/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/jsdom-testing-mocks@1.16.0/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var __create=Object.create,__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__typeError=e=>{throw TypeError(e)},__defNormalProp=(e,t,i)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,__spreadValues=(e,t)=>{for(var i in t||(t={}))__hasOwnProp.call(t,i)&&__defNormalProp(e,i,t[i]);if(__getOwnPropSymbols)for(var i of __getOwnPropSymbols(t))__propIsEnum.call(t,i)&&__defNormalProp(e,i,t[i]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__objRest=(e,t)=>{var i={};for(var n in e)__hasOwnProp.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))t.indexOf(n)<0&&__propIsEnum.call(e,n)&&(i[n]=e[n]);return i},__export=(e,t)=>{for(var i in t)__defProp(e,i,{get:t[i],enumerable:!0})},__copyProps=(e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of __getOwnPropNames(t))__hasOwnProp.call(e,r)||r===i||__defProp(e,r,{get:()=>t[r],enumerable:!(n=__getOwnPropDesc(t,r))||n.enumerable});return e},__toESM=(e,t,i)=>(i=null!=e?__create(__getProtoOf(e)):{},__copyProps(!t&&e&&e.__esModule?i:__defProp(i,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__accessCheck=(e,t,i)=>t.has(e)||__typeError("Cannot "+i),__privateGet=(e,t,i)=>(__accessCheck(e,t,"read from private field"),i?i.call(e):t.get(e)),__privateAdd=(e,t,i)=>t.has(e)?__typeError("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),__privateSet=(e,t,i,n)=>(__accessCheck(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),__privateMethod=(e,t,i)=>(__accessCheck(e,t,"access private method"),i),index_exports={};__export(index_exports,{MockedCSS:()=>MockedCSS,MockedCSSMathClamp:()=>MockedCSSMathClamp,MockedCSSMathInvert:()=>MockedCSSMathInvert,MockedCSSMathMax:()=>MockedCSSMathMax,MockedCSSMathMin:()=>MockedCSSMathMin,MockedCSSMathNegate:()=>MockedCSSMathNegate,MockedCSSMathProduct:()=>MockedCSSMathProduct,MockedCSSMathSum:()=>MockedCSSMathSum,MockedCSSMathValue:()=>MockedCSSMathValue,MockedCSSNumericValue:()=>MockedCSSNumericValue,MockedCSSUnitValue:()=>MockedCSSUnitValue,MockedDOMRect:()=>MockedDOMRect,MockedDOMRectReadOnly:()=>MockedDOMRectReadOnly,MockedIntersectionObserver:()=>MockedIntersectionObserver,configMocks:()=>configMocks,getConfig:()=>getConfig,initCSSTypedOM:()=>initCSSTypedOM,mockAnimationsApi:()=>mockAnimationsApi,mockCSSTypedOM:()=>initCSSTypedOM,mockDOMRect:()=>mockDOMRect,mockElementBoundingClientRect:()=>mockElementBoundingClientRect,mockIntersectionObserver:()=>mockIntersectionObserver,mockResizeObserver:()=>mockResizeObserver,mockViewport:()=>mockViewport,mockViewportForTestGroup:()=>mockViewportForTestGroup}),module.exports=__toCommonJS(index_exports);var UndefinedHookError=class extends Error{constructor(e){let t="";t=void 0!==(null==global?void 0:global.vi)?`jsdom-testing-mocks: ${e} is not defined. You can enable globals in your config or pass the hook manually to the configMocks function`:`jsdom-testing-mocks: ${e} is not defined. If you need to pass it manually, please use the configMocks function`,super(t)}},WrongEnvironmentError=class extends Error{constructor(){super("jsdom-testing-mocks: window is not defined. Please use this library in a browser environment")}},isJsdomEnv=()=>"undefined"!=typeof window,protectedProps=["_x","_y","_width","_height"],MockedDOMRectReadOnly=class{constructor(e=0,t=0,i=0,n=0){this._x=e,this._y=t,this._width=i,this._height=n,protectedProps.forEach((e=>{const t=Object.getOwnPropertyDescriptor(this,e);t&&Object.defineProperty(this,e,__spreadProps(__spreadValues({},t),{enumerable:!1}))}))}get x(){return this._x}set x(e){}get y(){return this._y}set y(e){}get width(){return this._width}set width(e){}get height(){return this._height}set height(e){}get left(){return this._x}set left(e){}get right(){return this._x+Math.max(0,this._width)}set right(e){}get top(){return this._y}set top(e){}get bottom(){return this._y+Math.max(0,this._height)}set bottom(e){}toJSON(){return{bottom:this.bottom,height:this.height,left:this.left,right:this.right,top:this.top,width:this.width,x:this.x,y:this.y}}toString(){return"[object DOMRectReadOnly]"}},MockedDOMRect=class extends MockedDOMRectReadOnly{constructor(e=0,t=0,i=0,n=0){super(e,t,i,n)}get x(){return super.x}set x(e){this._x=e}get y(){return super.y}set y(e){this._y=e}get width(){return super.width}set width(e){this._width=e}get height(){return super.height}set height(e){this._height=e}toString(){return"[object DOMRect]"}};function mockDOMRect(){if(!isJsdomEnv())throw new WrongEnvironmentError;Object.defineProperty(window,"DOMRectReadOnly",{writable:!0,configurable:!0,value:MockedDOMRectReadOnly}),Object.defineProperty(window,"DOMRect",{writable:!0,configurable:!0,value:MockedDOMRect})}var getThrowHookError=e=>()=>{throw new UndefinedHookError(e)},config={beforeAll:"undefined"!=typeof beforeAll?beforeAll:getThrowHookError("beforeAll"),afterAll:"undefined"!=typeof afterAll?afterAll:getThrowHookError("afterAll"),beforeEach:"undefined"!=typeof beforeEach?beforeEach:getThrowHookError("beforeEach"),afterEach:"undefined"!=typeof afterEach?afterEach:getThrowHookError("afterEach"),act:e=>e()},getConfig=()=>config,configMocks=({beforeAll:e,afterAll:t,beforeEach:i,afterEach:n,act:r})=>{e&&(config.beforeAll=e),t&&(config.afterAll=t),i&&(config.beforeEach=i),n&&(config.afterEach=n),r&&(config.act=r)},config2=getConfig(),defaultState={observers:[]},state=__spreadValues({},defaultState);function isElement(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:Boolean(e)&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function getObserversByNode(e){return state.observers.filter((t=>t.nodes.includes(e)))}function normalizeNodeDescriptions(e){return e.map((e=>isElement(e)?{node:e}:e))}function getNodeDescriptionsByObserver(e){const t=[];return e.forEach((({node:e,desc:i})=>{getObserversByNode(e).forEach((n=>{const r=t.find((({observer:e})=>e===n));r?r.nodeDescriptions.push({node:e,desc:i}):t.push({observer:n,nodeDescriptions:[{node:e,desc:i}]})}))})),t}function findNodeIndex(e,t){const i=e.findIndex((e=>t.isSameNode(e)));if(-1===i)throw new Error("IntersectionObserver mock: node not found");return i}var MockedIntersectionObserver=class{constructor(e,t){this.nodes=[],this.nodeStates=[],this.root=null,this.rootMargin="0px 0px 0px 0px",this.thresholds=[0],this.timeOrigin=0,this.callback=e,t&&(void 0!==t.root&&(this.root=t.root),void 0!==t.rootMargin&&(this.rootMargin=t.rootMargin),void 0!==t.threshold&&(this.thresholds=Array.isArray(t.threshold)?t.threshold:[t.threshold])),this.timeOrigin=performance.now(),state.observers.push(this)}observe(e){this.nodes.push(e),this.nodeStates.push({isIntersecting:!1,target:e,time:performance.now()-this.timeOrigin,rootBounds:new DOMRectReadOnly,intersectionRect:new DOMRectReadOnly,intersectionRatio:0,boundingClientRect:new DOMRectReadOnly})}unobserve(e){const t=this.nodes.findIndex((t=>t.isSameNode(e)));this.nodes.splice(t,1),this.nodeStates.splice(t,1)}disconnect(){this.nodes=[],this.nodeStates=[]}triggerNode(e,t){const i=findNodeIndex(this.nodes,e),n=this.nodeStates[i];this.nodeStates[i]=__spreadValues(__spreadProps(__spreadValues({},n),{time:performance.now()-this.timeOrigin,target:e}),t),this.callback([this.nodeStates[i]],this)}triggerNodes(e){if(0===e.length)return;const t=e.map((({node:e})=>findNodeIndex(this.nodes,e))),i=e.map((({node:e,desc:i},n)=>{const r=__spreadValues(__spreadProps(__spreadValues({},this.nodeStates[t[n]]),{time:performance.now()-this.timeOrigin,target:e}),i);return this.nodeStates[t[n]]=r,r}));this.callback(i,this)}takeRecords(){return[]}};function mockIntersectionObserver(){if(!isJsdomEnv())throw new WrongEnvironmentError;mockDOMRect();const e=window.IntersectionObserver;return Object.defineProperty(window,"IntersectionObserver",{writable:!0,configurable:!0,value:MockedIntersectionObserver}),config2.afterAll((()=>{window.IntersectionObserver=e})),{enterAll:e=>{config2.act((()=>{state.observers.forEach((t=>{const i=t.nodes.map((t=>({node:t,desc:__spreadProps(__spreadValues({intersectionRatio:1},e),{isIntersecting:!0})})));t.triggerNodes(i)}))}))},enterNode:(e,t)=>{const i=getObserversByNode(e);config2.act((()=>{i.forEach((i=>{i.triggerNode(e,__spreadProps(__spreadValues({intersectionRatio:1},t),{isIntersecting:!0}))}))}))},enterNodes:e=>{const t=getNodeDescriptionsByObserver(normalizeNodeDescriptions(e));config2.act((()=>{t.forEach((({observer:e,nodeDescriptions:t})=>{e.triggerNodes(t.map((({node:e,desc:t})=>({node:e,desc:__spreadProps(__spreadValues({intersectionRatio:1},t),{isIntersecting:!0})}))))}))}))},leaveAll:e=>{config2.act((()=>{state.observers.forEach((t=>{const i=t.nodes.map((t=>({node:t,desc:__spreadProps(__spreadValues({intersectionRatio:0},e),{isIntersecting:!1})})));t.triggerNodes(i)}))}))},leaveNode:(e,t)=>{const i=getObserversByNode(e);config2.act((()=>{i.forEach((i=>{i.triggerNode(e,__spreadProps(__spreadValues({intersectionRatio:0},t),{isIntersecting:!1}))}))}))},triggerNodes:e=>{const t=getNodeDescriptionsByObserver(normalizeNodeDescriptions(e));config2.act((()=>{t.forEach((({observer:e,nodeDescriptions:t})=>{e.triggerNodes(t)}))}))},leaveNodes:e=>{const t=getNodeDescriptionsByObserver(normalizeNodeDescriptions(e));config2.act((()=>{t.forEach((({observer:e,nodeDescriptions:t})=>{e.triggerNodes(t.map((({node:e,desc:t})=>({node:e,desc:__spreadProps(__spreadValues({intersectionRatio:0},t),{isIntersecting:!1})}))))}))}))},cleanup:()=>{window.IntersectionObserver=e,state.observers=[]}}}var config3=getConfig(),state2={observers:[],targetObservers:new Map,elementSizes:new Map};function resetState(){state2.observers=[],state2.targetObservers=new Map,state2.elementSizes=new Map}function defineResizeObserverSize(e){var t,i;return{blockSize:null!=(t=e.blockSize)?t:0,inlineSize:null!=(i=e.inlineSize)?i:0}}var MockedResizeObserver=class{constructor(e){this.observationTargets=new Set,this.activeTargets=new Set,this.observe=e=>{this.observationTargets.add(e),this.activeTargets.add(e),state2.targetObservers.has(e)?state2.targetObservers.get(e).push(this):state2.targetObservers.set(e,[this])},this.unobserve=e=>{this.observationTargets.delete(e);const t=state2.targetObservers.get(e);if(t){const i=t.findIndex((e=>e===this));t.splice(i,1),0===t.length&&state2.targetObservers.delete(e)}},this.disconnect=()=>{for(const e of this.observationTargets){const t=state2.targetObservers.get(e);if(t){const i=t.findIndex((e=>e===this));t.splice(i,1),0===t.length&&state2.targetObservers.delete(e)}}this.observationTargets.clear()},this.callback=e,state2.observers.push(this)}};function elementToEntry(e){const t=e.getBoundingClientRect();let i=state2.elementSizes.get(e);return i||(i={borderBoxSize:[{blockSize:t.width,inlineSize:t.height}],contentBoxSize:[{blockSize:t.width,inlineSize:t.height}],contentRect:t}),0===i.contentRect.width&&0===i.contentRect.height?null:{borderBoxSize:Object.freeze(i.borderBoxSize),contentBoxSize:Object.freeze(i.contentBoxSize),contentRect:i.contentRect,devicePixelContentBoxSize:Object.freeze(i.contentBoxSize.map((e=>({blockSize:e.blockSize*window.devicePixelRatio,inlineSize:e.inlineSize*window.devicePixelRatio})))),target:e}}function mockResizeObserver(){if(!isJsdomEnv())throw new WrongEnvironmentError;mockDOMRect();const e=window.ResizeObserver;return Object.defineProperty(window,"ResizeObserver",{writable:!0,configurable:!0,value:MockedResizeObserver}),config3.afterEach((()=>{resetState()})),config3.afterAll((()=>{window.ResizeObserver=e})),{getObservers:e=>{var t;return e?[...null!=(t=state2.targetObservers.get(e))?t:[]]:[...state2.observers]},getObservedElements:e=>e?[...e.observationTargets]:[...state2.targetObservers.keys()],mockElementSize:(e,t)=>{let i,n;if(!t.borderBoxSize&&t.contentBoxSize)Array.isArray(t.contentBoxSize)||(t.contentBoxSize=[t.contentBoxSize]),i=t.contentBoxSize.map(defineResizeObserverSize),n=i;else if(t.borderBoxSize&&!t.contentBoxSize)Array.isArray(t.borderBoxSize)||(t.borderBoxSize=[t.borderBoxSize]),i=t.borderBoxSize.map(defineResizeObserverSize),n=i;else{if(!t.borderBoxSize||!t.contentBoxSize)throw new Error("Neither borderBoxSize nor contentBoxSize was provided.");if(Array.isArray(t.borderBoxSize)||(t.borderBoxSize=[t.borderBoxSize]),Array.isArray(t.contentBoxSize)||(t.contentBoxSize=[t.contentBoxSize]),i=t.contentBoxSize.map(defineResizeObserverSize),n=t.borderBoxSize.map(defineResizeObserverSize),n.length!==i.length)throw new Error("Both borderBoxSize and contentBoxSize must have the same amount of elements.")}i.forEach(((e,t)=>{if(e.blockSize<0)throw new Error(`contentBoxSize[${t}].blockSize must not be negative.`);if(e.inlineSize<0)throw new Error(`contentBoxSize[${t}].inlineSize must not be negative.`)})),n.forEach(((e,t)=>{if(e.blockSize<0)throw new Error(`borderBoxSize[${t}].blockSize must not be negative.`);if(e.inlineSize<0)throw new Error(`borderBoxSize[${t}].inlineSize must not be negative.`)}));const r=new DOMRect(0,0,i.reduce(((e,t)=>e+t.inlineSize),0),i.reduce(((e,t)=>e+t.blockSize),0));state2.elementSizes.set(e,{contentBoxSize:i,borderBoxSize:n,contentRect:r})},resize:(e=[],{ignoreImplicit:t=!1}={})=>{config3.act((()=>{Array.isArray(e)||(e=[e]);for(const i of state2.observers){const n=e.filter((e=>i.observationTargets.has(e))),r=new Set([...n,...t?[]:i.activeTargets]);i.activeTargets.clear();const a=Array.from(r).map(elementToEntry).filter(Boolean);a.length>0&&i.callback(a,i)}}))}}}var mockElementBoundingClientRect=(e,{x:t=0,y:i=0,width:n=0,height:r=0})=>{mockDOMRect();const a=e.getBoundingClientRect;return e.getBoundingClientRect=()=>new DOMRectReadOnly(t,i,n,r),a},import_css_mediaquery=__toESM(require("css-mediaquery"),1),MockedMediaQueryListEvent=class extends Event{constructor(e,t={}){var i,n;super(e),this.media=null!=(i=t.media)?i:"",this.matches=null!=(n=t.matches)&&n}};function mockMediaQueryListEvent(){if(!isJsdomEnv())throw new WrongEnvironmentError;"undefined"==typeof MediaQueryListEvent&&Object.defineProperty(window,"MediaQueryListEvent",{writable:!0,configurable:!0,value:MockedMediaQueryListEvent})}var config4=getConfig();function isEventListenerObject(e){return void 0!==e.handleEvent}function mockViewport(e){if(!isJsdomEnv())throw new WrongEnvironmentError;mockMediaQueryListEvent();const t={currentDesc:e,oldListeners:[],listeners:[]},i=window.matchMedia,n=e=>{const i=t.listeners.findIndex((({listener:t})=>t===e));t.listeners.splice(i,1)};return Object.defineProperty(window,"matchMedia",{writable:!0,value:e=>({get matches(){return import_css_mediaquery.default.match(e,t.currentDesc)},media:e,onchange:null,addListener:function(e){e&&((e,i,n)=>{t.oldListeners.push({listener:n,matches:i,list:e})})(this,this.matches,e)},removeListener:e=>{e&&(e=>{const i=t.oldListeners.findIndex((({listener:t})=>t===e));t.oldListeners.splice(i,1)})(e)},addEventListener:function(e,i){"change"===e&&((e,i,n)=>{t.listeners.push({listener:n,matches:i,list:e})})(this,this.matches,i)},removeEventListener:(e,t)=>{"change"===e&&(isEventListenerObject(t)?n(t.handleEvent):n(t))},dispatchEvent:e=>("change"===e.type&&(t.listeners.forEach((({listener:t,list:i})=>{isEventListenerObject(t)?t.handleEvent(e):t.call(i,e)})),t.oldListeners.forEach((({listener:t,list:i})=>{t.call(i,e)}))),!0)})}),{cleanup:()=>{window.matchMedia=i},set:e=>{config4.act((()=>{t.currentDesc=e,t.listeners.forEach((({listener:e,matches:i,list:n},r)=>{const a=n.matches;if(a!==i){const i=new MediaQueryListEvent("change",{matches:a,media:n.media});isEventListenerObject(e)?e.handleEvent(i):e.call(n,i),t.listeners[r].matches=a}})),t.oldListeners.forEach((({listener:e,matches:i,list:n},r)=>{const a=n.matches;if(a!==i){const i=new MediaQueryListEvent("change",{matches:a,media:n.media});e.call(n,i),t.oldListeners[r].matches=a}}))}))}}}function mockViewportForTestGroup(e){let t;config4.beforeAll((()=>{t=mockViewport(e)})),config4.afterAll((()=>{t.cleanup()}))}var UNIT_CONVERSIONS={px:{canonical:"px",factor:1},in:{canonical:"px",factor:96},cm:{canonical:"px",factor:96/2.54},mm:{canonical:"px",factor:96/25.4},pt:{canonical:"px",factor:96/72},pc:{canonical:"px",factor:16},Q:{canonical:"px",factor:96/101.6},deg:{canonical:"deg",factor:1},rad:{canonical:"deg",factor:180/Math.PI},grad:{canonical:"deg",factor:.9},turn:{canonical:"deg",factor:360},ms:{canonical:"ms",factor:1},s:{canonical:"ms",factor:1e3},Hz:{canonical:"Hz",factor:1},kHz:{canonical:"Hz",factor:1e3},dppx:{canonical:"dppx",factor:1},dpi:{canonical:"dppx",factor:1/96},dpcm:{canonical:"dppx",factor:2.54/96}};function getBaseType(e){if("number"===e)return null;if("percent"===e)return"percent";return["px","in","cm","mm","pt","pc","Q","em","rem","ex","ch","cap","ic","lh","rlh","vw","vh","vi","vb","vmin","vmax","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","dvw","dvh","dvi","dvb","dvmin","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"].includes(e)?"length":["deg","rad","grad","turn"].includes(e)?"angle":["ms","s"].includes(e)?"time":["Hz","kHz"].includes(e)?"frequency":["dppx","dpi","dpcm"].includes(e)?"resolution":"fr"===e?"flex":null}function createTypeFromUnit(e){const t=getBaseType(e);if(t&&"percent"!==t){const e={};return e[t]=1,e}return"percent"===t?{percent:1}:{}}function addTypes(e,t){const i=__spreadValues({},e),n=0===Object.keys(e).length||Object.values(e).every((e=>0===e||void 0===e)),r=0===Object.keys(t).length||Object.values(t).every((e=>0===e||void 0===e));if(n&&r)return{};if(n||r)return null;const a=["length","angle","time","frequency","resolution","flex","percent"];for(const i of a)if("percentHint"!==i&&(e[i]||0)!==(t[i]||0))return null;return i}function multiplyTypes(e,t){return{length:e.length+t.length,angle:e.angle+t.angle,time:e.time+t.time,frequency:e.frequency+t.frequency,resolution:e.resolution+t.resolution,flex:e.flex+t.flex,percent:e.percent+t.percent}}function convertUnit(e,t,i){if(t===i)return e;const n=UNIT_CONVERSIONS[t],r=UNIT_CONVERSIONS[i];if(!n||!r)return null;if(n.canonical!==r.canonical)return null;const a=e*n.factor/r.factor;return Math.round(1e4*a)/1e4}function getCanonicalUnit(e){const t=UNIT_CONVERSIONS[e];return t?t.canonical:e}function rectifyNumberish(e,t=!1){if("number"==typeof e){if(t)return new MockedCSSUnitValue(e,"number");throw new TypeError("Numbers cannot be used directly in CSS Typed OM operations. Use CSS.number() to create a CSSNumericValue.")}if(e instanceof MockedCSSNumericValue)return e;throw new TypeError("Invalid CSSNumberish value")}var _timing,MockedCSSNumericValue=class e{constructor(){if(new.target===e)throw new TypeError("Cannot instantiate abstract class MockedCSSNumericValue directly")}add(...e){if(0===e.length)return this;if(e.some((e=>"number"==typeof e)))throw new TypeError("Cannot add numbers directly. Use CSS.number() instead.");const t=[this,...e.map((e=>rectifyNumberish(e)))];if(t.every((e=>e instanceof MockedCSSUnitValue))){const e=t,i=e[0].unit;if(e.every((e=>e.unit===i))){const t=e.reduce(((e,t)=>e+t.value),0);return new MockedCSSUnitValue(t,i)}}if(t.every((e=>e instanceof MockedCSSUnitValue&&"number"===e.unit))){const e=t.reduce(((e,t)=>e+t.value),0);return new MockedCSSUnitValue(e,"number")}let i=this.type();for(let e=1;e<t.length;e++){const n=addTypes(i,t[e].type());if(null===n)throw new TypeError("Incompatible types for addition");i=n}return new MockedCSSMathSum(t)}sub(...e){if(0===e.length)return this;if(e.some((e=>"number"==typeof e)))throw new TypeError("Cannot subtract numbers directly. Use CSS.number() instead.");const t=e.map((e=>rectifyNumberish(e).negate()));return this.add(...t)}mul(...e){if(0===e.length)return this;const t=[this,...e.map((e=>rectifyNumberish(e,!0)))];if(t.every((e=>e instanceof MockedCSSUnitValue))){const e=t,i=e.filter((e=>"number"===e.unit)),n=e.filter((e=>"number"!==e.unit));if(n.length<=1){const e=i.reduce(((e,t)=>e*t.value),1);if(0===n.length)return new MockedCSSUnitValue(e,"number");{const t=n[0];return new MockedCSSUnitValue(e*t.value,t.unit)}}}return new MockedCSSMathProduct(t)}div(...e){if(0===e.length)return this;const t=e.map((e=>{const t=rectifyNumberish(e,!0);if(t instanceof MockedCSSUnitValue&&0===t.value)throw new RangeError("Cannot divide by zero");return t.invert()}));return this.mul(...t)}min(...e){if(0===e.length)return this;if(e.some((e=>"number"==typeof e)))throw new TypeError("Cannot use raw numbers in min(). Use CSS.number() instead.");const t=[this,...e.map((e=>rectifyNumberish(e)))];if(t.every((e=>e instanceof MockedCSSUnitValue))){const e=t,i=e[0].unit;if(e.every((e=>e.unit===i))){const t=Math.min(...e.map((e=>e.value)));return new MockedCSSUnitValue(t,i)}}return new MockedCSSMathMin(t)}max(...e){if(0===e.length)return this;if(e.some((e=>"number"==typeof e)))throw new TypeError("Cannot use raw numbers in max(). Use CSS.number() instead.");const t=[this,...e.map((e=>rectifyNumberish(e)))];if(t.every((e=>e instanceof MockedCSSUnitValue))){const e=t,i=e[0].unit;if(e.every((e=>e.unit===i))){const t=Math.max(...e.map((e=>e.value)));return new MockedCSSUnitValue(t,i)}}return new MockedCSSMathMax(t)}equals(...e){for(const t of e){const e=rectifyNumberish(t);if(!this.isEqualTo(e))return!1}return!0}to(e){if(!(this instanceof MockedCSSUnitValue))throw new TypeError("Cannot convert complex values to a single unit");const t=convertUnit(this.value,this.unit,e);if(null===t)throw new TypeError(`Cannot convert from '${this.unit}' to '${e}'`);return new MockedCSSUnitValue(t,e)}toSum(...e){var t;if(0===e.length)return this instanceof MockedCSSMathSum?this:new MockedCSSMathSum([this]);if(this instanceof MockedCSSUnitValue){const t=[],i=this.unit;let n=!1;for(const r of e){const e=convertUnit(this.value,i,r);null===e||n?t.push(new MockedCSSUnitValue(0,r)):(t.push(new MockedCSSUnitValue(e,r)),n=!0)}if(!n)throw new TypeError(`Cannot convert ${i} to any of the specified units`);return new MockedCSSMathSum(t)}if(this instanceof MockedCSSMathSum){const i=new Map;for(const e of this.values)if(e instanceof MockedCSSUnitValue){const n=getCanonicalUnit(e.unit);i.has(n)||i.set(n,[]),null==(t=i.get(n))||t.push(e)}const n=[];for(const t of e){const e=getCanonicalUnit(t),r=i.get(e)||[];if(r.length>0){let a=0;for(const e of r){const i=convertUnit(e.value,e.unit,t);null!==i&&(a+=i)}n.push(new MockedCSSUnitValue(a,t)),i.delete(e)}else n.push(new MockedCSSUnitValue(0,t))}if(i.size>0)throw new TypeError("Some values cannot be converted to the specified units");return new MockedCSSMathSum(n)}throw new TypeError("Cannot convert complex math expressions to sum")}negate(){return this instanceof MockedCSSUnitValue?new MockedCSSUnitValue(-this.value,this.unit):new MockedCSSMathNegate(this)}invert(){if(this instanceof MockedCSSUnitValue&&"number"===this.unit){if(0===this.value)throw new RangeError("Cannot invert zero");return new MockedCSSUnitValue(1/this.value,"number")}return new MockedCSSMathInvert(this)}isEqualTo(e){return this.constructor===e.constructor&&(this instanceof MockedCSSUnitValue&&e instanceof MockedCSSUnitValue?this.value===e.value&&this.unit===e.unit:this instanceof MockedCSSMathSum&&e instanceof MockedCSSMathSum&&(this.values.length===e.values.length&&this.values.every(((t,i)=>t.isEqualTo(e.values[i])))))}static parse(e){throw new TypeError("CSS.parse is not available in browsers")}},MockedCSSUnitValue=class extends MockedCSSNumericValue{constructor(e,t){if(super(),this.value=e,this.unit=t,"number"!=typeof e||!isFinite(e))throw new TypeError("Invalid numeric value");if("%"===t&&(this.unit="percent"),"number"!==this.unit&&"percent"!==this.unit&&null===getBaseType(this.unit))throw new TypeError(`Invalid unit: ${t}`)}type(){return createTypeFromUnit(this.unit)}toString(){if("number"===this.unit)return String(this.value);if(Math.abs(this.value)>=1e6){return`${this.value.toExponential().replace(/e\+(\d)$/,"e+0$1")}${this.unit}`}return`${this.value}${this.unit}`}static parse(e){throw new TypeError("CSS.parse is not available in browsers")}},MockedCSSMathValue=class extends MockedCSSNumericValue{toString(){return`calc(${this.toCSSString()})`}},MockedCSSMathSum=class extends MockedCSSMathValue{constructor(e){if(super(),this.values=e,this.operator="sum",0===e.length)throw new SyntaxError("CSSMathSum requires at least one value")}type(){let e=this.values[0].type();for(let t=1;t<this.values.length;t++){const i=addTypes(e,this.values[t].type());if(null===i)throw new TypeError("Incompatible types in sum");e=i}return e}toCSSString(){return this.values.map(((e,t)=>{const i=e.toString();return t>0?(i.startsWith("-"),`+ ${i}`):i})).join(" ")}},MockedCSSMathProduct=class extends MockedCSSMathValue{constructor(e){if(super(),this.values=e,this.operator="product",0===e.length)throw new SyntaxError("CSSMathProduct requires at least one value")}type(){let e=this.values[0].type();for(let t=1;t<this.values.length;t++)e=multiplyTypes(e,this.values[t].type());return e}toCSSString(){return this.values.map((e=>e.toString())).join(" * ")}},MockedCSSMathNegate=class extends MockedCSSMathValue{constructor(e){super(),this.value=e,this.operator="negate"}type(){return this.value.type()}toCSSString(){return`-${this.value.toString()}`}},MockedCSSMathInvert=class extends MockedCSSMathValue{constructor(e){super(),this.value=e,this.operator="invert"}type(){const e=this.value.type();return{length:-e.length,angle:-e.angle,time:-e.time,frequency:-e.frequency,resolution:-e.resolution,flex:-e.flex,percent:-e.percent}}toCSSString(){return`1 / ${this.value.toString()}`}},MockedCSSMathMin=class extends MockedCSSMathValue{constructor(e){if(super(),this.values=e,this.operator="min",0===e.length)throw new SyntaxError("CSSMathMin requires at least one value")}type(){let e=this.values[0].type();for(let t=1;t<this.values.length;t++){const i=addTypes(e,this.values[t].type());if(null===i)throw new TypeError("Incompatible types in min()");e=i}return e}toCSSString(){return`min(${this.values.map((e=>e.toString())).join(", ")})`}toString(){return this.toCSSString()}},MockedCSSMathMax=class extends MockedCSSMathValue{constructor(e){if(super(),this.values=e,this.operator="max",0===e.length)throw new SyntaxError("CSSMathMax requires at least one value")}type(){let e=this.values[0].type();for(let t=1;t<this.values.length;t++){const i=addTypes(e,this.values[t].type());if(null===i)throw new TypeError("Incompatible types in max()");e=i}return e}toCSSString(){return`max(${this.values.map((e=>e.toString())).join(", ")})`}toString(){return this.toCSSString()}},MockedCSSMathClamp=class extends MockedCSSMathValue{constructor(e,t,i){super(),this.lower=e,this.value=t,this.upper=i,this.operator="clamp";const n=e.type(),r=t.type(),a=i.type(),s=addTypes(n,r);if(null===s)throw new TypeError("Incompatible types in clamp() lower and value");if(null===addTypes(s,a))throw new TypeError("Incompatible types in clamp()")}type(){return this.lower.type()}toCSSString(){return`clamp(${this.lower.toString()}, ${this.value.toString()}, ${this.upper.toString()})`}toString(){return this.toCSSString()}},MockedCSS={number:e=>new MockedCSSUnitValue(e,"number"),percent:e=>new MockedCSSUnitValue(e,"percent"),px:e=>new MockedCSSUnitValue(e,"px"),cm:e=>new MockedCSSUnitValue(e,"cm"),mm:e=>new MockedCSSUnitValue(e,"mm"),in:e=>new MockedCSSUnitValue(e,"in"),pt:e=>new MockedCSSUnitValue(e,"pt"),pc:e=>new MockedCSSUnitValue(e,"pc"),Q:e=>new MockedCSSUnitValue(e,"Q"),em:e=>new MockedCSSUnitValue(e,"em"),rem:e=>new MockedCSSUnitValue(e,"rem"),ex:e=>new MockedCSSUnitValue(e,"ex"),ch:e=>new MockedCSSUnitValue(e,"ch"),cap:e=>new MockedCSSUnitValue(e,"cap"),ic:e=>new MockedCSSUnitValue(e,"ic"),lh:e=>new MockedCSSUnitValue(e,"lh"),rlh:e=>new MockedCSSUnitValue(e,"rlh"),vw:e=>new MockedCSSUnitValue(e,"vw"),vh:e=>new MockedCSSUnitValue(e,"vh"),vi:e=>new MockedCSSUnitValue(e,"vi"),vb:e=>new MockedCSSUnitValue(e,"vb"),vmin:e=>new MockedCSSUnitValue(e,"vmin"),vmax:e=>new MockedCSSUnitValue(e,"vmax"),svw:e=>new MockedCSSUnitValue(e,"svw"),svh:e=>new MockedCSSUnitValue(e,"svh"),svi:e=>new MockedCSSUnitValue(e,"svi"),svb:e=>new MockedCSSUnitValue(e,"svb"),svmin:e=>new MockedCSSUnitValue(e,"svmin"),svmax:e=>new MockedCSSUnitValue(e,"svmax"),lvw:e=>new MockedCSSUnitValue(e,"lvw"),lvh:e=>new MockedCSSUnitValue(e,"lvh"),lvi:e=>new MockedCSSUnitValue(e,"lvi"),lvb:e=>new MockedCSSUnitValue(e,"lvb"),lvmin:e=>new MockedCSSUnitValue(e,"lvmin"),lvmax:e=>new MockedCSSUnitValue(e,"lvmax"),dvw:e=>new MockedCSSUnitValue(e,"dvw"),dvh:e=>new MockedCSSUnitValue(e,"dvh"),dvi:e=>new MockedCSSUnitValue(e,"dvi"),dvb:e=>new MockedCSSUnitValue(e,"dvb"),dvmin:e=>new MockedCSSUnitValue(e,"dvmin"),dvmax:e=>new MockedCSSUnitValue(e,"dvmax"),cqw:e=>new MockedCSSUnitValue(e,"cqw"),cqh:e=>new MockedCSSUnitValue(e,"cqh"),cqi:e=>new MockedCSSUnitValue(e,"cqi"),cqb:e=>new MockedCSSUnitValue(e,"cqb"),cqmin:e=>new MockedCSSUnitValue(e,"cqmin"),cqmax:e=>new MockedCSSUnitValue(e,"cqmax"),deg:e=>new MockedCSSUnitValue(e,"deg"),rad:e=>new MockedCSSUnitValue(e,"rad"),grad:e=>new MockedCSSUnitValue(e,"grad"),turn:e=>new MockedCSSUnitValue(e,"turn"),s:e=>new MockedCSSUnitValue(e,"s"),ms:e=>new MockedCSSUnitValue(e,"ms"),Hz:e=>new MockedCSSUnitValue(e,"Hz"),kHz:e=>new MockedCSSUnitValue(e,"kHz"),dpi:e=>new MockedCSSUnitValue(e,"dpi"),dpcm:e=>new MockedCSSUnitValue(e,"dpcm"),dppx:e=>new MockedCSSUnitValue(e,"dppx"),fr:e=>new MockedCSSUnitValue(e,"fr")};function initCSSTypedOM(){if(!isJsdomEnv())throw new WrongEnvironmentError;Object.defineProperty(globalThis,"CSSNumericValue",{writable:!0,configurable:!0,value:MockedCSSNumericValue}),Object.defineProperty(globalThis,"CSSUnitValue",{writable:!0,configurable:!0,value:MockedCSSUnitValue}),Object.defineProperty(globalThis,"CSSMathValue",{writable:!0,configurable:!0,value:MockedCSSMathValue}),Object.defineProperty(globalThis,"CSSMathSum",{writable:!0,configurable:!0,value:MockedCSSMathSum}),Object.defineProperty(globalThis,"CSSMathProduct",{writable:!0,configurable:!0,value:MockedCSSMathProduct}),Object.defineProperty(globalThis,"CSSMathNegate",{writable:!0,configurable:!0,value:MockedCSSMathNegate}),Object.defineProperty(globalThis,"CSSMathInvert",{writable:!0,configurable:!0,value:MockedCSSMathInvert}),Object.defineProperty(globalThis,"CSSMathMin",{writable:!0,configurable:!0,value:MockedCSSMathMin}),Object.defineProperty(globalThis,"CSSMathMax",{writable:!0,configurable:!0,value:MockedCSSMathMax}),Object.defineProperty(globalThis,"CSSMathClamp",{writable:!0,configurable:!0,value:MockedCSSMathClamp}),Object.defineProperty(globalThis,"CSS",{writable:!0,configurable:!0,value:MockedCSS})}function cssNumberishToNumber(e){if(null===e)return null;if("number"==typeof e)return e;if(e instanceof CSSUnitValue){const{unit:t,value:i}=e;return"s"===t?1e3*i:"ms"===t||"number"===t?i:(console.warn(`jsdom-testing-mocks: Unsupported CSS unit '${t}' in cssNumberishToNumber. Returning null.`),null)}if(e instanceof CSSMathValue){const t=e.type();if(1===t.time&&1===Object.values(t).filter((e=>0!==e)).length)try{const t=e.toSum("ms");return 1===t.values.length&&t.values[0]instanceof CSSUnitValue?t.values[0].value:(console.warn("jsdom-testing-mocks: Cannot simplify time-dimensioned CSSMathValue to single millisecond value. Returning null."),null)}catch(e){return console.warn("jsdom-testing-mocks: Cannot convert time-dimensioned CSSMathValue to milliseconds. Returning null."),null}if(Object.values(t).every((e=>0===e||void 0===e)))try{const t=e.toSum("number");return 1===t.values.length&&t.values[0]instanceof CSSUnitValue?t.values[0].value:(console.warn("jsdom-testing-mocks: Cannot simplify dimensionless CSSMathValue to single number value. Returning null."),null)}catch(e){return console.warn("jsdom-testing-mocks: Cannot convert dimensionless CSSMathValue to number. Returning null."),null}return console.warn("jsdom-testing-mocks: CSSMathValue has incompatible dimensions for animation timing. Returning null."),null}return console.warn("jsdom-testing-mocks: Unsupported CSSNumberish value in cssNumberishToNumber. Returning null."),null}function numberToCSSNumberish(e){return e}var _MockedAnimationEffect=class e{constructor(){if(__privateAdd(this,_timing,{delay:0,direction:"normal",duration:"auto",easing:"linear",endDelay:0,fill:"auto",iterationStart:0,iterations:1}),this.constructor===e)throw new TypeError("Illegal constructor")}_getNormalizedDuration(){var e;if("string"==typeof __privateGet(this,_timing).duration)return 0;const t=cssNumberishToNumber(null!=(e=__privateGet(this,_timing).duration)?e:null);return null!=t?t:0}getTiming(){return __privateGet(this,_timing)}getComputedTiming(){var e,t,i;const n=this._getNormalizedDuration(),r=__privateGet(this,_timing).iterations===1/0?1/0:n*(null!=(e=__privateGet(this,_timing).iterations)?e:1),a=__privateGet(this,_timing).iterations===1/0?1/0:Math.max((null!=(t=__privateGet(this,_timing).delay)?t:0)+r+(null!=(i=__privateGet(this,_timing).endDelay)?i:0),0);return __spreadProps(__spreadValues({},__privateGet(this,_timing)),{duration:n,fill:"auto"===__privateGet(this,_timing).fill?"none":__privateGet(this,_timing).fill,activeDuration:r,currentIteration:(__privateGet(this,_timing).iterations,null),endTime:a,localTime:null,progress:null})}updateTiming(e){Object.assign(__privateGet(this,_timing),e)}};_timing=new WeakMap;var _keyframes,_MockedKeyframeEffect_instances,validateKeyframes_fn,MockedAnimationEffect=_MockedAnimationEffect;function mockAnimationEffect(){"undefined"==typeof AnimationEffect&&Object.defineProperty(window,"AnimationEffect",{writable:!0,configurable:!0,value:MockedAnimationEffect})}function convertPropertyIndexedKeyframes(e){const t=[];let i=!1,n=0;for(;!i;){let r;for(const t in e){const i=e[t],a=Array.isArray(i)?i:[i];if(!a)continue;const s=a[n];null!=s&&(r||(r={}),r[t]=s)}r?(n++,t.push(r)):i=!0}return t}var MockedKeyframeEffect=class extends MockedAnimationEffect{constructor(e,t,i={}){var n,r,a,s,o;super(),__privateAdd(this,_MockedKeyframeEffect_instances),this.composite="replace",this.pseudoElement=null,__privateAdd(this,_keyframes,[]),"number"==typeof i&&(i={duration:i});const c=i,{composite:l,iterationComposite:_,pseudoElement:u}=c,h=__objRest(c,["composite","iterationComposite","pseudoElement"]);if(this.setKeyframes(t),this.target=e,this.composite=l||"replace",this.iterationComposite=_||"replace",this.pseudoElement=u||null,Object.keys(h).length>0){const e={};void 0!==h.delay&&(e.delay=null!=(n=cssNumberishToNumber(h.delay))?n:h.delay),void 0!==h.duration&&(e.duration="string"==typeof h.duration?h.duration:null!=(r=cssNumberishToNumber(h.duration))?r:0),void 0!==h.endDelay&&(e.endDelay=null!=(a=cssNumberishToNumber(h.endDelay))?a:h.endDelay),void 0!==h.iterationStart&&(e.iterationStart=null!=(s=cssNumberishToNumber(h.iterationStart))?s:h.iterationStart),void 0!==h.iterations&&(e.iterations=null!=(o=cssNumberishToNumber(h.iterations))?o:h.iterations),void 0!==h.direction&&(e.direction=h.direction),void 0!==h.easing&&(e.easing=h.easing),void 0!==h.fill&&(e.fill=h.fill),void 0!==h.playbackRate&&(e.playbackRate=h.playbackRate),this.updateTiming(e)}}getKeyframes(){var e,t;const i=__privateGet(this,_keyframes).length;if(0===i)return[];let n=null!=(t=null==(e=__privateGet(this,_keyframes)[0])?void 0:e.offset)?t:1===i?1:0;return __privateGet(this,_keyframes).map(((e,t)=>{var r=e,{composite:a,offset:s,easing:o}=r,c=__objRest(r,["composite","offset","easing"]);const l=__spreadValues({offset:null!=s?s:null,composite:null!=a?a:this.composite,easing:null!=o?o:"linear",computedOffset:n},c);let _,u;for(let e=t+1;e<i;e++){const i=__privateGet(this,_keyframes)[e].offset;if("number"==typeof i){_=i,u=e-t;break}}void 0===_&&(_=1,u=__privateGet(this,_keyframes).length-t-1);return n+="number"==typeof u&&u>0?(_-n)/u:0,l}))}setKeyframes(e){let t;t=null===e?[]:Array.isArray(e)?e:convertPropertyIndexedKeyframes(e),__privateMethod(this,_MockedKeyframeEffect_instances,validateKeyframes_fn).call(this,t),__privateSet(this,_keyframes,t)}};function mockKeyframeEffect(){mockAnimationEffect(),"undefined"==typeof KeyframeEffect&&Object.defineProperty(window,"KeyframeEffect",{writable:!0,configurable:!0,value:MockedKeyframeEffect})}_keyframes=new WeakMap,_MockedKeyframeEffect_instances=new WeakSet,validateKeyframes_fn=function(e){let t;e.forEach((e=>{const i=e.offset;if("number"==typeof i){if(i<0||i>1)throw new TypeError("Failed to construct 'KeyframeEffect': Offsets must be null or in the range [0,1].");if("number"==typeof t&&i<t)throw new TypeError("Failed to construct 'KeyframeEffect': Offsets must be monotonically non-decreasing.");t=i}}))};var MockedAnimationPlaybackEvent=class extends Event{constructor(){super(...arguments),this.currentTime=null,this.timelineTime=null}};function mockAnimationPlaybackEvent(){"undefined"==typeof AnimationPlaybackEvent&&Object.defineProperty(window,"AnimationPlaybackEvent",{writable:!0,configurable:!0,value:MockedAnimationPlaybackEvent})}var _originTime,MockedAnimationTimeline=class e{constructor(){if(this.constructor===e)throw new TypeError("Illegal constructor")}get currentTime(){return performance.now()}};function mockAnimationTimeline(){"undefined"==typeof AnimationTimeline&&Object.defineProperty(window,"AnimationTimeline",{writable:!0,configurable:!0,value:MockedAnimationTimeline})}var MockedDocumentTimeline=class extends MockedAnimationTimeline{constructor(e){var t;super(),__privateAdd(this,_originTime,0),__privateSet(this,_originTime,null!=(t=null==e?void 0:e.originTime)?t:0)}get currentTime(){return performance.now()-__privateGet(this,_originTime)}};function mockDocumentTimeline(){mockAnimationTimeline(),"undefined"==typeof DocumentTimeline&&(Object.defineProperty(window,"DocumentTimeline",{writable:!0,configurable:!0,value:MockedDocumentTimeline}),Object.defineProperty(Document.prototype,"timeline",{writable:!0,configurable:!0,value:new MockedDocumentTimeline}))}_originTime=new WeakMap;var import_bezier_easing=__toESM(require("bezier-easing"),1),ease=(0,import_bezier_easing.default)(.25,.1,.25,1),easeIn=(0,import_bezier_easing.default)(.42,0,1,1),easeOut=(0,import_bezier_easing.default)(0,0,.58,1),easeInOut=(0,import_bezier_easing.default)(.42,0,.58,1),VALID_JUMPTERMS=["jump-start","jump-end","jump-none","jump-both","start","end"],clamp=e=>Math.min(Math.max(e,0),1),StepsEasing=e=>{switch(e){case"step-start":e="steps(1, jump-start)";break;case"step-end":e="steps(1, jump-end)"}const t=e.replace("steps(","").replace(")","").split(",").map((e=>e.trim())),[i,n="jump-end"]=t,r=Number(i);if(isNaN(r)||!Number.isInteger(r)||r<=0||!VALID_JUMPTERMS.includes(n))throw new Error(`Invalid easing function: ${e}`);switch(n){case"start":case"jump-start":return e=>{const t=Math.ceil(e*r);return clamp(t/r)};case"end":case"jump-end":return e=>{const t=Math.floor(e*r);return clamp(t/r)};case"jump-none":return e=>{const t=Math.floor(e*r);return clamp(t/(r-1))};case"jump-both":return e=>{if(1===e)return 1;const t=Math.ceil(e*r);return clamp(t/(r+1))}}throw new Error(`Invalid easing function: ${e}`)},easingFunctions={linear:e=>e,ease:ease,"ease-in":easeIn,"ease-out":easeOut,"ease-in-out":easeInOut};function getEasingFunctionFromString(e){if(easingFunctions[e])return easingFunctions[e];if(0===e.indexOf("cubic-bezier(")){const t=e.replace("cubic-bezier(","").replace(")","").split(",").map(Number);return easingFunctions[e]=(0,import_bezier_easing.default)(t[0],t[1],t[2],t[3]),easingFunctions[e]}if(0===e.indexOf("steps("))return easingFunctions[e]=StepsEasing(e),easingFunctions[e];throw new Error(`Unknown easing function "${e}"`)}var elementAnimations=new Map;function removeAnimation(e,t){const i=elementAnimations.get(e);if(i){const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}function addAnimation(e,t){var i;const n=null!=(i=elementAnimations.get(e))?i:[];n.push(t),elementAnimations.set(e,n)}function getAnimations(){var e;return null!=(e=elementAnimations.get(this))?e:[]}function getAllAnimations(){return Array.from(elementAnimations.values()).flat()}function clearAnimations(){getAllAnimations().forEach((e=>{e.cancel()})),elementAnimations.clear()}var _finishedPromise,_readyPromise,_startTime,_pendingPauseTask,_pendingPlayTask,_previousCurrentTime,_previousPhase,_effect,_timeline,_rafId,_initialKeyframe,_fillMode,_promiseStates,_resolvers,_getRawComputedTiming,_pendingPlaybackRate,_playbackRate,_holdTime,_MockedAnimation_instances,getTiming_fn,getComputedTiming_fn,localTime_get,addToTarget_fn,removeFromTarget_fn,getNewFinishedPromise_fn,getNewReadyPromise_fn,silentlyRejectFinishedPromise_fn,hasPendingTask_fn,isTimelineActive_fn,hasKeyframeEffect_fn,isTimelineMonotonicallyIncreasing_fn,calcInitialKeyframe_fn,applyPendingPlaybackRate_fn,animationDirection_get,phase_get,resetPendingTasks_fn,calculateCurrentTime_fn,calculateStartTime_fn,getCurrentTimeInternal_fn,effectivePlaybackRate_get,setCurrentTimeSilent_fn,iteration_fn,cancelIteration_fn,playTask_fn,play_fn,pauseTask_fn,finishNotification_fn,_queuedFinishNotificationMicrotask,cancelFinishNotificationMicrotask_fn,queueFinishNotificationMicrotask_fn,updateFinishedState_fn,activeTime_get,overallProgress_get,iterationProgress_get,currentIteration_get,currentDirection_get,directedProgress_get,transformedProgress_get,commitKeyframeStyles_fn,config5=getConfig(),NON_STYLE_KEYFRAME_PROPERTIES=["offset","composite","easing"],RENAMED_KEYFRAME_PROPERTIES={cssFloat:"float",cssOffset:"offset"},noop=()=>{},MockedAnimation=class extends EventTarget{constructor(e=null,t=document.timeline){var i;super(),__privateAdd(this,_MockedAnimation_instances),this.id="",this.pending=!1,this.replaceState="active",__privateAdd(this,_finishedPromise),__privateAdd(this,_readyPromise),__privateAdd(this,_startTime,null),__privateAdd(this,_pendingPauseTask,null),__privateAdd(this,_pendingPlayTask,null),__privateAdd(this,_previousCurrentTime,null),__privateAdd(this,_previousPhase,"idle"),__privateAdd(this,_effect,null),__privateAdd(this,_timeline,null),__privateAdd(this,_rafId,null),__privateAdd(this,_initialKeyframe),__privateAdd(this,_fillMode),__privateAdd(this,_promiseStates,{finished:"pending",ready:"resolved"}),__privateAdd(this,_resolvers,{ready:{resolve:noop,reject:noop},finished:{resolve:noop,reject:noop}}),__privateAdd(this,_getRawComputedTiming,(()=>({}))),__privateAdd(this,_pendingPlaybackRate,null),__privateAdd(this,_playbackRate,1),__privateAdd(this,_holdTime,null),__privateAdd(this,_queuedFinishNotificationMicrotask,null),this.oncancel=null,this.onfinish=null,this.onremove=null,this.effect=e,__privateSet(this,_timeline,t),__privateSet(this,_initialKeyframe,__privateMethod(this,_MockedAnimation_instances,calcInitialKeyframe_fn).call(this)),__privateSet(this,_fillMode,null!=(i=null==e?void 0:e.getComputedTiming().fill)?i:"none"),__privateSet(this,_finishedPromise,__privateMethod(this,_MockedAnimation_instances,getNewFinishedPromise_fn).call(this)),__privateSet(this,_readyPromise,Promise.resolve(this))}get animationEffectStateInPlay(){return"active"===__privateGet(this,_MockedAnimation_instances,phase_get)&&"finished"!==this.playState}get animationEffectStateCurrent(){const e=__privateGet(this,_MockedAnimation_instances,phase_get);return this.animationEffectStateInPlay||this.playbackRate>0&&"before"===e||this.playbackRate<0&&"after"===e}get animationEffectStateInEffect(){return null!==__privateGet(this,_MockedAnimation_instances,activeTime_get)}get finished(){return __privateGet(this,_finishedPromise)}get ready(){return __privateGet(this,_readyPromise)}get timeline(){return __privateGet(this,_timeline)}set timeline(e){__privateGet(this,_timeline)!==e&&(__privateSet(this,_timeline,e),null!==this.startTime&&__privateSet(this,_holdTime,null),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!1,!1))}get effect(){return __privateGet(this,_effect)}set effect(e){const t=__privateGet(this,_effect);if(e!==t){if(__privateGet(this,_pendingPauseTask)&&this.ready.then((()=>{var e;return null==(e=__privateGet(this,_pendingPauseTask))?void 0:e.call(this)})),__privateGet(this,_pendingPlayTask)&&this.ready.then((()=>{var e;return null==(e=__privateGet(this,_pendingPlayTask))?void 0:e.call(this)})),e){const t=document.getAnimations().find((t=>t.effect===e));t&&(t.effect=null)}__privateSet(this,_effect,e),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!1,!1),e&&(__privateSet(this,_getRawComputedTiming,e.getComputedTiming),e.getComputedTiming=()=>{const t=__privateGet(this,_getRawComputedTiming).call(e);return __spreadProps(__spreadValues({},t),{localTime:__privateGet(this,_MockedAnimation_instances,localTime_get),progress:__privateGet(this,_MockedAnimation_instances,transformedProgress_get)})})}}get currentTime(){return __privateMethod(this,_MockedAnimation_instances,getCurrentTimeInternal_fn).call(this)}set currentTime(e){__privateMethod(this,_MockedAnimation_instances,setCurrentTimeSilent_fn).call(this,e),__privateGet(this,_pendingPauseTask)&&(__privateSet(this,_holdTime,e),__privateMethod(this,_MockedAnimation_instances,applyPendingPlaybackRate_fn).call(this),__privateSet(this,_startTime,null),__privateSet(this,_pendingPauseTask,null),__privateGet(this,_resolvers).ready.resolve(this)),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!0,!1)}get startTime(){return __privateGet(this,_startTime)}set startTime(e){var t,i;null===(null!=(i=null==(t=__privateGet(this,_timeline))?void 0:t.currentTime)?i:null)&&null!==e&&__privateSet(this,_holdTime,null),__privateSet(this,_previousCurrentTime,cssNumberishToNumber(this.currentTime)),__privateMethod(this,_MockedAnimation_instances,applyPendingPlaybackRate_fn).call(this),__privateSet(this,_startTime,cssNumberishToNumber(e)),null!==e?0!==this.playbackRate&&__privateSet(this,_holdTime,null):__privateSet(this,_holdTime,__privateGet(this,_previousCurrentTime)),__privateMethod(this,_MockedAnimation_instances,hasPendingTask_fn).call(this)&&(__privateSet(this,_pendingPlayTask,null),__privateSet(this,_pendingPauseTask,null),__privateGet(this,_resolvers).ready.resolve(this)),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!0,!1)}play(){__privateMethod(this,_MockedAnimation_instances,play_fn).call(this,!0)}pause(){if(null!==__privateGet(this,_pendingPauseTask))return;if("paused"===this.playState)return;let e=null;const t=__privateGet(this,_timeline)&&!__privateMethod(this,_MockedAnimation_instances,isTimelineMonotonicallyIncreasing_fn).call(this),i=this.currentTime,n=__privateMethod(this,_MockedAnimation_instances,getComputedTiming_fn).call(this).endTime;if(null===i)if(__privateGet(this,_playbackRate)>=0)e=0;else{if(n===1/0)throw new DOMException("Failed to execute 'pause' on 'Animation': Cannot play reversed Animation with infinite target effect end.","InvalidStateError");{const t=cssNumberishToNumber(n);e=null!=t?t:0}}null!==e&&(t?this.startTime=e:__privateSet(this,_holdTime,e));let r=!1;null!==__privateGet(this,_pendingPlayTask)&&(__privateSet(this,_pendingPlayTask,null),r=!0),r||__privateSet(this,_readyPromise,__privateMethod(this,_MockedAnimation_instances,getNewReadyPromise_fn).call(this)),__privateSet(this,_pendingPauseTask,(()=>{__privateMethod(this,_MockedAnimation_instances,pauseTask_fn).call(this)})),queueMicrotask((()=>{var e;null==(e=__privateGet(this,_pendingPauseTask))||e.call(this),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!1,!1)})),__privateMethod(this,_MockedAnimation_instances,cancelIteration_fn).call(this)}finish(){const e=__privateGet(this,_MockedAnimation_instances,effectivePlaybackRate_get),t=__privateMethod(this,_MockedAnimation_instances,getComputedTiming_fn).call(this).endTime;if(0===e||e>0&&t===1/0)throw new DOMException("Failed to execute 'finish' on 'Animation': Cannot finish Animation with an infinite target effect end.","InvalidStateError");__privateMethod(this,_MockedAnimation_instances,applyPendingPlaybackRate_fn).call(this);const i=cssNumberishToNumber(__privateGet(this,_playbackRate)>0?t:0);if(null!==i&&__privateMethod(this,_MockedAnimation_instances,setCurrentTimeSilent_fn).call(this,i),null===__privateGet(this,_startTime)&&__privateMethod(this,_MockedAnimation_instances,isTimelineActive_fn).call(this)){const e=cssNumberishToNumber(this.timeline.currentTime);null!==e&&null!==i&&__privateSet(this,_startTime,e-i/__privateGet(this,_playbackRate))}null!==__privateGet(this,_pendingPauseTask)&&null!==__privateGet(this,_startTime)&&(__privateSet(this,_holdTime,null),__privateSet(this,_pendingPauseTask,null),__privateGet(this,_resolvers).ready.resolve(this)),null!==__privateGet(this,_pendingPlayTask)&&null!==__privateGet(this,_startTime)&&(__privateSet(this,_pendingPlayTask,null),__privateGet(this,_resolvers).ready.resolve(this)),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!0,!0)}cancel(){var e,t;if(__privateMethod(this,_MockedAnimation_instances,hasKeyframeEffect_fn).call(this)){if("idle"!==this.playState){__privateMethod(this,_MockedAnimation_instances,resetPendingTasks_fn).call(this),__privateMethod(this,_MockedAnimation_instances,silentlyRejectFinishedPromise_fn).call(this,new DOMException("The user aborted a request.","AbortError")),__privateSet(this,_finishedPromise,__privateMethod(this,_MockedAnimation_instances,getNewFinishedPromise_fn).call(this));const i=null!=(t=null==(e=this.timeline)?void 0:e.currentTime)?t:null,n=new AnimationPlaybackEvent("cancel",{currentTime:null,timelineTime:i}),r=()=>{var e;this.dispatchEvent(n),null==(e=this.oncancel)||e.call(this,n)};config5.act?config5.act(r):r()}else __privateSet(this,_pendingPlaybackRate,null),__privateSet(this,_pendingPauseTask,__privateSet(this,_pendingPlayTask,null));__privateSet(this,_holdTime,null),__privateSet(this,_startTime,null)}}get playbackRate(){return __privateGet(this,_playbackRate)}set playbackRate(e){__privateSet(this,_pendingPlaybackRate,null);const t=this.currentTime;if(__privateSet(this,_playbackRate,e),null!==t){const e=cssNumberishToNumber(t);null!==e&&(this.currentTime=e)}}updatePlaybackRate(e){var t,i,n;const r=this.playState;if(__privateSet(this,_pendingPlaybackRate,e),!__privateMethod(this,_MockedAnimation_instances,hasPendingTask_fn).call(this))switch(r){case"idle":case"paused":__privateMethod(this,_MockedAnimation_instances,applyPendingPlaybackRate_fn).call(this);break;case"finished":{const e=null!=(t=__privateMethod(this,_MockedAnimation_instances,calculateCurrentTime_fn).call(this))?t:__privateGet(this,_holdTime),r=null!=(n=null==(i=this.timeline)?void 0:i.currentTime)?n:null;if(0!==__privateGet(this,_pendingPlaybackRate)){if(r){const t=cssNumberishToNumber(r),i=cssNumberishToNumber(e);null!==t&&__privateSet(this,_startTime,i?t-i/__privateGet(this,_pendingPlaybackRate):null)}}else{const e=cssNumberishToNumber(r);__privateSet(this,_startTime,e)}__privateMethod(this,_MockedAnimation_instances,applyPendingPlaybackRate_fn).call(this),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!1,!1)}break;case"running":__privateMethod(this,_MockedAnimation_instances,cancelIteration_fn).call(this),__privateMethod(this,_MockedAnimation_instances,play_fn).call(this,!1)}}reverse(){if(null===this.timeline||!__privateMethod(this,_MockedAnimation_instances,isTimelineActive_fn).call(this))throw new DOMException("Cannot reverse an animation with no active timeline","InvalidStateError");const e=__privateGet(this,_pendingPlaybackRate);__privateSet(this,_pendingPlaybackRate,-__privateGet(this,_MockedAnimation_instances,effectivePlaybackRate_get)),__privateMethod(this,_MockedAnimation_instances,cancelIteration_fn).call(this);try{__privateMethod(this,_MockedAnimation_instances,play_fn).call(this,!0)}catch(t){throw __privateSet(this,_pendingPlaybackRate,e),t}}get playState(){const e=this.currentTime;return null!==e||null!==__privateGet(this,_startTime)||__privateMethod(this,_MockedAnimation_instances,hasPendingTask_fn).call(this)?null!==__privateGet(this,_pendingPauseTask)||null===this.startTime&&null===__privateGet(this,_pendingPlayTask)?"paused":null!==e&&(__privateGet(this,_MockedAnimation_instances,effectivePlaybackRate_get)>0&&(()=>{const t=cssNumberishToNumber(e),i=cssNumberishToNumber(__privateMethod(this,_MockedAnimation_instances,getComputedTiming_fn).call(this).endTime);return null!==t&&null!==i&&t>=i})()||__privateGet(this,_MockedAnimation_instances,effectivePlaybackRate_get)<0&&(()=>{const t=cssNumberishToNumber(e);return null!==t&&t<=0})())?"finished":"running":"idle"}set playState(e){throw new TypeError("Cannot set property playState of #<Animation> which has only a getter")}commitStyles(){if(!(__privateGet(this,_effect)instanceof KeyframeEffect&&__privateMethod(this,_MockedAnimation_instances,isTimelineActive_fn).call(this)))return;const e=__privateGet(this,_effect).getKeyframes(),t=__privateGet(this,_MockedAnimation_instances,transformedProgress_get),i=__privateGet(this,_MockedAnimation_instances,currentDirection_get);if(0===e.length||null===t||null===i||!__privateGet(this,_effect).target)return;if(1===e.length&&("forwards"===i&&t<=.5||"reverse"===i&&t>=.5))return void __privateMethod(this,_MockedAnimation_instances,commitKeyframeStyles_fn).call(this,__privateGet(this,_initialKeyframe));let n=e[0],r=1/0;for(const i of e){const e=Math.abs(i.computedOffset-t);e<r&&(r=e,n=i)}__privateMethod(this,_MockedAnimation_instances,commitKeyframeStyles_fn).call(this,n)}persist(){console.log("persist isn't implemented yet")}};function mockAnimation(){mockKeyframeEffect(),mockAnimationPlaybackEvent(),mockDocumentTimeline(),"undefined"==typeof Animation&&Object.defineProperty(window,"Animation",{writable:!0,configurable:!0,value:MockedAnimation})}_finishedPromise=new WeakMap,_readyPromise=new WeakMap,_startTime=new WeakMap,_pendingPauseTask=new WeakMap,_pendingPlayTask=new WeakMap,_previousCurrentTime=new WeakMap,_previousPhase=new WeakMap,_effect=new WeakMap,_timeline=new WeakMap,_rafId=new WeakMap,_initialKeyframe=new WeakMap,_fillMode=new WeakMap,_promiseStates=new WeakMap,_resolvers=new WeakMap,_getRawComputedTiming=new WeakMap,_pendingPlaybackRate=new WeakMap,_playbackRate=new WeakMap,_holdTime=new WeakMap,_MockedAnimation_instances=new WeakSet,getTiming_fn=function(){return __privateGet(this,_effect)?__privateGet(this,_effect).getTiming():{delay:0,direction:"normal",duration:0,easing:"linear",endDelay:0,fill:"auto",iterationStart:0,iterations:1}},getComputedTiming_fn=function(){return __privateGet(this,_getRawComputedTiming).call(this.effect)},localTime_get=function(){return null!==__privateGet(this,_effect)?this.currentTime:null},addToTarget_fn=function(){__privateMethod(this,_MockedAnimation_instances,hasKeyframeEffect_fn).call(this)&&null!=this.effect.target&&addAnimation(this.effect.target,this)},removeFromTarget_fn=function(){__privateMethod(this,_MockedAnimation_instances,hasKeyframeEffect_fn).call(this)&&null!=this.effect.target&&removeAnimation(this.effect.target,this)},getNewFinishedPromise_fn=function(){return __privateGet(this,_promiseStates).finished="pending",new Promise(((e,t)=>{__privateGet(this,_resolvers).finished.resolve=t=>{__privateMethod(this,_MockedAnimation_instances,removeFromTarget_fn).call(this),__privateGet(this,_promiseStates).finished="resolved",e(t)},__privateGet(this,_resolvers).finished.reject=e=>{__privateMethod(this,_MockedAnimation_instances,removeFromTarget_fn).call(this),__privateGet(this,_promiseStates).finished="rejected",t(e)}}))},getNewReadyPromise_fn=function(){return __privateGet(this,_promiseStates).ready="pending",__privateMethod(this,_MockedAnimation_instances,addToTarget_fn).call(this),new Promise(((e,t)=>{__privateGet(this,_resolvers).ready.resolve=t=>{__privateGet(this,_promiseStates).ready="resolved",e(t)},__privateGet(this,_resolvers).ready.reject=e=>{__privateGet(this,_promiseStates).ready="rejected",t(e)}}))},silentlyRejectFinishedPromise_fn=function(e){__privateGet(this,_finishedPromise).catch(noop),__privateGet(this,_resolvers).finished.reject(e)},hasPendingTask_fn=function(){return __privateGet(this,_pendingPauseTask)||__privateGet(this,_pendingPlayTask)},isTimelineActive_fn=function(){var e;return null!==(null==(e=__privateGet(this,_timeline))?void 0:e.currentTime)},hasKeyframeEffect_fn=function(){return __privateGet(this,_effect)instanceof KeyframeEffect},isTimelineMonotonicallyIncreasing_fn=function(){return __privateGet(this,_timeline)instanceof DocumentTimeline},calcInitialKeyframe_fn=function(){const e={},t=new Set;if(!(__privateGet(this,_effect)instanceof KeyframeEffect))return e;const i=__privateGet(this,_effect).target;return __privateGet(this,_effect).getKeyframes().forEach((e=>{for(const i in e)NON_STYLE_KEYFRAME_PROPERTIES.includes(i)||t.add(i)})),t.forEach((t=>{var n;const r=null!=(n=RENAMED_KEYFRAME_PROPERTIES[t])?n:t,a=i.style.getPropertyValue(r);e[t]=a})),e},applyPendingPlaybackRate_fn=function(){null!==__privateGet(this,_pendingPlaybackRate)&&(__privateSet(this,_playbackRate,__privateGet(this,_pendingPlaybackRate)),__privateSet(this,_pendingPlaybackRate,null))},animationDirection_get=function(){return null!==__privateGet(this,_effect)&&this.playbackRate<0?"backwards":"forwards"},phase_get=function(){var e,t,i,n;const r=__privateGet(this,_MockedAnimation_instances,localTime_get);if(null===r)return"idle";const a=__privateMethod(this,_MockedAnimation_instances,getComputedTiming_fn).call(this),s=null!=(e=cssNumberishToNumber(a.delay))?e:0,o=null!=(t=cssNumberishToNumber(a.activeDuration))?t:0,c=null!=(i=cssNumberishToNumber(a.endTime))?i:0,l=null!=(n=cssNumberishToNumber(r))?n:0,_=Math.max(Math.min(s,c),0),u=Math.max(Math.min(s+o,c),0);return l<_||"backwards"===__privateGet(this,_MockedAnimation_instances,animationDirection_get)&&l===_?"before":l>u||"forwards"===__privateGet(this,_MockedAnimation_instances,animationDirection_get)&&l===u?"after":"active"},resetPendingTasks_fn=function(){__privateMethod(this,_MockedAnimation_instances,hasPendingTask_fn).call(this)&&(__privateGet(this,_pendingPlayTask)&&__privateSet(this,_pendingPlayTask,null),__privateGet(this,_pendingPauseTask)&&__privateSet(this,_pendingPauseTask,null),__privateMethod(this,_MockedAnimation_instances,applyPendingPlaybackRate_fn).call(this),__privateMethod(this,_MockedAnimation_instances,silentlyRejectFinishedPromise_fn).call(this,new DOMException(void 0,"AbortError")),__privateSet(this,_readyPromise,Promise.resolve(this)))},calculateCurrentTime_fn=function(){if(__privateGet(this,_timeline)&&null!==__privateGet(this,_timeline).currentTime&&null!==this.startTime){const e=cssNumberishToNumber(__privateGet(this,_timeline).currentTime),t=cssNumberishToNumber(this.startTime);return null===e||null===t?null:(e-t)*this.playbackRate}return null},calculateStartTime_fn=function(e){let t=null;if(__privateGet(this,_timeline)){const i=cssNumberishToNumber(__privateGet(this,_timeline).currentTime);null!==i&&(t=i-e/this.playbackRate)}return t},getCurrentTimeInternal_fn=function(){return null!==__privateGet(this,_holdTime)?__privateGet(this,_holdTime):__privateMethod(this,_MockedAnimation_instances,calculateCurrentTime_fn).call(this)},effectivePlaybackRate_get=function(){var e;return null!=(e=__privateGet(this,_pendingPlaybackRate))?e:this.playbackRate},setCurrentTimeSilent_fn=function(e){if(null===e){if(null!==this.currentTime)throw new TypeError("Failed to set the 'currentTime' property on 'Animation': currentTime may not be changed from resolved to unresolved");return}const t=this.startTime;__privateGet(this,_holdTime)||null===t||null===__privateGet(this,_timeline)||null===__privateGet(this,_timeline).currentTime||0==this.playbackRate?__privateSet(this,_holdTime,e):this.startTime=__privateMethod(this,_MockedAnimation_instances,calculateStartTime_fn).call(this,e),__privateSet(this,_previousCurrentTime,null)},iteration_fn=function(){if(!__privateMethod(this,_MockedAnimation_instances,hasKeyframeEffect_fn).call(this))return;const e=this.playState,t=__privateGet(this,_MockedAnimation_instances,phase_get),i=__privateGet(this,_fillMode),n=this.effect.getKeyframes();"running"!==e&&"finished"!==e||(__privateGet(this,_previousPhase)!==t&&("idle"===__privateGet(this,_previousPhase)?this.playbackRate>0?"before"!==t||"backwards"!==i&&"both"!==i||n.length>1&&__privateMethod(this,_MockedAnimation_instances,commitKeyframeStyles_fn).call(this,n[0]):"after"!==t||"forwards"!==i&&"both"!==i||__privateMethod(this,_MockedAnimation_instances,commitKeyframeStyles_fn).call(this,n[n.length-1]):"active"===__privateGet(this,_previousPhase)&&("after"===t?"backwards"!==i&&"none"!==i||__privateMethod(this,_MockedAnimation_instances,commitKeyframeStyles_fn).call(this,__privateGet(this,_initialKeyframe)):"before"===t&&("forwards"!==i&&"none"!==i||__privateMethod(this,_MockedAnimation_instances,commitKeyframeStyles_fn).call(this,__privateGet(this,_initialKeyframe))))),"active"===t&&this.commitStyles(),"running"===e&&__privateSet(this,_rafId,requestAnimationFrame((()=>{__privateMethod(this,_MockedAnimation_instances,iteration_fn).call(this)}))),__privateSet(this,_previousPhase,t)),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!1,!0)},cancelIteration_fn=function(){null!==__privateGet(this,_rafId)&&(cancelAnimationFrame(__privateGet(this,_rafId)),__privateSet(this,_rafId,null))},playTask_fn=function(){if(__privateSet(this,_pendingPlayTask,null),!__privateMethod(this,_MockedAnimation_instances,isTimelineActive_fn).call(this))throw new Error("Failed to play an 'Animation': the animation's timeline is inactive");if(null===__privateGet(this,_startTime)&&null===__privateGet(this,_holdTime))throw new Error("Failed to play an 'Animation': the start time or hold time must be resolved");const e=this.timeline.currentTime;if(null!==__privateGet(this,_holdTime)){__privateMethod(this,_MockedAnimation_instances,applyPendingPlaybackRate_fn).call(this);const t=cssNumberishToNumber(e);if(null===t)return;const i=__privateGet(this,_holdTime),n=0===__privateGet(this,_playbackRate)?t:t-i/__privateGet(this,_playbackRate);this.startTime=numberToCSSNumberish(n)}else if(null!==__privateGet(this,_startTime)&&null!==__privateGet(this,_pendingPlaybackRate)){const t=cssNumberishToNumber(e),i=cssNumberishToNumber(__privateGet(this,_startTime));if(null===t||null===i)return;const n=(t-i)*this.playbackRate;if(__privateMethod(this,_MockedAnimation_instances,applyPendingPlaybackRate_fn).call(this),0===__privateGet(this,_playbackRate))__privateSet(this,_holdTime,n);else{const e=t-n/__privateGet(this,_playbackRate);this.startTime=numberToCSSNumberish(e)}}__privateGet(this,_resolvers).ready.resolve(this),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!1,!1)},play_fn=function(e){const t=null!==__privateGet(this,_pendingPauseTask);let i=!1,n=null;const r=__privateGet(this,_timeline)&&!__privateMethod(this,_MockedAnimation_instances,isTimelineMonotonicallyIncreasing_fn).call(this),a=this.currentTime,s=__privateMethod(this,_MockedAnimation_instances,getComputedTiming_fn).call(this).endTime,o=cssNumberishToNumber(a),c=cssNumberishToNumber(s);if(__privateGet(this,_MockedAnimation_instances,effectivePlaybackRate_get)>0&&e&&(null===o||o<0||null!==c&&o>=c))n=0;else if(__privateGet(this,_MockedAnimation_instances,effectivePlaybackRate_get)<0&&e&&(null===o||o<=0||null!==c&&o>c)){if(c===1/0)throw new DOMException("Failed to execute 'play' on 'Animation': Cannot play reversed Animation with infinite target effect end.","InvalidStateError");n=null!=c?c:0}else 0===__privateGet(this,_MockedAnimation_instances,effectivePlaybackRate_get)&&null===a&&(n=0);null!==n&&(r?(this.startTime=n,__privateSet(this,_holdTime,null),__privateMethod(this,_MockedAnimation_instances,applyPendingPlaybackRate_fn).call(this)):__privateSet(this,_holdTime,n)),null!==__privateGet(this,_holdTime)&&(this.startTime=null),__privateMethod(this,_MockedAnimation_instances,hasPendingTask_fn).call(this)&&(__privateSet(this,_pendingPauseTask,null),__privateSet(this,_pendingPlayTask,null),i=!0),(null!==__privateGet(this,_holdTime)||null!==n||t||null!==__privateGet(this,_pendingPlaybackRate))&&(i||__privateSet(this,_readyPromise,__privateMethod(this,_MockedAnimation_instances,getNewReadyPromise_fn).call(this)),__privateSet(this,_pendingPlayTask,(()=>{__privateMethod(this,_MockedAnimation_instances,playTask_fn).call(this)})),this.ready.then((()=>{var e;null==(e=__privateGet(this,_pendingPlayTask))||e.call(this),__privateMethod(this,_MockedAnimation_instances,iteration_fn).call(this)})),queueMicrotask((()=>{__privateGet(this,_resolvers).ready.resolve(this)})),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!1,!1))},pauseTask_fn=function(){if(__privateSet(this,_pendingPauseTask,null),!__privateMethod(this,_MockedAnimation_instances,isTimelineActive_fn).call(this))throw new Error("Failed to pause an 'Animation': the animation's timeline is inactive");const e=this.timeline.currentTime;if(null!==__privateGet(this,_startTime)&&null===__privateGet(this,_holdTime)){const t=cssNumberishToNumber(e),i=cssNumberishToNumber(__privateGet(this,_startTime));null!==t&&null!==i&&__privateSet(this,_holdTime,(t-i)*__privateGet(this,_playbackRate))}__privateMethod(this,_MockedAnimation_instances,applyPendingPlaybackRate_fn).call(this),__privateSet(this,_startTime,null),__privateGet(this,_resolvers).ready.resolve(this),__privateMethod(this,_MockedAnimation_instances,updateFinishedState_fn).call(this,!1,!1)},finishNotification_fn=function(){if("finished"!==this.playState)return;__privateGet(this,_resolvers).finished.resolve(this);const e=new AnimationPlaybackEvent("finish",{currentTime:this.currentTime,timelineTime:this.timeline?this.timeline.currentTime:null}),t=()=>{var t;this.dispatchEvent(e),null==(t=this.onfinish)||t.call(this,e)};config5.act?config5.act(t):t()},_queuedFinishNotificationMicrotask=new WeakMap,cancelFinishNotificationMicrotask_fn=function(){__privateSet(this,_queuedFinishNotificationMicrotask,null)},queueFinishNotificationMicrotask_fn=function(){null===__privateGet(this,_queuedFinishNotificationMicrotask)&&(__privateSet(this,_queuedFinishNotificationMicrotask,(()=>{__privateMethod(this,_MockedAnimation_instances,finishNotification_fn).call(this),__privateSet(this,_queuedFinishNotificationMicrotask,null)})),queueMicrotask((()=>{var e;return null==(e=__privateGet(this,_queuedFinishNotificationMicrotask))?void 0:e.call(this)})))},updateFinishedState_fn=function(e,t){const i=e?__privateMethod(this,_MockedAnimation_instances,calculateCurrentTime_fn).call(this):this.currentTime,n=this.startTime,r=__privateMethod(this,_MockedAnimation_instances,getComputedTiming_fn).call(this).endTime;if(null!==i&&null!==n&&!__privateMethod(this,_MockedAnimation_instances,hasPendingTask_fn).call(this)){const t=this.playbackRate,n=cssNumberishToNumber(i),a=cssNumberishToNumber(r);if(t>0&&null!==n&&null!==a&&n>=a)e?__privateSet(this,_holdTime,n):null===__privateGet(this,_previousCurrentTime)?__privateSet(this,_holdTime,a):__privateSet(this,_holdTime,Math.max(__privateGet(this,_previousCurrentTime),a));else if(t<0&&null!==n&&n<=0)e?__privateSet(this,_holdTime,n):null===__privateGet(this,_previousCurrentTime)?__privateSet(this,_holdTime,0):__privateSet(this,_holdTime,Math.min(__privateGet(this,_previousCurrentTime),0));else if(0!==t&&__privateMethod(this,_MockedAnimation_instances,isTimelineActive_fn).call(this)){if(e&&null!==__privateGet(this,_holdTime)){const e=cssNumberishToNumber(this.timeline.currentTime);null!==e&&(this.startTime=numberToCSSNumberish(e-__privateGet(this,_holdTime)/t))}__privateSet(this,_holdTime,null)}}__privateSet(this,_previousCurrentTime,__privateMethod(this,_MockedAnimation_instances,calculateCurrentTime_fn).call(this));const a="finished"===this.playState;a&&"resolved"!==__privateGet(this,_promiseStates).finished&&(t?(__privateMethod(this,_MockedAnimation_instances,cancelFinishNotificationMicrotask_fn).call(this),__privateMethod(this,_MockedAnimation_instances,finishNotification_fn).call(this)):__privateMethod(this,_MockedAnimation_instances,queueFinishNotificationMicrotask_fn).call(this)),a||"resolved"!==__privateGet(this,_promiseStates).finished||__privateSet(this,_finishedPromise,__privateMethod(this,_MockedAnimation_instances,getNewFinishedPromise_fn).call(this))},activeTime_get=function(){const e=__privateMethod(this,_MockedAnimation_instances,getComputedTiming_fn).call(this),t=__privateGet(this,_MockedAnimation_instances,localTime_get);if(null===t)return null;switch(__privateGet(this,_MockedAnimation_instances,phase_get)){case"before":if("backwards"===__privateGet(this,_fillMode)||"both"===__privateGet(this,_fillMode)){const i=cssNumberishToNumber(t),n=cssNumberishToNumber(e.delay);return null!==i&&null!==n?Math.max(i-n,0):null}return null;case"active":{const i=cssNumberishToNumber(t),n=cssNumberishToNumber(e.delay);return null!==i&&null!==n?i-n:null}case"after":if("forwards"===__privateGet(this,_fillMode)||"both"===__privateGet(this,_fillMode)){const i=cssNumberishToNumber(t),n=cssNumberishToNumber(e.delay),r=cssNumberishToNumber(e.activeDuration);return null!==i&&null!==n&&null!==r?Math.max(Math.min(i-n,r),0):null}return null;default:return null}},overallProgress_get=function(){const e=__privateGet(this,_MockedAnimation_instances,activeTime_get);if(null===e)return null;const t=__privateMethod(this,_MockedAnimation_instances,getComputedTiming_fn).call(this);let i;return i=0===t.duration?"before"===__privateGet(this,_MockedAnimation_instances,phase_get)?0:t.iterations:e/t.duration,i+t.iterationStart},iterationProgress_get=function(){const e=__privateGet(this,_MockedAnimation_instances,overallProgress_get);if(null===e)return null;const t=__privateMethod(this,_MockedAnimation_instances,getComputedTiming_fn).call(this);let i;return i=e===1/0?t.iterationStart%1:e%1,0!==i||"active"!==__privateGet(this,_MockedAnimation_instances,phase_get)&&"after"!==__privateGet(this,_MockedAnimation_instances,phase_get)||__privateGet(this,_MockedAnimation_instances,activeTime_get)!==t.activeDuration||0===t.iterations||(i=1),i},currentIteration_get=function(){if(null===__privateGet(this,_MockedAnimation_instances,activeTime_get))return null;const e=__privateMethod(this,_MockedAnimation_instances,getTiming_fn).call(this);if("after"===__privateGet(this,_MockedAnimation_instances,phase_get)&&e.iterations===1/0)return 1/0;const t=__privateGet(this,_MockedAnimation_instances,iterationProgress_get),i=__privateGet(this,_MockedAnimation_instances,overallProgress_get);return null===i?0:1===t?Math.floor(i)-1:Math.floor(i)},currentDirection_get=function(){if(null===__privateGet(this,_MockedAnimation_instances,currentIteration_get))return null;let e;const t=__privateMethod(this,_MockedAnimation_instances,getTiming_fn).call(this).direction;if("normal"===t)e="forwards";else if("reverse"===t)e="reverse";else{let i=__privateGet(this,_MockedAnimation_instances,currentIteration_get);"alternate-reverse"===t&&(i+=1),e=i===1/0||i%2==0?"forwards":"reverse"}return e},directedProgress_get=function(){const e=__privateGet(this,_MockedAnimation_instances,iterationProgress_get);if(null===e)return null;return"forwards"===__privateGet(this,_MockedAnimation_instances,currentDirection_get)?e:1-e},transformedProgress_get=function(){const e=__privateGet(this,_MockedAnimation_instances,directedProgress_get),t=__privateMethod(this,_MockedAnimation_instances,getTiming_fn).call(this);if(null===e||void 0===t)return null;const i=e>=0?"forwards":"reverse";return getEasingFunctionFromString(t.easing)(e,"before"===__privateGet(this,_MockedAnimation_instances,phase_get)&&"forwards"===i||"after"===__privateGet(this,_MockedAnimation_instances,phase_get)&&"reverse"===i)},commitKeyframeStyles_fn=function(e){if(!(__privateGet(this,_effect)instanceof KeyframeEffect))return;const t=__privateGet(this,_effect).target,i=e,{composite:n,computedOffset:r,easing:a,offset:s}=i,o=__objRest(i,["composite","computedOffset","easing","offset"]);for(const e in o){const i=o[e];if(null==i){t.style.removeProperty(e);continue}const n="string"==typeof i?i:i.toString();t.style.setProperty(e,n)}};var config6=getConfig();function animate(e,t){const i=new KeyframeEffect(this,e,t),n=new Animation(i);return"object"==typeof t&&t.id&&(n.id=t.id),n.play(),n}function mockAnimationsApi(){if(!isJsdomEnv())throw new WrongEnvironmentError;const e=Element.prototype.animate,t=Element.prototype.getAnimations,i=Document.prototype.getAnimations;mockAnimation(),Object.defineProperties(Element.prototype,{animate:{writable:!0,configurable:!0,value:animate},getAnimations:{writable:!0,configurable:!0,value:getAnimations}}),Object.defineProperty(Document.prototype,"getAnimations",{writable:!0,configurable:!0,value:getAllAnimations}),config6.afterEach((()=>{clearAnimations()})),config6.afterAll((()=>{Element.prototype.animate=e,Element.prototype.getAnimations=t,Document.prototype.getAnimations=i}))}
//# sourceMappingURL=/sm/945fb0346d8a2f6cf0acca783d8d2bbf9944a8b0526667aacaa191aa3b18a82e.map