"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=e=>{const n=typeof e;return n!=="function"&&n!=="object"||e===null},k=e=>{const n=e.flags===""?void 0:e.flags;return new RegExp(e.source,n)},l=(e,n=new WeakMap)=>{if(e===null||v(e))return e;if(n.has(e))return n.get(e);if(e instanceof RegExp)return k(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof Function)return e;if(e instanceof Map){const r=new Map;return n.set(e,r),e.forEach((o,s)=>{r.set(s,l(o,n))}),r}if(e instanceof Set){const r=new Set;n.set(e,r);for(const o of e)r.add(l(o,n));return r}if(Array.isArray(e)){const r=[];return n.set(e,r),e.forEach(o=>{r.push(l(o,n))}),r}const t={};n.set(e,t);for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=l(e[r],n));return t},x=(e,n=200)=>{let t=0;return(...r)=>new Promise(o=>{t&&(clearTimeout(t),o("cancel")),t=window.setTimeout(()=>{e.apply(void 0,r),t=0,o("done")},n)})},C=(e,n={_blank:!0,nofollow:!0})=>{const t=document.createElement("a");t.href=e,n._blank&&(t.target="_blank"),n.nofollow&&(t.rel="noopener noreferrer"),t.click()},L=(e,n="")=>{const t=document.createElement("a");t.setAttribute("href",e),t.setAttribute("download",n),t.click()},y=()=>{let e=-1;return(t,r,o,s=100)=>{const c=()=>{o&&(typeof s=="number"?setTimeout(o,s):o())};e!==-1&&(cancelAnimationFrame(e),c());let i=t.scrollTop;const a=()=>{e=-1;const u=r-i;i=i+u/5,Math.abs(u)<1?(t.scrollTo(0,r),c()):(t.scrollTo(0,i),e=requestAnimationFrame(a))};e=requestAnimationFrame(a)}},O=y(),R=(e,n=200)=>{let t=0,r=null;const o=s=>{t===0&&(t=s),s-t>=n?(e.apply(void 0,r),r=null,t=0):window.requestAnimationFrame(o)};return(...s)=>{r===null&&window.requestAnimationFrame(o),r=s}},$=(e,n=!0)=>{if(!e)return{};const t={};return e.replace(/^\?/,"").split("&").forEach(r=>{const[o,s]=r.split("=");if(o){const c=n?decodeURIComponent(o):o,i=n?decodeURIComponent(s):s;t[c]!==void 0?(Array.isArray(t[c])||(t[c]=[t[c]]),t[c].push(i)):t[c]=i}}),t},F=(e,n=!0)=>e?Object.keys(e).map(t=>{const r=n?encodeURIComponent(t):t;if(Array.isArray(e[t]))return e[t].map(o=>{const s=n?encodeURIComponent(o):o;return`${r}=${s}`}).join("&");{const o=n?encodeURIComponent(e[t]):e[t];return`${r}=${o}`}}).join("&"):"",I=(e,n,t="asc")=>e.sort((r,o)=>{const s=n(r),c=n(o);return s===void 0&&c!==void 0||s===null&&c!==void 0?t==="asc"?-1:1:s==null&&c===void 0||c==null?t==="asc"?1:-1:p(s)&&p(c)?t=="asc"?s-c:c-s:t=="asc"?String(s).localeCompare(String(c),void 0,{numeric:!0}):String(c).localeCompare(String(s),void 0,{numeric:!0})}),P=e=>{const n=t=>{const{scrollHeight:r,scrollWidth:o,offsetHeight:s,offsetWidth:c,scrollLeft:i,scrollTop:a}=e,u=t.x,A=t.y,g=S=>{const f=a+A-S.y,d=i+u-S.x,M=r-s,E=o-c,m={};d>=0&&d<=E&&(m.left=d),f>=0&&f<=M&&(m.top=f),e.scroll(m)};document.addEventListener("mousemove",g);const w=()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",w)};document.addEventListener("mouseup",w)};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}},b=()=>`${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`,p=e=>{if(e==null||["boolean","symbol"].includes(typeof e)||/^\s*$/.test(e.toString()))return!1;const n=Number(e);return!isNaN(n)&&isFinite(n)},h=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),T=(e,n,t={})=>{const{excludeKeys:r}=t;for(const o in n)r&&r(o)?e[o]=n[o]:h(n[o])&&h(e[o])?e[o]=T(e[o],n[o],t):e[o]=n[o];return e},H=(e,n=document.body)=>{let t=e.offsetParent,r=e.offsetTop,o=e.offsetLeft;for(;t!==null&&t!==n;)r+=t.offsetTop,o+=t.offsetLeft,t=t.offsetParent;return{offsetTop:r,offsetLeft:o}},N=(e={})=>{const{forceScreenWidth:n=!1,threshold:t=768,fallbackToScreenWidth:r=!0}=e,o=navigator.userAgent,s=/android|ipad|iphone|ipod|windows phone|blackberry/i.test(o),c="ontouchstart"in window||navigator.maxTouchPoints>0,i=window.matchMedia(`(max-width: ${t}px)`).matches;return n?i:s&&c?!0:r?i:!1};exports.createSmoothScroll=y;exports.debounce=x;exports.deepClone=l;exports.deepMerge=T;exports.download=L;exports.draggingScroll=P;exports.getRootOffset=H;exports.isMobile=N;exports.isNumber=p;exports.isPrimitive=v;exports.linkTo=C;exports.objToSearch=F;exports.objectSort=I;exports.randomId=b;exports.searchToObj=$;exports.smoothScroll=O;exports.throttle=R;