import{q as t}from"./vendor-react-DfNOgXDS.js";import{c0 as c}from"./index-BOsmuAFH.js";function a(r,n){c("form_field_focus",{field_name:r,form_name:n})}function i(r,n,o){c("form_field_blur",{field_name:r,form_name:n,time_spent_ms:o})}function l(r,n,o){c("form_validation_error",{field_name:r,form_name:n,error_message:o})}function m(r,n,o=0){c("form_submit",{form_name:r,success:n,error_count:o})}function p(r,n){const o=t.useRef(0),e=t.useCallback(()=>{o.current=performance.now(),a(r,n)},[r,n]),u=t.useCallback(()=>{const s=o.current>0?Math.round(performance.now()-o.current):0;i(r,n,s),o.current=0},[r,n]);return{onFocus:e,onBlur:u}}function k(r,n){const o=t.useRef(0),e=t.useCallback(()=>{o.current=performance.now(),a(r,n)},[r,n]),u=t.useCallback(()=>{const s=o.current>0?Math.round(performance.now()-o.current):0;i(r,n,s),o.current=0},[r,n]);return{onOpen:e,onPick:u}}export{l as a,k as b,m as t,p as u};