Where to edit this loop

Hello Dears

Actually i`m planning to use this file


to make a dynamic website menu and include this file into header or navbar

but i wanna to know where to edit the loop which get the item groups info inside this file

file content

        <a href={{ route }}>{{ item_group_name }}</a>

so i wanna to edit the loop so i can make the menu multilevel coz i have more than 4 levels with around 64 item group

please help

any updates please ?