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