decord/source/9738_ItemLayout.js
2026-07-30 10:14:41 +00:00

87 lines
2.9 KiB
JavaScript

// Module ID: 9738
// Function ID: 9739
// Name: ItemLayout
// Dependencies: [19, 21, 9721, 9739, 1606]
// Exports: ItemLayout
// Module 9738 (ItemLayout)
import "noop";
import { jsx } from "jsxProd";
const require = arg1;
let closure_4 = { code: "function pnpm_ItemLayoutTsx1(){const{x,size}=this.__closure;return x.value/size;}" };
let closure_5 = { code: "function pnpm_ItemLayoutTsx2(){const{animationStyle,x,size,index}=this.__closure;return animationStyle(x.value/size,index);}" };
export const ItemLayout = (animationStyle) => {
let children;
let customConfig;
let dataLength;
let handlerOffset;
let height;
let index;
let loop;
let modeConfig;
let visibleRanges;
let width;
({ handlerOffset, index } = animationStyle);
animationStyle = animationStyle.animationStyle;
({ children, visibleRanges } = animationStyle);
let obj = index(9721);
const props = obj.useGlobalState().props;
({ loop, dataLength, width, height, customConfig, modeConfig } = props);
let tmp3 = width;
if (props.vertical) {
tmp3 = height;
}
const dependencyMap = tmp3;
obj = { handlerOffset, index, size: tmp3, dataLength, loop };
const merged = Object.assign(typeof customConfig === "find" ? customConfig() : {});
if ("horizontal-stack" === props.mode) {
obj = { handlerOffset: null, index: null, size: null, dataLength: null, loop: null, type: null, viewCount: null };
obj[0] = handlerOffset;
obj[1] = index;
obj[2] = tmp3;
obj[3] = dataLength;
obj[4] = loop;
let str = "positive";
if ("right" === modeConfig.snapDirection) {
str = "negative";
}
obj[5] = str;
obj[6] = modeConfig.showLength;
}
let tmpResult = tmp(9739);
const offsetX = tmpResult.useOffsetX(obj, visibleRanges);
tmpResult = tmp(1606);
const fn = function k() {
return offsetX.value / closure_2;
};
fn.__closure = { x: offsetX, size: tmp3 };
fn.__workletHash = 15967503186804;
fn.__initData = closure_4;
const items = [offsetX, tmp3];
const derivedValue = tmpResult.useDerivedValue(fn, items);
const tmp4 = typeof customConfig === "find" ? customConfig() : {};
class E {
constructor() {
return animationStyle(visibleRanges.value / closure_2, index);
}
}
E.__closure = { animationStyle, x: offsetX, size: tmp3, index };
E.__workletHash = 4560717846650;
E.__initData = closure_5;
const items1 = [animationStyle, index, offsetX, tmp3];
const animatedStyle = index(1606).useAnimatedStyle(E, items1);
if (!width) {
width = "100%";
}
const obj1 = { width, height: null, position: "absolute", pointerEvents: "box-none" };
if (!height) {
height = "100%";
}
const tmp9 = offsetX;
const tmpResult1 = index(1606);
obj1[1] = height;
const items2 = [obj1, animatedStyle];
return tmp9(animationStyle(1606).View, { style: items2, testID: "__CAROUSEL_ITEM_" + index + "__", children: children({ animationValue: derivedValue }) });
};