import { once } from 'storybook/internal/client-logger'; import { FORCE_REMOUNT, STORY_RENDER_PHASE_CHANGED, SET_CURRENT_STORY } from 'storybook/internal/core-events'; import { addons } from 'storybook/internal/preview-api'; import { global } from '@storybook/global'; var __require=(x=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(a2,b)=>(typeof require<"u"?require:a2)[b]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});var f={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},h=Object.entries(f);function a(n){return String(n)}a.open="";a.close="";function C(n=!1){let e=typeof process<"u"?process:void 0,i=e?.env||{},g=e?.argv||[];return !("NO_COLOR"in i||g.includes("--no-color"))&&("FORCE_COLOR"in i||g.includes("--color")||e?.platform==="win32"||n&&i.TERM!=="dumb"||"CI"in i)||typeof window<"u"&&!!window.chrome}function p(n=!1){let e=C(n),i=(r,t,c,o)=>{let l="",s=0;do l+=r.substring(s,o)+c,s=o+t.length,o=r.indexOf(t,s);while(~o);return l+r.substring(s)},g=(r,t,c=r)=>{let o=l=>{let s=String(l),b=s.indexOf(t,r.length);return ~b?r+i(s,t,c,b)+t:r+s+t};return o.open=r,o.close=t,o},u={isColorSupported:e},d=r=>`\x1B[${r}m`;for(let[r,t]of h)u[r]=e?g(d(t[0]),d(t[1]),t[2]):a;return u}var f2=p(!1);function getKeysOfEnumerableProperties(object,compareKeys){let rawKeys=Object.keys(object),keys=compareKeys===null?rawKeys:rawKeys.sort(compareKeys);if(Object.getOwnPropertySymbols)for(let symbol of Object.getOwnPropertySymbols(object))Object.getOwnPropertyDescriptor(object,symbol).enumerable&&keys.push(symbol);return keys}function printIteratorEntries(iterator,config,indentation,depth,refs,printer2,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=printer2(current.value[0],config,indentationNext,depth,refs),value=printer2(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,printer2){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+=printer2(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,printer2){let result="";list=list instanceof ArrayBuffer?new DataView(list):list;let isDataView=l=>l instanceof DataView,length=isDataView(list)?list.byteLength:list.length;if(length>0){result+=config.spacingOuter;let indentationNext=indentation+config.indent;for(let i=0;i0){result+=config.spacingOuter;let indentationNext=indentation+config.indent;for(let i=0;i{let stringedValue=val.toString();if(stringedValue==="ArrayContaining"||stringedValue==="ArrayNotContaining")return ++depth>config.maxDepth?`[${stringedValue}]`:`${stringedValue+SPACE$2}[${printListItems(val.sample,config,indentation,depth,refs,printer2)}]`;if(stringedValue==="ObjectContaining"||stringedValue==="ObjectNotContaining")return ++depth>config.maxDepth?`[${stringedValue}]`:`${stringedValue+SPACE$2}{${printObjectProperties(val.sample,config,indentation,depth,refs,printer2)}}`;if(stringedValue==="StringMatching"||stringedValue==="StringNotMatching"||stringedValue==="StringContaining"||stringedValue==="StringNotContaining")return stringedValue+SPACE$2+printer2(val.sample,config,indentation,depth,refs);if(typeof val.toAsymmetricMatcher!="function")throw new TypeError(`Asymmetric matcher ${val.constructor.name} does not implement toAsymmetricMatcher()`);return val.toAsymmetricMatcher()},test$5=val=>val&&val.$$typeof===asymmetricMatcher,plugin$5={serialize:serialize$5,test:test$5},SPACE$1=" ",OBJECT_NAMES=new Set(["DOMStringMap","NamedNodeMap"]),ARRAY_REGEXP=/^(?:HTML\w*Collection|NodeList)$/;function testName(name){return OBJECT_NAMES.has(name)||ARRAY_REGEXP.test(name)}var test$4=val=>val&&val.constructor&&!!val.constructor.name&&testName(val.constructor.name);function isNamedNodeMap(collection){return collection.constructor.name==="NamedNodeMap"}var serialize$4=(collection,config,indentation,depth,refs,printer2)=>{let name=collection.constructor.name;return ++depth>config.maxDepth?`[${name}]`:(config.min?"":name+SPACE$1)+(OBJECT_NAMES.has(name)?`{${printObjectProperties(isNamedNodeMap(collection)?[...collection].reduce((props,attribute)=>(props[attribute.name]=attribute.value,props),{}):{...collection},config,indentation,depth,refs,printer2)}}`:`[${printListItems([...collection],config,indentation,depth,refs,printer2)}]`)},plugin$4={serialize:serialize$4,test:test$4};function escapeHTML(str){return str.replaceAll("<","<").replaceAll(">",">")}function printProps(keys,props,config,indentation,depth,refs,printer2){let indentationNext=indentation+config.indent,colors=config.colors;return keys.map(key=>{let value=props[key],printed=printer2(value,config,indentationNext,depth,refs);return typeof value!="string"&&(printed.includes(` `)&&(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("")}function printChildren(children,config,indentation,depth,refs,printer2){return children.map(child=>config.spacingOuter+indentation+(typeof child=="string"?printText(child,config):printer2(child,config,indentation,depth,refs))).join("")}function printText(text,config){let contentColor=config.colors.content;return contentColor.open+escapeHTML(text)+contentColor.close}function printComment(comment,config){let commentColor=config.colors.comment;return `${commentColor.open}${commentColor.close}`}function 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}${tagColor.close}`}function printElementAsLeaf(type,config){let tagColor=config.colors.tag;return `${tagColor.open}<${type}${tagColor.close} \u2026${tagColor.open} />${tagColor.close}`}var ELEMENT_NODE=1,TEXT_NODE=3,COMMENT_NODE=8,FRAGMENT_NODE=11,ELEMENT_REGEXP=/^(?:(?:HTML|SVG)\w*)?Element$/;function testHasAttribute(val){try{return typeof val.hasAttribute=="function"&&val.hasAttribute("is")}catch{return !1}}function 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"}var test$3=val=>{var _a;return ((_a=val?.constructor)==null?void 0:_a.name)&&testNode(val)};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$3=(node,config,indentation,depth,refs,printer2)=>{if(nodeIsText(node))return printText(node.data,config);if(nodeIsComment(node))return printComment(node.data,config);let type=nodeIsFragment(node)?"DocumentFragment":node.tagName.toLowerCase();return ++depth>config.maxDepth?printElementAsLeaf(type,config):printElement(type,printProps(nodeIsFragment(node)?[]:Array.from(node.attributes,attr=>attr.name).sort(),nodeIsFragment(node)?{}:[...node.attributes].reduce((props,attribute)=>(props[attribute.name]=attribute.value,props),{}),config,indentation+config.indent,depth,refs,printer2),printChildren(Array.prototype.slice.call(node.childNodes||node.children),config,indentation+config.indent,depth,refs,printer2),config,indentation)},plugin$3={serialize:serialize$3,test:test$3},IS_ITERABLE_SENTINEL="@@__IMMUTABLE_ITERABLE__@@",IS_LIST_SENTINEL="@@__IMMUTABLE_LIST__@@",IS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@",IS_MAP_SENTINEL="@@__IMMUTABLE_MAP__@@",IS_ORDERED_SENTINEL="@@__IMMUTABLE_ORDERED__@@",IS_RECORD_SENTINEL="@@__IMMUTABLE_RECORD__@@",IS_SEQ_SENTINEL="@@__IMMUTABLE_SEQ__@@",IS_SET_SENTINEL="@@__IMMUTABLE_SET__@@",IS_STACK_SENTINEL="@@__IMMUTABLE_STACK__@@",getImmutableName=name=>`Immutable.${name}`,printAsLeaf=name=>`[${name}]`,SPACE=" ",LAZY="\u2026";function printImmutableEntries(val,config,indentation,depth,refs,printer2,type){return ++depth>config.maxDepth?printAsLeaf(getImmutableName(type)):`${getImmutableName(type)+SPACE}{${printIteratorEntries(val.entries(),config,indentation,depth,refs,printer2)}}`}function getRecordEntries(val){let i=0;return {next(){if(iconfig.maxDepth?printAsLeaf(name):`${name+SPACE}{${printIteratorEntries(getRecordEntries(val),config,indentation,depth,refs,printer2)}}`}function printImmutableSeq(val,config,indentation,depth,refs,printer2){let name=getImmutableName("Seq");return ++depth>config.maxDepth?printAsLeaf(name):val[IS_KEYED_SENTINEL]?`${name+SPACE}{${val._iter||val._object?printIteratorEntries(val.entries(),config,indentation,depth,refs,printer2):LAZY}}`:`${name+SPACE}[${val._iter||val._array||val._collection||val._iterable?printIteratorValues(val.values(),config,indentation,depth,refs,printer2):LAZY}]`}function printImmutableValues(val,config,indentation,depth,refs,printer2,type){return ++depth>config.maxDepth?printAsLeaf(getImmutableName(type)):`${getImmutableName(type)+SPACE}[${printIteratorValues(val.values(),config,indentation,depth,refs,printer2)}]`}var serialize$2=(val,config,indentation,depth,refs,printer2)=>val[IS_MAP_SENTINEL]?printImmutableEntries(val,config,indentation,depth,refs,printer2,val[IS_ORDERED_SENTINEL]?"OrderedMap":"Map"):val[IS_LIST_SENTINEL]?printImmutableValues(val,config,indentation,depth,refs,printer2,"List"):val[IS_SET_SENTINEL]?printImmutableValues(val,config,indentation,depth,refs,printer2,val[IS_ORDERED_SENTINEL]?"OrderedSet":"Set"):val[IS_STACK_SENTINEL]?printImmutableValues(val,config,indentation,depth,refs,printer2,"Stack"):val[IS_SEQ_SENTINEL]?printImmutableSeq(val,config,indentation,depth,refs,printer2):printImmutableRecord(val,config,indentation,depth,refs,printer2),test$2=val=>val&&(val[IS_ITERABLE_SENTINEL]===!0||val[IS_RECORD_SENTINEL]===!0),plugin$2={serialize:serialize$2,test:test$2},reactIs={exports:{}},reactIs_production_min={};var hasRequiredReactIs_production_min;function requireReactIs_production_min(){if(hasRequiredReactIs_production_min)return reactIs_production_min;hasRequiredReactIs_production_min=1;var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f3=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h2=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m2=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p2=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");function v(a2){if(typeof a2=="object"&&a2!==null){var r=a2.$$typeof;switch(r){case b:switch(a2=a2.type,a2){case d:case f3:case e:case m2:case n:return a2;default:switch(a2=a2&&a2.$$typeof,a2){case k:case h2:case l:case q:case p2:case g:return a2;default:return r}}case c:return r}}}return reactIs_production_min.ContextConsumer=h2,reactIs_production_min.ContextProvider=g,reactIs_production_min.Element=b,reactIs_production_min.ForwardRef=l,reactIs_production_min.Fragment=d,reactIs_production_min.Lazy=q,reactIs_production_min.Memo=p2,reactIs_production_min.Portal=c,reactIs_production_min.Profiler=f3,reactIs_production_min.StrictMode=e,reactIs_production_min.Suspense=m2,reactIs_production_min.SuspenseList=n,reactIs_production_min.isAsyncMode=function(){return !1},reactIs_production_min.isConcurrentMode=function(){return !1},reactIs_production_min.isContextConsumer=function(a2){return v(a2)===h2},reactIs_production_min.isContextProvider=function(a2){return v(a2)===g},reactIs_production_min.isElement=function(a2){return typeof a2=="object"&&a2!==null&&a2.$$typeof===b},reactIs_production_min.isForwardRef=function(a2){return v(a2)===l},reactIs_production_min.isFragment=function(a2){return v(a2)===d},reactIs_production_min.isLazy=function(a2){return v(a2)===q},reactIs_production_min.isMemo=function(a2){return v(a2)===p2},reactIs_production_min.isPortal=function(a2){return v(a2)===c},reactIs_production_min.isProfiler=function(a2){return v(a2)===f3},reactIs_production_min.isStrictMode=function(a2){return v(a2)===e},reactIs_production_min.isSuspense=function(a2){return v(a2)===m2},reactIs_production_min.isSuspenseList=function(a2){return v(a2)===n},reactIs_production_min.isValidElementType=function(a2){return typeof a2=="string"||typeof a2=="function"||a2===d||a2===f3||a2===e||a2===m2||a2===n||a2===t||typeof a2=="object"&&a2!==null&&(a2.$$typeof===q||a2.$$typeof===p2||a2.$$typeof===g||a2.$$typeof===h2||a2.$$typeof===l||a2.$$typeof===u||a2.getModuleId!==void 0)},reactIs_production_min.typeOf=v,reactIs_production_min}var reactIs_development={};var hasRequiredReactIs_development;function requireReactIs_development(){return hasRequiredReactIs_development||(hasRequiredReactIs_development=1,process.env.NODE_ENV!=="production"&&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}reactIs_development.ContextConsumer=ContextConsumer,reactIs_development.ContextProvider=ContextProvider,reactIs_development.Element=Element2,reactIs_development.ForwardRef=ForwardRef,reactIs_development.Fragment=Fragment,reactIs_development.Lazy=Lazy,reactIs_development.Memo=Memo,reactIs_development.Portal=Portal,reactIs_development.Profiler=Profiler,reactIs_development.StrictMode=StrictMode,reactIs_development.Suspense=Suspense,reactIs_development.SuspenseList=SuspenseList,reactIs_development.isAsyncMode=isAsyncMode,reactIs_development.isConcurrentMode=isConcurrentMode,reactIs_development.isContextConsumer=isContextConsumer,reactIs_development.isContextProvider=isContextProvider,reactIs_development.isElement=isElement,reactIs_development.isForwardRef=isForwardRef,reactIs_development.isFragment=isFragment,reactIs_development.isLazy=isLazy,reactIs_development.isMemo=isMemo,reactIs_development.isPortal=isPortal,reactIs_development.isProfiler=isProfiler,reactIs_development.isStrictMode=isStrictMode,reactIs_development.isSuspense=isSuspense,reactIs_development.isSuspenseList=isSuspenseList,reactIs_development.isValidElementType=isValidElementType,reactIs_development.typeOf=typeOf;}()),reactIs_development}var hasRequiredReactIs;function requireReactIs(){return hasRequiredReactIs||(hasRequiredReactIs=1,process.env.NODE_ENV==="production"?reactIs.exports=requireReactIs_production_min():reactIs.exports=requireReactIs_development()),reactIs.exports}var reactIsExports=requireReactIs();function getChildren(arg,children=[]){if(Array.isArray(arg))for(let item of arg)getChildren(item,children);else arg!=null&&arg!==!1&&arg!==""&&children.push(arg);return children}function getType(element){let type=element.type;if(typeof type=="string")return type;if(typeof type=="function")return type.displayName||type.name||"Unknown";if(reactIsExports.isFragment(element))return "React.Fragment";if(reactIsExports.isSuspense(element))return "React.Suspense";if(typeof type=="object"&&type!==null){if(reactIsExports.isContextProvider(element))return "Context.Provider";if(reactIsExports.isContextConsumer(element))return "Context.Consumer";if(reactIsExports.isForwardRef(element)){if(type.displayName)return type.displayName;let functionName=type.render.displayName||type.render.name||"";return functionName===""?"ForwardRef":`ForwardRef(${functionName})`}if(reactIsExports.isMemo(element)){let functionName=type.displayName||type.type.displayName||type.type.name||"";return functionName===""?"Memo":`Memo(${functionName})`}}return "UNDEFINED"}function getPropKeys$1(element){let{props}=element;return Object.keys(props).filter(key=>key!=="children"&&props[key]!==void 0).sort()}var serialize$1=(element,config,indentation,depth,refs,printer2)=>++depth>config.maxDepth?printElementAsLeaf(getType(element),config):printElement(getType(element),printProps(getPropKeys$1(element),element.props,config,indentation+config.indent,depth,refs,printer2),printChildren(getChildren(element.props.children),config,indentation+config.indent,depth,refs,printer2),config,indentation),test$1=val=>val!=null&&reactIsExports.isElement(val),plugin$1={serialize:serialize$1,test:test$1},testSymbol=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.test.json"):245830487;function getPropKeys(object){let{props}=object;return props?Object.keys(props).filter(key=>props[key]!==void 0).sort():[]}var serialize=(object,config,indentation,depth,refs,printer2)=>++depth>config.maxDepth?printElementAsLeaf(object.type,config):printElement(object.type,object.props?printProps(getPropKeys(object),object.props,config,indentation+config.indent,depth,refs,printer2):"",object.children?printChildren(object.children,config,indentation+config.indent,depth,refs,printer2):"",config,indentation),test=val=>val&&val.$$typeof===testSymbol,plugin={serialize,test},toString=Object.prototype.toString,toISOString=Date.prototype.toISOString,errorToString=Error.prototype.toString,regExpToString=RegExp.prototype.toString;function getConstructorName(val){return typeof val.constructor=="function"&&val.constructor.name||"Object"}function isWindow(val){return typeof window<"u"&&val===window}var SYMBOL_REGEXP=/^Symbol\((.*)\)(.*)$/,NEWLINE_REGEXP=/\n/g,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.replaceAll(/"|\\/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]"?Number.isNaN(+val)?"Date { NaN }":toISOString.call(val):toStringed==="[object Error]"?printError(val):toStringed==="[object RegExp]"?escapeRegex?regExpToString.call(val).replaceAll(/[$()*+.?[\\\]^{|}]/g,"\\$&"):regExpToString.call(val):val instanceof Error?printError(val):null}function printComplexValue(val,config,indentation,depth,refs,hasCalledToJSON){if(refs.includes(val))return "[Circular]";refs=[...refs],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 "}[${printListItems(val,config,indentation,depth,refs,printer)}]`:isToStringedArrayType(toStringed)?hitMaxDepth?`[${val.constructor.name}]`:`${min||!config.printBasicPrototype&&val.constructor.name==="Array"?"":`${val.constructor.name} `}[${printListItems(val,config,indentation,depth,refs,printer)}]`:toStringed==="[object Map]"?hitMaxDepth?"[Map]":`Map {${printIteratorEntries(val.entries(),config,indentation,depth,refs,printer," => ")}}`:toStringed==="[object Set]"?hitMaxDepth?"[Set]":`Set {${printIteratorValues(val.values(),config,indentation,depth,refs,printer)}}`:hitMaxDepth||isWindow(val)?`[${getConstructorName(val)}]`:`${min||!config.printBasicPrototype&&getConstructorName(val)==="Object"?"":`${getConstructorName(val)} `}{${printObjectProperties(val,config,indentation,depth,refs,printer)}}`}function isNewPlugin(plugin2){return plugin2.serialize!=null}function printPlugin(plugin2,val,config,indentation,depth,refs){let printed;try{printed=isNewPlugin(plugin2)?plugin2.serialize(val,config,indentation,depth,refs,printer):plugin2.print(val,valChild=>printer(valChild,config,indentation,depth,refs),str=>{let indentationNext=indentation+config.indent;return indentationNext+str.replaceAll(NEWLINE_REGEXP,` ${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 TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);return printed}function findPlugin(plugins2,val){for(let plugin2 of plugins2)try{if(plugin2.test(val))return plugin2}catch(error){throw new PrettyFormatPluginError(error.message,error.stack)}return null}function printer(val,config,indentation,depth,refs,hasCalledToJSON){let plugin2=findPlugin(config.plugins,val);if(plugin2!==null)return printPlugin(plugin2,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),DEFAULT_OPTIONS={callToJSON:!0,compareKeys:void 0,escapeRegex:!1,escapeString:!0,highlight:!1,indent:2,maxDepth:Number.POSITIVE_INFINITY,maxWidth:Number.POSITIVE_INFINITY,min:!1,plugins:[],printBasicPrototype:!0,printFunctionName:!0,theme:DEFAULT_THEME};function validateOptions(options){for(let key of Object.keys(options))if(!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS,key))throw new Error(`pretty-format: Unknown option "${key}".`);if(options.min&&options.indent!==void 0&&options.indent!==0)throw new Error('pretty-format: Options "min" and "indent" cannot be used together.')}function getColorsHighlight(){return DEFAULT_THEME_KEYS.reduce((colors,key)=>{let value=DEFAULT_THEME[key],color=value&&f2[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))}function getColorsEmpty(){return DEFAULT_THEME_KEYS.reduce((colors,key)=>(colors[key]={close:"",open:""},colors),Object.create(null))}function getPrintFunctionName(options){return options?.printFunctionName??DEFAULT_OPTIONS.printFunctionName}function getEscapeRegex(options){return options?.escapeRegex??DEFAULT_OPTIONS.escapeRegex}function getEscapeString(options){return options?.escapeString??DEFAULT_OPTIONS.escapeString}function getConfig(options){return {callToJSON:options?.callToJSON??DEFAULT_OPTIONS.callToJSON,colors:options?.highlight?getColorsHighlight():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?" ":` `,spacingOuter:options?.min?"":` `}}function createIndent(indent){return Array.from({length:indent+1}).join(" ")}function format(val,options){if(options&&(validateOptions(options),options.plugins)){let plugin2=findPlugin(options.plugins,val);if(plugin2!==null)return printPlugin(plugin2,val,getConfig(options),"",0,[])}let basicResult=printBasicValue(val,getPrintFunctionName(options),getEscapeRegex(options),getEscapeString(options));return basicResult!==null?basicResult:printComplexValue(val,getConfig(options),"",0,[])}var plugins={AsymmetricMatcher:plugin$5,DOMCollection:plugin$4,DOMElement:plugin$3,Immutable:plugin$2,ReactElement:plugin$1,ReactTestComponent:plugin};var ansiColors={bold:["1","22"],dim:["2","22"],italic:["3","23"],underline:["4","24"],inverse:["7","27"],hidden:["8","28"],strike:["9","29"],black:["30","39"],red:["31","39"],green:["32","39"],yellow:["33","39"],blue:["34","39"],magenta:["35","39"],cyan:["36","39"],white:["37","39"],brightblack:["30;1","39"],brightred:["31;1","39"],brightgreen:["32;1","39"],brightyellow:["33;1","39"],brightblue:["34;1","39"],brightmagenta:["35;1","39"],brightcyan:["36;1","39"],brightwhite:["37;1","39"],grey:["90","39"]},styles={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},truncator="\u2026";function colorise(value,styleType){let color=ansiColors[styles[styleType]]||ansiColors[styleType]||"";return color?`\x1B[${color[0]}m${String(value)}\x1B[${color[1]}m`:String(value)}function normaliseOptions({showHidden=!1,depth=2,colors=!1,customInspect=!0,showProxy=!1,maxArrayLength=1/0,breakLength=1/0,seen=[],truncate:truncate2=1/0,stylize=String}={},inspect3){let options={showHidden:!!showHidden,depth:Number(depth),colors:!!colors,customInspect:!!customInspect,showProxy:!!showProxy,maxArrayLength:Number(maxArrayLength),breakLength:Number(breakLength),truncate:Number(truncate2),seen,inspect:inspect3,stylize};return options.colors&&(options.stylize=colorise),options}function isHighSurrogate(char){return char>="\uD800"&&char<="\uDBFF"}function truncate(string,length,tail=truncator){string=String(string);let tailLength=tail.length,stringLength=string.length;if(tailLength>length&&stringLength>tailLength)return tail;if(stringLength>length&&stringLength>tailLength){let end=length-tailLength;return end>0&&isHighSurrogate(string[end-1])&&(end=end-1),`${string.slice(0,end)}${tail}`}return string}function inspectList(list,options,inspectItem,separator=", "){inspectItem=inspectItem||options.inspect;let size=list.length;if(size===0)return "";let originalLength=options.truncate,output="",peek="",truncated="";for(let i=0;ioriginalLength&&output.length+truncated.length<=originalLength||!last&&!secondToLast&&truncatedLength>originalLength||(peek=last?"":inspectItem(list[i+1],options)+(secondToLast?"":separator),!last&&secondToLast&&truncatedLength>originalLength&&nextLength+peek.length>originalLength))break;if(output+=string,!last&&!secondToLast&&nextLength+peek.length>=originalLength){truncated=`${truncator}(${list.length-i-1})`;break}truncated="";}return `${output}${truncated}`}function quoteComplexKey(key){return key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?key:JSON.stringify(key).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}function inspectProperty([key,value],options){return options.truncate-=2,typeof key=="string"?key=quoteComplexKey(key):typeof key!="number"&&(key=`[${options.inspect(key,options)}]`),options.truncate-=key.length,value=options.inspect(value,options),`${key}: ${value}`}function inspectArray(array,options){let nonIndexProperties=Object.keys(array).slice(array.length);if(!array.length&&!nonIndexProperties.length)return "[]";options.truncate-=4;let listContents=inspectList(array,options);options.truncate-=listContents.length;let propertyContents="";return nonIndexProperties.length&&(propertyContents=inspectList(nonIndexProperties.map(key=>[key,array[key]]),options,inspectProperty)),`[ ${listContents}${propertyContents?`, ${propertyContents}`:""} ]`}var getArrayName=array=>typeof Buffer=="function"&&array instanceof Buffer?"Buffer":array[Symbol.toStringTag]?array[Symbol.toStringTag]:array.constructor.name;function inspectTypedArray(array,options){let name=getArrayName(array);options.truncate-=name.length+4;let nonIndexProperties=Object.keys(array).slice(array.length);if(!array.length&&!nonIndexProperties.length)return `${name}[]`;let output="";for(let i=0;i[key,array[key]]),options,inspectProperty)),`${name}[ ${output}${propertyContents?`, ${propertyContents}`:""} ]`}function inspectDate(dateObject,options){let stringRepresentation=dateObject.toJSON();if(stringRepresentation===null)return "Invalid Date";let split=stringRepresentation.split("T"),date=split[0];return options.stylize(`${date}T${truncate(split[1],options.truncate-date.length-1)}`,"date")}function inspectFunction(func,options){let functionType=func[Symbol.toStringTag]||"Function",name=func.name;return name?options.stylize(`[${functionType} ${truncate(name,options.truncate-11)}]`,"special"):options.stylize(`[${functionType}]`,"special")}function inspectMapEntry([key,value],options){return options.truncate-=4,key=options.inspect(key,options),options.truncate-=key.length,value=options.inspect(value,options),`${key} => ${value}`}function mapToEntries(map){let entries=[];return map.forEach((value,key)=>{entries.push([key,value]);}),entries}function inspectMap(map,options){return map.size-1<=0?"Map{}":(options.truncate-=7,`Map{ ${inspectList(mapToEntries(map),options,inspectMapEntry)} }`)}var isNaN=Number.isNaN||(i=>i!==i);function inspectNumber(number,options){return isNaN(number)?options.stylize("NaN","number"):number===1/0?options.stylize("Infinity","number"):number===-1/0?options.stylize("-Infinity","number"):number===0?options.stylize(1/number===1/0?"+0":"-0","number"):options.stylize(truncate(String(number),options.truncate),"number")}function inspectBigInt(number,options){let nums=truncate(number.toString(),options.truncate-1);return nums!==truncator&&(nums+="n"),options.stylize(nums,"bigint")}function inspectRegExp(value,options){let flags=value.toString().split("/")[2],sourceLength=options.truncate-(2+flags.length),source=value.source;return options.stylize(`/${truncate(source,sourceLength)}/${flags}`,"regexp")}function arrayFromSet(set){let values=[];return set.forEach(value=>{values.push(value);}),values}function inspectSet(set,options){return set.size===0?"Set{}":(options.truncate-=7,`Set{ ${inspectList(arrayFromSet(set),options)} }`)}var stringEscapeChars=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),escapeCharacters={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},hex=16,unicodeLength=4;function escape(char){return escapeCharacters[char]||`\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}`}function inspectString(string,options){return stringEscapeChars.test(string)&&(string=string.replace(stringEscapeChars,escape)),options.stylize(`'${truncate(string,options.truncate-2)}'`,"string")}function inspectSymbol(value){return "description"in Symbol.prototype?value.description?`Symbol(${value.description})`:"Symbol()":value.toString()}var getPromiseValue=()=>"Promise{\u2026}";try{let{getPromiseDetails,kPending,kRejected}=process.binding("util");Array.isArray(getPromiseDetails(Promise.resolve()))&&(getPromiseValue=(value,options)=>{let[state,innerValue]=getPromiseDetails(value);return state===kPending?"Promise{}":`Promise${state===kRejected?"!":""}{${options.inspect(innerValue,options)}}`});}catch{}var promise_default=getPromiseValue;function inspectObject(object,options){let properties=Object.getOwnPropertyNames(object),symbols=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(object):[];if(properties.length===0&&symbols.length===0)return "{}";if(options.truncate-=4,options.seen=options.seen||[],options.seen.includes(object))return "[Circular]";options.seen.push(object);let propertyContents=inspectList(properties.map(key=>[key,object[key]]),options,inspectProperty),symbolContents=inspectList(symbols.map(key=>[key,object[key]]),options,inspectProperty);options.seen.pop();let sep="";return propertyContents&&symbolContents&&(sep=", "),`{ ${propertyContents}${sep}${symbolContents} }`}var toStringTag=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function inspectClass(value,options){let name="";return toStringTag&&toStringTag in value&&(name=value[toStringTag]),name=name||value.constructor.name,(!name||name==="_class")&&(name=""),options.truncate-=name.length,`${name}${inspectObject(value,options)}`}function inspectArguments(args,options){return args.length===0?"Arguments[]":(options.truncate-=13,`Arguments[ ${inspectList(args,options)} ]`)}var errorKeys=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function inspectObject2(error,options){let properties=Object.getOwnPropertyNames(error).filter(key=>errorKeys.indexOf(key)===-1),name=error.name;options.truncate-=name.length;let message="";if(typeof error.message=="string"?message=truncate(error.message,options.truncate):properties.unshift("message"),message=message?`: ${message}`:"",options.truncate-=message.length+5,options.seen=options.seen||[],options.seen.includes(error))return "[Circular]";options.seen.push(error);let propertyContents=inspectList(properties.map(key=>[key,error[key]]),options,inspectProperty);return `${name}${message}${propertyContents?` { ${propertyContents} }`:""}`}function inspectAttribute([key,value],options){return options.truncate-=3,value?`${options.stylize(String(key),"yellow")}=${options.stylize(`"${value}"`,"string")}`:`${options.stylize(String(key),"yellow")}`}function inspectHTMLCollection(collection,options){return inspectList(collection,options,inspectHTML,` `)}function inspectHTML(element,options){let properties=element.getAttributeNames(),name=element.tagName.toLowerCase(),head=options.stylize(`<${name}`,"special"),headClose=options.stylize(">","special"),tail=options.stylize(``,"special");options.truncate-=name.length*2+5;let propertyContents="";properties.length>0&&(propertyContents+=" ",propertyContents+=inspectList(properties.map(key=>[key,element.getAttribute(key)]),options,inspectAttribute," ")),options.truncate-=propertyContents.length;let truncate2=options.truncate,children=inspectHTMLCollection(element.children,options);return children&&children.length>truncate2&&(children=`${truncator}(${element.children.length})`),`${head}${propertyContents}${headClose}${children}${tail}`}var symbolsSupported=typeof Symbol=="function"&&typeof Symbol.for=="function",chaiInspect=symbolsSupported?Symbol.for("chai/inspect"):"@@chai/inspect",nodeInspect=!1;try{let nodeUtil=__require("util");nodeInspect=nodeUtil.inspect?nodeUtil.inspect.custom:!1;}catch{nodeInspect=!1;}var constructorMap=new WeakMap,stringTagMap={},baseTypesMap={undefined:(value,options)=>options.stylize("undefined","undefined"),null:(value,options)=>options.stylize("null","null"),boolean:(value,options)=>options.stylize(String(value),"boolean"),Boolean:(value,options)=>options.stylize(String(value),"boolean"),number:inspectNumber,Number:inspectNumber,bigint:inspectBigInt,BigInt:inspectBigInt,string:inspectString,String:inspectString,function:inspectFunction,Function:inspectFunction,symbol:inspectSymbol,Symbol:inspectSymbol,Array:inspectArray,Date:inspectDate,Map:inspectMap,Set:inspectSet,RegExp:inspectRegExp,Promise:promise_default,WeakSet:(value,options)=>options.stylize("WeakSet{\u2026}","special"),WeakMap:(value,options)=>options.stylize("WeakMap{\u2026}","special"),Arguments:inspectArguments,Int8Array:inspectTypedArray,Uint8Array:inspectTypedArray,Uint8ClampedArray:inspectTypedArray,Int16Array:inspectTypedArray,Uint16Array:inspectTypedArray,Int32Array:inspectTypedArray,Uint32Array:inspectTypedArray,Float32Array:inspectTypedArray,Float64Array:inspectTypedArray,Generator:()=>"",DataView:()=>"",ArrayBuffer:()=>"",Error:inspectObject2,HTMLCollection:inspectHTMLCollection,NodeList:inspectHTMLCollection},inspectCustom=(value,options,type)=>chaiInspect in value&&typeof value[chaiInspect]=="function"?value[chaiInspect](options):nodeInspect&&nodeInspect in value&&typeof value[nodeInspect]=="function"?value[nodeInspect](options.depth,options):"inspect"in value&&typeof value.inspect=="function"?value.inspect(options.depth,options):"constructor"in value&&constructorMap.has(value.constructor)?constructorMap.get(value.constructor)(value,options):stringTagMap[type]?stringTagMap[type](value,options):"",toString2=Object.prototype.toString;function inspect(value,opts={}){let options=normaliseOptions(opts,inspect),{customInspect}=options,type=value===null?"null":typeof value;if(type==="object"&&(type=toString2.call(value).slice(8,-1)),type in baseTypesMap)return baseTypesMap[type](value,options);if(customInspect&&value){let output=inspectCustom(value,options,type);if(output)return typeof output=="string"?output:inspect(output,options)}let proto=value?Object.getPrototypeOf(value):!1;return proto===Object.prototype||proto===null?inspectObject(value,options):value&&typeof HTMLElement=="function"&&value instanceof HTMLElement?inspectHTML(value,options):"constructor"in value?value.constructor!==Object?inspectClass(value,options):inspectObject(value,options):value===Object(value)?inspectObject(value,options):options.stylize(String(value),type)}var{AsymmetricMatcher,DOMCollection,DOMElement,Immutable,ReactElement,ReactTestComponent}=plugins,PLUGINS=[ReactTestComponent,ReactElement,DOMElement,DOMCollection,Immutable,AsymmetricMatcher];function stringify(object,maxDepth=10,{maxLength,...options}={}){let MAX_LENGTH=maxLength??1e4,result;try{result=format(object,{maxDepth,escapeString:!1,plugins:PLUGINS,...options});}catch{result=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=/%[sdjifoOc%]/g;function format2(...args){if(typeof args[0]!="string"){let objects=[];for(let i2=0;i2{if(x==="%%")return "%";if(i>=len)return x;switch(x){case"%s":{let value=args[i++];return typeof value=="bigint"?`${value.toString()}n`:typeof value=="number"&&value===0&&1/value<0?"-0":typeof value=="object"&&value!==null?inspect2(value,{depth:0,colors:!1}):String(value)}case"%d":{let value=args[i++];return typeof value=="bigint"?`${value.toString()}n`:Number(value).toString()}case"%i":{let value=args[i++];return typeof value=="bigint"?`${value.toString()}n`:Number.parseInt(String(value)).toString()}case"%f":return Number.parseFloat(String(args[i++])).toString();case"%o":return inspect2(args[i++],{showHidden:!0,showProxy:!0});case"%O":return inspect2(args[i++]);case"%c":return i++,"";case"%j":try{return JSON.stringify(args[i++])}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[i];icollector.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.from({length:k=val.length}),seen.set(val,out);k--;)out[k]=clone(val[k],seen,options);return out}if(Object.prototype.toString.call(val)==="[object Object]"){out=Object.create(Object.getPrototypeOf(val)),seen.set(val,out);let props=getOwnProperties(val);for(let k2 of props){let descriptor=Object.getOwnPropertyDescriptor(val,k2);if(!descriptor)continue;let cloned=clone(val[k2],seen,options);options.forceWritable?Object.defineProperty(out,k2,{enumerable:descriptor.enumerable,configurable:!0,writable:!0,value:cloned}):"get"in descriptor?Object.defineProperty(out,k2,{...descriptor,get(){return cloned}}):Object.defineProperty(out,k2,{...descriptor,value:cloned});}return out}return val}function getType3(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;}},diff_commonPrefix=function(text1,text2){if(!text1||!text2||text1.charAt(0)!==text2.charAt(0))return 0;let pointermin=0,pointermax=Math.min(text1.length,text2.length),pointermid=pointermax,pointerstart=0;for(;pointermintext2_length?text1=text1.substring(text1_length-text2_length):text1_length0?equalities[equalitiesLength-1]:-1,length_insertions1=0,length_deletions1=0,length_insertions2=0,length_deletions2=0,lastEquality=null,changes=!0)),pointer++;for(changes&&diff_cleanupMerge(diffs),diff_cleanupSemanticLossless(diffs),pointer=1;pointer=overlap_length2?(overlap_length1>=deletion.length/2||overlap_length1>=insertion.length/2)&&(diffs.splice(pointer,0,new Diff(DIFF_EQUAL,insertion.substring(0,overlap_length1))),diffs[pointer-1][1]=deletion.substring(0,deletion.length-overlap_length1),diffs[pointer+1][1]=insertion.substring(overlap_length1),pointer++):(overlap_length2>=deletion.length/2||overlap_length2>=insertion.length/2)&&(diffs.splice(pointer,0,new Diff(DIFF_EQUAL,deletion.substring(0,overlap_length2))),diffs[pointer-1][0]=DIFF_INSERT,diffs[pointer-1][1]=insertion.substring(0,insertion.length-overlap_length2),diffs[pointer+1][0]=DIFF_DELETE,diffs[pointer+1][1]=deletion.substring(overlap_length2),pointer++),pointer++;}pointer++;}},nonAlphaNumericRegex_=/[^a-z0-9]/i,whitespaceRegex_=/\s/,linebreakRegex_=/[\r\n]/,blanklineEndRegex_=/\n\r?\n$/,blanklineStartRegex_=/^\r?\n\r?\n/;function diff_cleanupSemanticLossless(diffs){let pointer=1;for(;pointer=bestScore&&(bestScore=score,bestEquality1=equality1,bestEdit=edit,bestEquality2=equality2);}diffs[pointer-1][1]!==bestEquality1&&(bestEquality1?diffs[pointer-1][1]=bestEquality1:(diffs.splice(pointer-1,1),pointer--),diffs[pointer][1]=bestEdit,bestEquality2?diffs[pointer+1][1]=bestEquality2:(diffs.splice(pointer+1,1),pointer--));}pointer++;}}function diff_cleanupMerge(diffs){diffs.push(new Diff(DIFF_EQUAL,""));let pointer=0,count_delete=0,count_insert=0,text_delete="",text_insert="",commonlength;for(;pointer1?(count_delete!==0&&count_insert!==0&&(commonlength=diff_commonPrefix(text_insert,text_delete),commonlength!==0&&(pointer-count_delete-count_insert>0&&diffs[pointer-count_delete-count_insert-1][0]===DIFF_EQUAL?diffs[pointer-count_delete-count_insert-1][1]+=text_insert.substring(0,commonlength):(diffs.splice(0,0,new Diff(DIFF_EQUAL,text_insert.substring(0,commonlength))),pointer++),text_insert=text_insert.substring(commonlength),text_delete=text_delete.substring(commonlength)),commonlength=diff_commonSuffix(text_insert,text_delete),commonlength!==0&&(diffs[pointer][1]=text_insert.substring(text_insert.length-commonlength)+diffs[pointer][1],text_insert=text_insert.substring(0,text_insert.length-commonlength),text_delete=text_delete.substring(0,text_delete.length-commonlength))),pointer-=count_delete+count_insert,diffs.splice(pointer,count_delete+count_insert),text_delete.length&&(diffs.splice(pointer,0,new Diff(DIFF_DELETE,text_delete)),pointer++),text_insert.length&&(diffs.splice(pointer,0,new Diff(DIFF_INSERT,text_insert)),pointer++),pointer++):pointer!==0&&diffs[pointer-1][0]===DIFF_EQUAL?(diffs[pointer-1][1]+=diffs[pointer][1],diffs.splice(pointer,1)):pointer++,count_insert=0,count_delete=0,text_delete="",text_insert="";break}diffs[diffs.length-1][1]===""&&diffs.pop();let changes=!1;for(pointer=1;pointer{let nCommon=0;for(;aIndex{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{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{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{let bR=bEnd-aEnd,aLength=aEnd-aStart,baDeltaLength=bEnd-bStart-aLength,kMinOverlapR=baDeltaLength-d,kMaxOverlapR=baDeltaLength+d,aIndexPrev1=NOT_YET_SET,nR=d{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{if(bEnd-bStart{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{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);}}return build}var buildExports=requireBuild(),diffSequences=getDefaultExportFromCjs(buildExports);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,i=0;for(;i!==iLength;){let iStart=i;for(;i!==iLength&&diffs[i][0]===DIFF_EQUAL;)i+=1;if(iStart!==i)if(iStart===0)i>nContextLines&&(jLength-=i-nContextLines,hasExcessAtStartOrEnd=!0);else if(i===iLength){let n=i-iStart;n>nContextLines&&(jLength-=n-nContextLines,hasExcessAtStartOrEnd=!0);}else {let n=i-iStart;n>nContextLines2&&(jLength-=n-nContextLines2,nExcessesBetweenChanges+=1);}for(;i!==iLength&&diffs[i][0]!==DIFF_EQUAL;)i+=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(i=0;i!==iLength;){let iStart=i;for(;i!==iLength&&diffs[i][0]===DIFF_EQUAL;)i+=1;if(iStart!==i)if(iStart===0){i>nContextLines&&(iStart=i-nContextLines,aStart=iStart,bStart=iStart,aEnd=aStart,bEnd=bStart);for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else if(i===iLength){let iEnd=i-iStart>nContextLines?iStart+nContextLines:i;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else {let nCommon=i-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=i-nContextLines;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}for(;i!==iLength&&diffs[i][0]===DIFF_DELETE;)pushDeleteLine(diffs[i][1]),i+=1;for(;i!==iLength&&diffs[i][0]===DIFF_INSERT;)pushInsertLine(diffs[i][1]),i+=1;}return hasPatch&&(lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options)),lines.join(` `)}function joinAlignedDiffsExpand(diffs,options){return diffs.map((diff2,i,diffs2)=>{let line=diff2[1],isFirstOrLast=i===0||i===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(` `)}var noColor=string=>string,DIFF_CONTEXT_DEFAULT=5,DIFF_TRUNCATE_THRESHOLD_DEFAULT=0;function getDefaultOptions(){return {aAnnotation:"Expected",aColor:f2.green,aIndicator:"-",bAnnotation:"Received",bColor:f2.red,bIndicator:"+",changeColor:f2.inverse,changeLineTrailingSpaceColor:noColor,commonColor:f2.dim,commonIndicator:" ",commonLineTrailingSpaceColor:noColor,compareKeys:void 0,contextLines:DIFF_CONTEXT_DEFAULT,emptyFirstOrLastLinePlaceholder:"",expand:!0,includeChangeCounts:!1,omitAnnotationLines:!1,patchColor:f2.yellow,truncateThreshold:DIFF_TRUNCATE_THRESHOLD_DEFAULT,truncateAnnotation:"... Diff result is truncated",truncateAnnotationColor:noColor}}function getCompareKeys(compareKeys){return compareKeys&&typeof compareKeys=="function"?compareKeys:void 0}function getContextLines(contextLines){return typeof contextLines=="number"&&Number.isSafeInteger(contextLines)&&contextLines>=0?contextLines:DIFF_CONTEXT_DEFAULT}function normalizeDiffOptions(options={}){return {...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 a2=0,b=0;return diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:a2+=1;break;case DIFF_INSERT:b+=1;break}}),{a:a2,b}}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 a2=`${aIndicator} ${aAnnotation}${aRest}`,b=`${bIndicator} ${bAnnotation}${bRest}`;return `${aColor(a2)} ${bColor(b)} `}function printDiffLines(diffs,truncated,options){return printAnnotation(options,countChanges(diffs))+(options.expand?joinAlignedDiffsExpand(diffs,options):joinAlignedDiffsNoExpand(diffs,options))+(truncated?options.truncateAnnotationColor(` ${options.truncateAnnotation}`):"")}function diffLinesUnified(aLines,bLines,options){let normalizedOptions=normalizeDiffOptions(options),[diffs,truncated]=diffLinesRaw(isEmptyString(aLines)?[]:aLines,isEmptyString(bLines)?[]:bLines,normalizedOptions);return printDiffLines(diffs,truncated,normalizedOptions)}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,truncated]=diffLinesRaw(aLinesCompare,bLinesCompare,options),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,truncated,normalizeDiffOptions(options))}function diffLinesRaw(aLines,bLines,options){let truncate2=options?.truncateThreshold??!1,truncateThreshold=Math.max(Math.floor(options?.truncateThreshold??0),0),aLength=truncate2?Math.min(aLines.length,truncateThreshold):aLines.length,bLength=truncate2?Math.min(bLines.length,truncateThreshold):bLines.length,truncated=aLength!==aLines.length||bLength!==bLines.length,isCommon=(aIndex2,bIndex2)=>aLines[aIndex2]===bLines[bIndex2],diffs=[],aIndex=0,bIndex=0;for(diffSequences(aLength,bLength,isCommon,(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]));});aIndex!==aLength;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bLength;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));return [diffs,truncated]}function getNewLineSymbol(string){return string.includes(`\r `)?`\r `:` `}function diffStrings(a2,b,options){let truncate2=options?.truncateThreshold??!1,truncateThreshold=Math.max(Math.floor(options?.truncateThreshold??0),0),aLength=a2.length,bLength=b.length;if(truncate2){let aMultipleLines=a2.includes(` `),bMultipleLines=b.includes(` `),aNewLineSymbol=getNewLineSymbol(a2),bNewLineSymbol=getNewLineSymbol(b),_a=aMultipleLines?`${a2.split(aNewLineSymbol,truncateThreshold).join(aNewLineSymbol)} `:a2,_b=bMultipleLines?`${b.split(bNewLineSymbol,truncateThreshold).join(bNewLineSymbol)} `:b;aLength=_a.length,bLength=_b.length;}let truncated=aLength!==a2.length||bLength!==b.length,isCommon=(aIndex2,bIndex2)=>a2[aIndex2]===b[bIndex2],aIndex=0,bIndex=0,diffs=[];return diffSequences(aLength,bLength,isCommon,(nCommon,aCommon,bCommon)=>{aIndex!==aCommon&&diffs.push(new Diff(DIFF_DELETE,a2.slice(aIndex,aCommon))),bIndex!==bCommon&&diffs.push(new Diff(DIFF_INSERT,b.slice(bIndex,bCommon))),aIndex=aCommon+nCommon,bIndex=bCommon+nCommon,diffs.push(new Diff(DIFF_EQUAL,b.slice(bCommon,bIndex)));}),aIndex!==aLength&&diffs.push(new Diff(DIFF_DELETE,a2.slice(aIndex))),bIndex!==bLength&&diffs.push(new Diff(DIFF_INSERT,b.slice(bIndex))),[diffs,truncated]}function concatenateRelevantDiffs(op,diffs,changeColor){return diffs.reduce((reduced,diff2)=>reduced+(diff2[0]===DIFF_EQUAL?diff2[1]:diff2[0]===op&&diff2[1].length!==0?changeColor(diff2[1]):""),"")}var ChangeBuffer=class{op;line;lines;changeColor;constructor(op,changeColor){this.op=op,this.line=[],this.lines=[],this.changeColor=changeColor;}pushSubstring(substring){this.pushDiff(new Diff(this.op,substring));}pushLine(){this.lines.push(this.line.length!==1?new Diff(this.op,concatenateRelevantDiffs(this.op,this.line,this.changeColor)):this.line[0][0]===this.op?this.line[0]:new Diff(this.op,this.line[0][1])),this.line.length=0;}isLineEmpty(){return this.line.length===0}pushDiff(diff2){this.line.push(diff2);}align(diff2){let string=diff2[1];if(string.includes(` `)){let substrings=string.split(` `),iLast=substrings.length-1;substrings.forEach((substring,i)=>{i{if(i===0){let subdiff=new Diff(op,substring);this.deleteBuffer.isLineEmpty()&&this.insertBuffer.isLineEmpty()?(this.flushChangeLines(),this.pushDiffCommonLine(subdiff)):(this.pushDiffChangeLines(subdiff),this.flushChangeLines());}else i{switch(diff2[0]){case DIFF_DELETE:deleteBuffer.align(diff2);break;case DIFF_INSERT:insertBuffer.align(diff2);break;default:commonBuffer.align(diff2);}}),commonBuffer.getLines()}function hasCommonDiff(diffs,isMultiline){if(isMultiline){let iLast=diffs.length-1;return diffs.some((diff2,i)=>diff2[0]===DIFF_EQUAL&&(i!==iLast||diff2[1]!==` `))}return diffs.some(diff2=>diff2[0]===DIFF_EQUAL)}function diffStringsUnified(a2,b,options){if(a2!==b&&a2.length!==0&&b.length!==0){let isMultiline=a2.includes(` `)||b.includes(` `),[diffs,truncated]=diffStringsRaw(isMultiline?`${a2} `:a2,isMultiline?`${b} `:b,!0,options);if(hasCommonDiff(diffs,isMultiline)){let optionsNormalized=normalizeDiffOptions(options),lines=getAlignedDiffs(diffs,optionsNormalized.changeColor);return printDiffLines(lines,truncated,optionsNormalized)}}return diffLinesUnified(a2.split(` `),b.split(` `),options)}function diffStringsRaw(a2,b,cleanup,options){let[diffs,truncated]=diffStrings(a2,b,options);return cleanup&&diff_cleanupSemantic(diffs),[diffs,truncated]}function getCommonMessage(message,options){let{commonColor}=normalizeDiffOptions(options);return commonColor(message)}var{AsymmetricMatcher:AsymmetricMatcher2,DOMCollection:DOMCollection2,DOMElement:DOMElement2,Immutable:Immutable2,ReactElement:ReactElement2,ReactTestComponent:ReactTestComponent2}=plugins,PLUGINS2=[ReactTestComponent2,ReactElement2,DOMElement2,DOMCollection2,Immutable2,AsymmetricMatcher2],FORMAT_OPTIONS={plugins:PLUGINS2},FALLBACK_FORMAT_OPTIONS={callToJSON:!1,maxDepth:10,plugins:PLUGINS2};function diff(a2,b,options){if(Object.is(a2,b))return "";let aType=getType3(a2),expectedType=aType,omitDifference=!1;if(aType==="object"&&typeof a2.asymmetricMatch=="function"){if(a2.$$typeof!==Symbol.for("jest.asymmetricMatcher")||typeof a2.getExpectedType!="function")return;expectedType=a2.getExpectedType(),omitDifference=expectedType==="string";}if(expectedType!==getType3(b)){let{aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator}=normalizeDiffOptions(options),formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options),aDisplay=format(a2,formatOptions),bDisplay=format(b,formatOptions),aDiff=`${aColor(`${aIndicator} ${aAnnotation}:`)} ${aDisplay}`,bDiff=`${bColor(`${bIndicator} ${bAnnotation}:`)} ${bDisplay}`;return `${aDiff} ${bDiff}`}if(!omitDifference)switch(aType){case"string":return diffLinesUnified(a2.split(` `),b.split(` `),options);case"boolean":case"number":return comparePrimitive(a2,b,options);case"map":return compareObjects(sortMap(a2),sortMap(b),options);case"set":return compareObjects(sortSet(a2),sortSet(b),options);default:return compareObjects(a2,b,options)}}function comparePrimitive(a2,b,options){let aFormat=format(a2,FORMAT_OPTIONS),bFormat=format(b,FORMAT_OPTIONS);return aFormat===bFormat?"":diffLinesUnified(aFormat.split(` `),bFormat.split(` `),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(a2,b,options){let difference,hasThrown=!1;try{let formatOptions=getFormatOptions(FORMAT_OPTIONS,options);difference=getObjectsDifference(a2,b,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(a2,b,formatOptions,options),difference!==noDiffMessage&&!hasThrown&&(difference=`${getCommonMessage(SIMILAR_MESSAGE,options)} ${difference}`);}return difference}function getFormatOptions(formatOptions,options){let{compareKeys}=normalizeDiffOptions(options);return {...formatOptions,compareKeys}}function getObjectsDifference(a2,b,formatOptions,options){let formatOptionsZeroIndent={...formatOptions,indent:0},aCompare=format(a2,formatOptionsZeroIndent),bCompare=format(b,formatOptionsZeroIndent);if(aCompare===bCompare)return getCommonMessage(NO_DIFF_MESSAGE,options);{let aDisplay=format(a2,formatOptions),bDisplay=format(b,formatOptions);return diffLinesUnified2(aDisplay.split(` `),bDisplay.split(` `),aCompare.split(` `),bCompare.split(` `),options)}}var MAX_DIFF_STRING_LENGTH=2e4;function isAsymmetricMatcher(data){return getType2(data)==="Object"&&typeof data.asymmetricMatch=="function"}function isReplaceable(obj1,obj2){let obj1Type=getType2(obj1),obj2Type=getType2(obj2);return obj1Type===obj2Type&&(obj1Type==="Object"||obj1Type==="Array")}function printDiffOrStringify(expected,received,options){let{aAnnotation,bAnnotation}=normalizeDiffOptions(options);if(typeof expected=="string"&&typeof received=="string"&&expected.length>0&&received.length>0&&expected.length<=MAX_DIFF_STRING_LENGTH&&received.length<=MAX_DIFF_STRING_LENGTH&&expected!==received){if(expected.includes(` `)||received.includes(` `))return diffStringsUnified(received,expected,options);let[diffs]=diffStringsRaw(received,expected,!0),hasCommonDiff2=diffs.some(diff2=>diff2[0]===DIFF_EQUAL),printLabel=getLabelPrinter(aAnnotation,bAnnotation),expectedLine=printLabel(aAnnotation)+printExpected(getCommonAndChangedSubstrings(diffs,DIFF_DELETE,hasCommonDiff2)),receivedLine=printLabel(bAnnotation)+printReceived(getCommonAndChangedSubstrings(diffs,DIFF_INSERT,hasCommonDiff2));return `${expectedLine} ${receivedLine}`}let clonedExpected=deepClone(expected,{forceWritable:!0}),clonedReceived=deepClone(received,{forceWritable:!0}),{replacedExpected,replacedActual}=replaceAsymmetricMatcher(clonedExpected,clonedReceived);return diff(replacedExpected,replacedActual,options)}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}}function getLabelPrinter(...strings){let maxLength=strings.reduce((max,string)=>string.length>max?string.length:max,0);return string=>`${string}: ${" ".repeat(maxLength-string.length)}`}var SPACE_SYMBOL="\xB7";function replaceTrailingSpaces(text){return text.replace(/\s+$/gm,spaces=>SPACE_SYMBOL.repeat(spaces.length))}function printReceived(object){return f2.red(replaceTrailingSpaces(stringify(object)))}function printExpected(value){return f2.green(replaceTrailingSpaces(stringify(value)))}function getCommonAndChangedSubstrings(diffs,op,hasCommonDiff2){return diffs.reduce((reduced,diff2)=>reduced+(diff2[0]===DIFF_EQUAL?diff2[1]:diff2[0]===op?hasCommonDiff2?f2.inverse(diff2[1]):diff2[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?`: ${err.message}`:typeof err=="string"?`: ${err}`:""}function serializeValue(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 serializeValue(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()} ${format2(val.sample)}`;if(typeof val.toJSON=="function")return serializeValue(val.toJSON(),seen);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,i)=>{try{clone2[i]=serializeValue(e,seen);}catch(err){clone2[i]=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]=serializeValue(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|vi_import)_\d+__\./g,"")}function processError(_err,diffOptions,seen=new WeakSet){if(!_err||typeof _err!="object")return {message:String(_err)};let err=_err;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)&&(err.diff=printDiffOrStringify(err.actual,err.expected,{...diffOptions,...err.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));}catch{}try{!seen.has(err)&&typeof err.cause=="object"&&(seen.add(err),err.cause=processError(err.cause,diffOptions,seen));}catch{}try{return serializeValue(err)}catch(e){return serializeValue(new Error(`Failed to fully serialize error: ${e?.message} Inner error message: ${err?.message}`))}}var CallStates=(CallStates2=>(CallStates2.DONE="done",CallStates2.ERROR="error",CallStates2.ACTIVE="active",CallStates2.WAITING="waiting",CallStates2))(CallStates||{});var EVENTS={CALL:"storybook/instrumenter/call",SYNC:"storybook/instrumenter/sync",START:"storybook/instrumenter/start",BACK:"storybook/instrumenter/back",GOTO:"storybook/instrumenter/goto",NEXT:"storybook/instrumenter/next",END:"storybook/instrumenter/end"},controlsDisabled={start:!1,back:!1,goto:!1,next:!1,end:!1},alreadyCompletedException=new Error("This function ran after the play function completed. Did you forget to `await` it?"),isObject=o=>Object.prototype.toString.call(o)==="[object Object]",isModule=o=>Object.prototype.toString.call(o)==="[object Module]",isInstrumentable=o=>{if(!isObject(o)&&!isModule(o))return !1;if(o.constructor===void 0)return !0;let proto=o.constructor.prototype;return !!isObject(proto)},construct=obj=>{try{return new obj.constructor}catch{return {}}},getInitialState=()=>({renderPhase:void 0,isDebugging:!1,isPlaying:!1,isLocked:!1,cursor:0,calls:[],shadowCalls:[],callRefsByResult:new Map,chainedCallIds:new Set,ancestors:[],playUntil:void 0,resolvers:{},syncTimeout:void 0}),getRetainedState=(state,isDebugging=!1)=>{let calls=(isDebugging?state.shadowCalls:state.calls).filter(call=>call.retain);if(!calls.length)return;let callRefsByResult=new Map(Array.from(state.callRefsByResult.entries()).filter(([,ref])=>ref.retain));return {cursor:calls.length,calls,callRefsByResult}},Instrumenter=class{constructor(){this.initialized=!1;this.channel=addons.getChannel(),this.state=global.window?.parent.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__||{};let resetState=({storyId,isPlaying=!0,isDebugging=!1})=>{let state=this.getState(storyId);this.setState(storyId,{...getInitialState(),...getRetainedState(state,isDebugging),shadowCalls:isDebugging?state.shadowCalls:[],chainedCallIds:isDebugging?state.chainedCallIds:new Set,playUntil:isDebugging?state.playUntil:void 0,isPlaying,isDebugging}),this.sync(storyId);};this.channel.on(FORCE_REMOUNT,resetState),this.channel.on(STORY_RENDER_PHASE_CHANGED,({storyId,newPhase})=>{let{isDebugging}=this.getState(storyId);this.setState(storyId,{renderPhase:newPhase}),newPhase==="preparing"&&isDebugging&&resetState({storyId}),newPhase==="playing"&&resetState({storyId,isDebugging}),newPhase==="played"&&this.setState(storyId,{isLocked:!1,isPlaying:!1,isDebugging:!1}),newPhase==="errored"&&this.setState(storyId,{isLocked:!1,isPlaying:!1});}),this.channel.on(SET_CURRENT_STORY,()=>{this.initialized?this.cleanup():this.initialized=!0;});let start=({storyId,playUntil})=>{this.getState(storyId).isDebugging||this.setState(storyId,({calls})=>({calls:[],shadowCalls:calls.map(call=>({...call,status:"waiting"})),isDebugging:!0}));let log=this.getLog(storyId);this.setState(storyId,({shadowCalls})=>{if(playUntil||!log.length)return {playUntil};let firstRowIndex=shadowCalls.findIndex(call=>call.id===log[0].callId);return {playUntil:shadowCalls.slice(0,firstRowIndex).filter(call=>call.interceptable&&!call.ancestors?.length).slice(-1)[0]?.id}}),this.channel.emit(FORCE_REMOUNT,{storyId,isDebugging:!0});},back=({storyId})=>{let log=this.getLog(storyId).filter(call=>!call.ancestors?.length),last=log.reduceRight((res,item,index)=>res>=0||item.status==="waiting"?res:index,-1);start({storyId,playUntil:log[last-1]?.callId});},goto=({storyId,callId})=>{let{calls,shadowCalls,resolvers}=this.getState(storyId),call=calls.find(({id})=>id===callId),shadowCall=shadowCalls.find(({id})=>id===callId);if(!call&&shadowCall&&Object.values(resolvers).length>0){let nextId=this.getLog(storyId).find(c=>c.status==="waiting")?.callId;shadowCall.id!==nextId&&this.setState(storyId,{playUntil:shadowCall.id}),Object.values(resolvers).forEach(resolve=>resolve());}else start({storyId,playUntil:callId});},next=({storyId})=>{let{resolvers}=this.getState(storyId);if(Object.values(resolvers).length>0)Object.values(resolvers).forEach(resolve=>resolve());else {let nextId=this.getLog(storyId).find(c=>c.status==="waiting")?.callId;nextId?start({storyId,playUntil:nextId}):end({storyId});}},end=({storyId})=>{this.setState(storyId,{playUntil:void 0,isDebugging:!1}),Object.values(this.getState(storyId).resolvers).forEach(resolve=>resolve());};this.channel.on(EVENTS.START,start),this.channel.on(EVENTS.BACK,back),this.channel.on(EVENTS.GOTO,goto),this.channel.on(EVENTS.NEXT,next),this.channel.on(EVENTS.END,end);}getState(storyId){return this.state[storyId]||getInitialState()}setState(storyId,update){let state=this.getState(storyId),patch=typeof update=="function"?update(state):update;this.state={...this.state,[storyId]:{...state,...patch}},global.window?.parent&&(global.window.parent.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__=this.state);}cleanup(){this.state=Object.entries(this.state).reduce((acc,[storyId,state])=>{let retainedState=getRetainedState(state);return retainedState&&(acc[storyId]=Object.assign(getInitialState(),retainedState)),acc},{});let payload={controlStates:controlsDisabled,logItems:[]};this.channel.emit(EVENTS.SYNC,payload),global.window?.parent&&(global.window.parent.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__=this.state);}getLog(storyId){let{calls,shadowCalls}=this.getState(storyId),merged=[...shadowCalls];calls.forEach((call,index)=>{merged[index]=call;});let seen=new Set;return merged.reduceRight((acc,call)=>(call.args.forEach(arg=>{arg?.__callId__&&seen.add(arg.__callId__);}),call.path.forEach(node=>{node.__callId__&&seen.add(node.__callId__);}),(call.interceptable||call.exception)&&!seen.has(call.id)&&(acc.unshift({callId:call.id,status:call.status,ancestors:call.ancestors}),seen.add(call.id)),acc),[])}instrument(obj,options,depth=0){if(!isInstrumentable(obj))return obj;let{mutate=!1,path=[]}=options,keys=options.getKeys?options.getKeys(obj,depth):Object.keys(obj);return depth+=1,keys.reduce((acc,key)=>{let descriptor=getPropertyDescriptor(obj,key);if(typeof descriptor?.get=="function"){let getter=()=>descriptor?.get?.bind(obj)?.();return Object.defineProperty(acc,key,{get:()=>this.instrument(getter(),{...options,path:path.concat(key)},depth)}),acc}let value=obj[key];return typeof value!="function"?(acc[key]=this.instrument(value,{...options,path:path.concat(key)},depth),acc):"__originalFn__"in value&&typeof value.__originalFn__=="function"?(acc[key]=value,acc):(acc[key]=(...args)=>this.track(key,value,obj,args,options),acc[key].__originalFn__=value,Object.defineProperty(acc[key],"name",{value:key,writable:!1}),Object.keys(value).length>0&&Object.assign(acc[key],this.instrument({...value},{...options,path:path.concat(key)},depth)),acc)},mutate?obj:construct(obj))}track(method,fn,object,args,options){let storyId=args?.[0]?.__storyId__||global.__STORYBOOK_PREVIEW__?.selectionStore?.selection?.storyId,{cursor,ancestors}=this.getState(storyId);this.setState(storyId,{cursor:cursor+1});let id=`${ancestors.slice(-1)[0]||storyId} [${cursor}] ${method}`,{path=[],intercept=!1,retain=!1}=options,interceptable=typeof intercept=="function"?intercept(method,path):intercept,call={id,cursor,storyId,ancestors,path,method,args,interceptable,retain},result=(interceptable&&!ancestors.length?this.intercept:this.invoke).call(this,fn,object,call,options);return this.instrument(result,{...options,mutate:!0,path:[{__callId__:call.id}]})}intercept(fn,object,call,options){let{chainedCallIds,isDebugging,playUntil}=this.getState(call.storyId),isChainedUpon=chainedCallIds.has(call.id);return !isDebugging||isChainedUpon||playUntil?(playUntil===call.id&&this.setState(call.storyId,{playUntil:void 0}),this.invoke(fn,object,call,options)):new Promise(resolve=>{this.setState(call.storyId,({resolvers})=>({isLocked:!1,resolvers:{...resolvers,[call.id]:resolve}}));}).then(()=>(this.setState(call.storyId,state=>{let{[call.id]:_,...resolvers}=state.resolvers;return {isLocked:!0,resolvers}}),this.invoke(fn,object,call,options)))}invoke(fn,object,call,options){let{callRefsByResult,renderPhase}=this.getState(call.storyId),maximumDepth=25,serializeValues=(value,depth,seen)=>{if(seen.includes(value))return "[Circular]";if(seen=[...seen,value],depth>maximumDepth)return "...";if(callRefsByResult.has(value))return callRefsByResult.get(value);if(value instanceof Array)return value.map(it=>serializeValues(it,++depth,seen));if(value instanceof Date)return {__date__:{value:value.toISOString()}};if(value instanceof Error){let{name,message,stack}=value;return {__error__:{name,message,stack}}}if(value instanceof RegExp){let{flags,source}=value;return {__regexp__:{flags,source}}}if(value instanceof global.window?.HTMLElement){let{prefix,localName,id,classList,innerText}=value,classNames=Array.from(classList);return {__element__:{prefix,localName,id,classNames,innerText}}}return typeof value=="function"?{__function__:{name:"getMockName"in value?value.getMockName():value.name}}:typeof value=="symbol"?{__symbol__:{description:value.description}}:typeof value=="object"&&value?.constructor?.name&&value?.constructor?.name!=="Object"?{__class__:{name:value.constructor.name}}:Object.prototype.toString.call(value)==="[object Object]"?Object.fromEntries(Object.entries(value).map(([key,val])=>[key,serializeValues(val,++depth,seen)])):value},info={...call,args:call.args.map(arg=>serializeValues(arg,0,[]))};call.path.forEach(ref=>{ref?.__callId__&&this.setState(call.storyId,({chainedCallIds})=>({chainedCallIds:new Set(Array.from(chainedCallIds).concat(ref.__callId__))}));});let handleException=e=>{if(e instanceof Error){let{name,message,stack,callId=call.id}=e,{showDiff=void 0,diff:diff2=void 0,actual=void 0,expected=void 0}=e.name==="AssertionError"?processError(e):e,exception={name,message,stack,callId,showDiff,diff:diff2,actual,expected};if(this.update({...info,status:"error",exception}),this.setState(call.storyId,state=>({callRefsByResult:new Map([...Array.from(state.callRefsByResult.entries()),[e,{__callId__:call.id,retain:call.retain}]])})),call.ancestors?.length)throw Object.prototype.hasOwnProperty.call(e,"callId")||Object.defineProperty(e,"callId",{value:call.id}),e}throw e};try{if(renderPhase==="played"&&!call.retain)throw alreadyCompletedException;let finalArgs=(options.getArgs?options.getArgs(call,this.getState(call.storyId)):call.args).map(arg=>typeof arg!="function"||Object.keys(arg).length?arg:(...args)=>{let{cursor,ancestors}=this.getState(call.storyId);this.setState(call.storyId,{cursor:0,ancestors:[...ancestors,call.id]});let restore=()=>this.setState(call.storyId,{cursor,ancestors}),willRestore=!1;try{let res=arg(...args);return res instanceof Promise?(willRestore=!0,res.finally(restore)):res}finally{willRestore||restore();}}),result=fn.apply(object,finalArgs);return result&&["object","function","symbol"].includes(typeof result)&&this.setState(call.storyId,state=>({callRefsByResult:new Map([...Array.from(state.callRefsByResult.entries()),[result,{__callId__:call.id,retain:call.retain}]])})),this.update({...info,status:result instanceof Promise?"active":"done"}),result instanceof Promise?result.then(value=>(this.update({...info,status:"done"}),value),handleException):result}catch(e){return handleException(e)}}update(call){this.channel.emit(EVENTS.CALL,call),this.setState(call.storyId,({calls})=>{let callsById=calls.concat(call).reduce((a2,c)=>Object.assign(a2,{[c.id]:c}),{});return {calls:Object.values(callsById).sort((a2,b)=>a2.id.localeCompare(b.id,void 0,{numeric:!0}))}}),this.sync(call.storyId);}sync(storyId){let synchronize=()=>{let{isLocked,isPlaying}=this.getState(storyId),logItems=this.getLog(storyId),pausedAt=logItems.filter(({ancestors})=>!ancestors.length).find(item=>item.status==="waiting")?.callId,hasActive=logItems.some(item=>item.status==="active");if(isLocked||hasActive||logItems.length===0){let payload2={controlStates:controlsDisabled,logItems};this.channel.emit(EVENTS.SYNC,payload2);return}let hasPrevious=logItems.some(item=>item.status==="done"||item.status==="error"),payload={controlStates:{start:hasPrevious,back:hasPrevious,goto:!0,next:isPlaying,end:isPlaying},logItems,pausedAt};this.channel.emit(EVENTS.SYNC,payload);};this.setState(storyId,({syncTimeout})=>(clearTimeout(syncTimeout),{syncTimeout:setTimeout(synchronize,0)}));}};function instrument(obj,options={}){try{let forceInstrument=!1,skipInstrument=!1;return global.window?.location?.search?.includes("instrument=true")?forceInstrument=!0:global.window?.location?.search?.includes("instrument=false")&&(skipInstrument=!0),global.window?.parent===global.window&&!forceInstrument||skipInstrument?obj:(global.window&&!global.window.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__&&(global.window.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__=new Instrumenter),(global.window?.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER__).instrument(obj,options))}catch(e){return once.warn(e),obj}}function getPropertyDescriptor(obj,propName){let target=obj;for(;target!=null;){let descriptor=Object.getOwnPropertyDescriptor(target,propName);if(descriptor)return descriptor;target=Object.getPrototypeOf(target);}} export { CallStates, EVENTS, instrument };