hsu-utils 0.0.55 → 0.0.56

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/hsu-utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * hsu-utils v0.0.55
3
+ * hsu-utils v0.0.56
4
4
  *
5
5
  * 常用前端工具集:深拷贝、类型判断、相等比较、文件下载、PDF 渲染、日期范围、控制台表格等
6
6
  *
@@ -105,7 +105,7 @@ eval("/**\n * @licstart The following is the entire license notice for the\n * J
105
105
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
106
106
 
107
107
  "use strict";
108
- eval("\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar __1 = __webpack_require__(/*! .. */ \"./tools/index.ts\");\nfunction countMap(arr) {\n var map = new Map();\n arr.forEach(function (item) {\n map.set(item, (map.get(item) || 0) + 1);\n });\n return map;\n}\nfunction array_is_includes(arr1, arr2) {\n var e_1, _a;\n if (arr1.length === 0 || arr2.length === 0) {\n return false;\n }\n var smallArr = arr1.length <= arr2.length ? arr1 : arr2;\n var largeArr = arr1.length > arr2.length ? arr1 : arr2;\n var smallArrMap = countMap(smallArr);\n var largeArrMap = countMap(largeArr);\n var _loop_1 = function (key, count) {\n var largekey = __spreadArray([], __read(largeArrMap.keys()), false).filter(function (item) { return __1.Equal.ValEqual(item, key); });\n if (!largekey.length || (largekey.length && largeArrMap.get(largekey[0]) !== count)) {\n return { value: false };\n }\n };\n try {\n for (var _b = __values(smallArrMap.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read(_c.value, 2), key = _d[0], count = _d[1];\n var state_1 = _loop_1(key, count);\n if (typeof state_1 === \"object\")\n return state_1.value;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return true;\n}\nexports[\"default\"] = array_is_includes;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/ArrayIsIncludes/index.ts?");
108
+ eval("\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar Equal_1 = __importDefault(__webpack_require__(/*! ../Equal */ \"./tools/Equal/index.ts\"));\nfunction countMap(arr) {\n var map = new Map();\n arr.forEach(function (item) {\n map.set(item, (map.get(item) || 0) + 1);\n });\n return map;\n}\nfunction array_is_includes(arr1, arr2) {\n var e_1, _a;\n if (arr1.length === 0 || arr2.length === 0) {\n return false;\n }\n var smallArr = arr1.length <= arr2.length ? arr1 : arr2;\n var largeArr = arr1.length > arr2.length ? arr1 : arr2;\n var smallArrMap = countMap(smallArr);\n var largeArrMap = countMap(largeArr);\n var _loop_1 = function (key, count) {\n var largekey = __spreadArray([], __read(largeArrMap.keys()), false).filter(function (item) { return Equal_1.default.ValEqual(item, key); });\n if (!largekey.length || (largekey.length && largeArrMap.get(largekey[0]) !== count)) {\n return { value: false };\n }\n };\n try {\n for (var _b = __values(smallArrMap.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {\n var _d = __read(_c.value, 2), key = _d[0], count = _d[1];\n var state_1 = _loop_1(key, count);\n if (typeof state_1 === \"object\")\n return state_1.value;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return true;\n}\nexports[\"default\"] = array_is_includes;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/ArrayIsIncludes/index.ts?");
109
109
 
110
110
  /***/ }),
111
111
 
@@ -135,10 +135,10 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
135
135
  /*!*********************************!*\
136
136
  !*** ./tools/DeepCopy/index.ts ***!
137
137
  \*********************************/
138
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
138
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
139
139
 
140
140
  "use strict";
