slimsdk 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // package.json
8
- var version = "0.2.0";
8
+ var version = "0.2.1";
9
9
 
10
10
  // src/config/global.ts
11
11
  var info = () => `sdk ${version}`;
@@ -418,6 +418,7 @@ __export(lib_exports, {
418
418
  getAge: () => getAge,
419
419
  isToday: () => isToday,
420
420
  jwtParse: () => jwtParse,
421
+ md5Hash: () => md5Hash,
421
422
  numFormat: () => numFormat,
422
423
  setYear: () => setYear,
423
424
  shiftIndex: () => shiftIndex,
@@ -976,6 +977,198 @@ function ThaiBahtText(input) {
976
977
  }
977
978
  var thbText = ThaiBahtText;
978
979
 
980
+ // src/lib/md5.ts
981
+ function safeAdd(x, y) {
982
+ const lsw = (x & 65535) + (y & 65535);
983
+ const msw = (x >> 16) + (y >> 16) + (lsw >> 16);
984
+ return msw << 16 | lsw & 65535;
985
+ }
986
+ function bitRotateLeft(num, cnt) {
987
+ return num << cnt | num >>> 32 - cnt;
988
+ }
989
+ function md5cmn(q, a, b, x, s, t) {
990
+ return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
991
+ }
992
+ function md5ff(a, b, c, d, x, s, t) {
993
+ return md5cmn(b & c | ~b & d, a, b, x, s, t);
994
+ }
995
+ function md5gg(a, b, c, d, x, s, t) {
996
+ return md5cmn(b & d | c & ~d, a, b, x, s, t);
997
+ }
998
+ function md5hh(a, b, c, d, x, s, t) {
999
+ return md5cmn(b ^ c ^ d, a, b, x, s, t);
1000
+ }
1001
+ function md5ii(a, b, c, d, x, s, t) {
1002
+ return md5cmn(c ^ (b | ~d), a, b, x, s, t);
1003
+ }
1004
+ function binlMD5(x, len) {
1005
+ x[len >> 5] |= 128 << len % 32;
1006
+ x[(len + 64 >>> 9 << 4) + 14] = len;
1007
+ let i;
1008
+ let olda;
1009
+ let oldb;
1010
+ let oldc;
1011
+ let oldd;
1012
+ let a = 1732584193;
1013
+ let b = -271733879;
1014
+ let c = -1732584194;
1015
+ let d = 271733878;
1016
+ for (i = 0; i < x.length; i += 16) {
1017
+ olda = a;
1018
+ oldb = b;
1019
+ oldc = c;
1020
+ oldd = d;
1021
+ a = md5ff(a, b, c, d, x[i], 7, -680876936);
1022
+ d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
1023
+ c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
1024
+ b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
1025
+ a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
1026
+ d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
1027
+ c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
1028
+ b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
1029
+ a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
1030
+ d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
1031
+ c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
1032
+ b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
1033
+ a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
1034
+ d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
1035
+ c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
1036
+ b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
1037
+ a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
1038
+ d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
1039
+ c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
1040
+ b = md5gg(b, c, d, a, x[i], 20, -373897302);
1041
+ a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
1042
+ d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
1043
+ c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
1044
+ b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
1045
+ a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
1046
+ d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
1047
+ c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
1048
+ b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
1049
+ a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
1050
+ d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
1051
+ c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
1052
+ b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
1053
+ a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
1054
+ d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
1055
+ c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
1056
+ b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
1057
+ a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
1058
+ d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
1059
+ c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
1060
+ b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
1061
+ a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
1062
+ d = md5hh(d, a, b, c, x[i], 11, -358537222);
1063
+ c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
1064
+ b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
1065
+ a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
1066
+ d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
1067
+ c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
1068
+ b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
1069
+ a = md5ii(a, b, c, d, x[i], 6, -198630844);
1070
+ d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
1071
+ c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
1072
+ b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
1073
+ a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
1074
+ d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
1075
+ c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
1076
+ b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
1077
+ a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
1078
+ d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
1079
+ c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
1080
+ b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
1081
+ a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
1082
+ d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
1083
+ c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
1084
+ b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
1085
+ a = safeAdd(a, olda);
1086
+ b = safeAdd(b, oldb);
1087
+ c = safeAdd(c, oldc);
1088
+ d = safeAdd(d, oldd);
1089
+ }
1090
+ return [a, b, c, d];
1091
+ }
1092
+ function binl2rstr(input) {
1093
+ let i;
1094
+ let output = "";
1095
+ const length32 = input.length * 32;
1096
+ for (i = 0; i < length32; i += 8) {
1097
+ output += String.fromCharCode(input[i >> 5] >>> i % 32 & 255);
1098
+ }
1099
+ return output;
1100
+ }
1101
+ function rstr2binl(input) {
1102
+ let i;
1103
+ const output = [];
1104
+ output[(input.length >> 2) - 1] = void 0;
1105
+ for (i = 0; i < output.length; i += 1) {
1106
+ output[i] = 0;
1107
+ }
1108
+ const length8 = input.length * 8;
1109
+ for (i = 0; i < length8; i += 8) {
1110
+ output[i >> 5] |= (input.charCodeAt(i / 8) & 255) << i % 32;
1111
+ }
1112
+ return output;
1113
+ }
1114
+ function rstrMD5(s) {
1115
+ return binl2rstr(binlMD5(rstr2binl(s), s.length * 8));
1116
+ }
1117
+ function rstrHMACMD5(key, data) {
1118
+ let i;
1119
+ let bkey = rstr2binl(key);
1120
+ const ipad = [];
1121
+ const opad = [];
1122
+ ipad[15] = opad[15] = void 0;
1123
+ if (bkey.length > 16) {
1124
+ bkey = binlMD5(bkey, key.length * 8);
1125
+ }
1126
+ for (i = 0; i < 16; i += 1) {
1127
+ ipad[i] = bkey[i] ^ 909522486;
1128
+ opad[i] = bkey[i] ^ 1549556828;
1129
+ }
1130
+ const hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
1131
+ return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));
1132
+ }
1133
+ function rstr2hex(input) {
1134
+ const hexTab = "0123456789abcdef";
1135
+ let output = "";
1136
+ let x;
1137
+ let i;
1138
+ for (i = 0; i < input.length; i += 1) {
1139
+ x = input.charCodeAt(i);
1140
+ output += hexTab.charAt(x >>> 4 & 15) + hexTab.charAt(x & 15);
1141
+ }
1142
+ return output;
1143
+ }
1144
+ function str2rstrUTF8(input) {
1145
+ return decodeURIComponent(encodeURIComponent(input));
1146
+ }
1147
+ function rawMD5(s) {
1148
+ return rstrMD5(str2rstrUTF8(s));
1149
+ }
1150
+ function hexMD5(s) {
1151
+ return rstr2hex(rawMD5(s));
1152
+ }
1153
+ function rawHMACMD5(k, d) {
1154
+ return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d));
1155
+ }
1156
+ function hexHMACMD5(k, d) {
1157
+ return rstr2hex(rawHMACMD5(k, d));
1158
+ }
1159
+ function md5Hash(string, key, raw) {
1160
+ if (!key) {
1161
+ if (!raw) {
1162
+ return hexMD5(string);
1163
+ }
1164
+ return rawMD5(string);
1165
+ }
1166
+ if (!raw) {
1167
+ return hexHMACMD5(key, string);
1168
+ }
1169
+ return rawHMACMD5(key, string);
1170
+ }
1171
+
979
1172
  // src/mod/index.ts
