@oardi/ts-utils 0.0.62 → 0.1.0
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/index.cjs +1 -10
- package/index.mjs +283 -1034
- package/index.umd.js +1 -10
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ue={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400,xxxl:1600};class Se{static getScreenWidth(){return document.documentElement.clientWidth}static getScreenHeight(){return document.documentElement.clientHeight}}class he{static breakPoints=Ue;static getCurrentBreakpoint(){return he.getBreakpointByScreenWidth(Se.getScreenWidth())}static getBreakpointByScreenWidth(e=Se.getScreenWidth()){let n="xs";for(const s of Object.keys(he.breakPoints))he.breakPoints[s]<=e&&(n=s);return{breakpoint:n,screenWidth:e}}static isScreenGreaterThan(e){return Se.getScreenWidth()>he.breakPoints[e]}static isScreenSmallerThan(e){return Se.getScreenWidth()<he.breakPoints[e]}}var ee=(a=>(a.opera="opera",a.firefox="firefox",a.safari="safari",a.ie="ie",a.edgeLegacy="edgeLegacy",a.edg="edg",a.chrome="chrome",a.iOS="iOS",a.iOsSafari="iOsSafari",a.edgiOs="edgiOs",a.headlessChrome="headlessChrome",a.nodeRuntime="nodeRuntime",a.electron="electron",a))(ee||{});class H{static getUserAgent(){return this.isBrowserEnv()?navigator.userAgent.toLowerCase():""}static resolveUserAgent(e){return(e??this.getUserAgent()).toLowerCase()}static isBrowserEnv(){return typeof window<"u"&&typeof navigator<"u"}static isOpera(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e);return n.includes("opr/")||n.includes("opera")}static isFirefox(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("firefox")||typeof globalThis.InstallTrigger<"u":!1}static isSafari(e){if(!this.isBrowserEnv())return!1;const n=navigator.vendor.includes("Apple"),s=this.resolveUserAgent(e),d=s.includes("safari"),_=!(s.includes("crios")||s.includes("chrome")||s.includes("android")||s.includes("opr/")||s.includes("edg"));return n&&d&&_}static isIOS(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e),s=/iphone|ipad|ipod/.test(n),d=n.includes("macintosh")&&navigator.maxTouchPoints>1;return s||d}static isIosSafari(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e);return this.isIOS(n)&&this.isSafari(n)}static isEdgeLegacy(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e);return!!window.StyleMedia&&!n.includes("edg/")}static isEdg(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("edg/"):!1}static isEdgeIos(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e);return this.isIOS(n)&&n.includes("edgios")}static isIE(){return this.isBrowserEnv()?typeof document<"u"&&!!document.documentMode:!1}static isChrome(e){if(!this.isBrowserEnv())return!1;const n=this.resolveUserAgent(e),s=navigator.vendor.includes("Google"),d=n.includes("chrome")||n.includes("crios"),_=!this.isEdg(n)&&!this.isOpera(n);return s&&d&&_}static isElectron(e){const n=!!(typeof process<"u"&&process.versions?.electron),s=this.resolveUserAgent(e);return n||s.includes("electron")}static isHeadlessChrome(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("headlesschrome"):!1}static isNodeRuntime(){return typeof process<"u"&&!!process.versions?.node&&!this.isBrowserEnv()}static getCurrentBrowser(){const e=H.getUserAgent();if(H.isElectron(e))return ee.electron;if(H.isNodeRuntime())return ee.nodeRuntime;if(H.isOpera(e))return ee.opera;if(H.isFirefox(e))return ee.firefox;if(H.isEdgeIos(e))return ee.edgiOs;if(H.isIosSafari(e))return ee.iOsSafari;if(H.isIOS(e))return ee.iOS;if(H.isHeadlessChrome(e))return ee.headlessChrome;if(H.isIE())return ee.ie;if(H.isEdgeLegacy(e))return ee.edgeLegacy;if(H.isEdg(e))return ee.edg;if(H.isChrome(e))return ee.chrome;if(H.isSafari(e))return ee.safari;throw new Error("Browser could not be detected: "+e)}}class je{static toBlob(e,n,s=!1,d){return new Promise((_,z)=>{e.toBlob(I=>{I?_(I):z(new Error("canvas.toBlob returned null"))},n,s?d:void 0)})}}function Be(a){return navigator.clipboard.writeText(a)}function Me(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var be={exports:{}};var Ye=be.exports,Re;function Pe(){return Re||(Re=1,(function(a,e){((n,s)=>{a.exports=s()})(Ye,function n(){var s=typeof self<"u"?self:typeof window<"u"?window:s!==void 0?s:{},d,_=!s.document&&!!s.postMessage,z=s.IS_PAPA_WORKER||!1,I={},K=0,p={};function U(t){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(r){var i=ce(r);i.chunkSize=parseInt(i.chunkSize),r.step||r.chunk||(i.chunkSize=null),this._handle=new ne(i),(this._handle.streamer=this)._config=i}).call(this,t),this.parseChunk=function(r,i){var u=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<u){let E=this._config.newline;E||(y=this._config.quoteChar||'"',E=this._handle.guessLineEndings(r,y)),r=[...r.split(E).slice(u)].join(E)}this.isFirstChunk&&L(this._config.beforeFirstChunk)&&(y=this._config.beforeFirstChunk(r))!==void 0&&(r=y),this.isFirstChunk=!1,this._halted=!1;var u=this._partialLine+r,y=(this._partialLine="",this._handle.parse(u,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(r=y.meta.cursor,u=(this._finished||(this._partialLine=u.substring(r-this._baseIndex),this._baseIndex=r),y&&y.data&&(this._rowCount+=y.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),z)s.postMessage({results:y,workerId:p.WORKER_ID,finished:u});else if(L(this._config.chunk)&&!i){if(this._config.chunk(y,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=y=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(y.data),this._completeResults.errors=this._completeResults.errors.concat(y.errors),this._completeResults.meta=y.meta),this._completed||!u||!L(this._config.complete)||y&&y.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),u||y&&y.meta.paused||this._nextChunk(),y}this._halted=!0},this._sendError=function(r){L(this._config.error)?this._config.error(r):z&&this._config.error&&s.postMessage({workerId:p.WORKER_ID,error:r,finished:!1})}}function j(t){var r;(t=t||{}).chunkSize||(t.chunkSize=p.RemoteChunkSize),U.call(this,t),this._nextChunk=_?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(i){this._input=i,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),_||(r.onload=V(this._chunkLoaded,this),r.onerror=V(this._chunkError,this)),r.open(this._config.downloadRequestBody?"POST":"GET",this._input,!_),this._config.downloadRequestHeaders){var i,u=this._config.downloadRequestHeaders;for(i in u)r.setRequestHeader(i,u[i])}var y;this._config.chunkSize&&(y=this._start+this._config.chunkSize-1,r.setRequestHeader("Range","bytes="+this._start+"-"+y));try{r.send(this._config.downloadRequestBody)}catch(E){this._chunkError(E.message)}_&&r.status===0&&this._chunkError()}},this._chunkLoaded=function(){r.readyState===4&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize||r.responseText.length,this._finished=!this._config.chunkSize||this._start>=(i=>(i=i.getResponseHeader("Content-Range"))!==null?parseInt(i.substring(i.lastIndexOf("/")+1)):-1)(r),this.parseChunk(r.responseText)))},this._chunkError=function(i){i=r.statusText||i,this._sendError(new Error(i))}}function Q(t){(t=t||{}).chunkSize||(t.chunkSize=p.LocalChunkSize),U.call(this,t);var r,i,u=typeof FileReader<"u";this.stream=function(y){this._input=y,i=y.slice||y.webkitSlice||y.mozSlice,u?((r=new FileReader).onload=V(this._chunkLoaded,this),r.onerror=V(this._chunkError,this)):r=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var y=this._input,E=(this._config.chunkSize&&(E=Math.min(this._start+this._config.chunkSize,this._input.size),y=i.call(y,this._start,E)),r.readAsText(y,this._config.encoding));u||this._chunkLoaded({target:{result:E}})},this._chunkLoaded=function(y){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(y.target.result)},this._chunkError=function(){this._sendError(r.error)}}function q(t){var r;U.call(this,t=t||{}),this.stream=function(i){return r=i,this._nextChunk()},this._nextChunk=function(){var i,u;if(!this._finished)return i=this._config.chunkSize,r=i?(u=r.substring(0,i),r.substring(i)):(u=r,""),this._finished=!r,this.parseChunk(u)}}function X(t){U.call(this,t=t||{});var r=[],i=!0,u=!1;this.pause=function(){U.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){U.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(y){this._input=y,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){u&&r.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),r.length?this.parseChunk(r.shift()):i=!0},this._streamData=V(function(y){try{r.push(typeof y=="string"?y:y.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(r.shift()))}catch(E){this._streamError(E)}},this),this._streamError=V(function(y){this._streamCleanUp(),this._sendError(y)},this),this._streamEnd=V(function(){this._streamCleanUp(),u=!0,this._streamData("")},this),this._streamCleanUp=V(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function ne(t){var r,i,u,y,E=Math.pow(2,53),v=-E,h=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,f=/^((\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)))$/,o=this,c=0,l=0,w=!1,m=!1,k=[],g={data:[],errors:[],meta:{}};function M(b){return t.skipEmptyLines==="greedy"?b.join("").trim()==="":b.length===1&&b[0].length===0}function C(){if(g&&u&&(N("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+p.DefaultDelimiter+"'"),u=!1),t.skipEmptyLines&&(g.data=g.data.filter(function(S){return!M(S)})),B()){let S=function(R,Y){L(t.transformHeader)&&(R=t.transformHeader(R,Y)),k.push(R)};if(g)if(Array.isArray(g.data[0])){for(var b=0;B()&&b<g.data.length;b++)g.data[b].forEach(S);g.data.splice(0,1)}else g.data.forEach(S)}function x(S,R){for(var Y=t.header?{}:[],A=0;A<S.length;A++){var F=A,$=S[A],$=((ie,O)=>(P=>(t.dynamicTypingFunction&&t.dynamicTyping[P]===void 0&&(t.dynamicTyping[P]=t.dynamicTypingFunction(P)),(t.dynamicTyping[P]||t.dynamicTyping)===!0))(ie)?O==="true"||O==="TRUE"||O!=="false"&&O!=="FALSE"&&((P=>{if(h.test(P)&&(P=parseFloat(P),v<P&&P<E))return 1})(O)?parseFloat(O):f.test(O)?new Date(O):O===""?null:O):O)(F=t.header?A>=k.length?"__parsed_extra":k[A]:F,$=t.transform?t.transform($,F):$);F==="__parsed_extra"?(Y[F]=Y[F]||[],Y[F].push($)):Y[F]=$}return t.header&&(A>k.length?N("FieldMismatch","TooManyFields","Too many fields: expected "+k.length+" fields but parsed "+A,l+R):A<k.length&&N("FieldMismatch","TooFewFields","Too few fields: expected "+k.length+" fields but parsed "+A,l+R)),Y}var D;g&&(t.header||t.dynamicTyping||t.transform)&&(D=1,!g.data.length||Array.isArray(g.data[0])?(g.data=g.data.map(x),D=g.data.length):g.data=x(g.data,0),t.header&&g.meta&&(g.meta.fields=k),l+=D)}function B(){return t.header&&k.length===0}function N(b,x,D,S){b={type:b,code:x,message:D},S!==void 0&&(b.row=S),g.errors.push(b)}L(t.step)&&(y=t.step,t.step=function(b){g=b,B()?C():(C(),g.data.length!==0&&(c+=b.data.length,t.preview&&c>t.preview?i.abort():(g.data=g.data[0],y(g,o))))}),this.parse=function(b,x,D){var S=t.quoteChar||'"',S=(t.newline||(t.newline=this.guessLineEndings(b,S)),u=!1,t.delimiter?L(t.delimiter)&&(t.delimiter=t.delimiter(b),g.meta.delimiter=t.delimiter):((S=((R,Y,A,F,$)=>{var ie,O,P,de;$=$||[","," ","|",";",p.RECORD_SEP,p.UNIT_SEP];for(var me=0;me<$.length;me++){for(var se,we=$[me],Z=0,ae=0,J=0,re=(P=void 0,new ge({comments:F,delimiter:we,newline:Y,preview:10}).parse(R)),le=0;le<re.data.length;le++)A&&M(re.data[le])?J++:(se=re.data[le].length,ae+=se,P===void 0?P=se:0<se&&(Z+=Math.abs(se-P),P=se));0<re.data.length&&(ae/=re.data.length-J),(O===void 0||Z<=O)&&(de===void 0||de<ae)&&1.99<ae&&(O=Z,ie=we,de=ae)}return{successful:!!(t.delimiter=ie),bestDelimiter:ie}})(b,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess)).successful?t.delimiter=S.bestDelimiter:(u=!0,t.delimiter=p.DefaultDelimiter),g.meta.delimiter=t.delimiter),ce(t));return t.preview&&t.header&&S.preview++,r=b,i=new ge(S),g=i.parse(r,x,D),C(),w?{meta:{paused:!0}}:g||{meta:{paused:!1}}},this.paused=function(){return w},this.pause=function(){w=!0,i.abort(),r=L(t.chunk)?"":r.substring(i.getCharIndex())},this.resume=function(){o.streamer._halted?(w=!1,o.streamer.parseChunk(r,!0)):setTimeout(o.resume,3)},this.aborted=function(){return m},this.abort=function(){m=!0,i.abort(),g.meta.aborted=!0,L(t.complete)&&t.complete(g),r=""},this.guessLineEndings=function(R,S){R=R.substring(0,1048576);var S=new RegExp(ue(S)+"([^]*?)"+ue(S),"gm"),D=(R=R.replace(S,"")).split("\r"),S=R.split(`
|
|
2
|
-
`),R=1<S.length&&S[0].length<D[0].length;if(D.length===1||R)return`
|
|
3
|
-
`;for(var Y=0,A=0;A<D.length;A++)D[A][0]===`
|
|
4
|
-
`&&Y++;return Y>=D.length/2?`\r
|
|
5
|
-
`:"\r"}}function ue(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(t){var r=(t=t||{}).delimiter,i=t.newline,u=t.comments,y=t.step,E=t.preview,v=t.fastMode,h=null,f=!1,o=t.quoteChar==null?'"':t.quoteChar,c=o;if(t.escapeChar!==void 0&&(c=t.escapeChar),(typeof r!="string"||-1<p.BAD_DELIMITERS.indexOf(r))&&(r=","),u===r)throw new Error("Comment character same as delimiter");u===!0?u="#":(typeof u!="string"||-1<p.BAD_DELIMITERS.indexOf(u))&&(u=!1),i!==`
|
|
6
|
-
`&&i!=="\r"&&i!==`\r
|
|
7
|
-
`&&(i=`
|
|
8
|
-
`);var l=0,w=!1;this.parse=function(m,k,g){if(typeof m!="string")throw new Error("Input must be a string");var M=m.length,C=r.length,B=i.length,N=u.length,b=L(y),x=[],D=[],S=[],R=l=0;if(!m)return Z();if(v||v!==!1&&m.indexOf(o)===-1){for(var Y=m.split(i),A=0;A<Y.length;A++){if(S=Y[A],l+=S.length,A!==Y.length-1)l+=i.length;else if(g)return Z();if(!u||S.substring(0,N)!==u){if(b){if(x=[],de(S.split(r)),ae(),w)return Z()}else de(S.split(r));if(E&&E<=A)return x=x.slice(0,E),Z(!0)}}return Z()}for(var F=m.indexOf(r,l),$=m.indexOf(i,l),ie=new RegExp(ue(c)+ue(o),"g"),O=m.indexOf(o,l);;)if(m[l]===o)for(O=l,l++;;){if((O=m.indexOf(o,O+1))===-1)return g||D.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:x.length,index:l}),se();if(O===M-1)return se(m.substring(l,O).replace(ie,o));if(o===c&&m[O+1]===c)O++;else if(o===c||O===0||m[O-1]!==c){F!==-1&&F<O+1&&(F=m.indexOf(r,O+1));var P=me(($=$!==-1&&$<O+1?m.indexOf(i,O+1):$)===-1?F:Math.min(F,$));if(m.substr(O+1+P,C)===r){S.push(m.substring(l,O).replace(ie,o)),m[l=O+1+P+C]!==o&&(O=m.indexOf(o,l)),F=m.indexOf(r,l),$=m.indexOf(i,l);break}if(P=me($),m.substring(O+1+P,O+1+P+B)===i){if(S.push(m.substring(l,O).replace(ie,o)),we(O+1+P+B),F=m.indexOf(r,l),O=m.indexOf(o,l),b&&(ae(),w))return Z();if(E&&x.length>=E)return Z(!0);break}D.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:x.length,index:l}),O++}}else if(u&&S.length===0&&m.substring(l,l+N)===u){if($===-1)return Z();l=$+B,$=m.indexOf(i,l),F=m.indexOf(r,l)}else if(F!==-1&&(F<$||$===-1))S.push(m.substring(l,F)),l=F+C,F=m.indexOf(r,l);else{if($===-1)break;if(S.push(m.substring(l,$)),we($+B),b&&(ae(),w))return Z();if(E&&x.length>=E)return Z(!0)}return se();function de(J){x.push(J),R=l}function me(J){var re=0;return re=J!==-1&&(J=m.substring(O+1,J))&&J.trim()===""?J.length:re}function se(J){return g||(J===void 0&&(J=m.substring(l)),S.push(J),l=M,de(S),b&&ae()),Z()}function we(J){l=J,de(S),S=[],$=m.indexOf(i,l)}function Z(J){if(t.header&&!k&&x.length&&!f){var re=x[0],le=Object.create(null),$e=new Set(re);let Ce=!1;for(let ye=0;ye<re.length;ye++){let oe=re[ye];if(le[oe=L(t.transformHeader)?t.transformHeader(oe,ye):oe]){let ke,Le=le[oe];for(;ke=oe+"_"+Le,Le++,$e.has(ke););$e.add(ke),re[ye]=ke,le[oe]++,Ce=!0,(h=h===null?{}:h)[ke]=oe}else le[oe]=1,re[ye]=oe;$e.add(oe)}Ce&&console.warn("Duplicate headers found and renamed."),f=!0}return{data:x,errors:D,meta:{delimiter:r,linebreak:i,aborted:w,truncated:!!J,cursor:R+(k||0),renamedHeaders:h}}}function ae(){y(Z()),x=[],D=[]}},this.abort=function(){w=!0},this.getCharIndex=function(){return l}}function ve(t){var r=t.data,i=I[r.workerId],u=!1;if(r.error)i.userError(r.error,r.file);else if(r.results&&r.results.data){var y={abort:function(){u=!0,fe(r.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:_e,resume:_e};if(L(i.userStep)){for(var E=0;E<r.results.data.length&&(i.userStep({data:r.results.data[E],errors:r.results.errors,meta:r.results.meta},y),!u);E++);delete r.results}else L(i.userChunk)&&(i.userChunk(r.results,y,r.file),delete r.results)}r.finished&&!u&&fe(r.workerId,r.results)}function fe(t,r){var i=I[t];L(i.userComplete)&&i.userComplete(r),i.terminate(),delete I[t]}function _e(){throw new Error("Not implemented.")}function ce(t){if(typeof t!="object"||t===null)return t;var r,i=Array.isArray(t)?[]:{};for(r in t)i[r]=ce(t[r]);return i}function V(t,r){return function(){t.apply(r,arguments)}}function L(t){return typeof t=="function"}return p.parse=function(t,r){var i=(r=r||{}).dynamicTyping||!1;if(L(i)&&(r.dynamicTypingFunction=i,i={}),r.dynamicTyping=i,r.transform=!!L(r.transform)&&r.transform,!r.worker||!p.WORKERS_SUPPORTED)return i=null,p.NODE_STREAM_INPUT,typeof t=="string"?(t=(u=>u.charCodeAt(0)!==65279?u:u.slice(1))(t),i=new(r.download?j:q)(r)):t.readable===!0&&L(t.read)&&L(t.on)?i=new X(r):(s.File&&t instanceof File||t instanceof Object)&&(i=new Q(r)),i.stream(t);(i=(()=>{var u;return!!p.WORKERS_SUPPORTED&&(u=(()=>{var y=s.URL||s.webkitURL||null,E=n.toString();return p.BLOB_URL||(p.BLOB_URL=y.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; ","(",E,")();"],{type:"text/javascript"})))})(),(u=new s.Worker(u)).onmessage=ve,u.id=K++,I[u.id]=u)})()).userStep=r.step,i.userChunk=r.chunk,i.userComplete=r.complete,i.userError=r.error,r.step=L(r.step),r.chunk=L(r.chunk),r.complete=L(r.complete),r.error=L(r.error),delete r.worker,i.postMessage({input:t,config:r,workerId:i.id})},p.unparse=function(t,r){var i=!1,u=!0,y=",",E=`\r
|
|
9
|
-
`,v='"',h=v+v,f=!1,o=null,c=!1,l=((()=>{if(typeof r=="object"){if(typeof r.delimiter!="string"||p.BAD_DELIMITERS.filter(function(k){return r.delimiter.indexOf(k)!==-1}).length||(y=r.delimiter),typeof r.quotes!="boolean"&&typeof r.quotes!="function"&&!Array.isArray(r.quotes)||(i=r.quotes),typeof r.skipEmptyLines!="boolean"&&typeof r.skipEmptyLines!="string"||(f=r.skipEmptyLines),typeof r.newline=="string"&&(E=r.newline),typeof r.quoteChar=="string"&&(v=r.quoteChar),typeof r.header=="boolean"&&(u=r.header),Array.isArray(r.columns)){if(r.columns.length===0)throw new Error("Option columns is empty");o=r.columns}r.escapeChar!==void 0&&(h=r.escapeChar+v),r.escapeFormulae instanceof RegExp?c=r.escapeFormulae:typeof r.escapeFormulae=="boolean"&&r.escapeFormulae&&(c=/^[=+\-@\t\r].*$/)}})(),new RegExp(ue(v),"g"));if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return w(null,t,f);if(typeof t[0]=="object")return w(o||Object.keys(t[0]),t,f)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||o),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:typeof t.data[0]=="object"?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||typeof t.data[0]=="object"||(t.data=[t.data])),w(t.fields||[],t.data||[],f);throw new Error("Unable to serialize unrecognized input");function w(k,g,M){var C="",B=(typeof k=="string"&&(k=JSON.parse(k)),typeof g=="string"&&(g=JSON.parse(g)),Array.isArray(k)&&0<k.length),N=!Array.isArray(g[0]);if(B&&u){for(var b=0;b<k.length;b++)0<b&&(C+=y),C+=m(k[b],b);0<g.length&&(C+=E)}for(var x=0;x<g.length;x++){var D=(B?k:g[x]).length,S=!1,R=B?Object.keys(g[x]).length===0:g[x].length===0;if(M&&!B&&(S=M==="greedy"?g[x].join("").trim()==="":g[x].length===1&&g[x][0].length===0),M==="greedy"&&B){for(var Y=[],A=0;A<D;A++){var F=N?k[A]:A;Y.push(g[x][F])}S=Y.join("").trim()===""}if(!S){for(var $=0;$<D;$++){0<$&&!R&&(C+=y);var ie=B&&N?k[$]:$;C+=m(g[x][ie],$)}x<g.length-1&&(!M||0<D&&!R)&&(C+=E)}}return C}function m(k,g){var M,C;return k==null?"":k.constructor===Date?JSON.stringify(k).slice(1,25):(C=!1,c&&typeof k=="string"&&c.test(k)&&(k="'"+k,C=!0),M=k.toString().replace(l,h),(C=C||i===!0||typeof i=="function"&&i(k,g)||Array.isArray(i)&&i[g]||((B,N)=>{for(var b=0;b<N.length;b++)if(-1<B.indexOf(N[b]))return!0;return!1})(M,p.BAD_DELIMITERS)||-1<M.indexOf(y)||M.charAt(0)===" "||M.charAt(M.length-1)===" ")?v+M+v:M)}},p.RECORD_SEP="",p.UNIT_SEP="",p.BYTE_ORDER_MARK="\uFEFF",p.BAD_DELIMITERS=["\r",`
|
|
10
|
-
`,'"',p.BYTE_ORDER_MARK],p.WORKERS_SUPPORTED=!_&&!!s.Worker,p.NODE_STREAM_INPUT=1,p.LocalChunkSize=10485760,p.RemoteChunkSize=5242880,p.DefaultDelimiter=",",p.Parser=ge,p.ParserHandle=ne,p.NetworkStreamer=j,p.FileStreamer=Q,p.StringStreamer=q,p.ReadableStreamStreamer=X,s.jQuery&&((d=s.jQuery).fn.parse=function(t){var r=t.config||{},i=[];return this.each(function(E){if(!(d(this).prop("tagName").toUpperCase()==="INPUT"&&d(this).attr("type").toLowerCase()==="file"&&s.FileReader)||!this.files||this.files.length===0)return!0;for(var v=0;v<this.files.length;v++)i.push({file:this.files[v],inputElem:this,instanceConfig:d.extend({},r)})}),u(),this;function u(){if(i.length===0)L(t.complete)&&t.complete();else{var E,v,h,f,o=i[0];if(L(t.before)){var c=t.before(o.file,o.inputElem);if(typeof c=="object"){if(c.action==="abort")return E="AbortError",v=o.file,h=o.inputElem,f=c.reason,void(L(t.error)&&t.error({name:E},v,h,f));if(c.action==="skip")return void y();typeof c.config=="object"&&(o.instanceConfig=d.extend(o.instanceConfig,c.config))}else if(c==="skip")return void y()}var l=o.instanceConfig.complete;o.instanceConfig.complete=function(w){L(l)&&l(w,o.file,o.inputElem),y()},p.parse(o.file,o.instanceConfig)}}function y(){i.splice(0,1),u()}}),z&&(s.onmessage=function(t){t=t.data,p.WORKER_ID===void 0&&t&&(p.WORKER_ID=t.workerId),typeof t.input=="string"?s.postMessage({workerId:p.WORKER_ID,results:p.parse(t.input,t.config),finished:!0}):(s.File&&t.input instanceof File||t.input instanceof Object)&&(t=p.parse(t.input,t.config))&&s.postMessage({workerId:p.WORKER_ID,results:t,finished:!0})}),(j.prototype=Object.create(U.prototype)).constructor=j,(Q.prototype=Object.create(U.prototype)).constructor=Q,(q.prototype=Object.create(q.prototype)).constructor=q,(X.prototype=Object.create(U.prototype)).constructor=X,p})})(be)),be.exports}var We=Pe();const Ne=Me(We),{parse:qe,unparse:Ke}=Ne;class Je{static unparse(e,n){return Ke(e,n)}static parse(e){return new Promise((n,s)=>{qe(e,{header:!0,complete:d=>n(d),error:d=>s(d)})})}}class Fe{static revokeObjectUrlDelay=4e4;static utf8BomMimeType=/^\s*(?:text\/\S*|application\/xml|\S+\/\S+\+xml)\s*;\s*charset\s*=\s*utf-8/i;static saveAs(e,n,s={}){this.assertBrowserEnvironment();const d=this.resolveFileName(e,n),_=s.autoBom?this.addUtf8Bom(e):e;this.downloadBlob(_,d)}static resolveFileName(e,n){return typeof n=="string"&&n.trim().length>0?n:typeof File<"u"&&e instanceof File&&e.name.trim().length>0?e.name:"download"}static addUtf8Bom(e){return this.utf8BomMimeType.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}static assertBrowserEnvironment(){if(typeof window>"u"||typeof document>"u"||typeof URL>"u"||typeof URL.createObjectURL!="function"||typeof URL.revokeObjectURL!="function")throw new Error("DownloadHelper is only available in a browser environment with object URL support.")}static downloadBlob(e,n){const s=URL.createObjectURL(e);try{this.clickDownloadLink(s,n)}finally{window.setTimeout(()=>URL.revokeObjectURL(s),this.revokeObjectUrlDelay)}}static clickDownloadLink(e,n){const s=document.body??document.documentElement;if(!s)throw new Error("DownloadHelper.saveAs requires an initialized document.");const d=document.createElement("a");try{d.download=n,d.href=e,d.target="_blank",d.rel="noopener noreferrer",d.style.display="none",s.appendChild(d),d.click()}finally{d.remove()}}}class Qe{static getEnumValue(e,n){if(n in e)return e[n];throw Error(`${n} not found in ${e}`)}static getKeyValues(e){return Object.keys(e).filter(n=>!isNaN(Number(n))).map(n=>({key:Number(n),value:e[n]}))}}class Ve{static getFileExtension(e){let n="";const s=e.lastIndexOf(".");return s>0&&s<e.length-1&&(n=`.${e.substring(s+1).toLowerCase()}`),n}static readAsText(e){const n=new FileReader;return new Promise((s,d)=>{n.onload=()=>{n.onload=null,n.onerror=null,typeof n.result=="string"?s(n.result):d(new Error("Unexpected result type"))},n.onerror=()=>{const _=n.error??new Error("FileReader error");n.onload=null,n.onerror=null,d(_)},n.readAsText(e)})}static readAsArrayBuffer(e){const n=new FileReader;return new Promise((s,d)=>{n.onload=()=>{n.onload=null,n.onerror=null,n.result instanceof ArrayBuffer?s(n.result):d(new Error("Unexpected result type"))},n.onerror=()=>{const _=n.error??new Error("FileReader error");n.onload=null,n.onerror=null,d(_)},n.readAsArrayBuffer(e)})}static readAsDataUrl(e){const n=new FileReader;return new Promise((s,d)=>{n.onload=_=>{s(_)},n.onerror=_=>d(_),n.readAsDataURL(e)})}static formatFileSize(e,n=2,s){if(e===0)return"0 Bytes";const d=1024,_=["Bytes","KB","MB","GB","TB"];let z=Math.floor(Math.log(e)/Math.log(d));s&&_.includes(s)&&(z=_.indexOf(s));const I=e/Math.pow(d,z);return`${parseFloat(I.toFixed(n))} ${_[z]}`}static isWithinSizeLimit(e,n){if(!Number.isSafeInteger(n)||n<0)throw new RangeError("maxBytes must be a non-negative safe integer.");return e.size<=n}static save(e,n,s){const d=new Blob([e],{type:s});Fe.saveAs(d,n)}}class Ze{static hasAllowedMimeType(e,n){const s=e.type.trim().toLowerCase();return s.length>0&&n.some(d=>d.trim().toLowerCase()===s)}static load(e){const n=URL.createObjectURL(e);return this.loadSource(n).finally(()=>URL.revokeObjectURL(n))}static async compress(e,n=.8,s="image/jpeg"){const d=await this.loadSource(e),{canvas:_}=this.resize(d,d.width,d.height);return _.toDataURL(s,n)}static resize(e,n,s){let{width:d,height:_}=e;const z=n/d,I=s/_,K=Math.min(z,I,1);d=Math.floor(d*K),_=Math.floor(_*K);const p=document.createElement("canvas");p.width=d,p.height=_;const U=p.getContext("2d");return U.clearRect(0,0,d,_),U.drawImage(e,0,0,d,_),{canvas:p,width:d,height:_}}static loadSource(e){return new Promise((n,s)=>{const d=new Image;d.onload=()=>n(d),d.onerror=s,d.src=e})}}class Ee{static set(e,n){localStorage.setItem(e,JSON.stringify(n))}static get(e){let n=null;const s=localStorage.getItem(e);return s&&(n=JSON.parse(s)),n}static remove(e){const n=localStorage.getItem(e)!==null;return n&&localStorage.removeItem(e),n}static removeAll(){localStorage.clear()}static getKeysBy(e){return Object.keys(localStorage).filter(n=>n.startsWith(e))}}var pe=(a=>(a.log="log",a.info="info",a.warn="warn",a.debug="debug",a.error="error",a))(pe||{});class G{static listeners=new Set;static enabled=!0;static log(...e){G.doLog(pe.log,e)}static info(...e){G.doLog(pe.info,e)}static warn(...e){G.doLog(pe.warn,e)}static debug(...e){G.doLog(pe.debug,e)}static error(...e){G.doLog(pe.error,e)}static clearListeners(){G.listeners.clear()}static setEnabled(e){G.enabled=e}static doLog(e,n){if(!G.enabled)return;const s={type:e,args:n,timestamp:new Date().toISOString()};for(const d of G.listeners)try{if(d(s)===!1)return}catch{}console[e].apply(console,n)}static onLog(e,n=!1){if(n){const s=d=>{try{return e(d)}finally{G.listeners.delete(s)}};return G.listeners.add(s),()=>G.listeners.delete(s)}return G.listeners.add(e),()=>G.listeners.delete(e)}}const He=(a,e,n)=>a.localeCompare(e)*(n?1:-1),Ge=(a,e)=>a<e?-1:a===e?0:1,Xe=(a,e,n)=>Ge(a,e)*(n?1:-1),et=(a,e,n)=>typeof a=="string"&&typeof e=="string"?He(a,e,n):Xe(a,e,n),ze=(a,e,n,s)=>{const d=n(a),_=n(e);return et(d,_,s)};class tt{static get(e){return Ee.get(e)}static set(e,n){Ee.set(e,n)}static remove(e){Ee.remove(e)}}class T{static listeners=new Set;static initialized=!1;static resizeTimeout=null;static lastWidth=null;static onResize(e){return T.initialized||T.init(),T.listeners.add(e),()=>T.off(e)}static handleResize=()=>{T.resizeTimeout!==null&&(window.clearTimeout(T.resizeTimeout),T.resizeTimeout=null),T.resizeTimeout=window.setTimeout(()=>{const e=window.innerWidth;if(T.resizeTimeout=null,e!==T.lastWidth){T.lastWidth=e;for(const n of T.listeners)n(e)}},150)};static init(){if(!T.initialized){if(typeof window>"u")throw new Error("WindowResizeHelper is only available in browser environments");T.lastWidth=window.innerWidth,window.addEventListener("resize",T.handleResize,{passive:!0}),T.initialized=!0}}static off(e){T.initialized&&(T.listeners.delete(e),T.listeners.size===0&&(T.resizeTimeout!==null&&(window.clearTimeout(T.resizeTimeout),T.resizeTimeout=null),window.removeEventListener("resize",T.handleResize),T.initialized=!1,T.lastWidth=null))}}function W(a,e,n){Object.defineProperty(a,e,{configurable:!0,enumerable:!1,value:n,writable:!0})}function rt(){W(Array.prototype,"distinct",function(a){return a?this.filter((n,s,d)=>d.findIndex(_=>a(_,n))===s):this.filter((n,s,d)=>d.indexOf(n)===s)}),W(Array.prototype,"filterBy",function(a){return this.filter(e=>a(e))}),W(Array.prototype,"first",function(){return this.length>0?this[0]:null}),W(Array.prototype,"groupBy",function(a){return this.reduce((e,n)=>{const s=a(n);return Object.hasOwn(e,s)||(e[s]=[]),e[s].push(n),e},Object.create(null))}),W(Array.prototype,"orderBy",function(a,e=!0){return this?.sort((n,s)=>ze(n,s,a,e)),this}),W(Array.prototype,"removeBy",function(a,e){return this.filter(n=>a(n)!==e)})}var Oe={exports:{}},nt=Oe.exports,Ae;function it(){return Ae||(Ae=1,(function(a,e){(function(n,s){a.exports=s()})(nt,(function(){var n=1e3,s=6e4,d=36e5,_="millisecond",z="second",I="minute",K="hour",p="day",U="week",j="month",Q="quarter",q="year",X="date",ne="Invalid Date",ue=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ge=/\[([^\]]+)]|YYYY|YY|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,ve={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(v){var h=["th","st","nd","rd"],f=v%100;return"["+v+(h[(f-20)%10]||h[f]||h[0])+"]"}},fe=function(v,h,f){var o=String(v);return!o||o.length>=h?v:""+Array(h+1-o.length).join(f)+v},_e={s:fe,z:function(v){var h=-v.utcOffset(),f=Math.abs(h),o=Math.floor(f/60),c=f%60;return(h<=0?"+":"-")+fe(o,2,"0")+":"+fe(c,2,"0")},m:function v(h,f){if(h.date()<f.date())return-v(f,h);var o=12*(f.year()-h.year())+(f.month()-h.month()),c=h.clone().add(o,j),l=f-c<0,w=h.clone().add(o+(l?-1:1),j);return+(-(o+(f-c)/(l?c-w:w-c))||0)},a:function(v){return v<0?Math.ceil(v)||0:Math.floor(v)},p:function(v){return{M:j,y:q,w:U,d:p,D:X,h:K,m:I,s:z,ms:_,Q}[v]||String(v||"").toLowerCase().replace(/s$/,"")},u:function(v){return v===void 0}},ce="en",V={};V[ce]=ve;var L="$isDayjsObject",t=function(v){return v instanceof y||!(!v||!v[L])},r=function v(h,f,o){var c;if(!h)return ce;if(typeof h=="string"){var l=h.toLowerCase();V[l]&&(c=l),f&&(V[l]=f,c=l);var w=h.split("-");if(!c&&w.length>1)return v(w[0])}else{var m=h.name;V[m]=h,c=m}return!o&&c&&(ce=c),c||!o&&ce},i=function(v,h){if(t(v))return v.clone();var f=typeof h=="object"?h:{};return f.date=v,f.args=arguments,new y(f)},u=_e;u.l=r,u.i=t,u.w=function(v,h){return i(v,{locale:h.$L,utc:h.$u,x:h.$x,$offset:h.$offset})};var y=(function(){function v(f){this.$L=r(f.locale,null,!0),this.parse(f),this.$x=this.$x||f.x||{},this[L]=!0}var h=v.prototype;return h.parse=function(f){this.$d=(function(o){var c=o.date,l=o.utc;if(c===null)return new Date(NaN);if(u.u(c))return new Date;if(c instanceof Date)return new Date(c);if(typeof c=="string"&&!/Z$/i.test(c)){var w=c.match(ue);if(w){var m=w[2]-1||0,k=(w[7]||"0").substring(0,3);return l?new Date(Date.UTC(w[1],m,w[3]||1,w[4]||0,w[5]||0,w[6]||0,k)):new Date(w[1],m,w[3]||1,w[4]||0,w[5]||0,w[6]||0,k)}}return new Date(c)})(f),this.init()},h.init=function(){var f=this.$d;this.$y=f.getFullYear(),this.$M=f.getMonth(),this.$D=f.getDate(),this.$W=f.getDay(),this.$H=f.getHours(),this.$m=f.getMinutes(),this.$s=f.getSeconds(),this.$ms=f.getMilliseconds()},h.$utils=function(){return u},h.isValid=function(){return this.$d.toString()!==ne},h.isSame=function(f,o){var c=i(f);return this.startOf(o)<=c&&c<=this.endOf(o)},h.isAfter=function(f,o){return i(f)<this.startOf(o)},h.isBefore=function(f,o){return this.endOf(o)<i(f)},h.$g=function(f,o,c){return u.u(f)?this[o]:this.set(c,f)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(f,o){var c=this,l=!!u.u(o)||o,w=u.p(f),m=function(x,D){var S=u.w(c.$u?Date.UTC(c.$y,D,x):new Date(c.$y,D,x),c);return l?S:S.endOf(p)},k=function(x,D){return u.w(c.toDate()[x].apply(c.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(D)),c)},g=this.$W,M=this.$M,C=this.$D,B="set"+(this.$u?"UTC":"");switch(w){case q:return l?m(1,0):m(31,11);case j:return l?m(1,M):m(0,M+1);case U:var N=this.$locale().weekStart||0,b=(g<N?g+7:g)-N;return m(l?C-b:C+(6-b),M);case p:case X:return k(B+"Hours",0);case K:return k(B+"Minutes",1);case I:return k(B+"Seconds",2);case z:return k(B+"Milliseconds",3);default:return this.clone()}},h.endOf=function(f){return this.startOf(f,!1)},h.$set=function(f,o){var c,l=u.p(f),w="set"+(this.$u?"UTC":""),m=(c={},c[p]=w+"Date",c[X]=w+"Date",c[j]=w+"Month",c[q]=w+"FullYear",c[K]=w+"Hours",c[I]=w+"Minutes",c[z]=w+"Seconds",c[_]=w+"Milliseconds",c)[l],k=l===p?this.$D+(o-this.$W):o;if(l===j||l===q){var g=this.clone().set(X,1);g.$d[m](k),g.init(),this.$d=g.set(X,Math.min(this.$D,g.daysInMonth())).$d}else m&&this.$d[m](k);return this.init(),this},h.set=function(f,o){return this.clone().$set(f,o)},h.get=function(f){return this[u.p(f)]()},h.add=function(f,o){var c,l=this;f=Number(f);var w=u.p(o),m=function(M){var C=i(l);return u.w(C.date(C.date()+Math.round(M*f)),l)};if(w===j)return this.set(j,this.$M+f);if(w===q)return this.set(q,this.$y+f);if(w===p)return m(1);if(w===U)return m(7);var k=(c={},c[I]=s,c[K]=d,c[z]=n,c)[w]||1,g=this.$d.getTime()+f*k;return u.w(g,this)},h.subtract=function(f,o){return this.add(-1*f,o)},h.format=function(f){var o=this,c=this.$locale();if(!this.isValid())return c.invalidDate||ne;var l=f||"YYYY-MM-DDTHH:mm:ssZ",w=u.z(this),m=this.$H,k=this.$m,g=this.$M,M=c.weekdays,C=c.months,B=c.meridiem,N=function(D,S,R,Y){return D&&(D[S]||D(o,l))||R[S].slice(0,Y)},b=function(D){return u.s(m%12||12,D,"0")},x=B||function(D,S,R){var Y=D<12?"AM":"PM";return R?Y.toLowerCase():Y};return l.replace(ge,(function(D,S){return S||(function(R){switch(R){case"YY":return String(o.$y).slice(-2);case"YYYY":return u.s(o.$y,4,"0");case"M":return g+1;case"MM":return u.s(g+1,2,"0");case"MMM":return N(c.monthsShort,g,C,3);case"MMMM":return N(C,g);case"D":return o.$D;case"DD":return u.s(o.$D,2,"0");case"d":return String(o.$W);case"dd":return N(c.weekdaysMin,o.$W,M,2);case"ddd":return N(c.weekdaysShort,o.$W,M,3);case"dddd":return M[o.$W];case"H":return String(m);case"HH":return u.s(m,2,"0");case"h":return b(1);case"hh":return b(2);case"a":return x(m,k,!0);case"A":return x(m,k,!1);case"m":return String(k);case"mm":return u.s(k,2,"0");case"s":return String(o.$s);case"ss":return u.s(o.$s,2,"0");case"SSS":return u.s(o.$ms,3,"0");case"Z":return w}return null})(D)||w.replace(":","")}))},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(f,o,c){var l,w=this,m=u.p(o),k=i(f),g=(k.utcOffset()-this.utcOffset())*s,M=this-k,C=function(){return u.m(w,k)};switch(m){case q:l=C()/12;break;case j:l=C();break;case Q:l=C()/3;break;case U:l=(M-g)/6048e5;break;case p:l=(M-g)/864e5;break;case K:l=M/d;break;case I:l=M/s;break;case z:l=M/n;break;default:l=M}return c?l:u.a(l)},h.daysInMonth=function(){return this.endOf(j).$D},h.$locale=function(){return V[this.$L]},h.locale=function(f,o){if(!f)return this.$L;var c=this.clone(),l=r(f,o,!0);return l&&(c.$L=l),c},h.clone=function(){return u.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},v})(),E=y.prototype;return i.prototype=E,[["$ms",_],["$s",z],["$m",I],["$H",K],["$W",p],["$M",j],["$y",q],["$D",X]].forEach((function(v){E[v[1]]=function(h){return this.$g(h,v[0],v[1])}})),i.extend=function(v,h){return v.$i||(v(h,y,i),v.$i=!0),i},i.locale=r,i.isDayjs=t,i.unix=function(v){return i(1e3*v)},i.en=V[ce],i.Ls=V,i.p={},i}))})(Oe)),Oe.exports}var st=it();const te=Me(st);var xe={exports:{}},at=xe.exports,Te;function ot(){return Te||(Te=1,(function(a,e){(function(n,s){a.exports=s()})(at,(function(){var n="day";return function(s,d,_){var z=function(p){return p.add(4-p.isoWeekday(),n)},I=d.prototype;I.isoWeekYear=function(){return z(this).year()},I.isoWeek=function(p){if(!this.$utils().u(p))return this.add(7*(p-this.isoWeek()),n);var U,j,Q,q,X=z(this),ne=(U=this.isoWeekYear(),j=this.$u,Q=(j?_.utc:_)().year(U).startOf("year"),q=4-Q.isoWeekday(),Q.isoWeekday()>4&&(q+=7),Q.add(q,n));return X.diff(ne,"week")+1},I.isoWeekday=function(p){return this.$utils().u(p)?this.day()||7:this.day(this.day()%7?p:p-7)};var K=I.startOf;I.startOf=function(p,U){var j=this.$utils(),Q=!!j.u(U)||U;return j.p(p)==="isoweek"?Q?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):K.bind(this)(p,U)}}}))})(xe)),xe.exports}var ut=ot();const ct=Me(ut);var De={exports:{}},lt=De.exports,Ie;function ft(){return Ie||(Ie=1,(function(a,e){(function(n,s){a.exports=s()})(lt,(function(){var n={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(s,d,_){var z=d.prototype,I=z.format;_.en.formats=n,z.format=function(K){K===void 0&&(K="YYYY-MM-DDTHH:mm:ssZ");var p=this.$locale().formats,U=(function(j,Q){return j.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(q,X,ne){var ue=ne&&ne.toUpperCase();return X||Q[ne]||n[ne]||Q[ue].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(ge,ve,fe){return ve||fe.slice(1)}))}))})(K,p===void 0?{}:p);return I.call(this,U)}}}))})(De)),De.exports}var dt=ft();const ht=Me(dt);te.extend(ht);te.extend(ct);function pt(){W(Date.prototype,"add",function(a,e){return te(this).add(a,e).toDate()}),W(Date.prototype,"diff",function(a,e){return te(this).diff(a,e)}),W(Date.prototype,"endOf",function(a){return te(this).endOf(a).toDate()}),W(Date.prototype,"firstDayOfMonth",function(){return te(this).startOf("month").toDate()}),W(Date.prototype,"format",function(a){return te(this).format(a)}),W(Date.prototype,"isAfter",function(a,e){return te(this).isAfter(a,e)}),W(Date.prototype,"isBefore",function(a,e){return te(this).isBefore(a,e)}),W(Date.prototype,"isValid",function(){return te(this).isValid()}),W(Date.prototype,"isoWeek",function(){return te(this).isoWeek()}),W(Date.prototype,"subtract",function(a,e){return te(this).subtract(a,e).toDate()}),W(Date.prototype,"lastDayOfMonth",function(){return te(this).endOf("month").toDate()}),W(Date.prototype,"set",function(a,e){return te(this).set(a,e).toDate()}),W(Date.prototype,"startOf",function(a){return te(this).startOf(a).toDate()})}function gt(){W(String.prototype,"capitalize",function(){return this.charAt(0).toUpperCase()+this.slice(1)}),W(String.prototype,"isNumber",function(){return!isNaN(Number(this))&&this.trim()!==""}),W(String.prototype,"isEmpty",function(){return this===void 0||!this||this.length===0}),W(String.prototype,"stripTags",function(){return new DOMParser().parseFromString(this.toString(),"text/html").body.textContent||""})}class mt{resizeListener=null;onResizeCallbacks=new Set;emitTimeoutId=null;duplicateThresholdMs=60;constructor(){typeof window<"u"&&(this.resizeListener=this.onResize,window.addEventListener("resize",this.resizeListener,{passive:!0}))}destroy(){typeof window<"u"&&this.resizeListener!==null&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.emitTimeoutId!==null&&(clearTimeout(this.emitTimeoutId),this.emitTimeoutId=null),this.onResizeCallbacks.clear()}onResizeChange(e){this.onResizeCallbacks.add(e)}offResizeChange(e){this.onResizeCallbacks.delete(e)}onResize=()=>{if(typeof window>"u")return;const e=window.innerWidth;this.emitTimeoutId!==null&&clearTimeout(this.emitTimeoutId),this.emitTimeoutId=window.setTimeout(()=>{this.emitTimeoutId=null;const n=he.getBreakpointByScreenWidth(e);for(const s of this.onResizeCallbacks)s(e,n)},this.duplicateThresholdMs)}}exports.BreakPointHelper=he;exports.BreakPoints=Ue;exports.BrowserHelper=H;exports.BrowserService=mt;exports.BrowserType=ee;exports.CanvasHelper=je;exports.CsvHelper=Je;exports.DownloadHelper=Fe;exports.EnumHelper=Qe;exports.FileHelper=Ve;exports.ImageHelper=Ze;exports.LocalStorageHelper=Ee;exports.LoggerHelper=G;exports.LoggerType=pe;exports.ScreenHelper=Se;exports.TokenHelper=tt;exports.WindowResizeHelper=T;exports.copyToClipboard=Be;exports.initArrayExtensions=rt;exports.initDateExtensions=pt;exports.initStringExtensions=gt;exports.sortHelper=ze;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("papaparse"),u=require("dayjs"),U=require("dayjs/plugin/isoWeek.js"),k=require("dayjs/plugin/localizedFormat.js"),b={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400,xxxl:1600};class p{static getScreenWidth(){return document.documentElement.clientWidth}static getScreenHeight(){return document.documentElement.clientHeight}}class f{static breakPoints=b;static getCurrentBreakpoint(){return f.getBreakpointByScreenWidth(p.getScreenWidth())}static getBreakpointByScreenWidth(e=p.getScreenWidth()){let t="xs";for(const i of Object.keys(f.breakPoints))f.breakPoints[i]<=e&&(t=i);return{breakpoint:t,screenWidth:e}}static isScreenGreaterThan(e){return p.getScreenWidth()>f.breakPoints[e]}static isScreenSmallerThan(e){return p.getScreenWidth()<f.breakPoints[e]}}var d=(r=>(r.opera="opera",r.firefox="firefox",r.safari="safari",r.ie="ie",r.edgeLegacy="edgeLegacy",r.edg="edg",r.chrome="chrome",r.iOS="iOS",r.iOsSafari="iOsSafari",r.edgiOs="edgiOs",r.headlessChrome="headlessChrome",r.nodeRuntime="nodeRuntime",r.electron="electron",r))(d||{});class c{static getUserAgent(){return this.isBrowserEnv()?navigator.userAgent.toLowerCase():""}static resolveUserAgent(e){return(e??this.getUserAgent()).toLowerCase()}static isBrowserEnv(){return typeof window<"u"&&typeof navigator<"u"}static isOpera(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e);return t.includes("opr/")||t.includes("opera")}static isFirefox(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("firefox")||typeof globalThis.InstallTrigger<"u":!1}static isSafari(e){if(!this.isBrowserEnv())return!1;const t=navigator.vendor.includes("Apple"),i=this.resolveUserAgent(e),n=i.includes("safari"),s=!(i.includes("crios")||i.includes("chrome")||i.includes("android")||i.includes("opr/")||i.includes("edg"));return t&&n&&s}static isIOS(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e),i=/iphone|ipad|ipod/.test(t),n=t.includes("macintosh")&&navigator.maxTouchPoints>1;return i||n}static isIosSafari(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e);return this.isIOS(t)&&this.isSafari(t)}static isEdgeLegacy(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e);return!!window.StyleMedia&&!t.includes("edg/")}static isEdg(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("edg/"):!1}static isEdgeIos(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e);return this.isIOS(t)&&t.includes("edgios")}static isIE(){return this.isBrowserEnv()?typeof document<"u"&&!!document.documentMode:!1}static isChrome(e){if(!this.isBrowserEnv())return!1;const t=this.resolveUserAgent(e),i=navigator.vendor.includes("Google"),n=t.includes("chrome")||t.includes("crios"),s=!this.isEdg(t)&&!this.isOpera(t);return i&&n&&s}static isElectron(e){const t=!!(typeof process<"u"&&process.versions?.electron),i=this.resolveUserAgent(e);return t||i.includes("electron")}static isHeadlessChrome(e){return this.isBrowserEnv()?this.resolveUserAgent(e).includes("headlesschrome"):!1}static isNodeRuntime(){return typeof process<"u"&&!!process.versions?.node&&!this.isBrowserEnv()}static getCurrentBrowser(){const e=c.getUserAgent();if(c.isElectron(e))return d.electron;if(c.isNodeRuntime())return d.nodeRuntime;if(c.isOpera(e))return d.opera;if(c.isFirefox(e))return d.firefox;if(c.isEdgeIos(e))return d.edgiOs;if(c.isIosSafari(e))return d.iOsSafari;if(c.isIOS(e))return d.iOS;if(c.isHeadlessChrome(e))return d.headlessChrome;if(c.isIE())return d.ie;if(c.isEdgeLegacy(e))return d.edgeLegacy;if(c.isEdg(e))return d.edg;if(c.isChrome(e))return d.chrome;if(c.isSafari(e))return d.safari;throw new Error("Browser could not be detected: "+e)}}class D{static toBlob(e,t,i=!1,n){return new Promise((s,h)=>{e.toBlob(g=>{g?s(g):h(new Error("canvas.toBlob returned null"))},t,i?n:void 0)})}}function L(r){return navigator.clipboard.writeText(r)}const{parse:C,unparse:I}=A;class T{static unparse(e,t){return I(e,t)}static parse(e){return new Promise((t,i)=>{C(e,{header:!0,complete:n=>t(n),error:n=>i(n)})})}}class x{static revokeObjectUrlDelay=4e4;static utf8BomMimeType=/^\s*(?:text\/\S*|application\/xml|\S+\/\S+\+xml)\s*;\s*charset\s*=\s*utf-8/i;static saveAs(e,t,i={}){this.assertBrowserEnvironment();const n=this.resolveFileName(e,t),s=i.autoBom?this.addUtf8Bom(e):e;this.downloadBlob(s,n)}static resolveFileName(e,t){return typeof t=="string"&&t.trim().length>0?t:typeof File<"u"&&e instanceof File&&e.name.trim().length>0?e.name:"download"}static addUtf8Bom(e){return this.utf8BomMimeType.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}static assertBrowserEnvironment(){if(typeof window>"u"||typeof document>"u"||typeof URL>"u"||typeof URL.createObjectURL!="function"||typeof URL.revokeObjectURL!="function")throw new Error("DownloadHelper is only available in a browser environment with object URL support.")}static downloadBlob(e,t){const i=URL.createObjectURL(e);try{this.clickDownloadLink(i,t)}finally{window.setTimeout(()=>URL.revokeObjectURL(i),this.revokeObjectUrlDelay)}}static clickDownloadLink(e,t){const i=document.body??document.documentElement;if(!i)throw new Error("DownloadHelper.saveAs requires an initialized document.");const n=document.createElement("a");try{n.download=t,n.href=e,n.target="_blank",n.rel="noopener noreferrer",n.style.display="none",i.appendChild(n),n.click()}finally{n.remove()}}}class B{static getEnumValue(e,t){if(t in e)return e[t];throw Error(`${t} not found in ${e}`)}static getKeyValues(e){return Object.keys(e).filter(t=>!isNaN(Number(t))).map(t=>({key:Number(t),value:e[t]}))}}class z{static getFileExtension(e){let t="";const i=e.lastIndexOf(".");return i>0&&i<e.length-1&&(t=`.${e.substring(i+1).toLowerCase()}`),t}static readAsText(e){const t=new FileReader;return new Promise((i,n)=>{t.onload=()=>{t.onload=null,t.onerror=null,typeof t.result=="string"?i(t.result):n(new Error("Unexpected result type"))},t.onerror=()=>{const s=t.error??new Error("FileReader error");t.onload=null,t.onerror=null,n(s)},t.readAsText(e)})}static readAsArrayBuffer(e){const t=new FileReader;return new Promise((i,n)=>{t.onload=()=>{t.onload=null,t.onerror=null,t.result instanceof ArrayBuffer?i(t.result):n(new Error("Unexpected result type"))},t.onerror=()=>{const s=t.error??new Error("FileReader error");t.onload=null,t.onerror=null,n(s)},t.readAsArrayBuffer(e)})}static readAsDataUrl(e){const t=new FileReader;return new Promise((i,n)=>{t.onload=s=>{i(s)},t.onerror=s=>n(s),t.readAsDataURL(e)})}static formatFileSize(e,t=2,i){if(e===0)return"0 Bytes";const n=1024,s=["Bytes","KB","MB","GB","TB"];let h=Math.floor(Math.log(e)/Math.log(n));i&&s.includes(i)&&(h=s.indexOf(i));const g=e/Math.pow(n,h);return`${parseFloat(g.toFixed(t))} ${s[h]}`}static isWithinSizeLimit(e,t){if(!Number.isSafeInteger(t)||t<0)throw new RangeError("maxBytes must be a non-negative safe integer.");return e.size<=t}static save(e,t,i){const n=new Blob([e],{type:i});x.saveAs(n,t)}}class F{static hasAllowedMimeType(e,t){const i=e.type.trim().toLowerCase();return i.length>0&&t.some(n=>n.trim().toLowerCase()===i)}static load(e){const t=URL.createObjectURL(e);return this.loadSource(t).finally(()=>URL.revokeObjectURL(t))}static async compress(e,t=.8,i="image/jpeg"){const n=await this.loadSource(e),{canvas:s}=this.resize(n,n.width,n.height);return s.toDataURL(i,t)}static resize(e,t,i){let{width:n,height:s}=e;const h=t/n,g=i/s,w=Math.min(h,g,1);n=Math.floor(n*w),s=Math.floor(s*w);const y=document.createElement("canvas");y.width=n,y.height=s;const S=y.getContext("2d");return S.clearRect(0,0,n,s),S.drawImage(e,0,0,n,s),{canvas:y,width:n,height:s}}static loadSource(e){return new Promise((t,i)=>{const n=new Image;n.onload=()=>t(n),n.onerror=i,n.src=e})}}class v{static set(e,t){localStorage.setItem(e,JSON.stringify(t))}static get(e){let t=null;const i=localStorage.getItem(e);return i&&(t=JSON.parse(i)),t}static remove(e){const t=localStorage.getItem(e)!==null;return t&&localStorage.removeItem(e),t}static removeAll(){localStorage.clear()}static getKeysBy(e){return Object.keys(localStorage).filter(t=>t.startsWith(e))}}var m=(r=>(r.log="log",r.info="info",r.warn="warn",r.debug="debug",r.error="error",r))(m||{});class l{static listeners=new Set;static enabled=!0;static log(...e){l.doLog(m.log,e)}static info(...e){l.doLog(m.info,e)}static warn(...e){l.doLog(m.warn,e)}static debug(...e){l.doLog(m.debug,e)}static error(...e){l.doLog(m.error,e)}static clearListeners(){l.listeners.clear()}static setEnabled(e){l.enabled=e}static doLog(e,t){if(!l.enabled)return;const i={type:e,args:t,timestamp:new Date().toISOString()};for(const n of l.listeners)try{if(n(i)===!1)return}catch{}console[e].apply(console,t)}static onLog(e,t=!1){if(t){const i=n=>{try{return e(n)}finally{l.listeners.delete(i)}};return l.listeners.add(i),()=>l.listeners.delete(i)}return l.listeners.add(e),()=>l.listeners.delete(e)}}const M=(r,e,t)=>r.localeCompare(e)*(t?1:-1),R=(r,e)=>r<e?-1:r===e?0:1,N=(r,e,t)=>R(r,e)*(t?1:-1),P=(r,e,t)=>typeof r=="string"&&typeof e=="string"?M(r,e,t):N(r,e,t),O=(r,e,t,i)=>{const n=t(r),s=t(e);return P(n,s,i)};class j{static get(e){return v.get(e)}static set(e,t){v.set(e,t)}static remove(e){v.remove(e)}}class o{static listeners=new Set;static initialized=!1;static resizeTimeout=null;static lastWidth=null;static onResize(e){return o.initialized||o.init(),o.listeners.add(e),()=>o.off(e)}static handleResize=()=>{o.resizeTimeout!==null&&(window.clearTimeout(o.resizeTimeout),o.resizeTimeout=null),o.resizeTimeout=window.setTimeout(()=>{const e=window.innerWidth;if(o.resizeTimeout=null,e!==o.lastWidth){o.lastWidth=e;for(const t of o.listeners)t(e)}},150)};static init(){if(!o.initialized){if(typeof window>"u")throw new Error("WindowResizeHelper is only available in browser environments");o.lastWidth=window.innerWidth,window.addEventListener("resize",o.handleResize,{passive:!0}),o.initialized=!0}}static off(e){o.initialized&&(o.listeners.delete(e),o.listeners.size===0&&(o.resizeTimeout!==null&&(window.clearTimeout(o.resizeTimeout),o.resizeTimeout=null),window.removeEventListener("resize",o.handleResize),o.initialized=!1,o.lastWidth=null))}}function a(r,e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!1,value:t,writable:!0})}function q(){a(Array.prototype,"distinct",function(r){return r?this.filter((t,i,n)=>n.findIndex(s=>r(s,t))===i):this.filter((t,i,n)=>n.indexOf(t)===i)}),a(Array.prototype,"filterBy",function(r){return this.filter(e=>r(e))}),a(Array.prototype,"first",function(){return this.length>0?this[0]:null}),a(Array.prototype,"groupBy",function(r){return this.reduce((e,t)=>{const i=r(t);return Object.hasOwn(e,i)||(e[i]=[]),e[i].push(t),e},Object.create(null))}),a(Array.prototype,"orderBy",function(r,e=!0){return this?.sort((t,i)=>O(t,i,r,e)),this}),a(Array.prototype,"removeBy",function(r,e){return this.filter(t=>r(t)!==e)})}let E=!1;function V(){E||(u.extend(k),u.extend(U),E=!0),a(Date.prototype,"add",function(r,e){return u(this).add(r,e).toDate()}),a(Date.prototype,"diff",function(r,e){return u(this).diff(r,e)}),a(Date.prototype,"endOf",function(r){return u(this).endOf(r).toDate()}),a(Date.prototype,"firstDayOfMonth",function(){return u(this).startOf("month").toDate()}),a(Date.prototype,"format",function(r){return u(this).format(r)}),a(Date.prototype,"isAfter",function(r,e){return u(this).isAfter(r,e)}),a(Date.prototype,"isBefore",function(r,e){return u(this).isBefore(r,e)}),a(Date.prototype,"isValid",function(){return u(this).isValid()}),a(Date.prototype,"isoWeek",function(){return u(this).isoWeek()}),a(Date.prototype,"subtract",function(r,e){return u(this).subtract(r,e).toDate()}),a(Date.prototype,"lastDayOfMonth",function(){return u(this).endOf("month").toDate()}),a(Date.prototype,"set",function(r,e){return u(this).set(r,e).toDate()}),a(Date.prototype,"startOf",function(r){return u(this).startOf(r).toDate()})}function $(){a(String.prototype,"capitalize",function(){return this.charAt(0).toUpperCase()+this.slice(1)}),a(String.prototype,"isNumber",function(){return!isNaN(Number(this))&&this.trim()!==""}),a(String.prototype,"isEmpty",function(){return this===void 0||!this||this.length===0}),a(String.prototype,"stripTags",function(){return new DOMParser().parseFromString(this.toString(),"text/html").body.textContent||""})}class G{resizeListener=null;onResizeCallbacks=new Set;emitTimeoutId=null;duplicateThresholdMs=60;constructor(){typeof window<"u"&&(this.resizeListener=this.onResize,window.addEventListener("resize",this.resizeListener,{passive:!0}))}destroy(){typeof window<"u"&&this.resizeListener!==null&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.emitTimeoutId!==null&&(clearTimeout(this.emitTimeoutId),this.emitTimeoutId=null),this.onResizeCallbacks.clear()}onResizeChange(e){this.onResizeCallbacks.add(e)}offResizeChange(e){this.onResizeCallbacks.delete(e)}onResize=()=>{if(typeof window>"u")return;const e=window.innerWidth;this.emitTimeoutId!==null&&clearTimeout(this.emitTimeoutId),this.emitTimeoutId=window.setTimeout(()=>{this.emitTimeoutId=null;const t=f.getBreakpointByScreenWidth(e);for(const i of this.onResizeCallbacks)i(e,t)},this.duplicateThresholdMs)}}exports.BreakPointHelper=f;exports.BreakPoints=b;exports.BrowserHelper=c;exports.BrowserService=G;exports.BrowserType=d;exports.CanvasHelper=D;exports.CsvHelper=T;exports.DownloadHelper=x;exports.EnumHelper=B;exports.FileHelper=z;exports.ImageHelper=F;exports.LocalStorageHelper=v;exports.LoggerHelper=l;exports.LoggerType=m;exports.ScreenHelper=p;exports.TokenHelper=j;exports.WindowResizeHelper=o;exports.copyToClipboard=L;exports.initArrayExtensions=q;exports.initDateExtensions=V;exports.initStringExtensions=$;exports.sortHelper=O;
|