Files
discord-decomp/_bundle/Module5363.js
T
2026-11-01 12:12:55 +02:00

74 lines
3.8 KiB
JavaScript

// Metro module 5363 (f5364).
import { useSharedValue, useDerivedValue } from "./Module1606";
import * as _Module5249 from "./Module5249";
import * as _Module5262 from "./Module5262";
const __initData = {
code: "function pnpm_useAnimatedSnapPointsTs1(){const{containerHeight,INITIAL_CONTAINER_HEIGHT,INITIAL_SNAP_POINT,snapPoints,normalizeSnapPoint,enableDynamicSizing,handleHeight,INITIAL_HANDLE_HEIGHT,contentHeight,maxDynamicContentSize,dynamicSnapPointIndex}=this.__closure;const isContainerLayoutReady=containerHeight.value!==INITIAL_CONTAINER_HEIGHT;if(!isContainerLayoutReady){return[INITIAL_SNAP_POINT];}const _snapPoints=snapPoints?'value'in snapPoints?snapPoints.value:snapPoints:[];let _normalizedSnapPoints=_snapPoints.map(function(snapPoint){return normalizeSnapPoint(snapPoint,containerHeight.value);});if(!enableDynamicSizing){return _normalizedSnapPoints;}if(handleHeight.value===INITIAL_HANDLE_HEIGHT){return[INITIAL_SNAP_POINT];}if(contentHeight.value===INITIAL_CONTAINER_HEIGHT){return[INITIAL_SNAP_POINT];}const dynamicSnapPoint=containerHeight.value-Math.min(contentHeight.value+handleHeight.value,maxDynamicContentSize!==undefined?maxDynamicContentSize:containerHeight.value);if(!_normalizedSnapPoints.includes(dynamicSnapPoint)){_normalizedSnapPoints.push(dynamicSnapPoint);}_normalizedSnapPoints=_normalizedSnapPoints.sort(function(a,b){return b-a;});dynamicSnapPointIndex.value=_normalizedSnapPoints.indexOf(dynamicSnapPoint);return _normalizedSnapPoints;}"
};
const __initData2 = {
code: "function pnpm_useAnimatedSnapPointsTs2(){const{enableDynamicSizing,snapPoints}=this.__closure;if(enableDynamicSizing){return true;}const _snapPoints=snapPoints?'value'in snapPoints?snapPoints.value:snapPoints:[];if(_snapPoints.length&&_snapPoints.find(function(snapPoint){return typeof snapPoint==='string';})){return true;}return false;}"
};
export const useAnimatedSnapPoints = (a0, a1, a2, a3, a4, a5, a6) => {
const sharedValue = useSharedValue(-1);
const P = function P() {
if (a1.value === _Module5249.INITIAL_CONTAINER_HEIGHT) {
return [_Module5249.INITIAL_SNAP_POINT];
}
const r8 = (a0 ? "value" in a0 ? a0.value : a0 : []).map((item) => _Module5262.normalizeSnapPoint(item, a1.value));
if (a5) {
if (a3.value === _Module5249.INITIAL_HANDLE_HEIGHT) {
return [_Module5249.INITIAL_SNAP_POINT];
}
if (a2.value === _Module5249.INITIAL_CONTAINER_HEIGHT) {
return [_Module5249.INITIAL_SNAP_POINT];
}
const value = a1.value;
const r10 = Math;
const r35 = a2.value + a3.value;
let r36 = a6;
if (r36 === void 0) {
r36 = a1.value;
}
const r38 = value - r10.min(r35, r36);
if (!r8.includes(r38)) {
r8.push(r38);
}
const r45 = r8.sort((a, b) => b - a);
sharedValue.value = r45.indexOf(r38);
return r45;
}
return r8;
};
P.__closure = {
containerHeight: a1,
INITIAL_CONTAINER_HEIGHT: _Module5249.INITIAL_CONTAINER_HEIGHT,
INITIAL_SNAP_POINT: _Module5249.INITIAL_SNAP_POINT,
snapPoints: a0,
normalizeSnapPoint: _Module5262.normalizeSnapPoint,
enableDynamicSizing: a5,
handleHeight: a3,
INITIAL_HANDLE_HEIGHT: _Module5249.INITIAL_HANDLE_HEIGHT,
contentHeight: a2,
maxDynamicContentSize: a6,
dynamicSnapPointIndex: sharedValue
};
P.__workletHash = 15015207820492;
P.__initData = __initData;
const derivedValue = useDerivedValue(P, [a0, a1, a3, a2, a4, a5, a6, sharedValue]);
const N = function N() {
if (a5) {
return true;
}
const r4 = a0 ? "value" in a0 ? a0.value : a0 : [];
const length = r4.length;
return !(length ? !r4.find((item) => typeof item === "string") : !length);
};
N.__closure = {
enableDynamicSizing: a5,
snapPoints: a0
};
N.__workletHash = 4816362093278;
N.__initData = __initData2;
return [derivedValue, sharedValue, useDerivedValue(N)];
};