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
key.startsWith("onLayout") ||
[17000] Fix | Delete
validMotionProps.has(key));
[17001] Fix | Delete
}
[17002] Fix | Delete
[17003] Fix | Delete
[17004] Fix | Delete
[17005] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs
[17006] Fix | Delete
[17007] Fix | Delete
[17008] Fix | Delete
let shouldForward = (key) => !isValidMotionProp(key);
[17009] Fix | Delete
function loadExternalIsValidProp(isValidProp) {
[17010] Fix | Delete
if (!isValidProp)
[17011] Fix | Delete
return;
[17012] Fix | Delete
// Explicitly filter our events
[17013] Fix | Delete
shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key);
[17014] Fix | Delete
}
[17015] Fix | Delete
/**
[17016] Fix | Delete
* Emotion and Styled Components both allow users to pass through arbitrary props to their components
[17017] Fix | Delete
* to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which
[17018] Fix | Delete
* of these should be passed to the underlying DOM node.
[17019] Fix | Delete
*
[17020] Fix | Delete
* However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props
[17021] Fix | Delete
* as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props
[17022] Fix | Delete
* passed through the `custom` prop so it doesn't *need* the payload or computational overhead of
[17023] Fix | Delete
* `@emotion/is-prop-valid`, however to fix this problem we need to use it.
[17024] Fix | Delete
*
[17025] Fix | Delete
* By making it an optionalDependency we can offer this functionality only in the situations where it's
[17026] Fix | Delete
* actually required.
[17027] Fix | Delete
*/
[17028] Fix | Delete
try {
[17029] Fix | Delete
/**
[17030] Fix | Delete
* We attempt to import this package but require won't be defined in esm environments, in that case
[17031] Fix | Delete
* isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed
[17032] Fix | Delete
* in favour of explicit injection.
[17033] Fix | Delete
*/
[17034] Fix | Delete
loadExternalIsValidProp(require("@emotion/is-prop-valid").default);
[17035] Fix | Delete
}
[17036] Fix | Delete
catch (_a) {
[17037] Fix | Delete
// We don't need to actually do anything here - the fallback is the existing `isPropValid`.
[17038] Fix | Delete
}
[17039] Fix | Delete
function filterProps(props, isDom, forwardMotionProps) {
[17040] Fix | Delete
const filteredProps = {};
[17041] Fix | Delete
for (const key in props) {
[17042] Fix | Delete
/**
[17043] Fix | Delete
* values is considered a valid prop by Emotion, so if it's present
[17044] Fix | Delete
* this will be rendered out to the DOM unless explicitly filtered.
[17045] Fix | Delete
*
[17046] Fix | Delete
* We check the type as it could be used with the `feColorMatrix`
[17047] Fix | Delete
* element, which we support.
[17048] Fix | Delete
*/
[17049] Fix | Delete
if (key === "values" && typeof props.values === "object")
[17050] Fix | Delete
continue;
[17051] Fix | Delete
if (shouldForward(key) ||
[17052] Fix | Delete
(forwardMotionProps === true && isValidMotionProp(key)) ||
[17053] Fix | Delete
(!isDom && !isValidMotionProp(key)) ||
[17054] Fix | Delete
// If trying to use native HTML drag events, forward drag listeners
[17055] Fix | Delete
(props["draggable"] &&
[17056] Fix | Delete
key.startsWith("onDrag"))) {
[17057] Fix | Delete
filteredProps[key] =
[17058] Fix | Delete
props[key];
[17059] Fix | Delete
}
[17060] Fix | Delete
}
[17061] Fix | Delete
return filteredProps;
[17062] Fix | Delete
}
[17063] Fix | Delete
[17064] Fix | Delete
[17065] Fix | Delete
[17066] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs
[17067] Fix | Delete
[17068] Fix | Delete
[17069] Fix | Delete
function calcOrigin(origin, offset, size) {
[17070] Fix | Delete
return typeof origin === "string"
[17071] Fix | Delete
? origin
[17072] Fix | Delete
: px.transform(offset + size * origin);
[17073] Fix | Delete
}
[17074] Fix | Delete
/**
[17075] Fix | Delete
* The SVG transform origin defaults are different to CSS and is less intuitive,
[17076] Fix | Delete
* so we use the measured dimensions of the SVG to reconcile these.
[17077] Fix | Delete
*/
[17078] Fix | Delete
function calcSVGTransformOrigin(dimensions, originX, originY) {
[17079] Fix | Delete
const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
[17080] Fix | Delete
const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
[17081] Fix | Delete
return `${pxOriginX} ${pxOriginY}`;
[17082] Fix | Delete
}
[17083] Fix | Delete
[17084] Fix | Delete
[17085] Fix | Delete
[17086] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/path.mjs
[17087] Fix | Delete
[17088] Fix | Delete
[17089] Fix | Delete
const dashKeys = {
[17090] Fix | Delete
offset: "stroke-dashoffset",
[17091] Fix | Delete
array: "stroke-dasharray",
[17092] Fix | Delete
};
[17093] Fix | Delete
const camelKeys = {
[17094] Fix | Delete
offset: "strokeDashoffset",
[17095] Fix | Delete
array: "strokeDasharray",
[17096] Fix | Delete
};
[17097] Fix | Delete
/**
[17098] Fix | Delete
* Build SVG path properties. Uses the path's measured length to convert
[17099] Fix | Delete
* our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset
[17100] Fix | Delete
* and stroke-dasharray attributes.
[17101] Fix | Delete
*
[17102] Fix | Delete
* This function is mutative to reduce per-frame GC.
[17103] Fix | Delete
*/
[17104] Fix | Delete
function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {
[17105] Fix | Delete
// Normalise path length by setting SVG attribute pathLength to 1
[17106] Fix | Delete
attrs.pathLength = 1;
[17107] Fix | Delete
// We use dash case when setting attributes directly to the DOM node and camel case
[17108] Fix | Delete
// when defining props on a React component.
[17109] Fix | Delete
const keys = useDashCase ? dashKeys : camelKeys;
[17110] Fix | Delete
// Build the dash offset
[17111] Fix | Delete
attrs[keys.offset] = px.transform(-offset);
[17112] Fix | Delete
// Build the dash array
[17113] Fix | Delete
const pathLength = px.transform(length);
[17114] Fix | Delete
const pathSpacing = px.transform(spacing);
[17115] Fix | Delete
attrs[keys.array] = `${pathLength} ${pathSpacing}`;
[17116] Fix | Delete
}
[17117] Fix | Delete
[17118] Fix | Delete
[17119] Fix | Delete
[17120] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs
[17121] Fix | Delete
[17122] Fix | Delete
[17123] Fix | Delete
[17124] Fix | Delete
[17125] Fix | Delete
/**
[17126] Fix | Delete
* Build SVG visual attrbutes, like cx and style.transform
[17127] Fix | Delete
*/
[17128] Fix | Delete
function buildSVGAttrs(state, { attrX, attrY, attrScale, originX, originY, pathLength, pathSpacing = 1, pathOffset = 0,
[17129] Fix | Delete
// This is object creation, which we try to avoid per-frame.
[17130] Fix | Delete
...latest }, options, isSVGTag, transformTemplate) {
[17131] Fix | Delete
buildHTMLStyles(state, latest, options, transformTemplate);
[17132] Fix | Delete
/**
[17133] Fix | Delete
* For svg tags we just want to make sure viewBox is animatable and treat all the styles
[17134] Fix | Delete
* as normal HTML tags.
[17135] Fix | Delete
*/
[17136] Fix | Delete
if (isSVGTag) {
[17137] Fix | Delete
if (state.style.viewBox) {
[17138] Fix | Delete
state.attrs.viewBox = state.style.viewBox;
[17139] Fix | Delete
}
[17140] Fix | Delete
return;
[17141] Fix | Delete
}
[17142] Fix | Delete
state.attrs = state.style;
[17143] Fix | Delete
state.style = {};
[17144] Fix | Delete
const { attrs, style, dimensions } = state;
[17145] Fix | Delete
/**
[17146] Fix | Delete
* However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs
[17147] Fix | Delete
* and copy it into style.
[17148] Fix | Delete
*/
[17149] Fix | Delete
if (attrs.transform) {
[17150] Fix | Delete
if (dimensions)
[17151] Fix | Delete
style.transform = attrs.transform;
[17152] Fix | Delete
delete attrs.transform;
[17153] Fix | Delete
}
[17154] Fix | Delete
// Parse transformOrigin
[17155] Fix | Delete
if (dimensions &&
[17156] Fix | Delete
(originX !== undefined || originY !== undefined || style.transform)) {
[17157] Fix | Delete
style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5);
[17158] Fix | Delete
}
[17159] Fix | Delete
// Render attrX/attrY/attrScale as attributes
[17160] Fix | Delete
if (attrX !== undefined)
[17161] Fix | Delete
attrs.x = attrX;
[17162] Fix | Delete
if (attrY !== undefined)
[17163] Fix | Delete
attrs.y = attrY;
[17164] Fix | Delete
if (attrScale !== undefined)
[17165] Fix | Delete
attrs.scale = attrScale;
[17166] Fix | Delete
// Build SVG path if one has been defined
[17167] Fix | Delete
if (pathLength !== undefined) {
[17168] Fix | Delete
buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);
[17169] Fix | Delete
}
[17170] Fix | Delete
}
[17171] Fix | Delete
[17172] Fix | Delete
[17173] Fix | Delete
[17174] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs
[17175] Fix | Delete
[17176] Fix | Delete
[17177] Fix | Delete
const createSvgRenderState = () => ({
[17178] Fix | Delete
...createHtmlRenderState(),
[17179] Fix | Delete
attrs: {},
[17180] Fix | Delete
});
[17181] Fix | Delete
[17182] Fix | Delete
[17183] Fix | Delete
[17184] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs
[17185] Fix | Delete
const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg";
[17186] Fix | Delete
[17187] Fix | Delete
[17188] Fix | Delete
[17189] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/use-props.mjs
[17190] Fix | Delete
[17191] Fix | Delete
[17192] Fix | Delete
[17193] Fix | Delete
[17194] Fix | Delete
[17195] Fix | Delete
[17196] Fix | Delete
function useSVGProps(props, visualState, _isStatic, Component) {
[17197] Fix | Delete
const visualProps = (0,external_React_.useMemo)(() => {
[17198] Fix | Delete
const state = createSvgRenderState();
[17199] Fix | Delete
buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, isSVGTag(Component), props.transformTemplate);
[17200] Fix | Delete
return {
[17201] Fix | Delete
...state.attrs,
[17202] Fix | Delete
style: { ...state.style },
[17203] Fix | Delete
};
[17204] Fix | Delete
}, [visualState]);
[17205] Fix | Delete
if (props.style) {
[17206] Fix | Delete
const rawStyles = {};
[17207] Fix | Delete
copyRawValuesOnly(rawStyles, props.style, props);
[17208] Fix | Delete
visualProps.style = { ...rawStyles, ...visualProps.style };
[17209] Fix | Delete
}
[17210] Fix | Delete
return visualProps;
[17211] Fix | Delete
}
[17212] Fix | Delete
[17213] Fix | Delete
[17214] Fix | Delete
[17215] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/use-render.mjs
[17216] Fix | Delete
[17217] Fix | Delete
[17218] Fix | Delete
[17219] Fix | Delete
[17220] Fix | Delete
[17221] Fix | Delete
[17222] Fix | Delete
[17223] Fix | Delete
function createUseRender(forwardMotionProps = false) {
[17224] Fix | Delete
const useRender = (Component, props, ref, { latestValues }, isStatic) => {
[17225] Fix | Delete
const useVisualProps = isSVGComponent(Component)
[17226] Fix | Delete
? useSVGProps
[17227] Fix | Delete
: useHTMLProps;
[17228] Fix | Delete
const visualProps = useVisualProps(props, latestValues, isStatic, Component);
[17229] Fix | Delete
const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps);
[17230] Fix | Delete
const elementProps = Component !== external_React_.Fragment
[17231] Fix | Delete
? { ...filteredProps, ...visualProps, ref }
[17232] Fix | Delete
: {};
[17233] Fix | Delete
/**
[17234] Fix | Delete
* If component has been handed a motion value as its child,
[17235] Fix | Delete
* memoise its initial value and render that. Subsequent updates
[17236] Fix | Delete
* will be handled by the onChange handler
[17237] Fix | Delete
*/
[17238] Fix | Delete
const { children } = props;
[17239] Fix | Delete
const renderedChildren = (0,external_React_.useMemo)(() => (isMotionValue(children) ? children.get() : children), [children]);
[17240] Fix | Delete
return (0,external_React_.createElement)(Component, {
[17241] Fix | Delete
...elementProps,
[17242] Fix | Delete
children: renderedChildren,
[17243] Fix | Delete
});
[17244] Fix | Delete
};
[17245] Fix | Delete
return useRender;
[17246] Fix | Delete
}
[17247] Fix | Delete
[17248] Fix | Delete
[17249] Fix | Delete
[17250] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/render.mjs
[17251] Fix | Delete
function renderHTML(element, { style, vars }, styleProp, projection) {
[17252] Fix | Delete
Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));
[17253] Fix | Delete
// Loop over any CSS variables and assign those.
[17254] Fix | Delete
for (const key in vars) {
[17255] Fix | Delete
element.style.setProperty(key, vars[key]);
[17256] Fix | Delete
}
[17257] Fix | Delete
}
[17258] Fix | Delete
[17259] Fix | Delete
[17260] Fix | Delete
[17261] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs
[17262] Fix | Delete
/**
[17263] Fix | Delete
* A set of attribute names that are always read/written as camel case.
[17264] Fix | Delete
*/
[17265] Fix | Delete
const camelCaseAttributes = new Set([
[17266] Fix | Delete
"baseFrequency",
[17267] Fix | Delete
"diffuseConstant",
[17268] Fix | Delete
"kernelMatrix",
[17269] Fix | Delete
"kernelUnitLength",
[17270] Fix | Delete
"keySplines",
[17271] Fix | Delete
"keyTimes",
[17272] Fix | Delete
"limitingConeAngle",
[17273] Fix | Delete
"markerHeight",
[17274] Fix | Delete
"markerWidth",
[17275] Fix | Delete
"numOctaves",
[17276] Fix | Delete
"targetX",
[17277] Fix | Delete
"targetY",
[17278] Fix | Delete
"surfaceScale",
[17279] Fix | Delete
"specularConstant",
[17280] Fix | Delete
"specularExponent",
[17281] Fix | Delete
"stdDeviation",
[17282] Fix | Delete
"tableValues",
[17283] Fix | Delete
"viewBox",
[17284] Fix | Delete
"gradientTransform",
[17285] Fix | Delete
"pathLength",
[17286] Fix | Delete
"startOffset",
[17287] Fix | Delete
"textLength",
[17288] Fix | Delete
"lengthAdjust",
[17289] Fix | Delete
]);
[17290] Fix | Delete
[17291] Fix | Delete
[17292] Fix | Delete
[17293] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/render.mjs
[17294] Fix | Delete
[17295] Fix | Delete
[17296] Fix | Delete
[17297] Fix | Delete
[17298] Fix | Delete
function renderSVG(element, renderState, _styleProp, projection) {
[17299] Fix | Delete
renderHTML(element, renderState, undefined, projection);
[17300] Fix | Delete
for (const key in renderState.attrs) {
[17301] Fix | Delete
element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);
[17302] Fix | Delete
}
[17303] Fix | Delete
}
[17304] Fix | Delete
[17305] Fix | Delete
[17306] Fix | Delete
[17307] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs
[17308] Fix | Delete
[17309] Fix | Delete
[17310] Fix | Delete
[17311] Fix | Delete
function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
[17312] Fix | Delete
var _a;
[17313] Fix | Delete
const { style } = props;
[17314] Fix | Delete
const newValues = {};
[17315] Fix | Delete
for (const key in style) {
[17316] Fix | Delete
if (isMotionValue(style[key]) ||
[17317] Fix | Delete
(prevProps.style &&
[17318] Fix | Delete
isMotionValue(prevProps.style[key])) ||
[17319] Fix | Delete
isForcedMotionValue(key, props) ||
[17320] Fix | Delete
((_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== undefined) {
[17321] Fix | Delete
newValues[key] = style[key];
[17322] Fix | Delete
}
[17323] Fix | Delete
}
[17324] Fix | Delete
return newValues;
[17325] Fix | Delete
}
[17326] Fix | Delete
[17327] Fix | Delete
[17328] Fix | Delete
[17329] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs
[17330] Fix | Delete
[17331] Fix | Delete
[17332] Fix | Delete
[17333] Fix | Delete
[17334] Fix | Delete
function scrape_motion_values_scrapeMotionValuesFromProps(props, prevProps, visualElement) {
[17335] Fix | Delete
const newValues = scrapeMotionValuesFromProps(props, prevProps, visualElement);
[17336] Fix | Delete
for (const key in props) {
[17337] Fix | Delete
if (isMotionValue(props[key]) ||
[17338] Fix | Delete
isMotionValue(prevProps[key])) {
[17339] Fix | Delete
const targetKey = transformPropOrder.indexOf(key) !== -1
[17340] Fix | Delete
? "attr" + key.charAt(0).toUpperCase() + key.substring(1)
[17341] Fix | Delete
: key;
[17342] Fix | Delete
newValues[targetKey] = props[key];
[17343] Fix | Delete
}
[17344] Fix | Delete
}
[17345] Fix | Delete
return newValues;
[17346] Fix | Delete
}
[17347] Fix | Delete
[17348] Fix | Delete
[17349] Fix | Delete
[17350] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs
[17351] Fix | Delete
function getValueState(visualElement) {
[17352] Fix | Delete
const state = [{}, {}];
[17353] Fix | Delete
visualElement === null || visualElement === void 0 ? void 0 : visualElement.values.forEach((value, key) => {
[17354] Fix | Delete
state[0][key] = value.get();
[17355] Fix | Delete
state[1][key] = value.getVelocity();
[17356] Fix | Delete
});
[17357] Fix | Delete
return state;
[17358] Fix | Delete
}
[17359] Fix | Delete
function resolveVariantFromProps(props, definition, custom, visualElement) {
[17360] Fix | Delete
/**
[17361] Fix | Delete
* If the variant definition is a function, resolve.
[17362] Fix | Delete
*/
[17363] Fix | Delete
if (typeof definition === "function") {
[17364] Fix | Delete
const [current, velocity] = getValueState(visualElement);
[17365] Fix | Delete
definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
[17366] Fix | Delete
}
[17367] Fix | Delete
/**
[17368] Fix | Delete
* If the variant definition is a variant label, or
[17369] Fix | Delete
* the function returned a variant label, resolve.
[17370] Fix | Delete
*/
[17371] Fix | Delete
if (typeof definition === "string") {
[17372] Fix | Delete
definition = props.variants && props.variants[definition];
[17373] Fix | Delete
}
[17374] Fix | Delete
/**
[17375] Fix | Delete
* At this point we've resolved both functions and variant labels,
[17376] Fix | Delete
* but the resolved variant label might itself have been a function.
[17377] Fix | Delete
* If so, resolve. This can only have returned a valid target object.
[17378] Fix | Delete
*/
[17379] Fix | Delete
if (typeof definition === "function") {
[17380] Fix | Delete
const [current, velocity] = getValueState(visualElement);
[17381] Fix | Delete
definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
[17382] Fix | Delete
}
[17383] Fix | Delete
return definition;
[17384] Fix | Delete
}
[17385] Fix | Delete
[17386] Fix | Delete
[17387] Fix | Delete
[17388] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-constant.mjs
[17389] Fix | Delete
[17390] Fix | Delete
[17391] Fix | Delete
/**
[17392] Fix | Delete
* Creates a constant value over the lifecycle of a component.
[17393] Fix | Delete
*
[17394] Fix | Delete
* Even if `useMemo` is provided an empty array as its final argument, it doesn't offer
[17395] Fix | Delete
* a guarantee that it won't re-run for performance reasons later on. By using `useConstant`
[17396] Fix | Delete
* you can ensure that initialisers don't execute twice or more.
[17397] Fix | Delete
*/
[17398] Fix | Delete
function useConstant(init) {
[17399] Fix | Delete
const ref = (0,external_React_.useRef)(null);
[17400] Fix | Delete
if (ref.current === null) {
[17401] Fix | Delete
ref.current = init();
[17402] Fix | Delete
}
[17403] Fix | Delete
return ref.current;
[17404] Fix | Delete
}
[17405] Fix | Delete
[17406] Fix | Delete
[17407] Fix | Delete
[17408] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs
[17409] Fix | Delete
const isKeyframesTarget = (v) => {
[17410] Fix | Delete
return Array.isArray(v);
[17411] Fix | Delete
};
[17412] Fix | Delete
[17413] Fix | Delete
[17414] Fix | Delete
[17415] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/resolve-value.mjs
[17416] Fix | Delete
[17417] Fix | Delete
[17418] Fix | Delete
const isCustomValue = (v) => {
[17419] Fix | Delete
return Boolean(v && typeof v === "object" && v.mix && v.toValue);
[17420] Fix | Delete
};
[17421] Fix | Delete
const resolveFinalValueInKeyframes = (v) => {
[17422] Fix | Delete
// TODO maybe throw if v.length - 1 is placeholder token?
[17423] Fix | Delete
return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;
[17424] Fix | Delete
};
[17425] Fix | Delete
[17426] Fix | Delete
[17427] Fix | Delete
[17428] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs
[17429] Fix | Delete
[17430] Fix | Delete
[17431] Fix | Delete
[17432] Fix | Delete
/**
[17433] Fix | Delete
* If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
[17434] Fix | Delete
*
[17435] Fix | Delete
* TODO: Remove and move to library
[17436] Fix | Delete
*/
[17437] Fix | Delete
function resolveMotionValue(value) {
[17438] Fix | Delete
const unwrappedValue = isMotionValue(value) ? value.get() : value;
[17439] Fix | Delete
return isCustomValue(unwrappedValue)
[17440] Fix | Delete
? unwrappedValue.toValue()
[17441] Fix | Delete
: unwrappedValue;
[17442] Fix | Delete
}
[17443] Fix | Delete
[17444] Fix | Delete
[17445] Fix | Delete
[17446] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs
[17447] Fix | Delete
[17448] Fix | Delete
[17449] Fix | Delete
[17450] Fix | Delete
[17451] Fix | Delete
[17452] Fix | Delete
[17453] Fix | Delete
[17454] Fix | Delete
[17455] Fix | Delete
[17456] Fix | Delete
function makeState({ scrapeMotionValuesFromProps, createRenderState, onMount, }, props, context, presenceContext) {
[17457] Fix | Delete
const state = {
[17458] Fix | Delete
latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),
[17459] Fix | Delete
renderState: createRenderState(),
[17460] Fix | Delete
};
[17461] Fix | Delete
if (onMount) {
[17462] Fix | Delete
state.mount = (instance) => onMount(props, instance, state);
[17463] Fix | Delete
}
[17464] Fix | Delete
return state;
[17465] Fix | Delete
}
[17466] Fix | Delete
const makeUseVisualState = (config) => (props, isStatic) => {
[17467] Fix | Delete
const context = (0,external_React_.useContext)(MotionContext);
[17468] Fix | Delete
const presenceContext = (0,external_React_.useContext)(PresenceContext_PresenceContext);
[17469] Fix | Delete
const make = () => makeState(config, props, context, presenceContext);
[17470] Fix | Delete
return isStatic ? make() : useConstant(make);
[17471] Fix | Delete
};
[17472] Fix | Delete
function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
[17473] Fix | Delete
const values = {};
[17474] Fix | Delete
const motionValues = scrapeMotionValues(props, {});
[17475] Fix | Delete
for (const key in motionValues) {
[17476] Fix | Delete
values[key] = resolveMotionValue(motionValues[key]);
[17477] Fix | Delete
}
[17478] Fix | Delete
let { initial, animate } = props;
[17479] Fix | Delete
const isControllingVariants$1 = isControllingVariants(props);
[17480] Fix | Delete
const isVariantNode$1 = isVariantNode(props);
[17481] Fix | Delete
if (context &&
[17482] Fix | Delete
isVariantNode$1 &&
[17483] Fix | Delete
!isControllingVariants$1 &&
[17484] Fix | Delete
props.inherit !== false) {
[17485] Fix | Delete
if (initial === undefined)
[17486] Fix | Delete
initial = context.initial;
[17487] Fix | Delete
if (animate === undefined)
[17488] Fix | Delete
animate = context.animate;
[17489] Fix | Delete
}
[17490] Fix | Delete
let isInitialAnimationBlocked = presenceContext
[17491] Fix | Delete
? presenceContext.initial === false
[17492] Fix | Delete
: false;
[17493] Fix | Delete
isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;
[17494] Fix | Delete
const variantToSet = isInitialAnimationBlocked ? animate : initial;
[17495] Fix | Delete
if (variantToSet &&
[17496] Fix | Delete
typeof variantToSet !== "boolean" &&
[17497] Fix | Delete
!isAnimationControls(variantToSet)) {
[17498] Fix | Delete
const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];
[17499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function