import{i,u as m,b as o,h as u}from"./DBjB5OCe.js";import{l as _}from"./Brw7Adzg.js";function h(e,a,f=a){var c=i();_(e,"input",r=>{var l=r?e.defaultValue:e.value;if(l=v(e)?s(l):l,f(l),c&&l!==(l=a())){var d=e.selectionStart,n=e.selectionEnd;e.value=l??"",n!==null&&(e.selectionStart=d,e.selectionEnd=Math.min(n,e.value.length))}}),(u&&e.defaultValue!==e.value||m(a)==null&&e.value)&&f(v(e)?s(e.value):e.value),o(()=>{var r=a();v(e)&&r===s(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function v(e){var a=e.type;return a==="number"||a==="range"}function s(e){return e===""?null:+e}function y(e,a,f=a){_(e,"change",()=>{f(e.files)}),u&&e.files&&f(e.files),o(()=>{e.files=a()})}export{y as a,h as b};
