Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: components.js
}
[20500] Fix | Delete
const isAnimationFinished = this.holdTime === null &&
[20501] Fix | Delete
(this.state === "finished" || (this.state === "running" && done));
[20502] Fix | Delete
if (isAnimationFinished && finalKeyframe !== undefined) {
[20503] Fix | Delete
state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe);
[20504] Fix | Delete
}
[20505] Fix | Delete
if (onUpdate) {
[20506] Fix | Delete
onUpdate(state.value);
[20507] Fix | Delete
}
[20508] Fix | Delete
if (isAnimationFinished) {
[20509] Fix | Delete
this.finish();
[20510] Fix | Delete
}
[20511] Fix | Delete
return state;
[20512] Fix | Delete
}
[20513] Fix | Delete
get duration() {
[20514] Fix | Delete
const { resolved } = this;
[20515] Fix | Delete
return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;
[20516] Fix | Delete
}
[20517] Fix | Delete
get time() {
[20518] Fix | Delete
return millisecondsToSeconds(this.currentTime);
[20519] Fix | Delete
}
[20520] Fix | Delete
set time(newTime) {
[20521] Fix | Delete
newTime = secondsToMilliseconds(newTime);
[20522] Fix | Delete
this.currentTime = newTime;
[20523] Fix | Delete
if (this.holdTime !== null || this.speed === 0) {
[20524] Fix | Delete
this.holdTime = newTime;
[20525] Fix | Delete
}
[20526] Fix | Delete
else if (this.driver) {
[20527] Fix | Delete
this.startTime = this.driver.now() - newTime / this.speed;
[20528] Fix | Delete
}
[20529] Fix | Delete
}
[20530] Fix | Delete
get speed() {
[20531] Fix | Delete
return this.playbackSpeed;
[20532] Fix | Delete
}
[20533] Fix | Delete
set speed(newSpeed) {
[20534] Fix | Delete
const hasChanged = this.playbackSpeed !== newSpeed;
[20535] Fix | Delete
this.playbackSpeed = newSpeed;
[20536] Fix | Delete
if (hasChanged) {
[20537] Fix | Delete
this.time = millisecondsToSeconds(this.currentTime);
[20538] Fix | Delete
}
[20539] Fix | Delete
}
[20540] Fix | Delete
play() {
[20541] Fix | Delete
if (!this.resolver.isScheduled) {
[20542] Fix | Delete
this.resolver.resume();
[20543] Fix | Delete
}
[20544] Fix | Delete
if (!this._resolved) {
[20545] Fix | Delete
this.pendingPlayState = "running";
[20546] Fix | Delete
return;
[20547] Fix | Delete
}
[20548] Fix | Delete
if (this.isStopped)
[20549] Fix | Delete
return;
[20550] Fix | Delete
const { driver = frameloopDriver, onPlay } = this.options;
[20551] Fix | Delete
if (!this.driver) {
[20552] Fix | Delete
this.driver = driver((timestamp) => this.tick(timestamp));
[20553] Fix | Delete
}
[20554] Fix | Delete
onPlay && onPlay();
[20555] Fix | Delete
const now = this.driver.now();
[20556] Fix | Delete
if (this.holdTime !== null) {
[20557] Fix | Delete
this.startTime = now - this.holdTime;
[20558] Fix | Delete
}
[20559] Fix | Delete
else if (!this.startTime || this.state === "finished") {
[20560] Fix | Delete
this.startTime = now;
[20561] Fix | Delete
}
[20562] Fix | Delete
if (this.state === "finished") {
[20563] Fix | Delete
this.updateFinishedPromise();
[20564] Fix | Delete
}
[20565] Fix | Delete
this.cancelTime = this.startTime;
[20566] Fix | Delete
this.holdTime = null;
[20567] Fix | Delete
/**
[20568] Fix | Delete
* Set playState to running only after we've used it in
[20569] Fix | Delete
* the previous logic.
[20570] Fix | Delete
*/
[20571] Fix | Delete
this.state = "running";
[20572] Fix | Delete
this.driver.start();
[20573] Fix | Delete
}
[20574] Fix | Delete
pause() {
[20575] Fix | Delete
var _a;
[20576] Fix | Delete
if (!this._resolved) {
[20577] Fix | Delete
this.pendingPlayState = "paused";
[20578] Fix | Delete
return;
[20579] Fix | Delete
}
[20580] Fix | Delete
this.state = "paused";
[20581] Fix | Delete
this.holdTime = (_a = this.currentTime) !== null && _a !== void 0 ? _a : 0;
[20582] Fix | Delete
}
[20583] Fix | Delete
complete() {
[20584] Fix | Delete
if (this.state !== "running") {
[20585] Fix | Delete
this.play();
[20586] Fix | Delete
}
[20587] Fix | Delete
this.pendingPlayState = this.state = "finished";
[20588] Fix | Delete
this.holdTime = null;
[20589] Fix | Delete
}
[20590] Fix | Delete
finish() {
[20591] Fix | Delete
this.teardown();
[20592] Fix | Delete
this.state = "finished";
[20593] Fix | Delete
const { onComplete } = this.options;
[20594] Fix | Delete
onComplete && onComplete();
[20595] Fix | Delete
}
[20596] Fix | Delete
cancel() {
[20597] Fix | Delete
if (this.cancelTime !== null) {
[20598] Fix | Delete
this.tick(this.cancelTime);
[20599] Fix | Delete
}
[20600] Fix | Delete
this.teardown();
[20601] Fix | Delete
this.updateFinishedPromise();
[20602] Fix | Delete
}
[20603] Fix | Delete
teardown() {
[20604] Fix | Delete
this.state = "idle";
[20605] Fix | Delete
this.stopDriver();
[20606] Fix | Delete
this.resolveFinishedPromise();
[20607] Fix | Delete
this.updateFinishedPromise();
[20608] Fix | Delete
this.startTime = this.cancelTime = null;
[20609] Fix | Delete
this.resolver.cancel();
[20610] Fix | Delete
}
[20611] Fix | Delete
stopDriver() {
[20612] Fix | Delete
if (!this.driver)
[20613] Fix | Delete
return;
[20614] Fix | Delete
this.driver.stop();
[20615] Fix | Delete
this.driver = undefined;
[20616] Fix | Delete
}
[20617] Fix | Delete
sample(time) {
[20618] Fix | Delete
this.startTime = 0;
[20619] Fix | Delete
return this.tick(time, true);
[20620] Fix | Delete
}
[20621] Fix | Delete
}
[20622] Fix | Delete
// Legacy interface
[20623] Fix | Delete
function animateValue(options) {
[20624] Fix | Delete
return new MainThreadAnimation(options);
[20625] Fix | Delete
}
[20626] Fix | Delete
[20627] Fix | Delete
[20628] Fix | Delete
[20629] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs
[20630] Fix | Delete
const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number";
[20631] Fix | Delete
[20632] Fix | Delete
[20633] Fix | Delete
[20634] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/waapi/easing.mjs
[20635] Fix | Delete
[20636] Fix | Delete
[20637] Fix | Delete
function isWaapiSupportedEasing(easing) {
[20638] Fix | Delete
return Boolean(!easing ||
[20639] Fix | Delete
(typeof easing === "string" && easing in supportedWaapiEasing) ||
[20640] Fix | Delete
isBezierDefinition(easing) ||
[20641] Fix | Delete
(Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));
[20642] Fix | Delete
}
[20643] Fix | Delete
const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
[20644] Fix | Delete
const supportedWaapiEasing = {
[20645] Fix | Delete
linear: "linear",
[20646] Fix | Delete
ease: "ease",
[20647] Fix | Delete
easeIn: "ease-in",
[20648] Fix | Delete
easeOut: "ease-out",
[20649] Fix | Delete
easeInOut: "ease-in-out",
[20650] Fix | Delete
circIn: cubicBezierAsString([0, 0.65, 0.55, 1]),
[20651] Fix | Delete
circOut: cubicBezierAsString([0.55, 0, 1, 0.45]),
[20652] Fix | Delete
backIn: cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),
[20653] Fix | Delete
backOut: cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),
[20654] Fix | Delete
};
[20655] Fix | Delete
function mapEasingToNativeEasingWithDefault(easing) {
[20656] Fix | Delete
return (mapEasingToNativeEasing(easing) ||
[20657] Fix | Delete
supportedWaapiEasing.easeOut);
[20658] Fix | Delete
}
[20659] Fix | Delete
function mapEasingToNativeEasing(easing) {
[20660] Fix | Delete
if (!easing) {
[20661] Fix | Delete
return undefined;
[20662] Fix | Delete
}
[20663] Fix | Delete
else if (isBezierDefinition(easing)) {
[20664] Fix | Delete
return cubicBezierAsString(easing);
[20665] Fix | Delete
}
[20666] Fix | Delete
else if (Array.isArray(easing)) {
[20667] Fix | Delete
return easing.map(mapEasingToNativeEasingWithDefault);
[20668] Fix | Delete
}
[20669] Fix | Delete
else {
[20670] Fix | Delete
return supportedWaapiEasing[easing];
[20671] Fix | Delete
}
[20672] Fix | Delete
}
[20673] Fix | Delete
[20674] Fix | Delete
[20675] Fix | Delete
[20676] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs
[20677] Fix | Delete
[20678] Fix | Delete
[20679] Fix | Delete
function animateStyle(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease, times, } = {}) {
[20680] Fix | Delete
const keyframeOptions = { [valueName]: keyframes };
[20681] Fix | Delete
if (times)
[20682] Fix | Delete
keyframeOptions.offset = times;
[20683] Fix | Delete
const easing = mapEasingToNativeEasing(ease);
[20684] Fix | Delete
/**
[20685] Fix | Delete
* If this is an easing array, apply to keyframes, not animation as a whole
[20686] Fix | Delete
*/
[20687] Fix | Delete
if (Array.isArray(easing))
[20688] Fix | Delete
keyframeOptions.easing = easing;
[20689] Fix | Delete
return element.animate(keyframeOptions, {
[20690] Fix | Delete
delay,
[20691] Fix | Delete
duration,
[20692] Fix | Delete
easing: !Array.isArray(easing) ? easing : "linear",
[20693] Fix | Delete
fill: "both",
[20694] Fix | Delete
iterations: repeat + 1,
[20695] Fix | Delete
direction: repeatType === "reverse" ? "alternate" : "normal",
[20696] Fix | Delete
});
[20697] Fix | Delete
}
[20698] Fix | Delete
[20699] Fix | Delete
[20700] Fix | Delete
[20701] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs
[20702] Fix | Delete
[20703] Fix | Delete
[20704] Fix | Delete
[20705] Fix | Delete
[20706] Fix | Delete
[20707] Fix | Delete
[20708] Fix | Delete
[20709] Fix | Delete
[20710] Fix | Delete
[20711] Fix | Delete
[20712] Fix | Delete
[20713] Fix | Delete
const supportsWaapi = memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
[20714] Fix | Delete
/**
[20715] Fix | Delete
* A list of values that can be hardware-accelerated.
[20716] Fix | Delete
*/
[20717] Fix | Delete
const acceleratedValues = new Set([
[20718] Fix | Delete
"opacity",
[20719] Fix | Delete
"clipPath",
[20720] Fix | Delete
"filter",
[20721] Fix | Delete
"transform",
[20722] Fix | Delete
// TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
[20723] Fix | Delete
// or until we implement support for linear() easing.
[20724] Fix | Delete
// "background-color"
[20725] Fix | Delete
]);
[20726] Fix | Delete
/**
[20727] Fix | Delete
* 10ms is chosen here as it strikes a balance between smooth
[20728] Fix | Delete
* results (more than one keyframe per frame at 60fps) and
[20729] Fix | Delete
* keyframe quantity.
[20730] Fix | Delete
*/
[20731] Fix | Delete
const sampleDelta = 10; //ms
[20732] Fix | Delete
/**
[20733] Fix | Delete
* Implement a practical max duration for keyframe generation
[20734] Fix | Delete
* to prevent infinite loops
[20735] Fix | Delete
*/
[20736] Fix | Delete
const AcceleratedAnimation_maxDuration = 20000;
[20737] Fix | Delete
/**
[20738] Fix | Delete
* Check if an animation can run natively via WAAPI or requires pregenerated keyframes.
[20739] Fix | Delete
* WAAPI doesn't support spring or function easings so we run these as JS animation before
[20740] Fix | Delete
* handing off.
[20741] Fix | Delete
*/
[20742] Fix | Delete
function requiresPregeneratedKeyframes(options) {
[20743] Fix | Delete
return (options.type === "spring" ||
[20744] Fix | Delete
options.name === "backgroundColor" ||
[20745] Fix | Delete
!isWaapiSupportedEasing(options.ease));
[20746] Fix | Delete
}
[20747] Fix | Delete
function pregenerateKeyframes(keyframes, options) {
[20748] Fix | Delete
/**
[20749] Fix | Delete
* Create a main-thread animation to pregenerate keyframes.
[20750] Fix | Delete
* We sample this at regular intervals to generate keyframes that we then
[20751] Fix | Delete
* linearly interpolate between.
[20752] Fix | Delete
*/
[20753] Fix | Delete
const sampleAnimation = new MainThreadAnimation({
[20754] Fix | Delete
...options,
[20755] Fix | Delete
keyframes,
[20756] Fix | Delete
repeat: 0,
[20757] Fix | Delete
delay: 0,
[20758] Fix | Delete
isGenerator: true,
[20759] Fix | Delete
});
[20760] Fix | Delete
let state = { done: false, value: keyframes[0] };
[20761] Fix | Delete
const pregeneratedKeyframes = [];
[20762] Fix | Delete
/**
[20763] Fix | Delete
* Bail after 20 seconds of pre-generated keyframes as it's likely
[20764] Fix | Delete
* we're heading for an infinite loop.
[20765] Fix | Delete
*/
[20766] Fix | Delete
let t = 0;
[20767] Fix | Delete
while (!state.done && t < AcceleratedAnimation_maxDuration) {
[20768] Fix | Delete
state = sampleAnimation.sample(t);
[20769] Fix | Delete
pregeneratedKeyframes.push(state.value);
[20770] Fix | Delete
t += sampleDelta;
[20771] Fix | Delete
}
[20772] Fix | Delete
return {
[20773] Fix | Delete
times: undefined,
[20774] Fix | Delete
keyframes: pregeneratedKeyframes,
[20775] Fix | Delete
duration: t - sampleDelta,
[20776] Fix | Delete
ease: "linear",
[20777] Fix | Delete
};
[20778] Fix | Delete
}
[20779] Fix | Delete
class AcceleratedAnimation extends BaseAnimation {
[20780] Fix | Delete
constructor(options) {
[20781] Fix | Delete
super(options);
[20782] Fix | Delete
const { name, motionValue, keyframes } = this.options;
[20783] Fix | Delete
this.resolver = new DOMKeyframesResolver(keyframes, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue);
[20784] Fix | Delete
this.resolver.scheduleResolve();
[20785] Fix | Delete
}
[20786] Fix | Delete
initPlayback(keyframes, finalKeyframe) {
[20787] Fix | Delete
var _a;
[20788] Fix | Delete
let { duration = 300, times, ease, type, motionValue, name, } = this.options;
[20789] Fix | Delete
/**
[20790] Fix | Delete
* If element has since been unmounted, return false to indicate
[20791] Fix | Delete
* the animation failed to initialised.
[20792] Fix | Delete
*/
[20793] Fix | Delete
if (!((_a = motionValue.owner) === null || _a === void 0 ? void 0 : _a.current)) {
[20794] Fix | Delete
return false;
[20795] Fix | Delete
}
[20796] Fix | Delete
/**
[20797] Fix | Delete
* If this animation needs pre-generated keyframes then generate.
[20798] Fix | Delete
*/
[20799] Fix | Delete
if (requiresPregeneratedKeyframes(this.options)) {
[20800] Fix | Delete
const { onComplete, onUpdate, motionValue, ...options } = this.options;
[20801] Fix | Delete
const pregeneratedAnimation = pregenerateKeyframes(keyframes, options);
[20802] Fix | Delete
keyframes = pregeneratedAnimation.keyframes;
[20803] Fix | Delete
// If this is a very short animation, ensure we have
[20804] Fix | Delete
// at least two keyframes to animate between as older browsers
[20805] Fix | Delete
// can't animate between a single keyframe.
[20806] Fix | Delete
if (keyframes.length === 1) {
[20807] Fix | Delete
keyframes[1] = keyframes[0];
[20808] Fix | Delete
}
[20809] Fix | Delete
duration = pregeneratedAnimation.duration;
[20810] Fix | Delete
times = pregeneratedAnimation.times;
[20811] Fix | Delete
ease = pregeneratedAnimation.ease;
[20812] Fix | Delete
type = "keyframes";
[20813] Fix | Delete
}
[20814] Fix | Delete
const animation = animateStyle(motionValue.owner.current, name, keyframes, { ...this.options, duration, times, ease });
[20815] Fix | Delete
// Override the browser calculated startTime with one synchronised to other JS
[20816] Fix | Delete
// and WAAPI animations starting this event loop.
[20817] Fix | Delete
animation.startTime = time.now();
[20818] Fix | Delete
if (this.pendingTimeline) {
[20819] Fix | Delete
animation.timeline = this.pendingTimeline;
[20820] Fix | Delete
this.pendingTimeline = undefined;
[20821] Fix | Delete
}
[20822] Fix | Delete
else {
[20823] Fix | Delete
/**
[20824] Fix | Delete
* Prefer the `onfinish` prop as it's more widely supported than
[20825] Fix | Delete
* the `finished` promise.
[20826] Fix | Delete
*
[20827] Fix | Delete
* Here, we synchronously set the provided MotionValue to the end
[20828] Fix | Delete
* keyframe. If we didn't, when the WAAPI animation is finished it would
[20829] Fix | Delete
* be removed from the element which would then revert to its old styles.
[20830] Fix | Delete
*/
[20831] Fix | Delete
animation.onfinish = () => {
[20832] Fix | Delete
const { onComplete } = this.options;
[20833] Fix | Delete
motionValue.set(getFinalKeyframe(keyframes, this.options, finalKeyframe));
[20834] Fix | Delete
onComplete && onComplete();
[20835] Fix | Delete
this.cancel();
[20836] Fix | Delete
this.resolveFinishedPromise();
[20837] Fix | Delete
};
[20838] Fix | Delete
}
[20839] Fix | Delete
return {
[20840] Fix | Delete
animation,
[20841] Fix | Delete
duration,
[20842] Fix | Delete
times,
[20843] Fix | Delete
type,
[20844] Fix | Delete
ease,
[20845] Fix | Delete
keyframes: keyframes,
[20846] Fix | Delete
};
[20847] Fix | Delete
}
[20848] Fix | Delete
get duration() {
[20849] Fix | Delete
const { resolved } = this;
[20850] Fix | Delete
if (!resolved)
[20851] Fix | Delete
return 0;
[20852] Fix | Delete
const { duration } = resolved;
[20853] Fix | Delete
return millisecondsToSeconds(duration);
[20854] Fix | Delete
}
[20855] Fix | Delete
get time() {
[20856] Fix | Delete
const { resolved } = this;
[20857] Fix | Delete
if (!resolved)
[20858] Fix | Delete
return 0;
[20859] Fix | Delete
const { animation } = resolved;
[20860] Fix | Delete
return millisecondsToSeconds(animation.currentTime || 0);
[20861] Fix | Delete
}
[20862] Fix | Delete
set time(newTime) {
[20863] Fix | Delete
const { resolved } = this;
[20864] Fix | Delete
if (!resolved)
[20865] Fix | Delete
return;
[20866] Fix | Delete
const { animation } = resolved;
[20867] Fix | Delete
animation.currentTime = secondsToMilliseconds(newTime);
[20868] Fix | Delete
}
[20869] Fix | Delete
get speed() {
[20870] Fix | Delete
const { resolved } = this;
[20871] Fix | Delete
if (!resolved)
[20872] Fix | Delete
return 1;
[20873] Fix | Delete
const { animation } = resolved;
[20874] Fix | Delete
return animation.playbackRate;
[20875] Fix | Delete
}
[20876] Fix | Delete
set speed(newSpeed) {
[20877] Fix | Delete
const { resolved } = this;
[20878] Fix | Delete
if (!resolved)
[20879] Fix | Delete
return;
[20880] Fix | Delete
const { animation } = resolved;
[20881] Fix | Delete
animation.playbackRate = newSpeed;
[20882] Fix | Delete
}
[20883] Fix | Delete
get state() {
[20884] Fix | Delete
const { resolved } = this;
[20885] Fix | Delete
if (!resolved)
[20886] Fix | Delete
return "idle";
[20887] Fix | Delete
const { animation } = resolved;
[20888] Fix | Delete
return animation.playState;
[20889] Fix | Delete
}
[20890] Fix | Delete
/**
[20891] Fix | Delete
* Replace the default DocumentTimeline with another AnimationTimeline.
[20892] Fix | Delete
* Currently used for scroll animations.
[20893] Fix | Delete
*/
[20894] Fix | Delete
attachTimeline(timeline) {
[20895] Fix | Delete
if (!this._resolved) {
[20896] Fix | Delete
this.pendingTimeline = timeline;
[20897] Fix | Delete
}
[20898] Fix | Delete
else {
[20899] Fix | Delete
const { resolved } = this;
[20900] Fix | Delete
if (!resolved)
[20901] Fix | Delete
return noop_noop;
[20902] Fix | Delete
const { animation } = resolved;
[20903] Fix | Delete
animation.timeline = timeline;
[20904] Fix | Delete
animation.onfinish = null;
[20905] Fix | Delete
}
[20906] Fix | Delete
return noop_noop;
[20907] Fix | Delete
}
[20908] Fix | Delete
play() {
[20909] Fix | Delete
if (this.isStopped)
[20910] Fix | Delete
return;
[20911] Fix | Delete
const { resolved } = this;
[20912] Fix | Delete
if (!resolved)
[20913] Fix | Delete
return;
[20914] Fix | Delete
const { animation } = resolved;
[20915] Fix | Delete
if (animation.playState === "finished") {
[20916] Fix | Delete
this.updateFinishedPromise();
[20917] Fix | Delete
}
[20918] Fix | Delete
animation.play();
[20919] Fix | Delete
}
[20920] Fix | Delete
pause() {
[20921] Fix | Delete
const { resolved } = this;
[20922] Fix | Delete
if (!resolved)
[20923] Fix | Delete
return;
[20924] Fix | Delete
const { animation } = resolved;
[20925] Fix | Delete
animation.pause();
[20926] Fix | Delete
}
[20927] Fix | Delete
stop() {
[20928] Fix | Delete
this.resolver.cancel();
[20929] Fix | Delete
this.isStopped = true;
[20930] Fix | Delete
if (this.state === "idle")
[20931] Fix | Delete
return;
[20932] Fix | Delete
const { resolved } = this;
[20933] Fix | Delete
if (!resolved)
[20934] Fix | Delete
return;
[20935] Fix | Delete
const { animation, keyframes, duration, type, ease, times } = resolved;
[20936] Fix | Delete
if (animation.playState === "idle" ||
[20937] Fix | Delete
animation.playState === "finished") {
[20938] Fix | Delete
return;
[20939] Fix | Delete
}
[20940] Fix | Delete
/**
[20941] Fix | Delete
* WAAPI doesn't natively have any interruption capabilities.
[20942] Fix | Delete
*
[20943] Fix | Delete
* Rather than read commited styles back out of the DOM, we can
[20944] Fix | Delete
* create a renderless JS animation and sample it twice to calculate
[20945] Fix | Delete
* its current value, "previous" value, and therefore allow
[20946] Fix | Delete
* Motion to calculate velocity for any subsequent animation.
[20947] Fix | Delete
*/
[20948] Fix | Delete
if (this.time) {
[20949] Fix | Delete
const { motionValue, onUpdate, onComplete, ...options } = this.options;
[20950] Fix | Delete
const sampleAnimation = new MainThreadAnimation({
[20951] Fix | Delete
...options,
[20952] Fix | Delete
keyframes,
[20953] Fix | Delete
duration,
[20954] Fix | Delete
type,
[20955] Fix | Delete
ease,
[20956] Fix | Delete
times,
[20957] Fix | Delete
isGenerator: true,
[20958] Fix | Delete
});
[20959] Fix | Delete
const sampleTime = secondsToMilliseconds(this.time);
[20960] Fix | Delete
motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
[20961] Fix | Delete
}
[20962] Fix | Delete
this.cancel();
[20963] Fix | Delete
}
[20964] Fix | Delete
complete() {
[20965] Fix | Delete
const { resolved } = this;
[20966] Fix | Delete
if (!resolved)
[20967] Fix | Delete
return;
[20968] Fix | Delete
resolved.animation.finish();
[20969] Fix | Delete
}
[20970] Fix | Delete
cancel() {
[20971] Fix | Delete
const { resolved } = this;
[20972] Fix | Delete
if (!resolved)
[20973] Fix | Delete
return;
[20974] Fix | Delete
resolved.animation.cancel();
[20975] Fix | Delete
}
[20976] Fix | Delete
static supports(options) {
[20977] Fix | Delete
const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
[20978] Fix | Delete
return (supportsWaapi() &&
[20979] Fix | Delete
name &&
[20980] Fix | Delete
acceleratedValues.has(name) &&
[20981] Fix | Delete
motionValue &&
[20982] Fix | Delete
motionValue.owner &&
[20983] Fix | Delete
motionValue.owner.current instanceof HTMLElement &&
[20984] Fix | Delete
/**
[20985] Fix | Delete
* If we're outputting values to onUpdate then we can't use WAAPI as there's
[20986] Fix | Delete
* no way to read the value from WAAPI every frame.
[20987] Fix | Delete
*/
[20988] Fix | Delete
!motionValue.owner.getProps().onUpdate &&
[20989] Fix | Delete
!repeatDelay &&
[20990] Fix | Delete
repeatType !== "mirror" &&
[20991] Fix | Delete
damping !== 0 &&
[20992] Fix | Delete
type !== "inertia");
[20993] Fix | Delete
}
[20994] Fix | Delete
}
[20995] Fix | Delete
[20996] Fix | Delete
[20997] Fix | Delete
[20998] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs
[20999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function