141
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar __1 = __webpack_require__(/*! .. */ \"./tools/index.ts\");\nfunction deepCopy(data) {\n if ((0, __1.Typeof)(data) === 'date') {\n return new Date(data.toISOString());\n }\n if ((0, __1.Typeof)(data) === 'formdata') {\n var _data = data;\n var _formData_1 = new FormData();\n _data.forEach(function (value, key) {\n _formData_1.append(key, value);\n });\n return _formData_1;\n }\n if ((0, __1.Typeof)(data) === 'map') {\n var _data = data;\n var map_1 = new Map();\n _data.forEach(function (value, key) {\n map_1.set(key, value);\n });\n return map_1;\n }\n if ((0, __1.Typeof)(data) === 'set') {\n var _data = data;\n var set_1 = new Set();\n _data.forEach(function (value) {\n set_1.add(value);\n });\n return set_1;\n }\n if (Array.isArray(data)) {\n var newData = data.map(function (item) {\n if (typeof item === 'object') {\n return deepCopy(item);\n }\n else {\n return item;\n }\n });\n return newData;\n }\n else if (data && (0, __1.Typeof)(data) === 'object') {\n var _data_1 = data;\n var newData_1 = {};\n Object.keys(_data_1).forEach(function (key) {\n var _item = _data_1[key];\n if (typeof _item === 'object') {\n newData_1[key] = deepCopy(_item);\n }\n else {\n newData_1[key] = _item;\n }\n });\n return newData_1;\n }\n return data;\n}\nexports[\"default\"] = deepCopy;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/DeepCopy/index.ts?");
141
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar Typeof_1 = __importDefault(__webpack_require__(/*! ../Typeof */ \"./tools/Typeof/index.ts\"));\nfunction deepCopy(data) {\n if ((0, Typeof_1.default)(data) === 'date') {\n return new Date(data.toISOString());\n }\n if ((0, Typeof_1.default)(data) === 'formdata') {\n var _data = data;\n var _formData_1 = new FormData();\n _data.forEach(function (value, key) {\n _formData_1.append(key, value);\n });\n return _formData_1;\n }\n if ((0, Typeof_1.default)(data) === 'map') {\n var _data = data;\n var map_1 = new Map();\n _data.forEach(function (value, key) {\n map_1.set(key, value);\n });\n return map_1;\n }\n if ((0, Typeof_1.default)(data) === 'set') {\n var _data = data;\n var set_1 = new Set();\n _data.forEach(function (value) {\n set_1.add(value);\n });\n return set_1;\n }\n if (Array.isArray(data)) {\n var newData = data.map(function (item) {\n if (typeof item === 'object') {\n return deepCopy(item);\n }\n else {\n return item;\n }\n });\n return newData;\n }\n else if (data && (0, Typeof_1.default)(data) === 'object') {\n var _data_1 = data;\n var newData_1 = {};\n Object.keys(_data_1).forEach(function (key) {\n var _item = _data_1[key];\n if (typeof _item === 'object') {\n newData_1[key] = deepCopy(_item);\n }\n else {\n newData_1[key] = _item;\n }\n });\n return newData_1;\n }\n return data;\n}\nexports[\"default\"] = deepCopy;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/DeepCopy/index.ts?");
142
142
 
143
143
  /***/ }),
144
144
 
@@ -149,7 +149,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar
149
149
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
150
150
 
151
151
  "use strict";
