utilzify 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var apizum=function(t,e,r,n,o){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=a(e),c=a(r),s=a(o);const u=t=>t.replace(/<[^>]*>/g,"").trim();var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d=Array.isArray,p="object"==typeof l&&l&&l.Object===Object&&l,h="object"==typeof self&&self&&self.Object===Object&&self,v=p||h||Function("return this")(),y=v.Symbol,g=y,m=Object.prototype,b=m.hasOwnProperty,_=m.toString,w=g?g.toStringTag:void 0;var j=function(t){var e=b.call(t,w),r=t[w];try{t[w]=void 0;var n=!0}catch(t){}var o=_.call(t);return n&&(e?t[w]=r:delete t[w]),o},S=Object.prototype.toString;var C=j,N=function(t){return S.call(t)},O=y?y.toStringTag:void 0;var $=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?C(t):N(t)};var T=$,x=function(t){return null!=t&&"object"==typeof t};var E=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==T(t)},M=d,P=E,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;var k=function(t,e){if(M(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!P(t))||(A.test(t)||!z.test(t)||null!=e&&t in Object(e))};var I=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},F=$,L=I;var U,B=function(t){if(!L(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=v["__core-js_shared__"],R=(U=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var Y=function(t){return!!R&&R in t},H=Function.prototype.toString;var V=B,G=Y,q=I,Z=function(t){if(null!=t){try{return H.call(t)}catch(t){}try{return t+""}catch(t){}}return""},J=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,W=K.toString,X=Q.hasOwnProperty,tt=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var et=function(t){return!(!q(t)||G(t))&&(V(t)?tt:J).test(Z(t))},rt=function(t,e){return null==t?void 0:t[e]};var nt=function(t,e){var r=rt(t,e);return et(r)?r:void 0},ot=nt(Object,"create"),at=ot;var it=function(){this.__data__=at?at(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},st=ot,ut=Object.prototype.hasOwnProperty;var lt=function(t){var e=this.__data__;if(st){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ut.call(e,t)?e[t]:void 0},ft=ot,dt=Object.prototype.hasOwnProperty;var pt=ot;var ht=it,vt=ct,yt=lt,gt=function(t){var e=this.__data__;return ft?void 0!==e[t]:dt.call(e,t)},mt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this};function bt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bt.prototype.clear=ht,bt.prototype.delete=vt,bt.prototype.get=yt,bt.prototype.has=gt,bt.prototype.set=mt;var _t=bt;var wt=function(){this.__data__=[],this.size=0};var jt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1},Ct=St,Nt=Array.prototype.splice;var Ot=St;var $t=St;var Tt=St;var xt=wt,Et=function(t){var e=this.__data__,r=Ct(e,t);return!(r<0)&&(r==e.length-1?e.pop():Nt.call(e,r,1),--this.size,!0)},Mt=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Pt=function(t){return $t(this.__data__,t)>-1},zt=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function At(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}At.prototype.clear=xt,At.prototype.delete=Et,At.prototype.get=Mt,At.prototype.has=Pt,At.prototype.set=zt;var kt=At,It=nt(v,"Map"),Ft=_t,Lt=kt,Ut=It;var Bt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Dt=function(t,e){var r=t.__data__;return Bt(e)?r["string"==typeof e?"string":"hash"]:r.map},Rt=Dt;var Yt=Dt;var Ht=Dt;var Vt=Dt;var Gt=function(){this.size=0,this.__data__={hash:new Ft,map:new(Ut||Lt),string:new Ft}},qt=function(t){var e=Rt(this,t).delete(t);return this.size-=e?1:0,e},Zt=function(t){return Yt(this,t).get(t)},Jt=function(t){return Ht(this,t).has(t)},Kt=function(t,e){var r=Vt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Qt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qt.prototype.clear=Gt,Qt.prototype.delete=qt,Qt.prototype.get=Zt,Qt.prototype.has=Jt,Qt.prototype.set=Kt;var Wt=Qt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Xt.Cache||Wt),r}Xt.Cache=Wt;var te=Xt;var ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/\\(\\)?/g,ne=function(t){var e=te(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ee,(function(t,r,n,o){e.push(n?o.replace(re,"$1"):r||t)})),e}));var oe=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},ae=d,ie=E,ce=y?y.prototype:void 0,se=ce?ce.toString:void 0;var ue=function t(e){if("string"==typeof e)return e;if(ae(e))return oe(e,t)+"";if(ie(e))return se?se.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},le=ue;var fe=d,de=k,pe=ne,he=function(t){return null==t?"":le(t)};var ve=E;var ye=function(t,e){return fe(t)?t:de(t,e)?[t]:pe(he(t))},ge=function(t){if("string"==typeof t||ve(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var me=function(t,e){for(var r=0,n=(e=ye(e,t)).length;null!=t&&r<n;)t=t[ge(e[r++])];return r&&r==n?t:void 0};var be=f((function(t,e,r){var n=null==t?void 0:me(t,e);return void 0===n?r:n}));const _e={columnIndexCache:new Map,columnNameCache:new Map};function we(t){const e=t.toUpperCase();if(_e.columnIndexCache.has(e))return _e.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return _e.columnIndexCache.set(e,n),n}const je={getStr(t=[],e,r=""){const n=be(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=be(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=be(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},Se={getStr(t=[],e,r=""){const n=we(e),o=be(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=we(e),o=be(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=we(e);if(!Array.isArray(t))return r;const o=be(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Ce=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Ne=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Oe=t=>{const e=Ce(),r=Ne();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};return t.ColumnMapper=Se,t.IndexMapper=je,t.StyledLogger=class{static getStyle(t){switch(t){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(t,e="",...r){if(Ce())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"",info:"",warn:"",error:"",success:"",debug:""};console.log(`${n[t]}[${t.toUpperCase()}] ${e}`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=Oe,t.convertDigitalSize=(t,e,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{Oe("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return"";console.log(t);let r="";const n=t instanceof Error&&"object"==typeof t;if(n&&be(t,"response.data")&&"object"==typeof t){const n=be(t,"response.data.errors");if(n)(n||[]).forEach((t=>{t.message&&(r+=t.message+"\n")}));else{const e=be(t,"response.data"),n="string"==typeof e?u(e):be(t,"response.data.error.message")||t.message||"";r+=n?n+"\n":""}return r.trim()||e}if(n){const n=t.message||"";return r+=n?n+"\n":"",r.trim()||e}return"object"==typeof t?t.errors&&t.errors.forEach((t=>{t.message&&(r+=t.message+"\n")})):r+=u(String(t))+"\n",r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=we,t.getColumnName=function(t){if(_e.columnNameCache.has(t))return _e.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return _e.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=i.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{Oe("backend");const t=s.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=we(e);return be(t,`[${n}]`,r)},t.isBrowser=Ce,t.isNode=Ne,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{Oe("backend");const e=c.default.promisify(n.exec),{stdout:r,stderr:o}=await e(t);if(o)throw new Error(o);return r.trim()},t.saveFile=(t,e)=>{if(Oe("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{Oe("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=u,Object.defineProperty(t,"__esModule",{value:!0}),t}({},moment,util,child_process,os);
1
+ var apizum=function(t,e,r,n,o){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=a(e),c=a(r),u=a(o);const s=t=>t.replace(/<[^>]*>/g,"").trim();var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d=Array.isArray,p="object"==typeof l&&l&&l.Object===Object&&l,h="object"==typeof self&&self&&self.Object===Object&&self,v=p||h||Function("return this")(),y=v.Symbol,g=y,m=Object.prototype,b=m.hasOwnProperty,_=m.toString,w=g?g.toStringTag:void 0;var j=function(t){var e=b.call(t,w),r=t[w];try{t[w]=void 0;var n=!0}catch(t){}var o=_.call(t);return n&&(e?t[w]=r:delete t[w]),o},S=Object.prototype.toString;var C=j,N=function(t){return S.call(t)},O=y?y.toStringTag:void 0;var $=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?C(t):N(t)};var T=$,A=function(t){return null!=t&&"object"==typeof t};var x=function(t){return"symbol"==typeof t||A(t)&&"[object Symbol]"==T(t)},M=d,P=x,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/;var I=function(t,e){if(M(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!P(t))||(k.test(t)||!z.test(t)||null!=e&&t in Object(e))};var E=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},F=$,L=E;var U,B=function(t){if(!L(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=v["__core-js_shared__"],R=(U=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var Y=function(t){return!!R&&R in t},H=Function.prototype.toString;var V=B,G=Y,q=E,Z=function(t){if(null!=t){try{return H.call(t)}catch(t){}try{return t+""}catch(t){}}return""},J=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,W=K.toString,X=Q.hasOwnProperty,tt=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var et=function(t){return!(!q(t)||G(t))&&(V(t)?tt:J).test(Z(t))},rt=function(t,e){return null==t?void 0:t[e]};var nt=function(t,e){var r=rt(t,e);return et(r)?r:void 0},ot=nt(Object,"create"),at=ot;var it=function(){this.__data__=at?at(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ut=ot,st=Object.prototype.hasOwnProperty;var lt=function(t){var e=this.__data__;if(ut){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return st.call(e,t)?e[t]:void 0},ft=ot,dt=Object.prototype.hasOwnProperty;var pt=ot;var ht=it,vt=ct,yt=lt,gt=function(t){var e=this.__data__;return ft?void 0!==e[t]:dt.call(e,t)},mt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this};function bt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bt.prototype.clear=ht,bt.prototype.delete=vt,bt.prototype.get=yt,bt.prototype.has=gt,bt.prototype.set=mt;var _t=bt;var wt=function(){this.__data__=[],this.size=0};var jt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1},Ct=St,Nt=Array.prototype.splice;var Ot=St;var $t=St;var Tt=St;var At=wt,xt=function(t){var e=this.__data__,r=Ct(e,t);return!(r<0)&&(r==e.length-1?e.pop():Nt.call(e,r,1),--this.size,!0)},Mt=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Pt=function(t){return $t(this.__data__,t)>-1},zt=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function kt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}kt.prototype.clear=At,kt.prototype.delete=xt,kt.prototype.get=Mt,kt.prototype.has=Pt,kt.prototype.set=zt;var It=kt,Et=nt(v,"Map"),Ft=_t,Lt=It,Ut=Et;var Bt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Dt=function(t,e){var r=t.__data__;return Bt(e)?r["string"==typeof e?"string":"hash"]:r.map},Rt=Dt;var Yt=Dt;var Ht=Dt;var Vt=Dt;var Gt=function(){this.size=0,this.__data__={hash:new Ft,map:new(Ut||Lt),string:new Ft}},qt=function(t){var e=Rt(this,t).delete(t);return this.size-=e?1:0,e},Zt=function(t){return Yt(this,t).get(t)},Jt=function(t){return Ht(this,t).has(t)},Kt=function(t,e){var r=Vt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Qt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qt.prototype.clear=Gt,Qt.prototype.delete=qt,Qt.prototype.get=Zt,Qt.prototype.has=Jt,Qt.prototype.set=Kt;var Wt=Qt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Xt.Cache||Wt),r}Xt.Cache=Wt;var te=Xt;var ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/\\(\\)?/g,ne=function(t){var e=te(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ee,(function(t,r,n,o){e.push(n?o.replace(re,"$1"):r||t)})),e}));var oe=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},ae=d,ie=x,ce=y?y.prototype:void 0,ue=ce?ce.toString:void 0;var se=function t(e){if("string"==typeof e)return e;if(ae(e))return oe(e,t)+"";if(ie(e))return ue?ue.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},le=se;var fe=d,de=I,pe=ne,he=function(t){return null==t?"":le(t)};var ve=x;var ye=function(t,e){return fe(t)?t:de(t,e)?[t]:pe(he(t))},ge=function(t){if("string"==typeof t||ve(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var me=function(t,e){for(var r=0,n=(e=ye(e,t)).length;null!=t&&r<n;)t=t[ge(e[r++])];return r&&r==n?t:void 0};var be=f((function(t,e,r){var n=null==t?void 0:me(t,e);return void 0===n?r:n}));const _e={columnIndexCache:new Map,columnNameCache:new Map};function we(t){const e=t.toUpperCase();if(_e.columnIndexCache.has(e))return _e.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return _e.columnIndexCache.set(e,n),n}const je={getStr(t=[],e,r=""){const n=be(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=be(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=be(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},Se={getStr(t=[],e,r=""){const n=we(e),o=be(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=we(e),o=be(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=we(e);if(!Array.isArray(t))return r;const o=be(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Ce=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Ne=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Oe=t=>{const e=Ce(),r=Ne();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};return t.ColumnMapper=Se,t.IndexMapper=je,t.StyledLogger=class{static getStyle(t){switch(t){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(t,e="",...r){if(Ce())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"",info:"",warn:"",error:"",success:"",debug:""};console.log(`${n[t]}[${t.toUpperCase()}] ${e}`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=Oe,t.convertDigitalSize=(t,e,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{Oe("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return e;let r="";if("object"==typeof t){const e=t?.response?.data?.errors;if(Array.isArray(e))r=e.map((t=>t.message)).filter(Boolean).join("\n");else{const e=t?.response?.data;r="string"==typeof e?s(e):e?.error?.message||t.message||""}r||(r=t.message||"")}else r=s(String(t));return r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=we,t.getColumnName=function(t){if(_e.columnNameCache.has(t))return _e.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return _e.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=i.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{Oe("backend");const t=u.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=we(e);return be(t,`[${n}]`,r)},t.isBrowser=Ce,t.isNode=Ne,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{Oe("backend");const e=c.default.promisify(n.exec),{stdout:r,stderr:o}=await e(t);if(o)throw new Error(o);return r.trim()},t.saveFile=(t,e)=>{if(Oe("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{Oe("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=s,Object.defineProperty(t,"__esModule",{value:!0}),t}({},moment,util,child_process,os);
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("moment"),require("util"),require("child_process"),require("os")):"function"==typeof define&&define.amd?define(["exports","moment","util","child_process","os"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).apizum={},t.moment,t.util,t.child_process,t.os)}(this,(function(t,e,r,n,o){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=a(e),c=a(r),s=a(o);const u=t=>t.replace(/<[^>]*>/g,"").trim();var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d=Array.isArray,p="object"==typeof l&&l&&l.Object===Object&&l,h="object"==typeof self&&self&&self.Object===Object&&self,y=p||h||Function("return this")(),g=y.Symbol,v=g,m=Object.prototype,b=m.hasOwnProperty,_=m.toString,w=v?v.toStringTag:void 0;var j=function(t){var e=b.call(t,w),r=t[w];try{t[w]=void 0;var n=!0}catch(t){}var o=_.call(t);return n&&(e?t[w]=r:delete t[w]),o},S=Object.prototype.toString;var C=j,N=function(t){return S.call(t)},O=g?g.toStringTag:void 0;var $=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?C(t):N(t)};var T=$,x=function(t){return null!=t&&"object"==typeof t};var E=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==T(t)},M=d,P=E,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;var k=function(t,e){if(M(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!P(t))||(A.test(t)||!z.test(t)||null!=e&&t in Object(e))};var I=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},F=$,L=I;var U,B=function(t){if(!L(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=y["__core-js_shared__"],R=(U=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var q=function(t){return!!R&&R in t},Y=Function.prototype.toString;var H=B,V=q,G=I,Z=function(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""},J=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,W=K.toString,X=Q.hasOwnProperty,tt=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var et=function(t){return!(!G(t)||V(t))&&(H(t)?tt:J).test(Z(t))},rt=function(t,e){return null==t?void 0:t[e]};var nt=function(t,e){var r=rt(t,e);return et(r)?r:void 0},ot=nt(Object,"create"),at=ot;var it=function(){this.__data__=at?at(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},st=ot,ut=Object.prototype.hasOwnProperty;var lt=function(t){var e=this.__data__;if(st){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ut.call(e,t)?e[t]:void 0},ft=ot,dt=Object.prototype.hasOwnProperty;var pt=ot;var ht=it,yt=ct,gt=lt,vt=function(t){var e=this.__data__;return ft?void 0!==e[t]:dt.call(e,t)},mt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this};function bt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bt.prototype.clear=ht,bt.prototype.delete=yt,bt.prototype.get=gt,bt.prototype.has=vt,bt.prototype.set=mt;var _t=bt;var wt=function(){this.__data__=[],this.size=0};var jt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1},Ct=St,Nt=Array.prototype.splice;var Ot=St;var $t=St;var Tt=St;var xt=wt,Et=function(t){var e=this.__data__,r=Ct(e,t);return!(r<0)&&(r==e.length-1?e.pop():Nt.call(e,r,1),--this.size,!0)},Mt=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Pt=function(t){return $t(this.__data__,t)>-1},zt=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function At(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}At.prototype.clear=xt,At.prototype.delete=Et,At.prototype.get=Mt,At.prototype.has=Pt,At.prototype.set=zt;var kt=At,It=nt(y,"Map"),Ft=_t,Lt=kt,Ut=It;var Bt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Dt=function(t,e){var r=t.__data__;return Bt(e)?r["string"==typeof e?"string":"hash"]:r.map},Rt=Dt;var qt=Dt;var Yt=Dt;var Ht=Dt;var Vt=function(){this.size=0,this.__data__={hash:new Ft,map:new(Ut||Lt),string:new Ft}},Gt=function(t){var e=Rt(this,t).delete(t);return this.size-=e?1:0,e},Zt=function(t){return qt(this,t).get(t)},Jt=function(t){return Yt(this,t).has(t)},Kt=function(t,e){var r=Ht(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Qt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qt.prototype.clear=Vt,Qt.prototype.delete=Gt,Qt.prototype.get=Zt,Qt.prototype.has=Jt,Qt.prototype.set=Kt;var Wt=Qt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Xt.Cache||Wt),r}Xt.Cache=Wt;var te=Xt;var ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/\\(\\)?/g,ne=function(t){var e=te(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ee,(function(t,r,n,o){e.push(n?o.replace(re,"$1"):r||t)})),e}));var oe=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},ae=d,ie=E,ce=g?g.prototype:void 0,se=ce?ce.toString:void 0;var ue=function t(e){if("string"==typeof e)return e;if(ae(e))return oe(e,t)+"";if(ie(e))return se?se.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},le=ue;var fe=d,de=k,pe=ne,he=function(t){return null==t?"":le(t)};var ye=E;var ge=function(t,e){return fe(t)?t:de(t,e)?[t]:pe(he(t))},ve=function(t){if("string"==typeof t||ye(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var me=function(t,e){for(var r=0,n=(e=ge(e,t)).length;null!=t&&r<n;)t=t[ve(e[r++])];return r&&r==n?t:void 0};var be=f((function(t,e,r){var n=null==t?void 0:me(t,e);return void 0===n?r:n}));const _e={columnIndexCache:new Map,columnNameCache:new Map};function we(t){const e=t.toUpperCase();if(_e.columnIndexCache.has(e))return _e.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return _e.columnIndexCache.set(e,n),n}const je={getStr(t=[],e,r=""){const n=be(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=be(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=be(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},Se={getStr(t=[],e,r=""){const n=we(e),o=be(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=we(e),o=be(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=we(e);if(!Array.isArray(t))return r;const o=be(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Ce=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Ne=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Oe=t=>{const e=Ce(),r=Ne();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};t.ColumnMapper=Se,t.IndexMapper=je,t.StyledLogger=class{static getStyle(t){switch(t){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(t,e="",...r){if(Ce())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"",info:"",warn:"",error:"",success:"",debug:""};console.log(`${n[t]}[${t.toUpperCase()}] ${e}`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=Oe,t.convertDigitalSize=(t,e,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{Oe("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return"";console.log(t);let r="";const n=t instanceof Error&&"object"==typeof t;if(n&&be(t,"response.data")&&"object"==typeof t){const n=be(t,"response.data.errors");if(n)(n||[]).forEach((t=>{t.message&&(r+=t.message+"\n")}));else{const e=be(t,"response.data"),n="string"==typeof e?u(e):be(t,"response.data.error.message")||t.message||"";r+=n?n+"\n":""}return r.trim()||e}if(n){const n=t.message||"";return r+=n?n+"\n":"",r.trim()||e}return"object"==typeof t?t.errors&&t.errors.forEach((t=>{t.message&&(r+=t.message+"\n")})):r+=u(String(t))+"\n",r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=we,t.getColumnName=function(t){if(_e.columnNameCache.has(t))return _e.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return _e.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=i.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{Oe("backend");const t=s.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=we(e);return be(t,`[${n}]`,r)},t.isBrowser=Ce,t.isNode=Ne,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{Oe("backend");const e=c.default.promisify(n.exec),{stdout:r,stderr:o}=await e(t);if(o)throw new Error(o);return r.trim()},t.saveFile=(t,e)=>{if(Oe("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{Oe("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=u,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("moment"),require("util"),require("child_process"),require("os")):"function"==typeof define&&define.amd?define(["exports","moment","util","child_process","os"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).apizum={},t.moment,t.util,t.child_process,t.os)}(this,(function(t,e,r,n,o){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=a(e),c=a(r),s=a(o);const u=t=>t.replace(/<[^>]*>/g,"").trim();var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d=Array.isArray,p="object"==typeof l&&l&&l.Object===Object&&l,h="object"==typeof self&&self&&self.Object===Object&&self,y=p||h||Function("return this")(),v=y.Symbol,g=v,m=Object.prototype,b=m.hasOwnProperty,_=m.toString,w=g?g.toStringTag:void 0;var j=function(t){var e=b.call(t,w),r=t[w];try{t[w]=void 0;var n=!0}catch(t){}var o=_.call(t);return n&&(e?t[w]=r:delete t[w]),o},S=Object.prototype.toString;var C=j,N=function(t){return S.call(t)},O=v?v.toStringTag:void 0;var $=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?C(t):N(t)};var T=$,x=function(t){return null!=t&&"object"==typeof t};var A=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==T(t)},M=d,P=A,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/;var I=function(t,e){if(M(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!P(t))||(k.test(t)||!z.test(t)||null!=e&&t in Object(e))};var E=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},F=$,L=E;var U,B=function(t){if(!L(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=y["__core-js_shared__"],R=(U=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var q=function(t){return!!R&&R in t},Y=Function.prototype.toString;var H=B,V=q,G=E,Z=function(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""},J=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,W=K.toString,X=Q.hasOwnProperty,tt=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var et=function(t){return!(!G(t)||V(t))&&(H(t)?tt:J).test(Z(t))},rt=function(t,e){return null==t?void 0:t[e]};var nt=function(t,e){var r=rt(t,e);return et(r)?r:void 0},ot=nt(Object,"create"),at=ot;var it=function(){this.__data__=at?at(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},st=ot,ut=Object.prototype.hasOwnProperty;var lt=function(t){var e=this.__data__;if(st){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ut.call(e,t)?e[t]:void 0},ft=ot,dt=Object.prototype.hasOwnProperty;var pt=ot;var ht=it,yt=ct,vt=lt,gt=function(t){var e=this.__data__;return ft?void 0!==e[t]:dt.call(e,t)},mt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this};function bt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bt.prototype.clear=ht,bt.prototype.delete=yt,bt.prototype.get=vt,bt.prototype.has=gt,bt.prototype.set=mt;var _t=bt;var wt=function(){this.__data__=[],this.size=0};var jt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1},Ct=St,Nt=Array.prototype.splice;var Ot=St;var $t=St;var Tt=St;var xt=wt,At=function(t){var e=this.__data__,r=Ct(e,t);return!(r<0)&&(r==e.length-1?e.pop():Nt.call(e,r,1),--this.size,!0)},Mt=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Pt=function(t){return $t(this.__data__,t)>-1},zt=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function kt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}kt.prototype.clear=xt,kt.prototype.delete=At,kt.prototype.get=Mt,kt.prototype.has=Pt,kt.prototype.set=zt;var It=kt,Et=nt(y,"Map"),Ft=_t,Lt=It,Ut=Et;var Bt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Dt=function(t,e){var r=t.__data__;return Bt(e)?r["string"==typeof e?"string":"hash"]:r.map},Rt=Dt;var qt=Dt;var Yt=Dt;var Ht=Dt;var Vt=function(){this.size=0,this.__data__={hash:new Ft,map:new(Ut||Lt),string:new Ft}},Gt=function(t){var e=Rt(this,t).delete(t);return this.size-=e?1:0,e},Zt=function(t){return qt(this,t).get(t)},Jt=function(t){return Yt(this,t).has(t)},Kt=function(t,e){var r=Ht(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Qt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qt.prototype.clear=Vt,Qt.prototype.delete=Gt,Qt.prototype.get=Zt,Qt.prototype.has=Jt,Qt.prototype.set=Kt;var Wt=Qt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Xt.Cache||Wt),r}Xt.Cache=Wt;var te=Xt;var ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/\\(\\)?/g,ne=function(t){var e=te(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ee,(function(t,r,n,o){e.push(n?o.replace(re,"$1"):r||t)})),e}));var oe=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},ae=d,ie=A,ce=v?v.prototype:void 0,se=ce?ce.toString:void 0;var ue=function t(e){if("string"==typeof e)return e;if(ae(e))return oe(e,t)+"";if(ie(e))return se?se.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},le=ue;var fe=d,de=I,pe=ne,he=function(t){return null==t?"":le(t)};var ye=A;var ve=function(t,e){return fe(t)?t:de(t,e)?[t]:pe(he(t))},ge=function(t){if("string"==typeof t||ye(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var me=function(t,e){for(var r=0,n=(e=ve(e,t)).length;null!=t&&r<n;)t=t[ge(e[r++])];return r&&r==n?t:void 0};var be=f((function(t,e,r){var n=null==t?void 0:me(t,e);return void 0===n?r:n}));const _e={columnIndexCache:new Map,columnNameCache:new Map};function we(t){const e=t.toUpperCase();if(_e.columnIndexCache.has(e))return _e.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return _e.columnIndexCache.set(e,n),n}const je={getStr(t=[],e,r=""){const n=be(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=be(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=be(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},Se={getStr(t=[],e,r=""){const n=we(e),o=be(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=we(e),o=be(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=we(e);if(!Array.isArray(t))return r;const o=be(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Ce=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Ne=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Oe=t=>{const e=Ce(),r=Ne();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};t.ColumnMapper=Se,t.IndexMapper=je,t.StyledLogger=class{static getStyle(t){switch(t){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(t,e="",...r){if(Ce())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"",info:"",warn:"",error:"",success:"",debug:""};console.log(`${n[t]}[${t.toUpperCase()}] ${e}`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=Oe,t.convertDigitalSize=(t,e,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{Oe("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return e;let r="";if("object"==typeof t){const e=t?.response?.data?.errors;if(Array.isArray(e))r=e.map((t=>t.message)).filter(Boolean).join("\n");else{const e=t?.response?.data;r="string"==typeof e?u(e):e?.error?.message||t.message||""}r||(r=t.message||"")}else r=u(String(t));return r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=we,t.getColumnName=function(t){if(_e.columnNameCache.has(t))return _e.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return _e.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=i.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{Oe("backend");const t=s.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=we(e);return be(t,`[${n}]`,r)},t.isBrowser=Ce,t.isNode=Ne,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{Oe("backend");const e=c.default.promisify(n.exec),{stdout:r,stderr:o}=await e(t);if(o)throw new Error(o);return r.trim()},t.saveFile=(t,e)=>{if(Oe("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{Oe("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=u,Object.defineProperty(t,"__esModule",{value:!0})}));
@@ -1 +1 @@
1
- {"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,MA2C/F,CAAC"}
1
+ {"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,MA6B/F,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lodash/get"),r=require("./tools.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=t(e);exports.extractErrorMessage=(e,t="Noma'lum xatolik")=>{if(!e)return"";console.log(e);let o="";const a=e instanceof Error&&"object"==typeof e;if(a&&s.default(e,"response.data")&&"object"==typeof e){const a=s.default(e,"response.data.errors");if(a)(a||[]).forEach((e=>{e.message&&(o+=e.message+"\n")}));else{const t=s.default(e,"response.data"),a="string"==typeof t?r.stripHtmlTags(t):s.default(e,"response.data.error.message")||e.message||"";o+=a?a+"\n":""}return o.trim()||t}if(a){const r=e.message||"";return o+=r?r+"\n":"",o.trim()||t}return"object"==typeof e?e.errors&&e.errors.forEach((e=>{e.message&&(o+=e.message+"\n")})):o+=r.stripHtmlTags(String(e))+"\n",o.trim()||t};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tools.js");exports.extractErrorMessage=(r,s="Noma'lum xatolik")=>{if(!r)return s;let t="";if("object"==typeof r){const s=r?.response?.data?.errors;if(Array.isArray(s))t=s.map((e=>e.message)).filter(Boolean).join("\n");else{const s=r?.response?.data;t="string"==typeof s?e.stripHtmlTags(s):s?.error?.message||r.message||""}t||(t=r.message||"")}else t=e.stripHtmlTags(String(r));return t.trim()||s};
@@ -1 +1 @@
1
- {"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,MA2C/F,CAAC"}
1
+ {"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,MA6B/F,CAAC"}
@@ -1 +1 @@
1
- import e from"lodash/get";import{stripHtmlTags as r}from"./tools.js";const o=(o,s="Noma'lum xatolik")=>{if(!o)return"";console.log(o);let t="";const n=o instanceof Error&&"object"==typeof o;if(n&&e(o,"response.data")&&"object"==typeof o){const n=e(o,"response.data.errors");if(n)(n||[]).forEach((e=>{e.message&&(t+=e.message+"\n")}));else{const s=e(o,"response.data"),n="string"==typeof s?r(s):e(o,"response.data.error.message")||o.message||"";t+=n?n+"\n":""}return t.trim()||s}if(n){const e=o.message||"";return t+=e?e+"\n":"",t.trim()||s}return"object"==typeof o?o.errors&&o.errors.forEach((e=>{e.message&&(t+=e.message+"\n")})):t+=r(String(o))+"\n",t.trim()||s};export{o as extractErrorMessage};
1
+ import{stripHtmlTags as e}from"./tools.js";const r=(r,s="Noma'lum xatolik")=>{if(!r)return s;let o="";if("object"==typeof r){const s=r?.response?.data?.errors;if(Array.isArray(s))o=s.map((e=>e.message)).filter(Boolean).join("\n");else{const s=r?.response?.data;o="string"==typeof s?e(s):s?.error?.message||r.message||""}o||(o=r.message||"")}else o=e(String(r));return o.trim()||s};export{r as extractErrorMessage};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilzify",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "outputDir": "./lib",
5
5
  "exports": {
6
6
  "import": {