@storybook/test 0.0.0-pr-24225-sha-d42b137f → 0.0.0-pr-23888-sha-8657c59a
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +591 -3
- package/dist/index.js +58 -2
- package/dist/index.mjs +61 -7
- package/package.json +11 -9
package/dist/index.mjs
CHANGED
@@ -1,20 +1,74 @@
|
|
1
1
|
import { instrument } from '@storybook/instrumenter';
|
2
|
-
import * as spy from '@vitest/spy';
|
3
|
-
export * from '@vitest/spy';
|
4
2
|
import * as chai from 'chai';
|
5
|
-
import chai__default from 'chai';
|
3
|
+
import chai__default, { util } from 'chai';
|
6
4
|
import { FORCE_REMOUNT, STORY_RENDER_PHASE_CHANGED } from '@storybook/core-events';
|
7
5
|
import { addons } from '@storybook/preview-api';
|
8
|
-
import {
|
6
|
+
import { inspect as inspect$1 } from 'loupe';
|
9
7
|
import * as matchers from '@testing-library/jest-dom/matchers';
|
10
8
|
import { once } from '@storybook/client-logger';
|
11
9
|
import * as domTestingLibrary from '@testing-library/dom';
|
12
10
|
import _userEvent from '@testing-library/user-event';
|
13
11
|
import dedent from 'ts-dedent';
|
14
12
|
|
15
|
-
function createExpect(){chai.use(JestExtend),chai.use(JestChaiExpect),chai.use(JestAsymmetricMatchers);let expect4=(value,message)=>{let{assertionCalls}=getState(expect4);return setState({assertionCalls:assertionCalls+1,soft:!1},expect4),chai.expect(value,message)};Object.assign(expect4,chai.expect),expect4.getState=()=>getState(expect4),expect4.setState=state=>setState(state,expect4),expect4.extend=expects=>chai.expect.extend(expect4,expects),expect4.soft=(...args)=>{let assert2=expect4(...args);return expect4.setState({soft:!0}),assert2},expect4.unreachable=message=>{chai.assert.fail(`expected${message?` "${message}" `:" "}not to be reached`);};function assertions(expected){let errorGen=()=>new Error(`expected number of assertions to be ${expected}, but got ${expect4.getState().assertionCalls}`);"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(errorGen(),assertions),expect4.setState({expectedAssertionsNumber:expected,expectedAssertionsNumberErrorGen:errorGen});}function hasAssertions(){let error=new Error("expected any number of assertion, but got none");"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(error,hasAssertions),expect4.setState({isExpectingAssertions:!0,isExpectingAssertionsError:error});}return setState({assertionCalls:0,isExpectingAssertions:!1,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null},expect4),chai.util.addMethod(expect4,"assertions",assertions),chai.util.addMethod(expect4,"hasAssertions",hasAssertions),expect4.extend(matchers),expect4}var expect2=createExpect();Object.defineProperty(globalThis,GLOBAL_EXPECT,{value:expect2,writable:!0,configurable:!0});var testingLibrary=instrument({...domTestingLibrary},{intercept:(method,path)=>path[0]==="fireEvent"||method.startsWith("find")||method.startsWith("waitFor")});testingLibrary.screen=new Proxy(testingLibrary.screen,{get(target,prop,receiver){return once.warn(dedent`
|
13
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0, cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_ansi_styles=__commonJS({"../../node_modules/@vitest/utils/node_modules/ansi-styles/index.js"(exports,module){var wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`;function assembleStyles(){let codes=new Map,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};styles.color.gray=styles.color.blackBright,styles.bgColor.bgGray=styles.bgColor.bgBlackBright,styles.color.grey=styles.color.blackBright,styles.bgColor.bgGrey=styles.bgColor.bgBlackBright;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1});}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value:(red,green,blue)=>red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5),enumerable:!1},hexToRgb:{value:hex=>{let matches=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));if(!matches)return [0,0,0];let{colorString}=matches.groups;colorString.length===3&&(colorString=colorString.split("").map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return [integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1}}),styles}Object.defineProperty(module,"exports",{enumerable:!0,get:assembleStyles});}});var require_collections=__commonJS({"../../node_modules/@vitest/utils/node_modules/pretty-format/build/collections.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.printIteratorEntries=printIteratorEntries;exports.printIteratorValues=printIteratorValues;exports.printListItems=printListItems;exports.printObjectProperties=printObjectProperties;var getKeysOfEnumerableProperties=(object,compareKeys)=>{let rawKeys=Object.keys(object),keys2=compareKeys!==null?rawKeys.sort(compareKeys):rawKeys;return Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(object).forEach(symbol=>{Object.getOwnPropertyDescriptor(object,symbol).enumerable&&keys2.push(symbol);}),keys2};function printIteratorEntries(iterator,config,indentation,depth,refs,printer,separator=": "){let result="",width=0,current=iterator.next();if(!current.done){result+=config.spacingOuter;let indentationNext=indentation+config.indent;for(;!current.done;){if(result+=indentationNext,width++===config.maxWidth){result+="\u2026";break}let name=printer(current.value[0],config,indentationNext,depth,refs),value=printer(current.value[1],config,indentationNext,depth,refs);result+=name+separator+value,current=iterator.next(),current.done?config.min||(result+=","):result+=`,${config.spacingInner}`;}result+=config.spacingOuter+indentation;}return result}function printIteratorValues(iterator,config,indentation,depth,refs,printer){let result="",width=0,current=iterator.next();if(!current.done){result+=config.spacingOuter;let indentationNext=indentation+config.indent;for(;!current.done;){if(result+=indentationNext,width++===config.maxWidth){result+="\u2026";break}result+=printer(current.value,config,indentationNext,depth,refs),current=iterator.next(),current.done?config.min||(result+=","):result+=`,${config.spacingInner}`;}result+=config.spacingOuter+indentation;}return result}function printListItems(list,config,indentation,depth,refs,printer){let result="";if(list.length){result+=config.spacingOuter;let indentationNext=indentation+config.indent;for(let i2=0;i2<list.length;i2++){if(result+=indentationNext,i2===config.maxWidth){result+="\u2026";break}i2 in list&&(result+=printer(list[i2],config,indentationNext,depth,refs)),i2<list.length-1?result+=`,${config.spacingInner}`:config.min||(result+=",");}result+=config.spacingOuter+indentation;}return result}function printObjectProperties(val,config,indentation,depth,refs,printer){let result="",keys2=getKeysOfEnumerableProperties(val,config.compareKeys);if(keys2.length){result+=config.spacingOuter;let indentationNext=indentation+config.indent;for(let i2=0;i2<keys2.length;i2++){let key=keys2[i2],name=printer(key,config,indentationNext,depth,refs),value=printer(val[key],config,indentationNext,depth,refs);result+=`${indentationNext+name}: ${value}`,i2<keys2.length-1?result+=`,${config.spacingInner}`:config.min||(result+=",");}result+=config.spacingOuter+indentation;}return result}}});var require_AsymmetricMatcher=__commonJS({"../../node_modules/@vitest/utils/node_modules/pretty-format/build/plugins/AsymmetricMatcher.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.test=exports.serialize=exports.default=void 0;var _collections=require_collections(),Symbol2=globalThis["jest-symbol-do-not-touch"]||globalThis.Symbol,asymmetricMatcher=typeof Symbol2=="function"&&Symbol2.for?Symbol2.for("jest.asymmetricMatcher"):1267621,SPACE=" ",serialize=(val,config,indentation,depth,refs,printer)=>{let stringedValue=val.toString();if(stringedValue==="ArrayContaining"||stringedValue==="ArrayNotContaining")return ++depth>config.maxDepth?`[${stringedValue}]`:`${stringedValue+SPACE}[${(0, _collections.printListItems)(val.sample,config,indentation,depth,refs,printer)}]`;if(stringedValue==="ObjectContaining"||stringedValue==="ObjectNotContaining")return ++depth>config.maxDepth?`[${stringedValue}]`:`${stringedValue+SPACE}{${(0, _collections.printObjectProperties)(val.sample,config,indentation,depth,refs,printer)}}`;if(stringedValue==="StringMatching"||stringedValue==="StringNotMatching"||stringedValue==="StringContaining"||stringedValue==="StringNotContaining")return stringedValue+SPACE+printer(val.sample,config,indentation,depth,refs);if(typeof val.toAsymmetricMatcher!="function")throw new Error(`Asymmetric matcher ${val.constructor.name} does not implement toAsymmetricMatcher()`);return val.toAsymmetricMatcher()};exports.serialize=serialize;var test=val=>val&&val.$$typeof===asymmetricMatcher;exports.test=test;var plugin={serialize,test},_default=plugin;exports.default=_default;}});var require_DOMCollection=__commonJS({"../../node_modules/@vitest/utils/node_modules/pretty-format/build/plugins/DOMCollection.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.test=exports.serialize=exports.default=void 0;var _collections=require_collections(),SPACE=" ",OBJECT_NAMES=["DOMStringMap","NamedNodeMap"],ARRAY_REGEXP=/^(HTML\w*Collection|NodeList)$/,testName=name=>OBJECT_NAMES.indexOf(name)!==-1||ARRAY_REGEXP.test(name),test=val=>val&&val.constructor&&!!val.constructor.name&&testName(val.constructor.name);exports.test=test;var isNamedNodeMap=collection=>collection.constructor.name==="NamedNodeMap",serialize=(collection,config,indentation,depth,refs,printer)=>{let name=collection.constructor.name;return ++depth>config.maxDepth?`[${name}]`:(config.min?"":name+SPACE)+(OBJECT_NAMES.indexOf(name)!==-1?`{${(0, _collections.printObjectProperties)(isNamedNodeMap(collection)?Array.from(collection).reduce((props,attribute)=>(props[attribute.name]=attribute.value,props),{}):{...collection},config,indentation,depth,refs,printer)}}`:`[${(0, _collections.printListItems)(Array.from(collection),config,indentation,depth,refs,printer)}]`)};exports.serialize=serialize;var plugin={serialize,test},_default=plugin;exports.default=_default;}});var require_escapeHTML=__commonJS({"../../node_modules/@vitest/utils/node_modules/pretty-format/build/plugins/lib/escapeHTML.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.default=escapeHTML;function escapeHTML(str){return str.replace(/</g,"<").replace(/>/g,">")}}});var require_markup=__commonJS({"../../node_modules/@vitest/utils/node_modules/pretty-format/build/plugins/lib/markup.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.printText=exports.printProps=exports.printElementAsLeaf=exports.printElement=exports.printComment=exports.printChildren=void 0;var _escapeHTML=_interopRequireDefault(require_escapeHTML());function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var printProps=(keys2,props,config,indentation,depth,refs,printer)=>{let indentationNext=indentation+config.indent,colors=config.colors;return keys2.map(key=>{let value=props[key],printed=printer(value,config,indentationNext,depth,refs);return typeof value!="string"&&(printed.indexOf(`
|
14
|
+
`)!==-1&&(printed=config.spacingOuter+indentationNext+printed+config.spacingOuter+indentation),printed=`{${printed}}`),`${config.spacingInner+indentation+colors.prop.open+key+colors.prop.close}=${colors.value.open}${printed}${colors.value.close}`}).join("")};exports.printProps=printProps;var printChildren=(children,config,indentation,depth,refs,printer)=>children.map(child=>config.spacingOuter+indentation+(typeof child=="string"?printText(child,config):printer(child,config,indentation,depth,refs))).join("");exports.printChildren=printChildren;var printText=(text,config)=>{let contentColor=config.colors.content;return contentColor.open+(0, _escapeHTML.default)(text)+contentColor.close};exports.printText=printText;var printComment=(comment,config)=>{let commentColor=config.colors.comment;return `${commentColor.open}<!--${(0, _escapeHTML.default)(comment)}-->${commentColor.close}`};exports.printComment=printComment;var printElement=(type,printedProps,printedChildren,config,indentation)=>{let tagColor=config.colors.tag;return `${tagColor.open}<${type}${printedProps&&tagColor.close+printedProps+config.spacingOuter+indentation+tagColor.open}${printedChildren?`>${tagColor.close}${printedChildren}${config.spacingOuter}${indentation}${tagColor.open}</${type}`:`${printedProps&&!config.min?"":" "}/`}>${tagColor.close}`};exports.printElement=printElement;var printElementAsLeaf=(type,config)=>{let tagColor=config.colors.tag;return `${tagColor.open}<${type}${tagColor.close} \u2026${tagColor.open} />${tagColor.close}`};exports.printElementAsLeaf=printElementAsLeaf;}});var require_DOMElement=__commonJS({"../../node_modules/@vitest/utils/node_modules/pretty-format/build/plugins/DOMElement.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.test=exports.serialize=exports.default=void 0;var _markup=require_markup(),ELEMENT_NODE=1,TEXT_NODE=3,COMMENT_NODE=8,FRAGMENT_NODE=11,ELEMENT_REGEXP=/^((HTML|SVG)\w*)?Element$/,testHasAttribute=val=>{try{return typeof val.hasAttribute=="function"&&val.hasAttribute("is")}catch{return !1}},testNode=val=>{let constructorName=val.constructor.name,{nodeType,tagName}=val,isCustomElement=typeof tagName=="string"&&tagName.includes("-")||testHasAttribute(val);return nodeType===ELEMENT_NODE&&(ELEMENT_REGEXP.test(constructorName)||isCustomElement)||nodeType===TEXT_NODE&&constructorName==="Text"||nodeType===COMMENT_NODE&&constructorName==="Comment"||nodeType===FRAGMENT_NODE&&constructorName==="DocumentFragment"},test=val=>val?.constructor?.name&&testNode(val);exports.test=test;function nodeIsText(node){return node.nodeType===TEXT_NODE}function nodeIsComment(node){return node.nodeType===COMMENT_NODE}function nodeIsFragment(node){return node.nodeType===FRAGMENT_NODE}var serialize=(node,config,indentation,depth,refs,printer)=>{if(nodeIsText(node))return (0, _markup.printText)(node.data,config);if(nodeIsComment(node))return (0, _markup.printComment)(node.data,config);let type=nodeIsFragment(node)?"DocumentFragment":node.tagName.toLowerCase();return ++depth>config.maxDepth?(0, _markup.printElementAsLeaf)(type,config):(0, _markup.printElement)(type,(0, _markup.printProps)(nodeIsFragment(node)?[]:Array.from(node.attributes).map(attr=>attr.name).sort(),nodeIsFragment(node)?{}:Array.from(node.attributes).reduce((props,attribute)=>(props[attribute.name]=attribute.value,props),{}),config,indentation+config.indent,depth,refs,printer),(0, _markup.printChildren)(Array.prototype.slice.call(node.childNodes||node.children),config,indentation+config.indent,depth,refs,printer),config,indentation)};exports.serialize=serialize;var plugin={serialize,test},_default=plugin;exports.default=_default;}});var require_Immutable=__commonJS({"../../node_modules/@vitest/utils/node_modules/pretty-format/build/plugins/Immutable.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.test=exports.serialize=exports.default=void 0;var _collections=require_collections(),IS_ITERABLE_SENTINEL="@@__IMMUTABLE_ITERABLE__@@",IS_LIST_SENTINEL="@@__IMMUTABLE_LIST__@@",IS_KEYED_SENTINEL2="@@__IMMUTABLE_KEYED__@@",IS_MAP_SENTINEL="@@__IMMUTABLE_MAP__@@",IS_ORDERED_SENTINEL2="@@__IMMUTABLE_ORDERED__@@",IS_RECORD_SENTINEL="@@__IMMUTABLE_RECORD__@@",IS_SEQ_SENTINEL="@@__IMMUTABLE_SEQ__@@",IS_SET_SENTINEL2="@@__IMMUTABLE_SET__@@",IS_STACK_SENTINEL="@@__IMMUTABLE_STACK__@@",getImmutableName=name=>`Immutable.${name}`,printAsLeaf=name=>`[${name}]`,SPACE=" ",LAZY="\u2026",printImmutableEntries=(val,config,indentation,depth,refs,printer,type)=>++depth>config.maxDepth?printAsLeaf(getImmutableName(type)):`${getImmutableName(type)+SPACE}{${(0, _collections.printIteratorEntries)(val.entries(),config,indentation,depth,refs,printer)}}`;function getRecordEntries(val){let i2=0;return {next(){if(i2<val._keys.length){let key=val._keys[i2++];return {done:!1,value:[key,val.get(key)]}}return {done:!0,value:void 0}}}}var printImmutableRecord=(val,config,indentation,depth,refs,printer)=>{let name=getImmutableName(val._name||"Record");return ++depth>config.maxDepth?printAsLeaf(name):`${name+SPACE}{${(0, _collections.printIteratorEntries)(getRecordEntries(val),config,indentation,depth,refs,printer)}}`},printImmutableSeq=(val,config,indentation,depth,refs,printer)=>{let name=getImmutableName("Seq");return ++depth>config.maxDepth?printAsLeaf(name):val[IS_KEYED_SENTINEL2]?`${name+SPACE}{${val._iter||val._object?(0, _collections.printIteratorEntries)(val.entries(),config,indentation,depth,refs,printer):LAZY}}`:`${name+SPACE}[${val._iter||val._array||val._collection||val._iterable?(0, _collections.printIteratorValues)(val.values(),config,indentation,depth,refs,printer):LAZY}]`},printImmutableValues=(val,config,indentation,depth,refs,printer,type)=>++depth>config.maxDepth?printAsLeaf(getImmutableName(type)):`${getImmutableName(type)+SPACE}[${(0, _collections.printIteratorValues)(val.values(),config,indentation,depth,refs,printer)}]`,serialize=(val,config,indentation,depth,refs,printer)=>val[IS_MAP_SENTINEL]?printImmutableEntries(val,config,indentation,depth,refs,printer,val[IS_ORDERED_SENTINEL2]?"OrderedMap":"Map"):val[IS_LIST_SENTINEL]?printImmutableValues(val,config,indentation,depth,refs,printer,"List"):val[IS_SET_SENTINEL2]?printImmutableValues(val,config,indentation,depth,refs,printer,val[IS_ORDERED_SENTINEL2]?"OrderedSet":"Set"):val[IS_STACK_SENTINEL]?printImmutableValues(val,config,indentation,depth,refs,printer,"Stack"):val[IS_SEQ_SENTINEL]?printImmutableSeq(val,config,indentation,depth,refs,printer):printImmutableRecord(val,config,indentation,depth,refs,printer);exports.serialize=serialize;var test=val=>val&&(val[IS_ITERABLE_SENTINEL]===!0||val[IS_RECORD_SENTINEL]===!0);exports.test=test;var plugin={serialize,test},_default=plugin;exports.default=_default;}});var require_react_is_development=__commonJS({"../../node_modules/@vitest/utils/node_modules/react-is/cjs/react-is.development.js"(exports){(function(){var REACT_ELEMENT_TYPE=Symbol.for("react.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_PROVIDER_TYPE=Symbol.for("react.provider"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_SERVER_CONTEXT_TYPE=Symbol.for("react.server_context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_SUSPENSE_LIST_TYPE=Symbol.for("react.suspense_list"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE=Symbol.for("react.lazy"),REACT_OFFSCREEN_TYPE=Symbol.for("react.offscreen"),enableScopeAPI=!1,enableCacheElement=!1,enableTransitionTracing=!1,enableLegacyHidden=!1,enableDebugTracing=!1,REACT_MODULE_REFERENCE;REACT_MODULE_REFERENCE=Symbol.for("react.module.reference");function isValidElementType(type){return !!(typeof type=="string"||typeof type=="function"||type===REACT_FRAGMENT_TYPE||type===REACT_PROFILER_TYPE||enableDebugTracing||type===REACT_STRICT_MODE_TYPE||type===REACT_SUSPENSE_TYPE||type===REACT_SUSPENSE_LIST_TYPE||enableLegacyHidden||type===REACT_OFFSCREEN_TYPE||enableScopeAPI||enableCacheElement||enableTransitionTracing||typeof type=="object"&&type!==null&&(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||type.$$typeof===REACT_MODULE_REFERENCE||type.getModuleId!==void 0))}function typeOf(object){if(typeof object=="object"&&object!==null){var $$typeof=object.$$typeof;switch($$typeof){case REACT_ELEMENT_TYPE:var type=object.type;switch(type){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:return type;default:var $$typeofType=type&&type.$$typeof;switch($$typeofType){case REACT_SERVER_CONTEXT_TYPE:case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:case REACT_PROVIDER_TYPE:return $$typeofType;default:return $$typeof}}case REACT_PORTAL_TYPE:return $$typeof}}}var ContextConsumer=REACT_CONTEXT_TYPE,ContextProvider=REACT_PROVIDER_TYPE,Element2=REACT_ELEMENT_TYPE,ForwardRef=REACT_FORWARD_REF_TYPE,Fragment=REACT_FRAGMENT_TYPE,Lazy=REACT_LAZY_TYPE,Memo=REACT_MEMO_TYPE,Portal=REACT_PORTAL_TYPE,Profiler=REACT_PROFILER_TYPE,StrictMode=REACT_STRICT_MODE_TYPE,Suspense=REACT_SUSPENSE_TYPE,SuspenseList=REACT_SUSPENSE_LIST_TYPE,hasWarnedAboutDeprecatedIsAsyncMode=!1,hasWarnedAboutDeprecatedIsConcurrentMode=!1;function isAsyncMode(object){return hasWarnedAboutDeprecatedIsAsyncMode||(hasWarnedAboutDeprecatedIsAsyncMode=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function isConcurrentMode(object){return hasWarnedAboutDeprecatedIsConcurrentMode||(hasWarnedAboutDeprecatedIsConcurrentMode=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function isContextConsumer(object){return typeOf(object)===REACT_CONTEXT_TYPE}function isContextProvider(object){return typeOf(object)===REACT_PROVIDER_TYPE}function isElement(object){return typeof object=="object"&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE}function isForwardRef(object){return typeOf(object)===REACT_FORWARD_REF_TYPE}function isFragment(object){return typeOf(object)===REACT_FRAGMENT_TYPE}function isLazy(object){return typeOf(object)===REACT_LAZY_TYPE}function isMemo(object){return typeOf(object)===REACT_MEMO_TYPE}function isPortal(object){return typeOf(object)===REACT_PORTAL_TYPE}function isProfiler(object){return typeOf(object)===REACT_PROFILER_TYPE}function isStrictMode(object){return typeOf(object)===REACT_STRICT_MODE_TYPE}function isSuspense(object){return typeOf(object)===REACT_SUSPENSE_TYPE}function isSuspenseList(object){return typeOf(object)===REACT_SUSPENSE_LIST_TYPE}exports.ContextConsumer=ContextConsumer,exports.ContextProvider=ContextProvider,exports.Element=Element2,exports.ForwardRef=ForwardRef,exports.Fragment=Fragment,exports.Lazy=Lazy,exports.Memo=Memo,exports.Portal=Portal,exports.Profiler=Profiler,exports.StrictMode=StrictMode,exports.Suspense=Suspense,exports.SuspenseList=SuspenseList,exports.isAsyncMode=isAsyncMode,exports.isConcurrentMode=isConcurrentMode,exports.isContextConsumer=isContextConsumer,exports.isContextProvider=isContextProvider,exports.isElement=isElement,exports.isForwardRef=isForwardRef,exports.isFragment=isFragment,exports.isLazy=isLazy,exports.isMemo=isMemo,exports.isPortal=isPortal,exports.isProfiler=isProfiler,exports.isStrictMode=isStrictMode,exports.isSuspense=isSuspense,exports.isSuspenseList=isSuspenseList,exports.isValidElementType=isValidElementType,exports.typeOf=typeOf;})();}});var require_react_is=__commonJS({"../../node_modules/@vitest/utils/node_modules/react-is/index.js"(exports,module){module.exports=require_react_is_development();}});var require_ReactElement=__commonJS({"../../node_modules/@vitest/utils/node_modules/pretty-format/build/plugins/ReactElement.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.test=exports.serialize=exports.default=void 0;var ReactIs=_interopRequireWildcard(require_react_is()),_markup=require_markup();function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!="function")return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return (_getRequireWildcardCache=function(nodeInterop2){return nodeInterop2?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(obj===null||typeof obj!="object"&&typeof obj!="function")return {default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key];}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}var getChildren=(arg,children=[])=>(Array.isArray(arg)?arg.forEach(item=>{getChildren(item,children);}):arg!=null&&arg!==!1&&children.push(arg),children),getType3=element=>{let type=element.type;if(typeof type=="string")return type;if(typeof type=="function")return type.displayName||type.name||"Unknown";if(ReactIs.isFragment(element))return "React.Fragment";if(ReactIs.isSuspense(element))return "React.Suspense";if(typeof type=="object"&&type!==null){if(ReactIs.isContextProvider(element))return "Context.Provider";if(ReactIs.isContextConsumer(element))return "Context.Consumer";if(ReactIs.isForwardRef(element)){if(type.displayName)return type.displayName;let functionName=type.render.displayName||type.render.name||"";return functionName!==""?`ForwardRef(${functionName})`:"ForwardRef"}if(ReactIs.isMemo(element)){let functionName=type.displayName||type.type.displayName||type.type.name||"";return functionName!==""?`Memo(${functionName})`:"Memo"}}return "UNDEFINED"},getPropKeys=element=>{let{props}=element;return Object.keys(props).filter(key=>key!=="children"&&props[key]!==void 0).sort()},serialize=(element,config,indentation,depth,refs,printer)=>++depth>config.maxDepth?(0, _markup.printElementAsLeaf)(getType3(element),config):(0, _markup.printElement)(getType3(element),(0, _markup.printProps)(getPropKeys(element),element.props,config,indentation+config.indent,depth,refs,printer),(0, _markup.printChildren)(getChildren(element.props.children),config,indentation+config.indent,depth,refs,printer),config,indentation);exports.serialize=serialize;var test=val=>val!=null&&ReactIs.isElement(val);exports.test=test;var plugin={serialize,test},_default=plugin;exports.default=_default;}});var require_ReactTestComponent=__commonJS({"../../node_modules/@vitest/utils/node_modules/pretty-format/build/plugins/ReactTestComponent.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.test=exports.serialize=exports.default=void 0;var _markup=require_markup(),Symbol2=globalThis["jest-symbol-do-not-touch"]||globalThis.Symbol,testSymbol=typeof Symbol2=="function"&&Symbol2.for?Symbol2.for("react.test.json"):245830487,getPropKeys=object=>{let{props}=object;return props?Object.keys(props).filter(key=>props[key]!==void 0).sort():[]},serialize=(object,config,indentation,depth,refs,printer)=>++depth>config.maxDepth?(0, _markup.printElementAsLeaf)(object.type,config):(0, _markup.printElement)(object.type,object.props?(0, _markup.printProps)(getPropKeys(object),object.props,config,indentation+config.indent,depth,refs,printer):"",object.children?(0, _markup.printChildren)(object.children,config,indentation+config.indent,depth,refs,printer):"",config,indentation);exports.serialize=serialize;var test=val=>val&&val.$$typeof===testSymbol;exports.test=test;var plugin={serialize,test},_default=plugin;exports.default=_default;}});var require_build=__commonJS({"../../node_modules/@vitest/utils/node_modules/pretty-format/build/index.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.default=exports.DEFAULT_OPTIONS=void 0;exports.format=format3;exports.plugins=void 0;var _ansiStyles=_interopRequireDefault(require_ansi_styles()),_collections=require_collections(),_AsymmetricMatcher=_interopRequireDefault(require_AsymmetricMatcher()),_DOMCollection=_interopRequireDefault(require_DOMCollection()),_DOMElement=_interopRequireDefault(require_DOMElement()),_Immutable=_interopRequireDefault(require_Immutable()),_ReactElement=_interopRequireDefault(require_ReactElement()),_ReactTestComponent=_interopRequireDefault(require_ReactTestComponent());function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var toString=Object.prototype.toString,toISOString=Date.prototype.toISOString,errorToString=Error.prototype.toString,regExpToString=RegExp.prototype.toString,getConstructorName=val=>typeof val.constructor=="function"&&val.constructor.name||"Object",isWindow=val=>typeof window<"u"&&val===window,SYMBOL_REGEXP=/^Symbol\((.*)\)(.*)$/,NEWLINE_REGEXP=/\n/gi,PrettyFormatPluginError=class extends Error{constructor(message,stack){super(message),this.stack=stack,this.name=this.constructor.name;}};function isToStringedArrayType(toStringed){return toStringed==="[object Array]"||toStringed==="[object ArrayBuffer]"||toStringed==="[object DataView]"||toStringed==="[object Float32Array]"||toStringed==="[object Float64Array]"||toStringed==="[object Int8Array]"||toStringed==="[object Int16Array]"||toStringed==="[object Int32Array]"||toStringed==="[object Uint8Array]"||toStringed==="[object Uint8ClampedArray]"||toStringed==="[object Uint16Array]"||toStringed==="[object Uint32Array]"}function printNumber(val){return Object.is(val,-0)?"-0":String(val)}function printBigInt(val){return `${val}n`}function printFunction(val,printFunctionName){return printFunctionName?`[Function ${val.name||"anonymous"}]`:"[Function]"}function printSymbol(val){return String(val).replace(SYMBOL_REGEXP,"Symbol($1)")}function printError(val){return `[${errorToString.call(val)}]`}function printBasicValue(val,printFunctionName,escapeRegex,escapeString){if(val===!0||val===!1)return `${val}`;if(val===void 0)return "undefined";if(val===null)return "null";let typeOf=typeof val;if(typeOf==="number")return printNumber(val);if(typeOf==="bigint")return printBigInt(val);if(typeOf==="string")return escapeString?`"${val.replace(/"|\\/g,"\\$&")}"`:`"${val}"`;if(typeOf==="function")return printFunction(val,printFunctionName);if(typeOf==="symbol")return printSymbol(val);let toStringed=toString.call(val);return toStringed==="[object WeakMap]"?"WeakMap {}":toStringed==="[object WeakSet]"?"WeakSet {}":toStringed==="[object Function]"||toStringed==="[object GeneratorFunction]"?printFunction(val,printFunctionName):toStringed==="[object Symbol]"?printSymbol(val):toStringed==="[object Date]"?isNaN(+val)?"Date { NaN }":toISOString.call(val):toStringed==="[object Error]"?printError(val):toStringed==="[object RegExp]"?escapeRegex?regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&"):regExpToString.call(val):val instanceof Error?printError(val):null}function printComplexValue(val,config,indentation,depth,refs,hasCalledToJSON){if(refs.indexOf(val)!==-1)return "[Circular]";refs=refs.slice(),refs.push(val);let hitMaxDepth=++depth>config.maxDepth,min=config.min;if(config.callToJSON&&!hitMaxDepth&&val.toJSON&&typeof val.toJSON=="function"&&!hasCalledToJSON)return printer(val.toJSON(),config,indentation,depth,refs,!0);let toStringed=toString.call(val);return toStringed==="[object Arguments]"?hitMaxDepth?"[Arguments]":`${min?"":"Arguments "}[${(0, _collections.printListItems)(val,config,indentation,depth,refs,printer)}]`:isToStringedArrayType(toStringed)?hitMaxDepth?`[${val.constructor.name}]`:`${min||!config.printBasicPrototype&&val.constructor.name==="Array"?"":`${val.constructor.name} `}[${(0, _collections.printListItems)(val,config,indentation,depth,refs,printer)}]`:toStringed==="[object Map]"?hitMaxDepth?"[Map]":`Map {${(0, _collections.printIteratorEntries)(val.entries(),config,indentation,depth,refs,printer," => ")}}`:toStringed==="[object Set]"?hitMaxDepth?"[Set]":`Set {${(0, _collections.printIteratorValues)(val.values(),config,indentation,depth,refs,printer)}}`:hitMaxDepth||isWindow(val)?`[${getConstructorName(val)}]`:`${min||!config.printBasicPrototype&&getConstructorName(val)==="Object"?"":`${getConstructorName(val)} `}{${(0, _collections.printObjectProperties)(val,config,indentation,depth,refs,printer)}}`}function isNewPlugin(plugin){return plugin.serialize!=null}function printPlugin(plugin,val,config,indentation,depth,refs){let printed;try{printed=isNewPlugin(plugin)?plugin.serialize(val,config,indentation,depth,refs,printer):plugin.print(val,valChild=>printer(valChild,config,indentation,depth,refs),str=>{let indentationNext=indentation+config.indent;return indentationNext+str.replace(NEWLINE_REGEXP,`
|
15
|
+
${indentationNext}`)},{edgeSpacing:config.spacingOuter,min:config.min,spacing:config.spacingInner},config.colors);}catch(error){throw new PrettyFormatPluginError(error.message,error.stack)}if(typeof printed!="string")throw new Error(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);return printed}function findPlugin(plugins4,val){for(let p=0;p<plugins4.length;p++)try{if(plugins4[p].test(val))return plugins4[p]}catch(error){throw new PrettyFormatPluginError(error.message,error.stack)}return null}function printer(val,config,indentation,depth,refs,hasCalledToJSON){let plugin=findPlugin(config.plugins,val);if(plugin!==null)return printPlugin(plugin,val,config,indentation,depth,refs);let basicResult=printBasicValue(val,config.printFunctionName,config.escapeRegex,config.escapeString);return basicResult!==null?basicResult:printComplexValue(val,config,indentation,depth,refs,hasCalledToJSON)}var DEFAULT_THEME={comment:"gray",content:"reset",prop:"yellow",tag:"cyan",value:"green"},DEFAULT_THEME_KEYS=Object.keys(DEFAULT_THEME),toOptionsSubtype=options=>options,DEFAULT_OPTIONS=toOptionsSubtype({callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:1/0,maxWidth:1/0,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,theme:DEFAULT_THEME});exports.DEFAULT_OPTIONS=DEFAULT_OPTIONS;function validateOptions(options){if(Object.keys(options).forEach(key=>{if(!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS,key))throw new Error(`pretty-format: Unknown option "${key}".`)}),options.min&&options.indent!==void 0&&options.indent!==0)throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');if(options.theme!==void 0){if(options.theme===null)throw new Error('pretty-format: Option "theme" must not be null.');if(typeof options.theme!="object")throw new Error(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof options.theme}".`)}}var getColorsHighlight=options=>DEFAULT_THEME_KEYS.reduce((colors,key)=>{let value=options.theme&&options.theme[key]!==void 0?options.theme[key]:DEFAULT_THEME[key],color=value&&_ansiStyles.default[value];if(color&&typeof color.close=="string"&&typeof color.open=="string")colors[key]=color;else throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);return colors},Object.create(null)),getColorsEmpty=()=>DEFAULT_THEME_KEYS.reduce((colors,key)=>(colors[key]={close:"",open:""},colors),Object.create(null)),getPrintFunctionName=options=>options?.printFunctionName??DEFAULT_OPTIONS.printFunctionName,getEscapeRegex=options=>options?.escapeRegex??DEFAULT_OPTIONS.escapeRegex,getEscapeString=options=>options?.escapeString??DEFAULT_OPTIONS.escapeString,getConfig2=options=>({callToJSON:options?.callToJSON??DEFAULT_OPTIONS.callToJSON,colors:options?.highlight?getColorsHighlight(options):getColorsEmpty(),compareKeys:typeof options?.compareKeys=="function"||options?.compareKeys===null?options.compareKeys:DEFAULT_OPTIONS.compareKeys,escapeRegex:getEscapeRegex(options),escapeString:getEscapeString(options),indent:options?.min?"":createIndent(options?.indent??DEFAULT_OPTIONS.indent),maxDepth:options?.maxDepth??DEFAULT_OPTIONS.maxDepth,maxWidth:options?.maxWidth??DEFAULT_OPTIONS.maxWidth,min:options?.min??DEFAULT_OPTIONS.min,plugins:options?.plugins??DEFAULT_OPTIONS.plugins,printBasicPrototype:options?.printBasicPrototype??!0,printFunctionName:getPrintFunctionName(options),spacingInner:options?.min?" ":`
|
16
|
+
`,spacingOuter:options?.min?"":`
|
17
|
+
`});function createIndent(indent){return new Array(indent+1).join(" ")}function format3(val,options){if(options&&(validateOptions(options),options.plugins)){let plugin=findPlugin(options.plugins,val);if(plugin!==null)return printPlugin(plugin,val,getConfig2(options),"",0,[])}let basicResult=printBasicValue(val,getPrintFunctionName(options),getEscapeRegex(options),getEscapeString(options));return basicResult!==null?basicResult:printComplexValue(val,getConfig2(options),"",0,[])}var plugins3={AsymmetricMatcher:_AsymmetricMatcher.default,DOMCollection:_DOMCollection.default,DOMElement:_DOMElement.default,Immutable:_Immutable.default,ReactElement:_ReactElement.default,ReactTestComponent:_ReactTestComponent.default};exports.plugins=plugins3;var _default=format3;exports.default=_default;}});var require_build2=__commonJS({"../../node_modules/diff-sequences/build/index.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.default=diffSequence;var pkg="diff-sequences",NOT_YET_SET=0,countCommonItemsF=(aIndex,aEnd,bIndex,bEnd,isCommon)=>{let nCommon=0;for(;aIndex<aEnd&&bIndex<bEnd&&isCommon(aIndex,bIndex);)aIndex+=1,bIndex+=1,nCommon+=1;return nCommon},countCommonItemsR=(aStart,aIndex,bStart,bIndex,isCommon)=>{let nCommon=0;for(;aStart<=aIndex&&bStart<=bIndex&&isCommon(aIndex,bIndex);)aIndex-=1,bIndex-=1,nCommon+=1;return nCommon},extendPathsF=(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF)=>{let iF=0,kF=-d,aFirst=aIndexesF[iF],aIndexPrev1=aFirst;aIndexesF[iF]+=countCommonItemsF(aFirst+1,aEnd,bF+aFirst-kF+1,bEnd,isCommon);let nF=d<iMaxF?d:iMaxF;for(iF+=1,kF+=2;iF<=nF;iF+=1,kF+=2){if(iF!==d&&aIndexPrev1<aIndexesF[iF])aFirst=aIndexesF[iF];else if(aFirst=aIndexPrev1+1,aEnd<=aFirst)return iF-1;aIndexPrev1=aIndexesF[iF],aIndexesF[iF]=aFirst+countCommonItemsF(aFirst+1,aEnd,bF+aFirst-kF+1,bEnd,isCommon);}return iMaxF},extendPathsR=(d,aStart,bStart,bR,isCommon,aIndexesR,iMaxR)=>{let iR=0,kR=d,aFirst=aIndexesR[iR],aIndexPrev1=aFirst;aIndexesR[iR]-=countCommonItemsR(aStart,aFirst-1,bStart,bR+aFirst-kR-1,isCommon);let nR=d<iMaxR?d:iMaxR;for(iR+=1,kR-=2;iR<=nR;iR+=1,kR-=2){if(iR!==d&&aIndexesR[iR]<aIndexPrev1)aFirst=aIndexesR[iR];else if(aFirst=aIndexPrev1-1,aFirst<aStart)return iR-1;aIndexPrev1=aIndexesR[iR],aIndexesR[iR]=aFirst-countCommonItemsR(aStart,aFirst-1,bStart,bR+aFirst-kR-1,isCommon);}return iMaxR},extendOverlappablePathsF=(d,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,iMaxF,aIndexesR,iMaxR,division)=>{let bF=bStart-aStart,aLength=aEnd-aStart,baDeltaLength=bEnd-bStart-aLength,kMinOverlapF=-baDeltaLength-(d-1),kMaxOverlapF=-baDeltaLength+(d-1),aIndexPrev1=NOT_YET_SET,nF=d<iMaxF?d:iMaxF;for(let iF=0,kF=-d;iF<=nF;iF+=1,kF+=2){let insert=iF===0||iF!==d&&aIndexPrev1<aIndexesF[iF],aLastPrev=insert?aIndexesF[iF]:aIndexPrev1,aFirst=insert?aLastPrev:aLastPrev+1,bFirst=bF+aFirst-kF,nCommonF=countCommonItemsF(aFirst+1,aEnd,bFirst+1,bEnd,isCommon),aLast=aFirst+nCommonF;if(aIndexPrev1=aIndexesF[iF],aIndexesF[iF]=aLast,kMinOverlapF<=kF&&kF<=kMaxOverlapF){let iR=(d-1-(kF+baDeltaLength))/2;if(iR<=iMaxR&&aIndexesR[iR]-1<=aLast){let bLastPrev=bF+aLastPrev-(insert?kF+1:kF-1),nCommonR=countCommonItemsR(aStart,aLastPrev,bStart,bLastPrev,isCommon),aIndexPrevFirst=aLastPrev-nCommonR,bIndexPrevFirst=bLastPrev-nCommonR,aEndPreceding=aIndexPrevFirst+1,bEndPreceding=bIndexPrevFirst+1;division.nChangePreceding=d-1,d-1===aEndPreceding+bEndPreceding-aStart-bStart?(division.aEndPreceding=aStart,division.bEndPreceding=bStart):(division.aEndPreceding=aEndPreceding,division.bEndPreceding=bEndPreceding),division.nCommonPreceding=nCommonR,nCommonR!==0&&(division.aCommonPreceding=aEndPreceding,division.bCommonPreceding=bEndPreceding),division.nCommonFollowing=nCommonF,nCommonF!==0&&(division.aCommonFollowing=aFirst+1,division.bCommonFollowing=bFirst+1);let aStartFollowing=aLast+1,bStartFollowing=bFirst+nCommonF+1;return division.nChangeFollowing=d-1,d-1===aEnd+bEnd-aStartFollowing-bStartFollowing?(division.aStartFollowing=aEnd,division.bStartFollowing=bEnd):(division.aStartFollowing=aStartFollowing,division.bStartFollowing=bStartFollowing),!0}}}return !1},extendOverlappablePathsR=(d,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,iMaxF,aIndexesR,iMaxR,division)=>{let bR=bEnd-aEnd,aLength=aEnd-aStart,baDeltaLength=bEnd-bStart-aLength,kMinOverlapR=baDeltaLength-d,kMaxOverlapR=baDeltaLength+d,aIndexPrev1=NOT_YET_SET,nR=d<iMaxR?d:iMaxR;for(let iR=0,kR=d;iR<=nR;iR+=1,kR-=2){let insert=iR===0||iR!==d&&aIndexesR[iR]<aIndexPrev1,aLastPrev=insert?aIndexesR[iR]:aIndexPrev1,aFirst=insert?aLastPrev:aLastPrev-1,bFirst=bR+aFirst-kR,nCommonR=countCommonItemsR(aStart,aFirst-1,bStart,bFirst-1,isCommon),aLast=aFirst-nCommonR;if(aIndexPrev1=aIndexesR[iR],aIndexesR[iR]=aLast,kMinOverlapR<=kR&&kR<=kMaxOverlapR){let iF=(d+(kR-baDeltaLength))/2;if(iF<=iMaxF&&aLast-1<=aIndexesF[iF]){let bLast=bFirst-nCommonR;if(division.nChangePreceding=d,d===aLast+bLast-aStart-bStart?(division.aEndPreceding=aStart,division.bEndPreceding=bStart):(division.aEndPreceding=aLast,division.bEndPreceding=bLast),division.nCommonPreceding=nCommonR,nCommonR!==0&&(division.aCommonPreceding=aLast,division.bCommonPreceding=bLast),division.nChangeFollowing=d-1,d===1)division.nCommonFollowing=0,division.aStartFollowing=aEnd,division.bStartFollowing=bEnd;else {let bLastPrev=bR+aLastPrev-(insert?kR-1:kR+1),nCommonF=countCommonItemsF(aLastPrev,aEnd,bLastPrev,bEnd,isCommon);division.nCommonFollowing=nCommonF,nCommonF!==0&&(division.aCommonFollowing=aLastPrev,division.bCommonFollowing=bLastPrev);let aStartFollowing=aLastPrev+nCommonF,bStartFollowing=bLastPrev+nCommonF;d-1===aEnd+bEnd-aStartFollowing-bStartFollowing?(division.aStartFollowing=aEnd,division.bStartFollowing=bEnd):(division.aStartFollowing=aStartFollowing,division.bStartFollowing=bStartFollowing);}return !0}}}return !1},divide=(nChange,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,aIndexesR,division)=>{let bF=bStart-aStart,bR=bEnd-aEnd,aLength=aEnd-aStart,bLength=bEnd-bStart,baDeltaLength=bLength-aLength,iMaxF=aLength,iMaxR=aLength;if(aIndexesF[0]=aStart-1,aIndexesR[0]=aEnd,baDeltaLength%2===0){let dMin=(nChange||baDeltaLength)/2,dMax=(aLength+bLength)/2;for(let d=1;d<=dMax;d+=1)if(iMaxF=extendPathsF(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF),d<dMin)iMaxR=extendPathsR(d,aStart,bStart,bR,isCommon,aIndexesR,iMaxR);else if(extendOverlappablePathsR(d,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,iMaxF,aIndexesR,iMaxR,division))return}else {let dMin=((nChange||baDeltaLength)+1)/2,dMax=(aLength+bLength+1)/2,d=1;for(iMaxF=extendPathsF(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF),d+=1;d<=dMax;d+=1)if(iMaxR=extendPathsR(d-1,aStart,bStart,bR,isCommon,aIndexesR,iMaxR),d<dMin)iMaxF=extendPathsF(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF);else if(extendOverlappablePathsF(d,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,iMaxF,aIndexesR,iMaxR,division))return}throw new Error(`${pkg}: no overlap aStart=${aStart} aEnd=${aEnd} bStart=${bStart} bEnd=${bEnd}`)},findSubsequences=(nChange,aStart,aEnd,bStart,bEnd,transposed,callbacks,aIndexesF,aIndexesR,division)=>{if(bEnd-bStart<aEnd-aStart){if(transposed=!transposed,transposed&&callbacks.length===1){let{foundSubsequence:foundSubsequence2,isCommon:isCommon2}=callbacks[0];callbacks[1]={foundSubsequence:(nCommon,bCommon,aCommon)=>{foundSubsequence2(nCommon,aCommon,bCommon);},isCommon:(bIndex,aIndex)=>isCommon2(aIndex,bIndex)};}let tStart=aStart,tEnd=aEnd;aStart=bStart,aEnd=bEnd,bStart=tStart,bEnd=tEnd;}let{foundSubsequence,isCommon}=callbacks[transposed?1:0];divide(nChange,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,aIndexesR,division);let{nChangePreceding,aEndPreceding,bEndPreceding,nCommonPreceding,aCommonPreceding,bCommonPreceding,nCommonFollowing,aCommonFollowing,bCommonFollowing,nChangeFollowing,aStartFollowing,bStartFollowing}=division;aStart<aEndPreceding&&bStart<bEndPreceding&&findSubsequences(nChangePreceding,aStart,aEndPreceding,bStart,bEndPreceding,transposed,callbacks,aIndexesF,aIndexesR,division),nCommonPreceding!==0&&foundSubsequence(nCommonPreceding,aCommonPreceding,bCommonPreceding),nCommonFollowing!==0&&foundSubsequence(nCommonFollowing,aCommonFollowing,bCommonFollowing),aStartFollowing<aEnd&&bStartFollowing<bEnd&&findSubsequences(nChangeFollowing,aStartFollowing,aEnd,bStartFollowing,bEnd,transposed,callbacks,aIndexesF,aIndexesR,division);},validateLength=(name,arg)=>{if(typeof arg!="number")throw new TypeError(`${pkg}: ${name} typeof ${typeof arg} is not a number`);if(!Number.isSafeInteger(arg))throw new RangeError(`${pkg}: ${name} value ${arg} is not a safe integer`);if(arg<0)throw new RangeError(`${pkg}: ${name} value ${arg} is a negative integer`)},validateCallback=(name,arg)=>{let type=typeof arg;if(type!=="function")throw new TypeError(`${pkg}: ${name} typeof ${type} is not a function`)};function diffSequence(aLength,bLength,isCommon,foundSubsequence){validateLength("aLength",aLength),validateLength("bLength",bLength),validateCallback("isCommon",isCommon),validateCallback("foundSubsequence",foundSubsequence);let nCommonF=countCommonItemsF(0,aLength,0,bLength,isCommon);if(nCommonF!==0&&foundSubsequence(nCommonF,0,0),aLength!==nCommonF||bLength!==nCommonF){let aStart=nCommonF,bStart=nCommonF,nCommonR=countCommonItemsR(aStart,aLength-1,bStart,bLength-1,isCommon),aEnd=aLength-nCommonR,bEnd=bLength-nCommonR,nCommonFR=nCommonF+nCommonR;aLength!==nCommonFR&&bLength!==nCommonFR&&findSubsequences(0,aStart,aEnd,bStart,bEnd,!1,[{foundSubsequence,isCommon}],[NOT_YET_SET],[NOT_YET_SET],{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}),nCommonR!==0&&foundSubsequence(nCommonR,aEnd,bEnd);}}}});function g(e,t){if(!e)throw new Error(t)}function i(e,t){return typeof t===e}function b(e){return e instanceof Promise}function f(e,t,r){Object.defineProperty(e,t,r);}function l(e,t,r){Object.defineProperty(e,t,{value:r});}var y=Symbol.for("tinyspy:spy"),m=new Set,M=e=>{e.called=!1,e.callCount=0,e.calls=[],e.results=[];},C=e=>(f(e,y,{value:{reset:()=>M(e[y])}}),e[y]),A=e=>e[y]||C(e);function I(e){g(i("function",e)||i("undefined",e),"cannot spy on a non-function value");let t=function(...o){let n=A(t);if(n.called=!0,n.callCount++,n.calls.push(o),n.next){let[p,s]=n.next;if(n.results.push(n.next),n.next=null,p==="ok")return s;throw s}let a,d="ok";if(n.impl)try{a=n.impl.apply(this,o),d="ok";}catch(p){throw a=p,d="error",n.results.push([d,p]),p}let u=[d,a];if(b(a)){let p=a.then(s=>u[1]=s).catch(s=>{throw u[0]="error",u[1]=s,s});Object.assign(p,a),a=p;}return n.results.push(u),a};l(t,"_isMockFunction",!0),l(t,"length",e?e.length:0),l(t,"name",e&&e.name||"spy");let r=A(t);return r.reset(),r.impl=e,t}var P=(e,t)=>Object.getOwnPropertyDescriptor(e,t);function E(e,t,r){g(!i("undefined",e),"spyOn could not find an object to spy upon"),g(i("object",e)||i("function",e),"cannot spyOn on a primitive value");let o=()=>{if(!i("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")},[n,a]=o(),d=P(e,n),u=Object.getPrototypeOf(e),p=u&&P(u,n),s=d||p;g(s||n in e,`${String(n)} does not exist`);let w=!1;a==="value"&&s&&!s.value&&s.get&&(a="get",w=!0,r=s.get());let c;s?c=s[a]:a!=="value"?c=()=>e[n]:c=e[n],r||(r=c);let x=I(r),O=h=>{let{value:G,...k}=s||{configurable:!0,writable:!0};a!=="value"&&delete k.writable,k[a]=h,f(e,n,k);},K=()=>s?f(e,n,s):O(c),T=x[y];return l(T,"restore",K),l(T,"getOriginal",()=>w?c():c),l(T,"willCall",h=>(T.impl=h,x)),O(w?()=>x:x),m.add(x),x}var spies=new Set;function isMockFunction(fn2){return typeof fn2=="function"&&"_isMockFunction"in fn2&&fn2._isMockFunction}function spyOn(obj,method,accessType){let objMethod=accessType?{[{get:"getter",set:"setter"}[accessType]]:method}:method,stub=E(obj,objMethod);return enhanceSpy(stub)}var callOrder=0;function enhanceSpy(spy){let stub=spy,implementation,instances=[],invocations=[],state=A(spy),mockContext={get calls(){return state.calls},get instances(){return instances},get invocationCallOrder(){return invocations},get results(){return state.results.map(([callType,value])=>({type:callType==="error"?"throw":"return",value}))},get lastCall(){return state.calls[state.calls.length-1]}},onceImplementations=[],implementationChangedTemporarily=!1;function mockCall(...args){return instances.push(this),invocations.push(++callOrder),(implementationChangedTemporarily?implementation:onceImplementations.shift()||implementation||state.getOriginal()||(()=>{})).apply(this,args)}let name=stub.name;stub.getMockName=()=>name||"vi.fn()",stub.mockName=n=>(name=n,stub),stub.mockClear=()=>(state.reset(),instances=[],invocations=[],stub),stub.mockReset=()=>(stub.mockClear(),implementation=()=>{},onceImplementations=[],stub),stub.mockRestore=()=>(stub.mockReset(),state.restore(),implementation=void 0,stub),stub.getMockImplementation=()=>implementation,stub.mockImplementation=fn2=>(implementation=fn2,state.willCall(mockCall),stub),stub.mockImplementationOnce=fn2=>(onceImplementations.push(fn2),stub);function withImplementation(fn2,cb){let originalImplementation=implementation;implementation=fn2,state.willCall(mockCall),implementationChangedTemporarily=!0;let reset=()=>{implementation=originalImplementation,implementationChangedTemporarily=!1;},result=cb();return result instanceof Promise?result.then(()=>(reset(),stub)):(reset(),stub)}return 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),spies.add(stub),stub}function fn(implementation){let enhancedSpy=enhanceSpy(E({spy:implementation||(()=>{})},"spy"));return implementation&&enhancedSpy.mockImplementation(implementation),enhancedSpy}function assertTypes(value,name,types){let receivedType=typeof value;if(!types.includes(receivedType))throw new TypeError(`${name} value must be ${types.join(" or ")}, received "${receivedType}"`)}function isObject(item){return item!=null&&typeof item=="object"&&!Array.isArray(item)}function isFinalObj(obj){return obj===Object.prototype||obj===Function.prototype||obj===RegExp.prototype}function getType(value){return Object.prototype.toString.apply(value).slice(8,-1)}function collectOwnProperties(obj,collector){let collect=typeof collector=="function"?collector:key=>collector.add(key);Object.getOwnPropertyNames(obj).forEach(collect),Object.getOwnPropertySymbols(obj).forEach(collect);}function getOwnProperties(obj){let ownProps=new Set;return isFinalObj(obj)?[]:(collectOwnProperties(obj,ownProps),Array.from(ownProps))}var defaultCloneOptions={forceWritable:!1};function deepClone(val,options=defaultCloneOptions){return clone(val,new WeakMap,options)}function clone(val,seen,options=defaultCloneOptions){let k,out;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){for(out=Array(k=val.length),seen.set(val,out);k--;)out[k]=clone(val[k],seen);return out}if(Object.prototype.toString.call(val)==="[object Object]"){out=Object.create(Object.getPrototypeOf(val)),seen.set(val,out);let props=getOwnProperties(val);for(let k2 of props){let descriptor=Object.getOwnPropertyDescriptor(val,k2);if(!descriptor)continue;let cloned=clone(val[k2],seen);"get"in descriptor?Object.defineProperty(out,k2,{...descriptor,get(){return cloned}}):Object.defineProperty(out,k2,{...descriptor,writable:options.forceWritable?!0:descriptor.writable,value:cloned});}return out}return val}var import_pretty_format=__toESM(require_build(),1);var{AsymmetricMatcher,DOMCollection,DOMElement,Immutable,ReactElement,ReactTestComponent}=import_pretty_format.plugins,PLUGINS=[ReactTestComponent,ReactElement,DOMElement,DOMCollection,Immutable,AsymmetricMatcher];function stringify(object,maxDepth=10,{maxLength,...options}={}){let MAX_LENGTH=maxLength??1e4,result;try{result=(0,import_pretty_format.format)(object,{maxDepth,escapeString:!1,plugins:PLUGINS,...options});}catch{result=(0, import_pretty_format.format)(object,{callToJSON:!1,maxDepth,escapeString:!1,plugins:PLUGINS,...options});}return result.length>=MAX_LENGTH&&maxDepth>1?stringify(object,Math.floor(maxDepth/2)):result}var formatRegExp=/%[sdjifoOcj%]/g;function format(...args){if(typeof args[0]!="string"){let objects=[];for(let i22=0;i22<args.length;i22++)objects.push(inspect(args[i22],{depth:0,colors:!1,compact:3}));return objects.join(" ")}let len=args.length,i2=1,template=args[0],str=String(template).replace(formatRegExp,x=>{if(x==="%%")return "%";if(i2>=len)return x;switch(x){case"%s":{let value=args[i2++];return typeof value=="bigint"?`${value.toString()}n`:typeof value=="number"&&value===0&&1/value<0?"-0":typeof value=="object"&&value!==null?inspect(value,{depth:0,colors:!1,compact:3}):String(value)}case"%d":{let value=args[i2++];return typeof value=="bigint"?`${value.toString()}n`:Number(value).toString()}case"%i":{let value=args[i2++];return typeof value=="bigint"?`${value.toString()}n`:Number.parseInt(String(value)).toString()}case"%f":return Number.parseFloat(String(args[i2++])).toString();case"%o":return inspect(args[i2++],{showHidden:!0,showProxy:!0});case"%O":return inspect(args[i2++]);case"%c":return i2++,"";case"%j":try{return JSON.stringify(args[i2++])}catch(err){let m2=err.message;if(m2.includes("circular structure")||m2.includes("cyclic structures")||m2.includes("cyclic object"))return "[Circular]";throw err}default:return x}});for(let x=args[i2];i2<len;x=args[++i2])x===null||typeof x!="object"?str+=` ${x}`:str+=` ${inspect(x)}`;return str}function inspect(obj,options={}){return options.truncate===0&&(options.truncate=Number.POSITIVE_INFINITY),inspect$1(obj,options)}var SAFE_COLORS_SYMBOL=Symbol("vitest:SAFE_COLORS"),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"]},colorsEntries=Object.entries(colorsMap);function string(str){return String(str)}string.open="";string.close="";var defaultColors=colorsEntries.reduce((acc,[key])=>(acc[key]=string,acc),{isColorSupported:!1});function getColors(){return globalThis[SAFE_COLORS_SYMBOL]||defaultColors}__toESM(require_build(),1);var import_pretty_format3=__toESM(require_build(),1),diff$1=__toESM(require_build2(),1);function getType2(value){if(value===void 0)return "undefined";if(value===null)return "null";if(Array.isArray(value))return "array";if(typeof value=="boolean")return "boolean";if(typeof value=="function")return "function";if(typeof value=="number")return "number";if(typeof value=="string")return "string";if(typeof value=="bigint")return "bigint";if(typeof value=="object"){if(value!=null){if(value.constructor===RegExp)return "regexp";if(value.constructor===Map)return "map";if(value.constructor===Set)return "set";if(value.constructor===Date)return "date"}return "object"}else if(typeof value=="symbol")return "symbol";throw new Error(`value of unknown type: ${value}`)}var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0,Diff=class{0;1;constructor(op,text){this[0]=op,this[1]=text;}};var NO_DIFF_MESSAGE="Compared values have no visual difference.",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){let iLength=diffs.length,nContextLines=options.contextLines,nContextLines2=nContextLines+nContextLines,jLength=iLength,hasExcessAtStartOrEnd=!1,nExcessesBetweenChanges=0,i2=0;for(;i2!==iLength;){let iStart=i2;for(;i2!==iLength&&diffs[i2][0]===DIFF_EQUAL;)i2+=1;if(iStart!==i2)if(iStart===0)i2>nContextLines&&(jLength-=i2-nContextLines,hasExcessAtStartOrEnd=!0);else if(i2===iLength){let n=i2-iStart;n>nContextLines&&(jLength-=n-nContextLines,hasExcessAtStartOrEnd=!0);}else {let n=i2-iStart;n>nContextLines2&&(jLength-=n-nContextLines2,nExcessesBetweenChanges+=1);}for(;i2!==iLength&&diffs[i2][0]!==DIFF_EQUAL;)i2+=1;}let hasPatch=nExcessesBetweenChanges!==0||hasExcessAtStartOrEnd;nExcessesBetweenChanges!==0?jLength+=nExcessesBetweenChanges+1:hasExcessAtStartOrEnd&&(jLength+=1);let jLast=jLength-1,lines=[],jPatchMark=0;hasPatch&&lines.push("");let aStart=0,bStart=0,aEnd=0,bEnd=0,pushCommonLine=line=>{let j=lines.length;lines.push(printCommonLine(line,j===0||j===jLast,options)),aEnd+=1,bEnd+=1;},pushDeleteLine=line=>{let j=lines.length;lines.push(printDeleteLine(line,j===0||j===jLast,options)),aEnd+=1;},pushInsertLine=line=>{let j=lines.length;lines.push(printInsertLine(line,j===0||j===jLast,options)),bEnd+=1;};for(i2=0;i2!==iLength;){let iStart=i2;for(;i2!==iLength&&diffs[i2][0]===DIFF_EQUAL;)i2+=1;if(iStart!==i2)if(iStart===0){i2>nContextLines&&(iStart=i2-nContextLines,aStart=iStart,bStart=iStart,aEnd=aStart,bEnd=bStart);for(let iCommon=iStart;iCommon!==i2;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else if(i2===iLength){let iEnd=i2-iStart>nContextLines?iStart+nContextLines:i2;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else {let nCommon=i2-iStart;if(nCommon>nContextLines2){let 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("");let nOmit=nCommon-nContextLines2;aStart=aEnd+nOmit,bStart=bEnd+nOmit,aEnd=aStart,bEnd=bStart;for(let iCommon=i2-nContextLines;iCommon!==i2;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else for(let iCommon=iStart;iCommon!==i2;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}for(;i2!==iLength&&diffs[i2][0]===DIFF_DELETE;)pushDeleteLine(diffs[i2][1]),i2+=1;for(;i2!==iLength&&diffs[i2][0]===DIFF_INSERT;)pushInsertLine(diffs[i2][1]),i2+=1;}return hasPatch&&(lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options)),lines.join(`
|
18
|
+
`)}function joinAlignedDiffsExpand(diffs,options){return diffs.map((diff2,i2,diffs2)=>{let line=diff2[1],isFirstOrLast=i2===0||i2===diffs2.length-1;switch(diff2[0]){case DIFF_DELETE:return printDeleteLine(line,isFirstOrLast,options);case DIFF_INSERT:return printInsertLine(line,isFirstOrLast,options);default:return printCommonLine(line,isFirstOrLast,options)}}).join(`
|
19
|
+
`)}var noColor=string2=>string2,DIFF_CONTEXT_DEFAULT=5;function getDefaultOptions(){let 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:!0,includeChangeCounts:!1,omitAnnotationLines:!1,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 {...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,b2=0;return diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:a+=1;break;case DIFF_INSERT:b2+=1;break}}),{a,b:b2}}function printAnnotation({aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator,includeChangeCounts,omitAnnotationLines},changeCounts){if(omitAnnotationLines)return "";let aRest="",bRest="";if(includeChangeCounts){let aCount=String(changeCounts.a),bCount=String(changeCounts.b),baAnnotationLengthDiff=bAnnotation.length-aAnnotation.length,aAnnotationPadding=" ".repeat(Math.max(0,baAnnotationLengthDiff)),bAnnotationPadding=" ".repeat(Math.max(0,-baAnnotationLengthDiff)),baCountLengthDiff=bCount.length-aCount.length,aCountPadding=" ".repeat(Math.max(0,baCountLengthDiff)),bCountPadding=" ".repeat(Math.max(0,-baCountLengthDiff));aRest=`${aAnnotationPadding} ${aIndicator} ${aCountPadding}${aCount}`,bRest=`${bAnnotationPadding} ${bIndicator} ${bCountPadding}${bCount}`;}let a=`${aIndicator} ${aAnnotation}${aRest}`,b2=`${bIndicator} ${bAnnotation}${bRest}`;return `${aColor(a)}
|
20
|
+
${bColor(b2)}
|
21
|
+
|
22
|
+
`}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=[]),isEmptyString(bLinesDisplay)&&isEmptyString(bLinesCompare)&&(bLinesDisplay=[],bLinesCompare=[]),aLinesDisplay.length!==aLinesCompare.length||bLinesDisplay.length!==bLinesCompare.length)return diffLinesUnified(aLinesDisplay,bLinesDisplay,options);let diffs=diffLinesRaw(aLinesCompare,bLinesCompare),aIndex=0,bIndex=0;return 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;}}),printDiffLines(diffs,normalizeDiffOptions(options))}function diffLinesRaw(aLines,bLines){let aLength=aLines.length,bLength=bLines.length,isCommon=(aIndex2,bIndex2)=>aLines[aIndex2]===bLines[bIndex2],diffs=[],aIndex=0,bIndex=0,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]));};for((diff$1.default.default||diff$1.default)(aLength,bLength,isCommon,foundSubsequence);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){let{commonColor}=normalizeDiffOptions(options);return commonColor(message)}var{AsymmetricMatcher:AsymmetricMatcher2,DOMCollection:DOMCollection2,DOMElement:DOMElement2,Immutable:Immutable2,ReactElement:ReactElement2,ReactTestComponent:ReactTestComponent2}=import_pretty_format3.plugins,PLUGINS2=[ReactTestComponent2,ReactElement2,DOMElement2,DOMCollection2,Immutable2,AsymmetricMatcher2],FORMAT_OPTIONS={plugins:PLUGINS2},FALLBACK_FORMAT_OPTIONS={callToJSON:!1,maxDepth:10,plugins:PLUGINS2};function diff(a,b2,options){if(Object.is(a,b2))return "";let aType=getType2(a),expectedType=aType,omitDifference=!1;if(aType==="object"&&typeof a.asymmetricMatch=="function"){if(a.$$typeof!==Symbol.for("jest.asymmetricMatcher")||typeof a.getExpectedType!="function")return null;expectedType=a.getExpectedType(),omitDifference=expectedType==="string";}if(expectedType!==getType2(b2)){let{aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator}=normalizeDiffOptions(options),formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options),aDisplay=(0, import_pretty_format3.format)(a,formatOptions),bDisplay=(0, import_pretty_format3.format)(b2,formatOptions),aDiff=`${aColor(`${aIndicator} ${aAnnotation}:`)}
|
23
|
+
${aDisplay}`,bDiff=`${bColor(`${bIndicator} ${bAnnotation}:`)}
|
24
|
+
${bDisplay}`;return `${aDiff}
|
25
|
+
|
26
|
+
${bDiff}`}if(omitDifference)return null;switch(aType){case"string":return diffLinesUnified(a.split(`
|
27
|
+
`),b2.split(`
|
28
|
+
`),options);case"boolean":case"number":return comparePrimitive(a,b2,options);case"map":return compareObjects(sortMap(a),sortMap(b2),options);case"set":return compareObjects(sortSet(a),sortSet(b2),options);default:return compareObjects(a,b2,options)}}function comparePrimitive(a,b2,options){let aFormat=(0, import_pretty_format3.format)(a,FORMAT_OPTIONS),bFormat=(0, import_pretty_format3.format)(b2,FORMAT_OPTIONS);return aFormat===bFormat?"":diffLinesUnified(aFormat.split(`
|
29
|
+
`),bFormat.split(`
|
30
|
+
`),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,b2,options){let difference,hasThrown=!1;try{let formatOptions=getFormatOptions(FORMAT_OPTIONS,options);difference=getObjectsDifference(a,b2,formatOptions,options);}catch{hasThrown=!0;}let noDiffMessage=getCommonMessage(NO_DIFF_MESSAGE,options);if(difference===void 0||difference===noDiffMessage){let formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);difference=getObjectsDifference(a,b2,formatOptions,options),difference!==noDiffMessage&&!hasThrown&&(difference=`${getCommonMessage(SIMILAR_MESSAGE,options)}
|
31
|
+
|
32
|
+
${difference}`);}return difference}function getFormatOptions(formatOptions,options){let{compareKeys}=normalizeDiffOptions(options);return {...formatOptions,compareKeys}}function getObjectsDifference(a,b2,formatOptions,options){let formatOptionsZeroIndent={...formatOptions,indent:0},aCompare=(0, import_pretty_format3.format)(a,formatOptionsZeroIndent),bCompare=(0, import_pretty_format3.format)(b2,formatOptionsZeroIndent);if(aCompare===bCompare)return getCommonMessage(NO_DIFF_MESSAGE,options);{let aDisplay=(0, import_pretty_format3.format)(a,formatOptions),bDisplay=(0, import_pretty_format3.format)(b2,formatOptions);return diffLinesUnified2(aDisplay.split(`
|
33
|
+
`),bDisplay.split(`
|
34
|
+
`),aCompare.split(`
|
35
|
+
`),bCompare.split(`
|
36
|
+
`),options)}}function isMockFunction2(fn2){return typeof fn2=="function"&&"_isMockFunction"in fn2&&fn2._isMockFunction}__toESM(require_build(),1);__toESM(require_build2(),1);var IS_RECORD_SYMBOL="@@__IMMUTABLE_RECORD__@@",IS_COLLECTION_SYMBOL="@@__IMMUTABLE_ITERABLE__@@";function isImmutable(v){return v&&(v[IS_COLLECTION_SYMBOL]||v[IS_RECORD_SYMBOL])}var OBJECT_PROTO=Object.getPrototypeOf({});function getUnserializableMessage(err){return err instanceof Error?`<unserializable>: ${err.message}`:typeof err=="string"?`<unserializable>: ${err}`:"<unserializable>"}function serializeError(val,seen=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<"u"&&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)){let clone2=new Array(val.length);return seen.set(val,clone2),val.forEach((e,i2)=>{try{clone2[i2]=serializeError(e,seen);}catch(err){clone2[i2]=getUnserializableMessage(err);}}),clone2}else {let clone2=Object.create(null);seen.set(val,clone2);let obj=val;for(;obj&&obj!==OBJECT_PROTO;)Object.getOwnPropertyNames(obj).forEach(key=>{if(!(key in clone2))try{clone2[key]=serializeError(val[key],seen);}catch(err){delete clone2[key],clone2[key]=getUnserializableMessage(err);}}),obj=Object.getPrototypeOf(obj);return clone2}}function normalizeErrorMessage(message){return message.replace(/__vite_ssr_import_\d+__\./g,"")}function processError(err,diffOptions){if(!err||typeof err!="object")return {message:err};if(err.stack&&(err.stackStr=String(err.stack)),err.name&&(err.nameStr=String(err.name)),err.showDiff||err.showDiff===void 0&&err.expected!==void 0&&err.actual!==void 0){let clonedActual=deepClone(err.actual,{forceWritable:!0}),clonedExpected=deepClone(err.expected,{forceWritable:!0}),{replacedActual,replacedExpected}=replaceAsymmetricMatcher(clonedActual,clonedExpected);err.diff=diff(replacedExpected,replacedActual,diffOptions);}typeof err.expected!="string"&&(err.expected=stringify(err.expected,10)),typeof err.actual!="string"&&(err.actual=stringify(err.actual,10));try{typeof err.message=="string"&&(err.message=normalizeErrorMessage(err.message)),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?.message}
|
37
|
+
Inner error message: ${err?.message}`))}}function isAsymmetricMatcher(data){return getType(data)==="Object"&&typeof data.asymmetricMatch=="function"}function isReplaceable(obj1,obj2){let obj1Type=getType(obj1),obj2Type=getType(obj2);return obj1Type===obj2Type&&obj1Type==="Object"}function replaceAsymmetricMatcher(actual,expected,actualReplaced=new WeakSet,expectedReplaced=new WeakSet){return isReplaceable(actual,expected)?actualReplaced.has(actual)||expectedReplaced.has(expected)?{replacedActual:actual,replacedExpected:expected}:(actualReplaced.add(actual),expectedReplaced.add(expected),getOwnProperties(expected).forEach(key=>{let expectedValue=expected[key],actualValue=actual[key];if(isAsymmetricMatcher(expectedValue))expectedValue.asymmetricMatch(actualValue)&&(actual[key]=expectedValue);else if(isAsymmetricMatcher(actualValue))actualValue.asymmetricMatch(expectedValue)&&(expected[key]=actualValue);else if(isReplaceable(actualValue,expectedValue)){let replaced=replaceAsymmetricMatcher(actualValue,expectedValue,actualReplaced,expectedReplaced);actual[key]=replaced.replacedActual,expected[key]=replaced.replacedExpected;}}),{replacedActual:actual,replacedExpected:expected}):{replacedActual:actual,replacedExpected:expected}}var MATCHERS_OBJECT=Symbol.for("matchers-object"),JEST_MATCHERS_OBJECT=Symbol.for("$$jest-matchers-object-storybook"),GLOBAL_EXPECT=Symbol.for("expect-global");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT)){let globalState=new WeakMap;Object.defineProperty(globalThis,MATCHERS_OBJECT,{get:()=>globalState});}if(!Object.prototype.hasOwnProperty.call(globalThis,JEST_MATCHERS_OBJECT)){let matchers2=Object.create(null);Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT,{configurable:!0,get:()=>({state:globalThis[MATCHERS_OBJECT].get(globalThis[GLOBAL_EXPECT]),matchers:matchers2})});}function getState(expect4){return globalThis[MATCHERS_OBJECT].get(expect4)}function setState(state,expect4){let map=globalThis[MATCHERS_OBJECT],current=map.get(expect4)||{};Object.assign(current,state),map.set(expect4,current);}function getMatcherUtils(){let c=()=>getColors(),EXPECTED_COLOR=c().green,RECEIVED_COLOR=c().red,INVERTED_COLOR=c().inverse,BOLD_WEIGHT=c().bold,DIM_COLOR=c().dim;function matcherHint(matcherName,received="received",expected="expected",options={}){let{comment="",isDirectExpectCall=!1,isNot=!1,promise="",secondArgument="",expectedColor=EXPECTED_COLOR,receivedColor=RECEIVED_COLOR,secondArgumentColor=EXPECTED_COLOR}=options,hint="",dimString="expect";return !isDirectExpectCall&&received!==""&&(hint+=DIM_COLOR(`${dimString}(`)+receivedColor(received),dimString=")"),promise!==""&&(hint+=DIM_COLOR(`${dimString}.`)+promise,dimString=""),isNot&&(hint+=`${DIM_COLOR(`${dimString}.`)}not`,dimString=""),matcherName.includes(".")?dimString+=matcherName:(hint+=DIM_COLOR(`${dimString}.`)+matcherName,dimString=""),expected===""?dimString+="()":(hint+=DIM_COLOR(`${dimString}(`)+expectedColor(expected),secondArgument&&(hint+=DIM_COLOR(", ")+secondArgumentColor(secondArgument)),dimString=")"),comment!==""&&(dimString+=` // ${comment}`),dimString!==""&&(hint+=DIM_COLOR(dimString)),hint}let SPACE_SYMBOL="\xB7",replaceTrailingSpaces=text=>text.replace(/\s+$/gm,spaces=>SPACE_SYMBOL.repeat(spaces.length));return {EXPECTED_COLOR,RECEIVED_COLOR,INVERTED_COLOR,BOLD_WEIGHT,DIM_COLOR,matcherHint,printReceived:object=>RECEIVED_COLOR(replaceTrailingSpaces(stringify(object))),printExpected:value=>EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)))}}function equals(a,b2,customTesters,strictCheck){return customTesters=customTesters||[],eq(a,b2,[],[],customTesters,strictCheck?hasKey:hasDefinedKey)}function isAsymmetric(obj){return !!obj&&typeof obj=="object"&&"asymmetricMatch"in obj&&isA("Function",obj.asymmetricMatch)}function asymmetricMatch(a,b2){let asymmetricA=isAsymmetric(a),asymmetricB=isAsymmetric(b2);if(!(asymmetricA&&asymmetricB)){if(asymmetricA)return a.asymmetricMatch(b2);if(asymmetricB)return b2.asymmetricMatch(a)}}function eq(a,b2,aStack,bStack,customTesters,hasKey2){let result=!0,asymmetricResult=asymmetricMatch(a,b2);if(asymmetricResult!==void 0)return asymmetricResult;for(let i2=0;i2<customTesters.length;i2++){let customTesterResult=customTesters[i2](a,b2);if(customTesterResult!==void 0)return customTesterResult}if(a instanceof Error&&b2 instanceof Error)return a.message===b2.message;if(Object.is(a,b2))return !0;if(a===null||b2===null)return a===b2;let className=Object.prototype.toString.call(a);if(className!==Object.prototype.toString.call(b2))return !1;switch(className){case"[object Boolean]":case"[object String]":case"[object Number]":return typeof a!=typeof b2?!1:typeof a!="object"&&typeof b2!="object"?Object.is(a,b2):Object.is(a.valueOf(),b2.valueOf());case"[object Date]":{let numA=+a,numB=+b2;return numA===numB||Number.isNaN(numA)&&Number.isNaN(numB)}case"[object RegExp]":return a.source===b2.source&&a.flags===b2.flags}if(typeof a!="object"||typeof b2!="object")return !1;if(isDomNode(a)&&isDomNode(b2))return a.isEqualNode(b2);let length=aStack.length;for(;length--;){if(aStack[length]===a)return bStack[length]===b2;if(bStack[length]===b2)return !1}if(aStack.push(a),bStack.push(b2),className==="[object Array]"&&a.length!==b2.length)return !1;let aKeys=keys(a,hasKey2),key,size=aKeys.length;if(keys(b2,hasKey2).length!==size)return !1;for(;size--;)if(key=aKeys[size],result=hasKey2(b2,key)&&eq(a[key],b2[key],aStack,bStack,customTesters,hasKey2),!result)return !1;return aStack.pop(),bStack.pop(),result}function keys(obj,hasKey2){let keys2=[];for(let key in obj)hasKey2(obj,key)&&keys2.push(key);return keys2.concat(Object.getOwnPropertySymbols(obj).filter(symbol=>Object.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"}var IS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@",IS_SET_SENTINEL="@@__IMMUTABLE_SET__@@",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])}var IteratorSymbol=Symbol.iterator;function hasIterator(object){return !!(object!=null&&object[IteratorSymbol])}function iterableEquality(a,b2,aStack=[],bStack=[]){if(typeof a!="object"||typeof b2!="object"||Array.isArray(a)||Array.isArray(b2)||!hasIterator(a)||!hasIterator(b2))return;if(a.constructor!==b2.constructor)return !1;let length=aStack.length;for(;length--;)if(aStack[length]===a)return bStack[length]===b2;aStack.push(a),bStack.push(b2);let iterableEqualityWithStack=(a2,b22)=>iterableEquality(a2,b22,[...aStack],[...bStack]);if(a.size!==void 0){if(a.size!==b2.size)return !1;if(isA("Set",a)||isImmutableUnorderedSet(a)){let allFound=!0;for(let aValue of a)if(!b2.has(aValue)){let has=!1;for(let bValue of b2)equals(aValue,bValue,[iterableEqualityWithStack])===!0&&(has=!0);if(has===!1){allFound=!1;break}}return aStack.pop(),bStack.pop(),allFound}else if(isA("Map",a)||isImmutableUnorderedKeyed(a)){let allFound=!0;for(let aEntry of a)if(!b2.has(aEntry[0])||!equals(aEntry[1],b2.get(aEntry[0]),[iterableEqualityWithStack])){let has=!1;for(let bEntry of b2){let matchedKey=equals(aEntry[0],bEntry[0],[iterableEqualityWithStack]),matchedValue=!1;matchedKey===!0&&(matchedValue=equals(aEntry[1],bEntry[1],[iterableEqualityWithStack])),matchedValue===!0&&(has=!0);}if(has===!1){allFound=!1;break}}return aStack.pop(),bStack.pop(),allFound}}let bIterator=b2[IteratorSymbol]();for(let aValue of a){let nextB=bIterator.next();if(nextB.done||!equals(aValue,nextB.value,[iterableEqualityWithStack]))return !1}return bIterator.next().done?(aStack.pop(),bStack.pop(),!0):!1}function hasPropertyInObject(object,key){return !object||typeof object!="object"||object===Object.prototype?!1:Object.prototype.hasOwnProperty.call(object,key)||hasPropertyInObject(Object.getPrototypeOf(object),key)}function isObjectWithKeys(a){return isObject(a)&&!(a instanceof Error)&&!Array.isArray(a)&&!(a instanceof Date)}function subsetEquality(object,subset){let subsetEqualityWithContext=(seenReferences=new WeakMap)=>(object2,subset2)=>{if(isObjectWithKeys(subset2))return Object.keys(subset2).every(key=>{if(isObjectWithKeys(subset2[key])){if(seenReferences.has(subset2[key]))return equals(object2[key],subset2[key],[iterableEquality]);seenReferences.set(subset2[key],!0);}let result=object2!=null&&hasPropertyInObject(object2,key)&&equals(object2[key],subset2[key],[iterableEquality,subsetEqualityWithContext(seenReferences)]);return seenReferences.delete(subset2[key]),result})};return subsetEqualityWithContext()(object,subset)}function typeEquality(a,b2){if(!(a==null||b2==null||a.constructor===b2.constructor))return !1}function arrayBufferEquality(a,b2){let dataViewA=a,dataViewB=b2;if(!(a instanceof DataView&&b2 instanceof DataView)){if(!(a instanceof ArrayBuffer)||!(b2 instanceof ArrayBuffer))return;try{dataViewA=new DataView(a),dataViewB=new DataView(b2);}catch{return}}if(dataViewA.byteLength!==dataViewB.byteLength)return !1;for(let i2=0;i2<dataViewA.byteLength;i2++)if(dataViewA.getUint8(i2)!==dataViewB.getUint8(i2))return !1;return !0}function sparseArrayEquality(a,b2){if(!Array.isArray(a)||!Array.isArray(b2))return;let aKeys=Object.keys(a),bKeys=Object.keys(b2);return equals(a,b2,[iterableEquality,typeEquality],!0)&&equals(aKeys,bKeys)}function generateToBeMessage(deepEqualityName,expected="#{this}",actual="#{exp}"){let toBeMessage=`expected ${expected} to be ${actual} // Object.is equality`;return ["toStrictEqual","toEqual"].includes(deepEqualityName)?`${toBeMessage}
|
38
|
+
|
39
|
+
If it should pass with deep equality, replace "toBe" with "${deepEqualityName}"
|
40
|
+
|
41
|
+
Expected: ${expected}
|
42
|
+
Received: serializes to the same string
|
43
|
+
`:toBeMessage}var AsymmetricMatcher3=class{constructor(sample,inverse=!1){this.sample=sample,this.inverse=inverse;}$$typeof=Symbol.for("jest.asymmetricMatcher");getMatcherContext(expect4){return {...getState(expect4||globalThis[GLOBAL_EXPECT]),equals,isNot:this.inverse,utils:{...getMatcherUtils(),diff,stringify,iterableEquality,subsetEquality}}}},StringContaining=class extends AsymmetricMatcher3{constructor(sample,inverse=!1){if(!isA("String",sample))throw new Error("Expected is not a string");super(sample,inverse);}asymmetricMatch(other){let result=isA("String",other)&&other.includes(this.sample);return this.inverse?!result:result}toString(){return `String${this.inverse?"Not":""}Containing`}getExpectedType(){return "string"}},Anything=class extends AsymmetricMatcher3{asymmetricMatch(other){return other!=null}toString(){return "Anything"}toAsymmetricMatcher(){return "Anything"}},ObjectContaining=class extends AsymmetricMatcher3{constructor(sample,inverse=!1){super(sample,inverse);}getPrototype(obj){return Object.getPrototypeOf?Object.getPrototypeOf(obj):obj.constructor.prototype===obj?null:obj.constructor.prototype}hasProperty(obj,property){return obj?Object.prototype.hasOwnProperty.call(obj,property)?!0:this.hasProperty(this.getPrototype(obj),property):!1}asymmetricMatch(other){if(typeof this.sample!="object")throw new TypeError(`You must provide an object to ${this.toString()}, not '${typeof this.sample}'.`);let result=!0;for(let property in this.sample)if(!this.hasProperty(other,property)||!equals(this.sample[property],other[property])){result=!1;break}return this.inverse?!result:result}toString(){return `Object${this.inverse?"Not":""}Containing`}getExpectedType(){return "object"}},ArrayContaining=class extends AsymmetricMatcher3{constructor(sample,inverse=!1){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}'.`);let result=this.sample.length===0||Array.isArray(other)&&this.sample.every(item=>other.some(another=>equals(item,another)));return this.inverse?!result:result}toString(){return `Array${this.inverse?"Not":""}Containing`}getExpectedType(){return "array"}},Any=class extends AsymmetricMatcher3{constructor(sample){if(typeof sample>"u")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;let matches=Function.prototype.toString.call(func).match(/^(?:async)?\s*function\s*\*?\s*([\w$]+)\s*\(/);return matches?matches[1]:"<anonymous>"}asymmetricMatch(other){return this.sample===String?typeof other=="string"||other instanceof String:this.sample===Number?typeof other=="number"||other instanceof Number:this.sample===Function?typeof other=="function"||other instanceof Function:this.sample===Boolean?typeof other=="boolean"||other instanceof Boolean:this.sample===BigInt?typeof other=="bigint"||other instanceof BigInt:this.sample===Symbol?typeof other=="symbol"||other instanceof Symbol:this.sample===Object?typeof other=="object":other instanceof this.sample}toString(){return "Any"}getExpectedType(){return this.sample===String?"string":this.sample===Number?"number":this.sample===Function?"function":this.sample===Object?"object":this.sample===Boolean?"boolean":this.fnNameFor(this.sample)}toAsymmetricMatcher(){return `Any<${this.fnNameFor(this.sample)}>`}},StringMatching=class extends AsymmetricMatcher3{constructor(sample,inverse=!1){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){let result=isA("String",other)&&this.sample.test(other);return this.inverse?!result:result}toString(){return `String${this.inverse?"Not":""}Matching`}getExpectedType(){return "string"}},JestAsymmetricMatchers=(chai3,utils)=>{utils.addMethod(chai3.expect,"anything",()=>new Anything),utils.addMethod(chai3.expect,"any",expected=>new Any(expected)),utils.addMethod(chai3.expect,"stringContaining",expected=>new StringContaining(expected)),utils.addMethod(chai3.expect,"objectContaining",expected=>new ObjectContaining(expected)),utils.addMethod(chai3.expect,"arrayContaining",expected=>new ArrayContaining(expected)),utils.addMethod(chai3.expect,"stringMatching",expected=>new StringMatching(expected)),chai3.expect.not={stringContaining:expected=>new StringContaining(expected,!0),objectContaining:expected=>new ObjectContaining(expected,!0),arrayContaining:expected=>new ArrayContaining(expected,!0),stringMatching:expected=>new StringMatching(expected,!0)};};function recordAsyncExpect(test,promise){return test&&promise instanceof Promise&&(promise=promise.finally(()=>{let index=test.promises.indexOf(promise);index!==-1&&test.promises.splice(index,1);}),test.promises||(test.promises=[]),test.promises.push(promise)),promise}function wrapSoft(utils,fn2){return function(...args){var _a;let test=utils.flag(this,"vitest-test");if(!(test?.context._local?test.context.expect.getState():getState(globalThis[GLOBAL_EXPECT])).soft)return fn2.apply(this,args);if(!test)throw new Error("expect.soft() can only be used inside a test");try{return fn2.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));}}}var JestChaiExpect=(chai3,utils)=>{let{AssertionError}=chai3,c=()=>getColors();function def(name,fn2){let addMethod=n=>{let softWrapper=wrapSoft(utils,fn2);utils.addMethod(chai3.Assertion.prototype,n,softWrapper),utils.addMethod(globalThis[JEST_MATCHERS_OBJECT].matchers,n,softWrapper);};Array.isArray(name)?name.forEach(n=>addMethod(n)):addMethod(name);}["throw","throws","Throw"].forEach(m2=>{utils.overwriteMethod(chai3.Assertion.prototype,m2,_super=>function(...args){let promise=utils.flag(this,"promise"),object=utils.flag(this,"object"),isNot=utils.flag(this,"negate");if(promise==="rejects")utils.flag(this,"object",()=>{throw object});else if(promise==="resolves"&&typeof object!="function"){if(isNot)return;{let message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't",error={showDiff:!1};throw new AssertionError(message,error,utils.flag(this,"ssfi"))}}_super.apply(this,args);});}),def("withTest",function(test){return utils.flag(this,"vitest-test",test),this}),def("toEqual",function(expected){let actual=utils.flag(this,"object"),equal=equals(actual,expected,[iterableEquality]);return this.assert(equal,"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",expected,actual)}),def("toStrictEqual",function(expected){let obj=utils.flag(this,"object"),equal=equals(obj,expected,[iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],!0);return this.assert(equal,"expected #{this} to strictly equal #{exp}","expected #{this} to not strictly equal #{exp}",expected,obj)}),def("toBe",function(expected){let actual=this._obj,pass=Object.is(actual,expected),deepEqualityName="";return pass||(equals(actual,expected,[iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],!0)?deepEqualityName="toStrictEqual":equals(actual,expected,[iterableEquality])&&(deepEqualityName="toEqual")),this.assert(pass,generateToBeMessage(deepEqualityName),"expected #{this} not to be #{exp} // Object.is equality",expected,actual)}),def("toMatchObject",function(expected){let actual=this._obj;return this.assert(equals(actual,expected,[iterableEquality,subsetEquality]),"expected #{this} to match object #{exp}","expected #{this} to not match object #{exp}",expected,actual)}),def("toMatch",function(expected){return typeof expected=="string"?this.include(expected):this.match(expected)}),def("toContain",function(item){return this.contain(item)}),def("toContainEqual",function(expected){let obj=utils.flag(this,"object"),index=Array.from(obj).findIndex(item=>equals(item,expected));this.assert(index!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",expected);}),def("toBeTruthy",function(){let obj=utils.flag(this,"object");this.assert(!!obj,"expected #{this} to be truthy","expected #{this} to not be truthy",obj,!1);}),def("toBeFalsy",function(){let obj=utils.flag(this,"object");this.assert(!obj,"expected #{this} to be falsy","expected #{this} to not be falsy",obj,!1);}),def("toBeGreaterThan",function(expected){let actual=this._obj;return assertTypes(actual,"actual",["number","bigint"]),assertTypes(expected,"expected",["number","bigint"]),this.assert(actual>expected,`expected ${actual} to be greater than ${expected}`,`expected ${actual} to be not greater than ${expected}`,actual,expected,!1)}),def("toBeGreaterThanOrEqual",function(expected){let actual=this._obj;return assertTypes(actual,"actual",["number","bigint"]),assertTypes(expected,"expected",["number","bigint"]),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,!1)}),def("toBeLessThan",function(expected){let actual=this._obj;return assertTypes(actual,"actual",["number","bigint"]),assertTypes(expected,"expected",["number","bigint"]),this.assert(actual<expected,`expected ${actual} to be less than ${expected}`,`expected ${actual} to be not less than ${expected}`,actual,expected,!1)}),def("toBeLessThanOrEqual",function(expected){let actual=this._obj;return assertTypes(actual,"actual",["number","bigint"]),assertTypes(expected,"expected",["number","bigint"]),this.assert(actual<=expected,`expected ${actual} to be less than or equal to ${expected}`,`expected ${actual} to be not less than or equal to ${expected}`,actual,expected,!1)}),def("toBeNaN",function(){return this.be.NaN}),def("toBeUndefined",function(){return this.be.undefined}),def("toBeNull",function(){return this.be.null}),def("toBeDefined",function(){let negate=utils.flag(this,"negate");return utils.flag(this,"negate",!1),negate?this.be.undefined:this.not.be.undefined}),def("toBeTypeOf",function(expected){let actual=typeof this._obj,equal=expected===actual;return this.assert(equal,"expected #{this} to be type of #{exp}","expected #{this} not to be type of #{exp}",expected,actual)}),def("toBeInstanceOf",function(obj){return this.instanceOf(obj)}),def("toHaveLength",function(length){return this.have.length(length)}),def("toHaveProperty",function(...args){Array.isArray(args[0])&&(args[0]=args[0].map(key=>String(key).replace(/([.[\]])/g,"\\$1")).join("."));let actual=this._obj,[propertyName,expected]=args,getValue=()=>Object.prototype.hasOwnProperty.call(actual,propertyName)?{value:actual[propertyName],exists:!0}:utils.getPathInfo(actual,propertyName),{value,exists}=getValue(),pass=exists&&(args.length===1||equals(expected,value)),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}`,actual)}),def("toBeCloseTo",function(received,precision=2){let expected=this._obj,pass=!1,expectedDiff=0,receivedDiff=0;return received===Number.POSITIVE_INFINITY&&expected===Number.POSITIVE_INFINITY||received===Number.NEGATIVE_INFINITY&&expected===Number.NEGATIVE_INFINITY?pass=!0:(expectedDiff=10**-precision/2,receivedDiff=Math.abs(expected-received),pass=receivedDiff<expectedDiff),this.assert(pass,`expected #{this} to be close to #{exp}, received difference is ${receivedDiff}, but expected ${expectedDiff}`,`expected #{this} to not be close to #{exp}, received difference is ${receivedDiff}, but expected ${expectedDiff}`,received,expected,!1)});let assertIsMock=assertion=>{if(!isMockFunction2(assertion._obj))throw new TypeError(`${utils.inspect(assertion._obj)} is not a spy or a call to a spy!`)},getSpy=assertion=>(assertIsMock(assertion),assertion._obj),ordinalOf=i2=>{let j=i2%10,k=i2%100;return j===1&&k!==11?`${i2}st`:j===2&&k!==12?`${i2}nd`:j===3&&k!==13?`${i2}rd`:`${i2}th`},formatCalls=(spy,msg,actualCall)=>(spy.mock.calls&&(msg+=c().gray(`
|
44
|
+
|
45
|
+
Received:
|
46
|
+
|
47
|
+
${spy.mock.calls.map((callArg,i2)=>{let methodCall=c().bold(` ${ordinalOf(i2+1)} ${spy.getMockName()} call:
|
48
|
+
|
49
|
+
`);return actualCall?methodCall+=diff(actualCall,callArg,{omitAnnotationLines:!0}):methodCall+=stringify(callArg).split(`
|
50
|
+
`).map(line=>` ${line}`).join(`
|
51
|
+
`),methodCall+=`
|
52
|
+
`,methodCall}).join(`
|
53
|
+
`)}`)),msg+=c().gray(`
|
54
|
+
|
55
|
+
Number of calls: ${c().bold(spy.mock.calls.length)}
|
56
|
+
`),msg),formatReturns=(spy,msg,actualReturn)=>(msg+=c().gray(`
|
57
|
+
|
58
|
+
Received:
|
59
|
+
|
60
|
+
${spy.mock.results.map((callReturn,i2)=>{let methodCall=c().bold(` ${ordinalOf(i2+1)} ${spy.getMockName()} call return:
|
61
|
+
|
62
|
+
`);return actualReturn?methodCall+=diff(actualReturn,callReturn.value,{omitAnnotationLines:!0}):methodCall+=stringify(callReturn).split(`
|
63
|
+
`).map(line=>` ${line}`).join(`
|
64
|
+
`),methodCall+=`
|
65
|
+
`,methodCall}).join(`
|
66
|
+
`)}`),msg+=c().gray(`
|
67
|
+
|
68
|
+
Number of calls: ${c().bold(spy.mock.calls.length)}
|
69
|
+
`),msg);def(["toHaveBeenCalledTimes","toBeCalledTimes"],function(number){let spy=getSpy(this),spyName=spy.getMockName(),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,!1)}),def("toHaveBeenCalledOnce",function(){let spy=getSpy(this),spyName=spy.getMockName(),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,!1)}),def(["toHaveBeenCalled","toBeCalled"],function(){let spy=getSpy(this),spyName=spy.getMockName(),callCount=spy.mock.calls.length,called=callCount>0,isNot=utils.flag(this,"negate"),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`,!0,called]);if(called&&isNot&&(msg=formatCalls(spy,msg)),called&&isNot||!called&&!isNot)throw new AssertionError(msg)}),def(["toHaveBeenCalledWith","toBeCalledWith"],function(...args){let spy=getSpy(this),spyName=spy.getMockName(),pass=spy.mock.calls.some(callArg=>equals(callArg,args,[iterableEquality])),isNot=utils.flag(this,"negate"),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){let spy=getSpy(this),spyName=spy.getMockName(),nthCall=spy.mock.calls[times-1];this.assert(equals(nthCall,args,[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){let spy=getSpy(this),spyName=spy.getMockName(),lastCall=spy.mock.calls[spy.mock.calls.length-1];this.assert(equals(lastCall,args,[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>"u"||expected instanceof RegExp)return this.throws(expected);let obj=this._obj,promise=utils.flag(this,"promise"),isNot=utils.flag(this,"negate"),thrown=null;if(promise==="rejects")thrown=obj;else if(promise==="resolves"&&typeof obj!="function"){if(isNot)return;{let message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't",error={showDiff:!1};throw new AssertionError(message,error,utils.flag(this,"ssfi"))}}else {let isThrow=!1;try{obj();}catch(err){isThrow=!0,thrown=err;}if(!isThrow&&!isNot){let message=utils.flag(this,"message")||"expected function to throw an error, but it didn't",error={showDiff:!1};throw new AssertionError(message,error,utils.flag(this,"ssfi"))}}if(typeof expected=="function"){let 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,!1)}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"){let matcher=expected;return this.assert(thrown&&matcher.asymmetricMatch(thrown),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",matcher.toString(),thrown,!1)}throw new Error(`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "${typeof expected}"`)}),def(["toHaveReturned","toReturn"],function(){let spy=getSpy(this),spyName=spy.getMockName(),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,!1);}),def(["toHaveReturnedTimes","toReturnTimes"],function(times){let spy=getSpy(this),spyName=spy.getMockName(),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}`,!1);}),def(["toHaveReturnedWith","toReturnWith"],function(value){let spy=getSpy(this),spyName=spy.getMockName(),pass=spy.mock.results.some(({type,value:result})=>type==="return"&&equals(value,result)),isNot=utils.flag(this,"negate"),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){let spy=getSpy(this),spyName=spy.getMockName(),{value:lastResult}=spy.mock.results[spy.mock.results.length-1],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){let spy=getSpy(this),spyName=spy.getMockName(),isNot=utils.flag(this,"negate"),{type:callType,value:callResult}=spy.mock.results[nthCall-1],ordinalCall=`${ordinalOf(nthCall)} call`;!isNot&&callType==="throw"&&chai3.assert.fail(`expected ${ordinalCall} to return #{exp}, but instead it threw an error`);let 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(chai3.Assertion.prototype,"resolves",function(){let error=new Error("resolves");utils.flag(this,"promise","resolves"),utils.flag(this,"error",error);let test=utils.flag(this,"vitest-test"),obj=utils.flag(this,"object");if(typeof obj?.then!="function")throw new TypeError(`You must provide a Promise to expect() when using .resolves, not '${typeof obj}'.`);let proxy=new Proxy(this,{get:(target,key,receiver)=>{let result=Reflect.get(target,key,receiver);return typeof result!="function"?result instanceof chai3.Assertion?proxy:result:async(...args)=>{let promise=obj.then(value=>(utils.flag(this,"object",value),result.call(this,...args)),err=>{let _error=new AssertionError(`promise rejected "${utils.inspect(err)}" instead of resolving`,{showDiff:!1});throw _error.stack=error.stack.replace(error.message,_error.message),_error});return recordAsyncExpect(test,promise)}}});return proxy}),utils.addProperty(chai3.Assertion.prototype,"rejects",function(){let error=new Error("rejects");utils.flag(this,"promise","rejects"),utils.flag(this,"error",error);let test=utils.flag(this,"vitest-test"),obj=utils.flag(this,"object"),wrapper=typeof obj=="function"?obj():obj;if(typeof wrapper?.then!="function")throw new TypeError(`You must provide a Promise to expect() when using .rejects, not '${typeof wrapper}'.`);let proxy=new Proxy(this,{get:(target,key,receiver)=>{let result=Reflect.get(target,key,receiver);return typeof result!="function"?result instanceof chai3.Assertion?proxy:result:async(...args)=>{let promise=wrapper.then(value=>{let _error=new AssertionError(`promise resolved "${utils.inspect(value)}" instead of rejecting`,{showDiff:!1});throw _error.stack=error.stack.replace(error.message,_error.message),_error},err=>(utils.flag(this,"object",err),result.call(this,...args)));return recordAsyncExpect(test,promise)}}});return proxy});};function getMatcherState(assertion,expect4){let obj=assertion._obj,isNot=util.flag(assertion,"negate"),promise=util.flag(assertion,"promise")||"",jestUtils={...getMatcherUtils(),diff,stringify,iterableEquality,subsetEquality};return {state:{...getState(expect4),isNot,utils:jestUtils,promise,equals,suppressedErrors:[]},isNot,obj}}var JestExtendError=class extends Error{constructor(message,actual,expected){super(message),this.actual=actual,this.expected=expected;}};function JestExtendPlugin(expect4,matchers2){return (c,utils)=>{Object.entries(matchers2).forEach(([expectAssertionName,expectAssertion])=>{function expectWrapper(...args){let{state,isNot,obj}=getMatcherState(this,expect4),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)});let{pass,message,actual,expected}=result;if(pass&&isNot||!pass&&!isNot)throw new JestExtendError(message(),actual,expected)}let softWrapper=wrapSoft(utils,expectWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT].matchers,expectAssertionName,softWrapper),utils.addMethod(c.Assertion.prototype,expectAssertionName,softWrapper);class CustomMatcher extends AsymmetricMatcher3{constructor(inverse=!1,...sample){super(sample,inverse);}asymmetricMatch(other){let{pass}=expectAssertion.call(this.getMatcherContext(expect4),other,...this.sample);return this.inverse?!pass:pass}toString(){return `${this.inverse?"not.":""}${expectAssertionName}`}getExpectedType(){return "any"}toAsymmetricMatcher(){return `${this.toString()}<${this.sample.map(String).join(", ")}>`}}Object.defineProperty(expect4,expectAssertionName,{configurable:!0,enumerable:!0,value:(...sample)=>new CustomMatcher(!1,...sample),writable:!0}),Object.defineProperty(expect4.not,expectAssertionName,{configurable:!0,enumerable:!0,value:(...sample)=>new CustomMatcher(!0,...sample),writable:!0});});}}var JestExtend=(chai3,utils)=>{utils.addMethod(chai3.expect,"extend",(expect4,expects)=>{chai3.use(JestExtendPlugin(expect4,expects));});};function createExpect(){chai.use(JestExtend),chai.use(JestChaiExpect),chai.use(JestAsymmetricMatchers);let expect4=(value,message)=>{let{assertionCalls}=getState(expect4);return setState({assertionCalls:assertionCalls+1,soft:!1},expect4),chai.expect(value,message)};Object.assign(expect4,chai.expect),expect4.getState=()=>getState(expect4),expect4.setState=state=>setState(state,expect4),expect4.extend=expects=>chai.expect.extend(expect4,expects),expect4.soft=(...args)=>{let assert2=expect4(...args);return expect4.setState({soft:!0}),assert2},expect4.unreachable=message=>{chai.assert.fail(`expected${message?` "${message}" `:" "}not to be reached`);};function assertions(expected){let errorGen=()=>new Error(`expected number of assertions to be ${expected}, but got ${expect4.getState().assertionCalls}`);"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(errorGen(),assertions),expect4.setState({expectedAssertionsNumber:expected,expectedAssertionsNumberErrorGen:errorGen});}function hasAssertions(){let error=new Error("expected any number of assertion, but got none");"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(error,hasAssertions),expect4.setState({isExpectingAssertions:!0,isExpectingAssertionsError:error});}return setState({assertionCalls:0,isExpectingAssertions:!1,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null},expect4),chai.util.addMethod(expect4,"assertions",assertions),chai.util.addMethod(expect4,"hasAssertions",hasAssertions),expect4.extend(matchers),expect4}var expect2=createExpect();Object.defineProperty(globalThis,GLOBAL_EXPECT,{value:expect2,writable:!0,configurable:!0});var testingLibrary=instrument({...domTestingLibrary},{intercept:(method,path)=>path[0]==="fireEvent"||method.startsWith("find")||method.startsWith("waitFor")});testingLibrary.screen=new Proxy(testingLibrary.screen,{get(target,prop,receiver){return once.warn(dedent`
|
16
70
|
You are using Testing Library's \`screen\` object. Use \`within(canvasElement)\` instead.
|
17
71
|
More info: https://storybook.js.org/docs/react/essentials/interactions
|
18
|
-
`),Reflect.get(target,prop,receiver)}});var {buildQueries,configure,createEvent,fireEvent,findAllByAltText,findAllByDisplayValue,findAllByLabelText,findAllByPlaceholderText,findAllByRole,findAllByTestId,findAllByText,findAllByTitle,findByAltText,findByDisplayValue,findByLabelText,findByPlaceholderText,findByRole,findByTestId,findByText,findByTitle,getAllByAltText,getAllByDisplayValue,getAllByLabelText,getAllByPlaceholderText,getAllByRole,getAllByTestId,getAllByText,getAllByTitle,getByAltText,getByDisplayValue,getByLabelText,getByPlaceholderText,getByRole,getByTestId,getByText,getByTitle,getConfig,getDefaultNormalizer,getElementError,getNodeText,getQueriesForElement,getRoles,getSuggestedQuery,isInaccessible,logDOM,logRoles,prettyDOM,queries,queryAllByAltText,queryAllByAttribute,queryAllByDisplayValue,queryAllByLabelText,queryAllByPlaceholderText,queryAllByRole,queryAllByTestId,queryAllByText,queryAllByTitle,queryByAltText,queryByAttribute,queryByDisplayValue,queryByLabelText,queryByPlaceholderText,queryByRole,queryByTestId,queryByText,queryByTitle,queryHelpers,screen,waitFor,waitForElementToBeRemoved,within,prettyFormat}=testingLibrary,{userEvent}=instrument({userEvent:_userEvent},{intercept:!0});var channel=addons.getChannel();channel.on(FORCE_REMOUNT,()=>
|
72
|
+
`),Reflect.get(target,prop,receiver)}});var {buildQueries,configure,createEvent,fireEvent,findAllByAltText,findAllByDisplayValue,findAllByLabelText,findAllByPlaceholderText,findAllByRole,findAllByTestId,findAllByText,findAllByTitle,findByAltText,findByDisplayValue,findByLabelText,findByPlaceholderText,findByRole,findByTestId,findByText,findByTitle,getAllByAltText,getAllByDisplayValue,getAllByLabelText,getAllByPlaceholderText,getAllByRole,getAllByTestId,getAllByText,getAllByTitle,getByAltText,getByDisplayValue,getByLabelText,getByPlaceholderText,getByRole,getByTestId,getByText,getByTitle,getConfig,getDefaultNormalizer,getElementError,getNodeText,getQueriesForElement,getRoles,getSuggestedQuery,isInaccessible,logDOM,logRoles,prettyDOM,queries,queryAllByAltText,queryAllByAttribute,queryAllByDisplayValue,queryAllByLabelText,queryAllByPlaceholderText,queryAllByRole,queryAllByTestId,queryAllByText,queryAllByTitle,queryByAltText,queryByAttribute,queryByDisplayValue,queryByLabelText,queryByPlaceholderText,queryByRole,queryByTestId,queryByText,queryByTitle,queryHelpers,screen,waitFor,waitForElementToBeRemoved,within,prettyFormat}=testingLibrary,{userEvent}=instrument({userEvent:_userEvent},{intercept:!0});var channel=addons.getChannel();channel.on(FORCE_REMOUNT,()=>spies.forEach(mock=>mock.mockClear()));channel.on(STORY_RENDER_PHASE_CHANGED,({newPhase})=>{newPhase==="loading"&&spies.forEach(mock=>mock.mockClear());});var {expect:expect3}=instrument({expect:expect2},{getKeys:(obj,depth)=>{let privateApi=["assert","__methods","__flags"];if(obj.constructor===chai__default.Assertion){let keys2=Object.keys(Object.getPrototypeOf(obj)).filter(it=>!privateApi.includes(it));return depth>2?keys2:[...keys2,"not"]}return Object.keys(obj)},intercept:method=>method!=="expect"});
|
19
73
|
|
20
|
-
export { buildQueries, configure, createEvent, expect3 as expect, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, logDOM, logRoles, prettyDOM, prettyFormat, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, screen, userEvent, waitFor, waitForElementToBeRemoved, within };
|
74
|
+
export { buildQueries, configure, createEvent, expect3 as expect, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, fn, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, isMockFunction, logDOM, logRoles, prettyDOM, prettyFormat, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, screen, spies, spyOn, userEvent, waitFor, waitForElementToBeRemoved, within };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/test",
|
3
|
-
"version": "0.0.0-pr-
|
3
|
+
"version": "0.0.0-pr-23888-sha-8657c59a",
|
4
4
|
"description": "",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -43,23 +43,25 @@
|
|
43
43
|
"prep": "../../../scripts/prepare/bundle.ts"
|
44
44
|
},
|
45
45
|
"dependencies": {
|
46
|
-
"@storybook/client-logger": "0.0.0-pr-
|
47
|
-
"@storybook/core-events": "0.0.0-pr-
|
48
|
-
"@storybook/instrumenter": "0.0.0-pr-
|
49
|
-
"@storybook/preview-api": "0.0.0-pr-
|
46
|
+
"@storybook/client-logger": "0.0.0-pr-23888-sha-8657c59a",
|
47
|
+
"@storybook/core-events": "0.0.0-pr-23888-sha-8657c59a",
|
48
|
+
"@storybook/instrumenter": "0.0.0-pr-23888-sha-8657c59a",
|
49
|
+
"@storybook/preview-api": "0.0.0-pr-23888-sha-8657c59a",
|
50
50
|
"@testing-library/dom": "^9.3.1",
|
51
51
|
"@testing-library/jest-dom": "^6.1.3",
|
52
52
|
"@testing-library/user-event": "^14.4.3",
|
53
|
-
"@vitest/expect": "^0.34.2",
|
54
|
-
"@vitest/spy": "^0.34.1",
|
55
53
|
"chai": "^4.3.7",
|
56
54
|
"expect": "^29.6.2",
|
55
|
+
"loupe": "^2.3.1",
|
57
56
|
"ts-dedent": "^2.2.0"
|
58
57
|
},
|
59
58
|
"devDependencies": {
|
60
59
|
"@types/chai": "^4",
|
61
|
-
"
|
62
|
-
"
|
60
|
+
"@vitest/expect": "^0.34.2",
|
61
|
+
"@vitest/spy": "^0.34.1",
|
62
|
+
"type-fest": "~2.19",
|
63
|
+
"typescript": "~4.9.3",
|
64
|
+
"util": "^0.12.4"
|
63
65
|
},
|
64
66
|
"publishConfig": {
|
65
67
|
"access": "public"
|