Snap nearest Spline with geometry node

Hello !

I would like to find the closest spline of a given vertex, and then change the factor value to put my vertex where I want on this spline. Here I have a curve with 3 splines, the nearest spline of the vertex index 2, should be the outer spline (index 2 also here).

Bad luck so far: if I plug the geometry proximity or the sample nearest, it will snap to the wrong spline. Is there any node or tips to handle this ?

I also posted on Blender.stackexchange, where Chris gave me the solution:
His version also adds nearest point of the spline:

And for my case :