152
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getFileNameFromHeader = void 0;\nvar __1 = __webpack_require__(/*! .. */ \"./tools/index.ts\");\nfunction getFileNameFromHeader(response) {\n var contentDisposition = null;\n if (response.headers && typeof response.headers.get === 'function') {\n contentDisposition = response.headers.get('Content-Disposition');\n }\n else if (response.headers && typeof response.headers === 'object') {\n var headers = response.headers;\n contentDisposition = headers['content-disposition'] || headers['Content-Disposition'] || null;\n }\n if (!contentDisposition) {\n return null;\n }\n var filenameStarMatch = contentDisposition.match(/filename\\*=UTF-8''([^;]+)/i);\n if (filenameStarMatch) {\n return decodeURIComponent(filenameStarMatch[1]);\n }\n var filenameMatch = contentDisposition.match(/filename=[\"']?([^;\"']+)[\"']?/i);\n if (filenameMatch) {\n return decodeURIComponent(filenameMatch[1]);\n }\n return null;\n}\nexports.getFileNameFromHeader = getFileNameFromHeader;\nfunction downloadFileByUrl(url, fileName, signal) {\n return __awaiter(this, void 0, void 0, function () {\n var response, finalFileName, arrayBuffer, error_1, downloadElement;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 3, , 4]);\n return [4, fetch(url, { signal: signal })];\n case 1:\n response = _a.sent();\n finalFileName = fileName;\n if (!finalFileName) {\n finalFileName = getFileNameFromHeader(response) || undefined;\n }\n return [4, response.arrayBuffer()];\n case 2:\n arrayBuffer = _a.sent();\n downloadFile(arrayBuffer, finalFileName);\n return [3, 4];\n case 3:\n error_1 = _a.sent();\n if ((error_1 === null || error_1 === void 0 ? void 0 : error_1.name) !== 'AbortError') {\n downloadElement = document.createElement('a');\n downloadElement.href = url;\n downloadElement.download = decodeURIComponent(fileName || '');\n downloadElement.target = '_blank';\n document.body.appendChild(downloadElement);\n downloadElement.click();\n document.body.removeChild(downloadElement);\n }\n return [3, 4];\n case 4: return [2];\n }\n });\n });\n}\nfunction downloadFile(file, fileName, signal) {\n return __awaiter(this, void 0, void 0, function () {\n var blob, downloadElement, href;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(typeof file === 'string')) return [3, 2];\n return [4, downloadFileByUrl(file, fileName, signal)];\n case 1:\n _a.sent();\n return [3, 3];\n case 2:\n blob = (0, __1.Typeof)(file) === 'blob' ? file : new Blob([file]);\n downloadElement = document.createElement('a');\n href = window.URL.createObjectURL(blob);\n downloadElement.href = href;\n downloadElement.download = decodeURIComponent(fileName || '');\n downloadElement.target = '_blank';\n document.body.appendChild(downloadElement);\n downloadElement.click();\n document.body.removeChild(downloadElement);\n window.URL.revokeObjectURL(href);\n _a.label = 3;\n case 3: return [2];\n }\n });\n });\n}\nexports[\"default\"] = downloadFile;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/DownloadFile/index.ts?");
152
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getFileNameFromHeader = void 0;\nvar Typeof_1 = __importDefault(__webpack_require__(/*! ../Typeof */ \"./tools/Typeof/index.ts\"));\nfunction getFileNameFromHeader(response) {\n var contentDisposition = null;\n if (response.headers && typeof response.headers.get === 'function') {\n contentDisposition = response.headers.get('Content-Disposition');\n }\n else if (response.headers && typeof response.headers === 'object') {\n var headers = response.headers;\n contentDisposition = headers['content-disposition'] || headers['Content-Disposition'] || null;\n }\n if (!contentDisposition) {\n return null;\n }\n var filenameStarMatch = contentDisposition.match(/filename\\*=UTF-8''([^;]+)/i);\n if (filenameStarMatch) {\n return decodeURIComponent(filenameStarMatch[1]);\n }\n var filenameMatch = contentDisposition.match(/filename=[\"']?([^;\"']+)[\"']?/i);\n if (filenameMatch) {\n return decodeURIComponent(filenameMatch[1]);\n }\n return null;\n}\nexports.getFileNameFromHeader = getFileNameFromHeader;\nfunction downloadFileByUrl(url, fileName, signal) {\n return __awaiter(this, void 0, void 0, function () {\n var response, finalFileName, arrayBuffer, error_1, downloadElement;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 3, , 4]);\n return [4, fetch(url, { signal: signal })];\n case 1:\n response = _a.sent();\n finalFileName = fileName;\n if (!finalFileName) {\n finalFileName = getFileNameFromHeader(response) || undefined;\n }\n return [4, response.arrayBuffer()];\n case 2:\n arrayBuffer = _a.sent();\n downloadFile(arrayBuffer, finalFileName);\n return [3, 4];\n case 3:\n error_1 = _a.sent();\n if ((error_1 === null || error_1 === void 0 ? void 0 : error_1.name) !== 'AbortError') {\n downloadElement = document.createElement('a');\n downloadElement.href = url;\n downloadElement.download = decodeURIComponent(fileName || '');\n downloadElement.target = '_blank';\n document.body.appendChild(downloadElement);\n downloadElement.click();\n document.body.removeChild(downloadElement);\n }\n return [3, 4];\n case 4: return [2];\n }\n });\n });\n}\nfunction downloadFile(file, fileName, signal) {\n return __awaiter(this, void 0, void 0, function () {\n var blob, downloadElement, href;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(typeof file === 'string')) return [3, 2];\n return [4, downloadFileByUrl(file, fileName, signal)];\n case 1:\n _a.sent();\n return [3, 3];\n case 2:\n blob = (0, Typeof_1.default)(file) === 'blob' ? file : new Blob([file]);\n downloadElement = document.createElement('a');\n href = window.URL.createObjectURL(blob);\n downloadElement.href = href;\n downloadElement.download = decodeURIComponent(fileName || '');\n downloadElement.target = '_blank';\n document.body.appendChild(downloadElement);\n downloadElement.click();\n document.body.removeChild(downloadElement);\n window.URL.revokeObjectURL(href);\n _a.label = 3;\n case 3: return [2];\n }\n });\n });\n}\nexports[\"default\"] = downloadFile;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/DownloadFile/index.ts?");
153
153
 
154
154
  /***/ }),
155
155
 
@@ -157,10 +157,10 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
157
157
  /*!******************************!*\
158
158
  !*** ./tools/Equal/index.ts ***!
159
159
  \******************************/
160
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
160
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
161
161
 
162
162
  "use strict";
