utils-T19oHQ5t.js 873 B

1
  1. import{B as c}from"./index-BH-yCh83.js";const u=t=>JSON.stringify(t),f=t=>{try{return JSON.parse(t)}catch(o){return console.log(o),null}},p=(t,o,e)=>{if(typeof t!="function")return new Error("debounce func is not a function");typeof e===void 0&&(e=!1);let n;return function(...r){const s=this;n&&clearTimeout(n),e&&!n&&t.apply(s,r),n=setTimeout(function(){n=null,e||t.apply(s,r)},o)}},h=t=>{{const o=c("ASSETS_BASE_URL");if(t.indexOf("http")===0){const e="http://smartai.com:8293";return t.indexOf(e)===0?t.replace(e,o):t}else return`${o}${t}`}},w=(t,o)=>{if(typeof t!="function")throw new Error(`${t} is not a function`);let e=0,n=null;return function(...r){const s=this,l=o-(new Date-e);l<=0?(t.call(s,...r),e=new Date,clearTimeout(n),n=null):n||(n=setTimeout(function(){clearTimeout(n),n=null,t.call(s,...r),e=new Date},l))}};export{u as a,p as b,w as c,h as f,f as j};