@kibalabs/core 0.6.2 → 0.6.3-next.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/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function webpackUniversalModuleDefinition(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define("@kibalabs/core",[],t):"object"===typeof exports?exports["@kibalabs/core"]=t():e["@kibalabs/core"]=t()}(global,(()=>(()=>{var e={374:(e,t,r)=>{"use strict";r.d(t,{N:()=>n.N});var n=r(172)},172:(e,t,r)=>{"use strict";r.d(t,{N:()=>m});var n=r(857),o=r.n(n),a=r(593),i=r.n(a),u=r(322),s=r.n(u),c=r(166),l=r.n(c),f=r(617),p=r.n(f),d=r(783),h=r.n(d),v=r(791),y=r.n(v);function _callSuper(e,t,r){return t=l()(t),s()(e,_isNativeReflectConstruct()?Reflect.construct(t,r||[],l()(e).constructor):t.apply(e,r))}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!e})()}var m=function(e){function KibaException(e,t){var r;return i()(this,KibaException),r=_callSuper(this,KibaException,[e]),y()(r,"statusCode",void 0),r.name=r.constructor.name,r.statusCode=t||500,r}return p()(KibaException,e),o()(KibaException)}(h()(Error))},296:(e,t,r)=>{"use strict";r.d(t,{RK:()=>l,vC:()=>f,D7:()=>b,Qb:()=>_,Wh:()=>n});var n=function(e){return e.DELETE="delete",e.GET="get",e.HEAD="head",e.OPTIONS="options",e.PATCH="patch",e.POST="post",e.PUT="put",e}({}),o=r(857),a=r.n(o),i=r(593),u=r.n(i),s=r(791),c=r.n(s),l=a()((function KibaRequest(e,t,r,n,o,a,i){u()(this,KibaRequest),c()(this,"method",void 0),c()(this,"url",void 0),c()(this,"headers",void 0),c()(this,"data",void 0),c()(this,"formData",void 0),c()(this,"date",void 0),c()(this,"timeoutSeconds",void 0),this.method=e,this.url=t,this.headers=r||{},this.data=n||null,this.formData=o||null,this.date=a||new Date,this.timeoutSeconds=i&&i>0?i:null})),f=a()((function KibaResponse(e,t,r,n){u()(this,KibaResponse),c()(this,"status",void 0),c()(this,"headers",{}),c()(this,"date",void 0),c()(this,"content",""),this.status=e,this.headers=t,this.date=r,this.content=n})),p=r(7),d=r.n(p),h=r(578),v=r.n(h),y=r(172),m=r(888),g=r(391);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _=function(){return a()((function RequesterModifier(){u()(this,RequesterModifier)}),[{key:"modifyRequest",value:function modifyRequest(e){return e}},{key:"modifyResponse",value:function modifyResponse(e){return e}}])}(),b=a()((function Requester(e,t){var r=this,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];u()(this,Requester),c()(this,"headers",void 0),c()(this,"modifiers",void 0),c()(this,"shouldIncludeCrossSiteCredentials",void 0),c()(this,"addModifier",(function(e){r.modifiers.push(e)})),c()(this,"modifyRequest",(function(e){return r.modifiers.reduce((function(e,t){return t.modifyRequest(e)}),e)})),c()(this,"modifyResponse",(function(e){return r.modifiers.reduce((function(e,t){return t.modifyResponse(e)}),e)})),c()(this,"getRequest",function(){var e=d()(v().mark((function _callee(e,t,o,a){var i;return v().wrap((function _callee$(u){for(;;)switch(u.prev=u.next){case 0:return i=new l(n.GET,e,o,t,void 0,new Date,a),u.abrupt("return",r.makeRequestInternal(i));case 2:case"end":return u.stop()}}),_callee)})));return function(t,r,n,o){return e.apply(this,arguments)}}()),c()(this,"postRequest",function(){var e=d()(v().mark((function _callee2(e,t,o,a){var i;return v().wrap((function _callee2$(u){for(;;)switch(u.prev=u.next){case 0:return i=new l(n.POST,e,o,t,void 0,new Date,a),u.abrupt("return",r.makeRequestInternal(i));case 2:case"end":return u.stop()}}),_callee2)})));return function(t,r,n,o){return e.apply(this,arguments)}}()),c()(this,"putRequest",function(){var e=d()(v().mark((function _callee3(e,t,o,a){var i;return v().wrap((function _callee3$(u){for(;;)switch(u.prev=u.next){case 0:return i=new l(n.PUT,e,o,t,void 0,new Date,a),u.abrupt("return",r.makeRequestInternal(i));case 2:case"end":return u.stop()}}),_callee3)})));return function(t,r,n,o){return e.apply(this,arguments)}}()),c()(this,"deleteRequest",function(){var e=d()(v().mark((function _callee4(e,t,o,a){var i;return v().wrap((function _callee4$(u){for(;;)switch(u.prev=u.next){case 0:return i=new l(n.DELETE,e,o,t,void 0,new Date,a),u.abrupt("return",r.makeRequestInternal(i));case 2:case"end":return u.stop()}}),_callee4)})));return function(t,r,n,o){return e.apply(this,arguments)}}()),c()(this,"makeRequest",function(){var e=d()(v().mark((function _callee5(e,t,n,o,a){var i;return v().wrap((function _callee5$(u){for(;;)switch(u.prev=u.next){case 0:return i=new l(e,t,o,n,void 0,new Date,a),u.abrupt("return",r.makeRequestInternal(i));case 2:case"end":return u.stop()}}),_callee5)})));return function(t,r,n,o,a){return e.apply(this,arguments)}}()),c()(this,"makeFormRequest",function(){var e=d()(v().mark((function _callee6(e,t,o,a){var i;return v().wrap((function _callee6$(u){for(;;)switch(u.prev=u.next){case 0:return i=new l(n.POST,e,o,void 0,t,new Date,a),u.abrupt("return",r.makeRequestInternal(i));case 2:case"end":return u.stop()}}),_callee6)})));return function(t,r,n,o){return e.apply(this,arguments)}}()),c()(this,"makeFormPutRequest",function(){var e=d()(v().mark((function _callee7(e,t,o,a){var i;return v().wrap((function _callee7$(u){for(;;)switch(u.prev=u.next){case 0:return i=new l(n.PUT,e,o,void 0,t,new Date,a),u.abrupt("return",r.makeRequestInternal(i));case 2:case"end":return u.stop()}}),_callee7)})));return function(t,r,n,o){return e.apply(this,arguments)}}()),c()(this,"makeRequestInternal",function(){var e=d()(v().mark((function _callee8(e){var t,n,o;return v().wrap((function _callee8$(a){for(;;)switch(a.prev=a.next){case 0:return t=r.modifyRequest(e),a.next=3,r.makeFetchRequest(t);case 3:if(n=a.sent,!((n=r.modifyResponse(n)).status>=400&&n.status<600)){a.next=11;break}o=null;try{o=JSON.parse(n.content)}catch(i){}if(!o||!("message"in o)){a.next=10;break}throw new y.N(o.message,n.status);case 10:throw new y.N(n.content,n.status);case 11:return a.abrupt("return",n);case 12:case"end":return a.stop()}}),_callee8)})));return function(t){return e.apply(this,arguments)}}()),c()(this,"makeFetchRequest",function(){var e=d()(v().mark((function _callee10(e){var t,o,a,i,u,s,c;return v().wrap((function _callee10$(l){for(;;)switch(l.prev=l.next){case 0:return t=new URL(e.url),o=new Headers(_objectSpread(_objectSpread({},r.headers),e.headers||{})),a={method:e.method.toUpperCase(),headers:o,credentials:r.shouldIncludeCrossSiteCredentials?"include":"same-origin"},e.method===n.GET||e.method===n.DELETE?e.data&&(i=_objectSpread({},e.data),Object.keys(i).forEach((function(e){void 0===i[e]&&delete i[e]})),t.search=(0,g.PI)(i).toString()):(u=o.get("Content-Type"),e.data?(a.body=JSON.stringify(e.data),u&&"application/json"!==u&&console.warn("Overwriting content-type header for request from ".concat(u," to application/json")),o.set("content-type","application/json")):e.formData&&(a.body=e.formData)),s=fetch(t.toString(),a).catch((function(e){throw new y.N("The request was made but no response was received: [".concat(e.code,'] "').concat(e.message,'"'))})).then(function(){var e=d()(v().mark((function _callee9(e){var t,r;return v().wrap((function _callee9$(n){for(;;)switch(n.prev=n.next){case 0:if(e){n.next=2;break}throw new y.N("The request was made but no response was received.");case 2:return n.next=4,e.text();case 4:return t=n.sent,r={},e.headers.forEach((function(e,t){r[t]&&console.warn("key ".concat(t," will be overwritten. TODO(krish): Implement joining keys!")),r[t]=e})),n.abrupt("return",new f(e.status,r,new Date,t));case 8:case"end":return n.stop()}}),_callee9)})));return function(t){return e.apply(this,arguments)}}()),l.next=7,e.timeoutSeconds?(0,m.B)(e.timeoutSeconds,s):s;case 7:return c=l.sent,l.abrupt("return",c);case 9:case"end":return l.stop()}}),_callee10)})));return function(t){return e.apply(this,arguments)}}()),this.headers=e||{},this.modifiers=t||[],this.shouldIncludeCrossSiteCredentials=o}))},978:(e,t,r)=>{"use strict";r.d(t,{CN:()=>d,su:()=>h,Nl:()=>v});var n=r(7),o=r.n(n),a=r(857),i=r.n(a),u=r(593),s=r.n(u),c=r(791),l=r.n(c),f=r(578),p=r.n(f),d=i()((function RequestData(){s()(this,RequestData),l()(this,"toObject",(function(){return{}}))})),h=i()((function ResponseData(){s()(this,ResponseData)})),v=i()((function ServiceClient(e,t){var r=this;s()(this,ServiceClient),l()(this,"requester",void 0),l()(this,"baseUrl",void 0),l()(this,"makeRequest",function(){var e=o()(p().mark((function _callee(e,t,n,o){var a,i;return p().wrap((function _callee$(u){for(;;)switch(u.prev=u.next){case 0:return a="".concat(r.baseUrl,"/").concat(t),u.next=3,r.requester.makeRequest(e,a,null===n||void 0===n?void 0:n.toObject());case 3:return i=u.sent,u.abrupt("return",o?o.fromObject(JSON.parse(i.content)):null);case 5:case"end":return u.stop()}}),_callee)})));return function(t,r,n,o){return e.apply(this,arguments)}}()),this.requester=e,this.baseUrl=t}))},605:(e,t,r)=>{"use strict";r.d(t,{_:()=>c});var n=r(593),o=r.n(n),a=r(857),i=r.n(a),u=r(791),s=r.n(u),c=function(){return i()((function LocalStorageClient(e){o()(this,LocalStorageClient),s()(this,"localStorage",void 0),this.localStorage=e}),[{key:"getValue",value:function getValue(e){return this.localStorage.getItem(e)}},{key:"setValue",value:function setValue(e,t){null===t||void 0===t?this.removeValue(e):this.localStorage.setItem(e,t)}},{key:"getBoolean",value:function getBoolean(e){var t=this.getValue(e);return"1"===t||"0"!==t&&null}},{key:"setBoolean",value:function setBoolean(e,t){null===t||void 0===t?this.removeValue(e):this.setValue(e,t?"1":"0")}},{key:"removeValue",value:function removeValue(e){this.localStorage.removeItem(e)}},{key:"clear",value:function clear(){this.localStorage.clear()}}])}()},277:(e,t,r)=>{"use strict";r.d(t,{c:()=>n});var n=function asyncSleep(e){return new Promise((function(t){setTimeout(t,e)}))}},321:(e,t,r)=>{"use strict";r.d(t,{Bd:()=>u,Fr:()=>l,gA:()=>c,lG:()=>s});var n=r(7),o=r.n(n),a=r(578),i=r.n(a),u=function isBrowser(){return"undefined"!==typeof document},s=function(){var e=o()(i().mark((function _callee(e,t){var r,n,o;return i().wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return r=new Blob([t]),a.next=3,URL.createObjectURL(r);case 3:n=a.sent,(o=document.createElement("a")).href=n,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o);case 10:case"end":return a.stop()}}),_callee)})));return function downloadFileFromBrowser(t,r){return e.apply(this,arguments)}}(),c=function isDocumentVisible(){return!!u()&&(void 0!==document.hidden?e="hidden":void 0!==document.msHidden?e="msHidden":void 0!==document.webkitHidden&&(e="webkitHidden"),!e||!document[e]);var e},l=function isMobile(){if("undefined"===typeof navigator)return!1;return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some((function(e){return e.test(navigator.userAgent)}))}},376:(e,t,r)=>{"use strict";r.d(t,{At:()=>u,Cl:()=>i,Hu:()=>a,T_:()=>o});var n=r(80),o=BigInt("1000000000000000000"),a=function etherToNumber(e){return Number(1000000n*e/o)/1e6},i=function shortFormatEther(e){var t=(0,n.tN)(a(e));return"\u039e".concat(t)},u=function longFormatEther(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(0,n.P9)(a(e),t,r,o);return"\u039e".concat(i)}},722:(e,t,r)=>{"use strict";r.d(t,{u:()=>n});var n=function getClassName(){for(var e=[],t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r.forEach((function(t){t&&e.push(String(t).trim().split(" "))}));var o=e.reduce((function(e,t){return e.concat(t)}),[]);return o=o.reverse(),(o=(o=Array.from(new Set(o))).reverse()).join(" ")}},601:(e,t,r)=>{"use strict";r.d(t,{M8:()=>c,fi:()=>y,LY:()=>v,YZ:()=>l,T2:()=>g,By:()=>m,$T:()=>f,D0:()=>b,ro:()=>p,cK:()=>d,PA:()=>h,ol:()=>_});const n=require("date-fns/addMinutes"),o=require("date-fns/isValid"),a=require("date-fns/parse"),i=require("date-fns/parseISO"),u=require("date-fns-tz");var s=r(172),c="yyyy-MM-dd'T'HH:mm:ss.SSSXXX",l=function dateFromString(e,t){var r;if(t)try{r=(0,a.parse)(e,t,new Date)}catch(n){}else r=(0,i.parseISO)(e);if(!r||!(0,o.isValid)(r))throw new s.N("Invalid date string ".concat(e," passed to dateFromString"));return r},f=function dateToString(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e;return r&&(o=(0,n.addMinutes)(o,o.getTimezoneOffset())),(0,u.format)(o,t,r?{timeZone:"UTC"}:{})},p=function isSameDay(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},d=function isToday(e){return p(e,new Date)},h=function isYesterday(e){var t=new Date;return t.setDate(t.getDate()-1),p(e,t)},v=function addHours(e,t){var r=new Date(e.getTime());return r.setTime(r.getTime()+60*t*60*1e3),r},y=function addDays(e,t){var r=new Date(e.getTime());return r.setDate(r.getDate()+t),r},m=function dateToRelativeString(e){var t,r=Math.floor(((new Date).valueOf()-e.valueOf())/1e3),n=Math.floor(r/31536e3);return n>=1?t="year":(n=Math.floor(r/2592e3))>=1?t="month":(n=Math.floor(r/86400))>=1?t="day":(n=Math.floor(r/3600))>=1?t="hour":(n=Math.floor(r/60))>=1?t="minute":(n=r,t="second"),(n>1||0===n)&&(t+="s"),"".concat(n," ").concat(t," ago")},g=function dateToRelativeShortString(e){var t,r=Math.floor(((new Date).valueOf()-e.valueOf())/1e3),n=Math.floor(r/31536e3);return n>=1?t="y":(n=Math.floor(r/2592e3))>=1?t="m":(n=Math.floor(r/86400))>=1?t="d":(n=Math.floor(r/3600))>=1?t="h":(n=Math.floor(r/60))>=1?t="m":(n=r,t="s"),"".concat(n).concat(t," ago")},_=function startOfDay(e){var t=new Date(e.getTime());return t.setHours(0,0,0,0),t},b=function endOfDay(e){var t=new Date(e.getTime());return t.setHours(23,59,59,999),t}},336:(e,t,r)=>{"use strict";r.d(t,{cj:()=>c,Xp:()=>s,bn:()=>u});const n=require("fs");var o=r.n(n);const a=require("path");var i=r.n(a),u=function humanFileSize(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(0===e)return"0 B";var r=Math.floor(Math.log(e)/Math.log(1024)),n=parseFloat((e/Math.pow(1024,r)).toFixed(t<0?0:t));return"".concat(n," ").concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][r])},s=function copyFileSync(e,t){var r=t;o().existsSync(t)&&o().lstatSync(t).isDirectory()&&(r=i().join(t,i().basename(e)));var n=i().dirname(r);o().existsSync(n)||o().mkdirSync(n,{recursive:!0}),o().writeFileSync(r,o().readFileSync(e))},c=function copyDirectorySync(e,t){if(!o().lstatSync(e).isDirectory())throw new Error("copyDirectorySync must be called with a directory. source ".concat(e," is not a directory"));if(o().existsSync(t)){if(!o().lstatSync(e).isDirectory())throw new Error("copyDirectorySync must be called with a directory. target ".concat(t," is not a directory"))}else o().mkdirSync(t,{recursive:!0});o().readdirSync(e).forEach((function(r){var n=i().join(e,r),a=i().join(t,r);o().lstatSync(n).isDirectory()?c(n,a):s(n,a)}))}},609:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CHARACTERS_ALPHA:()=>h.yH,CHARACTERS_ALPHANUMERIC:()=>h.hK,CHARACTERS_ALPHA_LOWERCASE:()=>h.qC,CHARACTERS_ALPHA_UPPERCASE:()=>h.Rk,CHARACTERS_HEX:()=>h.nU,CHARACTERS_NUMERIC:()=>h.n$,ETHER:()=>a.T_,JSON_DATE_FORMAT:()=>u.M8,addDays:()=>u.fi,addHours:()=>u.LY,arrayWithRange:()=>c.P,asyncSleep:()=>n.c,base64DecodeUnicode:()=>h.$8,booleanFromString:()=>d._n,booleanToString:()=>d.xZ,camelCaseToKebabCase:()=>h.$l,copyDirectorySync:()=>s.cj,copyFileSync:()=>s.Xp,createSearchParams:()=>m.PI,dateFromString:()=>u.YZ,dateToRelativeShortString:()=>u.T2,dateToRelativeString:()=>u.By,dateToString:()=>u.$T,deepCompare:()=>f.ky,downloadFileFromBrowser:()=>o.lG,endOfDay:()=>u.D0,etherToNumber:()=>a.Hu,generateRandomString:()=>h.kX,generateUUID:()=>h.lk,getChunks:()=>c.J,getClassName:()=>i.u,getLinkableUrl:()=>m.aW,getUrlDisplayString:()=>m.XQ,humanFileSize:()=>s.bn,integerFromString:()=>d.wl,integerToString:()=>d.tA,isBrowser:()=>o.Bd,isDocumentVisible:()=>o.gA,isMobile:()=>o.Fr,isSameDay:()=>u.ro,isToday:()=>u.cK,isValidEmail:()=>h.B9,isYesterday:()=>u.PA,longFormatEther:()=>a.At,longFormatNumber:()=>l.P9,merge:()=>f.h1,mergePartial:()=>f.AV,numberFromString:()=>d.ZK,numberToString:()=>d.um,numberWithCommas:()=>l.qC,objectFromString:()=>d.HI,objectToString:()=>d.qD,resolveUrl:()=>m.O2,shortFormatEther:()=>a.Cl,shortFormatNumber:()=>l.tN,startOfDay:()=>u.ol,stringListFromString:()=>d.Fc,stringListToString:()=>d.kl,timeoutPromise:()=>p.B,truncateEnd:()=>h.SO,truncateMiddle:()=>h.kU,truncateStart:()=>h.fl,updateQueryString:()=>m.Ze});var n=r(277),o=r(321),a=r(376),i=r(722),u=r(601),s=r(336),c=r(977),l=r(80),f=r(249),p=r(888),d=r(101),h=r(64),v=r(529),y={};for(const g in v)["default","asyncSleep","downloadFileFromBrowser","isBrowser","isDocumentVisible","isMobile","ETHER","etherToNumber","longFormatEther","shortFormatEther","getClassName","JSON_DATE_FORMAT","addDays","addHours","dateFromString","dateToRelativeShortString","dateToRelativeString","dateToString","endOfDay","isSameDay","isToday","isYesterday","startOfDay","copyDirectorySync","copyFileSync","humanFileSize","arrayWithRange","getChunks","longFormatNumber","numberWithCommas","shortFormatNumber","deepCompare","merge","mergePartial","timeoutPromise","booleanFromString","booleanToString","integerFromString","integerToString","numberFromString","numberToString","objectFromString","objectToString","stringListFromString","stringListToString","CHARACTERS_ALPHA","CHARACTERS_ALPHANUMERIC","CHARACTERS_ALPHA_LOWERCASE","CHARACTERS_ALPHA_UPPERCASE","CHARACTERS_HEX","CHARACTERS_NUMERIC","base64DecodeUnicode","camelCaseToKebabCase","generateRandomString","generateUUID","isValidEmail","truncateEnd","truncateMiddle","truncateStart"].indexOf(g)<0&&(y[g]=()=>v[g]);r.d(t,y);var m=r(391)},977:(e,t,r)=>{"use strict";r.d(t,{J:()=>o,P:()=>n});var n=function arrayWithRange(e,t){return Array(t-e).fill(null).map((function(t,r){return e+r}))},o=function getChunks(e,t){return e.reduce((function(e,r,n){var o=Math.floor(n/t);return e[o]||(e[o]=[]),e[o].push(r),e}),[])}},80:(e,t,r)=>{"use strict";r.d(t,{P9:()=>a,qC:()=>n,tN:()=>o});var n=function numberWithCommas(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},o=function shortFormatNumber(e){return e>=1e9?"".concat((e/1e9).toFixed(0),"B"):e>=1e7?"".concat((e/1e6).toFixed(0),"M"):e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e4?"".concat((e/1e3).toFixed(0),"K"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e>100?e.toFixed(0):e>1?e.toFixed(1):e.toFixed(2)},a=function longFormatNumber(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e.toFixed(t);if(r){for(;","===o.charAt(o.length-1);)o=o.slice(0,-1);o.endsWith(".0")&&(o=o.replace(".0",""))}if(n){var a=o.split("."),i=a[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");o=1===a.length?i:"".concat(i,".").concat(a[1])}return"".concat(o.toLocaleString())}},249:(e,t,r)=>{"use strict";r.d(t,{ky:()=>deepCompare,h1:()=>merge,AV:()=>mergePartial});const n=require("deepmerge"),o=require("fast-deep-equal");var a=r.n(o);function merge(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return n(e,mergePartial.apply(void 0,r))}function mergePartial(){for(var e={},t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return r.forEach((function(t){t&&(e=n(e,t))})),e}function deepCompare(e,t){return a()(e,t)}},888:(e,t,r)=>{"use strict";r.d(t,{B:()=>o});var n=r(172),o=function timeoutPromise(e,t){return new Promise((function(r,o){var a=setTimeout((function(){o(new n.N("TIMEOUT"))}),1e3*e);t.then((function(e){clearTimeout(a),r(e)}),(function(e){clearTimeout(a),o(e)}))}))}},101:(e,t,r)=>{"use strict";r.d(t,{Fc:()=>p,HI:()=>o,ZK:()=>s,_n:()=>i,kl:()=>f,qD:()=>n,tA:()=>c,um:()=>u,wl:()=>l,xZ:()=>a});var n=function objectToString(e){if(void 0!==e)return null===e?null:JSON.stringify(e)},o=function objectFromString(e){if(void 0!==e)return null===e?null:JSON.parse(e)},a=function booleanToString(e){if(void 0!==e)return null===e?null:e?"1":"0"},i=function booleanFromString(e){if(void 0!==e)return null===e?null:"1"===e||"true"===e},u=function numberToString(e){if(void 0!==e)return null===e?null:String(e)},s=function numberFromString(e){if(void 0!==e){if(null===e)return null;var t=Number(e);return Number.isNaN(t)?null:t}},c=function integerToString(e){return e?String(Math.round(e)):u(e)},l=function integerFromString(e){var t=s(e);return t?Math.round(t):t},f=function stringListToString(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";if(void 0!==e)return null===e?"":e.join(t)},p=function stringListFromString(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";if(void 0!==e)return null===e?[]:e?e.split(t):[]}},64:(e,t,r)=>{"use strict";r.d(t,{$8:()=>y,$l:()=>p,B9:()=>f,Rk:()=>a,SO:()=>v,fl:()=>h,hK:()=>u,kU:()=>d,kX:()=>c,lk:()=>l,n$:()=>n,nU:()=>s,qC:()=>o,yH:()=>i});var n="1234567890",o="abcdefghijklmnopqrstuvwxyz",a="ABCDEFGHIJKLMNOPQRSTUVWXYZ",i="".concat(o).concat(a),u="".concat(i).concat(n),s="".concat(n,"abcdef"),c=function generateRandomString(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,r="",n=0;n<e;n+=1)r+=t[Math.floor(Math.random()*t.length)];return r},l=function generateUUID(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=c(32,s);return e&&(t=[t.substring(0,8),t.substring(8,12),t.substring(12,16),t.substring(16,20),t.substring(20)].join("-")),t},f=function isValidEmail(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},p=function camelCaseToKebabCase(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()},d=function truncateMiddle(e,t){if(e.length-t>0){var r=e.substring(0,Math.ceil(t/2)),n=e.substring(e.length-Math.floor(t/2),e.length);return"".concat(r,"...").concat(n)}return e},h=function truncateStart(e,t){if(e.length-t>0){var r=e.substring(0,t);return"".concat(r,"...")}return e},v=function truncateEnd(e,t){if(e.length-t>0){var r=e.substring(0,t);return"".concat(r,"...")}return e},y=function base64DecodeUnicode(e){var t=atob(e).split("").map((function(e){return"%".concat("00".concat(e.charCodeAt(0).toString(16)).slice(-2))})).join("");return decodeURIComponent(t)}},529:()=>{},391:(e,t,r)=>{"use strict";r.d(t,{O2:()=>u,PI:()=>s,XQ:()=>a,Ze:()=>c,aW:()=>i});var n=r(361),o=r.n(n),a=function getUrlDisplayString(e){var t=e;for(t.startsWith("http://")&&(t=t.slice(7)),t.startsWith("https://")&&(t=t.slice(8));t.endsWith("/");)t=t.slice(0,t.length-1);return t},i=function getLinkableUrl(e){var t=e;return t.startsWith("http://")||t.startsWith("https://")||(t="http://".concat(t)),t},u=function resolveUrl(e){return e.startsWith("ipfs://")?e.replace("ipfs://","https://pablo-images.kibalabs.com/v1/ipfs/"):e},s=function createSearchParams(e){var t=new URLSearchParams;return Object.entries(e).forEach((function(e){var r=o()(e,2),n=r[0],a=r[1];Array.isArray(a)?a.forEach((function(e){t.append(n,e)})):t.append(n,a)})),t},c=function updateQueryString(e,t){var r=new URL(e);return Object.keys(t).forEach((function(e){r.searchParams.set(e,String(t[e]))})),r.toString()}},661:e=>{e.exports=function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},989:e=>{e.exports=function _arrayWithHoles(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},589:e=>{e.exports=function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},7:e=>{function asyncGeneratorStep(e,t,r,n,o,a,i){try{var u=e[a](i),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function _next(e){asyncGeneratorStep(a,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,n,o,_next,_throw,"throw",e)}_next(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},593:e=>{e.exports=function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},40:(e,t,r)=>{var n=r(364),o=r(82);e.exports=function _construct(e,t,r){if(n())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,t);var i=new(e.bind.apply(e,a));return r&&o(i,r.prototype),i},e.exports.__esModule=!0,e.exports.default=e.exports},857:(e,t,r)=>{var n=r(430);function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},791:(e,t,r)=>{var n=r(430);e.exports=function _defineProperty(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},166:e=>{function _getPrototypeOf(t){return e.exports=_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,_getPrototypeOf(t)}e.exports=_getPrototypeOf,e.exports.__esModule=!0,e.exports.default=e.exports},617:(e,t,r)=>{var n=r(82);e.exports=function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},150:e=>{e.exports=function _isNativeFunction(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},364:e=>{function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(e.exports=_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=_isNativeReflectConstruct,e.exports.__esModule=!0,e.exports.default=e.exports},518:e=>{e.exports=function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,u=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return u}},e.exports.__esModule=!0,e.exports.default=e.exports},486:e=>{e.exports=function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},322:(e,t,r)=>{var n=r(584).default,o=r(589);e.exports=function _possibleConstructorReturn(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},223:(e,t,r)=>{var n=r(584).default;function _regeneratorRuntime(){"use strict";e.exports=_regeneratorRuntime=function _regeneratorRuntime(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function define(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{define({},"")}catch(t){define=function define(e,t,r){return e[t]=r}}function wrap(e,t,r,n){var o=t&&t.prototype instanceof Generator?t:Generator,a=Object.create(o.prototype),u=new Context(n||[]);return i(a,"_invoke",{value:makeInvokeMethod(e,r,u)}),a}function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=wrap;var f="suspendedStart",p="suspendedYield",d="executing",h="completed",v={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var y={};define(y,s,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(values([])));g&&g!==o&&a.call(g,s)&&(y=g);var _=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(y);function defineIteratorMethods(e){["next","throw","return"].forEach((function(t){define(e,t,(function(e){return this._invoke(t,e)}))}))}function AsyncIterator(e,t){function invoke(r,o,i,u){var s=tryCatch(e[r],e,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==n(l)&&a.call(l,"__await")?t.resolve(l.__await).then((function(e){invoke("next",e,i,u)}),(function(e){invoke("throw",e,i,u)})):t.resolve(l).then((function(e){c.value=e,i(c)}),(function(e){return invoke("throw",e,i,u)}))}u(s.arg)}var r;i(this,"_invoke",{value:function value(e,n){function callInvokeWithMethodAndArg(){return new t((function(t,r){invoke(e,n,t,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=f;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var s=maybeInvokeDelegate(u,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=tryCatch(e,r,n);if("normal"===c.type){if(o=n.done?h:p,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=h,n.method="throw",n.arg=c.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=tryCatch(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(a.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(n(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,i(_,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),i(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},r.awrap=function(e){return{__await:e}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),r.AsyncIterator=AsyncIterator,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var i=new AsyncIterator(wrap(e,t,n,o),a);return r.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},defineIteratorMethods(_),define(_,l,"Generator"),define(_,s,(function(){return this})),define(_,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function next(){for(;r.length;){var e=r.pop();if(e in t)return next.value=e,next.done=!1,next}return next.done=!0,next}},r.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return i.type="throw",i.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var u=a.call(o,"catchLoc"),s=a.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0);if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}}}},abrupt:function abrupt(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function complete(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function finish(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),v}},catch:function _catch(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},r}e.exports=_regeneratorRuntime,e.exports.__esModule=!0,e.exports.default=e.exports},82:e=>{function _setPrototypeOf(t,r){return e.exports=_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,_setPrototypeOf(t,r)}e.exports=_setPrototypeOf,e.exports.__esModule=!0,e.exports.default=e.exports},361:(e,t,r)=>{var n=r(989),o=r(518),a=r(348),i=r(486);e.exports=function _slicedToArray(e,t){return n(e)||o(e,t)||a(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},283:(e,t,r)=>{var n=r(584).default;e.exports=function toPrimitive(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},430:(e,t,r)=>{var n=r(584).default,o=r(283);e.exports=function toPropertyKey(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},584:e=>{function _typeof(t){return e.exports=_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,_typeof(t)}e.exports=_typeof,e.exports.__esModule=!0,e.exports.default=e.exports},348:(e,t,r)=>{var n=r(661);e.exports=function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},783:(e,t,r)=>{var n=r(166),o=r(82),a=r(150),i=r(40);function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return e.exports=_wrapNativeSuper=function _wrapNativeSuper(e){if(null===e||!a(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,Wrapper)}function Wrapper(){return i(e,arguments,n(this).constructor)}return Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),o(Wrapper,e)},e.exports.__esModule=!0,e.exports.default=e.exports,_wrapNativeSuper(t)}e.exports=_wrapNativeSuper,e.exports.__esModule=!0,e.exports.default=e.exports},578:(e,t,r)=>{var n=r(223)();e.exports=n;try{regeneratorRuntime=n}catch(o){"object"===typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,__webpack_require__),o.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";__webpack_require__.r(r),__webpack_require__.d(r,{KibaException:()=>e.N,KibaRequest:()=>t.RK,KibaResponse:()=>t.vC,LocalStorageClient:()=>o._,RequestData:()=>n.CN,Requester:()=>t.D7,RequesterModifier:()=>t.Qb,ResponseData:()=>n.su,RestMethod:()=>t.Wh,ServiceClient:()=>n.Nl});var e=__webpack_require__(374),t=__webpack_require__(296),n=__webpack_require__(978),o=__webpack_require__(605),a=__webpack_require__(609),i={};for(const r in a)["default","KibaException","KibaRequest","KibaResponse","Requester","RequesterModifier","RestMethod","RequestData","ResponseData","ServiceClient","LocalStorageClient"].indexOf(r)<0&&(i[r]=()=>a[r]);__webpack_require__.d(r,i)})(),r})()));
|
|
1
|
+
import{addMinutes as N}from"date-fns/addMinutes";import{isValid as L}from"date-fns/isValid";import{parse as V}from"date-fns/parse";import{parseISO as W}from"date-fns/parseISO";import{format as _}from"date-fns-tz";import a from"fs";import l from"path";import w from"deepmerge";import x from"fast-deep-equal";var d=class extends Error{statusCode;constructor(e,t){super(e),this.name=this.constructor.name,this.statusCode=t||500}};let c=function(e){return e.DELETE="delete",e.GET="get",e.HEAD="head",e.OPTIONS="options",e.PATCH="patch",e.POST="post",e.PUT="put",e}({});var u=class{method;url;headers;data;formData;date;timeoutSeconds;constructor(e,t,n,r,s,i,o){this.method=e,this.url=t,this.headers=n||{},this.data=r||null,this.formData=s||null,this.date=i||new Date,this.timeoutSeconds=o&&o>0?o:null}},y=class{status;headers={};date;content="";constructor(e,t,n,r){this.status=e,this.headers=t,this.date=n,this.content=r}};const b=(e,t)=>new Promise((n,r)=>{const s=setTimeout(()=>{r(new d("TIMEOUT"))},e*1e3);t.then(i=>{clearTimeout(s),n(i)},i=>{clearTimeout(s),r(i)})}),K=e=>{let t=e;for(t.startsWith("http://")&&(t=t.slice(7)),t.startsWith("https://")&&(t=t.slice(8));t.endsWith("/");)t=t.slice(0,t.length-1);return t},z=e=>{let t=e;return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`http://${t}`),t},J=e=>e.startsWith("ipfs://")?e.replace("ipfs://","https://pablo-images.kibalabs.com/v1/ipfs/"):e,R=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([n,r])=>{Array.isArray(r)?r.forEach(s=>{t.append(n,s)}):t.append(n,r)}),t},Z=(e,t)=>{const n=new URL(e);return Object.keys(t).forEach(r=>{n.searchParams.set(r,String(t[r]))}),n.toString()};var G=class{modifyRequest(e){return e}modifyResponse(e){return e}},X=class{headers;modifiers;shouldIncludeCrossSiteCredentials;constructor(e,t,n=!0){this.headers=e||{},this.modifiers=t||[],this.shouldIncludeCrossSiteCredentials=n}addModifier=e=>{this.modifiers.push(e)};modifyRequest=e=>this.modifiers.reduce((t,n)=>n.modifyRequest(t),e);modifyResponse=e=>this.modifiers.reduce((t,n)=>n.modifyResponse(t),e);getRequest=async(e,t,n,r)=>{const s=new u(c.GET,e,n,t,void 0,new Date,r);return this.makeRequestInternal(s)};postRequest=async(e,t,n,r)=>{const s=new u(c.POST,e,n,t,void 0,new Date,r);return this.makeRequestInternal(s)};putRequest=async(e,t,n,r)=>{const s=new u(c.PUT,e,n,t,void 0,new Date,r);return this.makeRequestInternal(s)};deleteRequest=async(e,t,n,r)=>{const s=new u(c.DELETE,e,n,t,void 0,new Date,r);return this.makeRequestInternal(s)};makeRequest=async(e,t,n,r,s)=>{const i=new u(e,t,r,n,void 0,new Date,s);return this.makeRequestInternal(i)};makeFormRequest=async(e,t,n,r)=>{const s=new u(c.POST,e,n,void 0,t,new Date,r);return this.makeRequestInternal(s)};makeFormPutRequest=async(e,t,n,r)=>{const s=new u(c.PUT,e,n,void 0,t,new Date,r);return this.makeRequestInternal(s)};makeRequestInternal=async e=>{const t=this.modifyRequest(e);let n=await this.makeFetchRequest(t);if(n=this.modifyResponse(n),n.status>=400&&n.status<600){let r=null;try{r=JSON.parse(n.content)}catch{}throw r&&"message"in r?new d(r.message,n.status):new d(n.content,n.status)}return n};makeFetchRequest=async e=>{const t=new URL(e.url),n=new Headers({...this.headers,...e.headers||{}}),r={method:e.method.toUpperCase(),headers:n,credentials:this.shouldIncludeCrossSiteCredentials?"include":"same-origin"};if(e.method===c.GET||e.method===c.DELETE){if(e.data){const o={...e.data};Object.keys(o).forEach(f=>{o[f]===void 0&&delete o[f]}),t.search=R(o).toString()}}else{const o=n.get("Content-Type");e.data?(r.body=JSON.stringify(e.data),o&&o!=="application/json"&&console.warn(`Overwriting content-type header for request from ${o} to application/json`),n.set("content-type","application/json")):e.formData&&(r.body=e.formData)}const s=fetch(t.toString(),r).catch(o=>{throw new d(`The request was made but no response was received: [${o.code}] "${o.message}"`)}).then(async o=>{if(!o)throw new d("The request was made but no response was received.");const f=await o.text(),h={};return o.headers.forEach((j,m)=>{h[m]&&console.warn(`key ${m} will be overwritten. TODO(krish): Implement joining keys!`),h[m]=j}),new y(o.status,h,new Date,f)});return await(e.timeoutSeconds?b(e.timeoutSeconds,s):s)}},Y=class{toObject=()=>({})},Q=class{},v=class{requester;baseUrl;constructor(e,t){this.requester=e,this.baseUrl=t}makeRequest=async(e,t,n,r)=>{const s=`${this.baseUrl}/${t}`,i=await this.requester.makeRequest(e,s,n?.toObject());return r?r.fromObject(JSON.parse(i.content)):null}},ee=class{localStorage;constructor(e){this.localStorage=e}getValue(e){return this.localStorage.getItem(e)}setValue(e,t){t==null?this.removeValue(e):this.localStorage.setItem(e,t)}getBoolean(e){const t=this.getValue(e);return t==="1"?!0:t==="0"?!1:null}setBoolean(e,t){t==null?this.removeValue(e):this.setValue(e,t?"1":"0")}removeValue(e){this.localStorage.removeItem(e)}clear(){this.localStorage.clear()}};const te=e=>new Promise(t=>{setTimeout(t,e)}),T=()=>typeof document<"u",ne=async(e,t)=>{const n=new Blob([t]),r=await URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s)},re=()=>{if(!T())return!1;let e;return document.hidden!==void 0?e="hidden":document.msHidden!==void 0?e="msHidden":document.webkitHidden!==void 0&&(e="webkitHidden"),e?!document[e]:!0},se=()=>typeof navigator>"u"?!1:[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(t=>t.test(navigator.userAgent)),oe=e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),D=e=>e>=1e9?`${(e/1e9).toFixed(0)}B`:e>=1e7?`${(e/1e6).toFixed(0)}M`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e4?`${(e/1e3).toFixed(0)}K`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e>100?e.toFixed(0):e>1?e.toFixed(1):e.toFixed(2),E=(e,t=2,n=!1,r=!1)=>{let s=e.toFixed(t);if(n){for(;s.charAt(s.length-1)===",";)s=s.slice(0,-1);s.endsWith(".0")&&(s=s.replace(".0",""))}if(r){const i=s.split("."),o=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");s=i.length===1?o:`${o}.${i[1]}`}return`${s.toLocaleString()}`},C=BigInt("1000000000000000000"),g=e=>Number(e*1000000n/C)/1e6,ie=e=>`\u039E${D(g(e))}`,ae=(e,t=2,n=!1,r=!1)=>`\u039E${E(g(e),t,n,r)}`,ce=(...e)=>{const t=[];e.forEach(r=>{r&&t.push(String(r).trim().split(" "))});let n=t.reduce((r,s)=>r.concat(s),[]);return n=n.reverse(),n=Array.from(new Set(n)),n=n.reverse(),n.join(" ")},A="yyyy-MM-dd'T'HH:mm:ss.SSSXXX",ue=(e,t)=>{let n;if(!t)n=W(e);else try{n=V(e,t,new Date)}catch{}if(!n||!L(n))throw new d(`Invalid date string ${e} passed to dateFromString`);return n},de=(e,t=A,n=!1)=>{let r=e;return n&&(r=N(r,r.getTimezoneOffset())),_(r,t,n?{timeZone:"UTC"}:{})},p=(e,t)=>e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),le=e=>p(e,new Date),fe=e=>{const t=new Date;return t.setDate(t.getDate()-1),p(e,t)},he=(e,t)=>{const n=new Date(e.getTime());return n.setTime(n.getTime()+t*60*60*1e3),n},me=(e,t)=>{const n=new Date(e.getTime());return n.setDate(n.getDate()+t),n},ge=e=>{const t=Math.floor((new Date().valueOf()-e.valueOf())/1e3);let n,r=Math.floor(t/31536e3);return r>=1?n="year":(r=Math.floor(t/2592e3),r>=1?n="month":(r=Math.floor(t/86400),r>=1?n="day":(r=Math.floor(t/3600),r>=1?n="hour":(r=Math.floor(t/60),r>=1?n="minute":(r=t,n="second"))))),(r>1||r===0)&&(n+="s"),`${r} ${n} ago`},pe=e=>{const t=Math.floor((new Date().valueOf()-e.valueOf())/1e3);let n,r=Math.floor(t/31536e3);return r>=1?n="y":(r=Math.floor(t/2592e3),r>=1?n="m":(r=Math.floor(t/86400),r>=1?n="d":(r=Math.floor(t/3600),r>=1?n="h":(r=Math.floor(t/60),r>=1?n="m":(r=t,n="s"))))),`${r}${n} ago`},Se=e=>{const t=new Date(e.getTime());return t.setHours(0,0,0,0),t},we=e=>{const t=new Date(e.getTime());return t.setHours(23,59,59,999),t},ye=(e,t=1)=>{if(e===0)return"0 B";const n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(t<0?0:t))} ${n[r]}`},F=(e,t)=>{let n=t;a.existsSync(t)&&a.lstatSync(t).isDirectory()&&(n=l.join(t,l.basename(e)));const r=l.dirname(n);a.existsSync(r)||a.mkdirSync(r,{recursive:!0}),a.writeFileSync(n,a.readFileSync(e))},O=(e,t)=>{if(!a.lstatSync(e).isDirectory())throw new Error(`copyDirectorySync must be called with a directory. source ${e} is not a directory`);if(!a.existsSync(t))a.mkdirSync(t,{recursive:!0});else if(!a.lstatSync(e).isDirectory())throw new Error(`copyDirectorySync must be called with a directory. target ${t} is not a directory`);a.readdirSync(e).forEach(n=>{const r=l.join(e,n),s=l.join(t,n);a.lstatSync(r).isDirectory()?O(r,s):F(r,s)})},be=(e,t)=>Array(t-e).fill(null).map((n,r)=>e+r),Re=(e,t)=>e.reduce((n,r,s)=>{const i=Math.floor(s/t);return n[i]||(n[i]=[]),n[i].push(r),n},[]);function Te(e,...t){return w(e,M(...t))}function M(...e){let t={};return e.forEach(n=>{n&&(t=w(t,n))}),t}function De(e,t){return x(e,t)}const Ee=e=>{if(e!==void 0)return e===null?null:JSON.stringify(e)},Ce=e=>{if(e!==void 0)return e===null?null:JSON.parse(e)},Ae=e=>{if(e!==void 0)return e===null?null:e?"1":"0"},Fe=e=>{if(e!==void 0)return e===null?null:e==="1"||e==="true"},q=e=>{if(e!==void 0)return e===null?null:String(e)},$=e=>{if(e===void 0)return;if(e===null)return null;const t=Number(e);return Number.isNaN(t)?null:t},Oe=e=>e?String(Math.round(e)):q(e),Me=e=>{const t=$(e);return t&&Math.round(t)},qe=(e,t=",")=>{if(e!==void 0)return e===null?"":e.join(t)},$e=(e,t=",")=>{if(e!==void 0)return e===null?[]:e?e.split(t):[]},S="1234567890",I="abcdefghijklmnopqrstuvwxyz",P="ABCDEFGHIJKLMNOPQRSTUVWXYZ",k=`${I}${P}`,H=`${k}${S}`,U=`${S}abcdef`,B=(e,t=H)=>{let n="";for(let r=0;r<e;r+=1)n+=t[Math.floor(Math.random()*t.length)];return n},Ie=(e=!0)=>{let t=B(32,U);return e&&(t=[t.substring(0,8),t.substring(8,12),t.substring(12,16),t.substring(16,20),t.substring(20)].join("-")),t},Pe=e=>/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),ke=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),He=(e,t)=>{if(e.length-t>0){const r=e.substring(0,Math.ceil(t/2)),s=e.substring(e.length-Math.floor(t/2),e.length);return`${r}...${s}`}return e},Ue=(e,t)=>e.length-t>0?`${e.substring(0,t)}...`:e,Be=(e,t)=>e.length-t>0?`${e.substring(0,t)}...`:e,je=e=>{const t=atob(e).split("").map(n=>`%${`00${n.charCodeAt(0).toString(16)}`.slice(-2)}`).join("");return decodeURIComponent(t)};export{k as CHARACTERS_ALPHA,H as CHARACTERS_ALPHANUMERIC,I as CHARACTERS_ALPHA_LOWERCASE,P as CHARACTERS_ALPHA_UPPERCASE,U as CHARACTERS_HEX,S as CHARACTERS_NUMERIC,C as ETHER,A as JSON_DATE_FORMAT,d as KibaException,u as KibaRequest,y as KibaResponse,ee as LocalStorageClient,Y as RequestData,X as Requester,G as RequesterModifier,Q as ResponseData,c as RestMethod,v as ServiceClient,me as addDays,he as addHours,be as arrayWithRange,te as asyncSleep,je as base64DecodeUnicode,Fe as booleanFromString,Ae as booleanToString,ke as camelCaseToKebabCase,O as copyDirectorySync,F as copyFileSync,R as createSearchParams,ue as dateFromString,pe as dateToRelativeShortString,ge as dateToRelativeString,de as dateToString,De as deepCompare,ne as downloadFileFromBrowser,we as endOfDay,g as etherToNumber,B as generateRandomString,Ie as generateUUID,Re as getChunks,ce as getClassName,z as getLinkableUrl,K as getUrlDisplayString,ye as humanFileSize,Me as integerFromString,Oe as integerToString,T as isBrowser,re as isDocumentVisible,se as isMobile,p as isSameDay,le as isToday,Pe as isValidEmail,fe as isYesterday,ae as longFormatEther,E as longFormatNumber,Te as merge,M as mergePartial,$ as numberFromString,q as numberToString,oe as numberWithCommas,Ce as objectFromString,Ee as objectToString,J as resolveUrl,ie as shortFormatEther,D as shortFormatNumber,Se as startOfDay,$e as stringListFromString,qe as stringListToString,b as timeoutPromise,Be as truncateEnd,He as truncateMiddle,Ue as truncateStart,Z as updateQueryString};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateUtil.d.ts","sourceRoot":"","sources":["../../src/util/dateUtil.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,gBAAgB,iCAAmC,CAAC;AAEjE,eAAO,MAAM,cAAc,eAAgB,MAAM,iBAAiB,MAAM,KAAG,IAe1E,CAAC;
|
|
1
|
+
{"version":3,"file":"dateUtil.d.ts","sourceRoot":"","sources":["../../src/util/dateUtil.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,gBAAgB,iCAAmC,CAAC;AAEjE,eAAO,MAAM,cAAc,eAAgB,MAAM,iBAAiB,MAAM,KAAG,IAe1E,CAAC;AAGF,eAAO,MAAM,YAAY,SAAU,IAAI,iBAAgB,MAAM,6BAA4C,MAOxG,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,IAAI,SAAS,IAAI,KAAG,OAEpD,CAAC;AAEF,eAAO,MAAM,OAAO,SAAU,IAAI,KAAG,OAEpC,CAAC;AAEF,eAAO,MAAM,WAAW,SAAU,IAAI,KAAG,OAIxC,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,IAAI,SAAS,MAAM,KAAG,IAIpD,CAAC;AAEF,eAAO,MAAM,OAAO,SAAU,IAAI,QAAQ,MAAM,KAAG,IAIlD,CAAC;AAEF,eAAO,MAAM,oBAAoB,SAAU,IAAI,KAAG,MAmCjD,CAAC;AAEF,eAAO,MAAM,yBAAyB,SAAU,IAAI,KAAG,MAgCtD,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,IAAI,KAAG,IAIvC,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,IAAI,KAAG,IAIrC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RecursivePartial } from '
|
|
1
|
+
import { RecursivePartial } from './typeUtil';
|
|
2
2
|
export declare function merge<T>(base: T, ...partials: (RecursivePartial<T> | undefined)[]): T;
|
|
3
3
|
export declare function mergePartial<T>(...partials: (RecursivePartial<T> | undefined)[]): RecursivePartial<T>;
|
|
4
4
|
export declare function deepCompare<T>(object1: T, object2: T): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectUtil.d.ts","sourceRoot":"","sources":["../../src/util/objectUtil.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"objectUtil.d.ts","sourceRoot":"","sources":["../../src/util/objectUtil.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,wBAAgB,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,GAAG,CAAC,CAGrF;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAUrG;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAE9D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kibalabs/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3-next.1",
|
|
4
4
|
"description": "Utilities for use in front-end projects at Kiba Labs",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"dist/*"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"date-fns": "^
|
|
19
|
+
"date-fns": "^4.1.0",
|
|
20
20
|
"date-fns-tz": "^3.1.3",
|
|
21
21
|
"deepmerge": "^4.3.1",
|
|
22
22
|
"fast-deep-equal": "^3.1.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@kibalabs/build": "0.13.
|
|
25
|
+
"@kibalabs/build": "0.13.3-next.0"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|