163
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ObjEqual = exports.ValEqual = exports.TypeEqual = void 0;\nvar __1 = __webpack_require__(/*! .. */ \"./tools/index.ts\");\nfunction TypeEqual(obj1, obj2) {\n var isEqual = false;\n if ((0, __1.Typeof)(obj1) !== (0, __1.Typeof)(obj2)) {\n isEqual = false;\n }\n else {\n isEqual = true;\n }\n return isEqual;\n}\nexports.TypeEqual = TypeEqual;\nfunction ValEqual(obj1, obj2) {\n var isEqual = false;\n if ((obj1 === null && obj2 === undefined) || (obj1 === undefined && obj2 === null)) {\n isEqual = true;\n }\n else {\n if (typeof obj1 === 'object' && typeof obj2 === 'object') {\n isEqual = ObjEqual(obj1, obj2);\n }\n else if (typeof obj1 === 'function' && typeof obj2 === 'function') {\n isEqual = JSON.stringify(obj1) === JSON.stringify(obj2);\n }\n else {\n isEqual = obj1 === obj2;\n }\n }\n return isEqual;\n}\nexports.ValEqual = ValEqual;\nfunction ObjEqual(obj1, obj2) {\n var isEqual = false;\n var _obj1 = (0, __1.deepCopy)(obj1);\n var _obj2 = (0, __1.deepCopy)(obj2);\n if (_obj1 !== null && _obj2 !== null) {\n if (Array.isArray(_obj1) && Array.isArray(_obj2)) {\n _obj1.sort();\n _obj2.sort();\n if (_obj1.length !== _obj2.length) {\n isEqual = false;\n }\n else {\n isEqual = true;\n for (var i = 0; i < _obj1.length; i++) {\n isEqual = ValEqual(_obj1[i], _obj2[i]);\n if (!isEqual)\n break;\n }\n }\n }\n else if (typeof _obj1 === 'object' && typeof _obj2 === 'object') {\n if (Object.keys(_obj1).length !== Object.keys(_obj2).length) {\n isEqual = false;\n }\n else {\n isEqual = true;\n for (var key in _obj1) {\n isEqual = ValEqual(_obj1[key], _obj2[key]);\n if (!isEqual)\n break;\n }\n }\n }\n }\n else if (_obj1 === null && _obj2 === null) {\n isEqual = true;\n }\n return isEqual;\n}\nexports.ObjEqual = ObjEqual;\nvar Equal = {\n ValEqual: ValEqual,\n TypeEqual: TypeEqual,\n ObjEqual: ObjEqual\n};\nexports[\"default\"] = Equal;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/Equal/index.ts?");
163
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ObjEqual = exports.ValEqual = exports.TypeEqual = void 0;\nvar Typeof_1 = __importDefault(__webpack_require__(/*! ../Typeof */ \"./tools/Typeof/index.ts\"));\nvar DeepCopy_1 = __importDefault(__webpack_require__(/*! ../DeepCopy */ \"./tools/DeepCopy/index.ts\"));\nfunction TypeEqual(obj1, obj2) {\n var isEqual = false;\n if ((0, Typeof_1.default)(obj1) !== (0, Typeof_1.default)(obj2)) {\n isEqual = false;\n }\n else {\n isEqual = true;\n }\n return isEqual;\n}\nexports.TypeEqual = TypeEqual;\nfunction ValEqual(obj1, obj2) {\n var isEqual = false;\n if ((obj1 === null && obj2 === undefined) || (obj1 === undefined && obj2 === null)) {\n isEqual = true;\n }\n else {\n if (typeof obj1 === 'object' && typeof obj2 === 'object') {\n isEqual = ObjEqual(obj1, obj2);\n }\n else if (typeof obj1 === 'function' && typeof obj2 === 'function') {\n isEqual = JSON.stringify(obj1) === JSON.stringify(obj2);\n }\n else {\n isEqual = obj1 === obj2;\n }\n }\n return isEqual;\n}\nexports.ValEqual = ValEqual;\nfunction ObjEqual(obj1, obj2) {\n var isEqual = false;\n var _obj1 = (0, DeepCopy_1.default)(obj1);\n var _obj2 = (0, DeepCopy_1.default)(obj2);\n if (_obj1 !== null && _obj2 !== null) {\n if (Array.isArray(_obj1) && Array.isArray(_obj2)) {\n _obj1.sort();\n _obj2.sort();\n if (_obj1.length !== _obj2.length) {\n isEqual = false;\n }\n else {\n isEqual = true;\n for (var i = 0; i < _obj1.length; i++) {\n isEqual = ValEqual(_obj1[i], _obj2[i]);\n if (!isEqual)\n break;\n }\n }\n }\n else if (typeof _obj1 === 'object' && typeof _obj2 === 'object') {\n if (Object.keys(_obj1).length !== Object.keys(_obj2).length) {\n isEqual = false;\n }\n else {\n isEqual = true;\n for (var key in _obj1) {\n isEqual = ValEqual(_obj1[key], _obj2[key]);\n if (!isEqual)\n break;\n }\n }\n }\n }\n else if (_obj1 === null && _obj2 === null) {\n isEqual = true;\n }\n return isEqual;\n}\nexports.ObjEqual = ObjEqual;\nvar Equal = {\n ValEqual: ValEqual,\n TypeEqual: TypeEqual,\n ObjEqual: ObjEqual\n};\nexports[\"default\"] = Equal;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/Equal/index.ts?");
164
164
 
165
165
  /***/ }),
166
166
 
@@ -193,7 +193,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
193
193
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
194
194
 
195
195
  "use strict";
