@oardi/ts-utils 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @oardi/ts-utils
2
+
3
+ Powerful set of Typescript Utility Extensions Methods, Helpers, Interfaces, Services and Types.
4
+
5
+ ## Setup
6
+
7
+ ### Install npm package
8
+
9
+ ```
10
+ npm i @oardi/ts-utils
11
+ ```
12
+
13
+ ### about
14
+
15
+ Developed and maintained by [oardi](https://github.com/oardi)
package/index.cjs.js CHANGED
@@ -1,15 +1,15 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Re=(b=>(b.opera="opera",b.firefox="firefox",b.safari="safari",b.ie="ie",b.edge="edge",b.edg="edg",b.electron="electron",b.chrome="chrome",b.iOsSafari="iOsSafari",b.edgiOs="edgiOs",b.headlessChrome="headlessChrome",b))(Re||{});const ce=[{breakpoint:"xs",screenWidth:0},{breakpoint:"sm",screenWidth:375},{breakpoint:"md",screenWidth:768},{breakpoint:"lg",screenWidth:992},{breakpoint:"xl",screenWidth:1200},{breakpoint:"xxl",screenWidth:1400},{breakpoint:"xxxl",screenWidth:1600}];class xe{screenWidth=0;lastBreakpoint;resizeListener;resizeCallbacks=new Set;constructor(){typeof window<"u"&&(this.screenWidth=window.innerWidth,this.resizeListener=this.onResize.bind(this),window.addEventListener("resize",this.resizeListener),this.lastBreakpoint=this.getBreakpointBySize(this.screenWidth))}destroy(){typeof window<"u"&&window.removeEventListener("resize",this.resizeListener),this.resizeCallbacks.clear()}onBreakpointChange(i){this.resizeCallbacks.add(i)}offBreakpointChange(i){this.resizeCallbacks.delete(i)}getCurrentBrowser(){const i=navigator.userAgent.toLowerCase();if(this.isOpera())return"opera";if(this.isFirefox())return"firefox";if(this.isSafari())return"safari";if(this.isIE())return"ie";if(this.isEdge())return"edge";if(this.isEdg())return"edg";if(this.isElectron(i))return"electron";if(this.isChrome())return"chrome";if(this.isIOsSafari(i))return"iOsSafari";if(this.isEdgiOs(i))return"edgiOs";if(this.isHeadlessChrome(i))return"headlessChrome";throw new Error("Browser could not be detected: "+i)}getBreakpointBySize(i=this.screenWidth){let u=ce[0];for(const l of ce)l.screenWidth<=i&&(u=l);return u}isScreenGreaterThan(i){const u=this.getBreakpoint(i);return this.screenWidth>(u?.screenWidth??0)}isScreenSmallerThan(i){const u=this.getBreakpoint(i);return this.screenWidth<(u?.screenWidth??0)}getBreakpoint(i){return ce.find(u=>u.breakpoint===i)}isOpera(){return typeof window<"u"&&(!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.includes("OPR/"))}isFirefox(){return typeof InstallTrigger<"u"}isSafari(){return/constructor/i.test(window.HTMLElement)||(i=>i.toString()==="[object SafariRemoteNotification]")(!window.safari||window.safari&&window.safari.pushNotification)}isIE(){return!!document.documentMode}isEdge(){return!this.isIE()&&!!window.StyleMedia}isEdg(){return navigator.userAgent.toLowerCase().includes("edg")}isElectron(i){return i.includes("electron")}isChrome(){return typeof window<"u"&&!!window.chrome&&!this.isOpera()&&!this.isEdge()&&!this.isEdg()&&!this.isFirefox()&&!this.isSafari()&&!this.isIE()}isIOsSafari(i){return i.includes("iphone")||i.includes("ipad")||i.includes("macintosh")&&"ontouchend"in document&&i.includes("safari")}isEdgiOs(i){return i.includes("edgios")}isHeadlessChrome(i){return i.includes("headlesschrome")}onResize(i){const u=i.target.innerWidth;this.screenWidth=u;const l=this.getBreakpointBySize(u);this.lastBreakpoint?.breakpoint!==l?.breakpoint&&(this.lastBreakpoint=l,this.resizeCallbacks.forEach(O=>O(l)))}}class Oe{copy(i){return navigator.clipboard.writeText(i)}}var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pe={exports:{}},Ce=pe.exports,be;function Le(){return be||(be=1,function(b,i){(function(u,l){l()})(Ce,function(){function u(n,p){return typeof p>"u"?p={autoBom:!1}:typeof p!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),p={autoBom:!p}),p.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(n.type)?new Blob(["\uFEFF",n],{type:n.type}):n}function l(n,p,P){var k=new XMLHttpRequest;k.open("GET",n),k.responseType="blob",k.onload=function(){ie(k.response,p,P)},k.onerror=function(){console.error("could not download file")},k.send()}function O(n){var p=new XMLHttpRequest;p.open("HEAD",n,!1);try{p.send()}catch{}return 200<=p.status&&299>=p.status}function C(n){try{n.dispatchEvent(new MouseEvent("click"))}catch{var p=document.createEvent("MouseEvents");p.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),n.dispatchEvent(p)}}var q=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof fe=="object"&&fe.global===fe?fe:void 0,re=q.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),ie=q.saveAs||(typeof window!="object"||window!==q?function(){}:"download"in HTMLAnchorElement.prototype&&!re?function(n,p,P){var k=q.URL||q.webkitURL,F=document.createElement("a");p=p||n.name||"download",F.download=p,F.rel="noopener",typeof n=="string"?(F.href=n,F.origin===location.origin?C(F):O(F.href)?l(n,p,P):C(F,F.target="_blank")):(F.href=k.createObjectURL(n),setTimeout(function(){k.revokeObjectURL(F.href)},4e4),setTimeout(function(){C(F)},0))}:"msSaveOrOpenBlob"in navigator?function(n,p,P){if(p=p||n.name||"download",typeof n!="string")navigator.msSaveOrOpenBlob(u(n,P),p);else if(O(n))l(n,p,P);else{var k=document.createElement("a");k.href=n,k.target="_blank",setTimeout(function(){C(k)})}}:function(n,p,P,k){if(k=k||open("","_blank"),k&&(k.document.title=k.document.body.innerText="downloading..."),typeof n=="string")return l(n,p,P);var F=n.type==="application/octet-stream",ne=/constructor/i.test(q.HTMLElement)||q.safari,ue=/CriOS\/[\d]+/.test(navigator.userAgent);if((ue||F&&ne||re)&&typeof FileReader<"u"){var Z=new FileReader;Z.onloadend=function(){var V=Z.result;V=ue?V:V.replace(/^data:[^;]*;/,"data:attachment/file;"),k?k.location.href=V:location=V,k=null},Z.readAsDataURL(n)}else{var se=q.URL||q.webkitURL,le=se.createObjectURL(n);k?k.location=le:location.href=le,k=null,setTimeout(function(){se.revokeObjectURL(le)},4e4)}});q.saveAs=ie.saveAs=ie,b.exports=ie})}(pe)),pe.exports}var Ae=Le(),ge={exports:{}};/* @license
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ae=(h,r,f)=>h.localeCompare(r)*(f?1:-1),Te=(h,r)=>h<r?-1:h===r?0:1,Fe=(h,r,f)=>Te(h,r)*(f?1:-1),Ie=(h,r,f)=>{let d=0;return typeof h=="string"&&typeof r=="string"?d=Ae(h,r,f):d=Fe(h,r,f),d},$e=(h,r,f,d)=>{const C=f(h),$=f(r);return Ie(C,$,d)};Array.prototype.groupBy=function(h){return this.reduce((r,f)=>{const d=h(f);return(r[d]=r[d]||[]).push(f),r},{})};Array.prototype.removeBy=function(h,r){return this.filter(f=>h(f)!==r)};Array.prototype.orderBy=function(h,r=!0){return this?.sort((f,d)=>$e(f,d,h,r)),this};Array.prototype.filterBy=function(h){return this.filter(r=>{let f=!1;return h&&r[h]?f=r[h]===h:f=r===h,f})};Array.prototype.distinct=function(h){const r=this;return h?r.filter((d,C,$)=>$.findIndex(z=>h(z,d))===C):r.filter((d,C,$)=>$.indexOf(d)===C)};var ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ce(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var me={exports:{}},je=me.exports,Oe;function ze(){return Oe||(Oe=1,function(h,r){(function(f,d){h.exports=d()})(je,function(){var f=1e3,d=6e4,C=36e5,$="millisecond",z="second",N="minute",q="hour",o="day",S="week",A="month",D="quarter",T="year",Q="date",G="Invalid Date",X=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,se=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ae={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var l=["th","st","nd","rd"],c=_%100;return"["+_+(l[(c-20)%10]||l[c]||l[0])+"]"}},Z=function(_,l,c){var i=String(_);return!i||i.length>=l?_:""+Array(l+1-i.length).join(c)+_},pe={s:Z,z:function(_){var l=-_.utcOffset(),c=Math.abs(l),i=Math.floor(c/60),a=c%60;return(l<=0?"+":"-")+Z(i,2,"0")+":"+Z(a,2,"0")},m:function _(l,c){if(l.date()<c.date())return-_(c,l);var i=12*(c.year()-l.year())+(c.month()-l.month()),a=l.clone().add(i,A),u=c-a<0,y=l.clone().add(i+(u?-1:1),A);return+(-(i+(c-a)/(u?a-y:y-a))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:A,y:T,w:S,d:o,D:Q,h:q,m:N,s:z,ms:$,Q:D}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},oe="en",K={};K[oe]=ae;var F="$isDayjsObject",e=function(_){return _ instanceof m||!(!_||!_[F])},t=function _(l,c,i){var a;if(!l)return oe;if(typeof l=="string"){var u=l.toLowerCase();K[u]&&(a=u),c&&(K[u]=c,a=u);var y=l.split("-");if(!a&&y.length>1)return _(y[0])}else{var g=l.name;K[g]=l,a=g}return!i&&a&&(oe=a),a||!i&&oe},n=function(_,l){if(e(_))return _.clone();var c=typeof l=="object"?l:{};return c.date=_,c.args=arguments,new m(c)},s=pe;s.l=t,s.i=e,s.w=function(_,l){return n(_,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var m=function(){function _(c){this.$L=t(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[F]=!0}var l=_.prototype;return l.parse=function(c){this.$d=function(i){var a=i.date,u=i.utc;if(a===null)return new Date(NaN);if(s.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var y=a.match(X);if(y){var g=y[2]-1||0,v=(y[7]||"0").substring(0,3);return u?new Date(Date.UTC(y[1],g,y[3]||1,y[4]||0,y[5]||0,y[6]||0,v)):new Date(y[1],g,y[3]||1,y[4]||0,y[5]||0,y[6]||0,v)}}return new Date(a)}(c),this.init()},l.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},l.$utils=function(){return s},l.isValid=function(){return this.$d.toString()!==G},l.isSame=function(c,i){var a=n(c);return this.startOf(i)<=a&&a<=this.endOf(i)},l.isAfter=function(c,i){return n(c)<this.startOf(i)},l.isBefore=function(c,i){return this.endOf(i)<n(c)},l.$g=function(c,i,a){return s.u(c)?this[i]:this.set(a,c)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(c,i){var a=this,u=!!s.u(i)||i,y=s.p(c),g=function(O,x){var w=s.w(a.$u?Date.UTC(a.$y,x,O):new Date(a.$y,x,O),a);return u?w:w.endOf(o)},v=function(O,x){return s.w(a.toDate()[O].apply(a.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(x)),a)},p=this.$W,M=this.$M,L=this.$D,B="set"+(this.$u?"UTC":"");switch(y){case T:return u?g(1,0):g(31,11);case A:return u?g(1,M):g(0,M+1);case S:var Y=this.$locale().weekStart||0,k=(p<Y?p+7:p)-Y;return g(u?L-k:L+(6-k),M);case o:case Q:return v(B+"Hours",0);case q:return v(B+"Minutes",1);case N:return v(B+"Seconds",2);case z:return v(B+"Milliseconds",3);default:return this.clone()}},l.endOf=function(c){return this.startOf(c,!1)},l.$set=function(c,i){var a,u=s.p(c),y="set"+(this.$u?"UTC":""),g=(a={},a[o]=y+"Date",a[Q]=y+"Date",a[A]=y+"Month",a[T]=y+"FullYear",a[q]=y+"Hours",a[N]=y+"Minutes",a[z]=y+"Seconds",a[$]=y+"Milliseconds",a)[u],v=u===o?this.$D+(i-this.$W):i;if(u===A||u===T){var p=this.clone().set(Q,1);p.$d[g](v),p.init(),this.$d=p.set(Q,Math.min(this.$D,p.daysInMonth())).$d}else g&&this.$d[g](v);return this.init(),this},l.set=function(c,i){return this.clone().$set(c,i)},l.get=function(c){return this[s.p(c)]()},l.add=function(c,i){var a,u=this;c=Number(c);var y=s.p(i),g=function(M){var L=n(u);return s.w(L.date(L.date()+Math.round(M*c)),u)};if(y===A)return this.set(A,this.$M+c);if(y===T)return this.set(T,this.$y+c);if(y===o)return g(1);if(y===S)return g(7);var v=(a={},a[N]=d,a[q]=C,a[z]=f,a)[y]||1,p=this.$d.getTime()+c*v;return s.w(p,this)},l.subtract=function(c,i){return this.add(-1*c,i)},l.format=function(c){var i=this,a=this.$locale();if(!this.isValid())return a.invalidDate||G;var u=c||"YYYY-MM-DDTHH:mm:ssZ",y=s.z(this),g=this.$H,v=this.$m,p=this.$M,M=a.weekdays,L=a.months,B=a.meridiem,Y=function(x,w,I,U){return x&&(x[w]||x(i,u))||I[w].slice(0,U)},k=function(x){return s.s(g%12||12,x,"0")},O=B||function(x,w,I){var U=x<12?"AM":"PM";return I?U.toLowerCase():U};return u.replace(se,function(x,w){return w||function(I){switch(I){case"YY":return String(i.$y).slice(-2);case"YYYY":return s.s(i.$y,4,"0");case"M":return p+1;case"MM":return s.s(p+1,2,"0");case"MMM":return Y(a.monthsShort,p,L,3);case"MMMM":return Y(L,p);case"D":return i.$D;case"DD":return s.s(i.$D,2,"0");case"d":return String(i.$W);case"dd":return Y(a.weekdaysMin,i.$W,M,2);case"ddd":return Y(a.weekdaysShort,i.$W,M,3);case"dddd":return M[i.$W];case"H":return String(g);case"HH":return s.s(g,2,"0");case"h":return k(1);case"hh":return k(2);case"a":return O(g,v,!0);case"A":return O(g,v,!1);case"m":return String(v);case"mm":return s.s(v,2,"0");case"s":return String(i.$s);case"ss":return s.s(i.$s,2,"0");case"SSS":return s.s(i.$ms,3,"0");case"Z":return y}return null}(x)||y.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(c,i,a){var u,y=this,g=s.p(i),v=n(c),p=(v.utcOffset()-this.utcOffset())*d,M=this-v,L=function(){return s.m(y,v)};switch(g){case T:u=L()/12;break;case A:u=L();break;case D:u=L()/3;break;case S:u=(M-p)/6048e5;break;case o:u=(M-p)/864e5;break;case q:u=M/C;break;case N:u=M/d;break;case z:u=M/f;break;default:u=M}return a?u:s.a(u)},l.daysInMonth=function(){return this.endOf(A).$D},l.$locale=function(){return K[this.$L]},l.locale=function(c,i){if(!c)return this.$L;var a=this.clone(),u=t(c,i,!0);return u&&(a.$L=u),a},l.clone=function(){return s.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},_}(),b=m.prototype;return n.prototype=b,[["$ms",$],["$s",z],["$m",N],["$H",q],["$W",o],["$M",A],["$y",T],["$D",Q]].forEach(function(_){b[_[1]]=function(l){return this.$g(l,_[0],_[1])}}),n.extend=function(_,l){return _.$i||(_(l,m,n),_.$i=!0),n},n.locale=t,n.isDayjs=e,n.unix=function(_){return n(1e3*_)},n.en=K[oe],n.Ls=K,n.p={},n})}(me)),me.exports}var We=ze();const te=Ce(We);var _e={exports:{}},Be=_e.exports,xe;function Ue(){return xe||(xe=1,function(h,r){(function(f,d){h.exports=d()})(Be,function(){var f={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(d,C,$){var z=C.prototype,N=z.format;$.en.formats=f,z.format=function(q){q===void 0&&(q="YYYY-MM-DDTHH:mm:ssZ");var o=this.$locale().formats,S=function(A,D){return A.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(T,Q,G){var X=G&&G.toUpperCase();return Q||D[G]||f[G]||D[X].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(se,ae,Z){return ae||Z.slice(1)})})}(q,o===void 0?{}:o);return N.call(this,S)}}})}(_e)),_e.exports}var He=Ue();const Ye=Ce(He);te.extend(Ye);Date.prototype.isAfter=function(h,r){return te(this).isAfter(h,r)};Date.prototype.isBefore=function(h,r){return te(this).isBefore(h,r)};Date.prototype.format=function(h){return te(this).format(h)};Date.prototype.isValid=function(){return te(this).isValid()};Date.prototype.add=function(h,r){return te(this).add(h,r).toDate()};Date.prototype.subtract=function(h,r){return te(this).subtract(h,r).toDate()};Date.prototype.firstDayOfMonth=function(){return te(this).startOf("month").toDate()};Date.prototype.lastDayOfMonth=function(){return te(this).endOf("month").toDate()};Date.prototype.set=function(h,r){return te(this).set(h,r).toDate()};Date.prototype.diff=function(h,r){return te(this).diff(h,r)};String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};var Le=(h=>(h.opera="opera",h.firefox="firefox",h.safari="safari",h.ie="ie",h.edge="edge",h.edg="edg",h.electron="electron",h.chrome="chrome",h.iOsSafari="iOsSafari",h.edgiOs="edgiOs",h.headlessChrome="headlessChrome",h))(Le||{});const ye=[{breakpoint:"xs",screenWidth:0},{breakpoint:"sm",screenWidth:375},{breakpoint:"md",screenWidth:768},{breakpoint:"lg",screenWidth:992},{breakpoint:"xl",screenWidth:1200},{breakpoint:"xxl",screenWidth:1400},{breakpoint:"xxxl",screenWidth:1600}];class Pe{screenWidth=0;lastBreakpoint;resizeListener;resizeCallbacks=new Set;constructor(){typeof window<"u"&&(this.screenWidth=window.innerWidth,this.resizeListener=this.onResize.bind(this),window.addEventListener("resize",this.resizeListener),this.lastBreakpoint=this.getBreakpointBySize(this.screenWidth))}destroy(){typeof window<"u"&&window.removeEventListener("resize",this.resizeListener),this.resizeCallbacks.clear()}onBreakpointChange(r){this.resizeCallbacks.add(r)}offBreakpointChange(r){this.resizeCallbacks.delete(r)}getCurrentBrowser(){const r=navigator.userAgent.toLowerCase();if(this.isOpera())return"opera";if(this.isFirefox())return"firefox";if(this.isSafari())return"safari";if(this.isIE())return"ie";if(this.isEdge())return"edge";if(this.isEdg())return"edg";if(this.isElectron(r))return"electron";if(this.isChrome())return"chrome";if(this.isIOsSafari(r))return"iOsSafari";if(this.isEdgiOs(r))return"edgiOs";if(this.isHeadlessChrome(r))return"headlessChrome";throw new Error("Browser could not be detected: "+r)}getBreakpointBySize(r=this.screenWidth){let f=ye[0];for(const d of ye)d.screenWidth<=r&&(f=d);return f}isScreenGreaterThan(r){const f=this.getBreakpoint(r);return this.screenWidth>(f?.screenWidth??0)}isScreenSmallerThan(r){const f=this.getBreakpoint(r);return this.screenWidth<(f?.screenWidth??0)}getBreakpoint(r){return ye.find(f=>f.breakpoint===r)}isOpera(){return typeof window<"u"&&(!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.includes("OPR/"))}isFirefox(){return typeof InstallTrigger<"u"}isSafari(){return/constructor/i.test(window.HTMLElement)||(r=>r.toString()==="[object SafariRemoteNotification]")(!window.safari||window.safari&&window.safari.pushNotification)}isIE(){return!!document.documentMode}isEdge(){return!this.isIE()&&!!window.StyleMedia}isEdg(){return navigator.userAgent.toLowerCase().includes("edg")}isElectron(r){return r.includes("electron")}isChrome(){return typeof window<"u"&&!!window.chrome&&!this.isOpera()&&!this.isEdge()&&!this.isEdg()&&!this.isFirefox()&&!this.isSafari()&&!this.isIE()}isIOsSafari(r){return r.includes("iphone")||r.includes("ipad")||r.includes("macintosh")&&"ontouchend"in document&&r.includes("safari")}isEdgiOs(r){return r.includes("edgios")}isHeadlessChrome(r){return r.includes("headlesschrome")}onResize(r){const f=r.target.innerWidth;this.screenWidth=f;const d=this.getBreakpointBySize(f);this.lastBreakpoint?.breakpoint!==d?.breakpoint&&(this.lastBreakpoint=d,this.resizeCallbacks.forEach(C=>C(d)))}}class qe{copy(r){return navigator.clipboard.writeText(r)}}var ve={exports:{}},Ne=ve.exports,De;function Ke(){return De||(De=1,function(h,r){(function(f,d){d()})(Ne,function(){function f(o,S){return typeof S>"u"?S={autoBom:!1}:typeof S!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),S={autoBom:!S}),S.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type)?new Blob(["\uFEFF",o],{type:o.type}):o}function d(o,S,A){var D=new XMLHttpRequest;D.open("GET",o),D.responseType="blob",D.onload=function(){q(D.response,S,A)},D.onerror=function(){console.error("could not download file")},D.send()}function C(o){var S=new XMLHttpRequest;S.open("HEAD",o,!1);try{S.send()}catch{}return 200<=S.status&&299>=S.status}function $(o){try{o.dispatchEvent(new MouseEvent("click"))}catch{var S=document.createEvent("MouseEvents");S.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),o.dispatchEvent(S)}}var z=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ge=="object"&&ge.global===ge?ge:void 0,N=z.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),q=z.saveAs||(typeof window!="object"||window!==z?function(){}:"download"in HTMLAnchorElement.prototype&&!N?function(o,S,A){var D=z.URL||z.webkitURL,T=document.createElement("a");S=S||o.name||"download",T.download=S,T.rel="noopener",typeof o=="string"?(T.href=o,T.origin===location.origin?$(T):C(T.href)?d(o,S,A):$(T,T.target="_blank")):(T.href=D.createObjectURL(o),setTimeout(function(){D.revokeObjectURL(T.href)},4e4),setTimeout(function(){$(T)},0))}:"msSaveOrOpenBlob"in navigator?function(o,S,A){if(S=S||o.name||"download",typeof o!="string")navigator.msSaveOrOpenBlob(f(o,A),S);else if(C(o))d(o,S,A);else{var D=document.createElement("a");D.href=o,D.target="_blank",setTimeout(function(){$(D)})}}:function(o,S,A,D){if(D=D||open("","_blank"),D&&(D.document.title=D.document.body.innerText="downloading..."),typeof o=="string")return d(o,S,A);var T=o.type==="application/octet-stream",Q=/constructor/i.test(z.HTMLElement)||z.safari,G=/CriOS\/[\d]+/.test(navigator.userAgent);if((G||T&&Q||N)&&typeof FileReader<"u"){var X=new FileReader;X.onloadend=function(){var Z=X.result;Z=G?Z:Z.replace(/^data:[^;]*;/,"data:attachment/file;"),D?D.location.href=Z:location=Z,D=null},X.readAsDataURL(o)}else{var se=z.URL||z.webkitURL,ae=se.createObjectURL(o);D?D.location=ae:location.href=ae,D=null,setTimeout(function(){se.revokeObjectURL(ae)},4e4)}});z.saveAs=q.saveAs=q,h.exports=q})}(ve)),ve.exports}var Je=Ke(),we={exports:{}};/* @license
2
2
  Papa Parse
3
3
  v5.5.3
4
4
  https://github.com/mholt/PapaParse
5
5
  License: MIT
6
- */var Te=ge.exports,Ee;function Ie(){return Ee||(Ee=1,function(b,i){((u,l)=>{b.exports=l()})(Te,function u(){var l=typeof self<"u"?self:typeof window<"u"?window:l!==void 0?l:{},O,C=!l.document&&!!l.postMessage,q=l.IS_PAPA_WORKER||!1,re={},ie=0,n={};function p(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(t){var r=_e(t);r.chunkSize=parseInt(r.chunkSize),t.step||t.chunk||(r.chunkSize=null),this._handle=new ue(r),(this._handle.streamer=this)._config=r}).call(this,e),this.parseChunk=function(t,r){var a=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<a){let g=this._config.newline;g||(s=this._config.quoteChar||'"',g=this._handle.guessLineEndings(t,s)),t=[...t.split(g).slice(a)].join(g)}this.isFirstChunk&&S(this._config.beforeFirstChunk)&&(s=this._config.beforeFirstChunk(t))!==void 0&&(t=s),this.isFirstChunk=!1,this._halted=!1;var a=this._partialLine+t,s=(this._partialLine="",this._handle.parse(a,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(t=s.meta.cursor,a=(this._finished||(this._partialLine=a.substring(t-this._baseIndex),this._baseIndex=t),s&&s.data&&(this._rowCount+=s.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),q)l.postMessage({results:s,workerId:n.WORKER_ID,finished:a});else if(S(this._config.chunk)&&!r){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=s=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),this._completed||!a||!S(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||s&&s.meta.paused||this._nextChunk(),s}this._halted=!0},this._sendError=function(t){S(this._config.error)?this._config.error(t):q&&this._config.error&&l.postMessage({workerId:n.WORKER_ID,error:t,finished:!1})}}function P(e){var t;(e=e||{}).chunkSize||(e.chunkSize=n.RemoteChunkSize),p.call(this,e),this._nextChunk=C?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(r){this._input=r,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),C||(t.onload=ee(this._chunkLoaded,this),t.onerror=ee(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!C),this._config.downloadRequestHeaders){var r,a=this._config.downloadRequestHeaders;for(r in a)t.setRequestHeader(r,a[r])}var s;this._config.chunkSize&&(s=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+s));try{t.send(this._config.downloadRequestBody)}catch(g){this._chunkError(g.message)}C&&t.status===0&&this._chunkError()}},this._chunkLoaded=function(){t.readyState===4&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(r=>(r=r.getResponseHeader("Content-Range"))!==null?parseInt(r.substring(r.lastIndexOf("/")+1)):-1)(t),this.parseChunk(t.responseText)))},this._chunkError=function(r){r=t.statusText||r,this._sendError(new Error(r))}}function k(e){(e=e||{}).chunkSize||(e.chunkSize=n.LocalChunkSize),p.call(this,e);var t,r,a=typeof FileReader<"u";this.stream=function(s){this._input=s,r=s.slice||s.webkitSlice||s.mozSlice,a?((t=new FileReader).onload=ee(this._chunkLoaded,this),t.onerror=ee(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var s=this._input,g=(this._config.chunkSize&&(g=Math.min(this._start+this._config.chunkSize,this._input.size),s=r.call(s,this._start,g)),t.readAsText(s,this._config.encoding));a||this._chunkLoaded({target:{result:g}})},this._chunkLoaded=function(s){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(s.target.result)},this._chunkError=function(){this._sendError(t.error)}}function F(e){var t;p.call(this,e=e||{}),this.stream=function(r){return t=r,this._nextChunk()},this._nextChunk=function(){var r,a;if(!this._finished)return r=this._config.chunkSize,t=r?(a=t.substring(0,r),t.substring(r)):(a=t,""),this._finished=!t,this.parseChunk(a)}}function ne(e){p.call(this,e=e||{});var t=[],r=!0,a=!1;this.pause=function(){p.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){p.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(s){this._input=s,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){a&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=ee(function(s){try{t.push(typeof s=="string"?s:s.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(g){this._streamError(g)}},this),this._streamError=ee(function(s){this._streamCleanUp(),this._sendError(s)},this),this._streamEnd=ee(function(){this._streamCleanUp(),a=!0,this._streamData("")},this),this._streamCleanUp=ee(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function ue(e){var t,r,a,s,g=Math.pow(2,53),j=-g,N=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,K=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,_=this,L=0,h=0,W=!1,f=!1,m=[],o={data:[],errors:[],meta:{}};function D(v){return e.skipEmptyLines==="greedy"?v.join("").trim()==="":v.length===1&&v[0].length===0}function I(){if(o&&a&&($("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+n.DefaultDelimiter+"'"),a=!1),e.skipEmptyLines&&(o.data=o.data.filter(function(d){return!D(d)})),M()){let d=function(T,z){S(e.transformHeader)&&(T=e.transformHeader(T,z)),m.push(T)};if(o)if(Array.isArray(o.data[0])){for(var v=0;M()&&v<o.data.length;v++)o.data[v].forEach(d);o.data.splice(0,1)}else o.data.forEach(d)}function y(d,T){for(var z=e.header?{}:[],E=0;E<d.length;E++){var R=E,w=d[E],w=((J,c)=>(x=>(e.dynamicTypingFunction&&e.dynamicTyping[x]===void 0&&(e.dynamicTyping[x]=e.dynamicTypingFunction(x)),(e.dynamicTyping[x]||e.dynamicTyping)===!0))(J)?c==="true"||c==="TRUE"||c!=="false"&&c!=="FALSE"&&((x=>{if(N.test(x)&&(x=parseFloat(x),j<x&&x<g))return 1})(c)?parseFloat(c):K.test(c)?new Date(c):c===""?null:c):c)(R=e.header?E>=m.length?"__parsed_extra":m[E]:R,w=e.transform?e.transform(w,R):w);R==="__parsed_extra"?(z[R]=z[R]||[],z[R].push(w)):z[R]=w}return e.header&&(E>m.length?$("FieldMismatch","TooManyFields","Too many fields: expected "+m.length+" fields but parsed "+E,h+T):E<m.length&&$("FieldMismatch","TooFewFields","Too few fields: expected "+m.length+" fields but parsed "+E,h+T)),z}var A;o&&(e.header||e.dynamicTyping||e.transform)&&(A=1,!o.data.length||Array.isArray(o.data[0])?(o.data=o.data.map(y),A=o.data.length):o.data=y(o.data,0),e.header&&o.meta&&(o.meta.fields=m),h+=A)}function M(){return e.header&&m.length===0}function $(v,y,A,d){v={type:v,code:y,message:A},d!==void 0&&(v.row=d),o.errors.push(v)}S(e.step)&&(s=e.step,e.step=function(v){o=v,M()?I():(I(),o.data.length!==0&&(L+=v.data.length,e.preview&&L>e.preview?r.abort():(o.data=o.data[0],s(o,_))))}),this.parse=function(v,y,A){var d=e.quoteChar||'"',d=(e.newline||(e.newline=this.guessLineEndings(v,d)),a=!1,e.delimiter?S(e.delimiter)&&(e.delimiter=e.delimiter(v),o.meta.delimiter=e.delimiter):((d=((T,z,E,R,w)=>{var J,c,x,te;w=w||[","," ","|",";",n.RECORD_SEP,n.UNIT_SEP];for(var ae=0;ae<w.length;ae++){for(var Q,he=w[ae],U=0,G=0,B=0,H=(x=void 0,new se({comments:R,delimiter:he,newline:z,preview:10}).parse(T)),Y=0;Y<H.data.length;Y++)E&&D(H.data[Y])?B++:(Q=H.data[Y].length,G+=Q,x===void 0?x=Q:0<Q&&(U+=Math.abs(Q-x),x=Q));0<H.data.length&&(G/=H.data.length-B),(c===void 0||U<=c)&&(te===void 0||te<G)&&1.99<G&&(c=U,J=he,te=G)}return{successful:!!(e.delimiter=J),bestDelimiter:J}})(v,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=d.bestDelimiter:(a=!0,e.delimiter=n.DefaultDelimiter),o.meta.delimiter=e.delimiter),_e(e));return e.preview&&e.header&&d.preview++,t=v,r=new se(d),o=r.parse(t,y,A),I(),W?{meta:{paused:!0}}:o||{meta:{paused:!1}}},this.paused=function(){return W},this.pause=function(){W=!0,r.abort(),t=S(e.chunk)?"":t.substring(r.getCharIndex())},this.resume=function(){_.streamer._halted?(W=!1,_.streamer.parseChunk(t,!0)):setTimeout(_.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,r.abort(),o.meta.aborted=!0,S(e.complete)&&e.complete(o),t=""},this.guessLineEndings=function(T,d){T=T.substring(0,1048576);var d=new RegExp(Z(d)+"([^]*?)"+Z(d),"gm"),A=(T=T.replace(d,"")).split("\r"),d=T.split(`
7
- `),T=1<d.length&&d[0].length<A[0].length;if(A.length===1||T)return`
8
- `;for(var z=0,E=0;E<A.length;E++)A[E][0]===`
9
- `&&z++;return z>=A.length/2?`\r
10
- `:"\r"}}function Z(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function se(e){var t=(e=e||{}).delimiter,r=e.newline,a=e.comments,s=e.step,g=e.preview,j=e.fastMode,N=null,K=!1,_=e.quoteChar==null?'"':e.quoteChar,L=_;if(e.escapeChar!==void 0&&(L=e.escapeChar),(typeof t!="string"||-1<n.BAD_DELIMITERS.indexOf(t))&&(t=","),a===t)throw new Error("Comment character same as delimiter");a===!0?a="#":(typeof a!="string"||-1<n.BAD_DELIMITERS.indexOf(a))&&(a=!1),r!==`
11
- `&&r!=="\r"&&r!==`\r
12
- `&&(r=`
13
- `);var h=0,W=!1;this.parse=function(f,m,o){if(typeof f!="string")throw new Error("Input must be a string");var D=f.length,I=t.length,M=r.length,$=a.length,v=S(s),y=[],A=[],d=[],T=h=0;if(!f)return U();if(j||j!==!1&&f.indexOf(_)===-1){for(var z=f.split(r),E=0;E<z.length;E++){if(d=z[E],h+=d.length,E!==z.length-1)h+=r.length;else if(o)return U();if(!a||d.substring(0,$)!==a){if(v){if(y=[],te(d.split(t)),G(),W)return U()}else te(d.split(t));if(g&&g<=E)return y=y.slice(0,g),U(!0)}}return U()}for(var R=f.indexOf(t,h),w=f.indexOf(r,h),J=new RegExp(Z(L)+Z(_),"g"),c=f.indexOf(_,h);;)if(f[h]===_)for(c=h,h++;;){if((c=f.indexOf(_,c+1))===-1)return o||A.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:y.length,index:h}),Q();if(c===D-1)return Q(f.substring(h,c).replace(J,_));if(_===L&&f[c+1]===L)c++;else if(_===L||c===0||f[c-1]!==L){R!==-1&&R<c+1&&(R=f.indexOf(t,c+1));var x=ae((w=w!==-1&&w<c+1?f.indexOf(r,c+1):w)===-1?R:Math.min(R,w));if(f.substr(c+1+x,I)===t){d.push(f.substring(h,c).replace(J,_)),f[h=c+1+x+I]!==_&&(c=f.indexOf(_,h)),R=f.indexOf(t,h),w=f.indexOf(r,h);break}if(x=ae(w),f.substring(c+1+x,c+1+x+M)===r){if(d.push(f.substring(h,c).replace(J,_)),he(c+1+x+M),R=f.indexOf(t,h),c=f.indexOf(_,h),v&&(G(),W))return U();if(g&&y.length>=g)return U(!0);break}A.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:y.length,index:h}),c++}}else if(a&&d.length===0&&f.substring(h,h+$)===a){if(w===-1)return U();h=w+M,w=f.indexOf(r,h),R=f.indexOf(t,h)}else if(R!==-1&&(R<w||w===-1))d.push(f.substring(h,R)),h=R+I,R=f.indexOf(t,h);else{if(w===-1)break;if(d.push(f.substring(h,w)),he(w+M),v&&(G(),W))return U();if(g&&y.length>=g)return U(!0)}return Q();function te(B){y.push(B),T=h}function ae(B){var H=0;return H=B!==-1&&(B=f.substring(c+1,B))&&B.trim()===""?B.length:H}function Q(B){return o||(B===void 0&&(B=f.substring(h)),d.push(B),h=D,te(d),v&&G()),U()}function he(B){h=B,te(d),d=[],w=f.indexOf(r,h)}function U(B){if(e.header&&!m&&y.length&&!K){var H=y[0],Y=Object.create(null),me=new Set(H);let ye=!1;for(let oe=0;oe<H.length;oe++){let X=H[oe];if(Y[X=S(e.transformHeader)?e.transformHeader(X,oe):X]){let de,ke=Y[X];for(;de=X+"_"+ke,ke++,me.has(de););me.add(de),H[oe]=de,Y[X]++,ye=!0,(N=N===null?{}:N)[de]=X}else Y[X]=1,H[oe]=X;me.add(X)}ye&&console.warn("Duplicate headers found and renamed."),K=!0}return{data:y,errors:A,meta:{delimiter:t,linebreak:r,aborted:W,truncated:!!B,cursor:T+(m||0),renamedHeaders:N}}}function G(){s(U()),y=[],A=[]}},this.abort=function(){W=!0},this.getCharIndex=function(){return h}}function le(e){var t=e.data,r=re[t.workerId],a=!1;if(t.error)r.userError(t.error,t.file);else if(t.results&&t.results.data){var s={abort:function(){a=!0,V(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:we,resume:we};if(S(r.userStep)){for(var g=0;g<t.results.data.length&&(r.userStep({data:t.results.data[g],errors:t.results.errors,meta:t.results.meta},s),!a);g++);delete t.results}else S(r.userChunk)&&(r.userChunk(t.results,s,t.file),delete t.results)}t.finished&&!a&&V(t.workerId,t.results)}function V(e,t){var r=re[e];S(r.userComplete)&&r.userComplete(t),r.terminate(),delete re[e]}function we(){throw new Error("Not implemented.")}function _e(e){if(typeof e!="object"||e===null)return e;var t,r=Array.isArray(e)?[]:{};for(t in e)r[t]=_e(e[t]);return r}function ee(e,t){return function(){e.apply(t,arguments)}}function S(e){return typeof e=="function"}return n.parse=function(e,t){var r=(t=t||{}).dynamicTyping||!1;if(S(r)&&(t.dynamicTypingFunction=r,r={}),t.dynamicTyping=r,t.transform=!!S(t.transform)&&t.transform,!t.worker||!n.WORKERS_SUPPORTED)return r=null,n.NODE_STREAM_INPUT,typeof e=="string"?(e=(a=>a.charCodeAt(0)!==65279?a:a.slice(1))(e),r=new(t.download?P:F)(t)):e.readable===!0&&S(e.read)&&S(e.on)?r=new ne(t):(l.File&&e instanceof File||e instanceof Object)&&(r=new k(t)),r.stream(e);(r=(()=>{var a;return!!n.WORKERS_SUPPORTED&&(a=(()=>{var s=l.URL||l.webkitURL||null,g=u.toString();return n.BLOB_URL||(n.BLOB_URL=s.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",g,")();"],{type:"text/javascript"})))})(),(a=new l.Worker(a)).onmessage=le,a.id=ie++,re[a.id]=a)})()).userStep=t.step,r.userChunk=t.chunk,r.userComplete=t.complete,r.userError=t.error,t.step=S(t.step),t.chunk=S(t.chunk),t.complete=S(t.complete),t.error=S(t.error),delete t.worker,r.postMessage({input:e,config:t,workerId:r.id})},n.unparse=function(e,t){var r=!1,a=!0,s=",",g=`\r
14
- `,j='"',N=j+j,K=!1,_=null,L=!1,h=((()=>{if(typeof t=="object"){if(typeof t.delimiter!="string"||n.BAD_DELIMITERS.filter(function(m){return t.delimiter.indexOf(m)!==-1}).length||(s=t.delimiter),typeof t.quotes!="boolean"&&typeof t.quotes!="function"&&!Array.isArray(t.quotes)||(r=t.quotes),typeof t.skipEmptyLines!="boolean"&&typeof t.skipEmptyLines!="string"||(K=t.skipEmptyLines),typeof t.newline=="string"&&(g=t.newline),typeof t.quoteChar=="string"&&(j=t.quoteChar),typeof t.header=="boolean"&&(a=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw new Error("Option columns is empty");_=t.columns}t.escapeChar!==void 0&&(N=t.escapeChar+j),t.escapeFormulae instanceof RegExp?L=t.escapeFormulae:typeof t.escapeFormulae=="boolean"&&t.escapeFormulae&&(L=/^[=+\-@\t\r].*$/)}})(),new RegExp(Z(j),"g"));if(typeof e=="string"&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return W(null,e,K);if(typeof e[0]=="object")return W(_||Object.keys(e[0]),e,K)}else if(typeof e=="object")return typeof e.data=="string"&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||_),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:typeof e.data[0]=="object"?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||typeof e.data[0]=="object"||(e.data=[e.data])),W(e.fields||[],e.data||[],K);throw new Error("Unable to serialize unrecognized input");function W(m,o,D){var I="",M=(typeof m=="string"&&(m=JSON.parse(m)),typeof o=="string"&&(o=JSON.parse(o)),Array.isArray(m)&&0<m.length),$=!Array.isArray(o[0]);if(M&&a){for(var v=0;v<m.length;v++)0<v&&(I+=s),I+=f(m[v],v);0<o.length&&(I+=g)}for(var y=0;y<o.length;y++){var A=(M?m:o[y]).length,d=!1,T=M?Object.keys(o[y]).length===0:o[y].length===0;if(D&&!M&&(d=D==="greedy"?o[y].join("").trim()==="":o[y].length===1&&o[y][0].length===0),D==="greedy"&&M){for(var z=[],E=0;E<A;E++){var R=$?m[E]:E;z.push(o[y][R])}d=z.join("").trim()===""}if(!d){for(var w=0;w<A;w++){0<w&&!T&&(I+=s);var J=M&&$?m[w]:w;I+=f(o[y][J],w)}y<o.length-1&&(!D||0<A&&!T)&&(I+=g)}}return I}function f(m,o){var D,I;return m==null?"":m.constructor===Date?JSON.stringify(m).slice(1,25):(I=!1,L&&typeof m=="string"&&L.test(m)&&(m="'"+m,I=!0),D=m.toString().replace(h,N),(I=I||r===!0||typeof r=="function"&&r(m,o)||Array.isArray(r)&&r[o]||((M,$)=>{for(var v=0;v<$.length;v++)if(-1<M.indexOf($[v]))return!0;return!1})(D,n.BAD_DELIMITERS)||-1<D.indexOf(s)||D.charAt(0)===" "||D.charAt(D.length-1)===" ")?j+D+j:D)}},n.RECORD_SEP="",n.UNIT_SEP="",n.BYTE_ORDER_MARK="\uFEFF",n.BAD_DELIMITERS=["\r",`
15
- `,'"',n.BYTE_ORDER_MARK],n.WORKERS_SUPPORTED=!C&&!!l.Worker,n.NODE_STREAM_INPUT=1,n.LocalChunkSize=10485760,n.RemoteChunkSize=5242880,n.DefaultDelimiter=",",n.Parser=se,n.ParserHandle=ue,n.NetworkStreamer=P,n.FileStreamer=k,n.StringStreamer=F,n.ReadableStreamStreamer=ne,l.jQuery&&((O=l.jQuery).fn.parse=function(e){var t=e.config||{},r=[];return this.each(function(g){if(!(O(this).prop("tagName").toUpperCase()==="INPUT"&&O(this).attr("type").toLowerCase()==="file"&&l.FileReader)||!this.files||this.files.length===0)return!0;for(var j=0;j<this.files.length;j++)r.push({file:this.files[j],inputElem:this,instanceConfig:O.extend({},t)})}),a(),this;function a(){if(r.length===0)S(e.complete)&&e.complete();else{var g,j,N,K,_=r[0];if(S(e.before)){var L=e.before(_.file,_.inputElem);if(typeof L=="object"){if(L.action==="abort")return g="AbortError",j=_.file,N=_.inputElem,K=L.reason,void(S(e.error)&&e.error({name:g},j,N,K));if(L.action==="skip")return void s();typeof L.config=="object"&&(_.instanceConfig=O.extend(_.instanceConfig,L.config))}else if(L==="skip")return void s()}var h=_.instanceConfig.complete;_.instanceConfig.complete=function(W){S(h)&&h(W,_.file,_.inputElem),s()},n.parse(_.file,_.instanceConfig)}}function s(){r.splice(0,1),a()}}),q&&(l.onmessage=function(e){e=e.data,n.WORKER_ID===void 0&&e&&(n.WORKER_ID=e.workerId),typeof e.input=="string"?l.postMessage({workerId:n.WORKER_ID,results:n.parse(e.input,e.config),finished:!0}):(l.File&&e.input instanceof File||e.input instanceof Object)&&(e=n.parse(e.input,e.config))&&l.postMessage({workerId:n.WORKER_ID,results:e,finished:!0})}),(P.prototype=Object.create(p.prototype)).constructor=P,(k.prototype=Object.create(p.prototype)).constructor=k,(F.prototype=Object.create(F.prototype)).constructor=F,(ne.prototype=Object.create(p.prototype)).constructor=ne,n})}(ge)),ge.exports}var Se=Ie();class Fe{readAsText(i){const u=new FileReader;return new Promise((l,O)=>{u.onload=C=>{l(C)},u.onerror=C=>{O(C)},u.readAsText(i)})}readAsBinaryString(i){const u=new FileReader;return new Promise((l,O)=>{u.onload=C=>{l(C)},u.onerror=C=>{O(C)},u.readAsBinaryString(i)})}readAsDataUrl(i){const u=new FileReader;return new Promise((l,O)=>{u.onload=C=>{l(C)},u.onerror=C=>O(C),u.readAsDataURL(i)})}unparse(i,u){return Se.unparse(i,u)}parse(i){return new Promise((u,l)=>{Se.parse(i,{header:!0,complete:O=>u(O),error:O=>l(O)})})}getFileExtension(i){let u="-";return/[.]/.exec(i)&&(u=`.${/[^.]+$/.exec(i)?.[0]}`),u}save(i,u,l){const O=new Blob([i],{type:l});Ae.saveAs(O,u,{autoBom:!0})}}class je{set(i,u){localStorage.setItem(i,JSON.stringify(u))}get(i){let u=null;const l=localStorage.getItem(i);return l&&(u=JSON.parse(l)),u}remove(i){localStorage.removeItem(i)}removeAll(){localStorage.clear()}getKeysBy(i){return Object.keys(localStorage).filter(u=>u.startsWith(i))}}var ve=(b=>(b.log="log",b.info="info",b.warn="warn",b.debug="debug",b.error="error",b))(ve||{});class De{logType=ve;log(...i){this._doLog(this.logType.log,i.join(" "))}info(...i){this._doLog(this.logType.info,i.join(" "))}warn(...i){this._doLog(this.logType.warn,i.join(" "))}debug(...i){this._doLog(this.logType.debug,i.join(" "))}error(...i){this._doLog(this.logType.error,i.join(" "))}_doLog(i,...u){console[i].apply(console,u)}}class ze{constructor(i){this.localService=i}get(i){return this.localService.get(i)}set(i,u){this.localService.set(i,u)}remove(i){this.localService.remove(i)}}exports.BrowserService=xe;exports.BrowserType=Re;exports.ClipboardService=Oe;exports.FileService=Fe;exports.LocalService=je;exports.LogType=ve;exports.LoggerService=De;exports.ScreenBreakpoints=ce;exports.TokenService=ze;
6
+ */var Qe=we.exports,Me;function Ze(){return Me||(Me=1,function(h,r){((f,d)=>{h.exports=d()})(Qe,function f(){var d=typeof self<"u"?self:typeof window<"u"?window:d!==void 0?d:{},C,$=!d.document&&!!d.postMessage,z=d.IS_PAPA_WORKER||!1,N={},q=0,o={};function S(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(t){var n=oe(t);n.chunkSize=parseInt(n.chunkSize),t.step||t.chunk||(n.chunkSize=null),this._handle=new G(n),(this._handle.streamer=this)._config=n}).call(this,e),this.parseChunk=function(t,n){var s=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<s){let b=this._config.newline;b||(m=this._config.quoteChar||'"',b=this._handle.guessLineEndings(t,m)),t=[...t.split(b).slice(s)].join(b)}this.isFirstChunk&&F(this._config.beforeFirstChunk)&&(m=this._config.beforeFirstChunk(t))!==void 0&&(t=m),this.isFirstChunk=!1,this._halted=!1;var s=this._partialLine+t,m=(this._partialLine="",this._handle.parse(s,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(t=m.meta.cursor,s=(this._finished||(this._partialLine=s.substring(t-this._baseIndex),this._baseIndex=t),m&&m.data&&(this._rowCount+=m.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),z)d.postMessage({results:m,workerId:o.WORKER_ID,finished:s});else if(F(this._config.chunk)&&!n){if(this._config.chunk(m,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=m=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(m.data),this._completeResults.errors=this._completeResults.errors.concat(m.errors),this._completeResults.meta=m.meta),this._completed||!s||!F(this._config.complete)||m&&m.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),s||m&&m.meta.paused||this._nextChunk(),m}this._halted=!0},this._sendError=function(t){F(this._config.error)?this._config.error(t):z&&this._config.error&&d.postMessage({workerId:o.WORKER_ID,error:t,finished:!1})}}function A(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),S.call(this,e),this._nextChunk=$?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(n){this._input=n,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),$||(t.onload=K(this._chunkLoaded,this),t.onerror=K(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!$),this._config.downloadRequestHeaders){var n,s=this._config.downloadRequestHeaders;for(n in s)t.setRequestHeader(n,s[n])}var m;this._config.chunkSize&&(m=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+m));try{t.send(this._config.downloadRequestBody)}catch(b){this._chunkError(b.message)}$&&t.status===0&&this._chunkError()}},this._chunkLoaded=function(){t.readyState===4&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(n=>(n=n.getResponseHeader("Content-Range"))!==null?parseInt(n.substring(n.lastIndexOf("/")+1)):-1)(t),this.parseChunk(t.responseText)))},this._chunkError=function(n){n=t.statusText||n,this._sendError(new Error(n))}}function D(e){(e=e||{}).chunkSize||(e.chunkSize=o.LocalChunkSize),S.call(this,e);var t,n,s=typeof FileReader<"u";this.stream=function(m){this._input=m,n=m.slice||m.webkitSlice||m.mozSlice,s?((t=new FileReader).onload=K(this._chunkLoaded,this),t.onerror=K(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var m=this._input,b=(this._config.chunkSize&&(b=Math.min(this._start+this._config.chunkSize,this._input.size),m=n.call(m,this._start,b)),t.readAsText(m,this._config.encoding));s||this._chunkLoaded({target:{result:b}})},this._chunkLoaded=function(m){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(m.target.result)},this._chunkError=function(){this._sendError(t.error)}}function T(e){var t;S.call(this,e=e||{}),this.stream=function(n){return t=n,this._nextChunk()},this._nextChunk=function(){var n,s;if(!this._finished)return n=this._config.chunkSize,t=n?(s=t.substring(0,n),t.substring(n)):(s=t,""),this._finished=!t,this.parseChunk(s)}}function Q(e){S.call(this,e=e||{});var t=[],n=!0,s=!1;this.pause=function(){S.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){S.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(m){this._input=m,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){s&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=K(function(m){try{t.push(typeof m=="string"?m:m.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(b){this._streamError(b)}},this),this._streamError=K(function(m){this._streamCleanUp(),this._sendError(m)},this),this._streamEnd=K(function(){this._streamCleanUp(),s=!0,this._streamData("")},this),this._streamCleanUp=K(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function G(e){var t,n,s,m,b=Math.pow(2,53),_=-b,l=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,c=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,i=this,a=0,u=0,y=!1,g=!1,v=[],p={data:[],errors:[],meta:{}};function M(k){return e.skipEmptyLines==="greedy"?k.join("").trim()==="":k.length===1&&k[0].length===0}function L(){if(p&&s&&(Y("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),s=!1),e.skipEmptyLines&&(p.data=p.data.filter(function(w){return!M(w)})),B()){let w=function(I,U){F(e.transformHeader)&&(I=e.transformHeader(I,U)),v.push(I)};if(p)if(Array.isArray(p.data[0])){for(var k=0;B()&&k<p.data.length;k++)p.data[k].forEach(w);p.data.splice(0,1)}else p.data.forEach(w)}function O(w,I){for(var U=e.header?{}:[],j=0;j<w.length;j++){var W=j,R=w[j],R=((ee,E)=>(H=>(e.dynamicTypingFunction&&e.dynamicTyping[H]===void 0&&(e.dynamicTyping[H]=e.dynamicTypingFunction(H)),(e.dynamicTyping[H]||e.dynamicTyping)===!0))(ee)?E==="true"||E==="TRUE"||E!=="false"&&E!=="FALSE"&&((H=>{if(l.test(H)&&(H=parseFloat(H),_<H&&H<b))return 1})(E)?parseFloat(E):c.test(E)?new Date(E):E===""?null:E):E)(W=e.header?j>=v.length?"__parsed_extra":v[j]:W,R=e.transform?e.transform(R,W):R);W==="__parsed_extra"?(U[W]=U[W]||[],U[W].push(R)):U[W]=R}return e.header&&(j>v.length?Y("FieldMismatch","TooManyFields","Too many fields: expected "+v.length+" fields but parsed "+j,u+I):j<v.length&&Y("FieldMismatch","TooFewFields","Too few fields: expected "+v.length+" fields but parsed "+j,u+I)),U}var x;p&&(e.header||e.dynamicTyping||e.transform)&&(x=1,!p.data.length||Array.isArray(p.data[0])?(p.data=p.data.map(O),x=p.data.length):p.data=O(p.data,0),e.header&&p.meta&&(p.meta.fields=v),u+=x)}function B(){return e.header&&v.length===0}function Y(k,O,x,w){k={type:k,code:O,message:x},w!==void 0&&(k.row=w),p.errors.push(k)}F(e.step)&&(m=e.step,e.step=function(k){p=k,B()?L():(L(),p.data.length!==0&&(a+=k.data.length,e.preview&&a>e.preview?n.abort():(p.data=p.data[0],m(p,i))))}),this.parse=function(k,O,x){var w=e.quoteChar||'"',w=(e.newline||(e.newline=this.guessLineEndings(k,w)),s=!1,e.delimiter?F(e.delimiter)&&(e.delimiter=e.delimiter(k),p.meta.delimiter=e.delimiter):((w=((I,U,j,W,R)=>{var ee,E,H,ce;R=R||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var he=0;he<R.length;he++){for(var re,le=R[he],J=0,ne=0,P=0,V=(H=void 0,new se({comments:W,delimiter:le,newline:U,preview:10}).parse(I)),ue=0;ue<V.data.length;ue++)j&&M(V.data[ue])?P++:(re=V.data[ue].length,ne+=re,H===void 0?H=re:0<re&&(J+=Math.abs(re-H),H=re));0<V.data.length&&(ne/=V.data.length-P),(E===void 0||J<=E)&&(ce===void 0||ce<ne)&&1.99<ne&&(E=J,ee=le,ce=ne)}return{successful:!!(e.delimiter=ee),bestDelimiter:ee}})(k,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=w.bestDelimiter:(s=!0,e.delimiter=o.DefaultDelimiter),p.meta.delimiter=e.delimiter),oe(e));return e.preview&&e.header&&w.preview++,t=k,n=new se(w),p=n.parse(t,O,x),L(),y?{meta:{paused:!0}}:p||{meta:{paused:!1}}},this.paused=function(){return y},this.pause=function(){y=!0,n.abort(),t=F(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){i.streamer._halted?(y=!1,i.streamer.parseChunk(t,!0)):setTimeout(i.resume,3)},this.aborted=function(){return g},this.abort=function(){g=!0,n.abort(),p.meta.aborted=!0,F(e.complete)&&e.complete(p),t=""},this.guessLineEndings=function(I,w){I=I.substring(0,1048576);var w=new RegExp(X(w)+"([^]*?)"+X(w),"gm"),x=(I=I.replace(w,"")).split("\r"),w=I.split(`
7
+ `),I=1<w.length&&w[0].length<x[0].length;if(x.length===1||I)return`
8
+ `;for(var U=0,j=0;j<x.length;j++)x[j][0]===`
9
+ `&&U++;return U>=x.length/2?`\r
10
+ `:"\r"}}function X(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function se(e){var t=(e=e||{}).delimiter,n=e.newline,s=e.comments,m=e.step,b=e.preview,_=e.fastMode,l=null,c=!1,i=e.quoteChar==null?'"':e.quoteChar,a=i;if(e.escapeChar!==void 0&&(a=e.escapeChar),(typeof t!="string"||-1<o.BAD_DELIMITERS.indexOf(t))&&(t=","),s===t)throw new Error("Comment character same as delimiter");s===!0?s="#":(typeof s!="string"||-1<o.BAD_DELIMITERS.indexOf(s))&&(s=!1),n!==`
11
+ `&&n!=="\r"&&n!==`\r
12
+ `&&(n=`
13
+ `);var u=0,y=!1;this.parse=function(g,v,p){if(typeof g!="string")throw new Error("Input must be a string");var M=g.length,L=t.length,B=n.length,Y=s.length,k=F(m),O=[],x=[],w=[],I=u=0;if(!g)return J();if(_||_!==!1&&g.indexOf(i)===-1){for(var U=g.split(n),j=0;j<U.length;j++){if(w=U[j],u+=w.length,j!==U.length-1)u+=n.length;else if(p)return J();if(!s||w.substring(0,Y)!==s){if(k){if(O=[],ce(w.split(t)),ne(),y)return J()}else ce(w.split(t));if(b&&b<=j)return O=O.slice(0,b),J(!0)}}return J()}for(var W=g.indexOf(t,u),R=g.indexOf(n,u),ee=new RegExp(X(a)+X(i),"g"),E=g.indexOf(i,u);;)if(g[u]===i)for(E=u,u++;;){if((E=g.indexOf(i,E+1))===-1)return p||x.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:O.length,index:u}),re();if(E===M-1)return re(g.substring(u,E).replace(ee,i));if(i===a&&g[E+1]===a)E++;else if(i===a||E===0||g[E-1]!==a){W!==-1&&W<E+1&&(W=g.indexOf(t,E+1));var H=he((R=R!==-1&&R<E+1?g.indexOf(n,E+1):R)===-1?W:Math.min(W,R));if(g.substr(E+1+H,L)===t){w.push(g.substring(u,E).replace(ee,i)),g[u=E+1+H+L]!==i&&(E=g.indexOf(i,u)),W=g.indexOf(t,u),R=g.indexOf(n,u);break}if(H=he(R),g.substring(E+1+H,E+1+H+B)===n){if(w.push(g.substring(u,E).replace(ee,i)),le(E+1+H+B),W=g.indexOf(t,u),E=g.indexOf(i,u),k&&(ne(),y))return J();if(b&&O.length>=b)return J(!0);break}x.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:O.length,index:u}),E++}}else if(s&&w.length===0&&g.substring(u,u+Y)===s){if(R===-1)return J();u=R+B,R=g.indexOf(n,u),W=g.indexOf(t,u)}else if(W!==-1&&(W<R||R===-1))w.push(g.substring(u,W)),u=W+L,W=g.indexOf(t,u);else{if(R===-1)break;if(w.push(g.substring(u,R)),le(R+B),k&&(ne(),y))return J();if(b&&O.length>=b)return J(!0)}return re();function ce(P){O.push(P),I=u}function he(P){var V=0;return V=P!==-1&&(P=g.substring(E+1,P))&&P.trim()===""?P.length:V}function re(P){return p||(P===void 0&&(P=g.substring(u)),w.push(P),u=M,ce(w),k&&ne()),J()}function le(P){u=P,ce(w),w=[],R=g.indexOf(n,u)}function J(P){if(e.header&&!v&&O.length&&!c){var V=O[0],ue=Object.create(null),Se=new Set(V);let be=!1;for(let fe=0;fe<V.length;fe++){let ie=V[fe];if(ue[ie=F(e.transformHeader)?e.transformHeader(ie,fe):ie]){let de,Ee=ue[ie];for(;de=ie+"_"+Ee,Ee++,Se.has(de););Se.add(de),V[fe]=de,ue[ie]++,be=!0,(l=l===null?{}:l)[de]=ie}else ue[ie]=1,V[fe]=ie;Se.add(ie)}be&&console.warn("Duplicate headers found and renamed."),c=!0}return{data:O,errors:x,meta:{delimiter:t,linebreak:n,aborted:y,truncated:!!P,cursor:I+(v||0),renamedHeaders:l}}}function ne(){m(J()),O=[],x=[]}},this.abort=function(){y=!0},this.getCharIndex=function(){return u}}function ae(e){var t=e.data,n=N[t.workerId],s=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var m={abort:function(){s=!0,Z(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:pe,resume:pe};if(F(n.userStep)){for(var b=0;b<t.results.data.length&&(n.userStep({data:t.results.data[b],errors:t.results.errors,meta:t.results.meta},m),!s);b++);delete t.results}else F(n.userChunk)&&(n.userChunk(t.results,m,t.file),delete t.results)}t.finished&&!s&&Z(t.workerId,t.results)}function Z(e,t){var n=N[e];F(n.userComplete)&&n.userComplete(t),n.terminate(),delete N[e]}function pe(){throw new Error("Not implemented.")}function oe(e){if(typeof e!="object"||e===null)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=oe(e[t]);return n}function K(e,t){return function(){e.apply(t,arguments)}}function F(e){return typeof e=="function"}return o.parse=function(e,t){var n=(t=t||{}).dynamicTyping||!1;if(F(n)&&(t.dynamicTypingFunction=n,n={}),t.dynamicTyping=n,t.transform=!!F(t.transform)&&t.transform,!t.worker||!o.WORKERS_SUPPORTED)return n=null,o.NODE_STREAM_INPUT,typeof e=="string"?(e=(s=>s.charCodeAt(0)!==65279?s:s.slice(1))(e),n=new(t.download?A:T)(t)):e.readable===!0&&F(e.read)&&F(e.on)?n=new Q(t):(d.File&&e instanceof File||e instanceof Object)&&(n=new D(t)),n.stream(e);(n=(()=>{var s;return!!o.WORKERS_SUPPORTED&&(s=(()=>{var m=d.URL||d.webkitURL||null,b=f.toString();return o.BLOB_URL||(o.BLOB_URL=m.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",b,")();"],{type:"text/javascript"})))})(),(s=new d.Worker(s)).onmessage=ae,s.id=q++,N[s.id]=s)})()).userStep=t.step,n.userChunk=t.chunk,n.userComplete=t.complete,n.userError=t.error,t.step=F(t.step),t.chunk=F(t.chunk),t.complete=F(t.complete),t.error=F(t.error),delete t.worker,n.postMessage({input:e,config:t,workerId:n.id})},o.unparse=function(e,t){var n=!1,s=!0,m=",",b=`\r
14
+ `,_='"',l=_+_,c=!1,i=null,a=!1,u=((()=>{if(typeof t=="object"){if(typeof t.delimiter!="string"||o.BAD_DELIMITERS.filter(function(v){return t.delimiter.indexOf(v)!==-1}).length||(m=t.delimiter),typeof t.quotes!="boolean"&&typeof t.quotes!="function"&&!Array.isArray(t.quotes)||(n=t.quotes),typeof t.skipEmptyLines!="boolean"&&typeof t.skipEmptyLines!="string"||(c=t.skipEmptyLines),typeof t.newline=="string"&&(b=t.newline),typeof t.quoteChar=="string"&&(_=t.quoteChar),typeof t.header=="boolean"&&(s=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw new Error("Option columns is empty");i=t.columns}t.escapeChar!==void 0&&(l=t.escapeChar+_),t.escapeFormulae instanceof RegExp?a=t.escapeFormulae:typeof t.escapeFormulae=="boolean"&&t.escapeFormulae&&(a=/^[=+\-@\t\r].*$/)}})(),new RegExp(X(_),"g"));if(typeof e=="string"&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return y(null,e,c);if(typeof e[0]=="object")return y(i||Object.keys(e[0]),e,c)}else if(typeof e=="object")return typeof e.data=="string"&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||i),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:typeof e.data[0]=="object"?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||typeof e.data[0]=="object"||(e.data=[e.data])),y(e.fields||[],e.data||[],c);throw new Error("Unable to serialize unrecognized input");function y(v,p,M){var L="",B=(typeof v=="string"&&(v=JSON.parse(v)),typeof p=="string"&&(p=JSON.parse(p)),Array.isArray(v)&&0<v.length),Y=!Array.isArray(p[0]);if(B&&s){for(var k=0;k<v.length;k++)0<k&&(L+=m),L+=g(v[k],k);0<p.length&&(L+=b)}for(var O=0;O<p.length;O++){var x=(B?v:p[O]).length,w=!1,I=B?Object.keys(p[O]).length===0:p[O].length===0;if(M&&!B&&(w=M==="greedy"?p[O].join("").trim()==="":p[O].length===1&&p[O][0].length===0),M==="greedy"&&B){for(var U=[],j=0;j<x;j++){var W=Y?v[j]:j;U.push(p[O][W])}w=U.join("").trim()===""}if(!w){for(var R=0;R<x;R++){0<R&&!I&&(L+=m);var ee=B&&Y?v[R]:R;L+=g(p[O][ee],R)}O<p.length-1&&(!M||0<x&&!I)&&(L+=b)}}return L}function g(v,p){var M,L;return v==null?"":v.constructor===Date?JSON.stringify(v).slice(1,25):(L=!1,a&&typeof v=="string"&&a.test(v)&&(v="'"+v,L=!0),M=v.toString().replace(u,l),(L=L||n===!0||typeof n=="function"&&n(v,p)||Array.isArray(n)&&n[p]||((B,Y)=>{for(var k=0;k<Y.length;k++)if(-1<B.indexOf(Y[k]))return!0;return!1})(M,o.BAD_DELIMITERS)||-1<M.indexOf(m)||M.charAt(0)===" "||M.charAt(M.length-1)===" ")?_+M+_:M)}},o.RECORD_SEP="",o.UNIT_SEP="",o.BYTE_ORDER_MARK="\uFEFF",o.BAD_DELIMITERS=["\r",`
15
+ `,'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!$&&!!d.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=se,o.ParserHandle=G,o.NetworkStreamer=A,o.FileStreamer=D,o.StringStreamer=T,o.ReadableStreamStreamer=Q,d.jQuery&&((C=d.jQuery).fn.parse=function(e){var t=e.config||{},n=[];return this.each(function(b){if(!(C(this).prop("tagName").toUpperCase()==="INPUT"&&C(this).attr("type").toLowerCase()==="file"&&d.FileReader)||!this.files||this.files.length===0)return!0;for(var _=0;_<this.files.length;_++)n.push({file:this.files[_],inputElem:this,instanceConfig:C.extend({},t)})}),s(),this;function s(){if(n.length===0)F(e.complete)&&e.complete();else{var b,_,l,c,i=n[0];if(F(e.before)){var a=e.before(i.file,i.inputElem);if(typeof a=="object"){if(a.action==="abort")return b="AbortError",_=i.file,l=i.inputElem,c=a.reason,void(F(e.error)&&e.error({name:b},_,l,c));if(a.action==="skip")return void m();typeof a.config=="object"&&(i.instanceConfig=C.extend(i.instanceConfig,a.config))}else if(a==="skip")return void m()}var u=i.instanceConfig.complete;i.instanceConfig.complete=function(y){F(u)&&u(y,i.file,i.inputElem),m()},o.parse(i.file,i.instanceConfig)}}function m(){n.splice(0,1),s()}}),z&&(d.onmessage=function(e){e=e.data,o.WORKER_ID===void 0&&e&&(o.WORKER_ID=e.workerId),typeof e.input=="string"?d.postMessage({workerId:o.WORKER_ID,results:o.parse(e.input,e.config),finished:!0}):(d.File&&e.input instanceof File||e.input instanceof Object)&&(e=o.parse(e.input,e.config))&&d.postMessage({workerId:o.WORKER_ID,results:e,finished:!0})}),(A.prototype=Object.create(S.prototype)).constructor=A,(D.prototype=Object.create(S.prototype)).constructor=D,(T.prototype=Object.create(T.prototype)).constructor=T,(Q.prototype=Object.create(S.prototype)).constructor=Q,o})}(we)),we.exports}var Re=Ze();class Ve{readAsText(r){const f=new FileReader;return new Promise((d,C)=>{f.onload=$=>{d($)},f.onerror=$=>{C($)},f.readAsText(r)})}readAsBinaryString(r){const f=new FileReader;return new Promise((d,C)=>{f.onload=$=>{d($)},f.onerror=$=>{C($)},f.readAsBinaryString(r)})}readAsDataUrl(r){const f=new FileReader;return new Promise((d,C)=>{f.onload=$=>{d($)},f.onerror=$=>C($),f.readAsDataURL(r)})}unparse(r,f){return Re.unparse(r,f)}parse(r){return new Promise((f,d)=>{Re.parse(r,{header:!0,complete:C=>f(C),error:C=>d(C)})})}getFileExtension(r){let f="-";return/[.]/.exec(r)&&(f=`.${/[^.]+$/.exec(r)?.[0]}`),f}save(r,f,d){const C=new Blob([r],{type:d});Je.saveAs(C,f,{autoBom:!0})}}class Ge{set(r,f){localStorage.setItem(r,JSON.stringify(f))}get(r){let f=null;const d=localStorage.getItem(r);return d&&(f=JSON.parse(d)),f}remove(r){localStorage.removeItem(r)}removeAll(){localStorage.clear()}getKeysBy(r){return Object.keys(localStorage).filter(f=>f.startsWith(r))}}var ke=(h=>(h.log="log",h.info="info",h.warn="warn",h.debug="debug",h.error="error",h))(ke||{});class Xe{logType=ke;log(...r){this._doLog(this.logType.log,r.join(" "))}info(...r){this._doLog(this.logType.info,r.join(" "))}warn(...r){this._doLog(this.logType.warn,r.join(" "))}debug(...r){this._doLog(this.logType.debug,r.join(" "))}error(...r){this._doLog(this.logType.error,r.join(" "))}_doLog(r,...f){console[r].apply(console,f)}}class et{constructor(r){this.localService=r}get(r){return this.localService.get(r)}set(r,f){this.localService.set(r,f)}remove(r){this.localService.remove(r)}}exports.BrowserService=Pe;exports.BrowserType=Le;exports.ClipboardService=qe;exports.FileService=Ve;exports.LocalService=Ge;exports.LogType=ke;exports.LoggerService=Xe;exports.ScreenBreakpoints=ye;exports.TokenService=et;exports.sortHelper=$e;
package/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ export * from './extensions';
2
+ export * from './helpers';
3
+ export * from './interfaces';
1
4
  export * from './services';
2
5
  export * from './types';
3
6
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}