980
1173
  var mod_exports = {};
981
1174
  __export(mod_exports, {
@@ -1819,6 +2012,56 @@ var tempLogout = (
1819
2012
  <!-- loader -->
1820
2013
  <div id="loader"></div>
1821
2014
  </div>
2015
+ <style>
2016
+ #app:has(#page-logout) {
2017
+ padding: 0;
2018
+ }
2019
+ #page-logout {
2020
+ width: 100%;
2021
+ height: 100%;
2022
+ position: fixed;
2023
+ display: flex;
2024
+ flex-direction: column;
2025
+ justify-content: center;
2026
+ align-items: center;
2027
+ background-position: center;
2028
+ background-repeat: no-repeat;
2029
+ background-size: cover;
2030
+ background-image: url('https://cdn.jsdelivr.net/npm/slimsdk/dist/assets/bg/bg-01.jpg');
2031
+ }
2032
+ #page-logout #content {
2033
+ display: none;
2034
+ text-align: center;
2035
+ animation: fadeIn 0.4s;
2036
+ }
2037
+ #page-logout #content .logo {
2038
+ margin: auto;
2039
+ width: 150px;
2040
+ height: 150px;
2041
+ margin-bottom: 20px;
2042
+ border-radius: 50%;
2043
+ background-color: rgba(255, 255, 255, 0.2);
2044
+ box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
2045
+ 0 6px 20px 0 rgba(0, 0, 0, 0.19);
2046
+ }
2047
+ #page-logout #content .logo img {
2048
+ width: 100%;
2049
+ height: 100%;
2050
+ border-radius: 50%;
2051
+ }
2052
+ #page-logout #content #btn-login {
2053
+ box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px,
2054
+ rgba(0, 0, 0, 0.23) 0px 3px 6px;
2055
+ }
2056
+ #page-logout #loader {
2057
+ width: 110px;
2058
+ height: 110px;
2059
+ border-radius: 50%;
2060
+ border: 11px solid #E5E7EB;
2061
+ border-color: #E5E7EB #06B6D4 #E5E7EB #06B6D4;
2062
+ animation: spin 2s linear infinite;
2063
+ }
2064
+ </style>
1822
2065
  `
1823
2066
  );
1824
2067