196
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.get_string_size_async = void 0;\nvar __1 = __webpack_require__(/*! .. */ \"./tools/index.ts\");\nfunction get_string_size_async(str, font) {\n if (font === void 0) { font = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, style, _b, weight, _c, size, _d, fontFamily, canvas, ctx, metrics, width, height;\n return __generator(this, function (_e) {\n switch (_e.label) {\n case 0:\n _a = font.style, style = _a === void 0 ? 'normal' : _a, _b = font.weight, weight = _b === void 0 ? 'normal' : _b, _c = font.size, size = _c === void 0 ? 10 : _c, _d = font.family, fontFamily = _d === void 0 ? 'sans-serif' : _d;\n canvas = document.createElement('canvas');\n ctx = canvas.getContext('2d');\n return [4, (0, __1.loadFont)({ ctx: ctx, font: font, text: str })];\n case 1:\n _e.sent();\n ctx.font = \"\".concat(style, \" \").concat(weight, \" \").concat(size, \"px \").concat(fontFamily);\n metrics = ctx.measureText(str);\n width = +(+metrics.width.toFixed(2)).toFixed(2);\n height = +(+metrics.actualBoundingBoxAscent.toFixed(2) + +metrics.actualBoundingBoxDescent.toFixed(2)).toFixed(2);\n return [2, { width: +width.toFixed(2), height: +height.toFixed(2) }];\n }\n });\n });\n}\nexports.get_string_size_async = get_string_size_async;\nfunction get_string_size(str, font) {\n if (font === void 0) { font = {}; }\n var _a = font.style, style = _a === void 0 ? 'normal' : _a, _b = font.weight, weight = _b === void 0 ? 'normal' : _b, _c = font.size, size = _c === void 0 ? 10 : _c, _d = font.family, fontFamily = _d === void 0 ? 'sans-serif' : _d;\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n ctx.font = \"\".concat(style, \" \").concat(weight, \" \").concat(size, \"px \").concat(fontFamily);\n var metrics = ctx.measureText(str);\n var width = +(+metrics.width.toFixed(2)).toFixed(2);\n var height = +(+metrics.actualBoundingBoxAscent.toFixed(2) + +metrics.actualBoundingBoxDescent.toFixed(2)).toFixed(2);\n return { width: +width.toFixed(2), height: +height.toFixed(2) };\n}\nexports[\"default\"] = get_string_size;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/GetStrSize/index.ts?");
196
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.get_string_size_async = void 0;\nvar LoadFont_1 = __importDefault(__webpack_require__(/*! ../LoadFont */ \"./tools/LoadFont/index.ts\"));\nfunction get_string_size_async(str, font) {\n if (font === void 0) { font = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, style, _b, weight, _c, size, _d, fontFamily, canvas, ctx, metrics, width, height;\n return __generator(this, function (_e) {\n switch (_e.label) {\n case 0:\n _a = font.style, style = _a === void 0 ? 'normal' : _a, _b = font.weight, weight = _b === void 0 ? 'normal' : _b, _c = font.size, size = _c === void 0 ? 10 : _c, _d = font.family, fontFamily = _d === void 0 ? 'sans-serif' : _d;\n canvas = document.createElement('canvas');\n ctx = canvas.getContext('2d');\n return [4, (0, LoadFont_1.default)({ ctx: ctx, font: font, text: str })];\n case 1:\n _e.sent();\n ctx.font = \"\".concat(style, \" \").concat(weight, \" \").concat(size, \"px \").concat(fontFamily);\n metrics = ctx.measureText(str);\n width = +(+metrics.width.toFixed(2)).toFixed(2);\n height = +(+metrics.actualBoundingBoxAscent.toFixed(2) + +metrics.actualBoundingBoxDescent.toFixed(2)).toFixed(2);\n return [2, { width: +width.toFixed(2), height: +height.toFixed(2) }];\n }\n });\n });\n}\nexports.get_string_size_async = get_string_size_async;\nfunction get_string_size(str, font) {\n if (font === void 0) { font = {}; }\n var _a = font.style, style = _a === void 0 ? 'normal' : _a, _b = font.weight, weight = _b === void 0 ? 'normal' : _b, _c = font.size, size = _c === void 0 ? 10 : _c, _d = font.family, fontFamily = _d === void 0 ? 'sans-serif' : _d;\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n ctx.font = \"\".concat(style, \" \").concat(weight, \" \").concat(size, \"px \").concat(fontFamily);\n var metrics = ctx.measureText(str);\n var width = +(+metrics.width.toFixed(2)).toFixed(2);\n var height = +(+metrics.actualBoundingBoxAscent.toFixed(2) + +metrics.actualBoundingBoxDescent.toFixed(2)).toFixed(2);\n return { width: +width.toFixed(2), height: +height.toFixed(2) };\n}\nexports[\"default\"] = get_string_size;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/GetStrSize/index.ts?");
197
197
 
198
198
  /***/ }),
199
199
 
@@ -237,7 +237,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
237
237
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
238
238
 
239
239
  "use strict";
