utilzify 1.13.0 → 1.13.1
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.
- package/lib/browser/bundle.iife.js +1 -1
- package/lib/browser/bundle.umd.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/utils/index.d.ts +0 -3
- package/lib/cjs/utils/index.d.ts.map +1 -1
- package/lib/cjs/utils/index.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/utils/index.d.ts +0 -3
- package/lib/esm/utils/index.d.ts.map +1 -1
- package/lib/esm/utils/index.js +1 -1
- package/package.json +1 -1
- package/lib/cjs/utils/clipboard.d.ts +0 -2
- package/lib/cjs/utils/clipboard.d.ts.map +0 -1
- package/lib/cjs/utils/clipboard.js +0 -1
- package/lib/cjs/utils/get-local-ip.d.ts +0 -2
- package/lib/cjs/utils/get-local-ip.d.ts.map +0 -1
- package/lib/cjs/utils/get-local-ip.js +0 -1
- package/lib/cjs/utils/run-command.d.ts +0 -1
- package/lib/cjs/utils/run-command.d.ts.map +0 -1
- package/lib/cjs/utils/run-command.js +0 -1
- package/lib/cjs/utils/styled-logger.d.ts +0 -12
- package/lib/cjs/utils/styled-logger.d.ts.map +0 -1
- package/lib/cjs/utils/styled-logger.js +0 -1
- package/lib/esm/utils/clipboard.d.ts +0 -2
- package/lib/esm/utils/clipboard.d.ts.map +0 -1
- package/lib/esm/utils/clipboard.js +0 -1
- package/lib/esm/utils/get-local-ip.d.ts +0 -2
- package/lib/esm/utils/get-local-ip.d.ts.map +0 -1
- package/lib/esm/utils/get-local-ip.js +0 -1
- package/lib/esm/utils/run-command.d.ts +0 -1
- package/lib/esm/utils/run-command.d.ts.map +0 -1
- package/lib/esm/utils/run-command.js +0 -1
- package/lib/esm/utils/styled-logger.d.ts +0 -12
- package/lib/esm/utils/styled-logger.d.ts.map +0 -1
- package/lib/esm/utils/styled-logger.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var utilzify=function(e,t,r,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(t),s=o(n);const i=()=>"undefined"!=typeof window&&"undefined"!=typeof document,c=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),l=e=>{const t=i(),r=c();if("frontend"===e&&!t)throw new Error("This function can only be used in a frontend environment.");if("backend"===e&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===e?t:r},u=[{name:"Chrome",tokens:["Chrome","Safari"],prefix:"Mozilla/5.0"},{name:"Firefox",tokens:["Gecko"],prefix:"Mozilla/5.0"},{name:"Opera",tokens:["Presto"],prefix:"Opera/9.80"},{name:"Edge",tokens:["Edg"],prefix:"Mozilla/5.0"},{name:"Safari",tokens:["Version","Safari"],prefix:"Mozilla/5.0"},{name:"IE",tokens:["MSIE","Trident"],prefix:"Mozilla/4.0"}],f=["Windows NT 10.0","Windows NT 6.1","Windows 3.1","Macintosh; Intel Mac OS X 10_15_7","X11; Linux x86_64","X11; Ubuntu; Linux i686","Android 12; Mobile","Android 11; Tablet","iPhone; CPU iPhone OS 16_6 like Mac OS X","iPad; CPU OS 15_4 like Mac OS X"],d=["en","ru","de","fr","es","it","pl","ko","ja","tr"],p=["Trident","Gecko","Presto","Blink"],h=["WOW64","Win64; x64",".NET CLR 3.5.30729","SLCC2","InfoPath.3","Media Center PC 6.0","Tablet PC 2.0"],m=["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","application/json, text/plain, */*"],g=["google.com","bing.com","yandex.ru","duckduckgo.com","example.com","wikipedia.org"],y=e=>e[Math.floor(Math.random()*e.length)],b=()=>`${y([13,14,15,16,17,18,19,20])}.${Math.floor(256*Math.random())}.${Math.floor(256*Math.random())}.${Math.floor(1+254*Math.random())}`,v=(e=15)=>`${Math.floor(Math.random()*e)+1}.${Math.floor(10*Math.random())}`,w=e=>{const t=[];for(let r=0;r<e;r++){const e=y(u),r=y(f),n=y(d),o=y(p),a=v(),s=y(e.tokens),i=Math.random()>.5?`; ${y(h)}`:"",c="IE"===e.name?`${e.prefix} (compatible; ${s} ${a}; ${r}${i}; ${n})`:`${e.prefix} (${r}${i}; ${n}) ${s}/${a} ${o}/${v(5)}`;t.push(c)}return Array.from(new Set(t))},_=(e={},t=[])=>{const r=new Set(["host","connection","content-length","sec-ch-ua-platform","sec-ch-ua","sec-ch-ua-mobile","user-agent","origin","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","referer","cookie","accept-encoding","if-none-match",...t.map((e=>e.toLowerCase()))]);for(const t of Object.keys(e)){const n=t.toLowerCase(),o=n.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("-");(r.has(n)||r.has(o.toLowerCase()))&&delete e[t]}return e},x=w(200),$=()=>{const e={},t=!i();return e.Accept||(e.Accept=y(m)),e.Connection||(e.Connection="keep-alive"),e["User-Agent"]||e["user-agent"]||!t||(e["User-Agent"]=y(x)),!e.Referer&&t&&(e.Referer=(()=>{const e=y(g),t=y(["","search","images","news","video","docs"]),r=Math.random()>.5?`?q=test${Math.floor(1e3*Math.random())}`:"";return`${Math.random()>.5?"https":"http"}://www.${e}/${t}${r}`})()),!e["X-Forwarded-For"]&&t&&(e["X-Forwarded-For"]=b()),!e["Cache-Control"]&&t&&(e["Cache-Control"]="max-age=0"),e};var S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j=Array.isArray,E="object"==typeof S&&S&&S.Object===Object&&S,M="object"==typeof self&&self&&self.Object===Object&&self,C=E||M||Function("return this")(),T=C.Symbol,O=T,N=Object.prototype,k=N.hasOwnProperty,F=N.toString,P=O?O.toStringTag:void 0;var D=function(e){var t=k.call(e,P),r=e[P];try{e[P]=void 0;var n=!0}catch(e){}var o=F.call(e);return n&&(t?e[P]=r:delete e[P]),o},R=Object.prototype.toString;var I=D,U=function(e){return R.call(e)},z=T?T.toStringTag:void 0;var L=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":z&&z in Object(e)?I(e):U(e)};var B=L,W=function(e){return null!=e&&"object"==typeof e};var V=function(e){return"symbol"==typeof e||W(e)&&"[object Symbol]"==B(e)},H=j,X=V,q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/;var J=function(e,t){if(H(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!X(e))||(G.test(e)||!q.test(e)||null!=t&&e in Object(t))};var Y=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},K=L,Z=Y;var Q,ee=function(e){if(!Z(e))return!1;var t=K(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},te=C["__core-js_shared__"],re=(Q=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||""))?"Symbol(src)_1."+Q:"";var ne=function(e){return!!re&&re in e},oe=Function.prototype.toString;var ae=ee,se=ne,ie=Y,ce=function(e){if(null!=e){try{return oe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},le=/^\[object .+?Constructor\]$/,ue=Function.prototype,fe=Object.prototype,de=ue.toString,pe=fe.hasOwnProperty,he=RegExp("^"+de.call(pe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var me=function(e){return!(!ie(e)||se(e))&&(ae(e)?he:le).test(ce(e))},ge=function(e,t){return null==e?void 0:e[t]};var ye=function(e,t){var r=ge(e,t);return me(r)?r:void 0},be=ye(Object,"create"),ve=be;var we=function(){this.__data__=ve?ve(null):{},this.size=0};var _e=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xe=be,$e=Object.prototype.hasOwnProperty;var Se=function(e){var t=this.__data__;if(xe){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return $e.call(t,e)?t[e]:void 0},Ae=be,je=Object.prototype.hasOwnProperty;var Ee=be;var Me=we,Ce=_e,Te=Se,Oe=function(e){var t=this.__data__;return Ae?void 0!==t[e]:je.call(t,e)},Ne=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ee&&void 0===t?"__lodash_hash_undefined__":t,this};function ke(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ke.prototype.clear=Me,ke.prototype.delete=Ce,ke.prototype.get=Te,ke.prototype.has=Oe,ke.prototype.set=Ne;var Fe=ke;var Pe=function(){this.__data__=[],this.size=0};var De=function(e,t){return e===t||e!=e&&t!=t};var Re=function(e,t){for(var r=e.length;r--;)if(De(e[r][0],t))return r;return-1},Ie=Re,Ue=Array.prototype.splice;var ze=Re;var Le=Re;var Be=Re;var We=Pe,Ve=function(e){var t=this.__data__,r=Ie(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ue.call(t,r,1),--this.size,!0)},He=function(e){var t=this.__data__,r=ze(t,e);return r<0?void 0:t[r][1]},Xe=function(e){return Le(this.__data__,e)>-1},qe=function(e,t){var r=this.__data__,n=Be(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ge(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ge.prototype.clear=We,Ge.prototype.delete=Ve,Ge.prototype.get=He,Ge.prototype.has=Xe,Ge.prototype.set=qe;var Je=Ge,Ye=ye(C,"Map"),Ke=Fe,Ze=Je,Qe=Ye;var et=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var tt=function(e,t){var r=e.__data__;return et(t)?r["string"==typeof t?"string":"hash"]:r.map},rt=tt;var nt=tt;var ot=tt;var at=tt;var st=function(){this.size=0,this.__data__={hash:new Ke,map:new(Qe||Ze),string:new Ke}},it=function(e){var t=rt(this,e).delete(e);return this.size-=t?1:0,t},ct=function(e){return nt(this,e).get(e)},lt=function(e){return ot(this,e).has(e)},ut=function(e,t){var r=at(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function ft(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ft.prototype.clear=st,ft.prototype.delete=it,ft.prototype.get=ct,ft.prototype.has=lt,ft.prototype.set=ut;var dt=ft;function pt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=e.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(pt.Cache||dt),r}pt.Cache=dt;var ht=pt;var mt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gt=/\\(\\)?/g,yt=function(e){var t=ht(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(mt,(function(e,r,n,o){t.push(n?o.replace(gt,"$1"):r||e)})),t}));var bt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},vt=j,wt=V,_t=T?T.prototype:void 0,xt=_t?_t.toString:void 0;var $t=function e(t){if("string"==typeof t)return t;if(vt(t))return bt(t,e)+"";if(wt(t))return xt?xt.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},St=$t;var At=j,jt=J,Et=yt,Mt=function(e){return null==e?"":St(e)};var Ct=V;var Tt=function(e,t){return At(e)?e:jt(e,t)?[e]:Et(Mt(e))},Ot=function(e){if("string"==typeof e||Ct(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var Nt=function(e,t){for(var r=0,n=(t=Tt(t,e)).length;null!=e&&r<n;)e=e[Ot(t[r++])];return r&&r==n?e:void 0};var kt=A((function(e,t,r){var n=null==e?void 0:Nt(e,t);return void 0===n?r:n}));const Ft=e=>/^(\d{1,3}(,\d{2})*(\.\d+)?)$/.test(e)||/^(\d{1,3}(,\d{3})*(\.\d+)?)$/.test(e),Pt=e=>parseFloat(e.replace(/,/g,"")),Dt=e=>parseFloat(e.replace(/\./g,"").replace(",",".")),Rt=(e,t=0)=>null==e?t:"number"==typeof e?e:e&&"string"==typeof e&&/[\d,.]/.test(e)?(e=e.replace(/\s/g,"").trim(),Ft(e)?Pt(e):e.includes(",")?Dt(e):e.includes(".")||!e.includes(",")?parseFloat(e.replace(/,/g,"")):t):t,It=(e=Date.now(),t="DD/MM/YYYY HH:mm:ss")=>{const r=a.default(e);return r.isValid()?r.format(t):""},Ut=e=>e.replace(/<[^>]*>/g,"").trim(),zt={columnIndexCache:new Map,columnNameCache:new Map};function Lt(e){const t=e.toUpperCase();if(zt.columnIndexCache.has(t))return zt.columnIndexCache.get(t);let r=0;for(let e=0;e<t.length;e++)r=26*r+(t.charCodeAt(e)-65+1);const n=r-1;return zt.columnIndexCache.set(t,n),n}function Bt(e){if(zt.columnNameCache.has(e))return zt.columnNameCache.get(e);let t="";for(;e>=0;){const r=e%26;t=String.fromCharCode(65+r)+t,e=Math.floor(e/26)-1}return zt.columnNameCache.set(e,t),t}const Wt={getStr(e=[],t,r=""){const n=kt(e,`[${t}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(e=[],t,r=0){const n=String(kt(e,`[${t}]`,"")).replace(/\s/g,"");if(!n)return r;const o=Number(n);return isNaN(o)?r:o},getBool(e=[],t,r=!1){if(!Array.isArray(e))return r;const n=kt(e,`[${t}]`,r);return["TRUE","FALSE"].includes(n)?"TRUE"===n:"boolean"==typeof n?n:r},getPrice(e=[],t){const r=this.getStr(e,t);if(!r)return 0;const n=Rt(r);return isNaN(n)?0:n},getDate(e=[],t,r){const n=this.getStr(e,t);if(!n)return null;return a.default(n,r).toDate()},getDateFormatted(e=[],t,r,n){const o=this.getStr(e,t);if(!o)return null;const s=a.default(o,n);return r?It(s.toDate(),r):It(s.toDate())}},Vt={getStr(e=[],t,r=""){const n=Lt(t),o=kt(e,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(e=[],t,r=0){const n=Lt(t),o=String(kt(e,`[${n}]`,"")).replace(/\s/g,"");if(!o)return r;const a=Number(o);return isNaN(a)?r:a},getBool(e=[],t,r=!1){const n=Lt(t);if(!Array.isArray(e))return r;const o=kt(e,`[${n}]`,r);return["TRUE","FALSE"].includes(o)?"TRUE"===o:"boolean"==typeof o?o:r},getPrice(e=[],t){const r=this.getStr(e,t);if(!r)return 0;const n=Rt(r);return isNaN(n)?0:n},getDate(e=[],t,r){const n=this.getStr(e,t);if(!n)return null;return a.default(n,r).toDate()},getDateFormatted(e=[],t,r,n){const o=this.getStr(e,t);if(!o)return null;const s=a.default(o,n);return r?It(s.toDate(),r):It(s.toDate())}},Ht=(e,t)=>{const r={},n=Object.entries(t);for(let t=0;t<e.length;t++){const o=e[t];for(const[e,a]of n){if(void 0!==r[e])continue;o===(Array.isArray(a)?a[0]:a)&&(r[e]=Bt(t))}}return n.forEach((([e,t])=>{const n=Array.isArray(t)?t[1]:null,o=r[e];n&&void 0===o&&(r[e]=n)})),r},Xt={getStr(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Lt(t),s=r.get(e,`[${a}]`,o);return"number"==typeof s?String(s):s?String(s).trim():o},getNum(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Lt(t),s=String(r.get(e,`[${a}]`)).replace(/\s/g,"");if(!s)return o;const i=Number(s);return isNaN(i)?o:i},getBool(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Lt(t),s=r.get(e,`[${a}]`);return s?["TRUE","FALSE"].includes(String(s).trim().toUpperCase())?"TRUE"===s:Boolean(s):o},getPrice(e,t,r){const n=r??null;if(!Array.isArray(e))return n;const o=this.getStr(e,t);if(!o)return n;const a=Rt(o);return isNaN(a)?n:a},getDate(e,t,r,n){const o=n??null;if(!Array.isArray(e))return o;const s=this.getStr(e,t);if(!s)return o;const i=a.default(s,r);return i.isValid()?i.toDate():o},getDateFormatted(e,t,r,n,o){const s=o??null;if(!Array.isArray(e))return s;const i=this.getStr(e,t);if(!i)return s;const c=a.default(i,r);return c.isValid()?It(c.toDate(),n):s}},qt=(e,t,r)=>{switch(e._t){case"str":return Xt.getStr(r,t,e.def);case"num":return Xt.getNum(r,t,e.def);case"bool":return Xt.getBool(r,t,e.def);case"price":return Xt.getPrice(r,t,e.def);case"date":return Xt.getDate(r,t,e.fmt);case"datefmt":return Xt.getDateFormatted(r,t,e.parseFmt,e.returnFmt)}};var Gt=Object.freeze({__proto__:null,col:{str:(e,t)=>({_t:"str",col:e,def:t}),num:(e,t)=>({_t:"num",col:e,def:t}),bool:(e,t)=>({_t:"bool",col:e,def:t}),price:(e,t)=>({_t:"price",col:e,def:t}),date:(e,t)=>({_t:"date",col:e,fmt:t}),datefmt:(e,t,r)=>({_t:"datefmt",col:e,parseFmt:t,returnFmt:r}),fn:e=>({_t:"fn",fn:e})},hdr:{str:(e,t)=>({_t:"str",header:e,def:t}),num:(e,t)=>({_t:"num",header:e,def:t}),bool:(e,t)=>({_t:"bool",header:e,def:t}),price:(e,t)=>({_t:"price",header:e,def:t}),date:(e,t)=>({_t:"date",header:e,fmt:t}),datefmt:(e,t,r)=>({_t:"datefmt",header:e,parseFmt:t,returnFmt:r}),fn:e=>({_t:"fn",fn:e})},createColMapper:e=>t=>{const r={};for(const n in e){const o=e[n];r[n]="fn"===o._t?o.fn(t):qt(o,o.col,t)}return r},createHdrMapper:e=>{const t={};for(const r in e){const n=e[r];"fn"!==n._t&&(t[r]=n.header)}return r=>{const n=Ht(r,t);return t=>{const r={};for(const o in e){const a=e[o];"fn"===a._t?r[o]=a.fn(t):r[o]=qt(a,n[o]??"",t)}return r}}}});const Jt=(e,t)=>{const r=Math.floor(e/1e3),n=Math.floor(r/60),o=Math.floor(n/60),a=r%60;switch(t){case"ms":return`${e} millisoniya`;case"s":return`${(e/1e3).toFixed(2)} soniya`;case"min":return`${(e/6e4).toFixed(2)} daqiqa`;default:return`${o>0?`${o} soat `:""}${n%60>0?n%60+" daqiqa ":""}${(a>0?`${a} soniya`:"")||"0 soniya"}`.trim()}},Yt=(e,t)=>{const r=t.split(".");let n=e;for(const e of r){if(!n&&"number"!=typeof n)return null;n=n[e]}return n},Kt=(e,t)=>{if(l("frontend"),window.navigator){const r=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=r,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}};const Zt=["err.cause.message","cause.message","cause.stack","detailMessage","error_description","error.message","description","msg","message","error","errors","errorDetails","errorMessage","error_type","errorMsg","errorMessages","error_info","error_info.message","error_info.error_message","error_info.details","data.message","response.message","response.error_message","response.details","httpError","validationError","status_description","messages","alert_message","alert","userMessage","user_error","client_error","response.data.error","response.data.message","response.data.error_description","response.data.details","errorMessages[*].message","errors[*].msg","errors[*].message","[*].msg","[*].message"],Qt=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}return e},er=(e,t,r=0,n=5)=>{if(r>n||"object"!=typeof e||null===e)return null;for(const o of t){const a=o.split(".");let s=e;for(const e of a){if(null==s)break;if("[*]"===e){if(Array.isArray(s)){for(const t of s){const o=er(t,[a.slice(a.indexOf(e)+1).join(".")],r+1,n);if(o)return o}s=null;break}s=null;break}if(e.endsWith("]")){const t=e.match(/(\w+)\[(\d+)\]/);if(t){const[,e,r]=t;s=s?.[e]?.[Number(r)]}else s=s?.[e]}else s=s?.[e]}if(s=Qt(s),Array.isArray(s)){const e=s.map((e=>"string"==typeof e?e:e?.message||e?.msg||"")).filter(Boolean).join("\n");if(e)return e}if("string"==typeof s)return Ut(s);if("object"==typeof s&&null!==s){const e=er(s,t,r+1,n);if(e)return e}}return null},tr=(e,t,r=0,n=5)=>{if(r>n||"object"!=typeof e||null===e)return[];const o=[];for(const a of t){const s=a.split(".");let i=e;for(let e=0;e<s.length;e++){const t=s[e];if(null==i)break;if("[*]"===t){if(Array.isArray(i)){const t=s.slice(e+1).join(".");for(const e of i)o.push(...tr(e,[t],r+1,n))}i=null;break}if(t.endsWith("]")){const e=t.match(/(\w+)\[(\d+)\]/);if(e){const[,t,r]=e;i=i?.[t]?.[Number(r)]}else i=i?.[t]}else i=i?.[t]}if(i=Qt(i),"string"==typeof i)o.push(Ut(i));else if(Array.isArray(i)){for(const e of i)if("string"==typeof e)o.push(Ut(e));else if("object"==typeof e){const a=e?.message||e?.msg;"string"==typeof a?o.push(Ut(a)):o.push(...tr(e,t,r+1,n))}}else"object"==typeof i&&o.push(...tr(i,t,r+1,n))}return o},rr=(e,t="",r=[])=>{const n=[...r,...Zt];if(!e)return t;if("string"==typeof e){const r=Qt(e);return"object"==typeof r?er(r,n)||t:Ut(e)}const o=Qt(e?.response?.data||e?.data||e),a=er(o,n)||e?.message;return Ut(a||"").trim()||t},nr={PDF:"pdf",PNG:"image/png",JPEG:"image/jpeg",EXCEL:"excel",WORD:"word",TEXT:"text"},or={[nr.PDF]:{mimeType:"application/pdf",extension:"pdf"},[nr.PNG]:{mimeType:"image/png",extension:"png"},[nr.JPEG]:{mimeType:"image/jpeg",extension:"jpg"},[nr.EXCEL]:{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extension:"xlsx"},[nr.WORD]:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extension:"docx"},[nr.TEXT]:{mimeType:"text/plain",extension:"txt"}};return e.ColumnMapper=Vt,e.ColumnParser=Xt,e.Excel=class{constructor(){l("frontend")}async readFromArrayBuffer(e,t){try{let r;r=e instanceof Buffer?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):await e.arrayBuffer();const n=new s.default.Workbook;await n.xlsx.load(r);const o=n.getWorksheet(t),a=[];return o?(o.eachRow({includeEmpty:!0},(e=>{const t=[];e.eachCell({includeEmpty:!0},(e=>{t.push(void 0!==e.value?e.value:null)})),a.push(t)})),a):[]}catch(e){return[]}}async read(e,t=1){try{const r=new s.default.Workbook;await r.xlsx.readFile(e);const n=r.getWorksheet(t);if(!n)throw new Error(`Excelda ${t}-raqamli jadval topilmadi. Iltimos, faylda ushbu jadval mavjudligini tekshiring.`);const o=[];return n.eachRow({includeEmpty:!0},(e=>{const t=[];e.eachCell({includeEmpty:!0},(e=>{t.push(void 0!==e.value?e.value:null)})),o.push(t)})),o}catch(e){return this.handleError(e,this.read),[]}}async write(e,t,r,n="file",o="Sheet1",a=""){try{const i=new s.default.Workbook,c=i.addWorksheet(o);c.addRow(t),e.forEach((e=>{const t=r.map((t=>{const r=Yt(e,t);return!(null==r||"null"===r||"undefined"===r||"NaN"===r||"number"==typeof r&&isNaN(r))?r:a}));c.addRow(t)}));const l=`${n}_${(new Date).toISOString().slice(0,10)}.xlsx`,u=await i.xlsx.writeBuffer(),f=new Blob([u],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});return await Kt(f,l),!0}catch(e){return this.handleError(e,this.write),!1}}async writeFromArray(e,t=[],r="file",n="Sheet1",o=""){try{const a=new s.default.Workbook,i=a.addWorksheet(n);t.length>0&&i.addRow(t),e.forEach((e=>{const t=e.map((e=>null==e||"null"===e||"undefined"===e||"NaN"===e||"number"==typeof e&&isNaN(e)?o:e));i.addRow(t)}));const c=`${r}_${(new Date).toISOString().slice(0,10)}.xlsx`,l=await a.xlsx.writeBuffer(),u=new Blob([l],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});return await Kt(u,c),!0}catch(e){return this.handleError(e,this.writeFromArray),!1}}handleError(e,t){const r=t.name;throw new Error(`Xatolik Excel.${r} metodida yuz berdi: ${rr(e)}`)}},e.FileType=nr,e.Gsm=Gt,e.IndexMapper=Wt,e.StyledLogger=class{static getStyle(e){switch(e){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(e,t="",...r){if(i())console.log(`%c${t}`,this.getStyle(e),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[e]}[${e.toUpperCase()}] ${t}[0m`,...r)}}static info(e,...t){this.log("info",e,...t)}static warn(e,...t){this.log("warn",e,...t)}static error(e,...t){this.log("error",e,...t)}static success(e,...t){this.log("success",e,...t)}static debug(e,...t){this.log("debug",e,...t)}},e.axiosErrorHandler=(e,t=!0)=>r=>{const n=(r.message||"").trim();r.message="";const o=rr(r).trim()||n,a={error:o,data:r.response?.data,status:r.response?.status,statusText:r.response?.statusText,type:"ERROR"};return e?.(r,o),t?Promise.reject(a):Promise.resolve(a)},e.axiosSuccessHandler=e=>t=>(e?.(t.data),{...t,type:"SUCCESS"}),e.buildTableRows=(e,t,r=!1,n)=>{const o=[],a=[],s=[],i=Object.keys(t);for(const e of i){const n=t[e],o="string"==typeof n,i=Array.isArray(n),c="object"==typeof n&&null!==n&&!i?n.header??e:i&&2===n.length?n[0]:o?n:e;n&&(r&&a.push(c.trim()),s.push(e))}const{extraHeaders:c=[],extraValues:l=[]}=n?n(e):{};return c.length>0&&r&&a.push(...c),e.forEach(((e,r)=>{const n=s.map((r=>{const n=t[r],o=Array.isArray(n),a="object"==typeof n&&null!==n&&!o?n:"function"==typeof n?{mapper:n}:o&&2===n.length?{header:n[0],mapper:n[1]}:{emptyVal:null},s=a.staticVal?a.staticVal:Yt(e,r),i=s||"number"==typeof s?s:a.emptyVal;return a.mapper?a.mapper(i,e,r):"object"==typeof i&&null!==i?JSON.stringify(i):i})),a=l[r]||[];a.length>0&&n.push(...a),o.push(n)})),r&&o.unshift(a),o},e.checkEnvironment=l,e.clearHeaders=_,e.convertBase64ToFile=(e,t="converted_file",r)=>{l("frontend");const n=or[nr[r]];if(!n)throw new Error(`Invalid file type: ${r}`);const{mimeType:o,extension:a}=n,s=e.replace(/^data:.*;base64,/,""),i=window.atob(s),c=i.length,u=new Uint8Array(c);for(let e=0;e<c;e++)u[e]=i.charCodeAt(e);const f=new Blob([u],{type:o});Kt(f,`${t}.${a}`)},e.convertDigitalSize=(e,t,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[e]||!n[t])throw new Error("Invalid unit");return parseFloat((r*n[e]/n[t]).toFixed(2))},e.copyToClipboard=async e=>{l("frontend"),await navigator.clipboard.writeText(e)},e.debounce=(e,t=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const s=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(e(...o))}),t),s&&a(e(...o))}))},e.delay=e=>new Promise((t=>setTimeout(t,e))),e.delayRun=function(e,t){return new Promise((r=>{setTimeout((async()=>{if(t)try{const e=await t();r(e)}catch(e){throw e}r(null)}),e)}))},e.extractErrorMessage=rr,e.extractErrorMessages=(e,t=[])=>{const r=[...Zt,...t];if(!e)return[];const n=Qt("string"==typeof e?e:e?.response?.data||e?.data||e);return tr(n,r)},e.fileConfigs=or,e.formatCurrencyPrice=(e,t,r="en-US")=>e?.toLocaleString(r,{style:"currency",currency:t}),e.formatDateLocaleString=(e,t="en-GB",r="Asia/Tashkent")=>new Date(e).toLocaleString(t,{timeZone:r}),e.formatDuration=Jt,e.formatJsonForTelegram=e=>{try{"string"==typeof e&&(e=JSON.parse(e));return`<pre>${JSON.stringify(e,null,2)}</pre>`}catch(t){return`<pre>${e}</pre>`}},e.formatStringToFloat=Rt,e.generateAndAssignRandomHeaders=e=>{e.headers=e.headers||{},_(e.headers);const t=$();return Object.assign(e.headers,t),e},e.generateIdempotencyKey=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),e.generateRandomHeaders=$,e.generateUserAgents=w,e.getColumnIndex=Lt,e.getColumnName=Bt,e.getFormattedDate=It,e.getLocalIP=async()=>"127.0.0.1",e.getNestedValue=Yt,e.getPrimitiveKeys=e=>{const t=new Set,r=[],n=e=>null===e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e||"symbol"==typeof e||void 0===e,o=e=>"function"==typeof e;if(Array.isArray(e))for(const t of e)t&&"object"==typeof t&&!Array.isArray(t)&&r.push({value:t});else e&&"object"==typeof e&&r.push({value:e});for(;r.length;){const{value:e,prefix:a}=r.pop();for(const[s,i]of Object.entries(e)){const e=a?`${a}.${s}`:s;if(!o(i))if(n(i))t.add(e);else if(Array.isArray(i)){if(i.every((e=>n(e)))){t.add(e);continue}for(const t of i)!t||"object"!=typeof t||Array.isArray(t)||o(t)||r.push({value:t,prefix:e})}else"object"==typeof i&&null!==i&&r.push({value:i,prefix:e})}}return[...t]},e.getRandomInt=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),e.getValidDate=(e,t)=>a.default(e,t).toDate(),e.getValueByName=function(e=[],t,r=null){if(!Array.isArray(e))return r;const n=Lt(t);return kt(e,`[${n}]`,r)},e.headerRandomizer=(e={})=>{_(e);const t=$();return Object.assign(e,t),e},e.isBrowser=i,e.isIndianFormat=Ft,e.isNode=c,e.measureExecutionTime=(e,t="Execution",r)=>{const n=new Date;console.log(`[${t}] Boshladi: ${It(n)}`);const o=e(),a=e=>{const o=e.getTime()-n.getTime();console.log(`[${t}] Tugadi: ${It(e)}`),console.log(`[${t}] Davomiyligi: ${Jt(o,r)}`)};return o instanceof Promise?o.then((e=>(a(new Date),e))):(a(new Date),o)},e.objectItemToArray=(e,t,r=null)=>t.map((t=>{const n=Yt(e,t);return n||"number"==typeof n?n:r})),e.objectToArray=(e,t,r=[],n=null)=>{const o=[];return r.length>0&&o.push(r.map((e=>e.trim()||n))),e.forEach((e=>{const r=t.map((t=>{const r=Yt(e,t);return r||"number"==typeof r?r:n}));o.push(r)})),o},e.parseEuropeanFormat=Dt,e.parseIndianFormat=Pt,e.parseSeparatedNumber=e=>{const t=Number(e?.replace(/,/g,""));return isNaN(t)?0:t},e.rand=y,e.randIp=b,e.resolveHeaderColumn=(e,t,r="")=>{const n=e.indexOf(t);return-1===n?r:Bt(n)},e.resolveHeaderColumnMap=Ht,e.saveFile=Kt,e.scrollToElement=e=>{l("frontend");const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth"})},e.stripHtmlTags=Ut,e.toMilliseconds=e=>{const{milliseconds:t=0,seconds:r=0,minutes:n=0,hours:o=0,days:a=0,weeks:s=0,months:i=0,years:c=0}=e,l=36e5,u=864e5;return t+1e3*r+6e4*n+o*l+a*u+6048e5*s+2630016e3*i+315576e5*c},Object.defineProperty(e,"__esModule",{value:!0}),e}({},moment,lodash,ExcelJS);
|
|
1
|
+
var utilzify=function(e,t,r,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(t),s=o(n);const i=()=>"undefined"!=typeof window&&"undefined"!=typeof document,c=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),l=e=>{const t=i(),r=c();if("frontend"===e&&!t)throw new Error("This function can only be used in a frontend environment.");if("backend"===e&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===e?t:r},u=[{name:"Chrome",tokens:["Chrome","Safari"],prefix:"Mozilla/5.0"},{name:"Firefox",tokens:["Gecko"],prefix:"Mozilla/5.0"},{name:"Opera",tokens:["Presto"],prefix:"Opera/9.80"},{name:"Edge",tokens:["Edg"],prefix:"Mozilla/5.0"},{name:"Safari",tokens:["Version","Safari"],prefix:"Mozilla/5.0"},{name:"IE",tokens:["MSIE","Trident"],prefix:"Mozilla/4.0"}],f=["Windows NT 10.0","Windows NT 6.1","Windows 3.1","Macintosh; Intel Mac OS X 10_15_7","X11; Linux x86_64","X11; Ubuntu; Linux i686","Android 12; Mobile","Android 11; Tablet","iPhone; CPU iPhone OS 16_6 like Mac OS X","iPad; CPU OS 15_4 like Mac OS X"],d=["en","ru","de","fr","es","it","pl","ko","ja","tr"],p=["Trident","Gecko","Presto","Blink"],h=["WOW64","Win64; x64",".NET CLR 3.5.30729","SLCC2","InfoPath.3","Media Center PC 6.0","Tablet PC 2.0"],m=["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","application/json, text/plain, */*"],y=["google.com","bing.com","yandex.ru","duckduckgo.com","example.com","wikipedia.org"],g=e=>e[Math.floor(Math.random()*e.length)],v=()=>`${g([13,14,15,16,17,18,19,20])}.${Math.floor(256*Math.random())}.${Math.floor(256*Math.random())}.${Math.floor(1+254*Math.random())}`,b=(e=15)=>`${Math.floor(Math.random()*e)+1}.${Math.floor(10*Math.random())}`,_=e=>{const t=[];for(let r=0;r<e;r++){const e=g(u),r=g(f),n=g(d),o=g(p),a=b(),s=g(e.tokens),i=Math.random()>.5?`; ${g(h)}`:"",c="IE"===e.name?`${e.prefix} (compatible; ${s} ${a}; ${r}${i}; ${n})`:`${e.prefix} (${r}${i}; ${n}) ${s}/${a} ${o}/${b(5)}`;t.push(c)}return Array.from(new Set(t))},x=(e={},t=[])=>{const r=new Set(["host","connection","content-length","sec-ch-ua-platform","sec-ch-ua","sec-ch-ua-mobile","user-agent","origin","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","referer","cookie","accept-encoding","if-none-match",...t.map((e=>e.toLowerCase()))]);for(const t of Object.keys(e)){const n=t.toLowerCase(),o=n.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("-");(r.has(n)||r.has(o.toLowerCase()))&&delete e[t]}return e},w=_(200),$=()=>{const e={},t=!i();return e.Accept||(e.Accept=g(m)),e.Connection||(e.Connection="keep-alive"),e["User-Agent"]||e["user-agent"]||!t||(e["User-Agent"]=g(w)),!e.Referer&&t&&(e.Referer=(()=>{const e=g(y),t=g(["","search","images","news","video","docs"]),r=Math.random()>.5?`?q=test${Math.floor(1e3*Math.random())}`:"";return`${Math.random()>.5?"https":"http"}://www.${e}/${t}${r}`})()),!e["X-Forwarded-For"]&&t&&(e["X-Forwarded-For"]=v()),!e["Cache-Control"]&&t&&(e["Cache-Control"]="max-age=0"),e};var S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j=Array.isArray,E="object"==typeof S&&S&&S.Object===Object&&S,M="object"==typeof self&&self&&self.Object===Object&&self,C=E||M||Function("return this")(),T=C.Symbol,O=T,N=Object.prototype,k=N.hasOwnProperty,F=N.toString,P=O?O.toStringTag:void 0;var D=function(e){var t=k.call(e,P),r=e[P];try{e[P]=void 0;var n=!0}catch(e){}var o=F.call(e);return n&&(t?e[P]=r:delete e[P]),o},R=Object.prototype.toString;var I=D,U=function(e){return R.call(e)},z=T?T.toStringTag:void 0;var B=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":z&&z in Object(e)?I(e):U(e)};var L=B,W=function(e){return null!=e&&"object"==typeof e};var V=function(e){return"symbol"==typeof e||W(e)&&"[object Symbol]"==L(e)},H=j,X=V,q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/;var J=function(e,t){if(H(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!X(e))||(G.test(e)||!q.test(e)||null!=t&&e in Object(t))};var Y=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},K=B,Z=Y;var Q,ee=function(e){if(!Z(e))return!1;var t=K(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},te=C["__core-js_shared__"],re=(Q=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||""))?"Symbol(src)_1."+Q:"";var ne=function(e){return!!re&&re in e},oe=Function.prototype.toString;var ae=ee,se=ne,ie=Y,ce=function(e){if(null!=e){try{return oe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},le=/^\[object .+?Constructor\]$/,ue=Function.prototype,fe=Object.prototype,de=ue.toString,pe=fe.hasOwnProperty,he=RegExp("^"+de.call(pe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var me=function(e){return!(!ie(e)||se(e))&&(ae(e)?he:le).test(ce(e))},ye=function(e,t){return null==e?void 0:e[t]};var ge=function(e,t){var r=ye(e,t);return me(r)?r:void 0},ve=ge(Object,"create"),be=ve;var _e=function(){this.__data__=be?be(null):{},this.size=0};var xe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},we=ve,$e=Object.prototype.hasOwnProperty;var Se=function(e){var t=this.__data__;if(we){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return $e.call(t,e)?t[e]:void 0},Ae=ve,je=Object.prototype.hasOwnProperty;var Ee=ve;var Me=_e,Ce=xe,Te=Se,Oe=function(e){var t=this.__data__;return Ae?void 0!==t[e]:je.call(t,e)},Ne=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ee&&void 0===t?"__lodash_hash_undefined__":t,this};function ke(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ke.prototype.clear=Me,ke.prototype.delete=Ce,ke.prototype.get=Te,ke.prototype.has=Oe,ke.prototype.set=Ne;var Fe=ke;var Pe=function(){this.__data__=[],this.size=0};var De=function(e,t){return e===t||e!=e&&t!=t};var Re=function(e,t){for(var r=e.length;r--;)if(De(e[r][0],t))return r;return-1},Ie=Re,Ue=Array.prototype.splice;var ze=Re;var Be=Re;var Le=Re;var We=Pe,Ve=function(e){var t=this.__data__,r=Ie(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ue.call(t,r,1),--this.size,!0)},He=function(e){var t=this.__data__,r=ze(t,e);return r<0?void 0:t[r][1]},Xe=function(e){return Be(this.__data__,e)>-1},qe=function(e,t){var r=this.__data__,n=Le(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ge(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ge.prototype.clear=We,Ge.prototype.delete=Ve,Ge.prototype.get=He,Ge.prototype.has=Xe,Ge.prototype.set=qe;var Je=Ge,Ye=ge(C,"Map"),Ke=Fe,Ze=Je,Qe=Ye;var et=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var tt=function(e,t){var r=e.__data__;return et(t)?r["string"==typeof t?"string":"hash"]:r.map},rt=tt;var nt=tt;var ot=tt;var at=tt;var st=function(){this.size=0,this.__data__={hash:new Ke,map:new(Qe||Ze),string:new Ke}},it=function(e){var t=rt(this,e).delete(e);return this.size-=t?1:0,t},ct=function(e){return nt(this,e).get(e)},lt=function(e){return ot(this,e).has(e)},ut=function(e,t){var r=at(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function ft(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ft.prototype.clear=st,ft.prototype.delete=it,ft.prototype.get=ct,ft.prototype.has=lt,ft.prototype.set=ut;var dt=ft;function pt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=e.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(pt.Cache||dt),r}pt.Cache=dt;var ht=pt;var mt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yt=/\\(\\)?/g,gt=function(e){var t=ht(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(mt,(function(e,r,n,o){t.push(n?o.replace(yt,"$1"):r||e)})),t}));var vt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},bt=j,_t=V,xt=T?T.prototype:void 0,wt=xt?xt.toString:void 0;var $t=function e(t){if("string"==typeof t)return t;if(bt(t))return vt(t,e)+"";if(_t(t))return wt?wt.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},St=$t;var At=j,jt=J,Et=gt,Mt=function(e){return null==e?"":St(e)};var Ct=V;var Tt=function(e,t){return At(e)?e:jt(e,t)?[e]:Et(Mt(e))},Ot=function(e){if("string"==typeof e||Ct(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var Nt=function(e,t){for(var r=0,n=(t=Tt(t,e)).length;null!=e&&r<n;)e=e[Ot(t[r++])];return r&&r==n?e:void 0};var kt=A((function(e,t,r){var n=null==e?void 0:Nt(e,t);return void 0===n?r:n}));const Ft=e=>/^(\d{1,3}(,\d{2})*(\.\d+)?)$/.test(e)||/^(\d{1,3}(,\d{3})*(\.\d+)?)$/.test(e),Pt=e=>parseFloat(e.replace(/,/g,"")),Dt=e=>parseFloat(e.replace(/\./g,"").replace(",",".")),Rt=(e,t=0)=>null==e?t:"number"==typeof e?e:e&&"string"==typeof e&&/[\d,.]/.test(e)?(e=e.replace(/\s/g,"").trim(),Ft(e)?Pt(e):e.includes(",")?Dt(e):e.includes(".")||!e.includes(",")?parseFloat(e.replace(/,/g,"")):t):t,It=(e=Date.now(),t="DD/MM/YYYY HH:mm:ss")=>{const r=a.default(e);return r.isValid()?r.format(t):""},Ut=e=>e.replace(/<[^>]*>/g,"").trim(),zt={columnIndexCache:new Map,columnNameCache:new Map};function Bt(e){const t=e.toUpperCase();if(zt.columnIndexCache.has(t))return zt.columnIndexCache.get(t);let r=0;for(let e=0;e<t.length;e++)r=26*r+(t.charCodeAt(e)-65+1);const n=r-1;return zt.columnIndexCache.set(t,n),n}function Lt(e){if(zt.columnNameCache.has(e))return zt.columnNameCache.get(e);let t="";for(;e>=0;){const r=e%26;t=String.fromCharCode(65+r)+t,e=Math.floor(e/26)-1}return zt.columnNameCache.set(e,t),t}const Wt={getStr(e=[],t,r=""){const n=kt(e,`[${t}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(e=[],t,r=0){const n=String(kt(e,`[${t}]`,"")).replace(/\s/g,"");if(!n)return r;const o=Number(n);return isNaN(o)?r:o},getBool(e=[],t,r=!1){if(!Array.isArray(e))return r;const n=kt(e,`[${t}]`,r);return["TRUE","FALSE"].includes(n)?"TRUE"===n:"boolean"==typeof n?n:r},getPrice(e=[],t){const r=this.getStr(e,t);if(!r)return 0;const n=Rt(r);return isNaN(n)?0:n},getDate(e=[],t,r){const n=this.getStr(e,t);if(!n)return null;return a.default(n,r).toDate()},getDateFormatted(e=[],t,r,n){const o=this.getStr(e,t);if(!o)return null;const s=a.default(o,n);return r?It(s.toDate(),r):It(s.toDate())}},Vt={getStr(e=[],t,r=""){const n=Bt(t),o=kt(e,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(e=[],t,r=0){const n=Bt(t),o=String(kt(e,`[${n}]`,"")).replace(/\s/g,"");if(!o)return r;const a=Number(o);return isNaN(a)?r:a},getBool(e=[],t,r=!1){const n=Bt(t);if(!Array.isArray(e))return r;const o=kt(e,`[${n}]`,r);return["TRUE","FALSE"].includes(o)?"TRUE"===o:"boolean"==typeof o?o:r},getPrice(e=[],t){const r=this.getStr(e,t);if(!r)return 0;const n=Rt(r);return isNaN(n)?0:n},getDate(e=[],t,r){const n=this.getStr(e,t);if(!n)return null;return a.default(n,r).toDate()},getDateFormatted(e=[],t,r,n){const o=this.getStr(e,t);if(!o)return null;const s=a.default(o,n);return r?It(s.toDate(),r):It(s.toDate())}},Ht=(e,t)=>{const r={},n=Object.entries(t);for(let t=0;t<e.length;t++){const o=e[t];for(const[e,a]of n){if(void 0!==r[e])continue;o===(Array.isArray(a)?a[0]:a)&&(r[e]=Lt(t))}}return n.forEach((([e,t])=>{const n=Array.isArray(t)?t[1]:null,o=r[e];n&&void 0===o&&(r[e]=n)})),r},Xt={getStr(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Bt(t),s=r.get(e,`[${a}]`,o);return"number"==typeof s?String(s):s?String(s).trim():o},getNum(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Bt(t),s=String(r.get(e,`[${a}]`)).replace(/\s/g,"");if(!s)return o;const i=Number(s);return isNaN(i)?o:i},getBool(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Bt(t),s=r.get(e,`[${a}]`);return s?["TRUE","FALSE"].includes(String(s).trim().toUpperCase())?"TRUE"===s:Boolean(s):o},getPrice(e,t,r){const n=r??null;if(!Array.isArray(e))return n;const o=this.getStr(e,t);if(!o)return n;const a=Rt(o);return isNaN(a)?n:a},getDate(e,t,r,n){const o=n??null;if(!Array.isArray(e))return o;const s=this.getStr(e,t);if(!s)return o;const i=a.default(s,r);return i.isValid()?i.toDate():o},getDateFormatted(e,t,r,n,o){const s=o??null;if(!Array.isArray(e))return s;const i=this.getStr(e,t);if(!i)return s;const c=a.default(i,r);return c.isValid()?It(c.toDate(),n):s}},qt=(e,t,r)=>{switch(e._t){case"str":return Xt.getStr(r,t,e.def);case"num":return Xt.getNum(r,t,e.def);case"bool":return Xt.getBool(r,t,e.def);case"price":return Xt.getPrice(r,t,e.def);case"date":return Xt.getDate(r,t,e.fmt);case"datefmt":return Xt.getDateFormatted(r,t,e.parseFmt,e.returnFmt)}};var Gt=Object.freeze({__proto__:null,col:{str:(e,t)=>({_t:"str",col:e,def:t}),num:(e,t)=>({_t:"num",col:e,def:t}),bool:(e,t)=>({_t:"bool",col:e,def:t}),price:(e,t)=>({_t:"price",col:e,def:t}),date:(e,t)=>({_t:"date",col:e,fmt:t}),datefmt:(e,t,r)=>({_t:"datefmt",col:e,parseFmt:t,returnFmt:r}),fn:e=>({_t:"fn",fn:e})},hdr:{str:(e,t)=>({_t:"str",header:e,def:t}),num:(e,t)=>({_t:"num",header:e,def:t}),bool:(e,t)=>({_t:"bool",header:e,def:t}),price:(e,t)=>({_t:"price",header:e,def:t}),date:(e,t)=>({_t:"date",header:e,fmt:t}),datefmt:(e,t,r)=>({_t:"datefmt",header:e,parseFmt:t,returnFmt:r}),fn:e=>({_t:"fn",fn:e})},createColMapper:e=>t=>{const r={};for(const n in e){const o=e[n];r[n]="fn"===o._t?o.fn(t):qt(o,o.col,t)}return r},createHdrMapper:e=>{const t={};for(const r in e){const n=e[r];"fn"!==n._t&&(t[r]=n.header)}return r=>{const n=Ht(r,t);return t=>{const r={};for(const o in e){const a=e[o];"fn"===a._t?r[o]=a.fn(t):r[o]=qt(a,n[o]??"",t)}return r}}}});const Jt=(e,t)=>{const r=Math.floor(e/1e3),n=Math.floor(r/60),o=Math.floor(n/60),a=r%60;switch(t){case"ms":return`${e} millisoniya`;case"s":return`${(e/1e3).toFixed(2)} soniya`;case"min":return`${(e/6e4).toFixed(2)} daqiqa`;default:return`${o>0?`${o} soat `:""}${n%60>0?n%60+" daqiqa ":""}${(a>0?`${a} soniya`:"")||"0 soniya"}`.trim()}},Yt=(e,t)=>{const r=t.split(".");let n=e;for(const e of r){if(!n&&"number"!=typeof n)return null;n=n[e]}return n},Kt=(e,t)=>{if(l("frontend"),window.navigator){const r=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=r,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},Zt=["err.cause.message","cause.message","cause.stack","detailMessage","error_description","error.message","description","msg","message","error","errors","errorDetails","errorMessage","error_type","errorMsg","errorMessages","error_info","error_info.message","error_info.error_message","error_info.details","data.message","response.message","response.error_message","response.details","httpError","validationError","status_description","messages","alert_message","alert","userMessage","user_error","client_error","response.data.error","response.data.message","response.data.error_description","response.data.details","errorMessages[*].message","errors[*].msg","errors[*].message","[*].msg","[*].message"],Qt=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}return e},er=(e,t,r=0,n=5)=>{if(r>n||"object"!=typeof e||null===e)return null;for(const o of t){const a=o.split(".");let s=e;for(const e of a){if(null==s)break;if("[*]"===e){if(Array.isArray(s)){for(const t of s){const o=er(t,[a.slice(a.indexOf(e)+1).join(".")],r+1,n);if(o)return o}s=null;break}s=null;break}if(e.endsWith("]")){const t=e.match(/(\w+)\[(\d+)\]/);if(t){const[,e,r]=t;s=s?.[e]?.[Number(r)]}else s=s?.[e]}else s=s?.[e]}if(s=Qt(s),Array.isArray(s)){const e=s.map((e=>"string"==typeof e?e:e?.message||e?.msg||"")).filter(Boolean).join("\n");if(e)return e}if("string"==typeof s)return Ut(s);if("object"==typeof s&&null!==s){const e=er(s,t,r+1,n);if(e)return e}}return null},tr=(e,t,r=0,n=5)=>{if(r>n||"object"!=typeof e||null===e)return[];const o=[];for(const a of t){const s=a.split(".");let i=e;for(let e=0;e<s.length;e++){const t=s[e];if(null==i)break;if("[*]"===t){if(Array.isArray(i)){const t=s.slice(e+1).join(".");for(const e of i)o.push(...tr(e,[t],r+1,n))}i=null;break}if(t.endsWith("]")){const e=t.match(/(\w+)\[(\d+)\]/);if(e){const[,t,r]=e;i=i?.[t]?.[Number(r)]}else i=i?.[t]}else i=i?.[t]}if(i=Qt(i),"string"==typeof i)o.push(Ut(i));else if(Array.isArray(i)){for(const e of i)if("string"==typeof e)o.push(Ut(e));else if("object"==typeof e){const a=e?.message||e?.msg;"string"==typeof a?o.push(Ut(a)):o.push(...tr(e,t,r+1,n))}}else"object"==typeof i&&o.push(...tr(i,t,r+1,n))}return o},rr=(e,t="",r=[])=>{const n=[...r,...Zt];if(!e)return t;if("string"==typeof e){const r=Qt(e);return"object"==typeof r?er(r,n)||t:Ut(e)}const o=Qt(e?.response?.data||e?.data||e),a=er(o,n)||e?.message;return Ut(a||"").trim()||t},nr={PDF:"pdf",PNG:"image/png",JPEG:"image/jpeg",EXCEL:"excel",WORD:"word",TEXT:"text"},or={[nr.PDF]:{mimeType:"application/pdf",extension:"pdf"},[nr.PNG]:{mimeType:"image/png",extension:"png"},[nr.JPEG]:{mimeType:"image/jpeg",extension:"jpg"},[nr.EXCEL]:{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extension:"xlsx"},[nr.WORD]:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extension:"docx"},[nr.TEXT]:{mimeType:"text/plain",extension:"txt"}};return e.ColumnMapper=Vt,e.ColumnParser=Xt,e.Excel=class{constructor(){l("frontend")}async readFromArrayBuffer(e,t){try{let r;r=e instanceof Buffer?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):await e.arrayBuffer();const n=new s.default.Workbook;await n.xlsx.load(r);const o=n.getWorksheet(t),a=[];return o?(o.eachRow({includeEmpty:!0},(e=>{const t=[];e.eachCell({includeEmpty:!0},(e=>{t.push(void 0!==e.value?e.value:null)})),a.push(t)})),a):[]}catch(e){return[]}}async read(e,t=1){try{const r=new s.default.Workbook;await r.xlsx.readFile(e);const n=r.getWorksheet(t);if(!n)throw new Error(`Excelda ${t}-raqamli jadval topilmadi. Iltimos, faylda ushbu jadval mavjudligini tekshiring.`);const o=[];return n.eachRow({includeEmpty:!0},(e=>{const t=[];e.eachCell({includeEmpty:!0},(e=>{t.push(void 0!==e.value?e.value:null)})),o.push(t)})),o}catch(e){return this.handleError(e,this.read),[]}}async write(e,t,r,n="file",o="Sheet1",a=""){try{const i=new s.default.Workbook,c=i.addWorksheet(o);c.addRow(t),e.forEach((e=>{const t=r.map((t=>{const r=Yt(e,t);return!(null==r||"null"===r||"undefined"===r||"NaN"===r||"number"==typeof r&&isNaN(r))?r:a}));c.addRow(t)}));const l=`${n}_${(new Date).toISOString().slice(0,10)}.xlsx`,u=await i.xlsx.writeBuffer(),f=new Blob([u],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});return await Kt(f,l),!0}catch(e){return this.handleError(e,this.write),!1}}async writeFromArray(e,t=[],r="file",n="Sheet1",o=""){try{const a=new s.default.Workbook,i=a.addWorksheet(n);t.length>0&&i.addRow(t),e.forEach((e=>{const t=e.map((e=>null==e||"null"===e||"undefined"===e||"NaN"===e||"number"==typeof e&&isNaN(e)?o:e));i.addRow(t)}));const c=`${r}_${(new Date).toISOString().slice(0,10)}.xlsx`,l=await a.xlsx.writeBuffer(),u=new Blob([l],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});return await Kt(u,c),!0}catch(e){return this.handleError(e,this.writeFromArray),!1}}handleError(e,t){const r=t.name;throw new Error(`Xatolik Excel.${r} metodida yuz berdi: ${rr(e)}`)}},e.FileType=nr,e.Gsm=Gt,e.IndexMapper=Wt,e.axiosErrorHandler=(e,t=!0)=>r=>{const n=(r.message||"").trim();r.message="";const o=rr(r).trim()||n,a={error:o,data:r.response?.data,status:r.response?.status,statusText:r.response?.statusText,type:"ERROR"};return e?.(r,o),t?Promise.reject(a):Promise.resolve(a)},e.axiosSuccessHandler=e=>t=>(e?.(t.data),{...t,type:"SUCCESS"}),e.buildTableRows=(e,t,r=!1,n)=>{const o=[],a=[],s=[],i=Object.keys(t);for(const e of i){const n=t[e],o="string"==typeof n,i=Array.isArray(n),c="object"==typeof n&&null!==n&&!i?n.header??e:i&&2===n.length?n[0]:o?n:e;n&&(r&&a.push(c.trim()),s.push(e))}const{extraHeaders:c=[],extraValues:l=[]}=n?n(e):{};return c.length>0&&r&&a.push(...c),e.forEach(((e,r)=>{const n=s.map((r=>{const n=t[r],o=Array.isArray(n),a="object"==typeof n&&null!==n&&!o?n:"function"==typeof n?{mapper:n}:o&&2===n.length?{header:n[0],mapper:n[1]}:{emptyVal:null},s=a.staticVal?a.staticVal:Yt(e,r),i=s||"number"==typeof s?s:a.emptyVal;return a.mapper?a.mapper(i,e,r):"object"==typeof i&&null!==i?JSON.stringify(i):i})),a=l[r]||[];a.length>0&&n.push(...a),o.push(n)})),r&&o.unshift(a),o},e.checkEnvironment=l,e.clearHeaders=x,e.convertBase64ToFile=(e,t="converted_file",r)=>{l("frontend");const n=or[nr[r]];if(!n)throw new Error(`Invalid file type: ${r}`);const{mimeType:o,extension:a}=n,s=e.replace(/^data:.*;base64,/,""),i=window.atob(s),c=i.length,u=new Uint8Array(c);for(let e=0;e<c;e++)u[e]=i.charCodeAt(e);const f=new Blob([u],{type:o});Kt(f,`${t}.${a}`)},e.convertDigitalSize=(e,t,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[e]||!n[t])throw new Error("Invalid unit");return parseFloat((r*n[e]/n[t]).toFixed(2))},e.debounce=(e,t=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const s=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(e(...o))}),t),s&&a(e(...o))}))},e.delay=e=>new Promise((t=>setTimeout(t,e))),e.delayRun=function(e,t){return new Promise((r=>{setTimeout((async()=>{if(t)try{const e=await t();r(e)}catch(e){throw e}r(null)}),e)}))},e.extractErrorMessage=rr,e.extractErrorMessages=(e,t=[])=>{const r=[...Zt,...t];if(!e)return[];const n=Qt("string"==typeof e?e:e?.response?.data||e?.data||e);return tr(n,r)},e.fileConfigs=or,e.formatCurrencyPrice=(e,t,r="en-US")=>e?.toLocaleString(r,{style:"currency",currency:t}),e.formatDateLocaleString=(e,t="en-GB",r="Asia/Tashkent")=>new Date(e).toLocaleString(t,{timeZone:r}),e.formatDuration=Jt,e.formatJsonForTelegram=e=>{try{"string"==typeof e&&(e=JSON.parse(e));return`<pre>${JSON.stringify(e,null,2)}</pre>`}catch(t){return`<pre>${e}</pre>`}},e.formatStringToFloat=Rt,e.generateAndAssignRandomHeaders=e=>{e.headers=e.headers||{},x(e.headers);const t=$();return Object.assign(e.headers,t),e},e.generateIdempotencyKey=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),e.generateRandomHeaders=$,e.generateUserAgents=_,e.getColumnIndex=Bt,e.getColumnName=Lt,e.getFormattedDate=It,e.getNestedValue=Yt,e.getPrimitiveKeys=e=>{const t=new Set,r=[],n=e=>null===e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e||"symbol"==typeof e||void 0===e,o=e=>"function"==typeof e;if(Array.isArray(e))for(const t of e)t&&"object"==typeof t&&!Array.isArray(t)&&r.push({value:t});else e&&"object"==typeof e&&r.push({value:e});for(;r.length;){const{value:e,prefix:a}=r.pop();for(const[s,i]of Object.entries(e)){const e=a?`${a}.${s}`:s;if(!o(i))if(n(i))t.add(e);else if(Array.isArray(i)){if(i.every((e=>n(e)))){t.add(e);continue}for(const t of i)!t||"object"!=typeof t||Array.isArray(t)||o(t)||r.push({value:t,prefix:e})}else"object"==typeof i&&null!==i&&r.push({value:i,prefix:e})}}return[...t]},e.getRandomInt=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),e.getValidDate=(e,t)=>a.default(e,t).toDate(),e.getValueByName=function(e=[],t,r=null){if(!Array.isArray(e))return r;const n=Bt(t);return kt(e,`[${n}]`,r)},e.headerRandomizer=(e={})=>{x(e);const t=$();return Object.assign(e,t),e},e.isBrowser=i,e.isIndianFormat=Ft,e.isNode=c,e.measureExecutionTime=(e,t="Execution",r)=>{const n=new Date;console.log(`[${t}] Boshladi: ${It(n)}`);const o=e(),a=e=>{const o=e.getTime()-n.getTime();console.log(`[${t}] Tugadi: ${It(e)}`),console.log(`[${t}] Davomiyligi: ${Jt(o,r)}`)};return o instanceof Promise?o.then((e=>(a(new Date),e))):(a(new Date),o)},e.objectItemToArray=(e,t,r=null)=>t.map((t=>{const n=Yt(e,t);return n||"number"==typeof n?n:r})),e.objectToArray=(e,t,r=[],n=null)=>{const o=[];return r.length>0&&o.push(r.map((e=>e.trim()||n))),e.forEach((e=>{const r=t.map((t=>{const r=Yt(e,t);return r||"number"==typeof r?r:n}));o.push(r)})),o},e.parseEuropeanFormat=Dt,e.parseIndianFormat=Pt,e.parseSeparatedNumber=e=>{const t=Number(e?.replace(/,/g,""));return isNaN(t)?0:t},e.rand=g,e.randIp=v,e.resolveHeaderColumn=(e,t,r="")=>{const n=e.indexOf(t);return-1===n?r:Lt(n)},e.resolveHeaderColumnMap=Ht,e.saveFile=Kt,e.scrollToElement=e=>{l("frontend");const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth"})},e.stripHtmlTags=Ut,e.toMilliseconds=e=>{const{milliseconds:t=0,seconds:r=0,minutes:n=0,hours:o=0,days:a=0,weeks:s=0,months:i=0,years:c=0}=e,l=36e5,u=864e5;return t+1e3*r+6e4*n+o*l+a*u+6048e5*s+2630016e3*i+315576e5*c},Object.defineProperty(e,"__esModule",{value:!0}),e}({},moment,lodash,ExcelJS);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("moment"),require("lodash"),require("exceljs")):"function"==typeof define&&define.amd?define(["exports","moment","lodash","exceljs"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).utilzify={},e.moment,e.lodash,e.ExcelJS)}(this,(function(e,t,r,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(t),s=o(n);const i=()=>"undefined"!=typeof window&&"undefined"!=typeof document,c=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),l=e=>{const t=i(),r=c();if("frontend"===e&&!t)throw new Error("This function can only be used in a frontend environment.");if("backend"===e&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===e?t:r},u=[{name:"Chrome",tokens:["Chrome","Safari"],prefix:"Mozilla/5.0"},{name:"Firefox",tokens:["Gecko"],prefix:"Mozilla/5.0"},{name:"Opera",tokens:["Presto"],prefix:"Opera/9.80"},{name:"Edge",tokens:["Edg"],prefix:"Mozilla/5.0"},{name:"Safari",tokens:["Version","Safari"],prefix:"Mozilla/5.0"},{name:"IE",tokens:["MSIE","Trident"],prefix:"Mozilla/4.0"}],f=["Windows NT 10.0","Windows NT 6.1","Windows 3.1","Macintosh; Intel Mac OS X 10_15_7","X11; Linux x86_64","X11; Ubuntu; Linux i686","Android 12; Mobile","Android 11; Tablet","iPhone; CPU iPhone OS 16_6 like Mac OS X","iPad; CPU OS 15_4 like Mac OS X"],d=["en","ru","de","fr","es","it","pl","ko","ja","tr"],p=["Trident","Gecko","Presto","Blink"],h=["WOW64","Win64; x64",".NET CLR 3.5.30729","SLCC2","InfoPath.3","Media Center PC 6.0","Tablet PC 2.0"],m=["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","application/json, text/plain, */*"],g=["google.com","bing.com","yandex.ru","duckduckgo.com","example.com","wikipedia.org"],y=e=>e[Math.floor(Math.random()*e.length)],b=()=>`${y([13,14,15,16,17,18,19,20])}.${Math.floor(256*Math.random())}.${Math.floor(256*Math.random())}.${Math.floor(1+254*Math.random())}`,v=(e=15)=>`${Math.floor(Math.random()*e)+1}.${Math.floor(10*Math.random())}`,x=e=>{const t=[];for(let r=0;r<e;r++){const e=y(u),r=y(f),n=y(d),o=y(p),a=v(),s=y(e.tokens),i=Math.random()>.5?`; ${y(h)}`:"",c="IE"===e.name?`${e.prefix} (compatible; ${s} ${a}; ${r}${i}; ${n})`:`${e.prefix} (${r}${i}; ${n}) ${s}/${a} ${o}/${v(5)}`;t.push(c)}return Array.from(new Set(t))},w=(e={},t=[])=>{const r=new Set(["host","connection","content-length","sec-ch-ua-platform","sec-ch-ua","sec-ch-ua-mobile","user-agent","origin","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","referer","cookie","accept-encoding","if-none-match",...t.map((e=>e.toLowerCase()))]);for(const t of Object.keys(e)){const n=t.toLowerCase(),o=n.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("-");(r.has(n)||r.has(o.toLowerCase()))&&delete e[t]}return e},_=x(200),$=()=>{const e={},t=!i();return e.Accept||(e.Accept=y(m)),e.Connection||(e.Connection="keep-alive"),e["User-Agent"]||e["user-agent"]||!t||(e["User-Agent"]=y(_)),!e.Referer&&t&&(e.Referer=(()=>{const e=y(g),t=y(["","search","images","news","video","docs"]),r=Math.random()>.5?`?q=test${Math.floor(1e3*Math.random())}`:"";return`${Math.random()>.5?"https":"http"}://www.${e}/${t}${r}`})()),!e["X-Forwarded-For"]&&t&&(e["X-Forwarded-For"]=b()),!e["Cache-Control"]&&t&&(e["Cache-Control"]="max-age=0"),e};var S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j=Array.isArray,E="object"==typeof S&&S&&S.Object===Object&&S,M="object"==typeof self&&self&&self.Object===Object&&self,C=E||M||Function("return this")(),T=C.Symbol,O=T,N=Object.prototype,k=N.hasOwnProperty,F=N.toString,P=O?O.toStringTag:void 0;var D=function(e){var t=k.call(e,P),r=e[P];try{e[P]=void 0;var n=!0}catch(e){}var o=F.call(e);return n&&(t?e[P]=r:delete e[P]),o},R=Object.prototype.toString;var I=D,U=function(e){return R.call(e)},z=T?T.toStringTag:void 0;var L=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":z&&z in Object(e)?I(e):U(e)};var B=L,W=function(e){return null!=e&&"object"==typeof e};var V=function(e){return"symbol"==typeof e||W(e)&&"[object Symbol]"==B(e)},q=j,H=V,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/;var J=function(e,t){if(q(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!H(e))||(G.test(e)||!X.test(e)||null!=t&&e in Object(t))};var Y=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},K=L,Z=Y;var Q,ee=function(e){if(!Z(e))return!1;var t=K(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},te=C["__core-js_shared__"],re=(Q=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||""))?"Symbol(src)_1."+Q:"";var ne=function(e){return!!re&&re in e},oe=Function.prototype.toString;var ae=ee,se=ne,ie=Y,ce=function(e){if(null!=e){try{return oe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},le=/^\[object .+?Constructor\]$/,ue=Function.prototype,fe=Object.prototype,de=ue.toString,pe=fe.hasOwnProperty,he=RegExp("^"+de.call(pe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var me=function(e){return!(!ie(e)||se(e))&&(ae(e)?he:le).test(ce(e))},ge=function(e,t){return null==e?void 0:e[t]};var ye=function(e,t){var r=ge(e,t);return me(r)?r:void 0},be=ye(Object,"create"),ve=be;var xe=function(){this.__data__=ve?ve(null):{},this.size=0};var we=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},_e=be,$e=Object.prototype.hasOwnProperty;var Se=function(e){var t=this.__data__;if(_e){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return $e.call(t,e)?t[e]:void 0},Ae=be,je=Object.prototype.hasOwnProperty;var Ee=be;var Me=xe,Ce=we,Te=Se,Oe=function(e){var t=this.__data__;return Ae?void 0!==t[e]:je.call(t,e)},Ne=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ee&&void 0===t?"__lodash_hash_undefined__":t,this};function ke(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ke.prototype.clear=Me,ke.prototype.delete=Ce,ke.prototype.get=Te,ke.prototype.has=Oe,ke.prototype.set=Ne;var Fe=ke;var Pe=function(){this.__data__=[],this.size=0};var De=function(e,t){return e===t||e!=e&&t!=t};var Re=function(e,t){for(var r=e.length;r--;)if(De(e[r][0],t))return r;return-1},Ie=Re,Ue=Array.prototype.splice;var ze=Re;var Le=Re;var Be=Re;var We=Pe,Ve=function(e){var t=this.__data__,r=Ie(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ue.call(t,r,1),--this.size,!0)},qe=function(e){var t=this.__data__,r=ze(t,e);return r<0?void 0:t[r][1]},He=function(e){return Le(this.__data__,e)>-1},Xe=function(e,t){var r=this.__data__,n=Be(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ge(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ge.prototype.clear=We,Ge.prototype.delete=Ve,Ge.prototype.get=qe,Ge.prototype.has=He,Ge.prototype.set=Xe;var Je=Ge,Ye=ye(C,"Map"),Ke=Fe,Ze=Je,Qe=Ye;var et=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var tt=function(e,t){var r=e.__data__;return et(t)?r["string"==typeof t?"string":"hash"]:r.map},rt=tt;var nt=tt;var ot=tt;var at=tt;var st=function(){this.size=0,this.__data__={hash:new Ke,map:new(Qe||Ze),string:new Ke}},it=function(e){var t=rt(this,e).delete(e);return this.size-=t?1:0,t},ct=function(e){return nt(this,e).get(e)},lt=function(e){return ot(this,e).has(e)},ut=function(e,t){var r=at(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function ft(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ft.prototype.clear=st,ft.prototype.delete=it,ft.prototype.get=ct,ft.prototype.has=lt,ft.prototype.set=ut;var dt=ft;function pt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=e.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(pt.Cache||dt),r}pt.Cache=dt;var ht=pt;var mt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gt=/\\(\\)?/g,yt=function(e){var t=ht(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(mt,(function(e,r,n,o){t.push(n?o.replace(gt,"$1"):r||e)})),t}));var bt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},vt=j,xt=V,wt=T?T.prototype:void 0,_t=wt?wt.toString:void 0;var $t=function e(t){if("string"==typeof t)return t;if(vt(t))return bt(t,e)+"";if(xt(t))return _t?_t.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},St=$t;var At=j,jt=J,Et=yt,Mt=function(e){return null==e?"":St(e)};var Ct=V;var Tt=function(e,t){return At(e)?e:jt(e,t)?[e]:Et(Mt(e))},Ot=function(e){if("string"==typeof e||Ct(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var Nt=function(e,t){for(var r=0,n=(t=Tt(t,e)).length;null!=e&&r<n;)e=e[Ot(t[r++])];return r&&r==n?e:void 0};var kt=A((function(e,t,r){var n=null==e?void 0:Nt(e,t);return void 0===n?r:n}));const Ft=e=>/^(\d{1,3}(,\d{2})*(\.\d+)?)$/.test(e)||/^(\d{1,3}(,\d{3})*(\.\d+)?)$/.test(e),Pt=e=>parseFloat(e.replace(/,/g,"")),Dt=e=>parseFloat(e.replace(/\./g,"").replace(",",".")),Rt=(e,t=0)=>null==e?t:"number"==typeof e?e:e&&"string"==typeof e&&/[\d,.]/.test(e)?(e=e.replace(/\s/g,"").trim(),Ft(e)?Pt(e):e.includes(",")?Dt(e):e.includes(".")||!e.includes(",")?parseFloat(e.replace(/,/g,"")):t):t,It=(e=Date.now(),t="DD/MM/YYYY HH:mm:ss")=>{const r=a.default(e);return r.isValid()?r.format(t):""},Ut=e=>e.replace(/<[^>]*>/g,"").trim(),zt={columnIndexCache:new Map,columnNameCache:new Map};function Lt(e){const t=e.toUpperCase();if(zt.columnIndexCache.has(t))return zt.columnIndexCache.get(t);let r=0;for(let e=0;e<t.length;e++)r=26*r+(t.charCodeAt(e)-65+1);const n=r-1;return zt.columnIndexCache.set(t,n),n}function Bt(e){if(zt.columnNameCache.has(e))return zt.columnNameCache.get(e);let t="";for(;e>=0;){const r=e%26;t=String.fromCharCode(65+r)+t,e=Math.floor(e/26)-1}return zt.columnNameCache.set(e,t),t}const Wt={getStr(e=[],t,r=""){const n=kt(e,`[${t}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(e=[],t,r=0){const n=String(kt(e,`[${t}]`,"")).replace(/\s/g,"");if(!n)return r;const o=Number(n);return isNaN(o)?r:o},getBool(e=[],t,r=!1){if(!Array.isArray(e))return r;const n=kt(e,`[${t}]`,r);return["TRUE","FALSE"].includes(n)?"TRUE"===n:"boolean"==typeof n?n:r},getPrice(e=[],t){const r=this.getStr(e,t);if(!r)return 0;const n=Rt(r);return isNaN(n)?0:n},getDate(e=[],t,r){const n=this.getStr(e,t);if(!n)return null;return a.default(n,r).toDate()},getDateFormatted(e=[],t,r,n){const o=this.getStr(e,t);if(!o)return null;const s=a.default(o,n);return r?It(s.toDate(),r):It(s.toDate())}},Vt={getStr(e=[],t,r=""){const n=Lt(t),o=kt(e,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(e=[],t,r=0){const n=Lt(t),o=String(kt(e,`[${n}]`,"")).replace(/\s/g,"");if(!o)return r;const a=Number(o);return isNaN(a)?r:a},getBool(e=[],t,r=!1){const n=Lt(t);if(!Array.isArray(e))return r;const o=kt(e,`[${n}]`,r);return["TRUE","FALSE"].includes(o)?"TRUE"===o:"boolean"==typeof o?o:r},getPrice(e=[],t){const r=this.getStr(e,t);if(!r)return 0;const n=Rt(r);return isNaN(n)?0:n},getDate(e=[],t,r){const n=this.getStr(e,t);if(!n)return null;return a.default(n,r).toDate()},getDateFormatted(e=[],t,r,n){const o=this.getStr(e,t);if(!o)return null;const s=a.default(o,n);return r?It(s.toDate(),r):It(s.toDate())}},qt=(e,t)=>{const r={},n=Object.entries(t);for(let t=0;t<e.length;t++){const o=e[t];for(const[e,a]of n){if(void 0!==r[e])continue;o===(Array.isArray(a)?a[0]:a)&&(r[e]=Bt(t))}}return n.forEach((([e,t])=>{const n=Array.isArray(t)?t[1]:null,o=r[e];n&&void 0===o&&(r[e]=n)})),r},Ht={getStr(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Lt(t),s=r.get(e,`[${a}]`,o);return"number"==typeof s?String(s):s?String(s).trim():o},getNum(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Lt(t),s=String(r.get(e,`[${a}]`)).replace(/\s/g,"");if(!s)return o;const i=Number(s);return isNaN(i)?o:i},getBool(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Lt(t),s=r.get(e,`[${a}]`);return s?["TRUE","FALSE"].includes(String(s).trim().toUpperCase())?"TRUE"===s:Boolean(s):o},getPrice(e,t,r){const n=r??null;if(!Array.isArray(e))return n;const o=this.getStr(e,t);if(!o)return n;const a=Rt(o);return isNaN(a)?n:a},getDate(e,t,r,n){const o=n??null;if(!Array.isArray(e))return o;const s=this.getStr(e,t);if(!s)return o;const i=a.default(s,r);return i.isValid()?i.toDate():o},getDateFormatted(e,t,r,n,o){const s=o??null;if(!Array.isArray(e))return s;const i=this.getStr(e,t);if(!i)return s;const c=a.default(i,r);return c.isValid()?It(c.toDate(),n):s}},Xt=(e,t,r)=>{switch(e._t){case"str":return Ht.getStr(r,t,e.def);case"num":return Ht.getNum(r,t,e.def);case"bool":return Ht.getBool(r,t,e.def);case"price":return Ht.getPrice(r,t,e.def);case"date":return Ht.getDate(r,t,e.fmt);case"datefmt":return Ht.getDateFormatted(r,t,e.parseFmt,e.returnFmt)}};var Gt=Object.freeze({__proto__:null,col:{str:(e,t)=>({_t:"str",col:e,def:t}),num:(e,t)=>({_t:"num",col:e,def:t}),bool:(e,t)=>({_t:"bool",col:e,def:t}),price:(e,t)=>({_t:"price",col:e,def:t}),date:(e,t)=>({_t:"date",col:e,fmt:t}),datefmt:(e,t,r)=>({_t:"datefmt",col:e,parseFmt:t,returnFmt:r}),fn:e=>({_t:"fn",fn:e})},hdr:{str:(e,t)=>({_t:"str",header:e,def:t}),num:(e,t)=>({_t:"num",header:e,def:t}),bool:(e,t)=>({_t:"bool",header:e,def:t}),price:(e,t)=>({_t:"price",header:e,def:t}),date:(e,t)=>({_t:"date",header:e,fmt:t}),datefmt:(e,t,r)=>({_t:"datefmt",header:e,parseFmt:t,returnFmt:r}),fn:e=>({_t:"fn",fn:e})},createColMapper:e=>t=>{const r={};for(const n in e){const o=e[n];r[n]="fn"===o._t?o.fn(t):Xt(o,o.col,t)}return r},createHdrMapper:e=>{const t={};for(const r in e){const n=e[r];"fn"!==n._t&&(t[r]=n.header)}return r=>{const n=qt(r,t);return t=>{const r={};for(const o in e){const a=e[o];"fn"===a._t?r[o]=a.fn(t):r[o]=Xt(a,n[o]??"",t)}return r}}}});const Jt=(e,t)=>{const r=Math.floor(e/1e3),n=Math.floor(r/60),o=Math.floor(n/60),a=r%60;switch(t){case"ms":return`${e} millisoniya`;case"s":return`${(e/1e3).toFixed(2)} soniya`;case"min":return`${(e/6e4).toFixed(2)} daqiqa`;default:return`${o>0?`${o} soat `:""}${n%60>0?n%60+" daqiqa ":""}${(a>0?`${a} soniya`:"")||"0 soniya"}`.trim()}},Yt=(e,t)=>{const r=t.split(".");let n=e;for(const e of r){if(!n&&"number"!=typeof n)return null;n=n[e]}return n},Kt=(e,t)=>{if(l("frontend"),window.navigator){const r=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=r,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}};const Zt=["err.cause.message","cause.message","cause.stack","detailMessage","error_description","error.message","description","msg","message","error","errors","errorDetails","errorMessage","error_type","errorMsg","errorMessages","error_info","error_info.message","error_info.error_message","error_info.details","data.message","response.message","response.error_message","response.details","httpError","validationError","status_description","messages","alert_message","alert","userMessage","user_error","client_error","response.data.error","response.data.message","response.data.error_description","response.data.details","errorMessages[*].message","errors[*].msg","errors[*].message","[*].msg","[*].message"],Qt=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}return e},er=(e,t,r=0,n=5)=>{if(r>n||"object"!=typeof e||null===e)return null;for(const o of t){const a=o.split(".");let s=e;for(const e of a){if(null==s)break;if("[*]"===e){if(Array.isArray(s)){for(const t of s){const o=er(t,[a.slice(a.indexOf(e)+1).join(".")],r+1,n);if(o)return o}s=null;break}s=null;break}if(e.endsWith("]")){const t=e.match(/(\w+)\[(\d+)\]/);if(t){const[,e,r]=t;s=s?.[e]?.[Number(r)]}else s=s?.[e]}else s=s?.[e]}if(s=Qt(s),Array.isArray(s)){const e=s.map((e=>"string"==typeof e?e:e?.message||e?.msg||"")).filter(Boolean).join("\n");if(e)return e}if("string"==typeof s)return Ut(s);if("object"==typeof s&&null!==s){const e=er(s,t,r+1,n);if(e)return e}}return null},tr=(e,t,r=0,n=5)=>{if(r>n||"object"!=typeof e||null===e)return[];const o=[];for(const a of t){const s=a.split(".");let i=e;for(let e=0;e<s.length;e++){const t=s[e];if(null==i)break;if("[*]"===t){if(Array.isArray(i)){const t=s.slice(e+1).join(".");for(const e of i)o.push(...tr(e,[t],r+1,n))}i=null;break}if(t.endsWith("]")){const e=t.match(/(\w+)\[(\d+)\]/);if(e){const[,t,r]=e;i=i?.[t]?.[Number(r)]}else i=i?.[t]}else i=i?.[t]}if(i=Qt(i),"string"==typeof i)o.push(Ut(i));else if(Array.isArray(i)){for(const e of i)if("string"==typeof e)o.push(Ut(e));else if("object"==typeof e){const a=e?.message||e?.msg;"string"==typeof a?o.push(Ut(a)):o.push(...tr(e,t,r+1,n))}}else"object"==typeof i&&o.push(...tr(i,t,r+1,n))}return o},rr=(e,t="",r=[])=>{const n=[...r,...Zt];if(!e)return t;if("string"==typeof e){const r=Qt(e);return"object"==typeof r?er(r,n)||t:Ut(e)}const o=Qt(e?.response?.data||e?.data||e),a=er(o,n)||e?.message;return Ut(a||"").trim()||t},nr={PDF:"pdf",PNG:"image/png",JPEG:"image/jpeg",EXCEL:"excel",WORD:"word",TEXT:"text"},or={[nr.PDF]:{mimeType:"application/pdf",extension:"pdf"},[nr.PNG]:{mimeType:"image/png",extension:"png"},[nr.JPEG]:{mimeType:"image/jpeg",extension:"jpg"},[nr.EXCEL]:{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extension:"xlsx"},[nr.WORD]:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extension:"docx"},[nr.TEXT]:{mimeType:"text/plain",extension:"txt"}};e.ColumnMapper=Vt,e.ColumnParser=Ht,e.Excel=class{constructor(){l("frontend")}async readFromArrayBuffer(e,t){try{let r;r=e instanceof Buffer?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):await e.arrayBuffer();const n=new s.default.Workbook;await n.xlsx.load(r);const o=n.getWorksheet(t),a=[];return o?(o.eachRow({includeEmpty:!0},(e=>{const t=[];e.eachCell({includeEmpty:!0},(e=>{t.push(void 0!==e.value?e.value:null)})),a.push(t)})),a):[]}catch(e){return[]}}async read(e,t=1){try{const r=new s.default.Workbook;await r.xlsx.readFile(e);const n=r.getWorksheet(t);if(!n)throw new Error(`Excelda ${t}-raqamli jadval topilmadi. Iltimos, faylda ushbu jadval mavjudligini tekshiring.`);const o=[];return n.eachRow({includeEmpty:!0},(e=>{const t=[];e.eachCell({includeEmpty:!0},(e=>{t.push(void 0!==e.value?e.value:null)})),o.push(t)})),o}catch(e){return this.handleError(e,this.read),[]}}async write(e,t,r,n="file",o="Sheet1",a=""){try{const i=new s.default.Workbook,c=i.addWorksheet(o);c.addRow(t),e.forEach((e=>{const t=r.map((t=>{const r=Yt(e,t);return!(null==r||"null"===r||"undefined"===r||"NaN"===r||"number"==typeof r&&isNaN(r))?r:a}));c.addRow(t)}));const l=`${n}_${(new Date).toISOString().slice(0,10)}.xlsx`,u=await i.xlsx.writeBuffer(),f=new Blob([u],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});return await Kt(f,l),!0}catch(e){return this.handleError(e,this.write),!1}}async writeFromArray(e,t=[],r="file",n="Sheet1",o=""){try{const a=new s.default.Workbook,i=a.addWorksheet(n);t.length>0&&i.addRow(t),e.forEach((e=>{const t=e.map((e=>null==e||"null"===e||"undefined"===e||"NaN"===e||"number"==typeof e&&isNaN(e)?o:e));i.addRow(t)}));const c=`${r}_${(new Date).toISOString().slice(0,10)}.xlsx`,l=await a.xlsx.writeBuffer(),u=new Blob([l],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});return await Kt(u,c),!0}catch(e){return this.handleError(e,this.writeFromArray),!1}}handleError(e,t){const r=t.name;throw new Error(`Xatolik Excel.${r} metodida yuz berdi: ${rr(e)}`)}},e.FileType=nr,e.Gsm=Gt,e.IndexMapper=Wt,e.StyledLogger=class{static getStyle(e){switch(e){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(e,t="",...r){if(i())console.log(`%c${t}`,this.getStyle(e),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[e]}[${e.toUpperCase()}] ${t}[0m`,...r)}}static info(e,...t){this.log("info",e,...t)}static warn(e,...t){this.log("warn",e,...t)}static error(e,...t){this.log("error",e,...t)}static success(e,...t){this.log("success",e,...t)}static debug(e,...t){this.log("debug",e,...t)}},e.axiosErrorHandler=(e,t=!0)=>r=>{const n=(r.message||"").trim();r.message="";const o=rr(r).trim()||n,a={error:o,data:r.response?.data,status:r.response?.status,statusText:r.response?.statusText,type:"ERROR"};return e?.(r,o),t?Promise.reject(a):Promise.resolve(a)},e.axiosSuccessHandler=e=>t=>(e?.(t.data),{...t,type:"SUCCESS"}),e.buildTableRows=(e,t,r=!1,n)=>{const o=[],a=[],s=[],i=Object.keys(t);for(const e of i){const n=t[e],o="string"==typeof n,i=Array.isArray(n),c="object"==typeof n&&null!==n&&!i?n.header??e:i&&2===n.length?n[0]:o?n:e;n&&(r&&a.push(c.trim()),s.push(e))}const{extraHeaders:c=[],extraValues:l=[]}=n?n(e):{};return c.length>0&&r&&a.push(...c),e.forEach(((e,r)=>{const n=s.map((r=>{const n=t[r],o=Array.isArray(n),a="object"==typeof n&&null!==n&&!o?n:"function"==typeof n?{mapper:n}:o&&2===n.length?{header:n[0],mapper:n[1]}:{emptyVal:null},s=a.staticVal?a.staticVal:Yt(e,r),i=s||"number"==typeof s?s:a.emptyVal;return a.mapper?a.mapper(i,e,r):"object"==typeof i&&null!==i?JSON.stringify(i):i})),a=l[r]||[];a.length>0&&n.push(...a),o.push(n)})),r&&o.unshift(a),o},e.checkEnvironment=l,e.clearHeaders=w,e.convertBase64ToFile=(e,t="converted_file",r)=>{l("frontend");const n=or[nr[r]];if(!n)throw new Error(`Invalid file type: ${r}`);const{mimeType:o,extension:a}=n,s=e.replace(/^data:.*;base64,/,""),i=window.atob(s),c=i.length,u=new Uint8Array(c);for(let e=0;e<c;e++)u[e]=i.charCodeAt(e);const f=new Blob([u],{type:o});Kt(f,`${t}.${a}`)},e.convertDigitalSize=(e,t,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[e]||!n[t])throw new Error("Invalid unit");return parseFloat((r*n[e]/n[t]).toFixed(2))},e.copyToClipboard=async e=>{l("frontend"),await navigator.clipboard.writeText(e)},e.debounce=(e,t=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const s=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(e(...o))}),t),s&&a(e(...o))}))},e.delay=e=>new Promise((t=>setTimeout(t,e))),e.delayRun=function(e,t){return new Promise((r=>{setTimeout((async()=>{if(t)try{const e=await t();r(e)}catch(e){throw e}r(null)}),e)}))},e.extractErrorMessage=rr,e.extractErrorMessages=(e,t=[])=>{const r=[...Zt,...t];if(!e)return[];const n=Qt("string"==typeof e?e:e?.response?.data||e?.data||e);return tr(n,r)},e.fileConfigs=or,e.formatCurrencyPrice=(e,t,r="en-US")=>e?.toLocaleString(r,{style:"currency",currency:t}),e.formatDateLocaleString=(e,t="en-GB",r="Asia/Tashkent")=>new Date(e).toLocaleString(t,{timeZone:r}),e.formatDuration=Jt,e.formatJsonForTelegram=e=>{try{"string"==typeof e&&(e=JSON.parse(e));return`<pre>${JSON.stringify(e,null,2)}</pre>`}catch(t){return`<pre>${e}</pre>`}},e.formatStringToFloat=Rt,e.generateAndAssignRandomHeaders=e=>{e.headers=e.headers||{},w(e.headers);const t=$();return Object.assign(e.headers,t),e},e.generateIdempotencyKey=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),e.generateRandomHeaders=$,e.generateUserAgents=x,e.getColumnIndex=Lt,e.getColumnName=Bt,e.getFormattedDate=It,e.getLocalIP=async()=>"127.0.0.1",e.getNestedValue=Yt,e.getPrimitiveKeys=e=>{const t=new Set,r=[],n=e=>null===e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e||"symbol"==typeof e||void 0===e,o=e=>"function"==typeof e;if(Array.isArray(e))for(const t of e)t&&"object"==typeof t&&!Array.isArray(t)&&r.push({value:t});else e&&"object"==typeof e&&r.push({value:e});for(;r.length;){const{value:e,prefix:a}=r.pop();for(const[s,i]of Object.entries(e)){const e=a?`${a}.${s}`:s;if(!o(i))if(n(i))t.add(e);else if(Array.isArray(i)){if(i.every((e=>n(e)))){t.add(e);continue}for(const t of i)!t||"object"!=typeof t||Array.isArray(t)||o(t)||r.push({value:t,prefix:e})}else"object"==typeof i&&null!==i&&r.push({value:i,prefix:e})}}return[...t]},e.getRandomInt=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),e.getValidDate=(e,t)=>a.default(e,t).toDate(),e.getValueByName=function(e=[],t,r=null){if(!Array.isArray(e))return r;const n=Lt(t);return kt(e,`[${n}]`,r)},e.headerRandomizer=(e={})=>{w(e);const t=$();return Object.assign(e,t),e},e.isBrowser=i,e.isIndianFormat=Ft,e.isNode=c,e.measureExecutionTime=(e,t="Execution",r)=>{const n=new Date;console.log(`[${t}] Boshladi: ${It(n)}`);const o=e(),a=e=>{const o=e.getTime()-n.getTime();console.log(`[${t}] Tugadi: ${It(e)}`),console.log(`[${t}] Davomiyligi: ${Jt(o,r)}`)};return o instanceof Promise?o.then((e=>(a(new Date),e))):(a(new Date),o)},e.objectItemToArray=(e,t,r=null)=>t.map((t=>{const n=Yt(e,t);return n||"number"==typeof n?n:r})),e.objectToArray=(e,t,r=[],n=null)=>{const o=[];return r.length>0&&o.push(r.map((e=>e.trim()||n))),e.forEach((e=>{const r=t.map((t=>{const r=Yt(e,t);return r||"number"==typeof r?r:n}));o.push(r)})),o},e.parseEuropeanFormat=Dt,e.parseIndianFormat=Pt,e.parseSeparatedNumber=e=>{const t=Number(e?.replace(/,/g,""));return isNaN(t)?0:t},e.rand=y,e.randIp=b,e.resolveHeaderColumn=(e,t,r="")=>{const n=e.indexOf(t);return-1===n?r:Bt(n)},e.resolveHeaderColumnMap=qt,e.saveFile=Kt,e.scrollToElement=e=>{l("frontend");const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth"})},e.stripHtmlTags=Ut,e.toMilliseconds=e=>{const{milliseconds:t=0,seconds:r=0,minutes:n=0,hours:o=0,days:a=0,weeks:s=0,months:i=0,years:c=0}=e,l=36e5,u=864e5;return t+1e3*r+6e4*n+o*l+a*u+6048e5*s+2630016e3*i+315576e5*c},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("moment"),require("lodash"),require("exceljs")):"function"==typeof define&&define.amd?define(["exports","moment","lodash","exceljs"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).utilzify={},e.moment,e.lodash,e.ExcelJS)}(this,(function(e,t,r,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(t),s=o(n);const i=()=>"undefined"!=typeof window&&"undefined"!=typeof document,c=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),l=e=>{const t=i(),r=c();if("frontend"===e&&!t)throw new Error("This function can only be used in a frontend environment.");if("backend"===e&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===e?t:r},u=[{name:"Chrome",tokens:["Chrome","Safari"],prefix:"Mozilla/5.0"},{name:"Firefox",tokens:["Gecko"],prefix:"Mozilla/5.0"},{name:"Opera",tokens:["Presto"],prefix:"Opera/9.80"},{name:"Edge",tokens:["Edg"],prefix:"Mozilla/5.0"},{name:"Safari",tokens:["Version","Safari"],prefix:"Mozilla/5.0"},{name:"IE",tokens:["MSIE","Trident"],prefix:"Mozilla/4.0"}],f=["Windows NT 10.0","Windows NT 6.1","Windows 3.1","Macintosh; Intel Mac OS X 10_15_7","X11; Linux x86_64","X11; Ubuntu; Linux i686","Android 12; Mobile","Android 11; Tablet","iPhone; CPU iPhone OS 16_6 like Mac OS X","iPad; CPU OS 15_4 like Mac OS X"],d=["en","ru","de","fr","es","it","pl","ko","ja","tr"],p=["Trident","Gecko","Presto","Blink"],m=["WOW64","Win64; x64",".NET CLR 3.5.30729","SLCC2","InfoPath.3","Media Center PC 6.0","Tablet PC 2.0"],h=["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","application/json, text/plain, */*"],y=["google.com","bing.com","yandex.ru","duckduckgo.com","example.com","wikipedia.org"],g=e=>e[Math.floor(Math.random()*e.length)],v=()=>`${g([13,14,15,16,17,18,19,20])}.${Math.floor(256*Math.random())}.${Math.floor(256*Math.random())}.${Math.floor(1+254*Math.random())}`,b=(e=15)=>`${Math.floor(Math.random()*e)+1}.${Math.floor(10*Math.random())}`,x=e=>{const t=[];for(let r=0;r<e;r++){const e=g(u),r=g(f),n=g(d),o=g(p),a=b(),s=g(e.tokens),i=Math.random()>.5?`; ${g(m)}`:"",c="IE"===e.name?`${e.prefix} (compatible; ${s} ${a}; ${r}${i}; ${n})`:`${e.prefix} (${r}${i}; ${n}) ${s}/${a} ${o}/${b(5)}`;t.push(c)}return Array.from(new Set(t))},_=(e={},t=[])=>{const r=new Set(["host","connection","content-length","sec-ch-ua-platform","sec-ch-ua","sec-ch-ua-mobile","user-agent","origin","sec-fetch-site","sec-fetch-mode","sec-fetch-dest","referer","cookie","accept-encoding","if-none-match",...t.map((e=>e.toLowerCase()))]);for(const t of Object.keys(e)){const n=t.toLowerCase(),o=n.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("-");(r.has(n)||r.has(o.toLowerCase()))&&delete e[t]}return e},w=x(200),$=()=>{const e={},t=!i();return e.Accept||(e.Accept=g(h)),e.Connection||(e.Connection="keep-alive"),e["User-Agent"]||e["user-agent"]||!t||(e["User-Agent"]=g(w)),!e.Referer&&t&&(e.Referer=(()=>{const e=g(y),t=g(["","search","images","news","video","docs"]),r=Math.random()>.5?`?q=test${Math.floor(1e3*Math.random())}`:"";return`${Math.random()>.5?"https":"http"}://www.${e}/${t}${r}`})()),!e["X-Forwarded-For"]&&t&&(e["X-Forwarded-For"]=v()),!e["Cache-Control"]&&t&&(e["Cache-Control"]="max-age=0"),e};var S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j=Array.isArray,E="object"==typeof S&&S&&S.Object===Object&&S,M="object"==typeof self&&self&&self.Object===Object&&self,C=E||M||Function("return this")(),T=C.Symbol,O=T,N=Object.prototype,k=N.hasOwnProperty,F=N.toString,P=O?O.toStringTag:void 0;var D=function(e){var t=k.call(e,P),r=e[P];try{e[P]=void 0;var n=!0}catch(e){}var o=F.call(e);return n&&(t?e[P]=r:delete e[P]),o},R=Object.prototype.toString;var I=D,U=function(e){return R.call(e)},z=T?T.toStringTag:void 0;var B=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":z&&z in Object(e)?I(e):U(e)};var L=B,W=function(e){return null!=e&&"object"==typeof e};var V=function(e){return"symbol"==typeof e||W(e)&&"[object Symbol]"==L(e)},q=j,H=V,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/;var J=function(e,t){if(q(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!H(e))||(G.test(e)||!X.test(e)||null!=t&&e in Object(t))};var Y=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},K=B,Z=Y;var Q,ee=function(e){if(!Z(e))return!1;var t=K(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},te=C["__core-js_shared__"],re=(Q=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||""))?"Symbol(src)_1."+Q:"";var ne=function(e){return!!re&&re in e},oe=Function.prototype.toString;var ae=ee,se=ne,ie=Y,ce=function(e){if(null!=e){try{return oe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},le=/^\[object .+?Constructor\]$/,ue=Function.prototype,fe=Object.prototype,de=ue.toString,pe=fe.hasOwnProperty,me=RegExp("^"+de.call(pe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var he=function(e){return!(!ie(e)||se(e))&&(ae(e)?me:le).test(ce(e))},ye=function(e,t){return null==e?void 0:e[t]};var ge=function(e,t){var r=ye(e,t);return he(r)?r:void 0},ve=ge(Object,"create"),be=ve;var xe=function(){this.__data__=be?be(null):{},this.size=0};var _e=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},we=ve,$e=Object.prototype.hasOwnProperty;var Se=function(e){var t=this.__data__;if(we){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return $e.call(t,e)?t[e]:void 0},Ae=ve,je=Object.prototype.hasOwnProperty;var Ee=ve;var Me=xe,Ce=_e,Te=Se,Oe=function(e){var t=this.__data__;return Ae?void 0!==t[e]:je.call(t,e)},Ne=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ee&&void 0===t?"__lodash_hash_undefined__":t,this};function ke(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ke.prototype.clear=Me,ke.prototype.delete=Ce,ke.prototype.get=Te,ke.prototype.has=Oe,ke.prototype.set=Ne;var Fe=ke;var Pe=function(){this.__data__=[],this.size=0};var De=function(e,t){return e===t||e!=e&&t!=t};var Re=function(e,t){for(var r=e.length;r--;)if(De(e[r][0],t))return r;return-1},Ie=Re,Ue=Array.prototype.splice;var ze=Re;var Be=Re;var Le=Re;var We=Pe,Ve=function(e){var t=this.__data__,r=Ie(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ue.call(t,r,1),--this.size,!0)},qe=function(e){var t=this.__data__,r=ze(t,e);return r<0?void 0:t[r][1]},He=function(e){return Be(this.__data__,e)>-1},Xe=function(e,t){var r=this.__data__,n=Le(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ge(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ge.prototype.clear=We,Ge.prototype.delete=Ve,Ge.prototype.get=qe,Ge.prototype.has=He,Ge.prototype.set=Xe;var Je=Ge,Ye=ge(C,"Map"),Ke=Fe,Ze=Je,Qe=Ye;var et=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var tt=function(e,t){var r=e.__data__;return et(t)?r["string"==typeof t?"string":"hash"]:r.map},rt=tt;var nt=tt;var ot=tt;var at=tt;var st=function(){this.size=0,this.__data__={hash:new Ke,map:new(Qe||Ze),string:new Ke}},it=function(e){var t=rt(this,e).delete(e);return this.size-=t?1:0,t},ct=function(e){return nt(this,e).get(e)},lt=function(e){return ot(this,e).has(e)},ut=function(e,t){var r=at(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function ft(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ft.prototype.clear=st,ft.prototype.delete=it,ft.prototype.get=ct,ft.prototype.has=lt,ft.prototype.set=ut;var dt=ft;function pt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=e.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(pt.Cache||dt),r}pt.Cache=dt;var mt=pt;var ht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yt=/\\(\\)?/g,gt=function(e){var t=mt(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ht,(function(e,r,n,o){t.push(n?o.replace(yt,"$1"):r||e)})),t}));var vt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},bt=j,xt=V,_t=T?T.prototype:void 0,wt=_t?_t.toString:void 0;var $t=function e(t){if("string"==typeof t)return t;if(bt(t))return vt(t,e)+"";if(xt(t))return wt?wt.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},St=$t;var At=j,jt=J,Et=gt,Mt=function(e){return null==e?"":St(e)};var Ct=V;var Tt=function(e,t){return At(e)?e:jt(e,t)?[e]:Et(Mt(e))},Ot=function(e){if("string"==typeof e||Ct(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var Nt=function(e,t){for(var r=0,n=(t=Tt(t,e)).length;null!=e&&r<n;)e=e[Ot(t[r++])];return r&&r==n?e:void 0};var kt=A((function(e,t,r){var n=null==e?void 0:Nt(e,t);return void 0===n?r:n}));const Ft=e=>/^(\d{1,3}(,\d{2})*(\.\d+)?)$/.test(e)||/^(\d{1,3}(,\d{3})*(\.\d+)?)$/.test(e),Pt=e=>parseFloat(e.replace(/,/g,"")),Dt=e=>parseFloat(e.replace(/\./g,"").replace(",",".")),Rt=(e,t=0)=>null==e?t:"number"==typeof e?e:e&&"string"==typeof e&&/[\d,.]/.test(e)?(e=e.replace(/\s/g,"").trim(),Ft(e)?Pt(e):e.includes(",")?Dt(e):e.includes(".")||!e.includes(",")?parseFloat(e.replace(/,/g,"")):t):t,It=(e=Date.now(),t="DD/MM/YYYY HH:mm:ss")=>{const r=a.default(e);return r.isValid()?r.format(t):""},Ut=e=>e.replace(/<[^>]*>/g,"").trim(),zt={columnIndexCache:new Map,columnNameCache:new Map};function Bt(e){const t=e.toUpperCase();if(zt.columnIndexCache.has(t))return zt.columnIndexCache.get(t);let r=0;for(let e=0;e<t.length;e++)r=26*r+(t.charCodeAt(e)-65+1);const n=r-1;return zt.columnIndexCache.set(t,n),n}function Lt(e){if(zt.columnNameCache.has(e))return zt.columnNameCache.get(e);let t="";for(;e>=0;){const r=e%26;t=String.fromCharCode(65+r)+t,e=Math.floor(e/26)-1}return zt.columnNameCache.set(e,t),t}const Wt={getStr(e=[],t,r=""){const n=kt(e,`[${t}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(e=[],t,r=0){const n=String(kt(e,`[${t}]`,"")).replace(/\s/g,"");if(!n)return r;const o=Number(n);return isNaN(o)?r:o},getBool(e=[],t,r=!1){if(!Array.isArray(e))return r;const n=kt(e,`[${t}]`,r);return["TRUE","FALSE"].includes(n)?"TRUE"===n:"boolean"==typeof n?n:r},getPrice(e=[],t){const r=this.getStr(e,t);if(!r)return 0;const n=Rt(r);return isNaN(n)?0:n},getDate(e=[],t,r){const n=this.getStr(e,t);if(!n)return null;return a.default(n,r).toDate()},getDateFormatted(e=[],t,r,n){const o=this.getStr(e,t);if(!o)return null;const s=a.default(o,n);return r?It(s.toDate(),r):It(s.toDate())}},Vt={getStr(e=[],t,r=""){const n=Bt(t),o=kt(e,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(e=[],t,r=0){const n=Bt(t),o=String(kt(e,`[${n}]`,"")).replace(/\s/g,"");if(!o)return r;const a=Number(o);return isNaN(a)?r:a},getBool(e=[],t,r=!1){const n=Bt(t);if(!Array.isArray(e))return r;const o=kt(e,`[${n}]`,r);return["TRUE","FALSE"].includes(o)?"TRUE"===o:"boolean"==typeof o?o:r},getPrice(e=[],t){const r=this.getStr(e,t);if(!r)return 0;const n=Rt(r);return isNaN(n)?0:n},getDate(e=[],t,r){const n=this.getStr(e,t);if(!n)return null;return a.default(n,r).toDate()},getDateFormatted(e=[],t,r,n){const o=this.getStr(e,t);if(!o)return null;const s=a.default(o,n);return r?It(s.toDate(),r):It(s.toDate())}},qt=(e,t)=>{const r={},n=Object.entries(t);for(let t=0;t<e.length;t++){const o=e[t];for(const[e,a]of n){if(void 0!==r[e])continue;o===(Array.isArray(a)?a[0]:a)&&(r[e]=Lt(t))}}return n.forEach((([e,t])=>{const n=Array.isArray(t)?t[1]:null,o=r[e];n&&void 0===o&&(r[e]=n)})),r},Ht={getStr(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Bt(t),s=r.get(e,`[${a}]`,o);return"number"==typeof s?String(s):s?String(s).trim():o},getNum(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Bt(t),s=String(r.get(e,`[${a}]`)).replace(/\s/g,"");if(!s)return o;const i=Number(s);return isNaN(i)?o:i},getBool(e,t,n){const o=n??null;if(!Array.isArray(e))return o;const a=Bt(t),s=r.get(e,`[${a}]`);return s?["TRUE","FALSE"].includes(String(s).trim().toUpperCase())?"TRUE"===s:Boolean(s):o},getPrice(e,t,r){const n=r??null;if(!Array.isArray(e))return n;const o=this.getStr(e,t);if(!o)return n;const a=Rt(o);return isNaN(a)?n:a},getDate(e,t,r,n){const o=n??null;if(!Array.isArray(e))return o;const s=this.getStr(e,t);if(!s)return o;const i=a.default(s,r);return i.isValid()?i.toDate():o},getDateFormatted(e,t,r,n,o){const s=o??null;if(!Array.isArray(e))return s;const i=this.getStr(e,t);if(!i)return s;const c=a.default(i,r);return c.isValid()?It(c.toDate(),n):s}},Xt=(e,t,r)=>{switch(e._t){case"str":return Ht.getStr(r,t,e.def);case"num":return Ht.getNum(r,t,e.def);case"bool":return Ht.getBool(r,t,e.def);case"price":return Ht.getPrice(r,t,e.def);case"date":return Ht.getDate(r,t,e.fmt);case"datefmt":return Ht.getDateFormatted(r,t,e.parseFmt,e.returnFmt)}};var Gt=Object.freeze({__proto__:null,col:{str:(e,t)=>({_t:"str",col:e,def:t}),num:(e,t)=>({_t:"num",col:e,def:t}),bool:(e,t)=>({_t:"bool",col:e,def:t}),price:(e,t)=>({_t:"price",col:e,def:t}),date:(e,t)=>({_t:"date",col:e,fmt:t}),datefmt:(e,t,r)=>({_t:"datefmt",col:e,parseFmt:t,returnFmt:r}),fn:e=>({_t:"fn",fn:e})},hdr:{str:(e,t)=>({_t:"str",header:e,def:t}),num:(e,t)=>({_t:"num",header:e,def:t}),bool:(e,t)=>({_t:"bool",header:e,def:t}),price:(e,t)=>({_t:"price",header:e,def:t}),date:(e,t)=>({_t:"date",header:e,fmt:t}),datefmt:(e,t,r)=>({_t:"datefmt",header:e,parseFmt:t,returnFmt:r}),fn:e=>({_t:"fn",fn:e})},createColMapper:e=>t=>{const r={};for(const n in e){const o=e[n];r[n]="fn"===o._t?o.fn(t):Xt(o,o.col,t)}return r},createHdrMapper:e=>{const t={};for(const r in e){const n=e[r];"fn"!==n._t&&(t[r]=n.header)}return r=>{const n=qt(r,t);return t=>{const r={};for(const o in e){const a=e[o];"fn"===a._t?r[o]=a.fn(t):r[o]=Xt(a,n[o]??"",t)}return r}}}});const Jt=(e,t)=>{const r=Math.floor(e/1e3),n=Math.floor(r/60),o=Math.floor(n/60),a=r%60;switch(t){case"ms":return`${e} millisoniya`;case"s":return`${(e/1e3).toFixed(2)} soniya`;case"min":return`${(e/6e4).toFixed(2)} daqiqa`;default:return`${o>0?`${o} soat `:""}${n%60>0?n%60+" daqiqa ":""}${(a>0?`${a} soniya`:"")||"0 soniya"}`.trim()}},Yt=(e,t)=>{const r=t.split(".");let n=e;for(const e of r){if(!n&&"number"!=typeof n)return null;n=n[e]}return n},Kt=(e,t)=>{if(l("frontend"),window.navigator){const r=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=r,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},Zt=["err.cause.message","cause.message","cause.stack","detailMessage","error_description","error.message","description","msg","message","error","errors","errorDetails","errorMessage","error_type","errorMsg","errorMessages","error_info","error_info.message","error_info.error_message","error_info.details","data.message","response.message","response.error_message","response.details","httpError","validationError","status_description","messages","alert_message","alert","userMessage","user_error","client_error","response.data.error","response.data.message","response.data.error_description","response.data.details","errorMessages[*].message","errors[*].msg","errors[*].message","[*].msg","[*].message"],Qt=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}return e},er=(e,t,r=0,n=5)=>{if(r>n||"object"!=typeof e||null===e)return null;for(const o of t){const a=o.split(".");let s=e;for(const e of a){if(null==s)break;if("[*]"===e){if(Array.isArray(s)){for(const t of s){const o=er(t,[a.slice(a.indexOf(e)+1).join(".")],r+1,n);if(o)return o}s=null;break}s=null;break}if(e.endsWith("]")){const t=e.match(/(\w+)\[(\d+)\]/);if(t){const[,e,r]=t;s=s?.[e]?.[Number(r)]}else s=s?.[e]}else s=s?.[e]}if(s=Qt(s),Array.isArray(s)){const e=s.map((e=>"string"==typeof e?e:e?.message||e?.msg||"")).filter(Boolean).join("\n");if(e)return e}if("string"==typeof s)return Ut(s);if("object"==typeof s&&null!==s){const e=er(s,t,r+1,n);if(e)return e}}return null},tr=(e,t,r=0,n=5)=>{if(r>n||"object"!=typeof e||null===e)return[];const o=[];for(const a of t){const s=a.split(".");let i=e;for(let e=0;e<s.length;e++){const t=s[e];if(null==i)break;if("[*]"===t){if(Array.isArray(i)){const t=s.slice(e+1).join(".");for(const e of i)o.push(...tr(e,[t],r+1,n))}i=null;break}if(t.endsWith("]")){const e=t.match(/(\w+)\[(\d+)\]/);if(e){const[,t,r]=e;i=i?.[t]?.[Number(r)]}else i=i?.[t]}else i=i?.[t]}if(i=Qt(i),"string"==typeof i)o.push(Ut(i));else if(Array.isArray(i)){for(const e of i)if("string"==typeof e)o.push(Ut(e));else if("object"==typeof e){const a=e?.message||e?.msg;"string"==typeof a?o.push(Ut(a)):o.push(...tr(e,t,r+1,n))}}else"object"==typeof i&&o.push(...tr(i,t,r+1,n))}return o},rr=(e,t="",r=[])=>{const n=[...r,...Zt];if(!e)return t;if("string"==typeof e){const r=Qt(e);return"object"==typeof r?er(r,n)||t:Ut(e)}const o=Qt(e?.response?.data||e?.data||e),a=er(o,n)||e?.message;return Ut(a||"").trim()||t},nr={PDF:"pdf",PNG:"image/png",JPEG:"image/jpeg",EXCEL:"excel",WORD:"word",TEXT:"text"},or={[nr.PDF]:{mimeType:"application/pdf",extension:"pdf"},[nr.PNG]:{mimeType:"image/png",extension:"png"},[nr.JPEG]:{mimeType:"image/jpeg",extension:"jpg"},[nr.EXCEL]:{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extension:"xlsx"},[nr.WORD]:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extension:"docx"},[nr.TEXT]:{mimeType:"text/plain",extension:"txt"}};e.ColumnMapper=Vt,e.ColumnParser=Ht,e.Excel=class{constructor(){l("frontend")}async readFromArrayBuffer(e,t){try{let r;r=e instanceof Buffer?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):await e.arrayBuffer();const n=new s.default.Workbook;await n.xlsx.load(r);const o=n.getWorksheet(t),a=[];return o?(o.eachRow({includeEmpty:!0},(e=>{const t=[];e.eachCell({includeEmpty:!0},(e=>{t.push(void 0!==e.value?e.value:null)})),a.push(t)})),a):[]}catch(e){return[]}}async read(e,t=1){try{const r=new s.default.Workbook;await r.xlsx.readFile(e);const n=r.getWorksheet(t);if(!n)throw new Error(`Excelda ${t}-raqamli jadval topilmadi. Iltimos, faylda ushbu jadval mavjudligini tekshiring.`);const o=[];return n.eachRow({includeEmpty:!0},(e=>{const t=[];e.eachCell({includeEmpty:!0},(e=>{t.push(void 0!==e.value?e.value:null)})),o.push(t)})),o}catch(e){return this.handleError(e,this.read),[]}}async write(e,t,r,n="file",o="Sheet1",a=""){try{const i=new s.default.Workbook,c=i.addWorksheet(o);c.addRow(t),e.forEach((e=>{const t=r.map((t=>{const r=Yt(e,t);return!(null==r||"null"===r||"undefined"===r||"NaN"===r||"number"==typeof r&&isNaN(r))?r:a}));c.addRow(t)}));const l=`${n}_${(new Date).toISOString().slice(0,10)}.xlsx`,u=await i.xlsx.writeBuffer(),f=new Blob([u],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});return await Kt(f,l),!0}catch(e){return this.handleError(e,this.write),!1}}async writeFromArray(e,t=[],r="file",n="Sheet1",o=""){try{const a=new s.default.Workbook,i=a.addWorksheet(n);t.length>0&&i.addRow(t),e.forEach((e=>{const t=e.map((e=>null==e||"null"===e||"undefined"===e||"NaN"===e||"number"==typeof e&&isNaN(e)?o:e));i.addRow(t)}));const c=`${r}_${(new Date).toISOString().slice(0,10)}.xlsx`,l=await a.xlsx.writeBuffer(),u=new Blob([l],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});return await Kt(u,c),!0}catch(e){return this.handleError(e,this.writeFromArray),!1}}handleError(e,t){const r=t.name;throw new Error(`Xatolik Excel.${r} metodida yuz berdi: ${rr(e)}`)}},e.FileType=nr,e.Gsm=Gt,e.IndexMapper=Wt,e.axiosErrorHandler=(e,t=!0)=>r=>{const n=(r.message||"").trim();r.message="";const o=rr(r).trim()||n,a={error:o,data:r.response?.data,status:r.response?.status,statusText:r.response?.statusText,type:"ERROR"};return e?.(r,o),t?Promise.reject(a):Promise.resolve(a)},e.axiosSuccessHandler=e=>t=>(e?.(t.data),{...t,type:"SUCCESS"}),e.buildTableRows=(e,t,r=!1,n)=>{const o=[],a=[],s=[],i=Object.keys(t);for(const e of i){const n=t[e],o="string"==typeof n,i=Array.isArray(n),c="object"==typeof n&&null!==n&&!i?n.header??e:i&&2===n.length?n[0]:o?n:e;n&&(r&&a.push(c.trim()),s.push(e))}const{extraHeaders:c=[],extraValues:l=[]}=n?n(e):{};return c.length>0&&r&&a.push(...c),e.forEach(((e,r)=>{const n=s.map((r=>{const n=t[r],o=Array.isArray(n),a="object"==typeof n&&null!==n&&!o?n:"function"==typeof n?{mapper:n}:o&&2===n.length?{header:n[0],mapper:n[1]}:{emptyVal:null},s=a.staticVal?a.staticVal:Yt(e,r),i=s||"number"==typeof s?s:a.emptyVal;return a.mapper?a.mapper(i,e,r):"object"==typeof i&&null!==i?JSON.stringify(i):i})),a=l[r]||[];a.length>0&&n.push(...a),o.push(n)})),r&&o.unshift(a),o},e.checkEnvironment=l,e.clearHeaders=_,e.convertBase64ToFile=(e,t="converted_file",r)=>{l("frontend");const n=or[nr[r]];if(!n)throw new Error(`Invalid file type: ${r}`);const{mimeType:o,extension:a}=n,s=e.replace(/^data:.*;base64,/,""),i=window.atob(s),c=i.length,u=new Uint8Array(c);for(let e=0;e<c;e++)u[e]=i.charCodeAt(e);const f=new Blob([u],{type:o});Kt(f,`${t}.${a}`)},e.convertDigitalSize=(e,t,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[e]||!n[t])throw new Error("Invalid unit");return parseFloat((r*n[e]/n[t]).toFixed(2))},e.debounce=(e,t=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const s=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(e(...o))}),t),s&&a(e(...o))}))},e.delay=e=>new Promise((t=>setTimeout(t,e))),e.delayRun=function(e,t){return new Promise((r=>{setTimeout((async()=>{if(t)try{const e=await t();r(e)}catch(e){throw e}r(null)}),e)}))},e.extractErrorMessage=rr,e.extractErrorMessages=(e,t=[])=>{const r=[...Zt,...t];if(!e)return[];const n=Qt("string"==typeof e?e:e?.response?.data||e?.data||e);return tr(n,r)},e.fileConfigs=or,e.formatCurrencyPrice=(e,t,r="en-US")=>e?.toLocaleString(r,{style:"currency",currency:t}),e.formatDateLocaleString=(e,t="en-GB",r="Asia/Tashkent")=>new Date(e).toLocaleString(t,{timeZone:r}),e.formatDuration=Jt,e.formatJsonForTelegram=e=>{try{"string"==typeof e&&(e=JSON.parse(e));return`<pre>${JSON.stringify(e,null,2)}</pre>`}catch(t){return`<pre>${e}</pre>`}},e.formatStringToFloat=Rt,e.generateAndAssignRandomHeaders=e=>{e.headers=e.headers||{},_(e.headers);const t=$();return Object.assign(e.headers,t),e},e.generateIdempotencyKey=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),e.generateRandomHeaders=$,e.generateUserAgents=x,e.getColumnIndex=Bt,e.getColumnName=Lt,e.getFormattedDate=It,e.getNestedValue=Yt,e.getPrimitiveKeys=e=>{const t=new Set,r=[],n=e=>null===e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e||"symbol"==typeof e||void 0===e,o=e=>"function"==typeof e;if(Array.isArray(e))for(const t of e)t&&"object"==typeof t&&!Array.isArray(t)&&r.push({value:t});else e&&"object"==typeof e&&r.push({value:e});for(;r.length;){const{value:e,prefix:a}=r.pop();for(const[s,i]of Object.entries(e)){const e=a?`${a}.${s}`:s;if(!o(i))if(n(i))t.add(e);else if(Array.isArray(i)){if(i.every((e=>n(e)))){t.add(e);continue}for(const t of i)!t||"object"!=typeof t||Array.isArray(t)||o(t)||r.push({value:t,prefix:e})}else"object"==typeof i&&null!==i&&r.push({value:i,prefix:e})}}return[...t]},e.getRandomInt=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),e.getValidDate=(e,t)=>a.default(e,t).toDate(),e.getValueByName=function(e=[],t,r=null){if(!Array.isArray(e))return r;const n=Bt(t);return kt(e,`[${n}]`,r)},e.headerRandomizer=(e={})=>{_(e);const t=$();return Object.assign(e,t),e},e.isBrowser=i,e.isIndianFormat=Ft,e.isNode=c,e.measureExecutionTime=(e,t="Execution",r)=>{const n=new Date;console.log(`[${t}] Boshladi: ${It(n)}`);const o=e(),a=e=>{const o=e.getTime()-n.getTime();console.log(`[${t}] Tugadi: ${It(e)}`),console.log(`[${t}] Davomiyligi: ${Jt(o,r)}`)};return o instanceof Promise?o.then((e=>(a(new Date),e))):(a(new Date),o)},e.objectItemToArray=(e,t,r=null)=>t.map((t=>{const n=Yt(e,t);return n||"number"==typeof n?n:r})),e.objectToArray=(e,t,r=[],n=null)=>{const o=[];return r.length>0&&o.push(r.map((e=>e.trim()||n))),e.forEach((e=>{const r=t.map((t=>{const r=Yt(e,t);return r||"number"==typeof r?r:n}));o.push(r)})),o},e.parseEuropeanFormat=Dt,e.parseIndianFormat=Pt,e.parseSeparatedNumber=e=>{const t=Number(e?.replace(/,/g,""));return isNaN(t)?0:t},e.rand=g,e.randIp=v,e.resolveHeaderColumn=(e,t,r="")=>{const n=e.indexOf(t);return-1===n?r:Lt(n)},e.resolveHeaderColumnMap=qt,e.saveFile=Kt,e.scrollToElement=e=>{l("frontend");const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth"})},e.stripHtmlTags=Ut,e.toMilliseconds=e=>{const{milliseconds:t=0,seconds:r=0,minutes:n=0,hours:o=0,days:a=0,weeks:s=0,months:i=0,years:c=0}=e,l=36e5,u=864e5;return t+1e3*r+6e4*n+o*l+a*u+6048e5*s+2630016e3*i+315576e5*c},Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./utils/header-generator.js"),r=require("./utils/google-sheets-mappers.js"),t=require("./utils/dom.js"),s=require("./utils/tools.js"),o=require("./utils/excel.js"),a=require("./utils/mappers.js"),i=require("./utils/debounce.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./utils/header-generator.js"),r=require("./utils/google-sheets-mappers.js"),t=require("./utils/dom.js"),s=require("./utils/tools.js"),o=require("./utils/excel.js"),a=require("./utils/mappers.js"),i=require("./utils/debounce.js"),n=require("./utils/objecters.js"),l=require("./utils/save-file.js"),p=require("./utils/column-parser.js"),u=require("./utils/axios-handlers.js"),m=require("./utils/get-random-int.js"),x=require("./utils/idempotency-key.js"),d=require("./utils/to-milliseconds.js"),c=require("./utils/check-environment.js"),g=require("./utils/convert-digital-size.js"),j=require("./utils/extract-error-message.js"),y=require("./utils/convert-base64-to-file.js"),q=require("./utils/format-json-for-telegram.js"),v=require("./helpers/objects.js");exports.clearHeaders=e.clearHeaders,exports.generateAndAssignRandomHeaders=e.generateAndAssignRandomHeaders,exports.generateRandomHeaders=e.generateRandomHeaders,exports.generateUserAgents=e.generateUserAgents,exports.headerRandomizer=e.headerRandomizer,exports.rand=e.rand,exports.randIp=e.randIp,exports.Gsm=r,exports.scrollToElement=t.scrollToElement,exports.delay=s.delay,exports.delayRun=s.delayRun,exports.formatCurrencyPrice=s.formatCurrencyPrice,exports.formatDateLocaleString=s.formatDateLocaleString,exports.formatStringToFloat=s.formatStringToFloat,exports.getFormattedDate=s.getFormattedDate,exports.getValidDate=s.getValidDate,exports.isIndianFormat=s.isIndianFormat,exports.parseEuropeanFormat=s.parseEuropeanFormat,exports.parseIndianFormat=s.parseIndianFormat,exports.parseSeparatedNumber=s.parseSeparatedNumber,exports.stripHtmlTags=s.stripHtmlTags,exports.Excel=o.Excel,exports.ColumnMapper=a.ColumnMapper,exports.IndexMapper=a.IndexMapper,exports.getColumnIndex=a.getColumnIndex,exports.getColumnName=a.getColumnName,exports.getValueByName=a.getValueByName,exports.resolveHeaderColumn=a.resolveHeaderColumn,exports.resolveHeaderColumnMap=a.resolveHeaderColumnMap,exports.debounce=i.debounce,exports.measureExecutionTime=i.measureExecutionTime,exports.buildTableRows=n.buildTableRows,exports.getNestedValue=n.getNestedValue,exports.getPrimitiveKeys=n.getPrimitiveKeys,exports.objectItemToArray=n.objectItemToArray,exports.objectToArray=n.objectToArray,exports.saveFile=l.saveFile,exports.ColumnParser=p.ColumnParser,exports.axiosErrorHandler=u.axiosErrorHandler,exports.axiosSuccessHandler=u.axiosSuccessHandler,exports.getRandomInt=m.getRandomInt,exports.generateIdempotencyKey=x.generateIdempotencyKey,exports.formatDuration=d.formatDuration,exports.toMilliseconds=d.toMilliseconds,exports.checkEnvironment=c.checkEnvironment,exports.isBrowser=c.isBrowser,exports.isNode=c.isNode,exports.convertDigitalSize=g.convertDigitalSize,exports.extractErrorMessage=j.extractErrorMessage,exports.extractErrorMessages=j.extractErrorMessages,exports.convertBase64ToFile=y.convertBase64ToFile,exports.formatJsonForTelegram=q.formatJsonForTelegram,exports.FileType=v.FileType,exports.fileConfigs=v.fileConfigs;
|
package/lib/cjs/utils/index.d.ts
CHANGED
|
@@ -6,10 +6,7 @@ export * from "./excel";
|
|
|
6
6
|
export * from "./mappers";
|
|
7
7
|
export * from "./debounce";
|
|
8
8
|
export * from "./objecters";
|
|
9
|
-
export * from "./clipboard";
|
|
10
9
|
export * from "./save-file";
|
|
11
|
-
export * from "./get-local-ip";
|
|
12
|
-
export * from "./styled-logger";
|
|
13
10
|
export * from "./column-parser";
|
|
14
11
|
export * from "./axios-handlers";
|
|
15
12
|
export * from "./get-random-int";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,yBAAyB,CAAC;AAG/C,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,yBAAyB,CAAC;AAG/C,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC"}
|
package/lib/cjs/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./header-generator.js"),r=require("./google-sheets-mappers.js"),o=require("./dom.js"),t=require("./tools.js"),s=require("./excel.js"),a=require("./mappers.js"),n=require("./debounce.js"),i=require("./objecters.js"),p=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./header-generator.js"),r=require("./google-sheets-mappers.js"),o=require("./dom.js"),t=require("./tools.js"),s=require("./excel.js"),a=require("./mappers.js"),n=require("./debounce.js"),i=require("./objecters.js"),p=require("./save-file.js"),l=require("./column-parser.js"),m=require("./axios-handlers.js"),x=require("./get-random-int.js"),d=require("./idempotency-key.js"),u=require("./to-milliseconds.js"),c=require("./check-environment.js"),g=require("./convert-digital-size.js"),j=require("./extract-error-message.js"),y=require("./convert-base64-to-file.js"),v=require("./format-json-for-telegram.js");exports.clearHeaders=e.clearHeaders,exports.generateAndAssignRandomHeaders=e.generateAndAssignRandomHeaders,exports.generateRandomHeaders=e.generateRandomHeaders,exports.generateUserAgents=e.generateUserAgents,exports.headerRandomizer=e.headerRandomizer,exports.rand=e.rand,exports.randIp=e.randIp,exports.Gsm=r,exports.scrollToElement=o.scrollToElement,exports.delay=t.delay,exports.delayRun=t.delayRun,exports.formatCurrencyPrice=t.formatCurrencyPrice,exports.formatDateLocaleString=t.formatDateLocaleString,exports.formatStringToFloat=t.formatStringToFloat,exports.getFormattedDate=t.getFormattedDate,exports.getValidDate=t.getValidDate,exports.isIndianFormat=t.isIndianFormat,exports.parseEuropeanFormat=t.parseEuropeanFormat,exports.parseIndianFormat=t.parseIndianFormat,exports.parseSeparatedNumber=t.parseSeparatedNumber,exports.stripHtmlTags=t.stripHtmlTags,exports.Excel=s.Excel,exports.ColumnMapper=a.ColumnMapper,exports.IndexMapper=a.IndexMapper,exports.getColumnIndex=a.getColumnIndex,exports.getColumnName=a.getColumnName,exports.getValueByName=a.getValueByName,exports.resolveHeaderColumn=a.resolveHeaderColumn,exports.resolveHeaderColumnMap=a.resolveHeaderColumnMap,exports.debounce=n.debounce,exports.measureExecutionTime=n.measureExecutionTime,exports.buildTableRows=i.buildTableRows,exports.getNestedValue=i.getNestedValue,exports.getPrimitiveKeys=i.getPrimitiveKeys,exports.objectItemToArray=i.objectItemToArray,exports.objectToArray=i.objectToArray,exports.saveFile=p.saveFile,exports.ColumnParser=l.ColumnParser,exports.axiosErrorHandler=m.axiosErrorHandler,exports.axiosSuccessHandler=m.axiosSuccessHandler,exports.getRandomInt=x.getRandomInt,exports.generateIdempotencyKey=d.generateIdempotencyKey,exports.formatDuration=u.formatDuration,exports.toMilliseconds=u.toMilliseconds,exports.checkEnvironment=c.checkEnvironment,exports.isBrowser=c.isBrowser,exports.isNode=c.isNode,exports.convertDigitalSize=g.convertDigitalSize,exports.extractErrorMessage=j.extractErrorMessage,exports.extractErrorMessages=j.extractErrorMessages,exports.convertBase64ToFile=y.convertBase64ToFile,exports.formatJsonForTelegram=v.formatJsonForTelegram;
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{clearHeaders,generateAndAssignRandomHeaders,generateRandomHeaders,generateUserAgents,headerRandomizer,rand,randIp}from"./utils/header-generator.js";import*as e from"./utils/google-sheets-mappers.js";export{e as Gsm};export{scrollToElement}from"./utils/dom.js";export{delay,delayRun,formatCurrencyPrice,formatDateLocaleString,formatStringToFloat,getFormattedDate,getValidDate,isIndianFormat,parseEuropeanFormat,parseIndianFormat,parseSeparatedNumber,stripHtmlTags}from"./utils/tools.js";export{Excel}from"./utils/excel.js";export{ColumnMapper,IndexMapper,getColumnIndex,getColumnName,getValueByName,resolveHeaderColumn,resolveHeaderColumnMap}from"./utils/mappers.js";export{debounce,measureExecutionTime}from"./utils/debounce.js";export{buildTableRows,getNestedValue,getPrimitiveKeys,objectItemToArray,objectToArray}from"./utils/objecters.js";export{
|
|
1
|
+
export{clearHeaders,generateAndAssignRandomHeaders,generateRandomHeaders,generateUserAgents,headerRandomizer,rand,randIp}from"./utils/header-generator.js";import*as e from"./utils/google-sheets-mappers.js";export{e as Gsm};export{scrollToElement}from"./utils/dom.js";export{delay,delayRun,formatCurrencyPrice,formatDateLocaleString,formatStringToFloat,getFormattedDate,getValidDate,isIndianFormat,parseEuropeanFormat,parseIndianFormat,parseSeparatedNumber,stripHtmlTags}from"./utils/tools.js";export{Excel}from"./utils/excel.js";export{ColumnMapper,IndexMapper,getColumnIndex,getColumnName,getValueByName,resolveHeaderColumn,resolveHeaderColumnMap}from"./utils/mappers.js";export{debounce,measureExecutionTime}from"./utils/debounce.js";export{buildTableRows,getNestedValue,getPrimitiveKeys,objectItemToArray,objectToArray}from"./utils/objecters.js";export{saveFile}from"./utils/save-file.js";export{ColumnParser}from"./utils/column-parser.js";export{axiosErrorHandler,axiosSuccessHandler}from"./utils/axios-handlers.js";export{getRandomInt}from"./utils/get-random-int.js";export{generateIdempotencyKey}from"./utils/idempotency-key.js";export{formatDuration,toMilliseconds}from"./utils/to-milliseconds.js";export{checkEnvironment,isBrowser,isNode}from"./utils/check-environment.js";export{convertDigitalSize}from"./utils/convert-digital-size.js";export{extractErrorMessage,extractErrorMessages}from"./utils/extract-error-message.js";export{convertBase64ToFile}from"./utils/convert-base64-to-file.js";export{formatJsonForTelegram}from"./utils/format-json-for-telegram.js";export{FileType,fileConfigs}from"./helpers/objects.js";
|
package/lib/esm/utils/index.d.ts
CHANGED
|
@@ -6,10 +6,7 @@ export * from "./excel";
|
|
|
6
6
|
export * from "./mappers";
|
|
7
7
|
export * from "./debounce";
|
|
8
8
|
export * from "./objecters";
|
|
9
|
-
export * from "./clipboard";
|
|
10
9
|
export * from "./save-file";
|
|
11
|
-
export * from "./get-local-ip";
|
|
12
|
-
export * from "./styled-logger";
|
|
13
10
|
export * from "./column-parser";
|
|
14
11
|
export * from "./axios-handlers";
|
|
15
12
|
export * from "./get-random-int";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,yBAAyB,CAAC;AAG/C,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,yBAAyB,CAAC;AAG/C,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC"}
|
package/lib/esm/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{clearHeaders,generateAndAssignRandomHeaders,generateRandomHeaders,generateUserAgents,headerRandomizer,rand,randIp}from"./header-generator.js";import*as e from"./google-sheets-mappers.js";export{e as Gsm};export{scrollToElement}from"./dom.js";export{delay,delayRun,formatCurrencyPrice,formatDateLocaleString,formatStringToFloat,getFormattedDate,getValidDate,isIndianFormat,parseEuropeanFormat,parseIndianFormat,parseSeparatedNumber,stripHtmlTags}from"./tools.js";export{Excel}from"./excel.js";export{ColumnMapper,IndexMapper,getColumnIndex,getColumnName,getValueByName,resolveHeaderColumn,resolveHeaderColumnMap}from"./mappers.js";export{debounce,measureExecutionTime}from"./debounce.js";export{buildTableRows,getNestedValue,getPrimitiveKeys,objectItemToArray,objectToArray}from"./objecters.js";export{
|
|
1
|
+
export{clearHeaders,generateAndAssignRandomHeaders,generateRandomHeaders,generateUserAgents,headerRandomizer,rand,randIp}from"./header-generator.js";import*as e from"./google-sheets-mappers.js";export{e as Gsm};export{scrollToElement}from"./dom.js";export{delay,delayRun,formatCurrencyPrice,formatDateLocaleString,formatStringToFloat,getFormattedDate,getValidDate,isIndianFormat,parseEuropeanFormat,parseIndianFormat,parseSeparatedNumber,stripHtmlTags}from"./tools.js";export{Excel}from"./excel.js";export{ColumnMapper,IndexMapper,getColumnIndex,getColumnName,getValueByName,resolveHeaderColumn,resolveHeaderColumnMap}from"./mappers.js";export{debounce,measureExecutionTime}from"./debounce.js";export{buildTableRows,getNestedValue,getPrimitiveKeys,objectItemToArray,objectToArray}from"./objecters.js";export{saveFile}from"./save-file.js";export{ColumnParser}from"./column-parser.js";export{axiosErrorHandler,axiosSuccessHandler}from"./axios-handlers.js";export{getRandomInt}from"./get-random-int.js";export{generateIdempotencyKey}from"./idempotency-key.js";export{formatDuration,toMilliseconds}from"./to-milliseconds.js";export{checkEnvironment,isBrowser,isNode}from"./check-environment.js";export{convertDigitalSize}from"./convert-digital-size.js";export{extractErrorMessage,extractErrorMessages}from"./extract-error-message.js";export{convertBase64ToFile}from"./convert-base64-to-file.js";export{formatJsonForTelegram}from"./format-json-for-telegram.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../src/utils/clipboard.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,SAAgB,MAAM,KAAG,OAAO,CAAC,IAAI,CAGhE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("./header-generator.js"),require("moment"),require("lodash"),require("../node_modules/lodash/_baseGetTag.js"),require("../node_modules/lodash/_stringToPath.js"),require("../node_modules/lodash/_baseToString.js"),require("exceljs");var e=require("./check-environment.js");require("../helpers/objects.js");exports.copyToClipboard=async r=>{e.checkEnvironment("frontend"),await navigator.clipboard.writeText(r)};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-local-ip.d.ts","sourceRoot":"","sources":["../../../src/utils/get-local-ip.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,QAAa,OAAO,CAAC,MAAM,CAejD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.getLocalIP=async()=>"127.0.0.1";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=run-command.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-command.d.ts","sourceRoot":"","sources":["../../../src/utils/run-command.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
type LogType = "log" | "info" | "warn" | "error" | "success" | "debug";
|
|
2
|
-
export declare class StyledLogger {
|
|
3
|
-
private static getStyle;
|
|
4
|
-
static log(type: LogType, message?: string, ...args: unknown[]): void;
|
|
5
|
-
static info(message: string, ...args: unknown[]): void;
|
|
6
|
-
static warn(message: string, ...args: unknown[]): void;
|
|
7
|
-
static error(message: string, ...args: unknown[]): void;
|
|
8
|
-
static success(message: string, ...args: unknown[]): void;
|
|
9
|
-
static debug(message: string, ...args: unknown[]): void;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=styled-logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styled-logger.d.ts","sourceRoot":"","sources":["../../../src/utils/styled-logger.ts"],"names":[],"mappings":"AAEA,KAAK,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvE,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ;WAmBT,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,GAAE,MAAW,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAgBlE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAI/C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAI/C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAIhD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAIlD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAG/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("./header-generator.js"),require("moment"),require("lodash"),require("../node_modules/lodash/_baseGetTag.js"),require("../node_modules/lodash/_stringToPath.js"),require("../node_modules/lodash/_baseToString.js"),require("exceljs");var e=require("./check-environment.js");require("../helpers/objects.js");exports.StyledLogger=class{static getStyle(e){switch(e){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(r,o="",...s){if(e.isBrowser())console.log(`%c${o}`,this.getStyle(r),...s);else{const e={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${e[r]}[${r.toUpperCase()}] ${o}[0m`,...s)}}static info(e,...r){this.log("info",e,...r)}static warn(e,...r){this.log("warn",e,...r)}static error(e,...r){this.log("error",e,...r)}static success(e,...r){this.log("success",e,...r)}static debug(e,...r){this.log("debug",e,...r)}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../src/utils/clipboard.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,SAAgB,MAAM,KAAG,OAAO,CAAC,IAAI,CAGhE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./header-generator.js";import"moment";import"lodash";import"../node_modules/lodash/_baseGetTag.js";import"../node_modules/lodash/_stringToPath.js";import"../node_modules/lodash/_baseToString.js";import"exceljs";import{checkEnvironment as o}from"./check-environment.js";import"../helpers/objects.js";const e=async e=>{o("frontend"),await navigator.clipboard.writeText(e)};export{e as copyToClipboard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-local-ip.d.ts","sourceRoot":"","sources":["../../../src/utils/get-local-ip.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,QAAa,OAAO,CAAC,MAAM,CAejD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const c=async()=>"127.0.0.1";export{c as getLocalIP};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=run-command.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-command.d.ts","sourceRoot":"","sources":["../../../src/utils/run-command.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
type LogType = "log" | "info" | "warn" | "error" | "success" | "debug";
|
|
2
|
-
export declare class StyledLogger {
|
|
3
|
-
private static getStyle;
|
|
4
|
-
static log(type: LogType, message?: string, ...args: unknown[]): void;
|
|
5
|
-
static info(message: string, ...args: unknown[]): void;
|
|
6
|
-
static warn(message: string, ...args: unknown[]): void;
|
|
7
|
-
static error(message: string, ...args: unknown[]): void;
|
|
8
|
-
static success(message: string, ...args: unknown[]): void;
|
|
9
|
-
static debug(message: string, ...args: unknown[]): void;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=styled-logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styled-logger.d.ts","sourceRoot":"","sources":["../../../src/utils/styled-logger.ts"],"names":[],"mappings":"AAEA,KAAK,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvE,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ;WAmBT,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,GAAE,MAAW,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAgBlE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAI/C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAI/C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAIhD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAIlD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAG/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./header-generator.js";import"moment";import"lodash";import"../node_modules/lodash/_baseGetTag.js";import"../node_modules/lodash/_stringToPath.js";import"../node_modules/lodash/_baseToString.js";import"exceljs";import{isBrowser as o}from"./check-environment.js";import"../helpers/objects.js";class e{static getStyle(o){switch(o){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(e,t="",...s){if(o())console.log(`%c${t}`,this.getStyle(e),...s);else{const o={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${o[e]}[${e.toUpperCase()}] ${t}[0m`,...s)}}static info(o,...e){this.log("info",o,...e)}static warn(o,...e){this.log("warn",o,...e)}static error(o,...e){this.log("error",o,...e)}static success(o,...e){this.log("success",o,...e)}static debug(o,...e){this.log("debug",o,...e)}}export{e as StyledLogger};
|