"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("react");function t(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,u,o,i,a=[],l=!0,c=!1;try{if(o=(e=e.call(r)).next,0===t){if(Object(e)!==e)return;l=!1}else for(;!(l=(n=o.call(e)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(f){c=!0,u=f}finally{try{if(!l&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(c)throw u}}return a}}(r,t)||function(r,t){if(!r)return;if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}exports.useDebounce=function(e,n){var u=t(r.useState(e),2),o=u[0],i=u[1];return r.useEffect((function(){var r=setTimeout((function(){i(e)}),n);return function(){clearTimeout(r)}}),[e,n]),o};