240
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar pdf_js_1 = __webpack_require__(/*! pdfjs-dist/legacy/build/pdf.js */ \"./node_modules/pdfjs-dist/legacy/build/pdf.js\");\npdf_js_1.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.13.216/pdf.worker.min.js';\nvar PDFMap = new Map();\nfunction load(pdfUrl, workerSrc) {\n return __awaiter(this, void 0, void 0, function () {\n var pdf, loadingTask;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (workerSrc) {\n pdf_js_1.GlobalWorkerOptions.workerSrc = workerSrc;\n }\n pdf = PDFMap.get(pdfUrl);\n if (!pdf) {\n loadingTask = (0, pdf_js_1.getDocument)({\n url: pdfUrl,\n cMapUrl: 'https://unpkg.com/browse/pdfjs-dist@2.13.216/cmaps/',\n cMapPacked: true\n });\n pdf = loadingTask.promise;\n PDFMap.set(pdfUrl, pdf);\n }\n return [4, pdf];\n case 1: return [2, _a.sent()];\n }\n });\n });\n}\nfunction getNumPages(pdfUrl, workerSrc) {\n return __awaiter(this, void 0, void 0, function () {\n var pdf;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4, load(pdfUrl, workerSrc)];\n case 1:\n pdf = _a.sent();\n return [2, pdf.numPages];\n }\n });\n });\n}\nfunction clear(containerId) {\n var container = document.getElementById(containerId);\n var pages = document.querySelectorAll(\"[id^=\\\"\".concat(containerId, \"-page-\\\"]\"));\n pages === null || pages === void 0 ? void 0 : pages.forEach(function (item) {\n container === null || container === void 0 ? void 0 : container.removeChild(item);\n });\n}\nfunction render(_a) {\n var pdfUrl = _a.pdfUrl, containerId = _a.containerId, startPageNum = _a.startPageNum, endPageNum = _a.endPageNum, pixelRatio = _a.pixelRatio, scale = _a.scale, workerSrc = _a.workerSrc;\n return __awaiter(this, void 0, void 0, function () {\n var container, pdf, start, end, i;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n clear(containerId);\n container = document.getElementById(containerId);\n if (!container)\n return [2];\n return [4, load(pdfUrl, workerSrc)];\n case 1:\n pdf = _b.sent();\n start = startPageNum !== null && startPageNum !== void 0 ? startPageNum : 1;\n end = endPageNum !== null && endPageNum !== void 0 ? endPageNum : pdf.numPages;\n for (i = start; i <= end; i++) {\n renderPage({ pdf: pdf, container: container, num: i, pixelRatio: pixelRatio, scale: scale });\n }\n return [2];\n }\n });\n });\n}\nfunction renderPage(_a) {\n var pdf = _a.pdf, container = _a.container, num = _a.num, _b = _a.pixelRatio, pixelRatio = _b === void 0 ? 2 : _b, _c = _a.scale, scale = _c === void 0 ? 1 : _c;\n pdf.getPage(num).then(function (page) {\n var pageDiv = document.createElement('div');\n pageDiv.setAttribute('id', \"\".concat(container.id, \"-page-\").concat(num));\n pageDiv.setAttribute('style', 'position: relative; ');\n container.appendChild(pageDiv);\n var canvas = document.createElement('canvas');\n pageDiv.appendChild(canvas);\n var ctx = canvas.getContext('2d');\n var devicePixelRatio = window.devicePixelRatio * pixelRatio;\n var viewport = page.getViewport({ scale: 1 * devicePixelRatio });\n canvas.style.width = \"calc(100% * \".concat(scale, \")\");\n canvas.style.height = '100%';\n canvas.width = viewport.width;\n canvas.height = viewport.height;\n var renderContext = {\n canvasContext: ctx,\n viewport: viewport\n };\n page.render(renderContext);\n });\n}\nvar RenderPDF = {\n load: load,\n getNumPages: getNumPages,\n clear: clear,\n render: render\n};\nexports[\"default\"] = RenderPDF;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/RenderPDF/index.ts?");
240
+ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar DEFAULT_WORKER_SRC = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.13.216/pdf.worker.min.js';\nvar pdfjsPromise;\nvar preferredWorkerSrc;\nfunction loadPdfjs() {\n if (!pdfjsPromise) {\n pdfjsPromise = Promise.resolve().then(function () { return __importStar(__webpack_require__(/*! pdfjs-dist/legacy/build/pdf.js */ \"./node_modules/pdfjs-dist/legacy/build/pdf.js\")); }).then(function (mod) {\n var _a;\n var m = mod;\n var pdfjs = (_a = m.default) !== null && _a !== void 0 ? _a : m;\n pdfjs.GlobalWorkerOptions.workerSrc = preferredWorkerSrc !== null && preferredWorkerSrc !== void 0 ? preferredWorkerSrc : DEFAULT_WORKER_SRC;\n return pdfjs;\n })\n .catch(function (err) {\n pdfjsPromise = undefined;\n throw err;\n });\n }\n return pdfjsPromise;\n}\nvar PDFMap = new Map();\nfunction load(pdfUrl, workerSrc) {\n return __awaiter(this, void 0, void 0, function () {\n var pdfjs, pdf, loadingTask;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (workerSrc) {\n preferredWorkerSrc = workerSrc;\n }\n return [4, loadPdfjs()];\n case 1:\n pdfjs = _a.sent();\n if (workerSrc) {\n pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;\n }\n pdf = PDFMap.get(pdfUrl);\n if (!pdf) {\n loadingTask = pdfjs.getDocument({\n url: pdfUrl,\n cMapUrl: 'https://unpkg.com/browse/pdfjs-dist@2.13.216/cmaps/',\n cMapPacked: true\n });\n pdf = loadingTask.promise;\n PDFMap.set(pdfUrl, pdf);\n }\n return [4, pdf];\n case 2: return [2, _a.sent()];\n }\n });\n });\n}\nfunction getNumPages(pdfUrl, workerSrc) {\n return __awaiter(this, void 0, void 0, function () {\n var pdf;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4, load(pdfUrl, workerSrc)];\n case 1:\n pdf = _a.sent();\n return [2, pdf.numPages];\n }\n });\n });\n}\nfunction clear(containerId) {\n var container = document.getElementById(containerId);\n var pages = document.querySelectorAll(\"[id^=\\\"\".concat(containerId, \"-page-\\\"]\"));\n pages === null || pages === void 0 ? void 0 : pages.forEach(function (item) {\n container === null || container === void 0 ? void 0 : container.removeChild(item);\n });\n}\nfunction render(_a) {\n var pdfUrl = _a.pdfUrl, containerId = _a.containerId, startPageNum = _a.startPageNum, endPageNum = _a.endPageNum, pixelRatio = _a.pixelRatio, scale = _a.scale, workerSrc = _a.workerSrc;\n return __awaiter(this, void 0, void 0, function () {\n var container, pdf, start, end, i;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n clear(containerId);\n container = document.getElementById(containerId);\n if (!container)\n return [2];\n return [4, load(pdfUrl, workerSrc)];\n case 1:\n pdf = _b.sent();\n start = startPageNum !== null && startPageNum !== void 0 ? startPageNum : 1;\n end = endPageNum !== null && endPageNum !== void 0 ? endPageNum : pdf.numPages;\n for (i = start; i <= end; i++) {\n renderPage({ pdf: pdf, container: container, num: i, pixelRatio: pixelRatio, scale: scale });\n }\n return [2];\n }\n });\n });\n}\nfunction renderPage(_a) {\n var pdf = _a.pdf, container = _a.container, num = _a.num, _b = _a.pixelRatio, pixelRatio = _b === void 0 ? 2 : _b, _c = _a.scale, scale = _c === void 0 ? 1 : _c;\n pdf.getPage(num).then(function (page) {\n var pageDiv = document.createElement('div');\n pageDiv.setAttribute('id', \"\".concat(container.id, \"-page-\").concat(num));\n pageDiv.setAttribute('style', 'position: relative; ');\n container.appendChild(pageDiv);\n var canvas = document.createElement('canvas');\n pageDiv.appendChild(canvas);\n var ctx = canvas.getContext('2d');\n var devicePixelRatio = window.devicePixelRatio * pixelRatio;\n var viewport = page.getViewport({ scale: 1 * devicePixelRatio });\n canvas.style.width = \"calc(100% * \".concat(scale, \")\");\n canvas.style.height = '100%';\n canvas.width = viewport.width;\n canvas.height = viewport.height;\n var renderContext = {\n canvasContext: ctx,\n viewport: viewport\n };\n page.render(renderContext);\n });\n}\nvar RenderPDF = {\n load: load,\n getNumPages: getNumPages,\n clear: clear,\n render: render\n};\nexports[\"default\"] = RenderPDF;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/RenderPDF/index.ts?");
241
241
 
