Join co-planar curves

hi guys! I have a set of curves which in order to reduce their size, I explode them into segments and move it a certain distance (like in the screenshot). I was hoping someone could help me with reconstructing the curve, since I can’t figure out a way to do it since some curves have more that 4 segments each. Any ideas are welcome. Thank you!

Whole curve without exploding

Shattered and moved segment

Reconstructed curve

join coplanar (79.9 KB)