How to I process getting beaten and nearly robbed?

Today I [26M] was beaten and nearly robbed. It was at night in town around 21:45 I knew it was dangerous walking around town late hours but always thought before 22:00 it wasn't that bad and I was wrong.

As I was walking two guys came after me, one in front of me and one behind me. Looked like junkies and the guy in front grabbed my collar and shouted something idk I was wearing airpods. Before I could react the other guy also grabbed me.

My first instinct was to protect my phone and the bag I was carrying with had my laptop as I couldn't run away. The immediately notice my phone and tired to grab it, I held on tight and I was just screaming "thief!" couldn't even fight back or run away just helpless screaming.

One of them punched me in my eye and lips but just kept screaming then, my phone was snatched and held the guy in a chockhold but he passed my phone to the other guy and he started to run away.

I think he noticed people were now coming and toosed the phone to me and the other guy starting saying shit like "sorry bro" "didn't mean it". I should have punched him right then and there but I just froze and shouted at him, never felt to emasculated, weak and helpless.

Thank God my phone wasn't stolen or my bag with had money and laptop and I have no serious injuries or bruises from the punches only lost my groceries and lost my airpods but I don't know how to process this. I haven't slept yet, haven't eaten and the monet just keep replaying in my head.

My mind is racing so much right now, thinking about buying a pocket knife but haven't cause that probably wouldn't end well, haven't told my parents or friends cause the last time something like this happened my Dad said something like "why you, why were you targeted put of all people" and they 'll probably say I shouldn't walk at night and they'd be right it was stupid of me anyway and can't afford therapy so I should I process this?