242
242
  /***/ }),
243
243
 
@@ -259,7 +259,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunc
259
259
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
260
260
 
261
261
  "use strict";
262
- eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getDateRange = exports.getTimeDifference = exports.generateRandomStr = exports.array_is_includes = exports.downloadFile = exports.RenderPDF = exports.loadImage = exports.ConvertNumbers = exports.loadFont = exports.get_string_size_async = exports.get_string_size = exports.Typeof = exports.Equal = exports.deepCopy = exports.console_table = void 0;\nvar ConsoleTable_1 = __importDefault(__webpack_require__(/*! ./ConsoleTable */ \"./tools/ConsoleTable/index.ts\"));\nexports.console_table = ConsoleTable_1.default;\nvar DeepCopy_1 = __importDefault(__webpack_require__(/*! ./DeepCopy */ \"./tools/DeepCopy/index.ts\"));\nexports.deepCopy = DeepCopy_1.default;\nvar Equal_1 = __importDefault(__webpack_require__(/*! ./Equal */ \"./tools/Equal/index.ts\"));\nexports.Equal = Equal_1.default;\nvar Typeof_1 = __importDefault(__webpack_require__(/*! ./Typeof */ \"./tools/Typeof/index.ts\"));\nexports.Typeof = Typeof_1.default;\nvar GetStrSize_1 = __importStar(__webpack_require__(/*! ./GetStrSize */ \"./tools/GetStrSize/index.ts\"));\nexports.get_string_size = GetStrSize_1.default;\nObject.defineProperty(exports, \"get_string_size_async\", ({ enumerable: true, get: function () { return GetStrSize_1.get_string_size_async; } }));\nvar ConvertNumbers_1 = __importDefault(__webpack_require__(/*! ./ConvertNumbers */ \"./tools/ConvertNumbers/index.ts\"));\nexports.ConvertNumbers = ConvertNumbers_1.default;\nvar LoadImage_1 = __importDefault(__webpack_require__(/*! ./LoadImage */ \"./tools/LoadImage/index.ts\"));\nexports.loadImage = LoadImage_1.default;\nvar RenderPDF_1 = __importDefault(__webpack_require__(/*! ./RenderPDF */ \"./tools/RenderPDF/index.ts\"));\nexports.RenderPDF = RenderPDF_1.default;\nvar DownloadFile_1 = __importDefault(__webpack_require__(/*! ./DownloadFile */ \"./tools/DownloadFile/index.ts\"));\nexports.downloadFile = DownloadFile_1.default;\nvar ArrayIsIncludes_1 = __importDefault(__webpack_require__(/*! ./ArrayIsIncludes */ \"./tools/ArrayIsIncludes/index.ts\"));\nexports.array_is_includes = ArrayIsIncludes_1.default;\nvar GenerateRandomStr_1 = __importDefault(__webpack_require__(/*! ./GenerateRandomStr */ \"./tools/GenerateRandomStr/index.ts\"));\nexports.generateRandomStr = GenerateRandomStr_1.default;\nvar GetTimeDifference_1 = __importDefault(__webpack_require__(/*! ./GetTimeDifference */ \"./tools/GetTimeDifference/index.ts\"));\nexports.getTimeDifference = GetTimeDifference_1.default;\nvar LoadFont_1 = __importDefault(__webpack_require__(/*! ./LoadFont */ \"./tools/LoadFont/index.ts\"));\nexports.loadFont = LoadFont_1.default;\nvar GetDateRange_1 = __importDefault(__webpack_require__(/*! ./GetDateRange */ \"./tools/GetDateRange/index.ts\"));\nexports.getDateRange = GetDateRange_1.default;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/index.ts?");
262
+ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getDateRange = exports.getTimeDifference = exports.generateRandomStr = exports.array_is_includes = exports.getFileNameFromHeader = exports.downloadFile = exports.RenderPDF = exports.loadImage = exports.ConvertNumbers = exports.loadFont = exports.get_string_size_async = exports.get_string_size = exports.Typeof = exports.Equal = exports.deepCopy = exports.console_table = void 0;\nvar ConsoleTable_1 = __importDefault(__webpack_require__(/*! ./ConsoleTable */ \"./tools/ConsoleTable/index.ts\"));\nexports.console_table = ConsoleTable_1.default;\nvar DeepCopy_1 = __importDefault(__webpack_require__(/*! ./DeepCopy */ \"./tools/DeepCopy/index.ts\"));\nexports.deepCopy = DeepCopy_1.default;\nvar Equal_1 = __importDefault(__webpack_require__(/*! ./Equal */ \"./tools/Equal/index.ts\"));\nexports.Equal = Equal_1.default;\nvar Typeof_1 = __importDefault(__webpack_require__(/*! ./Typeof */ \"./tools/Typeof/index.ts\"));\nexports.Typeof = Typeof_1.default;\nvar GetStrSize_1 = __importStar(__webpack_require__(/*! ./GetStrSize */ \"./tools/GetStrSize/index.ts\"));\nexports.get_string_size = GetStrSize_1.default;\nObject.defineProperty(exports, \"get_string_size_async\", ({ enumerable: true, get: function () { return GetStrSize_1.get_string_size_async; } }));\nvar ConvertNumbers_1 = __importDefault(__webpack_require__(/*! ./ConvertNumbers */ \"./tools/ConvertNumbers/index.ts\"));\nexports.ConvertNumbers = ConvertNumbers_1.default;\nvar LoadImage_1 = __importDefault(__webpack_require__(/*! ./LoadImage */ \"./tools/LoadImage/index.ts\"));\nexports.loadImage = LoadImage_1.default;\nvar RenderPDF_1 = __importDefault(__webpack_require__(/*! ./RenderPDF */ \"./tools/RenderPDF/index.ts\"));\nexports.RenderPDF = RenderPDF_1.default;\nvar DownloadFile_1 = __importStar(__webpack_require__(/*! ./DownloadFile */ \"./tools/DownloadFile/index.ts\"));\nexports.downloadFile = DownloadFile_1.default;\nObject.defineProperty(exports, \"getFileNameFromHeader\", ({ enumerable: true, get: function () { return DownloadFile_1.getFileNameFromHeader; } }));\nvar ArrayIsIncludes_1 = __importDefault(__webpack_require__(/*! ./ArrayIsIncludes */ \"./tools/ArrayIsIncludes/index.ts\"));\nexports.array_is_includes = ArrayIsIncludes_1.default;\nvar GenerateRandomStr_1 = __importDefault(__webpack_require__(/*! ./GenerateRandomStr */ \"./tools/GenerateRandomStr/index.ts\"));\nexports.generateRandomStr = GenerateRandomStr_1.default;\nvar GetTimeDifference_1 = __importDefault(__webpack_require__(/*! ./GetTimeDifference */ \"./tools/GetTimeDifference/index.ts\"));\nexports.getTimeDifference = GetTimeDifference_1.default;\nvar LoadFont_1 = __importDefault(__webpack_require__(/*! ./LoadFont */ \"./tools/LoadFont/index.ts\"));\nexports.loadFont = LoadFont_1.default;\nvar GetDateRange_1 = __importDefault(__webpack_require__(/*! ./GetDateRange */ \"./tools/GetDateRange/index.ts\"));\nexports.getDateRange = GetDateRange_1.default;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/index.ts?");
263
263
 
264
264
  /***/ }),
265
265