mstate-cli 0.1.9 → 0.2.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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var e=require("fs"),a=require("path"),n=require("os"),i=require("node:process"),t=require("node:buffer"),o=require("node:path"),r=require("node:url"),s=require("node:child_process"),c=require("node:fs/promises"),p=require("node:os"),l=require("node:fs"),u=require("node:util"),d=require("tty"),f=require("util"),m=require("net"),v=require("events"),h=require("stream"),x=require("zlib"),g=require("buffer"),b=require("string_decoder"),y=require("querystring"),w=require("url"),k=require("http"),j=require("crypto"),_=require("process"),S="undefined"!=typeof document?document.currentScript:null;function E(e){var a=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(a,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),a.default=e,Object.freeze(a)}var A=E(e),C="0.1.9";const T=a.join(n.homedir(),".mstate"),O=a.join(T,".mstate_credentials"),B="https://api.mstate.mobioffice.io/api";var P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z={exports:{}};function I(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var F,R={exports:{}};function L(){return F||(F=1,R.exports=function(){var e=e||function(e,a){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==P&&P.crypto&&(n=P.crypto),!n)try{n=require("crypto")}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},t=Object.create||function(){function e(){}return function(a){var n;return e.prototype=a,n=new e,e.prototype=null,n}}(),o={},r=o.lib={},s=r.Base={extend:function(e){var a=t(this);return e&&a.mixIn(e),a.hasOwnProperty("init")&&this.init!==a.init||(a.init=function(){a.$super.init.apply(this,arguments)}),a.init.prototype=a,a.$super=this,a},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var a in e)e.hasOwnProperty(a)&&(this[a]=e[a]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=r.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=a?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var a=this.words,n=e.words,i=this.sigBytes,t=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o<t;o++){var r=n[o>>>2]>>>24-o%4*8&255;a[i+o>>>2]|=r<<24-(i+o)%4*8}else for(var s=0;s<t;s+=4)a[i+s>>>2]=n[s>>>2];return this.sigBytes+=t,this},clamp:function(){var a=this.words,n=this.sigBytes;a[n>>>2]&=4294967295<<32-n%4*8,a.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var a=[],n=0;n<e;n+=4)a.push(i());return new c.init(a,e)}}),p=o.enc={},l=p.Hex={stringify:function(e){for(var a=e.words,n=e.sigBytes,i=[],t=0;t<n;t++){var o=a[t>>>2]>>>24-t%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var a=e.length,n=[],i=0;i<a;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new c.init(n,a/2)}},u=p.Latin1={stringify:function(e){for(var a=e.words,n=e.sigBytes,i=[],t=0;t<n;t++){var o=a[t>>>2]>>>24-t%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var a=e.length,n=[],i=0;i<a;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new c.init(n,a)}},d=p.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(a){var n,i=this._data,t=i.words,o=i.sigBytes,r=this.blockSize,s=o/(4*r),p=(s=a?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*r,l=e.min(4*p,o);if(p){for(var u=0;u<p;u+=r)this._doProcessBlock(t,u);n=t.splice(0,p),i.sigBytes-=l}return new c.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=f.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(a,n){return new e.init(n).finalize(a)}},_createHmacHelper:function(e){return function(a,n){return new m.HMAC.init(e,n).finalize(a)}}});var m=o.algo={};return o}(Math);return e}()),R.exports}var D,N={exports:{}};function M(){return D||(D=1,N.exports=function(e){return i=(n=e).lib,t=i.Base,o=i.WordArray,(r=n.x64={}).Word=t.extend({init:function(e,a){this.high=e,this.low=a}}),r.WordArray=t.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=a?n:8*e.length},toX32:function(){for(var e=this.words,a=e.length,n=[],i=0;i<a;i++){var t=e[i];n.push(t.high),n.push(t.low)}return o.create(n,this.sigBytes)},clone:function(){for(var e=t.clone.call(this),a=e.words=this.words.slice(0),n=a.length,i=0;i<n;i++)a[i]=a[i].clone();return e}}),e;var a,n,i,t,o,r}(L())),N.exports}var U,H={exports:{}};function $(){return U||(U=1,H.exports=function(e){return function(){if("function"==typeof ArrayBuffer){var a=e.lib.WordArray,n=a.init,i=a.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var a=e.byteLength,i=[],t=0;t<a;t++)i[t>>>2]|=e[t]<<24-t%4*8;n.call(this,i,a)}else n.apply(this,arguments)};i.prototype=a}}(),e.lib.WordArray}(L())),H.exports}var W,K={exports:{}};function G(){return W||(W=1,K.exports=function(e){return function(){var a=e,n=a.lib.WordArray,i=a.enc;function t(e){return e<<8&4278255360|e>>>8&16711935}i.Utf16=i.Utf16BE={stringify:function(e){for(var a=e.words,n=e.sigBytes,i=[],t=0;t<n;t+=2){var o=a[t>>>2]>>>16-t%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var a=e.length,i=[],t=0;t<a;t++)i[t>>>1]|=e.charCodeAt(t)<<16-t%2*16;return n.create(i,2*a)}},i.Utf16LE={stringify:function(e){for(var a=e.words,n=e.sigBytes,i=[],o=0;o<n;o+=2){var r=t(a[o>>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(r))}return i.join("")},parse:function(e){for(var a=e.length,i=[],o=0;o<a;o++)i[o>>>1]|=t(e.charCodeAt(o)<<16-o%2*16);return n.create(i,2*a)}}}(),e.enc.Utf16}(L())),K.exports}var V,Z={exports:{}};function J(){return V||(V=1,Z.exports=function(e){return function(){var a=e,n=a.lib.WordArray;function i(e,a,i){for(var t=[],o=0,r=0;r<a;r++)if(r%4){var s=i[e.charCodeAt(r-1)]<<r%4*2|i[e.charCodeAt(r)]>>>6-r%4*2;t[o>>>2]|=s<<24-o%4*8,o++}return n.create(t,o)}a.enc.Base64={stringify:function(e){var a=e.words,n=e.sigBytes,i=this._map;e.clamp();for(var t=[],o=0;o<n;o+=3)for(var r=(a[o>>>2]>>>24-o%4*8&255)<<16|(a[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|a[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)t.push(i.charAt(r>>>6*(3-s)&63));var c=i.charAt(64);if(c)for(;t.length%4;)t.push(c);return t.join("")},parse:function(e){var a=e.length,n=this._map,t=this._reverseMap;if(!t){t=this._reverseMap=[];for(var o=0;o<n.length;o++)t[n.charCodeAt(o)]=o}var r=n.charAt(64);if(r){var s=e.indexOf(r);-1!==s&&(a=s)}return i(e,a,t)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(L())),Z.exports}var X,Y={exports:{}};function Q(){return X||(X=1,Y.exports=function(e){return function(){var a=e,n=a.lib.WordArray;function i(e,a,i){for(var t=[],o=0,r=0;r<a;r++)if(r%4){var s=i[e.charCodeAt(r-1)]<<r%4*2|i[e.charCodeAt(r)]>>>6-r%4*2;t[o>>>2]|=s<<24-o%4*8,o++}return n.create(t,o)}a.enc.Base64url={stringify:function(e,a){void 0===a&&(a=!0);var n=e.words,i=e.sigBytes,t=a?this._safe_map:this._map;e.clamp();for(var o=[],r=0;r<i;r+=3)for(var s=(n[r>>>2]>>>24-r%4*8&255)<<16|(n[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|n[r+2>>>2]>>>24-(r+2)%4*8&255,c=0;c<4&&r+.75*c<i;c++)o.push(t.charAt(s>>>6*(3-c)&63));var p=t.charAt(64);if(p)for(;o.length%4;)o.push(p);return o.join("")},parse:function(e,a){void 0===a&&(a=!0);var n=e.length,t=a?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var r=0;r<t.length;r++)o[t.charCodeAt(r)]=r}var s=t.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(n=c)}return i(e,n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),e.enc.Base64url}(L())),Y.exports}var ee,ae={exports:{}};function ne(){return ee||(ee=1,ae.exports=function(e){return function(a){var n=e,i=n.lib,t=i.WordArray,o=i.Hasher,r=n.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*a.abs(a.sin(e+1))|0}();var c=r.MD5=o.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,a){for(var n=0;n<16;n++){var i=a+n,t=e[i];e[i]=16711935&(t<<8|t>>>24)|4278255360&(t<<24|t>>>8)}var o=this._hash.words,r=e[a+0],c=e[a+1],f=e[a+2],m=e[a+3],v=e[a+4],h=e[a+5],x=e[a+6],g=e[a+7],b=e[a+8],y=e[a+9],w=e[a+10],k=e[a+11],j=e[a+12],_=e[a+13],S=e[a+14],E=e[a+15],A=o[0],C=o[1],T=o[2],O=o[3];A=p(A,C,T,O,r,7,s[0]),O=p(O,A,C,T,c,12,s[1]),T=p(T,O,A,C,f,17,s[2]),C=p(C,T,O,A,m,22,s[3]),A=p(A,C,T,O,v,7,s[4]),O=p(O,A,C,T,h,12,s[5]),T=p(T,O,A,C,x,17,s[6]),C=p(C,T,O,A,g,22,s[7]),A=p(A,C,T,O,b,7,s[8]),O=p(O,A,C,T,y,12,s[9]),T=p(T,O,A,C,w,17,s[10]),C=p(C,T,O,A,k,22,s[11]),A=p(A,C,T,O,j,7,s[12]),O=p(O,A,C,T,_,12,s[13]),T=p(T,O,A,C,S,17,s[14]),A=l(A,C=p(C,T,O,A,E,22,s[15]),T,O,c,5,s[16]),O=l(O,A,C,T,x,9,s[17]),T=l(T,O,A,C,k,14,s[18]),C=l(C,T,O,A,r,20,s[19]),A=l(A,C,T,O,h,5,s[20]),O=l(O,A,C,T,w,9,s[21]),T=l(T,O,A,C,E,14,s[22]),C=l(C,T,O,A,v,20,s[23]),A=l(A,C,T,O,y,5,s[24]),O=l(O,A,C,T,S,9,s[25]),T=l(T,O,A,C,m,14,s[26]),C=l(C,T,O,A,b,20,s[27]),A=l(A,C,T,O,_,5,s[28]),O=l(O,A,C,T,f,9,s[29]),T=l(T,O,A,C,g,14,s[30]),A=u(A,C=l(C,T,O,A,j,20,s[31]),T,O,h,4,s[32]),O=u(O,A,C,T,b,11,s[33]),T=u(T,O,A,C,k,16,s[34]),C=u(C,T,O,A,S,23,s[35]),A=u(A,C,T,O,c,4,s[36]),O=u(O,A,C,T,v,11,s[37]),T=u(T,O,A,C,g,16,s[38]),C=u(C,T,O,A,w,23,s[39]),A=u(A,C,T,O,_,4,s[40]),O=u(O,A,C,T,r,11,s[41]),T=u(T,O,A,C,m,16,s[42]),C=u(C,T,O,A,x,23,s[43]),A=u(A,C,T,O,y,4,s[44]),O=u(O,A,C,T,j,11,s[45]),T=u(T,O,A,C,E,16,s[46]),A=d(A,C=u(C,T,O,A,f,23,s[47]),T,O,r,6,s[48]),O=d(O,A,C,T,g,10,s[49]),T=d(T,O,A,C,S,15,s[50]),C=d(C,T,O,A,h,21,s[51]),A=d(A,C,T,O,j,6,s[52]),O=d(O,A,C,T,m,10,s[53]),T=d(T,O,A,C,w,15,s[54]),C=d(C,T,O,A,c,21,s[55]),A=d(A,C,T,O,b,6,s[56]),O=d(O,A,C,T,E,10,s[57]),T=d(T,O,A,C,x,15,s[58]),C=d(C,T,O,A,_,21,s[59]),A=d(A,C,T,O,v,6,s[60]),O=d(O,A,C,T,k,10,s[61]),T=d(T,O,A,C,f,15,s[62]),C=d(C,T,O,A,y,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+C|0,o[2]=o[2]+T|0,o[3]=o[3]+O|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,t=8*e.sigBytes;n[t>>>5]|=128<<24-t%32;var o=a.floor(i/4294967296),r=i;n[15+(t+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(t+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,p=0;p<4;p++){var l=c[p];c[p]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,a,n,i,t,o,r){var s=e+(a&n|~a&i)+t+r;return(s<<o|s>>>32-o)+a}function l(e,a,n,i,t,o,r){var s=e+(a&i|n&~i)+t+r;return(s<<o|s>>>32-o)+a}function u(e,a,n,i,t,o,r){var s=e+(a^n^i)+t+r;return(s<<o|s>>>32-o)+a}function d(e,a,n,i,t,o,r){var s=e+(n^(a|~i))+t+r;return(s<<o|s>>>32-o)+a}n.MD5=o._createHelper(c),n.HmacMD5=o._createHmacHelper(c)}(Math),e.MD5}(L())),ae.exports}var ie,te={exports:{}};function oe(){return ie||(ie=1,te.exports=function(e){return n=(a=e).lib,i=n.WordArray,t=n.Hasher,o=a.algo,r=[],s=o.SHA1=t.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,a){for(var n=this._hash.words,i=n[0],t=n[1],o=n[2],s=n[3],c=n[4],p=0;p<80;p++){if(p<16)r[p]=0|e[a+p];else{var l=r[p-3]^r[p-8]^r[p-14]^r[p-16];r[p]=l<<1|l>>>31}var u=(i<<5|i>>>27)+c+r[p];u+=p<20?1518500249+(t&o|~t&s):p<40?1859775393+(t^o^s):p<60?(t&o|t&s|o&s)-1894007588:(t^o^s)-899497514,c=s,s=o,o=t<<30|t>>>2,t=i,i=u}n[0]=n[0]+i|0,n[1]=n[1]+t|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,a=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return a[i>>>5]|=128<<24-i%32,a[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),a[15+(i+64>>>9<<4)]=n,e.sigBytes=4*a.length,this._process(),this._hash},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e}}),a.SHA1=t._createHelper(s),a.HmacSHA1=t._createHmacHelper(s),e.SHA1;var a,n,i,t,o,r,s}(L())),te.exports}var re,se={exports:{}};function ce(){return re||(re=1,se.exports=function(e){return function(a){var n=e,i=n.lib,t=i.WordArray,o=i.Hasher,r=n.algo,s=[],c=[];!function(){function e(e){for(var n=a.sqrt(e),i=2;i<=n;i++)if(!(e%i))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var i=2,t=0;t<64;)e(i)&&(t<8&&(s[t]=n(a.pow(i,.5))),c[t]=n(a.pow(i,1/3)),t++),i++}();var p=[],l=r.SHA256=o.extend({_doReset:function(){this._hash=new t.init(s.slice(0))},_doProcessBlock:function(e,a){for(var n=this._hash.words,i=n[0],t=n[1],o=n[2],r=n[3],s=n[4],l=n[5],u=n[6],d=n[7],f=0;f<64;f++){if(f<16)p[f]=0|e[a+f];else{var m=p[f-15],v=(m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3,h=p[f-2],x=(h<<15|h>>>17)^(h<<13|h>>>19)^h>>>10;p[f]=v+p[f-7]+x+p[f-16]}var g=i&t^i&o^t&o,b=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),y=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&u)+c[f]+p[f];d=u,u=l,l=s,s=r+y|0,r=o,o=t,t=i,i=y+(b+g)|0}n[0]=n[0]+i|0,n[1]=n[1]+t|0,n[2]=n[2]+o|0,n[3]=n[3]+r|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+u|0,n[7]=n[7]+d|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,t=8*e.sigBytes;return n[t>>>5]|=128<<24-t%32,n[14+(t+64>>>9<<4)]=a.floor(i/4294967296),n[15+(t+64>>>9<<4)]=i,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=o._createHelper(l),n.HmacSHA256=o._createHmacHelper(l)}(Math),e.SHA256}(L())),se.exports}var pe,le={exports:{}};var ue,de={exports:{}};function fe(){return ue||(ue=1,de.exports=function(e){return function(){var a=e,n=a.lib.Hasher,i=a.x64,t=i.Word,o=i.WordArray,r=a.algo;function s(){return t.create.apply(t,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],p=[];!function(){for(var e=0;e<80;e++)p[e]=s()}();var l=r.SHA512=n.extend({_doReset:function(){this._hash=new o.init([new t.init(1779033703,4089235720),new t.init(3144134277,2227873595),new t.init(1013904242,4271175723),new t.init(2773480762,1595750129),new t.init(1359893119,2917565137),new t.init(2600822924,725511199),new t.init(528734635,4215389547),new t.init(1541459225,327033209)])},_doProcessBlock:function(e,a){for(var n=this._hash.words,i=n[0],t=n[1],o=n[2],r=n[3],s=n[4],l=n[5],u=n[6],d=n[7],f=i.high,m=i.low,v=t.high,h=t.low,x=o.high,g=o.low,b=r.high,y=r.low,w=s.high,k=s.low,j=l.high,_=l.low,S=u.high,E=u.low,A=d.high,C=d.low,T=f,O=m,B=v,P=h,q=x,z=g,I=b,F=y,R=w,L=k,D=j,N=_,M=S,U=E,H=A,$=C,W=0;W<80;W++){var K,G,V=p[W];if(W<16)G=V.high=0|e[a+2*W],K=V.low=0|e[a+2*W+1];else{var Z=p[W-15],J=Z.high,X=Z.low,Y=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),ee=p[W-2],ae=ee.high,ne=ee.low,ie=(ae>>>19|ne<<13)^(ae<<3|ne>>>29)^ae>>>6,te=(ne>>>19|ae<<13)^(ne<<3|ae>>>29)^(ne>>>6|ae<<26),oe=p[W-7],re=oe.high,se=oe.low,ce=p[W-16],pe=ce.high,le=ce.low;G=(G=(G=Y+re+((K=Q+se)>>>0<Q>>>0?1:0))+ie+((K+=te)>>>0<te>>>0?1:0))+pe+((K+=le)>>>0<le>>>0?1:0),V.high=G,V.low=K}var ue,de=R&D^~R&M,fe=L&N^~L&U,me=T&B^T&q^B&q,ve=O&P^O&z^P&z,he=(T>>>28|O<<4)^(T<<30|O>>>2)^(T<<25|O>>>7),xe=(O>>>28|T<<4)^(O<<30|T>>>2)^(O<<25|T>>>7),ge=(R>>>14|L<<18)^(R>>>18|L<<14)^(R<<23|L>>>9),be=(L>>>14|R<<18)^(L>>>18|R<<14)^(L<<23|R>>>9),ye=c[W],we=ye.high,ke=ye.low,je=H+ge+((ue=$+be)>>>0<$>>>0?1:0),_e=xe+ve;H=M,$=U,M=D,U=N,D=R,N=L,R=I+(je=(je=(je=je+de+((ue+=fe)>>>0<fe>>>0?1:0))+we+((ue+=ke)>>>0<ke>>>0?1:0))+G+((ue+=K)>>>0<K>>>0?1:0))+((L=F+ue|0)>>>0<F>>>0?1:0)|0,I=q,F=z,q=B,z=P,B=T,P=O,T=je+(he+me+(_e>>>0<xe>>>0?1:0))+((O=ue+_e|0)>>>0<ue>>>0?1:0)|0}m=i.low=m+O,i.high=f+T+(m>>>0<O>>>0?1:0),h=t.low=h+P,t.high=v+B+(h>>>0<P>>>0?1:0),g=o.low=g+z,o.high=x+q+(g>>>0<z>>>0?1:0),y=r.low=y+F,r.high=b+I+(y>>>0<F>>>0?1:0),k=s.low=k+L,s.high=w+R+(k>>>0<L>>>0?1:0),_=l.low=_+N,l.high=j+D+(_>>>0<N>>>0?1:0),E=u.low=E+U,u.high=S+M+(E>>>0<U>>>0?1:0),C=d.low=C+$,d.high=A+H+(C>>>0<$>>>0?1:0)},_doFinalize:function(){var e=this._data,a=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return a[i>>>5]|=128<<24-i%32,a[30+(i+128>>>10<<5)]=Math.floor(n/4294967296),a[31+(i+128>>>10<<5)]=n,e.sigBytes=4*a.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});a.SHA512=n._createHelper(l),a.HmacSHA512=n._createHmacHelper(l)}(),e.SHA512}(L(),M())),de.exports}var me,ve={exports:{}};var he,xe={exports:{}};function ge(){return he||(he=1,xe.exports=function(e){return function(a){var n=e,i=n.lib,t=i.WordArray,o=i.Hasher,r=n.x64.Word,s=n.algo,c=[],p=[],l=[];!function(){for(var e=1,a=0,n=0;n<24;n++){c[e+5*a]=(n+1)*(n+2)/2%64;var i=(2*e+3*a)%5;e=a%5,a=i}for(e=0;e<5;e++)for(a=0;a<5;a++)p[e+5*a]=a+(2*e+3*a)%5*5;for(var t=1,o=0;o<24;o++){for(var s=0,u=0,d=0;d<7;d++){if(1&t){var f=(1<<d)-1;f<32?u^=1<<f:s^=1<<f-32}128&t?t=t<<1^113:t<<=1}l[o]=r.create(s,u)}}();var u=[];!function(){for(var e=0;e<25;e++)u[e]=r.create()}();var d=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],a=0;a<25;a++)e[a]=new r.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,a){for(var n=this._state,i=this.blockSize/2,t=0;t<i;t++){var o=e[a+2*t],r=e[a+2*t+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),(C=n[t]).high^=r,C.low^=o}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var f=0,m=0,v=0;v<5;v++)f^=(C=n[d+5*v]).high,m^=C.low;var h=u[d];h.high=f,h.low=m}for(d=0;d<5;d++){var x=u[(d+4)%5],g=u[(d+1)%5],b=g.high,y=g.low;for(f=x.high^(b<<1|y>>>31),m=x.low^(y<<1|b>>>31),v=0;v<5;v++)(C=n[d+5*v]).high^=f,C.low^=m}for(var w=1;w<25;w++){var k=(C=n[w]).high,j=C.low,_=c[w];_<32?(f=k<<_|j>>>32-_,m=j<<_|k>>>32-_):(f=j<<_-32|k>>>64-_,m=k<<_-32|j>>>64-_);var S=u[p[w]];S.high=f,S.low=m}var E=u[0],A=n[0];for(E.high=A.high,E.low=A.low,d=0;d<5;d++)for(v=0;v<5;v++){var C=n[w=d+5*v],T=u[w],O=u[(d+1)%5+5*v],B=u[(d+2)%5+5*v];C.high=T.high^~O.high&B.high,C.low=T.low^~O.low&B.low}C=n[0];var P=l[s];C.high^=P.high,C.low^=P.low}},_doFinalize:function(){var e=this._data,n=e.words;this._nDataBytes;var i=8*e.sigBytes,o=32*this.blockSize;n[i>>>5]|=1<<24-i%32,n[(a.ceil((i+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var r=this._state,s=this.cfg.outputLength/8,c=s/8,p=[],l=0;l<c;l++){var u=r[l],d=u.high,f=u.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),p.push(f),p.push(d)}return new t.init(p,s)},clone:function(){for(var e=o.clone.call(this),a=e._state=this._state.slice(0),n=0;n<25;n++)a[n]=a[n].clone();return e}});n.SHA3=o._createHelper(d),n.HmacSHA3=o._createHmacHelper(d)}(Math),e.SHA3}(L(),M())),xe.exports}var be,ye={exports:{}};var we,ke={exports:{}};function je(){return we||(we=1,ke.exports=function(e){var a,n,i;n=(a=e).lib.Base,i=a.enc.Utf8,a.algo.HMAC=n.extend({init:function(e,a){e=this._hasher=new e.init,"string"==typeof a&&(a=i.parse(a));var n=e.blockSize,t=4*n;a.sigBytes>t&&(a=e.finalize(a)),a.clamp();for(var o=this._oKey=a.clone(),r=this._iKey=a.clone(),s=o.words,c=r.words,p=0;p<n;p++)s[p]^=1549556828,c[p]^=909522486;o.sigBytes=r.sigBytes=t,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var a=this._hasher,n=a.finalize(e);return a.reset(),a.finalize(this._oKey.clone().concat(n))}})}(L())),ke.exports}var _e,Se={exports:{}};var Ee,Ae={exports:{}};function Ce(){return Ee||(Ee=1,Ae.exports=function(e){return n=(a=e).lib,i=n.Base,t=n.WordArray,o=a.algo,r=o.MD5,s=o.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:r,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,a){for(var n,i=this.cfg,o=i.hasher.create(),r=t.create(),s=r.words,c=i.keySize,p=i.iterations;s.length<c;){n&&o.update(n),n=o.update(e).finalize(a),o.reset();for(var l=1;l<p;l++)n=o.finalize(n),o.reset();r.concat(n)}return r.sigBytes=4*c,r}}),a.EvpKDF=function(e,a,n){return s.create(n).compute(e,a)},e.EvpKDF;var a,n,i,t,o,r,s}(L(),oe(),je())),Ae.exports}var Te,Oe={exports:{}};function Be(){return Te||(Te=1,Oe.exports=function(e){e.lib.Cipher||function(a){var n=e,i=n.lib,t=i.Base,o=i.WordArray,r=i.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var c=s.Base64,p=n.algo.EvpKDF,l=i.Cipher=r.extend({cfg:t.extend(),createEncryptor:function(e,a){return this.create(this._ENC_XFORM_MODE,e,a)},createDecryptor:function(e,a){return this.create(this._DEC_XFORM_MODE,e,a)},init:function(e,a,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=a,this.reset()},reset:function(){r.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:x}return function(a){return{encrypt:function(n,i,t){return e(i).encrypt(a,n,i,t)},decrypt:function(n,i,t){return e(i).decrypt(a,n,i,t)}}}}()});i.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=n.mode={},d=i.BlockCipherMode=t.extend({createEncryptor:function(e,a){return this.Encryptor.create(e,a)},createDecryptor:function(e,a){return this.Decryptor.create(e,a)},init:function(e,a){this._cipher=e,this._iv=a}}),f=u.CBC=function(){var e=d.extend();function n(e,n,i){var t,o=this._iv;o?(t=o,this._iv=a):t=this._prevBlock;for(var r=0;r<i;r++)e[n+r]^=t[r]}return e.Encryptor=e.extend({processBlock:function(e,a){var i=this._cipher,t=i.blockSize;n.call(this,e,a,t),i.encryptBlock(e,a),this._prevBlock=e.slice(a,a+t)}}),e.Decryptor=e.extend({processBlock:function(e,a){var i=this._cipher,t=i.blockSize,o=e.slice(a,a+t);i.decryptBlock(e,a),n.call(this,e,a,t),this._prevBlock=o}}),e}(),m=(n.pad={}).Pkcs7={pad:function(e,a){for(var n=4*a,i=n-e.sigBytes%n,t=i<<24|i<<16|i<<8|i,r=[],s=0;s<i;s+=4)r.push(t);var c=o.create(r,i);e.concat(c)},unpad:function(e){var a=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=a}};i.BlockCipher=l.extend({cfg:l.cfg.extend({mode:f,padding:m}),reset:function(){var e;l.reset.call(this);var a=this.cfg,n=a.iv,i=a.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(i,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,a){this._mode.processBlock(e,a)},_doFinalize:function(){var e,a=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(a.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),a.unpad(e)),e},blockSize:4});var v=i.CipherParams=t.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),h=(n.format={}).OpenSSL={stringify:function(e){var a=e.ciphertext,n=e.salt;return(n?o.create([1398893684,1701076831]).concat(n).concat(a):a).toString(c)},parse:function(e){var a,n=c.parse(e),i=n.words;return 1398893684==i[0]&&1701076831==i[1]&&(a=o.create(i.slice(2,4)),i.splice(0,4),n.sigBytes-=16),v.create({ciphertext:n,salt:a})}},x=i.SerializableCipher=t.extend({cfg:t.extend({format:h}),encrypt:function(e,a,n,i){i=this.cfg.extend(i);var t=e.createEncryptor(n,i),o=t.finalize(a),r=t.cfg;return v.create({ciphertext:o,key:n,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,a,n,i){return i=this.cfg.extend(i),a=this._parse(a,i.format),e.createDecryptor(n,i).finalize(a.ciphertext)},_parse:function(e,a){return"string"==typeof e?a.parse(e,this):e}}),g=(n.kdf={}).OpenSSL={execute:function(e,a,n,i,t){if(i||(i=o.random(8)),t)r=p.create({keySize:a+n,hasher:t}).compute(e,i);else var r=p.create({keySize:a+n}).compute(e,i);var s=o.create(r.words.slice(a),4*n);return r.sigBytes=4*a,v.create({key:r,iv:s,salt:i})}},b=i.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:g}),encrypt:function(e,a,n,i){var t=(i=this.cfg.extend(i)).kdf.execute(n,e.keySize,e.ivSize,i.salt,i.hasher);i.iv=t.iv;var o=x.encrypt.call(this,e,a,t.key,i);return o.mixIn(t),o},decrypt:function(e,a,n,i){i=this.cfg.extend(i),a=this._parse(a,i.format);var t=i.kdf.execute(n,e.keySize,e.ivSize,a.salt,i.hasher);return i.iv=t.iv,x.decrypt.call(this,e,a,t.key,i)}})}()}(L(),Ce())),Oe.exports}var Pe,qe={exports:{}};function ze(){return Pe||(Pe=1,qe.exports=function(e){return e.mode.CFB=function(){var a=e.lib.BlockCipherMode.extend();function n(e,a,n,i){var t,o=this._iv;o?(t=o.slice(0),this._iv=void 0):t=this._prevBlock,i.encryptBlock(t,0);for(var r=0;r<n;r++)e[a+r]^=t[r]}return a.Encryptor=a.extend({processBlock:function(e,a){var i=this._cipher,t=i.blockSize;n.call(this,e,a,t,i),this._prevBlock=e.slice(a,a+t)}}),a.Decryptor=a.extend({processBlock:function(e,a){var i=this._cipher,t=i.blockSize,o=e.slice(a,a+t);n.call(this,e,a,t,i),this._prevBlock=o}}),a}(),e.mode.CFB}(L(),Be())),qe.exports}var Ie,Fe={exports:{}};function Re(){return Ie||(Ie=1,Fe.exports=function(e){return e.mode.CTR=(a=e.lib.BlockCipherMode.extend(),n=a.Encryptor=a.extend({processBlock:function(e,a){var n=this._cipher,i=n.blockSize,t=this._iv,o=this._counter;t&&(o=this._counter=t.slice(0),this._iv=void 0);var r=o.slice(0);n.encryptBlock(r,0),o[i-1]=o[i-1]+1|0;for(var s=0;s<i;s++)e[a+s]^=r[s]}}),a.Decryptor=n,a),e.mode.CTR;var a,n}(L(),Be())),Fe.exports}var Le,De={exports:{}};function Ne(){return Le||(Le=1,De.exports=function(e){
2
+ "use strict";var e=require("fs"),a=require("path"),n=require("os"),i=require("node:process"),t=require("node:buffer"),o=require("node:path"),r=require("node:url"),s=require("node:child_process"),c=require("node:fs/promises"),p=require("node:os"),l=require("node:fs"),u=require("node:util"),d=require("tty"),f=require("util"),m=require("net"),v=require("events"),h=require("stream"),x=require("zlib"),g=require("buffer"),b=require("string_decoder"),y=require("querystring"),w=require("url"),k=require("http"),j=require("crypto"),_=require("process"),S="undefined"!=typeof document?document.currentScript:null;function E(e){var a=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(a,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),a.default=e,Object.freeze(a)}var A=E(e),C="0.2.0";const T=a.join(n.homedir(),".mstate"),O=a.join(T,".mstate_credentials"),B="https://api.mstate.mobioffice.io/api";var P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z={exports:{}};function I(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var F,R={exports:{}};function L(){return F||(F=1,R.exports=function(){var e=e||function(e,a){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==P&&P.crypto&&(n=P.crypto),!n)try{n=require("crypto")}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},t=Object.create||function(){function e(){}return function(a){var n;return e.prototype=a,n=new e,e.prototype=null,n}}(),o={},r=o.lib={},s=r.Base={extend:function(e){var a=t(this);return e&&a.mixIn(e),a.hasOwnProperty("init")&&this.init!==a.init||(a.init=function(){a.$super.init.apply(this,arguments)}),a.init.prototype=a,a.$super=this,a},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var a in e)e.hasOwnProperty(a)&&(this[a]=e[a]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=r.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=a?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var a=this.words,n=e.words,i=this.sigBytes,t=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o<t;o++){var r=n[o>>>2]>>>24-o%4*8&255;a[i+o>>>2]|=r<<24-(i+o)%4*8}else for(var s=0;s<t;s+=4)a[i+s>>>2]=n[s>>>2];return this.sigBytes+=t,this},clamp:function(){var a=this.words,n=this.sigBytes;a[n>>>2]&=4294967295<<32-n%4*8,a.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var a=[],n=0;n<e;n+=4)a.push(i());return new c.init(a,e)}}),p=o.enc={},l=p.Hex={stringify:function(e){for(var a=e.words,n=e.sigBytes,i=[],t=0;t<n;t++){var o=a[t>>>2]>>>24-t%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var a=e.length,n=[],i=0;i<a;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new c.init(n,a/2)}},u=p.Latin1={stringify:function(e){for(var a=e.words,n=e.sigBytes,i=[],t=0;t<n;t++){var o=a[t>>>2]>>>24-t%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var a=e.length,n=[],i=0;i<a;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new c.init(n,a)}},d=p.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(a){var n,i=this._data,t=i.words,o=i.sigBytes,r=this.blockSize,s=o/(4*r),p=(s=a?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*r,l=e.min(4*p,o);if(p){for(var u=0;u<p;u+=r)this._doProcessBlock(t,u);n=t.splice(0,p),i.sigBytes-=l}return new c.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=f.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(a,n){return new e.init(n).finalize(a)}},_createHmacHelper:function(e){return function(a,n){return new m.HMAC.init(e,n).finalize(a)}}});var m=o.algo={};return o}(Math);return e}()),R.exports}var D,N={exports:{}};function M(){return D||(D=1,N.exports=function(e){return i=(n=e).lib,t=i.Base,o=i.WordArray,(r=n.x64={}).Word=t.extend({init:function(e,a){this.high=e,this.low=a}}),r.WordArray=t.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=a?n:8*e.length},toX32:function(){for(var e=this.words,a=e.length,n=[],i=0;i<a;i++){var t=e[i];n.push(t.high),n.push(t.low)}return o.create(n,this.sigBytes)},clone:function(){for(var e=t.clone.call(this),a=e.words=this.words.slice(0),n=a.length,i=0;i<n;i++)a[i]=a[i].clone();return e}}),e;var a,n,i,t,o,r}(L())),N.exports}var U,H={exports:{}};function $(){return U||(U=1,H.exports=function(e){return function(){if("function"==typeof ArrayBuffer){var a=e.lib.WordArray,n=a.init,i=a.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var a=e.byteLength,i=[],t=0;t<a;t++)i[t>>>2]|=e[t]<<24-t%4*8;n.call(this,i,a)}else n.apply(this,arguments)};i.prototype=a}}(),e.lib.WordArray}(L())),H.exports}var W,K={exports:{}};function G(){return W||(W=1,K.exports=function(e){return function(){var a=e,n=a.lib.WordArray,i=a.enc;function t(e){return e<<8&4278255360|e>>>8&16711935}i.Utf16=i.Utf16BE={stringify:function(e){for(var a=e.words,n=e.sigBytes,i=[],t=0;t<n;t+=2){var o=a[t>>>2]>>>16-t%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var a=e.length,i=[],t=0;t<a;t++)i[t>>>1]|=e.charCodeAt(t)<<16-t%2*16;return n.create(i,2*a)}},i.Utf16LE={stringify:function(e){for(var a=e.words,n=e.sigBytes,i=[],o=0;o<n;o+=2){var r=t(a[o>>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(r))}return i.join("")},parse:function(e){for(var a=e.length,i=[],o=0;o<a;o++)i[o>>>1]|=t(e.charCodeAt(o)<<16-o%2*16);return n.create(i,2*a)}}}(),e.enc.Utf16}(L())),K.exports}var V,Z={exports:{}};function J(){return V||(V=1,Z.exports=function(e){return function(){var a=e,n=a.lib.WordArray;function i(e,a,i){for(var t=[],o=0,r=0;r<a;r++)if(r%4){var s=i[e.charCodeAt(r-1)]<<r%4*2|i[e.charCodeAt(r)]>>>6-r%4*2;t[o>>>2]|=s<<24-o%4*8,o++}return n.create(t,o)}a.enc.Base64={stringify:function(e){var a=e.words,n=e.sigBytes,i=this._map;e.clamp();for(var t=[],o=0;o<n;o+=3)for(var r=(a[o>>>2]>>>24-o%4*8&255)<<16|(a[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|a[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)t.push(i.charAt(r>>>6*(3-s)&63));var c=i.charAt(64);if(c)for(;t.length%4;)t.push(c);return t.join("")},parse:function(e){var a=e.length,n=this._map,t=this._reverseMap;if(!t){t=this._reverseMap=[];for(var o=0;o<n.length;o++)t[n.charCodeAt(o)]=o}var r=n.charAt(64);if(r){var s=e.indexOf(r);-1!==s&&(a=s)}return i(e,a,t)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(L())),Z.exports}var X,Y={exports:{}};function Q(){return X||(X=1,Y.exports=function(e){return function(){var a=e,n=a.lib.WordArray;function i(e,a,i){for(var t=[],o=0,r=0;r<a;r++)if(r%4){var s=i[e.charCodeAt(r-1)]<<r%4*2|i[e.charCodeAt(r)]>>>6-r%4*2;t[o>>>2]|=s<<24-o%4*8,o++}return n.create(t,o)}a.enc.Base64url={stringify:function(e,a){void 0===a&&(a=!0);var n=e.words,i=e.sigBytes,t=a?this._safe_map:this._map;e.clamp();for(var o=[],r=0;r<i;r+=3)for(var s=(n[r>>>2]>>>24-r%4*8&255)<<16|(n[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|n[r+2>>>2]>>>24-(r+2)%4*8&255,c=0;c<4&&r+.75*c<i;c++)o.push(t.charAt(s>>>6*(3-c)&63));var p=t.charAt(64);if(p)for(;o.length%4;)o.push(p);return o.join("")},parse:function(e,a){void 0===a&&(a=!0);var n=e.length,t=a?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var r=0;r<t.length;r++)o[t.charCodeAt(r)]=r}var s=t.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(n=c)}return i(e,n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),e.enc.Base64url}(L())),Y.exports}var ee,ae={exports:{}};function ne(){return ee||(ee=1,ae.exports=function(e){return function(a){var n=e,i=n.lib,t=i.WordArray,o=i.Hasher,r=n.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*a.abs(a.sin(e+1))|0}();var c=r.MD5=o.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,a){for(var n=0;n<16;n++){var i=a+n,t=e[i];e[i]=16711935&(t<<8|t>>>24)|4278255360&(t<<24|t>>>8)}var o=this._hash.words,r=e[a+0],c=e[a+1],f=e[a+2],m=e[a+3],v=e[a+4],h=e[a+5],x=e[a+6],g=e[a+7],b=e[a+8],y=e[a+9],w=e[a+10],k=e[a+11],j=e[a+12],_=e[a+13],S=e[a+14],E=e[a+15],A=o[0],C=o[1],T=o[2],O=o[3];A=p(A,C,T,O,r,7,s[0]),O=p(O,A,C,T,c,12,s[1]),T=p(T,O,A,C,f,17,s[2]),C=p(C,T,O,A,m,22,s[3]),A=p(A,C,T,O,v,7,s[4]),O=p(O,A,C,T,h,12,s[5]),T=p(T,O,A,C,x,17,s[6]),C=p(C,T,O,A,g,22,s[7]),A=p(A,C,T,O,b,7,s[8]),O=p(O,A,C,T,y,12,s[9]),T=p(T,O,A,C,w,17,s[10]),C=p(C,T,O,A,k,22,s[11]),A=p(A,C,T,O,j,7,s[12]),O=p(O,A,C,T,_,12,s[13]),T=p(T,O,A,C,S,17,s[14]),A=l(A,C=p(C,T,O,A,E,22,s[15]),T,O,c,5,s[16]),O=l(O,A,C,T,x,9,s[17]),T=l(T,O,A,C,k,14,s[18]),C=l(C,T,O,A,r,20,s[19]),A=l(A,C,T,O,h,5,s[20]),O=l(O,A,C,T,w,9,s[21]),T=l(T,O,A,C,E,14,s[22]),C=l(C,T,O,A,v,20,s[23]),A=l(A,C,T,O,y,5,s[24]),O=l(O,A,C,T,S,9,s[25]),T=l(T,O,A,C,m,14,s[26]),C=l(C,T,O,A,b,20,s[27]),A=l(A,C,T,O,_,5,s[28]),O=l(O,A,C,T,f,9,s[29]),T=l(T,O,A,C,g,14,s[30]),A=u(A,C=l(C,T,O,A,j,20,s[31]),T,O,h,4,s[32]),O=u(O,A,C,T,b,11,s[33]),T=u(T,O,A,C,k,16,s[34]),C=u(C,T,O,A,S,23,s[35]),A=u(A,C,T,O,c,4,s[36]),O=u(O,A,C,T,v,11,s[37]),T=u(T,O,A,C,g,16,s[38]),C=u(C,T,O,A,w,23,s[39]),A=u(A,C,T,O,_,4,s[40]),O=u(O,A,C,T,r,11,s[41]),T=u(T,O,A,C,m,16,s[42]),C=u(C,T,O,A,x,23,s[43]),A=u(A,C,T,O,y,4,s[44]),O=u(O,A,C,T,j,11,s[45]),T=u(T,O,A,C,E,16,s[46]),A=d(A,C=u(C,T,O,A,f,23,s[47]),T,O,r,6,s[48]),O=d(O,A,C,T,g,10,s[49]),T=d(T,O,A,C,S,15,s[50]),C=d(C,T,O,A,h,21,s[51]),A=d(A,C,T,O,j,6,s[52]),O=d(O,A,C,T,m,10,s[53]),T=d(T,O,A,C,w,15,s[54]),C=d(C,T,O,A,c,21,s[55]),A=d(A,C,T,O,b,6,s[56]),O=d(O,A,C,T,E,10,s[57]),T=d(T,O,A,C,x,15,s[58]),C=d(C,T,O,A,_,21,s[59]),A=d(A,C,T,O,v,6,s[60]),O=d(O,A,C,T,k,10,s[61]),T=d(T,O,A,C,f,15,s[62]),C=d(C,T,O,A,y,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+C|0,o[2]=o[2]+T|0,o[3]=o[3]+O|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,t=8*e.sigBytes;n[t>>>5]|=128<<24-t%32;var o=a.floor(i/4294967296),r=i;n[15+(t+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(t+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,p=0;p<4;p++){var l=c[p];c[p]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,a,n,i,t,o,r){var s=e+(a&n|~a&i)+t+r;return(s<<o|s>>>32-o)+a}function l(e,a,n,i,t,o,r){var s=e+(a&i|n&~i)+t+r;return(s<<o|s>>>32-o)+a}function u(e,a,n,i,t,o,r){var s=e+(a^n^i)+t+r;return(s<<o|s>>>32-o)+a}function d(e,a,n,i,t,o,r){var s=e+(n^(a|~i))+t+r;return(s<<o|s>>>32-o)+a}n.MD5=o._createHelper(c),n.HmacMD5=o._createHmacHelper(c)}(Math),e.MD5}(L())),ae.exports}var ie,te={exports:{}};function oe(){return ie||(ie=1,te.exports=function(e){return n=(a=e).lib,i=n.WordArray,t=n.Hasher,o=a.algo,r=[],s=o.SHA1=t.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,a){for(var n=this._hash.words,i=n[0],t=n[1],o=n[2],s=n[3],c=n[4],p=0;p<80;p++){if(p<16)r[p]=0|e[a+p];else{var l=r[p-3]^r[p-8]^r[p-14]^r[p-16];r[p]=l<<1|l>>>31}var u=(i<<5|i>>>27)+c+r[p];u+=p<20?1518500249+(t&o|~t&s):p<40?1859775393+(t^o^s):p<60?(t&o|t&s|o&s)-1894007588:(t^o^s)-899497514,c=s,s=o,o=t<<30|t>>>2,t=i,i=u}n[0]=n[0]+i|0,n[1]=n[1]+t|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,a=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return a[i>>>5]|=128<<24-i%32,a[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),a[15+(i+64>>>9<<4)]=n,e.sigBytes=4*a.length,this._process(),this._hash},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e}}),a.SHA1=t._createHelper(s),a.HmacSHA1=t._createHmacHelper(s),e.SHA1;var a,n,i,t,o,r,s}(L())),te.exports}var re,se={exports:{}};function ce(){return re||(re=1,se.exports=function(e){return function(a){var n=e,i=n.lib,t=i.WordArray,o=i.Hasher,r=n.algo,s=[],c=[];!function(){function e(e){for(var n=a.sqrt(e),i=2;i<=n;i++)if(!(e%i))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var i=2,t=0;t<64;)e(i)&&(t<8&&(s[t]=n(a.pow(i,.5))),c[t]=n(a.pow(i,1/3)),t++),i++}();var p=[],l=r.SHA256=o.extend({_doReset:function(){this._hash=new t.init(s.slice(0))},_doProcessBlock:function(e,a){for(var n=this._hash.words,i=n[0],t=n[1],o=n[2],r=n[3],s=n[4],l=n[5],u=n[6],d=n[7],f=0;f<64;f++){if(f<16)p[f]=0|e[a+f];else{var m=p[f-15],v=(m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3,h=p[f-2],x=(h<<15|h>>>17)^(h<<13|h>>>19)^h>>>10;p[f]=v+p[f-7]+x+p[f-16]}var g=i&t^i&o^t&o,b=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),y=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&u)+c[f]+p[f];d=u,u=l,l=s,s=r+y|0,r=o,o=t,t=i,i=y+(b+g)|0}n[0]=n[0]+i|0,n[1]=n[1]+t|0,n[2]=n[2]+o|0,n[3]=n[3]+r|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+u|0,n[7]=n[7]+d|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,t=8*e.sigBytes;return n[t>>>5]|=128<<24-t%32,n[14+(t+64>>>9<<4)]=a.floor(i/4294967296),n[15+(t+64>>>9<<4)]=i,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=o._createHelper(l),n.HmacSHA256=o._createHmacHelper(l)}(Math),e.SHA256}(L())),se.exports}var pe,le={exports:{}};var ue,de={exports:{}};function fe(){return ue||(ue=1,de.exports=function(e){return function(){var a=e,n=a.lib.Hasher,i=a.x64,t=i.Word,o=i.WordArray,r=a.algo;function s(){return t.create.apply(t,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],p=[];!function(){for(var e=0;e<80;e++)p[e]=s()}();var l=r.SHA512=n.extend({_doReset:function(){this._hash=new o.init([new t.init(1779033703,4089235720),new t.init(3144134277,2227873595),new t.init(1013904242,4271175723),new t.init(2773480762,1595750129),new t.init(1359893119,2917565137),new t.init(2600822924,725511199),new t.init(528734635,4215389547),new t.init(1541459225,327033209)])},_doProcessBlock:function(e,a){for(var n=this._hash.words,i=n[0],t=n[1],o=n[2],r=n[3],s=n[4],l=n[5],u=n[6],d=n[7],f=i.high,m=i.low,v=t.high,h=t.low,x=o.high,g=o.low,b=r.high,y=r.low,w=s.high,k=s.low,j=l.high,_=l.low,S=u.high,E=u.low,A=d.high,C=d.low,T=f,O=m,B=v,P=h,q=x,z=g,I=b,F=y,R=w,L=k,D=j,N=_,M=S,U=E,H=A,$=C,W=0;W<80;W++){var K,G,V=p[W];if(W<16)G=V.high=0|e[a+2*W],K=V.low=0|e[a+2*W+1];else{var Z=p[W-15],J=Z.high,X=Z.low,Y=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),ee=p[W-2],ae=ee.high,ne=ee.low,ie=(ae>>>19|ne<<13)^(ae<<3|ne>>>29)^ae>>>6,te=(ne>>>19|ae<<13)^(ne<<3|ae>>>29)^(ne>>>6|ae<<26),oe=p[W-7],re=oe.high,se=oe.low,ce=p[W-16],pe=ce.high,le=ce.low;G=(G=(G=Y+re+((K=Q+se)>>>0<Q>>>0?1:0))+ie+((K+=te)>>>0<te>>>0?1:0))+pe+((K+=le)>>>0<le>>>0?1:0),V.high=G,V.low=K}var ue,de=R&D^~R&M,fe=L&N^~L&U,me=T&B^T&q^B&q,ve=O&P^O&z^P&z,he=(T>>>28|O<<4)^(T<<30|O>>>2)^(T<<25|O>>>7),xe=(O>>>28|T<<4)^(O<<30|T>>>2)^(O<<25|T>>>7),ge=(R>>>14|L<<18)^(R>>>18|L<<14)^(R<<23|L>>>9),be=(L>>>14|R<<18)^(L>>>18|R<<14)^(L<<23|R>>>9),ye=c[W],we=ye.high,ke=ye.low,je=H+ge+((ue=$+be)>>>0<$>>>0?1:0),_e=xe+ve;H=M,$=U,M=D,U=N,D=R,N=L,R=I+(je=(je=(je=je+de+((ue+=fe)>>>0<fe>>>0?1:0))+we+((ue+=ke)>>>0<ke>>>0?1:0))+G+((ue+=K)>>>0<K>>>0?1:0))+((L=F+ue|0)>>>0<F>>>0?1:0)|0,I=q,F=z,q=B,z=P,B=T,P=O,T=je+(he+me+(_e>>>0<xe>>>0?1:0))+((O=ue+_e|0)>>>0<ue>>>0?1:0)|0}m=i.low=m+O,i.high=f+T+(m>>>0<O>>>0?1:0),h=t.low=h+P,t.high=v+B+(h>>>0<P>>>0?1:0),g=o.low=g+z,o.high=x+q+(g>>>0<z>>>0?1:0),y=r.low=y+F,r.high=b+I+(y>>>0<F>>>0?1:0),k=s.low=k+L,s.high=w+R+(k>>>0<L>>>0?1:0),_=l.low=_+N,l.high=j+D+(_>>>0<N>>>0?1:0),E=u.low=E+U,u.high=S+M+(E>>>0<U>>>0?1:0),C=d.low=C+$,d.high=A+H+(C>>>0<$>>>0?1:0)},_doFinalize:function(){var e=this._data,a=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return a[i>>>5]|=128<<24-i%32,a[30+(i+128>>>10<<5)]=Math.floor(n/4294967296),a[31+(i+128>>>10<<5)]=n,e.sigBytes=4*a.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});a.SHA512=n._createHelper(l),a.HmacSHA512=n._createHmacHelper(l)}(),e.SHA512}(L(),M())),de.exports}var me,ve={exports:{}};var he,xe={exports:{}};function ge(){return he||(he=1,xe.exports=function(e){return function(a){var n=e,i=n.lib,t=i.WordArray,o=i.Hasher,r=n.x64.Word,s=n.algo,c=[],p=[],l=[];!function(){for(var e=1,a=0,n=0;n<24;n++){c[e+5*a]=(n+1)*(n+2)/2%64;var i=(2*e+3*a)%5;e=a%5,a=i}for(e=0;e<5;e++)for(a=0;a<5;a++)p[e+5*a]=a+(2*e+3*a)%5*5;for(var t=1,o=0;o<24;o++){for(var s=0,u=0,d=0;d<7;d++){if(1&t){var f=(1<<d)-1;f<32?u^=1<<f:s^=1<<f-32}128&t?t=t<<1^113:t<<=1}l[o]=r.create(s,u)}}();var u=[];!function(){for(var e=0;e<25;e++)u[e]=r.create()}();var d=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],a=0;a<25;a++)e[a]=new r.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,a){for(var n=this._state,i=this.blockSize/2,t=0;t<i;t++){var o=e[a+2*t],r=e[a+2*t+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),(C=n[t]).high^=r,C.low^=o}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var f=0,m=0,v=0;v<5;v++)f^=(C=n[d+5*v]).high,m^=C.low;var h=u[d];h.high=f,h.low=m}for(d=0;d<5;d++){var x=u[(d+4)%5],g=u[(d+1)%5],b=g.high,y=g.low;for(f=x.high^(b<<1|y>>>31),m=x.low^(y<<1|b>>>31),v=0;v<5;v++)(C=n[d+5*v]).high^=f,C.low^=m}for(var w=1;w<25;w++){var k=(C=n[w]).high,j=C.low,_=c[w];_<32?(f=k<<_|j>>>32-_,m=j<<_|k>>>32-_):(f=j<<_-32|k>>>64-_,m=k<<_-32|j>>>64-_);var S=u[p[w]];S.high=f,S.low=m}var E=u[0],A=n[0];for(E.high=A.high,E.low=A.low,d=0;d<5;d++)for(v=0;v<5;v++){var C=n[w=d+5*v],T=u[w],O=u[(d+1)%5+5*v],B=u[(d+2)%5+5*v];C.high=T.high^~O.high&B.high,C.low=T.low^~O.low&B.low}C=n[0];var P=l[s];C.high^=P.high,C.low^=P.low}},_doFinalize:function(){var e=this._data,n=e.words;this._nDataBytes;var i=8*e.sigBytes,o=32*this.blockSize;n[i>>>5]|=1<<24-i%32,n[(a.ceil((i+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var r=this._state,s=this.cfg.outputLength/8,c=s/8,p=[],l=0;l<c;l++){var u=r[l],d=u.high,f=u.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),p.push(f),p.push(d)}return new t.init(p,s)},clone:function(){for(var e=o.clone.call(this),a=e._state=this._state.slice(0),n=0;n<25;n++)a[n]=a[n].clone();return e}});n.SHA3=o._createHelper(d),n.HmacSHA3=o._createHmacHelper(d)}(Math),e.SHA3}(L(),M())),xe.exports}var be,ye={exports:{}};var we,ke={exports:{}};function je(){return we||(we=1,ke.exports=function(e){var a,n,i;n=(a=e).lib.Base,i=a.enc.Utf8,a.algo.HMAC=n.extend({init:function(e,a){e=this._hasher=new e.init,"string"==typeof a&&(a=i.parse(a));var n=e.blockSize,t=4*n;a.sigBytes>t&&(a=e.finalize(a)),a.clamp();for(var o=this._oKey=a.clone(),r=this._iKey=a.clone(),s=o.words,c=r.words,p=0;p<n;p++)s[p]^=1549556828,c[p]^=909522486;o.sigBytes=r.sigBytes=t,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var a=this._hasher,n=a.finalize(e);return a.reset(),a.finalize(this._oKey.clone().concat(n))}})}(L())),ke.exports}var _e,Se={exports:{}};var Ee,Ae={exports:{}};function Ce(){return Ee||(Ee=1,Ae.exports=function(e){return n=(a=e).lib,i=n.Base,t=n.WordArray,o=a.algo,r=o.MD5,s=o.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:r,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,a){for(var n,i=this.cfg,o=i.hasher.create(),r=t.create(),s=r.words,c=i.keySize,p=i.iterations;s.length<c;){n&&o.update(n),n=o.update(e).finalize(a),o.reset();for(var l=1;l<p;l++)n=o.finalize(n),o.reset();r.concat(n)}return r.sigBytes=4*c,r}}),a.EvpKDF=function(e,a,n){return s.create(n).compute(e,a)},e.EvpKDF;var a,n,i,t,o,r,s}(L(),oe(),je())),Ae.exports}var Te,Oe={exports:{}};function Be(){return Te||(Te=1,Oe.exports=function(e){e.lib.Cipher||function(a){var n=e,i=n.lib,t=i.Base,o=i.WordArray,r=i.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var c=s.Base64,p=n.algo.EvpKDF,l=i.Cipher=r.extend({cfg:t.extend(),createEncryptor:function(e,a){return this.create(this._ENC_XFORM_MODE,e,a)},createDecryptor:function(e,a){return this.create(this._DEC_XFORM_MODE,e,a)},init:function(e,a,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=a,this.reset()},reset:function(){r.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:x}return function(a){return{encrypt:function(n,i,t){return e(i).encrypt(a,n,i,t)},decrypt:function(n,i,t){return e(i).decrypt(a,n,i,t)}}}}()});i.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=n.mode={},d=i.BlockCipherMode=t.extend({createEncryptor:function(e,a){return this.Encryptor.create(e,a)},createDecryptor:function(e,a){return this.Decryptor.create(e,a)},init:function(e,a){this._cipher=e,this._iv=a}}),f=u.CBC=function(){var e=d.extend();function n(e,n,i){var t,o=this._iv;o?(t=o,this._iv=a):t=this._prevBlock;for(var r=0;r<i;r++)e[n+r]^=t[r]}return e.Encryptor=e.extend({processBlock:function(e,a){var i=this._cipher,t=i.blockSize;n.call(this,e,a,t),i.encryptBlock(e,a),this._prevBlock=e.slice(a,a+t)}}),e.Decryptor=e.extend({processBlock:function(e,a){var i=this._cipher,t=i.blockSize,o=e.slice(a,a+t);i.decryptBlock(e,a),n.call(this,e,a,t),this._prevBlock=o}}),e}(),m=(n.pad={}).Pkcs7={pad:function(e,a){for(var n=4*a,i=n-e.sigBytes%n,t=i<<24|i<<16|i<<8|i,r=[],s=0;s<i;s+=4)r.push(t);var c=o.create(r,i);e.concat(c)},unpad:function(e){var a=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=a}};i.BlockCipher=l.extend({cfg:l.cfg.extend({mode:f,padding:m}),reset:function(){var e;l.reset.call(this);var a=this.cfg,n=a.iv,i=a.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(i,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,a){this._mode.processBlock(e,a)},_doFinalize:function(){var e,a=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(a.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),a.unpad(e)),e},blockSize:4});var v=i.CipherParams=t.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),h=(n.format={}).OpenSSL={stringify:function(e){var a=e.ciphertext,n=e.salt;return(n?o.create([1398893684,1701076831]).concat(n).concat(a):a).toString(c)},parse:function(e){var a,n=c.parse(e),i=n.words;return 1398893684==i[0]&&1701076831==i[1]&&(a=o.create(i.slice(2,4)),i.splice(0,4),n.sigBytes-=16),v.create({ciphertext:n,salt:a})}},x=i.SerializableCipher=t.extend({cfg:t.extend({format:h}),encrypt:function(e,a,n,i){i=this.cfg.extend(i);var t=e.createEncryptor(n,i),o=t.finalize(a),r=t.cfg;return v.create({ciphertext:o,key:n,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,a,n,i){return i=this.cfg.extend(i),a=this._parse(a,i.format),e.createDecryptor(n,i).finalize(a.ciphertext)},_parse:function(e,a){return"string"==typeof e?a.parse(e,this):e}}),g=(n.kdf={}).OpenSSL={execute:function(e,a,n,i,t){if(i||(i=o.random(8)),t)r=p.create({keySize:a+n,hasher:t}).compute(e,i);else var r=p.create({keySize:a+n}).compute(e,i);var s=o.create(r.words.slice(a),4*n);return r.sigBytes=4*a,v.create({key:r,iv:s,salt:i})}},b=i.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:g}),encrypt:function(e,a,n,i){var t=(i=this.cfg.extend(i)).kdf.execute(n,e.keySize,e.ivSize,i.salt,i.hasher);i.iv=t.iv;var o=x.encrypt.call(this,e,a,t.key,i);return o.mixIn(t),o},decrypt:function(e,a,n,i){i=this.cfg.extend(i),a=this._parse(a,i.format);var t=i.kdf.execute(n,e.keySize,e.ivSize,a.salt,i.hasher);return i.iv=t.iv,x.decrypt.call(this,e,a,t.key,i)}})}()}(L(),Ce())),Oe.exports}var Pe,qe={exports:{}};function ze(){return Pe||(Pe=1,qe.exports=function(e){return e.mode.CFB=function(){var a=e.lib.BlockCipherMode.extend();function n(e,a,n,i){var t,o=this._iv;o?(t=o.slice(0),this._iv=void 0):t=this._prevBlock,i.encryptBlock(t,0);for(var r=0;r<n;r++)e[a+r]^=t[r]}return a.Encryptor=a.extend({processBlock:function(e,a){var i=this._cipher,t=i.blockSize;n.call(this,e,a,t,i),this._prevBlock=e.slice(a,a+t)}}),a.Decryptor=a.extend({processBlock:function(e,a){var i=this._cipher,t=i.blockSize,o=e.slice(a,a+t);n.call(this,e,a,t,i),this._prevBlock=o}}),a}(),e.mode.CFB}(L(),Be())),qe.exports}var Ie,Fe={exports:{}};function Re(){return Ie||(Ie=1,Fe.exports=function(e){return e.mode.CTR=(a=e.lib.BlockCipherMode.extend(),n=a.Encryptor=a.extend({processBlock:function(e,a){var n=this._cipher,i=n.blockSize,t=this._iv,o=this._counter;t&&(o=this._counter=t.slice(0),this._iv=void 0);var r=o.slice(0);n.encryptBlock(r,0),o[i-1]=o[i-1]+1|0;for(var s=0;s<i;s++)e[a+s]^=r[s]}}),a.Decryptor=n,a),e.mode.CTR;var a,n}(L(),Be())),Fe.exports}var Le,De={exports:{}};function Ne(){return Le||(Le=1,De.exports=function(e){
3
3
  /** @preserve
4
4
  * Counter block mode compatible with Dr Brian Gladman fileenc.c
5
5
  * derived from CryptoJS.mode.CTR
@@ -295,4 +295,4 @@ return function(){var a=e,n=a.lib,i=n.WordArray,t=n.Hasher,o=a.algo,r=i.create([
295
295
  * Copyright(c) 2013 Roman Shtylman
296
296
  * Copyright(c) 2014-2015 Douglas Christopher Wilson
297
297
  * MIT Licensed
298
- */var gc,bc,yc,wc=q(mc?fc:(mc=1,fc=xc())),kc={exports:{}};function jc(){if(bc)return gc;bc=1;var e=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return gc=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var a={},n=0;n<10;n++)a["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(a).map((function(e){return a[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(i,t){for(var o,r,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(i),c=1;c<arguments.length;c++){for(var p in o=Object(arguments[c]))a.call(o,p)&&(s[p]=o[p]);if(e){r=e(o);for(var l=0;l<r.length;l++)n.call(o,r[l])&&(s[r[l]]=o[r[l]])}}return s},gc}var _c,Sc=(yc||(yc=1,function(){var e=jc(),a=pc(),n={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function i(e){return"string"==typeof e||e instanceof String}function t(e,a){if(Array.isArray(a)){for(var n=0;n<a.length;++n)if(t(e,a[n]))return!0;return!1}return i(a)?e===a:a instanceof RegExp?a.test(e):!!a}function o(e,a){var n,o=a.headers.origin,r=[];return e.origin&&"*"!==e.origin?i(e.origin)?(r.push([{key:"Access-Control-Allow-Origin",value:e.origin}]),r.push([{key:"Vary",value:"Origin"}])):(n=t(o,e.origin),r.push([{key:"Access-Control-Allow-Origin",value:!!n&&o}]),r.push([{key:"Vary",value:"Origin"}])):r.push([{key:"Access-Control-Allow-Origin",value:"*"}]),r}function r(e){return!0===e.credentials?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function s(e){var a=e.exposedHeaders;return a?(a.join&&(a=a.join(",")),a&&a.length?{key:"Access-Control-Expose-Headers",value:a}:null):null}function c(e,n){for(var i=0,t=e.length;i<t;i++){var o=e[i];o&&(Array.isArray(o)?c(o,n):"Vary"===o.key&&o.value?a(n,o.value):o.value&&n.setHeader(o.key,o.value))}}kc.exports=function(a){var i=null;return i="function"==typeof a?a:function(e,n){n(null,a)},function(a,t,p){i(a,(function(i,l){if(i)p(i);else{var u=e({},n,l),d=null;u.origin&&"function"==typeof u.origin?d=u.origin:u.origin&&(d=function(e,a){a(null,u.origin)}),d?d(a.headers.origin,(function(e,n){e||!n?p(e):(u.origin=n,function(e,a,n,i){var t=[];"OPTIONS"===(a.method&&a.method.toUpperCase&&a.method.toUpperCase())?(t.push(o(e,a)),t.push(r(e)),t.push(function(e){var a=e.methods;return a.join&&(a=e.methods.join(",")),{key:"Access-Control-Allow-Methods",value:a}}(e)),t.push(function(e,a){var n=e.allowedHeaders||e.headers,i=[];return n?n.join&&(n=n.join(",")):(n=a.headers["access-control-request-headers"],i.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),n&&n.length&&i.push([{key:"Access-Control-Allow-Headers",value:n}]),i}(e,a)),t.push(function(e){var a=("number"==typeof e.maxAge||e.maxAge)&&e.maxAge.toString();return a&&a.length?{key:"Access-Control-Max-Age",value:a}:null}(e)),t.push(s(e)),c(t,n),e.preflightContinue?i():(n.statusCode=e.optionsSuccessStatus,n.setHeader("Content-Length","0"),n.end())):(t.push(o(e,a)),t.push(r(e)),t.push(s(e)),c(t,n),i())}(u,a,t,p))})):p()}}))}}}()),kc.exports),Ec=q(Sc);!function(e){e.PERMISSIONS="permissions=",e.SECRET_KEY="secret=",e.USER_ID="user="}(_c||(_c={}));const Ac=new class{constructor(){}async addToken(){const e=process.argv,a=wa(e,_c.PERMISSIONS).trim(),n=a.split(","),i=Ea(),t=wa(e,_c.USER_ID);if(!a.length)return void _a.changeAndThrow("Parameter permissions is required");if(!i)return void _a.changeAndThrow("Parameter secret is required");if(!t)return void _a.changeAndThrow("Parameter user is required");const o=`${B}/company/permission`,r=await fetch(o,{method:"POST",headers:{"secret-key":i,"Content-Type":"application/json"},body:JSON.stringify({user:t,permissions:n})}),s=await r.json();s?.errors?_a.changeAndThrow("Invalid Parameters for Company: ",...s?.errors):_a.success("Company updated successfully \n",s?.data)}async revokePermission(){const e=process.argv,a=wa(e,_c.PERMISSIONS).split(","),n=Ea(),i=wa(e,_c.USER_ID);if(!a.length)return void _a.changeAndThrow("Parameter permissions is required");if(!n)return void _a.changeAndThrow("Parameter secret is required");if(!i)return void _a.changeAndThrow("Parameter user is required");const t=`${B}/company/permission`,o=await fetch(t,{method:"DELETE",headers:{"secret-key":n,"Content-Type":"application/json"},body:JSON.stringify({user:i,permissions:a})}),r=await o.json();r?.errors?_a.changeAndThrow("Invalid Parameters for Company: ",...r?.errors):_a.success("Company updated successfully \n",r?.data)}async handleLogin(){let e=49152;const a=wc();a.use(Ec({origin:"*"})),async function(){console.log("Opening browser for authentication...");const n=e=>a.listen(e,(()=>{console.log(`Server is running on port ${e}`)})),i=n(e);i.on("error",(a=>{"EADDRINUSE"===a.code?(console.log(`Port ${e} is in use. Trying another port...`),n(++e)):console.error("Server error:",a)})),a.get("/cli/mstate/login",((e,a)=>{try{const{token:n}=e.query;n?(console.log("Authentication successful! Token received."),Sa(n),a.send("<h1>Login successful! You can close this window.</h1>")):(console.error("Authentication failed. No token received."),a.send("<h1>Authentication failed. Please try again.</h1>"))}catch(e){}finally{i.close()}}))}().then((async()=>{await((e,a)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return tn({...a,target:e})})(`https"//mstate.ai/oauth?redirect=${encodeURIComponent("cli/mstate/login")}&open=${e}&scope=profile`)})).catch((e=>{console.error("Error during login:",e.message),process.exit(1)}))}logToken(){_a.info("Token",Ea())}};const Cc=new class{logCommandInfo(){console.log('\n\nUsage: mstate [cmd] [parameter]="[value]"\n'),console.log("Commands:"),_a.info(Ba.ADD,"Add new workflow"),_a.info(Ba.CLONE,"Clone workflow with actions and environments"),_a.info(Ba.PUSH,"Update the changes one in cloned workflow"),_a.info(Ba.LINK,"Add workflow and allow user to view workflow in the mobioffice application"),_a.info(Ba.UNLINK,"Disallow user to view workflow in the mobioffice application"),_a.info([Ba.VERSION_FLAG,Ba.VERSION].toString(),"print mstate-cli version")}logActionInfo(e){if(e===Ba.ADD);else _a.error(`${e?"Invalid":"Missing"} script: ${e??""}`),console.log(`use 'mstate ${Ba.HELP_FLAG}, ${Ba.HELP}' for getting allowed action`)}},[Tc]=_.argv.slice(2);(async function(){switch(Tc){case Ba.VERSION:case Ba.VERSION_FLAG:console.log(`v${C}`);break;case Ba.LINK:case Ba.UNLINK:await qa.linkToMobioffice(Tc);break;case Ba.USER:Ac.logToken();break;case Ba.LOGIN:await Ac.handleLogin();break;case Ba.CLONE:await Oa.cloneWorkflow(),await Ca.cloneActions(),await Ia.cloneEnvironments();break;case Ba.ADD:await Oa.saveToDB();break;case Ba.PUSH:await Oa.updateWorkflowToDB(),await Ca.saveToDB(),await Ia.saveToDB(),await Oa.resetCache();break;case Ba.HELP:case Ba.HELP_FLAG:Cc.logCommandInfo();break;default:_a.error(`${Tc?"Invalid":"Missing"} script: ${Tc??""}`),console.log(`use 'mstate [command]? ${Ba.HELP_FLAG}, ${Ba.HELP}' for getting allowed action`)}})().then().catch((e=>{ka(_.argv,Ba.HELP)||ka(_.argv,Ba.HELP_FLAG)?Cc.logActionInfo(Tc):_a.error(e.message)})),console.log("");
298
+ */var gc,bc,yc,wc=q(mc?fc:(mc=1,fc=xc())),kc={exports:{}};function jc(){if(bc)return gc;bc=1;var e=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return gc=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var a={},n=0;n<10;n++)a["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(a).map((function(e){return a[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(i,t){for(var o,r,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(i),c=1;c<arguments.length;c++){for(var p in o=Object(arguments[c]))a.call(o,p)&&(s[p]=o[p]);if(e){r=e(o);for(var l=0;l<r.length;l++)n.call(o,r[l])&&(s[r[l]]=o[r[l]])}}return s},gc}var _c,Sc=(yc||(yc=1,function(){var e=jc(),a=pc(),n={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function i(e){return"string"==typeof e||e instanceof String}function t(e,a){if(Array.isArray(a)){for(var n=0;n<a.length;++n)if(t(e,a[n]))return!0;return!1}return i(a)?e===a:a instanceof RegExp?a.test(e):!!a}function o(e,a){var n,o=a.headers.origin,r=[];return e.origin&&"*"!==e.origin?i(e.origin)?(r.push([{key:"Access-Control-Allow-Origin",value:e.origin}]),r.push([{key:"Vary",value:"Origin"}])):(n=t(o,e.origin),r.push([{key:"Access-Control-Allow-Origin",value:!!n&&o}]),r.push([{key:"Vary",value:"Origin"}])):r.push([{key:"Access-Control-Allow-Origin",value:"*"}]),r}function r(e){return!0===e.credentials?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function s(e){var a=e.exposedHeaders;return a?(a.join&&(a=a.join(",")),a&&a.length?{key:"Access-Control-Expose-Headers",value:a}:null):null}function c(e,n){for(var i=0,t=e.length;i<t;i++){var o=e[i];o&&(Array.isArray(o)?c(o,n):"Vary"===o.key&&o.value?a(n,o.value):o.value&&n.setHeader(o.key,o.value))}}kc.exports=function(a){var i=null;return i="function"==typeof a?a:function(e,n){n(null,a)},function(a,t,p){i(a,(function(i,l){if(i)p(i);else{var u=e({},n,l),d=null;u.origin&&"function"==typeof u.origin?d=u.origin:u.origin&&(d=function(e,a){a(null,u.origin)}),d?d(a.headers.origin,(function(e,n){e||!n?p(e):(u.origin=n,function(e,a,n,i){var t=[];"OPTIONS"===(a.method&&a.method.toUpperCase&&a.method.toUpperCase())?(t.push(o(e,a)),t.push(r(e)),t.push(function(e){var a=e.methods;return a.join&&(a=e.methods.join(",")),{key:"Access-Control-Allow-Methods",value:a}}(e)),t.push(function(e,a){var n=e.allowedHeaders||e.headers,i=[];return n?n.join&&(n=n.join(",")):(n=a.headers["access-control-request-headers"],i.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),n&&n.length&&i.push([{key:"Access-Control-Allow-Headers",value:n}]),i}(e,a)),t.push(function(e){var a=("number"==typeof e.maxAge||e.maxAge)&&e.maxAge.toString();return a&&a.length?{key:"Access-Control-Max-Age",value:a}:null}(e)),t.push(s(e)),c(t,n),e.preflightContinue?i():(n.statusCode=e.optionsSuccessStatus,n.setHeader("Content-Length","0"),n.end())):(t.push(o(e,a)),t.push(r(e)),t.push(s(e)),c(t,n),i())}(u,a,t,p))})):p()}}))}}}()),kc.exports),Ec=q(Sc);!function(e){e.PERMISSIONS="permissions=",e.SECRET_KEY="secret=",e.USER_ID="user="}(_c||(_c={}));const Ac=new class{constructor(){}async addToken(){const e=process.argv,a=wa(e,_c.PERMISSIONS).trim(),n=a.split(","),i=Ea(),t=wa(e,_c.USER_ID);if(!a.length)return void _a.changeAndThrow("Parameter permissions is required");if(!i)return void _a.changeAndThrow("Parameter secret is required");if(!t)return void _a.changeAndThrow("Parameter user is required");const o=`${B}/company/permission`,r=await fetch(o,{method:"POST",headers:{"secret-key":i,"Content-Type":"application/json"},body:JSON.stringify({user:t,permissions:n})}),s=await r.json();s?.errors?_a.changeAndThrow("Invalid Parameters for Company: ",...s?.errors):_a.success("Company updated successfully \n",s?.data)}async revokePermission(){const e=process.argv,a=wa(e,_c.PERMISSIONS).split(","),n=Ea(),i=wa(e,_c.USER_ID);if(!a.length)return void _a.changeAndThrow("Parameter permissions is required");if(!n)return void _a.changeAndThrow("Parameter secret is required");if(!i)return void _a.changeAndThrow("Parameter user is required");const t=`${B}/company/permission`,o=await fetch(t,{method:"DELETE",headers:{"secret-key":n,"Content-Type":"application/json"},body:JSON.stringify({user:i,permissions:a})}),r=await o.json();r?.errors?_a.changeAndThrow("Invalid Parameters for Company: ",...r?.errors):_a.success("Company updated successfully \n",r?.data)}async handleLogin(){let e=49152;const a=wc();a.use(Ec({origin:"*"})),async function(){console.log("Opening browser for authentication...");const n=e=>a.listen(e,(()=>{console.log(`Server is running on port ${e}`)})),i=n(e);i.on("error",(a=>{"EADDRINUSE"===a.code?(console.log(`Port ${e} is in use. Trying another port...`),n(++e)):console.error("Server error:",a)})),a.get("/cli/mstate/login",((e,a)=>{try{const{token:n}=e.query;n?(console.log("Authentication successful! Token received."),Sa(n),a.send("<h1>Login successful! You can close this window.</h1>")):(console.error("Authentication failed. No token received."),a.send("<h1>Authentication failed. Please try again.</h1>"))}catch(e){}finally{i.close()}}))}().then((async()=>{await((e,a)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return tn({...a,target:e})})(`https://mstate.ai/oauth?redirect=${encodeURIComponent("cli/mstate/login")}&open=${e}&scope=profile`)})).catch((e=>{console.error("Error during login:",e.message),process.exit(1)}))}logToken(){_a.info("Token",Ea())}};const Cc=new class{logCommandInfo(){console.log('\n\nUsage: mstate [cmd] [parameter]="[value]"\n'),console.log("Commands:"),_a.info(Ba.ADD,"Add new workflow"),_a.info(Ba.CLONE,"Clone workflow with actions and environments"),_a.info(Ba.PUSH,"Update the changes one in cloned workflow"),_a.info(Ba.LINK,"Add workflow and allow user to view workflow in the mobioffice application"),_a.info(Ba.UNLINK,"Disallow user to view workflow in the mobioffice application"),_a.info([Ba.VERSION_FLAG,Ba.VERSION].toString(),"print mstate-cli version")}logActionInfo(e){if(e===Ba.ADD);else _a.error(`${e?"Invalid":"Missing"} script: ${e??""}`),console.log(`use 'mstate ${Ba.HELP_FLAG}, ${Ba.HELP}' for getting allowed action`)}},[Tc]=_.argv.slice(2);(async function(){switch(Tc){case Ba.VERSION:case Ba.VERSION_FLAG:console.log(`v${C}`);break;case Ba.LINK:case Ba.UNLINK:await qa.linkToMobioffice(Tc);break;case Ba.USER:Ac.logToken();break;case Ba.LOGIN:await Ac.handleLogin();break;case Ba.CLONE:await Oa.cloneWorkflow(),await Ca.cloneActions(),await Ia.cloneEnvironments();break;case Ba.ADD:await Oa.saveToDB();break;case Ba.PUSH:await Oa.updateWorkflowToDB(),await Ca.saveToDB(),await Ia.saveToDB(),await Oa.resetCache();break;case Ba.HELP:case Ba.HELP_FLAG:Cc.logCommandInfo();break;default:_a.error(`${Tc?"Invalid":"Missing"} script: ${Tc??""}`),console.log(`use 'mstate [command]? ${Ba.HELP_FLAG}, ${Ba.HELP}' for getting allowed action`)}})().then().catch((e=>{ka(_.argv,Ba.HELP)||ka(_.argv,Ba.HELP_FLAG)?Cc.logActionInfo(Tc):_a.error(e.message)})),console.log("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mstate-cli",
3
- "version": "0.1.9",
3
+ "version": "0.2.0",
4
4
  "main": "index.js",
5
5
  "bin": {
6
6
  "mstate": "./dist/index.js"
@@ -7,7 +7,7 @@ export const CRED_FILE_PATH = path.join(
7
7
  '.mstate_credentials',
8
8
  );
9
9
 
10
- export const MSTATE_DOMAIN: string = `https"//mstate.ai/`;
10
+ export const MSTATE_DOMAIN: string = `https://mstate.ai/`;
11
11
  // export const MSTATE_DOMAIN: string = `http://localhost:5173/`;
12
12
 
13
13
  // export const MSTATE_URL: string = 'https://dev.mstate.mobioffice.io/api';