import{useInteraction as t}from"@gem-sdk/core";import{useCallback as e}from"react";let useDispatchAfterSubmitEvent=r=>{let{trigger:i}=t();return e(()=>{let t=document.querySelector(`[data-id="${r}"]`);if(!t)return;let e=JSON.parse(t?.getAttribute("gp-interaction-after-submit")??"{}");Object.keys(e).length<=0||Object.entries(e).forEach(([e])=>{i({event:"gp:after-submit",selector:`[data-id="${r}"]`,data:Number(e),element:t})})},[r,i])};export{useDispatchAfterSubmitEvent};
