@cj-tech-master/excelts 1.1.0 → 1.4.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/browser/excelts.iife.js +1049 -559
- package/dist/browser/excelts.iife.js.map +1 -1
- package/dist/browser/excelts.iife.min.js +17 -17
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/utils/cell-format.js +815 -0
- package/dist/cjs/utils/parse-sax.js +2 -2
- package/dist/cjs/utils/{extra-utils.js → sheet-utils.js} +114 -89
- package/dist/cjs/utils/stream-buf.js +15 -4
- package/dist/cjs/utils/unzip/parse.js +82 -1
- package/dist/cjs/utils/utils.js +13 -17
- package/dist/cjs/utils/zip-stream.js +20 -32
- package/dist/cjs/xlsx/xlsx.js +1 -2
- package/dist/esm/index.browser.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/utils/cell-format.js +810 -0
- package/dist/esm/utils/parse-sax.js +1 -1
- package/dist/esm/utils/{extra-utils.js → sheet-utils.js} +97 -72
- package/dist/esm/utils/stream-buf.js +15 -4
- package/dist/esm/utils/unzip/parse.js +83 -2
- package/dist/esm/utils/utils.js +12 -16
- package/dist/esm/utils/zip-stream.js +20 -32
- package/dist/esm/xlsx/xlsx.js +1 -2
- package/dist/types/index.browser.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/cell-format.d.ts +32 -0
- package/dist/types/utils/{extra-utils.d.ts → sheet-utils.d.ts} +51 -52
- package/dist/types/utils/utils.d.ts +5 -2
- package/package.json +5 -5
- package/dist/cjs/utils/browser-buffer-decode.js +0 -13
- package/dist/cjs/utils/browser-buffer-encode.js +0 -13
- package/dist/cjs/utils/browser.js +0 -6
- package/dist/esm/utils/browser-buffer-decode.js +0 -11
- package/dist/esm/utils/browser-buffer-encode.js +0 -11
- package/dist/esm/utils/browser.js +0 -3
- package/dist/types/utils/browser-buffer-decode.d.ts +0 -2
- package/dist/types/utils/browser-buffer-encode.d.ts +0 -2
- package/dist/types/utils/browser.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cj-tech-master/excelts v1.
|
|
2
|
+
* @cj-tech-master/excelts v1.4.0
|
|
3
3
|
* TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
|
|
4
4
|
* (c) 2025 cjnoname
|
|
5
5
|
* Released under the MIT License
|
|
@@ -2690,7 +2690,7 @@ var ExcelTS = (function(exports) {
|
|
|
2690
2690
|
var base64 = require_base64_js();
|
|
2691
2691
|
var ieee754 = require_ieee754();
|
|
2692
2692
|
var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
|
|
2693
|
-
exports.Buffer = Buffer$
|
|
2693
|
+
exports.Buffer = Buffer$68;
|
|
2694
2694
|
exports.SlowBuffer = SlowBuffer;
|
|
2695
2695
|
exports.INSPECT_MAX_BYTES = 50;
|
|
2696
2696
|
var K_MAX_LENGTH = 2147483647;
|
|
@@ -2709,8 +2709,8 @@ var ExcelTS = (function(exports) {
|
|
|
2709
2709
|
* (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
|
|
2710
2710
|
* for __proto__ and has a buggy typed array implementation.
|
|
2711
2711
|
*/
|
|
2712
|
-
Buffer$
|
|
2713
|
-
if (!Buffer$
|
|
2712
|
+
Buffer$68.TYPED_ARRAY_SUPPORT = typedArraySupport();
|
|
2713
|
+
if (!Buffer$68.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");
|
|
2714
2714
|
function typedArraySupport() {
|
|
2715
2715
|
try {
|
|
2716
2716
|
var arr = new Uint8Array(1);
|
|
@@ -2724,24 +2724,24 @@ var ExcelTS = (function(exports) {
|
|
|
2724
2724
|
return false;
|
|
2725
2725
|
}
|
|
2726
2726
|
}
|
|
2727
|
-
Object.defineProperty(Buffer$
|
|
2727
|
+
Object.defineProperty(Buffer$68.prototype, "parent", {
|
|
2728
2728
|
enumerable: true,
|
|
2729
2729
|
get: function() {
|
|
2730
|
-
if (!Buffer$
|
|
2730
|
+
if (!Buffer$68.isBuffer(this)) return void 0;
|
|
2731
2731
|
return this.buffer;
|
|
2732
2732
|
}
|
|
2733
2733
|
});
|
|
2734
|
-
Object.defineProperty(Buffer$
|
|
2734
|
+
Object.defineProperty(Buffer$68.prototype, "offset", {
|
|
2735
2735
|
enumerable: true,
|
|
2736
2736
|
get: function() {
|
|
2737
|
-
if (!Buffer$
|
|
2737
|
+
if (!Buffer$68.isBuffer(this)) return void 0;
|
|
2738
2738
|
return this.byteOffset;
|
|
2739
2739
|
}
|
|
2740
2740
|
});
|
|
2741
2741
|
function createBuffer(length) {
|
|
2742
2742
|
if (length > K_MAX_LENGTH) throw new RangeError("The value \"" + length + "\" is invalid for option \"size\"");
|
|
2743
2743
|
var buf = new Uint8Array(length);
|
|
2744
|
-
Object.setPrototypeOf(buf, Buffer$
|
|
2744
|
+
Object.setPrototypeOf(buf, Buffer$68.prototype);
|
|
2745
2745
|
return buf;
|
|
2746
2746
|
}
|
|
2747
2747
|
/**
|
|
@@ -2753,14 +2753,14 @@ var ExcelTS = (function(exports) {
|
|
|
2753
2753
|
*
|
|
2754
2754
|
* The `Uint8Array` prototype remains unmodified.
|
|
2755
2755
|
*/
|
|
2756
|
-
function Buffer$
|
|
2756
|
+
function Buffer$68(arg, encodingOrOffset, length) {
|
|
2757
2757
|
if (typeof arg === "number") {
|
|
2758
2758
|
if (typeof encodingOrOffset === "string") throw new TypeError("The \"string\" argument must be of type string. Received type number");
|
|
2759
2759
|
return allocUnsafe(arg);
|
|
2760
2760
|
}
|
|
2761
2761
|
return from$1(arg, encodingOrOffset, length);
|
|
2762
2762
|
}
|
|
2763
|
-
Buffer$
|
|
2763
|
+
Buffer$68.poolSize = 8192;
|
|
2764
2764
|
function from$1(value, encodingOrOffset, length) {
|
|
2765
2765
|
if (typeof value === "string") return fromString(value, encodingOrOffset);
|
|
2766
2766
|
if (ArrayBuffer.isView(value)) return fromArrayView(value);
|
|
@@ -2769,10 +2769,10 @@ var ExcelTS = (function(exports) {
|
|
|
2769
2769
|
if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) return fromArrayBuffer(value, encodingOrOffset, length);
|
|
2770
2770
|
if (typeof value === "number") throw new TypeError("The \"value\" argument must not be of type number. Received type number");
|
|
2771
2771
|
var valueOf = value.valueOf && value.valueOf();
|
|
2772
|
-
if (valueOf != null && valueOf !== value) return Buffer$
|
|
2772
|
+
if (valueOf != null && valueOf !== value) return Buffer$68.from(valueOf, encodingOrOffset, length);
|
|
2773
2773
|
var b = fromObject(value);
|
|
2774
2774
|
if (b) return b;
|
|
2775
|
-
if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") return Buffer$
|
|
2775
|
+
if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") return Buffer$68.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);
|
|
2776
2776
|
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
|
|
2777
2777
|
}
|
|
2778
2778
|
/**
|
|
@@ -2783,11 +2783,11 @@ var ExcelTS = (function(exports) {
|
|
|
2783
2783
|
* Buffer.from(buffer)
|
|
2784
2784
|
* Buffer.from(arrayBuffer[, byteOffset[, length]])
|
|
2785
2785
|
**/
|
|
2786
|
-
Buffer$
|
|
2786
|
+
Buffer$68.from = function(value, encodingOrOffset, length) {
|
|
2787
2787
|
return from$1(value, encodingOrOffset, length);
|
|
2788
2788
|
};
|
|
2789
|
-
Object.setPrototypeOf(Buffer$
|
|
2790
|
-
Object.setPrototypeOf(Buffer$
|
|
2789
|
+
Object.setPrototypeOf(Buffer$68.prototype, Uint8Array.prototype);
|
|
2790
|
+
Object.setPrototypeOf(Buffer$68, Uint8Array);
|
|
2791
2791
|
function assertSize$1(size) {
|
|
2792
2792
|
if (typeof size !== "number") throw new TypeError("\"size\" argument must be of type number");
|
|
2793
2793
|
else if (size < 0) throw new RangeError("The value \"" + size + "\" is invalid for option \"size\"");
|
|
@@ -2802,7 +2802,7 @@ var ExcelTS = (function(exports) {
|
|
|
2802
2802
|
* Creates a new filled Buffer instance.
|
|
2803
2803
|
* alloc(size[, fill[, encoding]])
|
|
2804
2804
|
**/
|
|
2805
|
-
Buffer$
|
|
2805
|
+
Buffer$68.alloc = function(size, fill, encoding) {
|
|
2806
2806
|
return alloc(size, fill, encoding);
|
|
2807
2807
|
};
|
|
2808
2808
|
function allocUnsafe(size) {
|
|
@@ -2812,18 +2812,18 @@ var ExcelTS = (function(exports) {
|
|
|
2812
2812
|
/**
|
|
2813
2813
|
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
|
|
2814
2814
|
* */
|
|
2815
|
-
Buffer$
|
|
2815
|
+
Buffer$68.allocUnsafe = function(size) {
|
|
2816
2816
|
return allocUnsafe(size);
|
|
2817
2817
|
};
|
|
2818
2818
|
/**
|
|
2819
2819
|
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
|
|
2820
2820
|
*/
|
|
2821
|
-
Buffer$
|
|
2821
|
+
Buffer$68.allocUnsafeSlow = function(size) {
|
|
2822
2822
|
return allocUnsafe(size);
|
|
2823
2823
|
};
|
|
2824
2824
|
function fromString(string, encoding) {
|
|
2825
2825
|
if (typeof encoding !== "string" || encoding === "") encoding = "utf8";
|
|
2826
|
-
if (!Buffer$
|
|
2826
|
+
if (!Buffer$68.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
|
|
2827
2827
|
var length = byteLength(string, encoding) | 0;
|
|
2828
2828
|
var buf = createBuffer(length);
|
|
2829
2829
|
var actual = buf.write(string, encoding);
|
|
@@ -2850,11 +2850,11 @@ var ExcelTS = (function(exports) {
|
|
|
2850
2850
|
if (byteOffset === void 0 && length === void 0) buf = new Uint8Array(array);
|
|
2851
2851
|
else if (length === void 0) buf = new Uint8Array(array, byteOffset);
|
|
2852
2852
|
else buf = new Uint8Array(array, byteOffset, length);
|
|
2853
|
-
Object.setPrototypeOf(buf, Buffer$
|
|
2853
|
+
Object.setPrototypeOf(buf, Buffer$68.prototype);
|
|
2854
2854
|
return buf;
|
|
2855
2855
|
}
|
|
2856
2856
|
function fromObject(obj) {
|
|
2857
|
-
if (Buffer$
|
|
2857
|
+
if (Buffer$68.isBuffer(obj)) {
|
|
2858
2858
|
var len$1 = checked(obj.length) | 0;
|
|
2859
2859
|
var buf = createBuffer(len$1);
|
|
2860
2860
|
if (buf.length === 0) return buf;
|
|
@@ -2873,15 +2873,15 @@ var ExcelTS = (function(exports) {
|
|
|
2873
2873
|
}
|
|
2874
2874
|
function SlowBuffer(length) {
|
|
2875
2875
|
if (+length != length) length = 0;
|
|
2876
|
-
return Buffer$
|
|
2876
|
+
return Buffer$68.alloc(+length);
|
|
2877
2877
|
}
|
|
2878
|
-
Buffer$
|
|
2879
|
-
return b != null && b._isBuffer === true && b !== Buffer$
|
|
2878
|
+
Buffer$68.isBuffer = function isBuffer(b) {
|
|
2879
|
+
return b != null && b._isBuffer === true && b !== Buffer$68.prototype;
|
|
2880
2880
|
};
|
|
2881
|
-
Buffer$
|
|
2882
|
-
if (isInstance(a, Uint8Array)) a = Buffer$
|
|
2883
|
-
if (isInstance(b, Uint8Array)) b = Buffer$
|
|
2884
|
-
if (!Buffer$
|
|
2881
|
+
Buffer$68.compare = function compare$1(a, b) {
|
|
2882
|
+
if (isInstance(a, Uint8Array)) a = Buffer$68.from(a, a.offset, a.byteLength);
|
|
2883
|
+
if (isInstance(b, Uint8Array)) b = Buffer$68.from(b, b.offset, b.byteLength);
|
|
2884
|
+
if (!Buffer$68.isBuffer(a) || !Buffer$68.isBuffer(b)) throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
|
|
2885
2885
|
if (a === b) return 0;
|
|
2886
2886
|
var x$1 = a.length;
|
|
2887
2887
|
var y = b.length;
|
|
@@ -2894,7 +2894,7 @@ var ExcelTS = (function(exports) {
|
|
|
2894
2894
|
if (y < x$1) return 1;
|
|
2895
2895
|
return 0;
|
|
2896
2896
|
};
|
|
2897
|
-
Buffer$
|
|
2897
|
+
Buffer$68.isEncoding = function isEncoding$1(encoding) {
|
|
2898
2898
|
switch (String(encoding).toLowerCase()) {
|
|
2899
2899
|
case "hex":
|
|
2900
2900
|
case "utf8":
|
|
@@ -2910,28 +2910,28 @@ var ExcelTS = (function(exports) {
|
|
|
2910
2910
|
default: return false;
|
|
2911
2911
|
}
|
|
2912
2912
|
};
|
|
2913
|
-
Buffer$
|
|
2913
|
+
Buffer$68.concat = function concat(list, length) {
|
|
2914
2914
|
if (!Array.isArray(list)) throw new TypeError("\"list\" argument must be an Array of Buffers");
|
|
2915
|
-
if (list.length === 0) return Buffer$
|
|
2915
|
+
if (list.length === 0) return Buffer$68.alloc(0);
|
|
2916
2916
|
var i$2;
|
|
2917
2917
|
if (length === void 0) {
|
|
2918
2918
|
length = 0;
|
|
2919
2919
|
for (i$2 = 0; i$2 < list.length; ++i$2) length += list[i$2].length;
|
|
2920
2920
|
}
|
|
2921
|
-
var buffer$2 = Buffer$
|
|
2921
|
+
var buffer$2 = Buffer$68.allocUnsafe(length);
|
|
2922
2922
|
var pos = 0;
|
|
2923
2923
|
for (i$2 = 0; i$2 < list.length; ++i$2) {
|
|
2924
2924
|
var buf = list[i$2];
|
|
2925
|
-
if (isInstance(buf, Uint8Array)) if (pos + buf.length > buffer$2.length) Buffer$
|
|
2925
|
+
if (isInstance(buf, Uint8Array)) if (pos + buf.length > buffer$2.length) Buffer$68.from(buf).copy(buffer$2, pos);
|
|
2926
2926
|
else Uint8Array.prototype.set.call(buffer$2, buf, pos);
|
|
2927
|
-
else if (!Buffer$
|
|
2927
|
+
else if (!Buffer$68.isBuffer(buf)) throw new TypeError("\"list\" argument must be an Array of Buffers");
|
|
2928
2928
|
else buf.copy(buffer$2, pos);
|
|
2929
2929
|
pos += buf.length;
|
|
2930
2930
|
}
|
|
2931
2931
|
return buffer$2;
|
|
2932
2932
|
};
|
|
2933
2933
|
function byteLength(string, encoding) {
|
|
2934
|
-
if (Buffer$
|
|
2934
|
+
if (Buffer$68.isBuffer(string)) return string.length;
|
|
2935
2935
|
if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) return string.byteLength;
|
|
2936
2936
|
if (typeof string !== "string") throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof string);
|
|
2937
2937
|
var len$1 = string.length;
|
|
@@ -2956,7 +2956,7 @@ var ExcelTS = (function(exports) {
|
|
|
2956
2956
|
loweredCase = true;
|
|
2957
2957
|
}
|
|
2958
2958
|
}
|
|
2959
|
-
Buffer$
|
|
2959
|
+
Buffer$68.byteLength = byteLength;
|
|
2960
2960
|
function slowToString(encoding, start, end) {
|
|
2961
2961
|
var loweredCase = false;
|
|
2962
2962
|
if (start === void 0 || start < 0) start = 0;
|
|
@@ -2985,19 +2985,19 @@ var ExcelTS = (function(exports) {
|
|
|
2985
2985
|
loweredCase = true;
|
|
2986
2986
|
}
|
|
2987
2987
|
}
|
|
2988
|
-
Buffer$
|
|
2988
|
+
Buffer$68.prototype._isBuffer = true;
|
|
2989
2989
|
function swap(b, n, m) {
|
|
2990
2990
|
var i$2 = b[n];
|
|
2991
2991
|
b[n] = b[m];
|
|
2992
2992
|
b[m] = i$2;
|
|
2993
2993
|
}
|
|
2994
|
-
Buffer$
|
|
2994
|
+
Buffer$68.prototype.swap16 = function swap16() {
|
|
2995
2995
|
var len$1 = this.length;
|
|
2996
2996
|
if (len$1 % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
2997
2997
|
for (var i$2 = 0; i$2 < len$1; i$2 += 2) swap(this, i$2, i$2 + 1);
|
|
2998
2998
|
return this;
|
|
2999
2999
|
};
|
|
3000
|
-
Buffer$
|
|
3000
|
+
Buffer$68.prototype.swap32 = function swap32() {
|
|
3001
3001
|
var len$1 = this.length;
|
|
3002
3002
|
if (len$1 % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
3003
3003
|
for (var i$2 = 0; i$2 < len$1; i$2 += 4) {
|
|
@@ -3006,7 +3006,7 @@ var ExcelTS = (function(exports) {
|
|
|
3006
3006
|
}
|
|
3007
3007
|
return this;
|
|
3008
3008
|
};
|
|
3009
|
-
Buffer$
|
|
3009
|
+
Buffer$68.prototype.swap64 = function swap64() {
|
|
3010
3010
|
var len$1 = this.length;
|
|
3011
3011
|
if (len$1 % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
3012
3012
|
for (var i$2 = 0; i$2 < len$1; i$2 += 8) {
|
|
@@ -3017,29 +3017,29 @@ var ExcelTS = (function(exports) {
|
|
|
3017
3017
|
}
|
|
3018
3018
|
return this;
|
|
3019
3019
|
};
|
|
3020
|
-
Buffer$
|
|
3020
|
+
Buffer$68.prototype.toString = function toString$5() {
|
|
3021
3021
|
var length = this.length;
|
|
3022
3022
|
if (length === 0) return "";
|
|
3023
3023
|
if (arguments.length === 0) return utf8Slice(this, 0, length);
|
|
3024
3024
|
return slowToString.apply(this, arguments);
|
|
3025
3025
|
};
|
|
3026
|
-
Buffer$
|
|
3027
|
-
Buffer$
|
|
3028
|
-
if (!Buffer$
|
|
3026
|
+
Buffer$68.prototype.toLocaleString = Buffer$68.prototype.toString;
|
|
3027
|
+
Buffer$68.prototype.equals = function equals(b) {
|
|
3028
|
+
if (!Buffer$68.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
|
|
3029
3029
|
if (this === b) return true;
|
|
3030
|
-
return Buffer$
|
|
3030
|
+
return Buffer$68.compare(this, b) === 0;
|
|
3031
3031
|
};
|
|
3032
|
-
Buffer$
|
|
3032
|
+
Buffer$68.prototype.inspect = function inspect$2() {
|
|
3033
3033
|
var str = "";
|
|
3034
3034
|
var max$3 = exports.INSPECT_MAX_BYTES;
|
|
3035
3035
|
str = this.toString("hex", 0, max$3).replace(/(.{2})/g, "$1 ").trim();
|
|
3036
3036
|
if (this.length > max$3) str += " ... ";
|
|
3037
3037
|
return "<Buffer " + str + ">";
|
|
3038
3038
|
};
|
|
3039
|
-
if (customInspectSymbol) Buffer$
|
|
3040
|
-
Buffer$
|
|
3041
|
-
if (isInstance(target, Uint8Array)) target = Buffer$
|
|
3042
|
-
if (!Buffer$
|
|
3039
|
+
if (customInspectSymbol) Buffer$68.prototype[customInspectSymbol] = Buffer$68.prototype.inspect;
|
|
3040
|
+
Buffer$68.prototype.compare = function compare$1(target, start, end, thisStart, thisEnd) {
|
|
3041
|
+
if (isInstance(target, Uint8Array)) target = Buffer$68.from(target, target.offset, target.byteLength);
|
|
3042
|
+
if (!Buffer$68.isBuffer(target)) throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof target);
|
|
3043
3043
|
if (start === void 0) start = 0;
|
|
3044
3044
|
if (end === void 0) end = target ? target.length : 0;
|
|
3045
3045
|
if (thisStart === void 0) thisStart = 0;
|
|
@@ -3081,8 +3081,8 @@ var ExcelTS = (function(exports) {
|
|
|
3081
3081
|
else byteOffset = buffer$2.length - 1;
|
|
3082
3082
|
else if (byteOffset < 0) if (dir) byteOffset = 0;
|
|
3083
3083
|
else return -1;
|
|
3084
|
-
if (typeof val === "string") val = Buffer$
|
|
3085
|
-
if (Buffer$
|
|
3084
|
+
if (typeof val === "string") val = Buffer$68.from(val, encoding);
|
|
3085
|
+
if (Buffer$68.isBuffer(val)) {
|
|
3086
3086
|
if (val.length === 0) return -1;
|
|
3087
3087
|
return arrayIndexOf(buffer$2, val, byteOffset, encoding, dir);
|
|
3088
3088
|
} else if (typeof val === "number") {
|
|
@@ -3134,13 +3134,13 @@ var ExcelTS = (function(exports) {
|
|
|
3134
3134
|
}
|
|
3135
3135
|
return -1;
|
|
3136
3136
|
}
|
|
3137
|
-
Buffer$
|
|
3137
|
+
Buffer$68.prototype.includes = function includes$1(val, byteOffset, encoding) {
|
|
3138
3138
|
return this.indexOf(val, byteOffset, encoding) !== -1;
|
|
3139
3139
|
};
|
|
3140
|
-
Buffer$
|
|
3140
|
+
Buffer$68.prototype.indexOf = function indexOf$2(val, byteOffset, encoding) {
|
|
3141
3141
|
return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
|
|
3142
3142
|
};
|
|
3143
|
-
Buffer$
|
|
3143
|
+
Buffer$68.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
|
|
3144
3144
|
return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
|
|
3145
3145
|
};
|
|
3146
3146
|
function hexWrite(buf, string, offset, length) {
|
|
@@ -3172,7 +3172,7 @@ var ExcelTS = (function(exports) {
|
|
|
3172
3172
|
function ucs2Write(buf, string, offset, length) {
|
|
3173
3173
|
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
|
|
3174
3174
|
}
|
|
3175
|
-
Buffer$
|
|
3175
|
+
Buffer$68.prototype.write = function write$1(string, offset, length, encoding) {
|
|
3176
3176
|
if (offset === void 0) {
|
|
3177
3177
|
encoding = "utf8";
|
|
3178
3178
|
length = this.length;
|
|
@@ -3214,7 +3214,7 @@ var ExcelTS = (function(exports) {
|
|
|
3214
3214
|
loweredCase = true;
|
|
3215
3215
|
}
|
|
3216
3216
|
};
|
|
3217
|
-
Buffer$
|
|
3217
|
+
Buffer$68.prototype.toJSON = function toJSON() {
|
|
3218
3218
|
return {
|
|
3219
3219
|
type: "Buffer",
|
|
3220
3220
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
@@ -3311,7 +3311,7 @@ var ExcelTS = (function(exports) {
|
|
|
3311
3311
|
for (var i$2 = 0; i$2 < bytes.length - 1; i$2 += 2) res += String.fromCharCode(bytes[i$2] + bytes[i$2 + 1] * 256);
|
|
3312
3312
|
return res;
|
|
3313
3313
|
}
|
|
3314
|
-
Buffer$
|
|
3314
|
+
Buffer$68.prototype.slice = function slice(start, end) {
|
|
3315
3315
|
var len$1 = this.length;
|
|
3316
3316
|
start = ~~start;
|
|
3317
3317
|
end = end === void 0 ? len$1 : ~~end;
|
|
@@ -3325,14 +3325,14 @@ var ExcelTS = (function(exports) {
|
|
|
3325
3325
|
} else if (end > len$1) end = len$1;
|
|
3326
3326
|
if (end < start) end = start;
|
|
3327
3327
|
var newBuf = this.subarray(start, end);
|
|
3328
|
-
Object.setPrototypeOf(newBuf, Buffer$
|
|
3328
|
+
Object.setPrototypeOf(newBuf, Buffer$68.prototype);
|
|
3329
3329
|
return newBuf;
|
|
3330
3330
|
};
|
|
3331
3331
|
function checkOffset(offset, ext, length) {
|
|
3332
3332
|
if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
|
|
3333
3333
|
if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
|
|
3334
3334
|
}
|
|
3335
|
-
Buffer$
|
|
3335
|
+
Buffer$68.prototype.readUintLE = Buffer$68.prototype.readUIntLE = function readUIntLE(offset, byteLength$2, noAssert) {
|
|
3336
3336
|
offset = offset >>> 0;
|
|
3337
3337
|
byteLength$2 = byteLength$2 >>> 0;
|
|
3338
3338
|
if (!noAssert) checkOffset(offset, byteLength$2, this.length);
|
|
@@ -3342,7 +3342,7 @@ var ExcelTS = (function(exports) {
|
|
|
3342
3342
|
while (++i$2 < byteLength$2 && (mul *= 256)) val += this[offset + i$2] * mul;
|
|
3343
3343
|
return val;
|
|
3344
3344
|
};
|
|
3345
|
-
Buffer$
|
|
3345
|
+
Buffer$68.prototype.readUintBE = Buffer$68.prototype.readUIntBE = function readUIntBE(offset, byteLength$2, noAssert) {
|
|
3346
3346
|
offset = offset >>> 0;
|
|
3347
3347
|
byteLength$2 = byteLength$2 >>> 0;
|
|
3348
3348
|
if (!noAssert) checkOffset(offset, byteLength$2, this.length);
|
|
@@ -3351,32 +3351,32 @@ var ExcelTS = (function(exports) {
|
|
|
3351
3351
|
while (byteLength$2 > 0 && (mul *= 256)) val += this[offset + --byteLength$2] * mul;
|
|
3352
3352
|
return val;
|
|
3353
3353
|
};
|
|
3354
|
-
Buffer$
|
|
3354
|
+
Buffer$68.prototype.readUint8 = Buffer$68.prototype.readUInt8 = function readUInt8(offset, noAssert) {
|
|
3355
3355
|
offset = offset >>> 0;
|
|
3356
3356
|
if (!noAssert) checkOffset(offset, 1, this.length);
|
|
3357
3357
|
return this[offset];
|
|
3358
3358
|
};
|
|
3359
|
-
Buffer$
|
|
3359
|
+
Buffer$68.prototype.readUint16LE = Buffer$68.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
|
|
3360
3360
|
offset = offset >>> 0;
|
|
3361
3361
|
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
3362
3362
|
return this[offset] | this[offset + 1] << 8;
|
|
3363
3363
|
};
|
|
3364
|
-
Buffer$
|
|
3364
|
+
Buffer$68.prototype.readUint16BE = Buffer$68.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
|
|
3365
3365
|
offset = offset >>> 0;
|
|
3366
3366
|
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
3367
3367
|
return this[offset] << 8 | this[offset + 1];
|
|
3368
3368
|
};
|
|
3369
|
-
Buffer$
|
|
3369
|
+
Buffer$68.prototype.readUint32LE = Buffer$68.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
|
|
3370
3370
|
offset = offset >>> 0;
|
|
3371
3371
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
3372
3372
|
return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
|
|
3373
3373
|
};
|
|
3374
|
-
Buffer$
|
|
3374
|
+
Buffer$68.prototype.readUint32BE = Buffer$68.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
|
|
3375
3375
|
offset = offset >>> 0;
|
|
3376
3376
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
3377
3377
|
return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
|
|
3378
3378
|
};
|
|
3379
|
-
Buffer$
|
|
3379
|
+
Buffer$68.prototype.readIntLE = function readIntLE(offset, byteLength$2, noAssert) {
|
|
3380
3380
|
offset = offset >>> 0;
|
|
3381
3381
|
byteLength$2 = byteLength$2 >>> 0;
|
|
3382
3382
|
if (!noAssert) checkOffset(offset, byteLength$2, this.length);
|
|
@@ -3388,7 +3388,7 @@ var ExcelTS = (function(exports) {
|
|
|
3388
3388
|
if (val >= mul) val -= Math.pow(2, 8 * byteLength$2);
|
|
3389
3389
|
return val;
|
|
3390
3390
|
};
|
|
3391
|
-
Buffer$
|
|
3391
|
+
Buffer$68.prototype.readIntBE = function readIntBE(offset, byteLength$2, noAssert) {
|
|
3392
3392
|
offset = offset >>> 0;
|
|
3393
3393
|
byteLength$2 = byteLength$2 >>> 0;
|
|
3394
3394
|
if (!noAssert) checkOffset(offset, byteLength$2, this.length);
|
|
@@ -3400,60 +3400,60 @@ var ExcelTS = (function(exports) {
|
|
|
3400
3400
|
if (val >= mul) val -= Math.pow(2, 8 * byteLength$2);
|
|
3401
3401
|
return val;
|
|
3402
3402
|
};
|
|
3403
|
-
Buffer$
|
|
3403
|
+
Buffer$68.prototype.readInt8 = function readInt8(offset, noAssert) {
|
|
3404
3404
|
offset = offset >>> 0;
|
|
3405
3405
|
if (!noAssert) checkOffset(offset, 1, this.length);
|
|
3406
3406
|
if (!(this[offset] & 128)) return this[offset];
|
|
3407
3407
|
return (255 - this[offset] + 1) * -1;
|
|
3408
3408
|
};
|
|
3409
|
-
Buffer$
|
|
3409
|
+
Buffer$68.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
|
|
3410
3410
|
offset = offset >>> 0;
|
|
3411
3411
|
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
3412
3412
|
var val = this[offset] | this[offset + 1] << 8;
|
|
3413
3413
|
return val & 32768 ? val | 4294901760 : val;
|
|
3414
3414
|
};
|
|
3415
|
-
Buffer$
|
|
3415
|
+
Buffer$68.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
|
|
3416
3416
|
offset = offset >>> 0;
|
|
3417
3417
|
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
3418
3418
|
var val = this[offset + 1] | this[offset] << 8;
|
|
3419
3419
|
return val & 32768 ? val | 4294901760 : val;
|
|
3420
3420
|
};
|
|
3421
|
-
Buffer$
|
|
3421
|
+
Buffer$68.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
|
|
3422
3422
|
offset = offset >>> 0;
|
|
3423
3423
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
3424
3424
|
return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
|
|
3425
3425
|
};
|
|
3426
|
-
Buffer$
|
|
3426
|
+
Buffer$68.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
|
|
3427
3427
|
offset = offset >>> 0;
|
|
3428
3428
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
3429
3429
|
return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
|
|
3430
3430
|
};
|
|
3431
|
-
Buffer$
|
|
3431
|
+
Buffer$68.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
|
|
3432
3432
|
offset = offset >>> 0;
|
|
3433
3433
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
3434
3434
|
return ieee754.read(this, offset, true, 23, 4);
|
|
3435
3435
|
};
|
|
3436
|
-
Buffer$
|
|
3436
|
+
Buffer$68.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
|
|
3437
3437
|
offset = offset >>> 0;
|
|
3438
3438
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
3439
3439
|
return ieee754.read(this, offset, false, 23, 4);
|
|
3440
3440
|
};
|
|
3441
|
-
Buffer$
|
|
3441
|
+
Buffer$68.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
|
|
3442
3442
|
offset = offset >>> 0;
|
|
3443
3443
|
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
3444
3444
|
return ieee754.read(this, offset, true, 52, 8);
|
|
3445
3445
|
};
|
|
3446
|
-
Buffer$
|
|
3446
|
+
Buffer$68.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
|
|
3447
3447
|
offset = offset >>> 0;
|
|
3448
3448
|
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
3449
3449
|
return ieee754.read(this, offset, false, 52, 8);
|
|
3450
3450
|
};
|
|
3451
3451
|
function checkInt(buf, value, offset, ext, max$3, min$1) {
|
|
3452
|
-
if (!Buffer$
|
|
3452
|
+
if (!Buffer$68.isBuffer(buf)) throw new TypeError("\"buffer\" argument must be a Buffer instance");
|
|
3453
3453
|
if (value > max$3 || value < min$1) throw new RangeError("\"value\" argument is out of bounds");
|
|
3454
3454
|
if (offset + ext > buf.length) throw new RangeError("Index out of range");
|
|
3455
3455
|
}
|
|
3456
|
-
Buffer$
|
|
3456
|
+
Buffer$68.prototype.writeUintLE = Buffer$68.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength$2, noAssert) {
|
|
3457
3457
|
value = +value;
|
|
3458
3458
|
offset = offset >>> 0;
|
|
3459
3459
|
byteLength$2 = byteLength$2 >>> 0;
|
|
@@ -3467,7 +3467,7 @@ var ExcelTS = (function(exports) {
|
|
|
3467
3467
|
while (++i$2 < byteLength$2 && (mul *= 256)) this[offset + i$2] = value / mul & 255;
|
|
3468
3468
|
return offset + byteLength$2;
|
|
3469
3469
|
};
|
|
3470
|
-
Buffer$
|
|
3470
|
+
Buffer$68.prototype.writeUintBE = Buffer$68.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength$2, noAssert) {
|
|
3471
3471
|
value = +value;
|
|
3472
3472
|
offset = offset >>> 0;
|
|
3473
3473
|
byteLength$2 = byteLength$2 >>> 0;
|
|
@@ -3481,14 +3481,14 @@ var ExcelTS = (function(exports) {
|
|
|
3481
3481
|
while (--i$2 >= 0 && (mul *= 256)) this[offset + i$2] = value / mul & 255;
|
|
3482
3482
|
return offset + byteLength$2;
|
|
3483
3483
|
};
|
|
3484
|
-
Buffer$
|
|
3484
|
+
Buffer$68.prototype.writeUint8 = Buffer$68.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
|
|
3485
3485
|
value = +value;
|
|
3486
3486
|
offset = offset >>> 0;
|
|
3487
3487
|
if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
|
|
3488
3488
|
this[offset] = value & 255;
|
|
3489
3489
|
return offset + 1;
|
|
3490
3490
|
};
|
|
3491
|
-
Buffer$
|
|
3491
|
+
Buffer$68.prototype.writeUint16LE = Buffer$68.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
|
|
3492
3492
|
value = +value;
|
|
3493
3493
|
offset = offset >>> 0;
|
|
3494
3494
|
if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
|
|
@@ -3496,7 +3496,7 @@ var ExcelTS = (function(exports) {
|
|
|
3496
3496
|
this[offset + 1] = value >>> 8;
|
|
3497
3497
|
return offset + 2;
|
|
3498
3498
|
};
|
|
3499
|
-
Buffer$
|
|
3499
|
+
Buffer$68.prototype.writeUint16BE = Buffer$68.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
|
|
3500
3500
|
value = +value;
|
|
3501
3501
|
offset = offset >>> 0;
|
|
3502
3502
|
if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
|
|
@@ -3504,7 +3504,7 @@ var ExcelTS = (function(exports) {
|
|
|
3504
3504
|
this[offset + 1] = value & 255;
|
|
3505
3505
|
return offset + 2;
|
|
3506
3506
|
};
|
|
3507
|
-
Buffer$
|
|
3507
|
+
Buffer$68.prototype.writeUint32LE = Buffer$68.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
|
|
3508
3508
|
value = +value;
|
|
3509
3509
|
offset = offset >>> 0;
|
|
3510
3510
|
if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
|
|
@@ -3514,7 +3514,7 @@ var ExcelTS = (function(exports) {
|
|
|
3514
3514
|
this[offset] = value & 255;
|
|
3515
3515
|
return offset + 4;
|
|
3516
3516
|
};
|
|
3517
|
-
Buffer$
|
|
3517
|
+
Buffer$68.prototype.writeUint32BE = Buffer$68.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
|
|
3518
3518
|
value = +value;
|
|
3519
3519
|
offset = offset >>> 0;
|
|
3520
3520
|
if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
|
|
@@ -3524,7 +3524,7 @@ var ExcelTS = (function(exports) {
|
|
|
3524
3524
|
this[offset + 3] = value & 255;
|
|
3525
3525
|
return offset + 4;
|
|
3526
3526
|
};
|
|
3527
|
-
Buffer$
|
|
3527
|
+
Buffer$68.prototype.writeIntLE = function writeIntLE(value, offset, byteLength$2, noAssert) {
|
|
3528
3528
|
value = +value;
|
|
3529
3529
|
offset = offset >>> 0;
|
|
3530
3530
|
if (!noAssert) {
|
|
@@ -3541,7 +3541,7 @@ var ExcelTS = (function(exports) {
|
|
|
3541
3541
|
}
|
|
3542
3542
|
return offset + byteLength$2;
|
|
3543
3543
|
};
|
|
3544
|
-
Buffer$
|
|
3544
|
+
Buffer$68.prototype.writeIntBE = function writeIntBE(value, offset, byteLength$2, noAssert) {
|
|
3545
3545
|
value = +value;
|
|
3546
3546
|
offset = offset >>> 0;
|
|
3547
3547
|
if (!noAssert) {
|
|
@@ -3558,7 +3558,7 @@ var ExcelTS = (function(exports) {
|
|
|
3558
3558
|
}
|
|
3559
3559
|
return offset + byteLength$2;
|
|
3560
3560
|
};
|
|
3561
|
-
Buffer$
|
|
3561
|
+
Buffer$68.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
|
|
3562
3562
|
value = +value;
|
|
3563
3563
|
offset = offset >>> 0;
|
|
3564
3564
|
if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
|
|
@@ -3566,7 +3566,7 @@ var ExcelTS = (function(exports) {
|
|
|
3566
3566
|
this[offset] = value & 255;
|
|
3567
3567
|
return offset + 1;
|
|
3568
3568
|
};
|
|
3569
|
-
Buffer$
|
|
3569
|
+
Buffer$68.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
|
|
3570
3570
|
value = +value;
|
|
3571
3571
|
offset = offset >>> 0;
|
|
3572
3572
|
if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
|
|
@@ -3574,7 +3574,7 @@ var ExcelTS = (function(exports) {
|
|
|
3574
3574
|
this[offset + 1] = value >>> 8;
|
|
3575
3575
|
return offset + 2;
|
|
3576
3576
|
};
|
|
3577
|
-
Buffer$
|
|
3577
|
+
Buffer$68.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
|
|
3578
3578
|
value = +value;
|
|
3579
3579
|
offset = offset >>> 0;
|
|
3580
3580
|
if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
|
|
@@ -3582,7 +3582,7 @@ var ExcelTS = (function(exports) {
|
|
|
3582
3582
|
this[offset + 1] = value & 255;
|
|
3583
3583
|
return offset + 2;
|
|
3584
3584
|
};
|
|
3585
|
-
Buffer$
|
|
3585
|
+
Buffer$68.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
|
|
3586
3586
|
value = +value;
|
|
3587
3587
|
offset = offset >>> 0;
|
|
3588
3588
|
if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
@@ -3592,7 +3592,7 @@ var ExcelTS = (function(exports) {
|
|
|
3592
3592
|
this[offset + 3] = value >>> 24;
|
|
3593
3593
|
return offset + 4;
|
|
3594
3594
|
};
|
|
3595
|
-
Buffer$
|
|
3595
|
+
Buffer$68.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
|
|
3596
3596
|
value = +value;
|
|
3597
3597
|
offset = offset >>> 0;
|
|
3598
3598
|
if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
@@ -3614,10 +3614,10 @@ var ExcelTS = (function(exports) {
|
|
|
3614
3614
|
ieee754.write(buf, value, offset, littleEndian, 23, 4);
|
|
3615
3615
|
return offset + 4;
|
|
3616
3616
|
}
|
|
3617
|
-
Buffer$
|
|
3617
|
+
Buffer$68.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
|
|
3618
3618
|
return writeFloat(this, value, offset, true, noAssert);
|
|
3619
3619
|
};
|
|
3620
|
-
Buffer$
|
|
3620
|
+
Buffer$68.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
|
|
3621
3621
|
return writeFloat(this, value, offset, false, noAssert);
|
|
3622
3622
|
};
|
|
3623
3623
|
function writeDouble(buf, value, offset, littleEndian, noAssert) {
|
|
@@ -3627,14 +3627,14 @@ var ExcelTS = (function(exports) {
|
|
|
3627
3627
|
ieee754.write(buf, value, offset, littleEndian, 52, 8);
|
|
3628
3628
|
return offset + 8;
|
|
3629
3629
|
}
|
|
3630
|
-
Buffer$
|
|
3630
|
+
Buffer$68.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
|
|
3631
3631
|
return writeDouble(this, value, offset, true, noAssert);
|
|
3632
3632
|
};
|
|
3633
|
-
Buffer$
|
|
3633
|
+
Buffer$68.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
|
|
3634
3634
|
return writeDouble(this, value, offset, false, noAssert);
|
|
3635
3635
|
};
|
|
3636
|
-
Buffer$
|
|
3637
|
-
if (!Buffer$
|
|
3636
|
+
Buffer$68.prototype.copy = function copy(target, targetStart, start, end) {
|
|
3637
|
+
if (!Buffer$68.isBuffer(target)) throw new TypeError("argument should be a Buffer");
|
|
3638
3638
|
if (!start) start = 0;
|
|
3639
3639
|
if (!end && end !== 0) end = this.length;
|
|
3640
3640
|
if (targetStart >= target.length) targetStart = target.length;
|
|
@@ -3652,7 +3652,7 @@ var ExcelTS = (function(exports) {
|
|
|
3652
3652
|
else Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart);
|
|
3653
3653
|
return len$1;
|
|
3654
3654
|
};
|
|
3655
|
-
Buffer$
|
|
3655
|
+
Buffer$68.prototype.fill = function fill(val, start, end, encoding) {
|
|
3656
3656
|
if (typeof val === "string") {
|
|
3657
3657
|
if (typeof start === "string") {
|
|
3658
3658
|
encoding = start;
|
|
@@ -3663,7 +3663,7 @@ var ExcelTS = (function(exports) {
|
|
|
3663
3663
|
end = this.length;
|
|
3664
3664
|
}
|
|
3665
3665
|
if (encoding !== void 0 && typeof encoding !== "string") throw new TypeError("encoding must be a string");
|
|
3666
|
-
if (typeof encoding === "string" && !Buffer$
|
|
3666
|
+
if (typeof encoding === "string" && !Buffer$68.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
|
|
3667
3667
|
if (val.length === 1) {
|
|
3668
3668
|
var code$1 = val.charCodeAt(0);
|
|
3669
3669
|
if (encoding === "utf8" && code$1 < 128 || encoding === "latin1") val = code$1;
|
|
@@ -3678,7 +3678,7 @@ var ExcelTS = (function(exports) {
|
|
|
3678
3678
|
var i$2;
|
|
3679
3679
|
if (typeof val === "number") for (i$2 = start; i$2 < end; ++i$2) this[i$2] = val;
|
|
3680
3680
|
else {
|
|
3681
|
-
var bytes = Buffer$
|
|
3681
|
+
var bytes = Buffer$68.isBuffer(val) ? val : Buffer$68.from(val, encoding);
|
|
3682
3682
|
var len$1 = bytes.length;
|
|
3683
3683
|
if (len$1 === 0) throw new TypeError("The value \"" + val + "\" is invalid for argument \"value\"");
|
|
3684
3684
|
for (i$2 = 0; i$2 < end - start; ++i$2) this[i$2 + start] = bytes[i$2 % len$1];
|
|
@@ -3993,27 +3993,27 @@ var ExcelTS = (function(exports) {
|
|
|
3993
3993
|
var require_safe_buffer$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3994
3994
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3995
3995
|
var buffer$1 = require_buffer$1();
|
|
3996
|
-
var Buffer$
|
|
3996
|
+
var Buffer$67 = buffer$1.Buffer;
|
|
3997
3997
|
function copyProps$1(src, dst) {
|
|
3998
3998
|
for (var key$1 in src) dst[key$1] = src[key$1];
|
|
3999
3999
|
}
|
|
4000
|
-
if (Buffer$
|
|
4000
|
+
if (Buffer$67.from && Buffer$67.alloc && Buffer$67.allocUnsafe && Buffer$67.allocUnsafeSlow) module.exports = buffer$1;
|
|
4001
4001
|
else {
|
|
4002
4002
|
copyProps$1(buffer$1, exports);
|
|
4003
4003
|
exports.Buffer = SafeBuffer$1;
|
|
4004
4004
|
}
|
|
4005
4005
|
function SafeBuffer$1(arg, encodingOrOffset, length) {
|
|
4006
|
-
return Buffer$
|
|
4006
|
+
return Buffer$67(arg, encodingOrOffset, length);
|
|
4007
4007
|
}
|
|
4008
|
-
SafeBuffer$1.prototype = Object.create(Buffer$
|
|
4009
|
-
copyProps$1(Buffer$
|
|
4008
|
+
SafeBuffer$1.prototype = Object.create(Buffer$67.prototype);
|
|
4009
|
+
copyProps$1(Buffer$67, SafeBuffer$1);
|
|
4010
4010
|
SafeBuffer$1.from = function(arg, encodingOrOffset, length) {
|
|
4011
4011
|
if (typeof arg === "number") throw new TypeError("Argument must not be a number");
|
|
4012
|
-
return Buffer$
|
|
4012
|
+
return Buffer$67(arg, encodingOrOffset, length);
|
|
4013
4013
|
};
|
|
4014
4014
|
SafeBuffer$1.alloc = function(size, fill, encoding) {
|
|
4015
4015
|
if (typeof size !== "number") throw new TypeError("Argument must be a number");
|
|
4016
|
-
var buf = Buffer$
|
|
4016
|
+
var buf = Buffer$67(size);
|
|
4017
4017
|
if (fill !== void 0) if (typeof encoding === "string") buf.fill(fill, encoding);
|
|
4018
4018
|
else buf.fill(fill);
|
|
4019
4019
|
else buf.fill(0);
|
|
@@ -4021,7 +4021,7 @@ var ExcelTS = (function(exports) {
|
|
|
4021
4021
|
};
|
|
4022
4022
|
SafeBuffer$1.allocUnsafe = function(size) {
|
|
4023
4023
|
if (typeof size !== "number") throw new TypeError("Argument must be a number");
|
|
4024
|
-
return Buffer$
|
|
4024
|
+
return Buffer$67(size);
|
|
4025
4025
|
};
|
|
4026
4026
|
SafeBuffer$1.allocUnsafeSlow = function(size) {
|
|
4027
4027
|
if (typeof size !== "number") throw new TypeError("Argument must be a number");
|
|
@@ -4038,13 +4038,13 @@ var ExcelTS = (function(exports) {
|
|
|
4038
4038
|
function oldBrowser$1() {
|
|
4039
4039
|
throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11");
|
|
4040
4040
|
}
|
|
4041
|
-
var Buffer$
|
|
4041
|
+
var Buffer$66 = require_safe_buffer$1().Buffer;
|
|
4042
4042
|
var crypto$4 = global.crypto || global.msCrypto;
|
|
4043
4043
|
if (crypto$4 && crypto$4.getRandomValues) module.exports = randomBytes$4;
|
|
4044
4044
|
else module.exports = oldBrowser$1;
|
|
4045
4045
|
function randomBytes$4(size, cb) {
|
|
4046
4046
|
if (size > MAX_UINT32) throw new RangeError("requested too many random bytes");
|
|
4047
|
-
var bytes = Buffer$
|
|
4047
|
+
var bytes = Buffer$66.allocUnsafe(size);
|
|
4048
4048
|
if (size > 0) if (size > MAX_BYTES) for (var generated = 0; generated < size; generated += MAX_BYTES) crypto$4.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));
|
|
4049
4049
|
else crypto$4.getRandomValues(bytes);
|
|
4050
4050
|
if (typeof cb === "function") return api.nextTick(function() {
|
|
@@ -6271,11 +6271,11 @@ var ExcelTS = (function(exports) {
|
|
|
6271
6271
|
}
|
|
6272
6272
|
return (hint === "string" ? String : Number)(input);
|
|
6273
6273
|
}
|
|
6274
|
-
var Buffer$
|
|
6274
|
+
var Buffer$65 = require_buffer$1().Buffer;
|
|
6275
6275
|
var inspect = require_util$1().inspect;
|
|
6276
6276
|
var custom = inspect && inspect.custom || "inspect";
|
|
6277
6277
|
function copyBuffer$1(src, target, offset) {
|
|
6278
|
-
Buffer$
|
|
6278
|
+
Buffer$65.prototype.copy.call(src, target, offset);
|
|
6279
6279
|
}
|
|
6280
6280
|
module.exports = /* @__PURE__ */ function() {
|
|
6281
6281
|
function BufferList$2() {
|
|
@@ -6341,8 +6341,8 @@ var ExcelTS = (function(exports) {
|
|
|
6341
6341
|
{
|
|
6342
6342
|
key: "concat",
|
|
6343
6343
|
value: function concat(n) {
|
|
6344
|
-
if (this.length === 0) return Buffer$
|
|
6345
|
-
var ret = Buffer$
|
|
6344
|
+
if (this.length === 0) return Buffer$65.alloc(0);
|
|
6345
|
+
var ret = Buffer$65.allocUnsafe(n >>> 0);
|
|
6346
6346
|
var p$1 = this.head;
|
|
6347
6347
|
var i$2 = 0;
|
|
6348
6348
|
while (p$1) {
|
|
@@ -6404,7 +6404,7 @@ var ExcelTS = (function(exports) {
|
|
|
6404
6404
|
{
|
|
6405
6405
|
key: "_getBuffer",
|
|
6406
6406
|
value: function _getBuffer(n) {
|
|
6407
|
-
var ret = Buffer$
|
|
6407
|
+
var ret = Buffer$65.allocUnsafe(n);
|
|
6408
6408
|
var p$1 = this.head;
|
|
6409
6409
|
var c = 1;
|
|
6410
6410
|
p$1.data.copy(ret);
|
|
@@ -6699,13 +6699,13 @@ var ExcelTS = (function(exports) {
|
|
|
6699
6699
|
Writable$3.WritableState = WritableState$1;
|
|
6700
6700
|
var internalUtil$1 = { deprecate: require_browser$10() };
|
|
6701
6701
|
var Stream$4 = require_stream_browser$1();
|
|
6702
|
-
var Buffer$
|
|
6702
|
+
var Buffer$64 = require_buffer$1().Buffer;
|
|
6703
6703
|
var OurUint8Array$3 = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
|
|
6704
6704
|
function _uint8ArrayToBuffer$3(chunk) {
|
|
6705
|
-
return Buffer$
|
|
6705
|
+
return Buffer$64.from(chunk);
|
|
6706
6706
|
}
|
|
6707
6707
|
function _isUint8Array$3(obj) {
|
|
6708
|
-
return Buffer$
|
|
6708
|
+
return Buffer$64.isBuffer(obj) || obj instanceof OurUint8Array$3;
|
|
6709
6709
|
}
|
|
6710
6710
|
var destroyImpl$3 = require_destroy$1();
|
|
6711
6711
|
var getHighWaterMark$1 = require_state().getHighWaterMark;
|
|
@@ -6812,7 +6812,7 @@ var ExcelTS = (function(exports) {
|
|
|
6812
6812
|
var state = this._writableState;
|
|
6813
6813
|
var ret = false;
|
|
6814
6814
|
var isBuf = !state.objectMode && _isUint8Array$3(chunk);
|
|
6815
|
-
if (isBuf && !Buffer$
|
|
6815
|
+
if (isBuf && !Buffer$64.isBuffer(chunk)) chunk = _uint8ArrayToBuffer$3(chunk);
|
|
6816
6816
|
if (typeof encoding === "function") {
|
|
6817
6817
|
cb = encoding;
|
|
6818
6818
|
encoding = null;
|
|
@@ -6862,7 +6862,7 @@ var ExcelTS = (function(exports) {
|
|
|
6862
6862
|
}
|
|
6863
6863
|
});
|
|
6864
6864
|
function decodeChunk$1(state, chunk, encoding) {
|
|
6865
|
-
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer$
|
|
6865
|
+
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer$64.from(chunk, encoding);
|
|
6866
6866
|
return chunk;
|
|
6867
6867
|
}
|
|
6868
6868
|
Object.defineProperty(Writable$3.prototype, "writableHighWaterMark", {
|
|
@@ -7171,8 +7171,8 @@ var ExcelTS = (function(exports) {
|
|
|
7171
7171
|
//#endregion
|
|
7172
7172
|
//#region node_modules/.pnpm/string_decoder@1.3.0/node_modules/string_decoder/lib/string_decoder.js
|
|
7173
7173
|
var require_string_decoder = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
7174
|
-
var Buffer$
|
|
7175
|
-
var isEncoding = Buffer$
|
|
7174
|
+
var Buffer$63 = require_safe_buffer$1().Buffer;
|
|
7175
|
+
var isEncoding = Buffer$63.isEncoding || function(encoding) {
|
|
7176
7176
|
encoding = "" + encoding;
|
|
7177
7177
|
switch (encoding && encoding.toLowerCase()) {
|
|
7178
7178
|
case "hex":
|
|
@@ -7212,7 +7212,7 @@ var ExcelTS = (function(exports) {
|
|
|
7212
7212
|
}
|
|
7213
7213
|
function normalizeEncoding(enc) {
|
|
7214
7214
|
var nenc = _normalizeEncoding(enc);
|
|
7215
|
-
if (typeof nenc !== "string" && (Buffer$
|
|
7215
|
+
if (typeof nenc !== "string" && (Buffer$63.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
7216
7216
|
return nenc || enc;
|
|
7217
7217
|
}
|
|
7218
7218
|
exports.StringDecoder = StringDecoder$3;
|
|
@@ -7241,7 +7241,7 @@ var ExcelTS = (function(exports) {
|
|
|
7241
7241
|
}
|
|
7242
7242
|
this.lastNeed = 0;
|
|
7243
7243
|
this.lastTotal = 0;
|
|
7244
|
-
this.lastChar = Buffer$
|
|
7244
|
+
this.lastChar = Buffer$63.allocUnsafe(nb);
|
|
7245
7245
|
}
|
|
7246
7246
|
StringDecoder$3.prototype.write = function(buf) {
|
|
7247
7247
|
if (buf.length === 0) return "";
|
|
@@ -7666,13 +7666,13 @@ var ExcelTS = (function(exports) {
|
|
|
7666
7666
|
return emitter.listeners(type).length;
|
|
7667
7667
|
};
|
|
7668
7668
|
var Stream$3 = require_stream_browser$1();
|
|
7669
|
-
var Buffer$
|
|
7669
|
+
var Buffer$62 = require_buffer$1().Buffer;
|
|
7670
7670
|
var OurUint8Array$2 = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
|
|
7671
7671
|
function _uint8ArrayToBuffer$2(chunk) {
|
|
7672
|
-
return Buffer$
|
|
7672
|
+
return Buffer$62.from(chunk);
|
|
7673
7673
|
}
|
|
7674
7674
|
function _isUint8Array$2(obj) {
|
|
7675
|
-
return Buffer$
|
|
7675
|
+
return Buffer$62.isBuffer(obj) || obj instanceof OurUint8Array$2;
|
|
7676
7676
|
}
|
|
7677
7677
|
var debugUtil$1 = require_util$1();
|
|
7678
7678
|
var debug$1;
|
|
@@ -7770,7 +7770,7 @@ var ExcelTS = (function(exports) {
|
|
|
7770
7770
|
if (typeof chunk === "string") {
|
|
7771
7771
|
encoding = encoding || state.defaultEncoding;
|
|
7772
7772
|
if (encoding !== state.encoding) {
|
|
7773
|
-
chunk = Buffer$
|
|
7773
|
+
chunk = Buffer$62.from(chunk, encoding);
|
|
7774
7774
|
encoding = "";
|
|
7775
7775
|
}
|
|
7776
7776
|
skipChunkCheck = true;
|
|
@@ -7792,7 +7792,7 @@ var ExcelTS = (function(exports) {
|
|
|
7792
7792
|
if (!skipChunkCheck) er = chunkInvalid$1(state, chunk);
|
|
7793
7793
|
if (er) errorOrDestroy(stream$1, er);
|
|
7794
7794
|
else if (state.objectMode || chunk && chunk.length > 0) {
|
|
7795
|
-
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer$
|
|
7795
|
+
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer$62.prototype) chunk = _uint8ArrayToBuffer$2(chunk);
|
|
7796
7796
|
if (addToFront) if (state.endEmitted) errorOrDestroy(stream$1, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
|
|
7797
7797
|
else addChunk$1(stream$1, state, chunk, true);
|
|
7798
7798
|
else if (state.ended) errorOrDestroy(stream$1, new ERR_STREAM_PUSH_AFTER_EOF());
|
|
@@ -8557,12 +8557,12 @@ var ExcelTS = (function(exports) {
|
|
|
8557
8557
|
//#endregion
|
|
8558
8558
|
//#region node_modules/.pnpm/hash-base@3.0.5/node_modules/hash-base/index.js
|
|
8559
8559
|
var require_hash_base$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
8560
|
-
var Buffer$
|
|
8560
|
+
var Buffer$61 = require_safe_buffer$1().Buffer;
|
|
8561
8561
|
var Transform$8 = require_stream_browserify().Transform;
|
|
8562
8562
|
var inherits$34 = require_inherits_browser();
|
|
8563
8563
|
function HashBase$3(blockSize$1) {
|
|
8564
8564
|
Transform$8.call(this);
|
|
8565
|
-
this._block = Buffer$
|
|
8565
|
+
this._block = Buffer$61.allocUnsafe(blockSize$1);
|
|
8566
8566
|
this._blockSize = blockSize$1;
|
|
8567
8567
|
this._blockOffset = 0;
|
|
8568
8568
|
this._length = [
|
|
@@ -8593,17 +8593,17 @@ var ExcelTS = (function(exports) {
|
|
|
8593
8593
|
callback(error);
|
|
8594
8594
|
};
|
|
8595
8595
|
var useUint8Array$3 = typeof Uint8Array !== "undefined";
|
|
8596
|
-
var useArrayBuffer$1 = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && ArrayBuffer.isView && (Buffer$
|
|
8596
|
+
var useArrayBuffer$1 = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && ArrayBuffer.isView && (Buffer$61.prototype instanceof Uint8Array || Buffer$61.TYPED_ARRAY_SUPPORT);
|
|
8597
8597
|
function toBuffer$7(data, encoding) {
|
|
8598
|
-
if (data instanceof Buffer$
|
|
8599
|
-
if (typeof data === "string") return Buffer$
|
|
8598
|
+
if (data instanceof Buffer$61) return data;
|
|
8599
|
+
if (typeof data === "string") return Buffer$61.from(data, encoding);
|
|
8600
8600
|
if (useArrayBuffer$1 && ArrayBuffer.isView(data)) {
|
|
8601
|
-
if (data.byteLength === 0) return Buffer$
|
|
8602
|
-
var res = Buffer$
|
|
8601
|
+
if (data.byteLength === 0) return Buffer$61.alloc(0);
|
|
8602
|
+
var res = Buffer$61.from(data.buffer, data.byteOffset, data.byteLength);
|
|
8603
8603
|
if (res.byteLength === data.byteLength) return res;
|
|
8604
8604
|
}
|
|
8605
|
-
if (useUint8Array$3 && data instanceof Uint8Array) return Buffer$
|
|
8606
|
-
if (Buffer$
|
|
8605
|
+
if (useUint8Array$3 && data instanceof Uint8Array) return Buffer$61.from(data);
|
|
8606
|
+
if (Buffer$61.isBuffer(data) && data.constructor && typeof data.constructor.isBuffer === "function" && data.constructor.isBuffer(data)) return Buffer$61.from(data);
|
|
8607
8607
|
throw new TypeError("The \"data\" argument must be of type string or an instance of Buffer, TypedArray, or DataView.");
|
|
8608
8608
|
}
|
|
8609
8609
|
HashBase$3.prototype.update = function(data, encoding) {
|
|
@@ -8648,7 +8648,7 @@ var ExcelTS = (function(exports) {
|
|
|
8648
8648
|
var require_md5$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
8649
8649
|
var inherits$33 = require_inherits_browser();
|
|
8650
8650
|
var HashBase$2 = require_hash_base$1();
|
|
8651
|
-
var Buffer$
|
|
8651
|
+
var Buffer$60 = require_safe_buffer$1().Buffer;
|
|
8652
8652
|
var ARRAY16$1 = new Array(16);
|
|
8653
8653
|
function MD5$3() {
|
|
8654
8654
|
HashBase$2.call(this, 64);
|
|
@@ -8745,7 +8745,7 @@ var ExcelTS = (function(exports) {
|
|
|
8745
8745
|
this._block.writeUInt32LE(this._length[0], 56);
|
|
8746
8746
|
this._block.writeUInt32LE(this._length[1], 60);
|
|
8747
8747
|
this._update();
|
|
8748
|
-
var buffer$2 = Buffer$
|
|
8748
|
+
var buffer$2 = Buffer$60.allocUnsafe(16);
|
|
8749
8749
|
buffer$2.writeInt32LE(this._a, 0);
|
|
8750
8750
|
buffer$2.writeInt32LE(this._b, 4);
|
|
8751
8751
|
buffer$2.writeInt32LE(this._c, 8);
|
|
@@ -8796,7 +8796,7 @@ var ExcelTS = (function(exports) {
|
|
|
8796
8796
|
//#endregion
|
|
8797
8797
|
//#region node_modules/.pnpm/to-buffer@1.2.2/node_modules/to-buffer/index.js
|
|
8798
8798
|
var require_to_buffer$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
8799
|
-
var Buffer$
|
|
8799
|
+
var Buffer$59 = require_safe_buffer$1().Buffer;
|
|
8800
8800
|
var isArray$3 = require_isarray$1();
|
|
8801
8801
|
var typedArrayBuffer = require_typed_array_buffer();
|
|
8802
8802
|
var isView$2 = ArrayBuffer.isView || function isView$3(obj) {
|
|
@@ -8809,30 +8809,30 @@ var ExcelTS = (function(exports) {
|
|
|
8809
8809
|
};
|
|
8810
8810
|
var useUint8Array$2 = typeof Uint8Array !== "undefined";
|
|
8811
8811
|
var useArrayBuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
|
|
8812
|
-
var useFromArrayBuffer = useArrayBuffer && (Buffer$
|
|
8812
|
+
var useFromArrayBuffer = useArrayBuffer && (Buffer$59.prototype instanceof Uint8Array || Buffer$59.TYPED_ARRAY_SUPPORT);
|
|
8813
8813
|
module.exports = function toBuffer$8(data, encoding) {
|
|
8814
|
-
if (Buffer$
|
|
8815
|
-
if (data.constructor && !("isBuffer" in data)) return Buffer$
|
|
8814
|
+
if (Buffer$59.isBuffer(data)) {
|
|
8815
|
+
if (data.constructor && !("isBuffer" in data)) return Buffer$59.from(data);
|
|
8816
8816
|
return data;
|
|
8817
8817
|
}
|
|
8818
|
-
if (typeof data === "string") return Buffer$
|
|
8818
|
+
if (typeof data === "string") return Buffer$59.from(data, encoding);
|
|
8819
8819
|
if (useArrayBuffer && isView$2(data)) {
|
|
8820
|
-
if (data.byteLength === 0) return Buffer$
|
|
8820
|
+
if (data.byteLength === 0) return Buffer$59.alloc(0);
|
|
8821
8821
|
if (useFromArrayBuffer) {
|
|
8822
|
-
var res = Buffer$
|
|
8822
|
+
var res = Buffer$59.from(data.buffer, data.byteOffset, data.byteLength);
|
|
8823
8823
|
if (res.byteLength === data.byteLength) return res;
|
|
8824
8824
|
}
|
|
8825
8825
|
var uint8 = data instanceof Uint8Array ? data : new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
8826
|
-
var result = Buffer$
|
|
8826
|
+
var result = Buffer$59.from(uint8);
|
|
8827
8827
|
if (result.length === data.byteLength) return result;
|
|
8828
8828
|
}
|
|
8829
|
-
if (useUint8Array$2 && data instanceof Uint8Array) return Buffer$
|
|
8829
|
+
if (useUint8Array$2 && data instanceof Uint8Array) return Buffer$59.from(data);
|
|
8830
8830
|
var isArr = isArray$3(data);
|
|
8831
8831
|
if (isArr) for (var i$2 = 0; i$2 < data.length; i$2 += 1) {
|
|
8832
8832
|
var x$1 = data[i$2];
|
|
8833
8833
|
if (typeof x$1 !== "number" || x$1 < 0 || x$1 > 255 || ~~x$1 !== x$1) throw new RangeError("Array items must be numbers in the range 0-255.");
|
|
8834
8834
|
}
|
|
8835
|
-
if (isArr || Buffer$
|
|
8835
|
+
if (isArr || Buffer$59.isBuffer(data) && data.constructor && typeof data.constructor.isBuffer === "function" && data.constructor.isBuffer(data)) return Buffer$59.from(data);
|
|
8836
8836
|
throw new TypeError("The \"data\" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.");
|
|
8837
8837
|
};
|
|
8838
8838
|
}));
|
|
@@ -8840,12 +8840,12 @@ var ExcelTS = (function(exports) {
|
|
|
8840
8840
|
//#endregion
|
|
8841
8841
|
//#region node_modules/.pnpm/hash-base@3.1.2/node_modules/hash-base/to-buffer.js
|
|
8842
8842
|
var require_to_buffer$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
8843
|
-
var Buffer$
|
|
8843
|
+
var Buffer$58 = require_safe_buffer$1().Buffer;
|
|
8844
8844
|
var toBuffer$6 = require_to_buffer$2();
|
|
8845
8845
|
var useUint8Array$1 = typeof Uint8Array !== "undefined";
|
|
8846
8846
|
var isView$1 = useUint8Array$1 && typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView;
|
|
8847
8847
|
module.exports = function(thing, encoding) {
|
|
8848
|
-
if (typeof thing === "string" || Buffer$
|
|
8848
|
+
if (typeof thing === "string" || Buffer$58.isBuffer(thing) || useUint8Array$1 && thing instanceof Uint8Array || isView$1 && isView$1(thing)) return toBuffer$6(thing, encoding);
|
|
8849
8849
|
throw new TypeError("The \"data\" argument must be a string, a Buffer, a Uint8Array, or a DataView");
|
|
8850
8850
|
};
|
|
8851
8851
|
}));
|
|
@@ -8902,26 +8902,26 @@ var ExcelTS = (function(exports) {
|
|
|
8902
8902
|
//#region node_modules/.pnpm/safe-buffer@5.1.2/node_modules/safe-buffer/index.js
|
|
8903
8903
|
var require_safe_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
8904
8904
|
var buffer = require_buffer$1();
|
|
8905
|
-
var Buffer$
|
|
8905
|
+
var Buffer$57 = buffer.Buffer;
|
|
8906
8906
|
function copyProps(src, dst) {
|
|
8907
8907
|
for (var key$1 in src) dst[key$1] = src[key$1];
|
|
8908
8908
|
}
|
|
8909
|
-
if (Buffer$
|
|
8909
|
+
if (Buffer$57.from && Buffer$57.alloc && Buffer$57.allocUnsafe && Buffer$57.allocUnsafeSlow) module.exports = buffer;
|
|
8910
8910
|
else {
|
|
8911
8911
|
copyProps(buffer, exports);
|
|
8912
8912
|
exports.Buffer = SafeBuffer;
|
|
8913
8913
|
}
|
|
8914
8914
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
8915
|
-
return Buffer$
|
|
8915
|
+
return Buffer$57(arg, encodingOrOffset, length);
|
|
8916
8916
|
}
|
|
8917
|
-
copyProps(Buffer$
|
|
8917
|
+
copyProps(Buffer$57, SafeBuffer);
|
|
8918
8918
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
8919
8919
|
if (typeof arg === "number") throw new TypeError("Argument must not be a number");
|
|
8920
|
-
return Buffer$
|
|
8920
|
+
return Buffer$57(arg, encodingOrOffset, length);
|
|
8921
8921
|
};
|
|
8922
8922
|
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
8923
8923
|
if (typeof size !== "number") throw new TypeError("Argument must be a number");
|
|
8924
|
-
var buf = Buffer$
|
|
8924
|
+
var buf = Buffer$57(size);
|
|
8925
8925
|
if (fill !== void 0) if (typeof encoding === "string") buf.fill(fill, encoding);
|
|
8926
8926
|
else buf.fill(fill);
|
|
8927
8927
|
else buf.fill(0);
|
|
@@ -8929,7 +8929,7 @@ var ExcelTS = (function(exports) {
|
|
|
8929
8929
|
};
|
|
8930
8930
|
SafeBuffer.allocUnsafe = function(size) {
|
|
8931
8931
|
if (typeof size !== "number") throw new TypeError("Argument must be a number");
|
|
8932
|
-
return Buffer$
|
|
8932
|
+
return Buffer$57(size);
|
|
8933
8933
|
};
|
|
8934
8934
|
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
8935
8935
|
if (typeof size !== "number") throw new TypeError("Argument must be a number");
|
|
@@ -9009,7 +9009,7 @@ var ExcelTS = (function(exports) {
|
|
|
9009
9009
|
function _classCallCheck(instance, Constructor) {
|
|
9010
9010
|
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
9011
9011
|
}
|
|
9012
|
-
var Buffer$
|
|
9012
|
+
var Buffer$56 = require_safe_buffer().Buffer;
|
|
9013
9013
|
var util$5 = require_util$1();
|
|
9014
9014
|
function copyBuffer(src, target, offset) {
|
|
9015
9015
|
src.copy(target, offset);
|
|
@@ -9060,8 +9060,8 @@ var ExcelTS = (function(exports) {
|
|
|
9060
9060
|
return ret;
|
|
9061
9061
|
};
|
|
9062
9062
|
BufferList$2.prototype.concat = function concat(n) {
|
|
9063
|
-
if (this.length === 0) return Buffer$
|
|
9064
|
-
var ret = Buffer$
|
|
9063
|
+
if (this.length === 0) return Buffer$56.alloc(0);
|
|
9064
|
+
var ret = Buffer$56.allocUnsafe(n >>> 0);
|
|
9065
9065
|
var p$1 = this.head;
|
|
9066
9066
|
var i$2 = 0;
|
|
9067
9067
|
while (p$1) {
|
|
@@ -9158,13 +9158,13 @@ var ExcelTS = (function(exports) {
|
|
|
9158
9158
|
util$4.inherits = require_inherits_browser();
|
|
9159
9159
|
var internalUtil = { deprecate: require_browser$10() };
|
|
9160
9160
|
var Stream$1 = require_stream_browser();
|
|
9161
|
-
var Buffer$
|
|
9161
|
+
var Buffer$55 = require_safe_buffer().Buffer;
|
|
9162
9162
|
var OurUint8Array$1 = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
|
|
9163
9163
|
function _uint8ArrayToBuffer$1(chunk) {
|
|
9164
|
-
return Buffer$
|
|
9164
|
+
return Buffer$55.from(chunk);
|
|
9165
9165
|
}
|
|
9166
9166
|
function _isUint8Array$1(obj) {
|
|
9167
|
-
return Buffer$
|
|
9167
|
+
return Buffer$55.isBuffer(obj) || obj instanceof OurUint8Array$1;
|
|
9168
9168
|
}
|
|
9169
9169
|
var destroyImpl$1 = require_destroy();
|
|
9170
9170
|
util$4.inherits(Writable$1, Stream$1);
|
|
@@ -9272,7 +9272,7 @@ var ExcelTS = (function(exports) {
|
|
|
9272
9272
|
var state = this._writableState;
|
|
9273
9273
|
var ret = false;
|
|
9274
9274
|
var isBuf = !state.objectMode && _isUint8Array$1(chunk);
|
|
9275
|
-
if (isBuf && !Buffer$
|
|
9275
|
+
if (isBuf && !Buffer$55.isBuffer(chunk)) chunk = _uint8ArrayToBuffer$1(chunk);
|
|
9276
9276
|
if (typeof encoding === "function") {
|
|
9277
9277
|
cb = encoding;
|
|
9278
9278
|
encoding = null;
|
|
@@ -9317,7 +9317,7 @@ var ExcelTS = (function(exports) {
|
|
|
9317
9317
|
return this;
|
|
9318
9318
|
};
|
|
9319
9319
|
function decodeChunk(state, chunk, encoding) {
|
|
9320
|
-
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer$
|
|
9320
|
+
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer$55.from(chunk, encoding);
|
|
9321
9321
|
return chunk;
|
|
9322
9322
|
}
|
|
9323
9323
|
Object.defineProperty(Writable$1.prototype, "writableHighWaterMark", {
|
|
@@ -9614,13 +9614,13 @@ var ExcelTS = (function(exports) {
|
|
|
9614
9614
|
return emitter.listeners(type).length;
|
|
9615
9615
|
};
|
|
9616
9616
|
var Stream = require_stream_browser();
|
|
9617
|
-
var Buffer$
|
|
9617
|
+
var Buffer$54 = require_safe_buffer().Buffer;
|
|
9618
9618
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
|
|
9619
9619
|
function _uint8ArrayToBuffer(chunk) {
|
|
9620
|
-
return Buffer$
|
|
9620
|
+
return Buffer$54.from(chunk);
|
|
9621
9621
|
}
|
|
9622
9622
|
function _isUint8Array(obj) {
|
|
9623
|
-
return Buffer$
|
|
9623
|
+
return Buffer$54.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
9624
9624
|
}
|
|
9625
9625
|
var util$2 = Object.create(require_util());
|
|
9626
9626
|
util$2.inherits = require_inherits_browser();
|
|
@@ -9717,7 +9717,7 @@ var ExcelTS = (function(exports) {
|
|
|
9717
9717
|
if (typeof chunk === "string") {
|
|
9718
9718
|
encoding = encoding || state.defaultEncoding;
|
|
9719
9719
|
if (encoding !== state.encoding) {
|
|
9720
|
-
chunk = Buffer$
|
|
9720
|
+
chunk = Buffer$54.from(chunk, encoding);
|
|
9721
9721
|
encoding = "";
|
|
9722
9722
|
}
|
|
9723
9723
|
skipChunkCheck = true;
|
|
@@ -9738,7 +9738,7 @@ var ExcelTS = (function(exports) {
|
|
|
9738
9738
|
if (!skipChunkCheck) er = chunkInvalid(state, chunk);
|
|
9739
9739
|
if (er) stream$1.emit("error", er);
|
|
9740
9740
|
else if (state.objectMode || chunk && chunk.length > 0) {
|
|
9741
|
-
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer$
|
|
9741
|
+
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer$54.prototype) chunk = _uint8ArrayToBuffer(chunk);
|
|
9742
9742
|
if (addToFront) if (state.endEmitted) stream$1.emit("error", /* @__PURE__ */ new Error("stream.unshift() after end event"));
|
|
9743
9743
|
else addChunk(stream$1, state, chunk, true);
|
|
9744
9744
|
else if (state.ended) stream$1.emit("error", /* @__PURE__ */ new Error("stream.push() after EOF"));
|
|
@@ -10191,7 +10191,7 @@ var ExcelTS = (function(exports) {
|
|
|
10191
10191
|
return ret;
|
|
10192
10192
|
}
|
|
10193
10193
|
function copyFromBuffer(n, list) {
|
|
10194
|
-
var ret = Buffer$
|
|
10194
|
+
var ret = Buffer$54.allocUnsafe(n);
|
|
10195
10195
|
var p$1 = list.head;
|
|
10196
10196
|
var c = 1;
|
|
10197
10197
|
p$1.data.copy(ret);
|
|
@@ -10357,13 +10357,13 @@ var ExcelTS = (function(exports) {
|
|
|
10357
10357
|
//#endregion
|
|
10358
10358
|
//#region node_modules/.pnpm/hash-base@3.1.2/node_modules/hash-base/index.js
|
|
10359
10359
|
var require_hash_base = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10360
|
-
var Buffer$
|
|
10360
|
+
var Buffer$53 = require_safe_buffer$1().Buffer;
|
|
10361
10361
|
var toBuffer$5 = require_to_buffer$1();
|
|
10362
10362
|
var Transform$5 = require_readable_browser().Transform;
|
|
10363
10363
|
var inherits$32 = require_inherits_browser();
|
|
10364
10364
|
function HashBase$1(blockSize$1) {
|
|
10365
10365
|
Transform$5.call(this);
|
|
10366
|
-
this._block = Buffer$
|
|
10366
|
+
this._block = Buffer$53.allocUnsafe(blockSize$1);
|
|
10367
10367
|
this._blockSize = blockSize$1;
|
|
10368
10368
|
this._blockOffset = 0;
|
|
10369
10369
|
this._length = [
|
|
@@ -10441,7 +10441,7 @@ var ExcelTS = (function(exports) {
|
|
|
10441
10441
|
//#endregion
|
|
10442
10442
|
//#region node_modules/.pnpm/ripemd160@2.0.3/node_modules/ripemd160/index.js
|
|
10443
10443
|
var require_ripemd160 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10444
|
-
var Buffer$
|
|
10444
|
+
var Buffer$52 = require_buffer$1().Buffer;
|
|
10445
10445
|
var inherits$31 = require_inherits_browser();
|
|
10446
10446
|
var HashBase = require_hash_base();
|
|
10447
10447
|
var ARRAY16 = new Array(16);
|
|
@@ -10876,7 +10876,7 @@ var ExcelTS = (function(exports) {
|
|
|
10876
10876
|
this._block.writeUInt32LE(this._length[0], 56);
|
|
10877
10877
|
this._block.writeUInt32LE(this._length[1], 60);
|
|
10878
10878
|
this._update();
|
|
10879
|
-
var buffer$2 = Buffer$
|
|
10879
|
+
var buffer$2 = Buffer$52.alloc ? Buffer$52.alloc(20) : new Buffer$52(20);
|
|
10880
10880
|
buffer$2.writeInt32LE(this._a, 0);
|
|
10881
10881
|
buffer$2.writeInt32LE(this._b, 4);
|
|
10882
10882
|
buffer$2.writeInt32LE(this._c, 8);
|
|
@@ -10890,10 +10890,10 @@ var ExcelTS = (function(exports) {
|
|
|
10890
10890
|
//#endregion
|
|
10891
10891
|
//#region node_modules/.pnpm/sha.js@2.4.12/node_modules/sha.js/hash.js
|
|
10892
10892
|
var require_hash$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10893
|
-
var Buffer$
|
|
10893
|
+
var Buffer$51 = require_safe_buffer$1().Buffer;
|
|
10894
10894
|
var toBuffer$4 = require_to_buffer$2();
|
|
10895
10895
|
function Hash$9(blockSize$1, finalSize) {
|
|
10896
|
-
this._block = Buffer$
|
|
10896
|
+
this._block = Buffer$51.alloc(blockSize$1);
|
|
10897
10897
|
this._finalSize = finalSize;
|
|
10898
10898
|
this._blockSize = blockSize$1;
|
|
10899
10899
|
this._len = 0;
|
|
@@ -10946,7 +10946,7 @@ var ExcelTS = (function(exports) {
|
|
|
10946
10946
|
var require_sha$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10947
10947
|
var inherits$30 = require_inherits_browser();
|
|
10948
10948
|
var Hash$8 = require_hash$1();
|
|
10949
|
-
var Buffer$
|
|
10949
|
+
var Buffer$50 = require_safe_buffer$1().Buffer;
|
|
10950
10950
|
var K$4 = [
|
|
10951
10951
|
1518500249,
|
|
10952
10952
|
1859775393,
|
|
@@ -11004,7 +11004,7 @@ var ExcelTS = (function(exports) {
|
|
|
11004
11004
|
this._e = e + this._e | 0;
|
|
11005
11005
|
};
|
|
11006
11006
|
Sha.prototype._hash = function() {
|
|
11007
|
-
var H = Buffer$
|
|
11007
|
+
var H = Buffer$50.allocUnsafe(20);
|
|
11008
11008
|
H.writeInt32BE(this._a | 0, 0);
|
|
11009
11009
|
H.writeInt32BE(this._b | 0, 4);
|
|
11010
11010
|
H.writeInt32BE(this._c | 0, 8);
|
|
@@ -11020,7 +11020,7 @@ var ExcelTS = (function(exports) {
|
|
|
11020
11020
|
var require_sha1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11021
11021
|
var inherits$29 = require_inherits_browser();
|
|
11022
11022
|
var Hash$7 = require_hash$1();
|
|
11023
|
-
var Buffer$
|
|
11023
|
+
var Buffer$49 = require_safe_buffer$1().Buffer;
|
|
11024
11024
|
var K$3 = [
|
|
11025
11025
|
1518500249,
|
|
11026
11026
|
1859775393,
|
|
@@ -11081,7 +11081,7 @@ var ExcelTS = (function(exports) {
|
|
|
11081
11081
|
this._e = e + this._e | 0;
|
|
11082
11082
|
};
|
|
11083
11083
|
Sha1.prototype._hash = function() {
|
|
11084
|
-
var H = Buffer$
|
|
11084
|
+
var H = Buffer$49.allocUnsafe(20);
|
|
11085
11085
|
H.writeInt32BE(this._a | 0, 0);
|
|
11086
11086
|
H.writeInt32BE(this._b | 0, 4);
|
|
11087
11087
|
H.writeInt32BE(this._c | 0, 8);
|
|
@@ -11104,7 +11104,7 @@ var ExcelTS = (function(exports) {
|
|
|
11104
11104
|
*/
|
|
11105
11105
|
var inherits$28 = require_inherits_browser();
|
|
11106
11106
|
var Hash$6 = require_hash$1();
|
|
11107
|
-
var Buffer$
|
|
11107
|
+
var Buffer$48 = require_safe_buffer$1().Buffer;
|
|
11108
11108
|
var K$2 = [
|
|
11109
11109
|
1116352408,
|
|
11110
11110
|
1899447441,
|
|
@@ -11241,7 +11241,7 @@ var ExcelTS = (function(exports) {
|
|
|
11241
11241
|
this._h = h + this._h | 0;
|
|
11242
11242
|
};
|
|
11243
11243
|
Sha256$1.prototype._hash = function() {
|
|
11244
|
-
var H = Buffer$
|
|
11244
|
+
var H = Buffer$48.allocUnsafe(32);
|
|
11245
11245
|
H.writeInt32BE(this._a, 0);
|
|
11246
11246
|
H.writeInt32BE(this._b, 4);
|
|
11247
11247
|
H.writeInt32BE(this._c, 8);
|
|
@@ -11268,7 +11268,7 @@ var ExcelTS = (function(exports) {
|
|
|
11268
11268
|
var inherits$27 = require_inherits_browser();
|
|
11269
11269
|
var Sha256 = require_sha256();
|
|
11270
11270
|
var Hash$5 = require_hash$1();
|
|
11271
|
-
var Buffer$
|
|
11271
|
+
var Buffer$47 = require_safe_buffer$1().Buffer;
|
|
11272
11272
|
var W$2 = new Array(64);
|
|
11273
11273
|
function Sha224() {
|
|
11274
11274
|
this.init();
|
|
@@ -11288,7 +11288,7 @@ var ExcelTS = (function(exports) {
|
|
|
11288
11288
|
return this;
|
|
11289
11289
|
};
|
|
11290
11290
|
Sha224.prototype._hash = function() {
|
|
11291
|
-
var H = Buffer$
|
|
11291
|
+
var H = Buffer$47.allocUnsafe(28);
|
|
11292
11292
|
H.writeInt32BE(this._a, 0);
|
|
11293
11293
|
H.writeInt32BE(this._b, 4);
|
|
11294
11294
|
H.writeInt32BE(this._c, 8);
|
|
@@ -11306,7 +11306,7 @@ var ExcelTS = (function(exports) {
|
|
|
11306
11306
|
var require_sha512 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11307
11307
|
var inherits$26 = require_inherits_browser();
|
|
11308
11308
|
var Hash$4 = require_hash$1();
|
|
11309
|
-
var Buffer$
|
|
11309
|
+
var Buffer$46 = require_safe_buffer$1().Buffer;
|
|
11310
11310
|
var K$1 = [
|
|
11311
11311
|
1116352408,
|
|
11312
11312
|
3609767458,
|
|
@@ -11624,7 +11624,7 @@ var ExcelTS = (function(exports) {
|
|
|
11624
11624
|
this._hh = this._hh + hh + getCarry(this._hl, hl$1) | 0;
|
|
11625
11625
|
};
|
|
11626
11626
|
Sha512.prototype._hash = function() {
|
|
11627
|
-
var H = Buffer$
|
|
11627
|
+
var H = Buffer$46.allocUnsafe(64);
|
|
11628
11628
|
function writeInt64BE(h, l, offset) {
|
|
11629
11629
|
H.writeInt32BE(h, offset);
|
|
11630
11630
|
H.writeInt32BE(l, offset + 4);
|
|
@@ -11648,7 +11648,7 @@ var ExcelTS = (function(exports) {
|
|
|
11648
11648
|
var inherits$25 = require_inherits_browser();
|
|
11649
11649
|
var SHA512$2 = require_sha512();
|
|
11650
11650
|
var Hash$3 = require_hash$1();
|
|
11651
|
-
var Buffer$
|
|
11651
|
+
var Buffer$45 = require_safe_buffer$1().Buffer;
|
|
11652
11652
|
var W = new Array(160);
|
|
11653
11653
|
function Sha384() {
|
|
11654
11654
|
this.init();
|
|
@@ -11676,7 +11676,7 @@ var ExcelTS = (function(exports) {
|
|
|
11676
11676
|
return this;
|
|
11677
11677
|
};
|
|
11678
11678
|
Sha384.prototype._hash = function() {
|
|
11679
|
-
var H = Buffer$
|
|
11679
|
+
var H = Buffer$45.allocUnsafe(48);
|
|
11680
11680
|
function writeInt64BE(h, l, offset) {
|
|
11681
11681
|
H.writeInt32BE(h, offset);
|
|
11682
11682
|
H.writeInt32BE(l, offset + 4);
|
|
@@ -11712,7 +11712,7 @@ var ExcelTS = (function(exports) {
|
|
|
11712
11712
|
//#endregion
|
|
11713
11713
|
//#region node_modules/.pnpm/cipher-base@1.0.7/node_modules/cipher-base/index.js
|
|
11714
11714
|
var require_cipher_base = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11715
|
-
var Buffer$
|
|
11715
|
+
var Buffer$44 = require_safe_buffer$1().Buffer;
|
|
11716
11716
|
var Transform$4 = require_stream_browserify().Transform;
|
|
11717
11717
|
var StringDecoder = require_string_decoder().StringDecoder;
|
|
11718
11718
|
var inherits$24 = require_inherits_browser();
|
|
@@ -11768,7 +11768,7 @@ var ExcelTS = (function(exports) {
|
|
|
11768
11768
|
done$2(err$1);
|
|
11769
11769
|
};
|
|
11770
11770
|
CipherBase$1.prototype._finalOrDigest = function(outputEnc) {
|
|
11771
|
-
var outData = this.__final() || Buffer$
|
|
11771
|
+
var outData = this.__final() || Buffer$44.alloc(0);
|
|
11772
11772
|
if (outputEnc) outData = this._toString(outData, outputEnc, true);
|
|
11773
11773
|
return outData;
|
|
11774
11774
|
};
|
|
@@ -11816,19 +11816,19 @@ var ExcelTS = (function(exports) {
|
|
|
11816
11816
|
//#region node_modules/.pnpm/create-hmac@1.1.7/node_modules/create-hmac/legacy.js
|
|
11817
11817
|
var require_legacy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11818
11818
|
var inherits$22 = require_inherits_browser();
|
|
11819
|
-
var Buffer$
|
|
11819
|
+
var Buffer$43 = require_safe_buffer$1().Buffer;
|
|
11820
11820
|
var Base$4 = require_cipher_base();
|
|
11821
|
-
var ZEROS$2 = Buffer$
|
|
11821
|
+
var ZEROS$2 = Buffer$43.alloc(128);
|
|
11822
11822
|
var blocksize = 64;
|
|
11823
11823
|
function Hmac$3(alg, key$1) {
|
|
11824
11824
|
Base$4.call(this, "digest");
|
|
11825
|
-
if (typeof key$1 === "string") key$1 = Buffer$
|
|
11825
|
+
if (typeof key$1 === "string") key$1 = Buffer$43.from(key$1);
|
|
11826
11826
|
this._alg = alg;
|
|
11827
11827
|
this._key = key$1;
|
|
11828
11828
|
if (key$1.length > blocksize) key$1 = alg(key$1);
|
|
11829
|
-
else if (key$1.length < blocksize) key$1 = Buffer$
|
|
11830
|
-
var ipad = this._ipad = Buffer$
|
|
11831
|
-
var opad = this._opad = Buffer$
|
|
11829
|
+
else if (key$1.length < blocksize) key$1 = Buffer$43.concat([key$1, ZEROS$2], blocksize);
|
|
11830
|
+
var ipad = this._ipad = Buffer$43.allocUnsafe(blocksize);
|
|
11831
|
+
var opad = this._opad = Buffer$43.allocUnsafe(blocksize);
|
|
11832
11832
|
for (var i$2 = 0; i$2 < blocksize; i$2++) {
|
|
11833
11833
|
ipad[i$2] = key$1[i$2] ^ 54;
|
|
11834
11834
|
opad[i$2] = key$1[i$2] ^ 92;
|
|
@@ -11840,8 +11840,8 @@ var ExcelTS = (function(exports) {
|
|
|
11840
11840
|
this._hash.push(data);
|
|
11841
11841
|
};
|
|
11842
11842
|
Hmac$3.prototype._final = function() {
|
|
11843
|
-
var h = this._alg(Buffer$
|
|
11844
|
-
return this._alg(Buffer$
|
|
11843
|
+
var h = this._alg(Buffer$43.concat(this._hash));
|
|
11844
|
+
return this._alg(Buffer$43.concat([this._opad, h]));
|
|
11845
11845
|
};
|
|
11846
11846
|
module.exports = Hmac$3;
|
|
11847
11847
|
}));
|
|
@@ -11861,21 +11861,21 @@ var ExcelTS = (function(exports) {
|
|
|
11861
11861
|
var inherits$21 = require_inherits_browser();
|
|
11862
11862
|
var Legacy = require_legacy();
|
|
11863
11863
|
var Base$3 = require_cipher_base();
|
|
11864
|
-
var Buffer$
|
|
11864
|
+
var Buffer$42 = require_safe_buffer$1().Buffer;
|
|
11865
11865
|
var md5$1 = require_md5();
|
|
11866
11866
|
var RIPEMD160$2 = require_ripemd160();
|
|
11867
11867
|
var sha$1 = require_sha$1();
|
|
11868
|
-
var ZEROS$1 = Buffer$
|
|
11868
|
+
var ZEROS$1 = Buffer$42.alloc(128);
|
|
11869
11869
|
function Hmac$2(alg, key$1) {
|
|
11870
11870
|
Base$3.call(this, "digest");
|
|
11871
|
-
if (typeof key$1 === "string") key$1 = Buffer$
|
|
11871
|
+
if (typeof key$1 === "string") key$1 = Buffer$42.from(key$1);
|
|
11872
11872
|
var blocksize$1 = alg === "sha512" || alg === "sha384" ? 128 : 64;
|
|
11873
11873
|
this._alg = alg;
|
|
11874
11874
|
this._key = key$1;
|
|
11875
11875
|
if (key$1.length > blocksize$1) key$1 = (alg === "rmd160" ? new RIPEMD160$2() : sha$1(alg)).update(key$1).digest();
|
|
11876
|
-
else if (key$1.length < blocksize$1) key$1 = Buffer$
|
|
11877
|
-
var ipad = this._ipad = Buffer$
|
|
11878
|
-
var opad = this._opad = Buffer$
|
|
11876
|
+
else if (key$1.length < blocksize$1) key$1 = Buffer$42.concat([key$1, ZEROS$1], blocksize$1);
|
|
11877
|
+
var ipad = this._ipad = Buffer$42.allocUnsafe(blocksize$1);
|
|
11878
|
+
var opad = this._opad = Buffer$42.allocUnsafe(blocksize$1);
|
|
11879
11879
|
for (var i$2 = 0; i$2 < blocksize$1; i$2++) {
|
|
11880
11880
|
ipad[i$2] = key$1[i$2] ^ 54;
|
|
11881
11881
|
opad[i$2] = key$1[i$2] ^ 92;
|
|
@@ -12090,12 +12090,12 @@ var ExcelTS = (function(exports) {
|
|
|
12090
12090
|
//#endregion
|
|
12091
12091
|
//#region node_modules/.pnpm/pbkdf2@3.1.5/node_modules/pbkdf2/lib/to-buffer.js
|
|
12092
12092
|
var require_to_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12093
|
-
var Buffer$
|
|
12093
|
+
var Buffer$41 = require_safe_buffer$1().Buffer;
|
|
12094
12094
|
var toBuffer$2 = require_to_buffer$2();
|
|
12095
12095
|
var useUint8Array = typeof Uint8Array !== "undefined";
|
|
12096
12096
|
var isView = useUint8Array && typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView;
|
|
12097
12097
|
module.exports = function(thing, encoding, name) {
|
|
12098
|
-
if (typeof thing === "string" || Buffer$
|
|
12098
|
+
if (typeof thing === "string" || Buffer$41.isBuffer(thing) || useUint8Array && thing instanceof Uint8Array || isView && isView(thing)) return toBuffer$2(thing, encoding);
|
|
12099
12099
|
throw new TypeError(name + " must be a string, a Buffer, a Uint8Array, or a DataView");
|
|
12100
12100
|
};
|
|
12101
12101
|
}));
|
|
@@ -12106,11 +12106,11 @@ var ExcelTS = (function(exports) {
|
|
|
12106
12106
|
var md5 = require_md5();
|
|
12107
12107
|
var RIPEMD160$1 = require_ripemd160();
|
|
12108
12108
|
var sha = require_sha$1();
|
|
12109
|
-
var Buffer$
|
|
12109
|
+
var Buffer$40 = require_safe_buffer$1().Buffer;
|
|
12110
12110
|
var checkParameters$1 = require_precondition();
|
|
12111
12111
|
var defaultEncoding$1 = require_default_encoding();
|
|
12112
12112
|
var toBuffer$1 = require_to_buffer();
|
|
12113
|
-
var ZEROS = Buffer$
|
|
12113
|
+
var ZEROS = Buffer$40.alloc(128);
|
|
12114
12114
|
var sizes = {
|
|
12115
12115
|
__proto__: null,
|
|
12116
12116
|
md5: 16,
|
|
@@ -12147,14 +12147,14 @@ var ExcelTS = (function(exports) {
|
|
|
12147
12147
|
var hash$4 = getDigest(alg);
|
|
12148
12148
|
var blocksize$1 = alg === "sha512" || alg === "sha384" ? 128 : 64;
|
|
12149
12149
|
if (key$1.length > blocksize$1) key$1 = hash$4(key$1);
|
|
12150
|
-
else if (key$1.length < blocksize$1) key$1 = Buffer$
|
|
12151
|
-
var ipad = Buffer$
|
|
12152
|
-
var opad = Buffer$
|
|
12150
|
+
else if (key$1.length < blocksize$1) key$1 = Buffer$40.concat([key$1, ZEROS], blocksize$1);
|
|
12151
|
+
var ipad = Buffer$40.allocUnsafe(blocksize$1 + sizes[alg]);
|
|
12152
|
+
var opad = Buffer$40.allocUnsafe(blocksize$1 + sizes[alg]);
|
|
12153
12153
|
for (var i$2 = 0; i$2 < blocksize$1; i$2++) {
|
|
12154
12154
|
ipad[i$2] = key$1[i$2] ^ 54;
|
|
12155
12155
|
opad[i$2] = key$1[i$2] ^ 92;
|
|
12156
12156
|
}
|
|
12157
|
-
var ipad1 = Buffer$
|
|
12157
|
+
var ipad1 = Buffer$40.allocUnsafe(blocksize$1 + saltLen + 4);
|
|
12158
12158
|
ipad.copy(ipad1, 0, 0, blocksize$1);
|
|
12159
12159
|
this.ipad1 = ipad1;
|
|
12160
12160
|
this.ipad2 = ipad;
|
|
@@ -12178,8 +12178,8 @@ var ExcelTS = (function(exports) {
|
|
|
12178
12178
|
var size = sizes[mappedDigest];
|
|
12179
12179
|
if (typeof size !== "number" || !size) throw new TypeError("Digest algorithm not supported: " + digest);
|
|
12180
12180
|
var hmac = new Hmac$1(mappedDigest, password, salt.length);
|
|
12181
|
-
var DK = Buffer$
|
|
12182
|
-
var block1 = Buffer$
|
|
12181
|
+
var DK = Buffer$40.allocUnsafe(keylen);
|
|
12182
|
+
var block1 = Buffer$40.allocUnsafe(salt.length + 4);
|
|
12183
12183
|
salt.copy(block1, 0, 0, salt.length);
|
|
12184
12184
|
var destPos = 0;
|
|
12185
12185
|
var hLen = size;
|
|
@@ -12203,7 +12203,7 @@ var ExcelTS = (function(exports) {
|
|
|
12203
12203
|
//#endregion
|
|
12204
12204
|
//#region node_modules/.pnpm/pbkdf2@3.1.5/node_modules/pbkdf2/lib/async.js
|
|
12205
12205
|
var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12206
|
-
var Buffer$
|
|
12206
|
+
var Buffer$39 = require_safe_buffer$1().Buffer;
|
|
12207
12207
|
var checkParameters = require_precondition();
|
|
12208
12208
|
var defaultEncoding = require_default_encoding();
|
|
12209
12209
|
var sync = require_sync_browser();
|
|
@@ -12240,14 +12240,14 @@ var ExcelTS = (function(exports) {
|
|
|
12240
12240
|
hash: { name: algo }
|
|
12241
12241
|
}, key$1, length << 3);
|
|
12242
12242
|
}).then(function(res) {
|
|
12243
|
-
return Buffer$
|
|
12243
|
+
return Buffer$39.from(res);
|
|
12244
12244
|
});
|
|
12245
12245
|
}
|
|
12246
12246
|
function checkNative(algo) {
|
|
12247
12247
|
if (global.process && !global.process.browser) return Promise.resolve(false);
|
|
12248
12248
|
if (!subtle || !subtle.importKey || !subtle.deriveBits) return Promise.resolve(false);
|
|
12249
12249
|
if (checks[algo] !== void 0) return checks[algo];
|
|
12250
|
-
ZERO_BUF = ZERO_BUF || Buffer$
|
|
12250
|
+
ZERO_BUF = ZERO_BUF || Buffer$39.alloc(8);
|
|
12251
12251
|
var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() {
|
|
12252
12252
|
return true;
|
|
12253
12253
|
}, function() {
|
|
@@ -13403,7 +13403,7 @@ var ExcelTS = (function(exports) {
|
|
|
13403
13403
|
var CipherBase = require_cipher_base();
|
|
13404
13404
|
var des = require_des();
|
|
13405
13405
|
var inherits$17 = require_inherits_browser();
|
|
13406
|
-
var Buffer$
|
|
13406
|
+
var Buffer$38 = require_safe_buffer$1().Buffer;
|
|
13407
13407
|
var modes$2 = {
|
|
13408
13408
|
"des-ede3-cbc": des.CBC.instantiate(des.EDE),
|
|
13409
13409
|
"des-ede3": des.EDE,
|
|
@@ -13424,10 +13424,10 @@ var ExcelTS = (function(exports) {
|
|
|
13424
13424
|
if (opts.decrypt) type = "decrypt";
|
|
13425
13425
|
else type = "encrypt";
|
|
13426
13426
|
var key$1 = opts.key;
|
|
13427
|
-
if (!Buffer$
|
|
13428
|
-
if (modeName === "des-ede" || modeName === "des-ede-cbc") key$1 = Buffer$
|
|
13427
|
+
if (!Buffer$38.isBuffer(key$1)) key$1 = Buffer$38.from(key$1);
|
|
13428
|
+
if (modeName === "des-ede" || modeName === "des-ede-cbc") key$1 = Buffer$38.concat([key$1, key$1.slice(0, 8)]);
|
|
13429
13429
|
var iv = opts.iv;
|
|
13430
|
-
if (!Buffer$
|
|
13430
|
+
if (!Buffer$38.isBuffer(iv)) iv = Buffer$38.from(iv);
|
|
13431
13431
|
this._des = mode.create({
|
|
13432
13432
|
key: key$1,
|
|
13433
13433
|
iv,
|
|
@@ -13435,10 +13435,10 @@ var ExcelTS = (function(exports) {
|
|
|
13435
13435
|
});
|
|
13436
13436
|
}
|
|
13437
13437
|
DES$1.prototype._update = function(data) {
|
|
13438
|
-
return Buffer$
|
|
13438
|
+
return Buffer$38.from(this._des.update(data));
|
|
13439
13439
|
};
|
|
13440
13440
|
DES$1.prototype._final = function() {
|
|
13441
|
-
return Buffer$
|
|
13441
|
+
return Buffer$38.from(this._des.final());
|
|
13442
13442
|
};
|
|
13443
13443
|
}));
|
|
13444
13444
|
|
|
@@ -13456,10 +13456,10 @@ var ExcelTS = (function(exports) {
|
|
|
13456
13456
|
//#endregion
|
|
13457
13457
|
//#region node_modules/.pnpm/buffer-xor@1.0.3/node_modules/buffer-xor/index.js
|
|
13458
13458
|
var require_buffer_xor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
13459
|
-
var import_buffer$
|
|
13459
|
+
var import_buffer$11 = require_buffer$1();
|
|
13460
13460
|
module.exports = function xor$7(a, b) {
|
|
13461
13461
|
var length = Math.min(a.length, b.length);
|
|
13462
|
-
var buffer$2 = new import_buffer$
|
|
13462
|
+
var buffer$2 = new import_buffer$11.Buffer(length);
|
|
13463
13463
|
for (var i$2 = 0; i$2 < length; ++i$2) buffer$2[i$2] = a[i$2] ^ b[i$2];
|
|
13464
13464
|
return buffer$2;
|
|
13465
13465
|
};
|
|
@@ -13484,29 +13484,29 @@ var ExcelTS = (function(exports) {
|
|
|
13484
13484
|
//#endregion
|
|
13485
13485
|
//#region node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/cfb.js
|
|
13486
13486
|
var require_cfb = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13487
|
-
var Buffer$
|
|
13487
|
+
var Buffer$36 = require_safe_buffer$1().Buffer;
|
|
13488
13488
|
var xor$5 = require_buffer_xor();
|
|
13489
13489
|
function encryptStart(self$1, data, decrypt$1) {
|
|
13490
13490
|
var len$1 = data.length;
|
|
13491
13491
|
var out = xor$5(data, self$1._cache);
|
|
13492
13492
|
self$1._cache = self$1._cache.slice(len$1);
|
|
13493
|
-
self$1._prev = Buffer$
|
|
13493
|
+
self$1._prev = Buffer$36.concat([self$1._prev, decrypt$1 ? data : out]);
|
|
13494
13494
|
return out;
|
|
13495
13495
|
}
|
|
13496
13496
|
exports.encrypt = function(self$1, data, decrypt$1) {
|
|
13497
|
-
var out = Buffer$
|
|
13497
|
+
var out = Buffer$36.allocUnsafe(0);
|
|
13498
13498
|
var len$1;
|
|
13499
13499
|
while (data.length) {
|
|
13500
13500
|
if (self$1._cache.length === 0) {
|
|
13501
13501
|
self$1._cache = self$1._cipher.encryptBlock(self$1._prev);
|
|
13502
|
-
self$1._prev = Buffer$
|
|
13502
|
+
self$1._prev = Buffer$36.allocUnsafe(0);
|
|
13503
13503
|
}
|
|
13504
13504
|
if (self$1._cache.length <= data.length) {
|
|
13505
13505
|
len$1 = self$1._cache.length;
|
|
13506
|
-
out = Buffer$
|
|
13506
|
+
out = Buffer$36.concat([out, encryptStart(self$1, data.slice(0, len$1), decrypt$1)]);
|
|
13507
13507
|
data = data.slice(len$1);
|
|
13508
13508
|
} else {
|
|
13509
|
-
out = Buffer$
|
|
13509
|
+
out = Buffer$36.concat([out, encryptStart(self$1, data, decrypt$1)]);
|
|
13510
13510
|
break;
|
|
13511
13511
|
}
|
|
13512
13512
|
}
|
|
@@ -13517,15 +13517,15 @@ var ExcelTS = (function(exports) {
|
|
|
13517
13517
|
//#endregion
|
|
13518
13518
|
//#region node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/cfb8.js
|
|
13519
13519
|
var require_cfb8 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13520
|
-
var Buffer$
|
|
13520
|
+
var Buffer$35 = require_safe_buffer$1().Buffer;
|
|
13521
13521
|
function encryptByte$1(self$1, byteParam, decrypt$1) {
|
|
13522
13522
|
var out = self$1._cipher.encryptBlock(self$1._prev)[0] ^ byteParam;
|
|
13523
|
-
self$1._prev = Buffer$
|
|
13523
|
+
self$1._prev = Buffer$35.concat([self$1._prev.slice(1), Buffer$35.from([decrypt$1 ? byteParam : out])]);
|
|
13524
13524
|
return out;
|
|
13525
13525
|
}
|
|
13526
13526
|
exports.encrypt = function(self$1, chunk, decrypt$1) {
|
|
13527
13527
|
var len$1 = chunk.length;
|
|
13528
|
-
var out = Buffer$
|
|
13528
|
+
var out = Buffer$35.allocUnsafe(len$1);
|
|
13529
13529
|
var i$2 = -1;
|
|
13530
13530
|
while (++i$2 < len$1) out[i$2] = encryptByte$1(self$1, chunk[i$2], decrypt$1);
|
|
13531
13531
|
return out;
|
|
@@ -13535,7 +13535,7 @@ var ExcelTS = (function(exports) {
|
|
|
13535
13535
|
//#endregion
|
|
13536
13536
|
//#region node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/cfb1.js
|
|
13537
13537
|
var require_cfb1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13538
|
-
var Buffer$
|
|
13538
|
+
var Buffer$34 = require_safe_buffer$1().Buffer;
|
|
13539
13539
|
function encryptByte(self$1, byteParam, decrypt$1) {
|
|
13540
13540
|
var pad$1;
|
|
13541
13541
|
var i$2 = -1;
|
|
@@ -13554,14 +13554,14 @@ var ExcelTS = (function(exports) {
|
|
|
13554
13554
|
function shiftIn(buffer$2, value) {
|
|
13555
13555
|
var len$1 = buffer$2.length;
|
|
13556
13556
|
var i$2 = -1;
|
|
13557
|
-
var out = Buffer$
|
|
13558
|
-
buffer$2 = Buffer$
|
|
13557
|
+
var out = Buffer$34.allocUnsafe(buffer$2.length);
|
|
13558
|
+
buffer$2 = Buffer$34.concat([buffer$2, Buffer$34.from([value])]);
|
|
13559
13559
|
while (++i$2 < len$1) out[i$2] = buffer$2[i$2] << 1 | buffer$2[i$2 + 1] >> 7;
|
|
13560
13560
|
return out;
|
|
13561
13561
|
}
|
|
13562
13562
|
exports.encrypt = function(self$1, chunk, decrypt$1) {
|
|
13563
13563
|
var len$1 = chunk.length;
|
|
13564
|
-
var out = Buffer$
|
|
13564
|
+
var out = Buffer$34.allocUnsafe(len$1);
|
|
13565
13565
|
var i$2 = -1;
|
|
13566
13566
|
while (++i$2 < len$1) out[i$2] = encryptByte(self$1, chunk[i$2], decrypt$1);
|
|
13567
13567
|
return out;
|
|
@@ -13571,14 +13571,14 @@ var ExcelTS = (function(exports) {
|
|
|
13571
13571
|
//#endregion
|
|
13572
13572
|
//#region node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/ofb.js
|
|
13573
13573
|
var require_ofb = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13574
|
-
var import_buffer$
|
|
13574
|
+
var import_buffer$10 = require_buffer$1();
|
|
13575
13575
|
var xor$4 = require_buffer_xor();
|
|
13576
13576
|
function getBlock$1(self$1) {
|
|
13577
13577
|
self$1._prev = self$1._cipher.encryptBlock(self$1._prev);
|
|
13578
13578
|
return self$1._prev;
|
|
13579
13579
|
}
|
|
13580
13580
|
exports.encrypt = function(self$1, chunk) {
|
|
13581
|
-
while (self$1._cache.length < chunk.length) self$1._cache = import_buffer$
|
|
13581
|
+
while (self$1._cache.length < chunk.length) self$1._cache = import_buffer$10.Buffer.concat([self$1._cache, getBlock$1(self$1)]);
|
|
13582
13582
|
var pad$1 = self$1._cache.slice(0, chunk.length);
|
|
13583
13583
|
self$1._cache = self$1._cache.slice(chunk.length);
|
|
13584
13584
|
return xor$4(chunk, pad$1);
|
|
@@ -13608,7 +13608,7 @@ var ExcelTS = (function(exports) {
|
|
|
13608
13608
|
//#region node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/ctr.js
|
|
13609
13609
|
var require_ctr = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13610
13610
|
var xor$3 = require_buffer_xor();
|
|
13611
|
-
var Buffer$
|
|
13611
|
+
var Buffer$32 = require_safe_buffer$1().Buffer;
|
|
13612
13612
|
var incr32$1 = require_incr32();
|
|
13613
13613
|
function getBlock(self$1) {
|
|
13614
13614
|
var out = self$1._cipher.encryptBlockRaw(self$1._prev);
|
|
@@ -13619,7 +13619,7 @@ var ExcelTS = (function(exports) {
|
|
|
13619
13619
|
exports.encrypt = function(self$1, chunk) {
|
|
13620
13620
|
var chunkNum = Math.ceil(chunk.length / blockSize);
|
|
13621
13621
|
var start = self$1._cache.length;
|
|
13622
|
-
self$1._cache = Buffer$
|
|
13622
|
+
self$1._cache = Buffer$32.concat([self$1._cache, Buffer$32.allocUnsafe(chunkNum * blockSize)]);
|
|
13623
13623
|
for (var i$2 = 0; i$2 < chunkNum; i$2++) {
|
|
13624
13624
|
var out = getBlock(self$1);
|
|
13625
13625
|
var offset = start + i$2 * blockSize;
|
|
@@ -13851,9 +13851,9 @@ var ExcelTS = (function(exports) {
|
|
|
13851
13851
|
//#endregion
|
|
13852
13852
|
//#region node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/aes.js
|
|
13853
13853
|
var require_aes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
13854
|
-
var Buffer$
|
|
13854
|
+
var Buffer$31 = require_safe_buffer$1().Buffer;
|
|
13855
13855
|
function asUInt32Array(buf) {
|
|
13856
|
-
if (!Buffer$
|
|
13856
|
+
if (!Buffer$31.isBuffer(buf)) buf = Buffer$31.from(buf);
|
|
13857
13857
|
var len$1 = buf.length / 4 | 0;
|
|
13858
13858
|
var out = new Array(len$1);
|
|
13859
13859
|
for (var i$2 = 0; i$2 < len$1; i$2++) out[i$2] = buf.readUInt32BE(i$2 * 4);
|
|
@@ -14003,7 +14003,7 @@ var ExcelTS = (function(exports) {
|
|
|
14003
14003
|
};
|
|
14004
14004
|
AES.prototype.encryptBlock = function(M) {
|
|
14005
14005
|
var out = this.encryptBlockRaw(M);
|
|
14006
|
-
var buf = Buffer$
|
|
14006
|
+
var buf = Buffer$31.allocUnsafe(16);
|
|
14007
14007
|
buf.writeUInt32BE(out[0], 0);
|
|
14008
14008
|
buf.writeUInt32BE(out[1], 4);
|
|
14009
14009
|
buf.writeUInt32BE(out[2], 8);
|
|
@@ -14016,7 +14016,7 @@ var ExcelTS = (function(exports) {
|
|
|
14016
14016
|
M[1] = M[3];
|
|
14017
14017
|
M[3] = m1;
|
|
14018
14018
|
var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds);
|
|
14019
|
-
var buf = Buffer$
|
|
14019
|
+
var buf = Buffer$31.allocUnsafe(16);
|
|
14020
14020
|
buf.writeUInt32BE(out[0], 0);
|
|
14021
14021
|
buf.writeUInt32BE(out[3], 4);
|
|
14022
14022
|
buf.writeUInt32BE(out[2], 8);
|
|
@@ -14034,8 +14034,8 @@ var ExcelTS = (function(exports) {
|
|
|
14034
14034
|
//#endregion
|
|
14035
14035
|
//#region node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/ghash.js
|
|
14036
14036
|
var require_ghash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
14037
|
-
var Buffer$
|
|
14038
|
-
var ZEROES = Buffer$
|
|
14037
|
+
var Buffer$30 = require_safe_buffer$1().Buffer;
|
|
14038
|
+
var ZEROES = Buffer$30.alloc(16, 0);
|
|
14039
14039
|
function toArray$2(buf) {
|
|
14040
14040
|
return [
|
|
14041
14041
|
buf.readUInt32BE(0),
|
|
@@ -14045,7 +14045,7 @@ var ExcelTS = (function(exports) {
|
|
|
14045
14045
|
];
|
|
14046
14046
|
}
|
|
14047
14047
|
function fromArray(out) {
|
|
14048
|
-
var buf = Buffer$
|
|
14048
|
+
var buf = Buffer$30.allocUnsafe(16);
|
|
14049
14049
|
buf.writeUInt32BE(out[0] >>> 0, 0);
|
|
14050
14050
|
buf.writeUInt32BE(out[1] >>> 0, 4);
|
|
14051
14051
|
buf.writeUInt32BE(out[2] >>> 0, 8);
|
|
@@ -14054,8 +14054,8 @@ var ExcelTS = (function(exports) {
|
|
|
14054
14054
|
}
|
|
14055
14055
|
function GHASH$1(key$1) {
|
|
14056
14056
|
this.h = key$1;
|
|
14057
|
-
this.state = Buffer$
|
|
14058
|
-
this.cache = Buffer$
|
|
14057
|
+
this.state = Buffer$30.alloc(16, 0);
|
|
14058
|
+
this.cache = Buffer$30.allocUnsafe(0);
|
|
14059
14059
|
}
|
|
14060
14060
|
GHASH$1.prototype.ghash = function(block) {
|
|
14061
14061
|
var i$2 = -1;
|
|
@@ -14088,7 +14088,7 @@ var ExcelTS = (function(exports) {
|
|
|
14088
14088
|
this.state = fromArray(Zi);
|
|
14089
14089
|
};
|
|
14090
14090
|
GHASH$1.prototype.update = function(buf) {
|
|
14091
|
-
this.cache = Buffer$
|
|
14091
|
+
this.cache = Buffer$30.concat([this.cache, buf]);
|
|
14092
14092
|
var chunk;
|
|
14093
14093
|
while (this.cache.length >= 16) {
|
|
14094
14094
|
chunk = this.cache.slice(0, 16);
|
|
@@ -14097,7 +14097,7 @@ var ExcelTS = (function(exports) {
|
|
|
14097
14097
|
}
|
|
14098
14098
|
};
|
|
14099
14099
|
GHASH$1.prototype.final = function(abl, bl) {
|
|
14100
|
-
if (this.cache.length) this.ghash(Buffer$
|
|
14100
|
+
if (this.cache.length) this.ghash(Buffer$30.concat([this.cache, ZEROES], 16));
|
|
14101
14101
|
this.ghash(fromArray([
|
|
14102
14102
|
0,
|
|
14103
14103
|
abl,
|
|
@@ -14113,7 +14113,7 @@ var ExcelTS = (function(exports) {
|
|
|
14113
14113
|
//#region node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/authCipher.js
|
|
14114
14114
|
var require_authCipher = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
14115
14115
|
var aes$5 = require_aes();
|
|
14116
|
-
var Buffer$
|
|
14116
|
+
var Buffer$29 = require_safe_buffer$1().Buffer;
|
|
14117
14117
|
var Transform$3 = require_cipher_base();
|
|
14118
14118
|
var inherits$16 = require_inherits_browser();
|
|
14119
14119
|
var GHASH = require_ghash();
|
|
@@ -14128,13 +14128,13 @@ var ExcelTS = (function(exports) {
|
|
|
14128
14128
|
}
|
|
14129
14129
|
function calcIv(self$1, iv, ck) {
|
|
14130
14130
|
if (iv.length === 12) {
|
|
14131
|
-
self$1._finID = Buffer$
|
|
14131
|
+
self$1._finID = Buffer$29.concat([iv, Buffer$29.from([
|
|
14132
14132
|
0,
|
|
14133
14133
|
0,
|
|
14134
14134
|
0,
|
|
14135
14135
|
1
|
|
14136
14136
|
])]);
|
|
14137
|
-
return Buffer$
|
|
14137
|
+
return Buffer$29.concat([iv, Buffer$29.from([
|
|
14138
14138
|
0,
|
|
14139
14139
|
0,
|
|
14140
14140
|
0,
|
|
@@ -14147,28 +14147,28 @@ var ExcelTS = (function(exports) {
|
|
|
14147
14147
|
ghash.update(iv);
|
|
14148
14148
|
if (toPad) {
|
|
14149
14149
|
toPad = 16 - toPad;
|
|
14150
|
-
ghash.update(Buffer$
|
|
14150
|
+
ghash.update(Buffer$29.alloc(toPad, 0));
|
|
14151
14151
|
}
|
|
14152
|
-
ghash.update(Buffer$
|
|
14152
|
+
ghash.update(Buffer$29.alloc(8, 0));
|
|
14153
14153
|
var ivBits = len$1 * 8;
|
|
14154
|
-
var tail = Buffer$
|
|
14154
|
+
var tail = Buffer$29.alloc(8);
|
|
14155
14155
|
tail.writeUIntBE(ivBits, 0, 8);
|
|
14156
14156
|
ghash.update(tail);
|
|
14157
14157
|
self$1._finID = ghash.state;
|
|
14158
|
-
var out = Buffer$
|
|
14158
|
+
var out = Buffer$29.from(self$1._finID);
|
|
14159
14159
|
incr32(out);
|
|
14160
14160
|
return out;
|
|
14161
14161
|
}
|
|
14162
14162
|
function StreamCipher$3(mode, key$1, iv, decrypt$1) {
|
|
14163
14163
|
Transform$3.call(this);
|
|
14164
|
-
var h = Buffer$
|
|
14164
|
+
var h = Buffer$29.alloc(4, 0);
|
|
14165
14165
|
this._cipher = new aes$5.AES(key$1);
|
|
14166
14166
|
var ck = this._cipher.encryptBlock(h);
|
|
14167
14167
|
this._ghash = new GHASH(ck);
|
|
14168
14168
|
iv = calcIv(this, iv, ck);
|
|
14169
|
-
this._prev = Buffer$
|
|
14170
|
-
this._cache = Buffer$
|
|
14171
|
-
this._secCache = Buffer$
|
|
14169
|
+
this._prev = Buffer$29.from(iv);
|
|
14170
|
+
this._cache = Buffer$29.allocUnsafe(0);
|
|
14171
|
+
this._secCache = Buffer$29.allocUnsafe(0);
|
|
14172
14172
|
this._decrypt = decrypt$1;
|
|
14173
14173
|
this._alen = 0;
|
|
14174
14174
|
this._len = 0;
|
|
@@ -14181,7 +14181,7 @@ var ExcelTS = (function(exports) {
|
|
|
14181
14181
|
if (!this._called && this._alen) {
|
|
14182
14182
|
var rump = 16 - this._alen % 16;
|
|
14183
14183
|
if (rump < 16) {
|
|
14184
|
-
rump = Buffer$
|
|
14184
|
+
rump = Buffer$29.alloc(rump, 0);
|
|
14185
14185
|
this._ghash.update(rump);
|
|
14186
14186
|
}
|
|
14187
14187
|
}
|
|
@@ -14200,7 +14200,7 @@ var ExcelTS = (function(exports) {
|
|
|
14200
14200
|
this._cipher.scrub();
|
|
14201
14201
|
};
|
|
14202
14202
|
StreamCipher$3.prototype.getAuthTag = function getAuthTag() {
|
|
14203
|
-
if (this._decrypt || !Buffer$
|
|
14203
|
+
if (this._decrypt || !Buffer$29.isBuffer(this._authTag)) throw new Error("Attempting to get auth tag in unsupported state");
|
|
14204
14204
|
return this._authTag;
|
|
14205
14205
|
};
|
|
14206
14206
|
StreamCipher$3.prototype.setAuthTag = function setAuthTag(tag) {
|
|
@@ -14219,15 +14219,15 @@ var ExcelTS = (function(exports) {
|
|
|
14219
14219
|
//#region node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/streamCipher.js
|
|
14220
14220
|
var require_streamCipher = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
14221
14221
|
var aes$4 = require_aes();
|
|
14222
|
-
var Buffer$
|
|
14222
|
+
var Buffer$28 = require_safe_buffer$1().Buffer;
|
|
14223
14223
|
var Transform$2 = require_cipher_base();
|
|
14224
14224
|
var inherits$15 = require_inherits_browser();
|
|
14225
14225
|
function StreamCipher$2(mode, key$1, iv, decrypt$1) {
|
|
14226
14226
|
Transform$2.call(this);
|
|
14227
14227
|
this._cipher = new aes$4.AES(key$1);
|
|
14228
|
-
this._prev = Buffer$
|
|
14229
|
-
this._cache = Buffer$
|
|
14230
|
-
this._secCache = Buffer$
|
|
14228
|
+
this._prev = Buffer$28.from(iv);
|
|
14229
|
+
this._cache = Buffer$28.allocUnsafe(0);
|
|
14230
|
+
this._secCache = Buffer$28.allocUnsafe(0);
|
|
14231
14231
|
this._decrypt = decrypt$1;
|
|
14232
14232
|
this._mode = mode;
|
|
14233
14233
|
}
|
|
@@ -14244,18 +14244,18 @@ var ExcelTS = (function(exports) {
|
|
|
14244
14244
|
//#endregion
|
|
14245
14245
|
//#region node_modules/.pnpm/evp_bytestokey@1.0.3/node_modules/evp_bytestokey/index.js
|
|
14246
14246
|
var require_evp_bytestokey = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
14247
|
-
var Buffer$
|
|
14247
|
+
var Buffer$27 = require_safe_buffer$1().Buffer;
|
|
14248
14248
|
var MD5 = require_md5$1();
|
|
14249
14249
|
function EVP_BytesToKey(password, salt, keyBits, ivLen) {
|
|
14250
|
-
if (!Buffer$
|
|
14250
|
+
if (!Buffer$27.isBuffer(password)) password = Buffer$27.from(password, "binary");
|
|
14251
14251
|
if (salt) {
|
|
14252
|
-
if (!Buffer$
|
|
14252
|
+
if (!Buffer$27.isBuffer(salt)) salt = Buffer$27.from(salt, "binary");
|
|
14253
14253
|
if (salt.length !== 8) throw new RangeError("salt should be Buffer with 8 byte length");
|
|
14254
14254
|
}
|
|
14255
14255
|
var keyLen = keyBits / 8;
|
|
14256
|
-
var key$1 = Buffer$
|
|
14257
|
-
var iv = Buffer$
|
|
14258
|
-
var tmp = Buffer$
|
|
14256
|
+
var key$1 = Buffer$27.alloc(keyLen);
|
|
14257
|
+
var iv = Buffer$27.alloc(ivLen || 0);
|
|
14258
|
+
var tmp = Buffer$27.alloc(0);
|
|
14259
14259
|
while (keyLen > 0 || ivLen > 0) {
|
|
14260
14260
|
var hash$4 = new MD5();
|
|
14261
14261
|
hash$4.update(tmp);
|
|
@@ -14290,7 +14290,7 @@ var ExcelTS = (function(exports) {
|
|
|
14290
14290
|
var require_encrypter = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
14291
14291
|
var MODES$1 = require_modes$1();
|
|
14292
14292
|
var AuthCipher$1 = require_authCipher();
|
|
14293
|
-
var Buffer$
|
|
14293
|
+
var Buffer$26 = require_safe_buffer$1().Buffer;
|
|
14294
14294
|
var StreamCipher$1 = require_streamCipher();
|
|
14295
14295
|
var Transform$1 = require_cipher_base();
|
|
14296
14296
|
var aes$3 = require_aes();
|
|
@@ -14300,7 +14300,7 @@ var ExcelTS = (function(exports) {
|
|
|
14300
14300
|
Transform$1.call(this);
|
|
14301
14301
|
this._cache = new Splitter$1();
|
|
14302
14302
|
this._cipher = new aes$3.AES(key$1);
|
|
14303
|
-
this._prev = Buffer$
|
|
14303
|
+
this._prev = Buffer$26.from(iv);
|
|
14304
14304
|
this._mode = mode;
|
|
14305
14305
|
this._autopadding = true;
|
|
14306
14306
|
}
|
|
@@ -14314,9 +14314,9 @@ var ExcelTS = (function(exports) {
|
|
|
14314
14314
|
thing = this._mode.encrypt(this, chunk);
|
|
14315
14315
|
out.push(thing);
|
|
14316
14316
|
}
|
|
14317
|
-
return Buffer$
|
|
14317
|
+
return Buffer$26.concat(out);
|
|
14318
14318
|
};
|
|
14319
|
-
var PADDING = Buffer$
|
|
14319
|
+
var PADDING = Buffer$26.alloc(16, 16);
|
|
14320
14320
|
Cipher.prototype._final = function() {
|
|
14321
14321
|
var chunk = this._cache.flush();
|
|
14322
14322
|
if (this._autopadding) {
|
|
@@ -14334,10 +14334,10 @@ var ExcelTS = (function(exports) {
|
|
|
14334
14334
|
return this;
|
|
14335
14335
|
};
|
|
14336
14336
|
function Splitter$1() {
|
|
14337
|
-
this.cache = Buffer$
|
|
14337
|
+
this.cache = Buffer$26.allocUnsafe(0);
|
|
14338
14338
|
}
|
|
14339
14339
|
Splitter$1.prototype.add = function(data) {
|
|
14340
|
-
this.cache = Buffer$
|
|
14340
|
+
this.cache = Buffer$26.concat([this.cache, data]);
|
|
14341
14341
|
};
|
|
14342
14342
|
Splitter$1.prototype.get = function() {
|
|
14343
14343
|
if (this.cache.length > 15) {
|
|
@@ -14349,17 +14349,17 @@ var ExcelTS = (function(exports) {
|
|
|
14349
14349
|
};
|
|
14350
14350
|
Splitter$1.prototype.flush = function() {
|
|
14351
14351
|
var len$1 = 16 - this.cache.length;
|
|
14352
|
-
var padBuff = Buffer$
|
|
14352
|
+
var padBuff = Buffer$26.allocUnsafe(len$1);
|
|
14353
14353
|
var i$2 = -1;
|
|
14354
14354
|
while (++i$2 < len$1) padBuff.writeUInt8(len$1, i$2);
|
|
14355
|
-
return Buffer$
|
|
14355
|
+
return Buffer$26.concat([this.cache, padBuff]);
|
|
14356
14356
|
};
|
|
14357
14357
|
function createCipheriv$1(suite, password, iv) {
|
|
14358
14358
|
var config$1 = MODES$1[suite.toLowerCase()];
|
|
14359
14359
|
if (!config$1) throw new TypeError("invalid suite type");
|
|
14360
|
-
if (typeof password === "string") password = Buffer$
|
|
14360
|
+
if (typeof password === "string") password = Buffer$26.from(password);
|
|
14361
14361
|
if (password.length !== config$1.key / 8) throw new TypeError("invalid key length " + password.length);
|
|
14362
|
-
if (typeof iv === "string") iv = Buffer$
|
|
14362
|
+
if (typeof iv === "string") iv = Buffer$26.from(iv);
|
|
14363
14363
|
if (config$1.mode !== "GCM" && iv.length !== config$1.iv) throw new TypeError("invalid iv length " + iv.length);
|
|
14364
14364
|
if (config$1.type === "stream") return new StreamCipher$1(config$1.module, password, iv);
|
|
14365
14365
|
else if (config$1.type === "auth") return new AuthCipher$1(config$1.module, password, iv);
|
|
@@ -14379,7 +14379,7 @@ var ExcelTS = (function(exports) {
|
|
|
14379
14379
|
//#region node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/decrypter.js
|
|
14380
14380
|
var require_decrypter = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
14381
14381
|
var AuthCipher = require_authCipher();
|
|
14382
|
-
var Buffer$
|
|
14382
|
+
var Buffer$25 = require_safe_buffer$1().Buffer;
|
|
14383
14383
|
var MODES = require_modes$1();
|
|
14384
14384
|
var StreamCipher = require_streamCipher();
|
|
14385
14385
|
var Transform = require_cipher_base();
|
|
@@ -14391,7 +14391,7 @@ var ExcelTS = (function(exports) {
|
|
|
14391
14391
|
this._cache = new Splitter();
|
|
14392
14392
|
this._last = void 0;
|
|
14393
14393
|
this._cipher = new aes$2.AES(key$1);
|
|
14394
|
-
this._prev = Buffer$
|
|
14394
|
+
this._prev = Buffer$25.from(iv);
|
|
14395
14395
|
this._mode = mode;
|
|
14396
14396
|
this._autopadding = true;
|
|
14397
14397
|
}
|
|
@@ -14405,7 +14405,7 @@ var ExcelTS = (function(exports) {
|
|
|
14405
14405
|
thing = this._mode.decrypt(this, chunk);
|
|
14406
14406
|
out.push(thing);
|
|
14407
14407
|
}
|
|
14408
|
-
return Buffer$
|
|
14408
|
+
return Buffer$25.concat(out);
|
|
14409
14409
|
};
|
|
14410
14410
|
Decipher.prototype._final = function() {
|
|
14411
14411
|
var chunk = this._cache.flush();
|
|
@@ -14417,10 +14417,10 @@ var ExcelTS = (function(exports) {
|
|
|
14417
14417
|
return this;
|
|
14418
14418
|
};
|
|
14419
14419
|
function Splitter() {
|
|
14420
|
-
this.cache = Buffer$
|
|
14420
|
+
this.cache = Buffer$25.allocUnsafe(0);
|
|
14421
14421
|
}
|
|
14422
14422
|
Splitter.prototype.add = function(data) {
|
|
14423
|
-
this.cache = Buffer$
|
|
14423
|
+
this.cache = Buffer$25.concat([this.cache, data]);
|
|
14424
14424
|
};
|
|
14425
14425
|
Splitter.prototype.get = function(autoPadding) {
|
|
14426
14426
|
var out;
|
|
@@ -14451,9 +14451,9 @@ var ExcelTS = (function(exports) {
|
|
|
14451
14451
|
function createDecipheriv$1(suite, password, iv) {
|
|
14452
14452
|
var config$1 = MODES[suite.toLowerCase()];
|
|
14453
14453
|
if (!config$1) throw new TypeError("invalid suite type");
|
|
14454
|
-
if (typeof iv === "string") iv = Buffer$
|
|
14454
|
+
if (typeof iv === "string") iv = Buffer$25.from(iv);
|
|
14455
14455
|
if (config$1.mode !== "GCM" && iv.length !== config$1.iv) throw new TypeError("invalid iv length " + iv.length);
|
|
14456
|
-
if (typeof password === "string") password = Buffer$
|
|
14456
|
+
if (typeof password === "string") password = Buffer$25.from(password);
|
|
14457
14457
|
if (password.length !== config$1.key / 8) throw new TypeError("invalid key length " + password.length);
|
|
14458
14458
|
if (config$1.type === "stream") return new StreamCipher(config$1.module, password, iv, true);
|
|
14459
14459
|
else if (config$1.type === "auth") return new AuthCipher(config$1.module, password, iv, true);
|
|
@@ -14612,10 +14612,10 @@ var ExcelTS = (function(exports) {
|
|
|
14612
14612
|
else exports$1.BN = BN$18;
|
|
14613
14613
|
BN$18.BN = BN$18;
|
|
14614
14614
|
BN$18.wordSize = 26;
|
|
14615
|
-
var Buffer$
|
|
14615
|
+
var Buffer$69;
|
|
14616
14616
|
try {
|
|
14617
|
-
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer$
|
|
14618
|
-
else Buffer$
|
|
14617
|
+
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer$69 = window.Buffer;
|
|
14618
|
+
else Buffer$69 = require_buffer$1().Buffer;
|
|
14619
14619
|
} catch (e) {}
|
|
14620
14620
|
BN$18.isBN = function isBN(num) {
|
|
14621
14621
|
if (num instanceof BN$18) return true;
|
|
@@ -14967,8 +14967,8 @@ var ExcelTS = (function(exports) {
|
|
|
14967
14967
|
return this.toString(16);
|
|
14968
14968
|
};
|
|
14969
14969
|
BN$18.prototype.toBuffer = function toBuffer$8(endian, length) {
|
|
14970
|
-
assert$22(typeof Buffer$
|
|
14971
|
-
return this.toArrayLike(Buffer$
|
|
14970
|
+
assert$22(typeof Buffer$69 !== "undefined");
|
|
14971
|
+
return this.toArrayLike(Buffer$69, endian, length);
|
|
14972
14972
|
};
|
|
14973
14973
|
BN$18.prototype.toArray = function toArray$3(endian, length) {
|
|
14974
14974
|
return this.toArrayLike(Array, endian, length);
|
|
@@ -17288,7 +17288,7 @@ var ExcelTS = (function(exports) {
|
|
|
17288
17288
|
//#endregion
|
|
17289
17289
|
//#region node_modules/.pnpm/diffie-hellman@5.0.3/node_modules/diffie-hellman/lib/dh.js
|
|
17290
17290
|
var require_dh = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
17291
|
-
var import_buffer$
|
|
17291
|
+
var import_buffer$9 = require_buffer$1();
|
|
17292
17292
|
var BN$16 = require_bn$1();
|
|
17293
17293
|
var millerRabin = new (require_mr())();
|
|
17294
17294
|
var TWENTYFOUR = new BN$16(24);
|
|
@@ -17301,13 +17301,13 @@ var ExcelTS = (function(exports) {
|
|
|
17301
17301
|
module.exports = DH$1;
|
|
17302
17302
|
function setPublicKey(pub, enc) {
|
|
17303
17303
|
enc = enc || "utf8";
|
|
17304
|
-
if (!import_buffer$
|
|
17304
|
+
if (!import_buffer$9.Buffer.isBuffer(pub)) pub = new import_buffer$9.Buffer(pub, enc);
|
|
17305
17305
|
this._pub = new BN$16(pub);
|
|
17306
17306
|
return this;
|
|
17307
17307
|
}
|
|
17308
17308
|
function setPrivateKey(priv, enc) {
|
|
17309
17309
|
enc = enc || "utf8";
|
|
17310
|
-
if (!import_buffer$
|
|
17310
|
+
if (!import_buffer$9.Buffer.isBuffer(priv)) priv = new import_buffer$9.Buffer(priv, enc);
|
|
17311
17311
|
this._priv = new BN$16(priv);
|
|
17312
17312
|
return this;
|
|
17313
17313
|
}
|
|
@@ -17367,12 +17367,12 @@ var ExcelTS = (function(exports) {
|
|
|
17367
17367
|
DH$1.prototype.computeSecret = function(other) {
|
|
17368
17368
|
other = new BN$16(other);
|
|
17369
17369
|
other = other.toRed(this._prime);
|
|
17370
|
-
var out = new import_buffer$
|
|
17370
|
+
var out = new import_buffer$9.Buffer(other.redPow(this._priv).fromRed().toArray());
|
|
17371
17371
|
var prime = this.getPrime();
|
|
17372
17372
|
if (out.length < prime.length) {
|
|
17373
|
-
var front = new import_buffer$
|
|
17373
|
+
var front = new import_buffer$9.Buffer(prime.length - out.length);
|
|
17374
17374
|
front.fill(0);
|
|
17375
|
-
out = import_buffer$
|
|
17375
|
+
out = import_buffer$9.Buffer.concat([front, out]);
|
|
17376
17376
|
}
|
|
17377
17377
|
return out;
|
|
17378
17378
|
};
|
|
@@ -17390,13 +17390,13 @@ var ExcelTS = (function(exports) {
|
|
|
17390
17390
|
};
|
|
17391
17391
|
DH$1.prototype.setGenerator = function(gen, enc) {
|
|
17392
17392
|
enc = enc || "utf8";
|
|
17393
|
-
if (!import_buffer$
|
|
17393
|
+
if (!import_buffer$9.Buffer.isBuffer(gen)) gen = new import_buffer$9.Buffer(gen, enc);
|
|
17394
17394
|
this.__gen = gen;
|
|
17395
17395
|
this._gen = new BN$16(gen);
|
|
17396
17396
|
return this;
|
|
17397
17397
|
};
|
|
17398
17398
|
function formatReturnValue$1(bn$1, enc) {
|
|
17399
|
-
var buf = new import_buffer$
|
|
17399
|
+
var buf = new import_buffer$9.Buffer(bn$1.toArray());
|
|
17400
17400
|
if (!enc) return buf;
|
|
17401
17401
|
else return buf.toString(enc);
|
|
17402
17402
|
}
|
|
@@ -17405,12 +17405,12 @@ var ExcelTS = (function(exports) {
|
|
|
17405
17405
|
//#endregion
|
|
17406
17406
|
//#region node_modules/.pnpm/diffie-hellman@5.0.3/node_modules/diffie-hellman/browser.js
|
|
17407
17407
|
var require_browser$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
17408
|
-
var import_buffer$
|
|
17408
|
+
var import_buffer$8 = require_buffer$1();
|
|
17409
17409
|
var generatePrime = require_generatePrime();
|
|
17410
17410
|
var primes = require_primes();
|
|
17411
17411
|
var DH = require_dh();
|
|
17412
17412
|
function getDiffieHellman(mod) {
|
|
17413
|
-
return new DH(new import_buffer$
|
|
17413
|
+
return new DH(new import_buffer$8.Buffer(primes[mod].prime, "hex"), new import_buffer$8.Buffer(primes[mod].gen, "hex"));
|
|
17414
17414
|
}
|
|
17415
17415
|
var ENCODINGS = {
|
|
17416
17416
|
"binary": true,
|
|
@@ -17418,13 +17418,13 @@ var ExcelTS = (function(exports) {
|
|
|
17418
17418
|
"base64": true
|
|
17419
17419
|
};
|
|
17420
17420
|
function createDiffieHellman(prime, enc, generator, genc) {
|
|
17421
|
-
if (import_buffer$
|
|
17421
|
+
if (import_buffer$8.Buffer.isBuffer(enc) || ENCODINGS[enc] === void 0) return createDiffieHellman(prime, "binary", enc, generator);
|
|
17422
17422
|
enc = enc || "binary";
|
|
17423
17423
|
genc = genc || "binary";
|
|
17424
|
-
generator = generator || new import_buffer$
|
|
17425
|
-
if (!import_buffer$
|
|
17424
|
+
generator = generator || new import_buffer$8.Buffer([2]);
|
|
17425
|
+
if (!import_buffer$8.Buffer.isBuffer(generator)) generator = new import_buffer$8.Buffer(generator, genc);
|
|
17426
17426
|
if (typeof prime === "number") return new DH(generatePrime(prime, generator), generator, true);
|
|
17427
|
-
if (!import_buffer$
|
|
17427
|
+
if (!import_buffer$8.Buffer.isBuffer(prime)) prime = new import_buffer$8.Buffer(prime, enc);
|
|
17428
17428
|
return new DH(prime, generator, true);
|
|
17429
17429
|
}
|
|
17430
17430
|
exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman;
|
|
@@ -17464,10 +17464,10 @@ var ExcelTS = (function(exports) {
|
|
|
17464
17464
|
else exports$1.BN = BN$18;
|
|
17465
17465
|
BN$18.BN = BN$18;
|
|
17466
17466
|
BN$18.wordSize = 26;
|
|
17467
|
-
var Buffer$
|
|
17467
|
+
var Buffer$69;
|
|
17468
17468
|
try {
|
|
17469
|
-
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer$
|
|
17470
|
-
else Buffer$
|
|
17469
|
+
if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer$69 = window.Buffer;
|
|
17470
|
+
else Buffer$69 = require_buffer$1().Buffer;
|
|
17471
17471
|
} catch (e) {}
|
|
17472
17472
|
BN$18.isBN = function isBN(num) {
|
|
17473
17473
|
if (num instanceof BN$18) return true;
|
|
@@ -17837,8 +17837,8 @@ var ExcelTS = (function(exports) {
|
|
|
17837
17837
|
BN$18.prototype.toJSON = function toJSON() {
|
|
17838
17838
|
return this.toString(16, 2);
|
|
17839
17839
|
};
|
|
17840
|
-
if (Buffer$
|
|
17841
|
-
return this.toArrayLike(Buffer$
|
|
17840
|
+
if (Buffer$69) BN$18.prototype.toBuffer = function toBuffer$8(endian, length) {
|
|
17841
|
+
return this.toArrayLike(Buffer$69, endian, length);
|
|
17842
17842
|
};
|
|
17843
17843
|
BN$18.prototype.toArray = function toArray$3(endian, length) {
|
|
17844
17844
|
return this.toArrayLike(Array, endian, length);
|
|
@@ -19978,7 +19978,7 @@ var ExcelTS = (function(exports) {
|
|
|
19978
19978
|
var require_browserify_rsa = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
19979
19979
|
var BN$15 = require_bn();
|
|
19980
19980
|
var randomBytes$1 = require_browser$11();
|
|
19981
|
-
var Buffer$
|
|
19981
|
+
var Buffer$22 = require_safe_buffer$1().Buffer;
|
|
19982
19982
|
function getr(priv) {
|
|
19983
19983
|
var len$1 = priv.modulus.byteLength();
|
|
19984
19984
|
var r$2;
|
|
@@ -20006,7 +20006,7 @@ var ExcelTS = (function(exports) {
|
|
|
20006
20006
|
var m1 = c1.redPow(priv.exponent1).fromRed();
|
|
20007
20007
|
var m2 = c2.redPow(priv.exponent2).fromRed();
|
|
20008
20008
|
var h = m1.isub(m2).imul(qinv).umod(p$1).imul(q);
|
|
20009
|
-
return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer$
|
|
20009
|
+
return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer$22, "be", len$1);
|
|
20010
20010
|
}
|
|
20011
20011
|
crt$3.getr = getr;
|
|
20012
20012
|
module.exports = crt$3;
|
|
@@ -24119,10 +24119,10 @@ var ExcelTS = (function(exports) {
|
|
|
24119
24119
|
var require_buffer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
24120
24120
|
var inherits$6 = require_inherits_browser();
|
|
24121
24121
|
var Reporter$1 = require_base().Reporter;
|
|
24122
|
-
var Buffer$
|
|
24122
|
+
var Buffer$21 = require_buffer$1().Buffer;
|
|
24123
24123
|
function DecoderBuffer$1(base$3, options) {
|
|
24124
24124
|
Reporter$1.call(this, options);
|
|
24125
|
-
if (!Buffer$
|
|
24125
|
+
if (!Buffer$21.isBuffer(base$3)) {
|
|
24126
24126
|
this.error("Input not Buffer");
|
|
24127
24127
|
return;
|
|
24128
24128
|
}
|
|
@@ -24179,15 +24179,15 @@ var ExcelTS = (function(exports) {
|
|
|
24179
24179
|
this.length = 1;
|
|
24180
24180
|
} else if (typeof value === "string") {
|
|
24181
24181
|
this.value = value;
|
|
24182
|
-
this.length = Buffer$
|
|
24183
|
-
} else if (Buffer$
|
|
24182
|
+
this.length = Buffer$21.byteLength(value);
|
|
24183
|
+
} else if (Buffer$21.isBuffer(value)) {
|
|
24184
24184
|
this.value = value;
|
|
24185
24185
|
this.length = value.length;
|
|
24186
24186
|
} else return reporter.error("Unsupported type: " + typeof value);
|
|
24187
24187
|
}
|
|
24188
24188
|
exports.EncoderBuffer = EncoderBuffer$1;
|
|
24189
24189
|
EncoderBuffer$1.prototype.join = function join(out, offset) {
|
|
24190
|
-
if (!out) out = new Buffer$
|
|
24190
|
+
if (!out) out = new Buffer$21(this.length);
|
|
24191
24191
|
if (!offset) offset = 0;
|
|
24192
24192
|
if (this.length === 0) return out;
|
|
24193
24193
|
if (Array.isArray(this.value)) this.value.forEach(function(item) {
|
|
@@ -24197,7 +24197,7 @@ var ExcelTS = (function(exports) {
|
|
|
24197
24197
|
else {
|
|
24198
24198
|
if (typeof this.value === "number") out[offset] = this.value;
|
|
24199
24199
|
else if (typeof this.value === "string") out.write(this.value, offset);
|
|
24200
|
-
else if (Buffer$
|
|
24200
|
+
else if (Buffer$21.isBuffer(this.value)) this.value.copy(out, offset);
|
|
24201
24201
|
offset += this.length;
|
|
24202
24202
|
}
|
|
24203
24203
|
return out;
|
|
@@ -24931,7 +24931,7 @@ var ExcelTS = (function(exports) {
|
|
|
24931
24931
|
//#region node_modules/.pnpm/asn1.js@4.10.1/node_modules/asn1.js/lib/asn1/decoders/pem.js
|
|
24932
24932
|
var require_pem$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
24933
24933
|
var inherits$4 = require_inherits_browser();
|
|
24934
|
-
var Buffer$
|
|
24934
|
+
var Buffer$20 = require_buffer$1().Buffer;
|
|
24935
24935
|
var DERDecoder = require_der$1();
|
|
24936
24936
|
function PEMDecoder(entity) {
|
|
24937
24937
|
DERDecoder.call(this, entity);
|
|
@@ -24961,7 +24961,7 @@ var ExcelTS = (function(exports) {
|
|
|
24961
24961
|
if (start === -1 || end === -1) throw new Error("PEM section not found for: " + label);
|
|
24962
24962
|
var base64$1 = lines.slice(start + 1, end).join("");
|
|
24963
24963
|
base64$1.replace(/[^a-z0-9\+\/=]+/gi, "");
|
|
24964
|
-
var input = new Buffer$
|
|
24964
|
+
var input = new Buffer$20(base64$1, "base64");
|
|
24965
24965
|
return DERDecoder.prototype.decode.call(this, input, options);
|
|
24966
24966
|
};
|
|
24967
24967
|
}));
|
|
@@ -24978,7 +24978,7 @@ var ExcelTS = (function(exports) {
|
|
|
24978
24978
|
//#region node_modules/.pnpm/asn1.js@4.10.1/node_modules/asn1.js/lib/asn1/encoders/der.js
|
|
24979
24979
|
var require_der = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
24980
24980
|
var inherits$3 = require_inherits_browser();
|
|
24981
|
-
var Buffer$
|
|
24981
|
+
var Buffer$19 = require_buffer$1().Buffer;
|
|
24982
24982
|
var asn1$3 = require_asn1$1();
|
|
24983
24983
|
var base = asn1$3.base;
|
|
24984
24984
|
var der = asn1$3.constants.der;
|
|
@@ -25000,14 +25000,14 @@ var ExcelTS = (function(exports) {
|
|
|
25000
25000
|
DERNode.prototype._encodeComposite = function encodeComposite(tag, primitive, cls, content) {
|
|
25001
25001
|
var encodedTag = encodeTag(tag, primitive, cls, this.reporter);
|
|
25002
25002
|
if (content.length < 128) {
|
|
25003
|
-
var header = new Buffer$
|
|
25003
|
+
var header = new Buffer$19(2);
|
|
25004
25004
|
header[0] = encodedTag;
|
|
25005
25005
|
header[1] = content.length;
|
|
25006
25006
|
return this._createEncoderBuffer([header, content]);
|
|
25007
25007
|
}
|
|
25008
25008
|
var lenOctets = 1;
|
|
25009
25009
|
for (var i$2 = content.length; i$2 >= 256; i$2 >>= 8) lenOctets++;
|
|
25010
|
-
var header = new Buffer$
|
|
25010
|
+
var header = new Buffer$19(2 + lenOctets);
|
|
25011
25011
|
header[0] = encodedTag;
|
|
25012
25012
|
header[1] = 128 | lenOctets;
|
|
25013
25013
|
for (var i$2 = 1 + lenOctets, j = content.length; j > 0; i$2--, j >>= 8) header[i$2] = j & 255;
|
|
@@ -25016,7 +25016,7 @@ var ExcelTS = (function(exports) {
|
|
|
25016
25016
|
DERNode.prototype._encodeStr = function encodeStr(str, tag) {
|
|
25017
25017
|
if (tag === "bitstr") return this._createEncoderBuffer([str.unused | 0, str.data]);
|
|
25018
25018
|
else if (tag === "bmpstr") {
|
|
25019
|
-
var buf = new Buffer$
|
|
25019
|
+
var buf = new Buffer$19(str.length * 2);
|
|
25020
25020
|
for (var i$2 = 0; i$2 < str.length; i$2++) buf.writeUInt16BE(str.charCodeAt(i$2), i$2 * 2);
|
|
25021
25021
|
return this._createEncoderBuffer(buf);
|
|
25022
25022
|
} else if (tag === "numstr") {
|
|
@@ -25049,7 +25049,7 @@ var ExcelTS = (function(exports) {
|
|
|
25049
25049
|
var ident = id[i$2];
|
|
25050
25050
|
for (size++; ident >= 128; ident >>= 7) size++;
|
|
25051
25051
|
}
|
|
25052
|
-
var objid = new Buffer$
|
|
25052
|
+
var objid = new Buffer$19(size);
|
|
25053
25053
|
var offset = objid.length - 1;
|
|
25054
25054
|
for (var i$2 = id.length - 1; i$2 >= 0; i$2--) {
|
|
25055
25055
|
var ident = id[i$2];
|
|
@@ -25095,15 +25095,15 @@ var ExcelTS = (function(exports) {
|
|
|
25095
25095
|
if (!values.hasOwnProperty(num)) return this.reporter.error("Values map doesn't contain: " + JSON.stringify(num));
|
|
25096
25096
|
num = values[num];
|
|
25097
25097
|
}
|
|
25098
|
-
if (typeof num !== "number" && !Buffer$
|
|
25098
|
+
if (typeof num !== "number" && !Buffer$19.isBuffer(num)) {
|
|
25099
25099
|
var numArray = num.toArray();
|
|
25100
25100
|
if (!num.sign && numArray[0] & 128) numArray.unshift(0);
|
|
25101
|
-
num = new Buffer$
|
|
25101
|
+
num = new Buffer$19(numArray);
|
|
25102
25102
|
}
|
|
25103
|
-
if (Buffer$
|
|
25103
|
+
if (Buffer$19.isBuffer(num)) {
|
|
25104
25104
|
var size = num.length;
|
|
25105
25105
|
if (num.length === 0) size++;
|
|
25106
|
-
var out = new Buffer$
|
|
25106
|
+
var out = new Buffer$19(size);
|
|
25107
25107
|
num.copy(out);
|
|
25108
25108
|
if (num.length === 0) out[0] = 0;
|
|
25109
25109
|
return this._createEncoderBuffer(out);
|
|
@@ -25118,7 +25118,7 @@ var ExcelTS = (function(exports) {
|
|
|
25118
25118
|
num >>= 8;
|
|
25119
25119
|
}
|
|
25120
25120
|
if (out[0] & 128) out.unshift(0);
|
|
25121
|
-
return this._createEncoderBuffer(new Buffer$
|
|
25121
|
+
return this._createEncoderBuffer(new Buffer$19(out));
|
|
25122
25122
|
};
|
|
25123
25123
|
DERNode.prototype._encodeBool = function encodeBool(value) {
|
|
25124
25124
|
return this._createEncoderBuffer(value ? 255 : 0);
|
|
@@ -25308,24 +25308,24 @@ var ExcelTS = (function(exports) {
|
|
|
25308
25308
|
var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m;
|
|
25309
25309
|
var evp = require_evp_bytestokey();
|
|
25310
25310
|
var ciphers$1 = require_browser$6();
|
|
25311
|
-
var Buffer$
|
|
25311
|
+
var Buffer$18 = require_safe_buffer$1().Buffer;
|
|
25312
25312
|
module.exports = function(okey, password) {
|
|
25313
25313
|
var key$1 = okey.toString();
|
|
25314
25314
|
var match = key$1.match(findProc);
|
|
25315
25315
|
var decrypted;
|
|
25316
25316
|
if (!match) {
|
|
25317
25317
|
var match2 = key$1.match(fullRegex);
|
|
25318
|
-
decrypted = Buffer$
|
|
25318
|
+
decrypted = Buffer$18.from(match2[2].replace(/[\r\n]/g, ""), "base64");
|
|
25319
25319
|
} else {
|
|
25320
25320
|
var suite = "aes" + match[1];
|
|
25321
|
-
var iv = Buffer$
|
|
25322
|
-
var cipherText = Buffer$
|
|
25321
|
+
var iv = Buffer$18.from(match[2], "hex");
|
|
25322
|
+
var cipherText = Buffer$18.from(match[3].replace(/[\r\n]/g, ""), "base64");
|
|
25323
25323
|
var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key;
|
|
25324
25324
|
var out = [];
|
|
25325
25325
|
var cipher = ciphers$1.createDecipheriv(suite, cipherKey, iv);
|
|
25326
25326
|
out.push(cipher.update(cipherText));
|
|
25327
25327
|
out.push(cipher["final"]());
|
|
25328
|
-
decrypted = Buffer$
|
|
25328
|
+
decrypted = Buffer$18.concat(out);
|
|
25329
25329
|
}
|
|
25330
25330
|
return {
|
|
25331
25331
|
tag: key$1.match(startRegex)[1],
|
|
@@ -25342,7 +25342,7 @@ var ExcelTS = (function(exports) {
|
|
|
25342
25342
|
var fixProc = require_fixProc();
|
|
25343
25343
|
var ciphers = require_browser$6();
|
|
25344
25344
|
var pbkdf2Sync = require_browser$7().pbkdf2Sync;
|
|
25345
|
-
var Buffer$
|
|
25345
|
+
var Buffer$17 = require_safe_buffer$1().Buffer;
|
|
25346
25346
|
function decrypt(data, password) {
|
|
25347
25347
|
var salt = data.algorithm.decrypt.kde.kdeparams.salt;
|
|
25348
25348
|
var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10);
|
|
@@ -25354,15 +25354,15 @@ var ExcelTS = (function(exports) {
|
|
|
25354
25354
|
var out = [];
|
|
25355
25355
|
out.push(cipher.update(cipherText));
|
|
25356
25356
|
out.push(cipher["final"]());
|
|
25357
|
-
return Buffer$
|
|
25357
|
+
return Buffer$17.concat(out);
|
|
25358
25358
|
}
|
|
25359
25359
|
function parseKeys$4(buffer$2) {
|
|
25360
25360
|
var password;
|
|
25361
|
-
if (typeof buffer$2 === "object" && !Buffer$
|
|
25361
|
+
if (typeof buffer$2 === "object" && !Buffer$17.isBuffer(buffer$2)) {
|
|
25362
25362
|
password = buffer$2.passphrase;
|
|
25363
25363
|
buffer$2 = buffer$2.key;
|
|
25364
25364
|
}
|
|
25365
|
-
if (typeof buffer$2 === "string") buffer$2 = Buffer$
|
|
25365
|
+
if (typeof buffer$2 === "string") buffer$2 = Buffer$17.from(buffer$2);
|
|
25366
25366
|
var stripped = fixProc(buffer$2, password);
|
|
25367
25367
|
var type = stripped.tag;
|
|
25368
25368
|
var data = stripped.data;
|
|
@@ -25443,7 +25443,7 @@ var ExcelTS = (function(exports) {
|
|
|
25443
25443
|
//#endregion
|
|
25444
25444
|
//#region node_modules/.pnpm/browserify-sign@4.2.5/node_modules/browserify-sign/browser/sign.js
|
|
25445
25445
|
var require_sign = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25446
|
-
var Buffer$
|
|
25446
|
+
var Buffer$16 = require_safe_buffer$1().Buffer;
|
|
25447
25447
|
var createHmac = require_browser$8();
|
|
25448
25448
|
var crt$2 = require_browserify_rsa();
|
|
25449
25449
|
var EC$1 = require_elliptic().ec;
|
|
@@ -25462,7 +25462,7 @@ var ExcelTS = (function(exports) {
|
|
|
25462
25462
|
}
|
|
25463
25463
|
if (signType !== "rsa" && signType !== "ecdsa/rsa") throw new Error("wrong private key type");
|
|
25464
25464
|
if (key$1.padding !== void 0 && key$1.padding !== RSA_PKCS1_PADDING) throw new Error("illegal or unsupported padding mode");
|
|
25465
|
-
hash$4 = Buffer$
|
|
25465
|
+
hash$4 = Buffer$16.concat([tag, hash$4]);
|
|
25466
25466
|
var len$1 = priv.modulus.byteLength();
|
|
25467
25467
|
var pad$1 = [0, 1];
|
|
25468
25468
|
while (hash$4.length + pad$1.length + 1 < len$1) pad$1.push(255);
|
|
@@ -25475,7 +25475,7 @@ var ExcelTS = (function(exports) {
|
|
|
25475
25475
|
var curveId = curves$1[priv.curve.join(".")];
|
|
25476
25476
|
if (!curveId) throw new Error("unknown curve " + priv.curve.join("."));
|
|
25477
25477
|
var out = new EC$1(curveId).keyFromPrivate(priv.privateKey).sign(hash$4);
|
|
25478
|
-
return Buffer$
|
|
25478
|
+
return Buffer$16.from(out.toDER());
|
|
25479
25479
|
}
|
|
25480
25480
|
function dsaSign(hash$4, priv, algo) {
|
|
25481
25481
|
var x$1 = priv.params.priv_key;
|
|
@@ -25510,22 +25510,22 @@ var ExcelTS = (function(exports) {
|
|
|
25510
25510
|
r$2.length
|
|
25511
25511
|
];
|
|
25512
25512
|
res = res.concat(r$2, [2, s$1.length], s$1);
|
|
25513
|
-
return Buffer$
|
|
25513
|
+
return Buffer$16.from(res);
|
|
25514
25514
|
}
|
|
25515
25515
|
function getKey(x$1, q, hash$4, algo) {
|
|
25516
|
-
x$1 = Buffer$
|
|
25516
|
+
x$1 = Buffer$16.from(x$1.toArray());
|
|
25517
25517
|
if (x$1.length < q.byteLength()) {
|
|
25518
|
-
var zeros = Buffer$
|
|
25519
|
-
x$1 = Buffer$
|
|
25518
|
+
var zeros = Buffer$16.alloc(q.byteLength() - x$1.length);
|
|
25519
|
+
x$1 = Buffer$16.concat([zeros, x$1]);
|
|
25520
25520
|
}
|
|
25521
25521
|
var hlen = hash$4.length;
|
|
25522
25522
|
var hbits = bits2octets(hash$4, q);
|
|
25523
|
-
var v$2 = Buffer$
|
|
25523
|
+
var v$2 = Buffer$16.alloc(hlen);
|
|
25524
25524
|
v$2.fill(1);
|
|
25525
|
-
var k = Buffer$
|
|
25526
|
-
k = createHmac(algo, k).update(v$2).update(Buffer$
|
|
25525
|
+
var k = Buffer$16.alloc(hlen);
|
|
25526
|
+
k = createHmac(algo, k).update(v$2).update(Buffer$16.from([0])).update(x$1).update(hbits).digest();
|
|
25527
25527
|
v$2 = createHmac(algo, k).update(v$2).digest();
|
|
25528
|
-
k = createHmac(algo, k).update(v$2).update(Buffer$
|
|
25528
|
+
k = createHmac(algo, k).update(v$2).update(Buffer$16.from([1])).update(x$1).update(hbits).digest();
|
|
25529
25529
|
v$2 = createHmac(algo, k).update(v$2).digest();
|
|
25530
25530
|
return {
|
|
25531
25531
|
k,
|
|
@@ -25541,10 +25541,10 @@ var ExcelTS = (function(exports) {
|
|
|
25541
25541
|
function bits2octets(bits$1, q) {
|
|
25542
25542
|
bits$1 = bits2int(bits$1, q);
|
|
25543
25543
|
bits$1 = bits$1.mod(q);
|
|
25544
|
-
var out = Buffer$
|
|
25544
|
+
var out = Buffer$16.from(bits$1.toArray());
|
|
25545
25545
|
if (out.length < q.byteLength()) {
|
|
25546
|
-
var zeros = Buffer$
|
|
25547
|
-
out = Buffer$
|
|
25546
|
+
var zeros = Buffer$16.alloc(q.byteLength() - out.length);
|
|
25547
|
+
out = Buffer$16.concat([zeros, out]);
|
|
25548
25548
|
}
|
|
25549
25549
|
return out;
|
|
25550
25550
|
}
|
|
@@ -25552,13 +25552,13 @@ var ExcelTS = (function(exports) {
|
|
|
25552
25552
|
var t;
|
|
25553
25553
|
var k;
|
|
25554
25554
|
do {
|
|
25555
|
-
t = Buffer$
|
|
25555
|
+
t = Buffer$16.alloc(0);
|
|
25556
25556
|
while (t.length * 8 < q.bitLength()) {
|
|
25557
25557
|
kv.v = createHmac(algo, kv.k).update(kv.v).digest();
|
|
25558
|
-
t = Buffer$
|
|
25558
|
+
t = Buffer$16.concat([t, kv.v]);
|
|
25559
25559
|
}
|
|
25560
25560
|
k = bits2int(t, q);
|
|
25561
|
-
kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer$
|
|
25561
|
+
kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer$16.from([0])).digest();
|
|
25562
25562
|
kv.v = createHmac(algo, kv.k).update(kv.v).digest();
|
|
25563
25563
|
} while (k.cmp(q) !== -1);
|
|
25564
25564
|
return k;
|
|
@@ -25574,7 +25574,7 @@ var ExcelTS = (function(exports) {
|
|
|
25574
25574
|
//#endregion
|
|
25575
25575
|
//#region node_modules/.pnpm/browserify-sign@4.2.5/node_modules/browserify-sign/browser/verify.js
|
|
25576
25576
|
var require_verify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25577
|
-
var Buffer$
|
|
25577
|
+
var Buffer$15 = require_safe_buffer$1().Buffer;
|
|
25578
25578
|
var BN$4 = require_bn();
|
|
25579
25579
|
var EC = require_elliptic().ec;
|
|
25580
25580
|
var parseKeys$2 = require_parse_asn1();
|
|
@@ -25589,7 +25589,7 @@ var ExcelTS = (function(exports) {
|
|
|
25589
25589
|
return dsaVerify(sig, hash$4, pub);
|
|
25590
25590
|
}
|
|
25591
25591
|
if (signType !== "rsa" && signType !== "ecdsa/rsa") throw new Error("wrong public key type");
|
|
25592
|
-
hash$4 = Buffer$
|
|
25592
|
+
hash$4 = Buffer$15.concat([tag, hash$4]);
|
|
25593
25593
|
var len$1 = pub.modulus.byteLength();
|
|
25594
25594
|
var pad$1 = [1];
|
|
25595
25595
|
var padNum = 0;
|
|
@@ -25600,11 +25600,11 @@ var ExcelTS = (function(exports) {
|
|
|
25600
25600
|
pad$1.push(0);
|
|
25601
25601
|
var i$2 = -1;
|
|
25602
25602
|
while (++i$2 < hash$4.length) pad$1.push(hash$4[i$2]);
|
|
25603
|
-
pad$1 = Buffer$
|
|
25603
|
+
pad$1 = Buffer$15.from(pad$1);
|
|
25604
25604
|
var red = BN$4.mont(pub.modulus);
|
|
25605
25605
|
sig = new BN$4(sig).toRed(red);
|
|
25606
25606
|
sig = sig.redPow(new BN$4(pub.publicExponent));
|
|
25607
|
-
sig = Buffer$
|
|
25607
|
+
sig = Buffer$15.from(sig.fromRed().toArray());
|
|
25608
25608
|
var out = padNum < 8 ? 1 : 0;
|
|
25609
25609
|
len$1 = Math.min(sig.length, pad$1.length);
|
|
25610
25610
|
if (sig.length !== pad$1.length) out = 1;
|
|
@@ -25643,7 +25643,7 @@ var ExcelTS = (function(exports) {
|
|
|
25643
25643
|
//#endregion
|
|
25644
25644
|
//#region node_modules/.pnpm/browserify-sign@4.2.5/node_modules/browserify-sign/browser/index.js
|
|
25645
25645
|
var require_browser$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25646
|
-
var Buffer$
|
|
25646
|
+
var Buffer$14 = require_safe_buffer$1().Buffer;
|
|
25647
25647
|
var createHash$3 = require_browser$9();
|
|
25648
25648
|
var stream = require_readable_browser();
|
|
25649
25649
|
var inherits$1 = require_inherits_browser();
|
|
@@ -25651,7 +25651,7 @@ var ExcelTS = (function(exports) {
|
|
|
25651
25651
|
var verify = require_verify();
|
|
25652
25652
|
var algorithms = require_algorithms();
|
|
25653
25653
|
Object.keys(algorithms).forEach(function(key$1) {
|
|
25654
|
-
algorithms[key$1].id = Buffer$
|
|
25654
|
+
algorithms[key$1].id = Buffer$14.from(algorithms[key$1].id, "hex");
|
|
25655
25655
|
algorithms[key$1.toLowerCase()] = algorithms[key$1];
|
|
25656
25656
|
});
|
|
25657
25657
|
function Sign(algorithm) {
|
|
@@ -25669,7 +25669,7 @@ var ExcelTS = (function(exports) {
|
|
|
25669
25669
|
done$2();
|
|
25670
25670
|
};
|
|
25671
25671
|
Sign.prototype.update = function update(data, enc) {
|
|
25672
|
-
this._hash.update(typeof data === "string" ? Buffer$
|
|
25672
|
+
this._hash.update(typeof data === "string" ? Buffer$14.from(data, enc) : data);
|
|
25673
25673
|
return this;
|
|
25674
25674
|
};
|
|
25675
25675
|
Sign.prototype.sign = function signMethod(key$1, enc) {
|
|
@@ -25691,11 +25691,11 @@ var ExcelTS = (function(exports) {
|
|
|
25691
25691
|
done$2();
|
|
25692
25692
|
};
|
|
25693
25693
|
Verify.prototype.update = function update(data, enc) {
|
|
25694
|
-
this._hash.update(typeof data === "string" ? Buffer$
|
|
25694
|
+
this._hash.update(typeof data === "string" ? Buffer$14.from(data, enc) : data);
|
|
25695
25695
|
return this;
|
|
25696
25696
|
};
|
|
25697
25697
|
Verify.prototype.verify = function verifyMethod(key$1, sig, enc) {
|
|
25698
|
-
var sigBuffer = typeof sig === "string" ? Buffer$
|
|
25698
|
+
var sigBuffer = typeof sig === "string" ? Buffer$14.from(sig, enc) : sig;
|
|
25699
25699
|
this.end();
|
|
25700
25700
|
return verify(sigBuffer, this._hash.digest(), key$1, this._signType, this._tag);
|
|
25701
25701
|
};
|
|
@@ -25716,7 +25716,7 @@ var ExcelTS = (function(exports) {
|
|
|
25716
25716
|
//#endregion
|
|
25717
25717
|
//#region node_modules/.pnpm/create-ecdh@4.0.4/node_modules/create-ecdh/browser.js
|
|
25718
25718
|
var require_browser$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25719
|
-
var import_buffer$
|
|
25719
|
+
var import_buffer$7 = require_buffer$1();
|
|
25720
25720
|
var elliptic = require_elliptic();
|
|
25721
25721
|
var BN$3 = require_bn$1();
|
|
25722
25722
|
module.exports = function createECDH(curve$2) {
|
|
@@ -25763,18 +25763,18 @@ var ExcelTS = (function(exports) {
|
|
|
25763
25763
|
this.curve = new elliptic.ec(this.curveType.name);
|
|
25764
25764
|
this.keys = void 0;
|
|
25765
25765
|
}
|
|
25766
|
-
ECDH.prototype.generateKeys = function(enc, format$
|
|
25766
|
+
ECDH.prototype.generateKeys = function(enc, format$3) {
|
|
25767
25767
|
this.keys = this.curve.genKeyPair();
|
|
25768
|
-
return this.getPublicKey(enc, format$
|
|
25768
|
+
return this.getPublicKey(enc, format$3);
|
|
25769
25769
|
};
|
|
25770
25770
|
ECDH.prototype.computeSecret = function(other, inenc, enc) {
|
|
25771
25771
|
inenc = inenc || "utf8";
|
|
25772
|
-
if (!import_buffer$
|
|
25772
|
+
if (!import_buffer$7.Buffer.isBuffer(other)) other = new import_buffer$7.Buffer(other, inenc);
|
|
25773
25773
|
return formatReturnValue(this.curve.keyFromPublic(other).getPublic().mul(this.keys.getPrivate()).getX(), enc, this.curveType.byteLength);
|
|
25774
25774
|
};
|
|
25775
|
-
ECDH.prototype.getPublicKey = function(enc, format$
|
|
25776
|
-
var key$1 = this.keys.getPublic(format$
|
|
25777
|
-
if (format$
|
|
25775
|
+
ECDH.prototype.getPublicKey = function(enc, format$3) {
|
|
25776
|
+
var key$1 = this.keys.getPublic(format$3 === "compressed", true);
|
|
25777
|
+
if (format$3 === "hybrid") if (key$1[key$1.length - 1] % 2) key$1[0] = 7;
|
|
25778
25778
|
else key$1[0] = 6;
|
|
25779
25779
|
return formatReturnValue(key$1, enc);
|
|
25780
25780
|
};
|
|
@@ -25783,13 +25783,13 @@ var ExcelTS = (function(exports) {
|
|
|
25783
25783
|
};
|
|
25784
25784
|
ECDH.prototype.setPublicKey = function(pub, enc) {
|
|
25785
25785
|
enc = enc || "utf8";
|
|
25786
|
-
if (!import_buffer$
|
|
25786
|
+
if (!import_buffer$7.Buffer.isBuffer(pub)) pub = new import_buffer$7.Buffer(pub, enc);
|
|
25787
25787
|
this.keys._importPublic(pub);
|
|
25788
25788
|
return this;
|
|
25789
25789
|
};
|
|
25790
25790
|
ECDH.prototype.setPrivateKey = function(priv, enc) {
|
|
25791
25791
|
enc = enc || "utf8";
|
|
25792
|
-
if (!import_buffer$
|
|
25792
|
+
if (!import_buffer$7.Buffer.isBuffer(priv)) priv = new import_buffer$7.Buffer(priv, enc);
|
|
25793
25793
|
var _priv = new BN$3(priv);
|
|
25794
25794
|
_priv = _priv.toString(16);
|
|
25795
25795
|
this.keys = this.curve.genKeyPair();
|
|
@@ -25798,11 +25798,11 @@ var ExcelTS = (function(exports) {
|
|
|
25798
25798
|
};
|
|
25799
25799
|
function formatReturnValue(bn$1, enc, len$1) {
|
|
25800
25800
|
if (!Array.isArray(bn$1)) bn$1 = bn$1.toArray();
|
|
25801
|
-
var buf = new import_buffer$
|
|
25801
|
+
var buf = new import_buffer$7.Buffer(bn$1);
|
|
25802
25802
|
if (len$1 && buf.length < len$1) {
|
|
25803
|
-
var zeros = new import_buffer$
|
|
25803
|
+
var zeros = new import_buffer$7.Buffer(len$1 - buf.length);
|
|
25804
25804
|
zeros.fill(0);
|
|
25805
|
-
buf = import_buffer$
|
|
25805
|
+
buf = import_buffer$7.Buffer.concat([zeros, buf]);
|
|
25806
25806
|
}
|
|
25807
25807
|
if (!enc) return buf;
|
|
25808
25808
|
else return buf.toString(enc);
|
|
@@ -25813,19 +25813,19 @@ var ExcelTS = (function(exports) {
|
|
|
25813
25813
|
//#region node_modules/.pnpm/public-encrypt@4.0.3/node_modules/public-encrypt/mgf.js
|
|
25814
25814
|
var require_mgf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25815
25815
|
var createHash$2 = require_browser$9();
|
|
25816
|
-
var Buffer$
|
|
25816
|
+
var Buffer$12 = require_safe_buffer$1().Buffer;
|
|
25817
25817
|
module.exports = function(seed, len$1) {
|
|
25818
|
-
var t = Buffer$
|
|
25818
|
+
var t = Buffer$12.alloc(0);
|
|
25819
25819
|
var i$2 = 0;
|
|
25820
25820
|
var c;
|
|
25821
25821
|
while (t.length < len$1) {
|
|
25822
25822
|
c = i2ops(i$2++);
|
|
25823
|
-
t = Buffer$
|
|
25823
|
+
t = Buffer$12.concat([t, createHash$2("sha1").update(seed).update(c).digest()]);
|
|
25824
25824
|
}
|
|
25825
25825
|
return t.slice(0, len$1);
|
|
25826
25826
|
};
|
|
25827
25827
|
function i2ops(c) {
|
|
25828
|
-
var out = Buffer$
|
|
25828
|
+
var out = Buffer$12.allocUnsafe(4);
|
|
25829
25829
|
out.writeUInt32BE(c, 0);
|
|
25830
25830
|
return out;
|
|
25831
25831
|
}
|
|
@@ -25846,9 +25846,9 @@ var ExcelTS = (function(exports) {
|
|
|
25846
25846
|
//#region node_modules/.pnpm/public-encrypt@4.0.3/node_modules/public-encrypt/withPublic.js
|
|
25847
25847
|
var require_withPublic = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25848
25848
|
var BN$2 = require_bn$1();
|
|
25849
|
-
var Buffer$
|
|
25849
|
+
var Buffer$11 = require_safe_buffer$1().Buffer;
|
|
25850
25850
|
function withPublic$2(paddedMsg, key$1) {
|
|
25851
|
-
return Buffer$
|
|
25851
|
+
return Buffer$11.from(paddedMsg.toRed(BN$2.mont(key$1.modulus)).redPow(new BN$2(key$1.publicExponent)).fromRed().toArray());
|
|
25852
25852
|
}
|
|
25853
25853
|
module.exports = withPublic$2;
|
|
25854
25854
|
}));
|
|
@@ -25864,7 +25864,7 @@ var ExcelTS = (function(exports) {
|
|
|
25864
25864
|
var BN$1 = require_bn$1();
|
|
25865
25865
|
var withPublic$1 = require_withPublic();
|
|
25866
25866
|
var crt$1 = require_browserify_rsa();
|
|
25867
|
-
var Buffer$
|
|
25867
|
+
var Buffer$10 = require_safe_buffer$1().Buffer;
|
|
25868
25868
|
module.exports = function publicEncrypt$1(publicKey, msg, reverse) {
|
|
25869
25869
|
var padding;
|
|
25870
25870
|
if (publicKey.padding) padding = publicKey.padding;
|
|
@@ -25884,22 +25884,22 @@ var ExcelTS = (function(exports) {
|
|
|
25884
25884
|
function oaep$1(key$1, msg) {
|
|
25885
25885
|
var k = key$1.modulus.byteLength();
|
|
25886
25886
|
var mLen = msg.length;
|
|
25887
|
-
var iHash = createHash$1("sha1").update(Buffer$
|
|
25887
|
+
var iHash = createHash$1("sha1").update(Buffer$10.alloc(0)).digest();
|
|
25888
25888
|
var hLen = iHash.length;
|
|
25889
25889
|
var hLen2 = 2 * hLen;
|
|
25890
25890
|
if (mLen > k - hLen2 - 2) throw new Error("message too long");
|
|
25891
|
-
var ps = Buffer$
|
|
25891
|
+
var ps = Buffer$10.alloc(k - mLen - hLen2 - 2);
|
|
25892
25892
|
var dblen = k - hLen - 1;
|
|
25893
25893
|
var seed = randomBytes(hLen);
|
|
25894
|
-
var maskedDb = xor$1(Buffer$
|
|
25894
|
+
var maskedDb = xor$1(Buffer$10.concat([
|
|
25895
25895
|
iHash,
|
|
25896
25896
|
ps,
|
|
25897
|
-
Buffer$
|
|
25897
|
+
Buffer$10.alloc(1, 1),
|
|
25898
25898
|
msg
|
|
25899
25899
|
], dblen), mgf$1(seed, dblen));
|
|
25900
25900
|
var maskedSeed = xor$1(seed, mgf$1(maskedDb, hLen));
|
|
25901
|
-
return new BN$1(Buffer$
|
|
25902
|
-
Buffer$
|
|
25901
|
+
return new BN$1(Buffer$10.concat([
|
|
25902
|
+
Buffer$10.alloc(1),
|
|
25903
25903
|
maskedSeed,
|
|
25904
25904
|
maskedDb
|
|
25905
25905
|
], k));
|
|
@@ -25909,17 +25909,17 @@ var ExcelTS = (function(exports) {
|
|
|
25909
25909
|
var k = key$1.modulus.byteLength();
|
|
25910
25910
|
if (mLen > k - 11) throw new Error("message too long");
|
|
25911
25911
|
var ps;
|
|
25912
|
-
if (reverse) ps = Buffer$
|
|
25912
|
+
if (reverse) ps = Buffer$10.alloc(k - mLen - 3, 255);
|
|
25913
25913
|
else ps = nonZero(k - mLen - 3);
|
|
25914
|
-
return new BN$1(Buffer$
|
|
25915
|
-
Buffer$
|
|
25914
|
+
return new BN$1(Buffer$10.concat([
|
|
25915
|
+
Buffer$10.from([0, reverse ? 1 : 2]),
|
|
25916
25916
|
ps,
|
|
25917
|
-
Buffer$
|
|
25917
|
+
Buffer$10.alloc(1),
|
|
25918
25918
|
msg
|
|
25919
25919
|
], k));
|
|
25920
25920
|
}
|
|
25921
25921
|
function nonZero(len$1) {
|
|
25922
|
-
var out = Buffer$
|
|
25922
|
+
var out = Buffer$10.allocUnsafe(len$1);
|
|
25923
25923
|
var i$2 = 0;
|
|
25924
25924
|
var cache$1 = randomBytes(len$1 * 2);
|
|
25925
25925
|
var cur = 0;
|
|
@@ -25946,7 +25946,7 @@ var ExcelTS = (function(exports) {
|
|
|
25946
25946
|
var crt = require_browserify_rsa();
|
|
25947
25947
|
var createHash = require_browser$9();
|
|
25948
25948
|
var withPublic = require_withPublic();
|
|
25949
|
-
var Buffer$
|
|
25949
|
+
var Buffer$9 = require_safe_buffer$1().Buffer;
|
|
25950
25950
|
module.exports = function privateDecrypt(privateKey, enc, reverse) {
|
|
25951
25951
|
var padding;
|
|
25952
25952
|
if (privateKey.padding) padding = privateKey.padding;
|
|
@@ -25958,8 +25958,8 @@ var ExcelTS = (function(exports) {
|
|
|
25958
25958
|
var msg;
|
|
25959
25959
|
if (reverse) msg = withPublic(new BN(enc), key$1);
|
|
25960
25960
|
else msg = crt(enc, key$1);
|
|
25961
|
-
var zBuffer = Buffer$
|
|
25962
|
-
msg = Buffer$
|
|
25961
|
+
var zBuffer = Buffer$9.alloc(k - msg.length);
|
|
25962
|
+
msg = Buffer$9.concat([zBuffer, msg], k);
|
|
25963
25963
|
if (padding === 4) return oaep(key$1, msg);
|
|
25964
25964
|
else if (padding === 1) return pkcs1(key$1, msg, reverse);
|
|
25965
25965
|
else if (padding === 3) return msg;
|
|
@@ -25967,7 +25967,7 @@ var ExcelTS = (function(exports) {
|
|
|
25967
25967
|
};
|
|
25968
25968
|
function oaep(key$1, msg) {
|
|
25969
25969
|
var k = key$1.modulus.byteLength();
|
|
25970
|
-
var iHash = createHash("sha1").update(Buffer$
|
|
25970
|
+
var iHash = createHash("sha1").update(Buffer$9.alloc(0)).digest();
|
|
25971
25971
|
var hLen = iHash.length;
|
|
25972
25972
|
if (msg[0] !== 0) throw new Error("decryption error");
|
|
25973
25973
|
var maskedSeed = msg.slice(1, hLen + 1);
|
|
@@ -25994,8 +25994,8 @@ var ExcelTS = (function(exports) {
|
|
|
25994
25994
|
return msg.slice(i$2);
|
|
25995
25995
|
}
|
|
25996
25996
|
function compare(a, b) {
|
|
25997
|
-
a = Buffer$
|
|
25998
|
-
b = Buffer$
|
|
25997
|
+
a = Buffer$9.from(a);
|
|
25998
|
+
b = Buffer$9.from(b);
|
|
25999
25999
|
var dif = 0;
|
|
26000
26000
|
var len$1 = a.length;
|
|
26001
26001
|
if (a.length !== b.length) {
|
|
@@ -26030,7 +26030,7 @@ var ExcelTS = (function(exports) {
|
|
|
26030
26030
|
}
|
|
26031
26031
|
var safeBuffer = require_safe_buffer$1();
|
|
26032
26032
|
var randombytes = require_browser$11();
|
|
26033
|
-
var Buffer$
|
|
26033
|
+
var Buffer$8 = safeBuffer.Buffer;
|
|
26034
26034
|
var kBufferMaxLength = safeBuffer.kMaxLength;
|
|
26035
26035
|
var crypto$2 = global.crypto || global.msCrypto;
|
|
26036
26036
|
var kMaxUint32 = Math.pow(2, 32) - 1;
|
|
@@ -26052,7 +26052,7 @@ var ExcelTS = (function(exports) {
|
|
|
26052
26052
|
exports.randomFillSync = oldBrowser;
|
|
26053
26053
|
}
|
|
26054
26054
|
function randomFill(buf, offset, size, cb) {
|
|
26055
|
-
if (!Buffer$
|
|
26055
|
+
if (!Buffer$8.isBuffer(buf) && !(buf instanceof global.Uint8Array)) throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");
|
|
26056
26056
|
if (typeof offset === "function") {
|
|
26057
26057
|
cb = offset;
|
|
26058
26058
|
offset = 0;
|
|
@@ -26091,7 +26091,7 @@ var ExcelTS = (function(exports) {
|
|
|
26091
26091
|
}
|
|
26092
26092
|
function randomFillSync(buf, offset, size) {
|
|
26093
26093
|
if (typeof offset === "undefined") offset = 0;
|
|
26094
|
-
if (!Buffer$
|
|
26094
|
+
if (!Buffer$8.isBuffer(buf) && !(buf instanceof global.Uint8Array)) throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");
|
|
26095
26095
|
assertOffset(offset, buf.length);
|
|
26096
26096
|
if (size === void 0) size = buf.length - offset;
|
|
26097
26097
|
assertSize(size, offset, buf.length);
|
|
@@ -26177,21 +26177,21 @@ var ExcelTS = (function(exports) {
|
|
|
26177
26177
|
|
|
26178
26178
|
//#endregion
|
|
26179
26179
|
//#region src/utils/encryptor.ts
|
|
26180
|
-
var import_buffer$
|
|
26180
|
+
var import_buffer$6 = require_buffer$1();
|
|
26181
26181
|
var import_crypto_browserify = /* @__PURE__ */ __toESM(require_crypto_browserify(), 1);
|
|
26182
26182
|
const Encryptor = {
|
|
26183
26183
|
hash(algorithm, ...buffers) {
|
|
26184
26184
|
const hash$4 = import_crypto_browserify.createHash(algorithm);
|
|
26185
|
-
hash$4.update(import_buffer$
|
|
26185
|
+
hash$4.update(import_buffer$6.Buffer.concat(buffers));
|
|
26186
26186
|
return hash$4.digest();
|
|
26187
26187
|
},
|
|
26188
26188
|
convertPasswordToHash(password, hashAlgorithm, saltValue, spinCount) {
|
|
26189
26189
|
hashAlgorithm = hashAlgorithm.toLowerCase();
|
|
26190
26190
|
if (import_crypto_browserify.getHashes().indexOf(hashAlgorithm) < 0) throw new Error(`Hash algorithm '${hashAlgorithm}' not supported!`);
|
|
26191
|
-
const passwordBuffer = import_buffer$
|
|
26192
|
-
let key$1 = this.hash(hashAlgorithm, import_buffer$
|
|
26191
|
+
const passwordBuffer = import_buffer$6.Buffer.from(password, "utf16le");
|
|
26192
|
+
let key$1 = this.hash(hashAlgorithm, import_buffer$6.Buffer.from(saltValue, "base64"), passwordBuffer);
|
|
26193
26193
|
for (let i$2 = 0; i$2 < spinCount; i$2++) {
|
|
26194
|
-
const iterator = import_buffer$
|
|
26194
|
+
const iterator = import_buffer$6.Buffer.alloc(4);
|
|
26195
26195
|
iterator.writeUInt32LE(i$2, 0);
|
|
26196
26196
|
key$1 = this.hash(hashAlgorithm, key$1, iterator);
|
|
26197
26197
|
}
|
|
@@ -26334,6 +26334,15 @@ var ExcelTS = (function(exports) {
|
|
|
26334
26334
|
return result;
|
|
26335
26335
|
}, {});
|
|
26336
26336
|
}
|
|
26337
|
+
const textDecoder = new TextDecoder("utf-8");
|
|
26338
|
+
/**
|
|
26339
|
+
* Convert a Buffer or ArrayBuffer to a UTF-8 string
|
|
26340
|
+
* Works in both Node.js and browser environments
|
|
26341
|
+
*/
|
|
26342
|
+
function bufferToString(chunk) {
|
|
26343
|
+
if (typeof chunk === "string") return chunk;
|
|
26344
|
+
return textDecoder.decode(chunk);
|
|
26345
|
+
}
|
|
26337
26346
|
|
|
26338
26347
|
//#endregion
|
|
26339
26348
|
//#region src/doc/pivot-table.ts
|
|
@@ -28520,10 +28529,10 @@ Please leave feedback at https://github.com/excelts/excelts/discussions/2575`);
|
|
|
28520
28529
|
//#region src/utils/string-buf.ts
|
|
28521
28530
|
var import_stream_browserify$1 = require_stream_browserify();
|
|
28522
28531
|
var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
28523
|
-
var import_buffer$
|
|
28532
|
+
var import_buffer$5 = require_buffer$1();
|
|
28524
28533
|
var StringBuf = class {
|
|
28525
28534
|
constructor(options) {
|
|
28526
|
-
this._buf = import_buffer$
|
|
28535
|
+
this._buf = import_buffer$5.Buffer.alloc(options && options.size || 16384);
|
|
28527
28536
|
this._encoding = options && options.encoding || "utf8";
|
|
28528
28537
|
this._inPos = 0;
|
|
28529
28538
|
this._buffer = void 0;
|
|
@@ -28539,7 +28548,7 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28539
28548
|
}
|
|
28540
28549
|
toBuffer() {
|
|
28541
28550
|
if (!this._buffer) {
|
|
28542
|
-
this._buffer = import_buffer$
|
|
28551
|
+
this._buffer = import_buffer$5.Buffer.alloc(this.length);
|
|
28543
28552
|
this._buf.copy(this._buffer, 0, 0, this.length);
|
|
28544
28553
|
}
|
|
28545
28554
|
return this._buffer;
|
|
@@ -28552,7 +28561,7 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28552
28561
|
_grow(min$1) {
|
|
28553
28562
|
let size = this._buf.length * 2;
|
|
28554
28563
|
while (size < min$1) size *= 2;
|
|
28555
|
-
const buf = import_buffer$
|
|
28564
|
+
const buf = import_buffer$5.Buffer.alloc(size);
|
|
28556
28565
|
this._buf.copy(buf, 0);
|
|
28557
28566
|
this._buf = buf;
|
|
28558
28567
|
}
|
|
@@ -28577,8 +28586,7 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28577
28586
|
|
|
28578
28587
|
//#endregion
|
|
28579
28588
|
//#region src/utils/stream-buf.ts
|
|
28580
|
-
var import_buffer$
|
|
28581
|
-
init_process();
|
|
28589
|
+
var import_buffer$4 = require_buffer$1();
|
|
28582
28590
|
var StringChunk = class {
|
|
28583
28591
|
constructor(data, encoding) {
|
|
28584
28592
|
this._data = data;
|
|
@@ -28591,7 +28599,7 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28591
28599
|
return this.toBuffer().copy(target, targetOffset, offset, length);
|
|
28592
28600
|
}
|
|
28593
28601
|
toBuffer() {
|
|
28594
|
-
if (!this._buffer) this._buffer = import_buffer$
|
|
28602
|
+
if (!this._buffer) this._buffer = import_buffer$4.Buffer.from(this._data, this._encoding);
|
|
28595
28603
|
return this._buffer;
|
|
28596
28604
|
}
|
|
28597
28605
|
};
|
|
@@ -28626,13 +28634,13 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28626
28634
|
var ReadWriteBuf = class {
|
|
28627
28635
|
constructor(size) {
|
|
28628
28636
|
this.size = size;
|
|
28629
|
-
this.buffer = import_buffer$
|
|
28637
|
+
this.buffer = import_buffer$4.Buffer.alloc(size);
|
|
28630
28638
|
this.iRead = 0;
|
|
28631
28639
|
this.iWrite = 0;
|
|
28632
28640
|
}
|
|
28633
28641
|
toBuffer() {
|
|
28634
28642
|
if (this.iRead === 0 && this.iWrite === this.size) return this.buffer;
|
|
28635
|
-
const buf = import_buffer$
|
|
28643
|
+
const buf = import_buffer$4.Buffer.alloc(this.iWrite - this.iRead);
|
|
28636
28644
|
this.buffer.copy(buf, 0, this.iRead, this.iWrite);
|
|
28637
28645
|
return buf;
|
|
28638
28646
|
}
|
|
@@ -28653,7 +28661,7 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28653
28661
|
this.iRead = this.iWrite;
|
|
28654
28662
|
return buf;
|
|
28655
28663
|
}
|
|
28656
|
-
buf = import_buffer$
|
|
28664
|
+
buf = import_buffer$4.Buffer.alloc(size);
|
|
28657
28665
|
this.buffer.copy(buf, 0, this.iRead, size);
|
|
28658
28666
|
this.iRead += size;
|
|
28659
28667
|
return buf;
|
|
@@ -28684,7 +28692,7 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28684
28692
|
switch (this.buffers.length) {
|
|
28685
28693
|
case 0: return null;
|
|
28686
28694
|
case 1: return this.buffers[0].toBuffer();
|
|
28687
|
-
default: return import_buffer$
|
|
28695
|
+
default: return import_buffer$4.Buffer.concat(this.buffers.map((rwBuf) => rwBuf.toBuffer()));
|
|
28688
28696
|
}
|
|
28689
28697
|
},
|
|
28690
28698
|
_getWritableBuffer() {
|
|
@@ -28722,9 +28730,11 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28722
28730
|
callback = callback || nop;
|
|
28723
28731
|
let chunk;
|
|
28724
28732
|
if (data instanceof StringBuf || data && data.constructor?.name === "StringBuf") chunk = new StringBufChunk(data);
|
|
28725
|
-
else if (
|
|
28726
|
-
else if (
|
|
28727
|
-
else
|
|
28733
|
+
else if (import_buffer$4.Buffer.isBuffer(data)) chunk = new BufferChunk(data);
|
|
28734
|
+
else if (ArrayBuffer.isView(data)) chunk = new BufferChunk(import_buffer$4.Buffer.from(data.buffer, data.byteOffset, data.byteLength));
|
|
28735
|
+
else if (data instanceof ArrayBuffer) chunk = new BufferChunk(import_buffer$4.Buffer.from(data));
|
|
28736
|
+
else if (typeof data === "string" || data instanceof String) chunk = new StringChunk(String(data), encoding);
|
|
28737
|
+
else throw new Error("Chunk must be one of type String, Buffer, Uint8Array, ArrayBuffer or StringBuf.");
|
|
28728
28738
|
if (this.pipes.length) if (this.batch) {
|
|
28729
28739
|
this._writeToBuffers(chunk);
|
|
28730
28740
|
while (!this.corked && this.buffers.length > 1) this._pipe(this.buffers.shift());
|
|
@@ -28733,7 +28743,7 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28733
28743
|
callback();
|
|
28734
28744
|
} else {
|
|
28735
28745
|
this._writeToBuffers(chunk);
|
|
28736
|
-
|
|
28746
|
+
queueMicrotask(() => callback());
|
|
28737
28747
|
}
|
|
28738
28748
|
else {
|
|
28739
28749
|
if (!this.paused) this.emit("data", chunk.toBuffer());
|
|
@@ -28777,11 +28787,11 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28777
28787
|
buffers.push(buffer$2);
|
|
28778
28788
|
if (first.eod && first.full) this.buffers.shift();
|
|
28779
28789
|
}
|
|
28780
|
-
return import_buffer$
|
|
28790
|
+
return import_buffer$4.Buffer.concat(buffers);
|
|
28781
28791
|
}
|
|
28782
28792
|
buffers = this.buffers.map((buf) => buf.toBuffer()).filter(Boolean);
|
|
28783
28793
|
this.buffers = [];
|
|
28784
|
-
return import_buffer$
|
|
28794
|
+
return import_buffer$4.Buffer.concat(buffers);
|
|
28785
28795
|
},
|
|
28786
28796
|
setEncoding(encoding) {
|
|
28787
28797
|
this.encoding = encoding;
|
|
@@ -28811,20 +28821,6 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28811
28821
|
}
|
|
28812
28822
|
});
|
|
28813
28823
|
|
|
28814
|
-
//#endregion
|
|
28815
|
-
//#region src/utils/browser-buffer-encode.ts
|
|
28816
|
-
var import_buffer$4 = require_buffer$1();
|
|
28817
|
-
const textEncoder = typeof TextEncoder === "undefined" ? null : new TextEncoder();
|
|
28818
|
-
function stringToBuffer(str) {
|
|
28819
|
-
if (typeof str !== "string") return str;
|
|
28820
|
-
if (textEncoder) return import_buffer$4.Buffer.from(textEncoder.encode(str).buffer);
|
|
28821
|
-
return import_buffer$4.Buffer.from(str);
|
|
28822
|
-
}
|
|
28823
|
-
|
|
28824
|
-
//#endregion
|
|
28825
|
-
//#region src/utils/browser.ts
|
|
28826
|
-
const isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && typeof navigator !== "undefined";
|
|
28827
|
-
|
|
28828
28824
|
//#endregion
|
|
28829
28825
|
//#region src/utils/zip-stream.ts
|
|
28830
28826
|
var import_buffer$3 = require_buffer$1();
|
|
@@ -28852,15 +28848,11 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
28852
28848
|
let buffer$2;
|
|
28853
28849
|
if (Object.prototype.hasOwnProperty.call(options, "base64") && options.base64) {
|
|
28854
28850
|
const base64Data = typeof data === "string" ? data : data.toString();
|
|
28855
|
-
|
|
28856
|
-
|
|
28857
|
-
|
|
28858
|
-
|
|
28859
|
-
|
|
28860
|
-
} else buffer$2 = import_buffer$3.Buffer.from(base64Data, "base64");
|
|
28861
|
-
} else if (typeof data === "string") if (isBrowser) buffer$2 = stringToBuffer(data);
|
|
28862
|
-
else buffer$2 = import_buffer$3.Buffer.from(data, "utf8");
|
|
28863
|
-
else if (import_buffer$3.Buffer.isBuffer(data)) buffer$2 = new Uint8Array(data);
|
|
28851
|
+
buffer$2 = import_buffer$3.Buffer.from(base64Data, "base64");
|
|
28852
|
+
} else if (typeof data === "string") buffer$2 = import_buffer$3.Buffer.from(data, "utf8");
|
|
28853
|
+
else if (import_buffer$3.Buffer.isBuffer(data)) buffer$2 = data;
|
|
28854
|
+
else if (ArrayBuffer.isView(data)) buffer$2 = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
28855
|
+
else if (data instanceof ArrayBuffer) buffer$2 = new Uint8Array(data);
|
|
28864
28856
|
else buffer$2 = data;
|
|
28865
28857
|
const zipFile = this.options.compression !== "STORE" ? new ZipDeflate(options.name, { level: this.compressionLevel }) : new ZipPassThrough(options.name);
|
|
28866
28858
|
this.zip.add(zipFile);
|
|
@@ -29028,15 +29020,6 @@ var import_events = /* @__PURE__ */ __toESM(require_events(), 1);
|
|
|
29028
29020
|
}
|
|
29029
29021
|
};
|
|
29030
29022
|
|
|
29031
|
-
//#endregion
|
|
29032
|
-
//#region src/utils/browser-buffer-decode.ts
|
|
29033
|
-
const textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder("utf-8");
|
|
29034
|
-
function bufferToString(chunk) {
|
|
29035
|
-
if (typeof chunk === "string") return chunk;
|
|
29036
|
-
if (textDecoder) return textDecoder.decode(chunk);
|
|
29037
|
-
return String.fromCharCode(...new Uint8Array(chunk));
|
|
29038
|
-
}
|
|
29039
|
-
|
|
29040
29023
|
//#endregion
|
|
29041
29024
|
//#region node_modules/.pnpm/xmlchars@2.2.0/node_modules/xmlchars/xml/1.0/ed5.js
|
|
29042
29025
|
var require_ed5 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -40365,10 +40348,10 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
40365
40348
|
return FormatterOptions_2.FormatterOptions;
|
|
40366
40349
|
}
|
|
40367
40350
|
});
|
|
40368
|
-
const format$
|
|
40351
|
+
const format$2 = (options) => {
|
|
40369
40352
|
return new CsvFormatterStream_1.CsvFormatterStream(new FormatterOptions_1.FormatterOptions(options));
|
|
40370
40353
|
};
|
|
40371
|
-
exports.format = format$
|
|
40354
|
+
exports.format = format$2;
|
|
40372
40355
|
const write = (rows, options) => {
|
|
40373
40356
|
const csvStream = (0, exports.format)(options);
|
|
40374
40357
|
const promiseWrite = (0, util_1.promisify)((row, cb) => {
|
|
@@ -45031,45 +45014,548 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45031
45014
|
}({});
|
|
45032
45015
|
|
|
45033
45016
|
//#endregion
|
|
45034
|
-
//#region src/utils/
|
|
45017
|
+
//#region src/utils/cell-format.ts
|
|
45018
|
+
/**
|
|
45019
|
+
* Excel Cell Format Parser
|
|
45020
|
+
* A simplified implementation for formatting cell values according to Excel numFmt patterns
|
|
45021
|
+
* Supports: General, percentages, decimals, thousands separators, dates, currencies,
|
|
45022
|
+
* scientific notation, fractions, elapsed time, and more
|
|
45023
|
+
*/
|
|
45024
|
+
/**
|
|
45025
|
+
* Pad number with leading zeros
|
|
45026
|
+
*/
|
|
45027
|
+
function pad0(num, len$1) {
|
|
45028
|
+
let s$1 = Math.round(num).toString();
|
|
45029
|
+
while (s$1.length < len$1) s$1 = "0" + s$1;
|
|
45030
|
+
return s$1;
|
|
45031
|
+
}
|
|
45032
|
+
/**
|
|
45033
|
+
* Add thousand separators to a number string
|
|
45034
|
+
*/
|
|
45035
|
+
function commaify(s$1) {
|
|
45036
|
+
const w = 3;
|
|
45037
|
+
if (s$1.length <= w) return s$1;
|
|
45038
|
+
const j = s$1.length % w;
|
|
45039
|
+
let o = s$1.substring(0, j);
|
|
45040
|
+
for (let i$2 = j; i$2 < s$1.length; i$2 += w) o += (o.length > 0 ? "," : "") + s$1.substring(i$2, i$2 + w);
|
|
45041
|
+
return o;
|
|
45042
|
+
}
|
|
45043
|
+
/**
|
|
45044
|
+
* Round a number to specified decimal places
|
|
45045
|
+
*/
|
|
45046
|
+
function roundTo(val, decimals) {
|
|
45047
|
+
const factor = Math.pow(10, decimals);
|
|
45048
|
+
return Math.round(val * factor) / factor;
|
|
45049
|
+
}
|
|
45050
|
+
/**
|
|
45051
|
+
* Process _ (underscore) placeholder - adds space with width of next character
|
|
45052
|
+
* Process * (asterisk) placeholder - repeats next character to fill width (simplified to single char)
|
|
45053
|
+
*/
|
|
45054
|
+
function processPlaceholders(fmt) {
|
|
45055
|
+
let result = fmt.replace(/_./g, " ");
|
|
45056
|
+
result = result.replace(/\*./g, "");
|
|
45057
|
+
return result;
|
|
45058
|
+
}
|
|
45059
|
+
/**
|
|
45060
|
+
* Check if format is "General"
|
|
45061
|
+
*/
|
|
45062
|
+
function isGeneral(fmt) {
|
|
45063
|
+
return /^General$/i.test(fmt.trim());
|
|
45064
|
+
}
|
|
45065
|
+
/**
|
|
45066
|
+
* Check if format is a date format
|
|
45067
|
+
*/
|
|
45068
|
+
function isDateFormat(fmt) {
|
|
45069
|
+
const cleaned = fmt.replace(/\[[^\]]*\]/g, "");
|
|
45070
|
+
return /[ymdhs]/i.test(cleaned) && !/^[#0.,E%$\s()\-+]+$/i.test(cleaned);
|
|
45071
|
+
}
|
|
45072
|
+
const MONTHS_SHORT = [
|
|
45073
|
+
"Jan",
|
|
45074
|
+
"Feb",
|
|
45075
|
+
"Mar",
|
|
45076
|
+
"Apr",
|
|
45077
|
+
"May",
|
|
45078
|
+
"Jun",
|
|
45079
|
+
"Jul",
|
|
45080
|
+
"Aug",
|
|
45081
|
+
"Sep",
|
|
45082
|
+
"Oct",
|
|
45083
|
+
"Nov",
|
|
45084
|
+
"Dec"
|
|
45085
|
+
];
|
|
45086
|
+
const MONTHS_LONG = [
|
|
45087
|
+
"January",
|
|
45088
|
+
"February",
|
|
45089
|
+
"March",
|
|
45090
|
+
"April",
|
|
45091
|
+
"May",
|
|
45092
|
+
"June",
|
|
45093
|
+
"July",
|
|
45094
|
+
"August",
|
|
45095
|
+
"September",
|
|
45096
|
+
"October",
|
|
45097
|
+
"November",
|
|
45098
|
+
"December"
|
|
45099
|
+
];
|
|
45100
|
+
const MONTHS_LETTER = [
|
|
45101
|
+
"J",
|
|
45102
|
+
"F",
|
|
45103
|
+
"M",
|
|
45104
|
+
"A",
|
|
45105
|
+
"M",
|
|
45106
|
+
"J",
|
|
45107
|
+
"J",
|
|
45108
|
+
"A",
|
|
45109
|
+
"S",
|
|
45110
|
+
"O",
|
|
45111
|
+
"N",
|
|
45112
|
+
"D"
|
|
45113
|
+
];
|
|
45114
|
+
const DAYS_SHORT = [
|
|
45115
|
+
"Sun",
|
|
45116
|
+
"Mon",
|
|
45117
|
+
"Tue",
|
|
45118
|
+
"Wed",
|
|
45119
|
+
"Thu",
|
|
45120
|
+
"Fri",
|
|
45121
|
+
"Sat"
|
|
45122
|
+
];
|
|
45123
|
+
const DAYS_LONG = [
|
|
45124
|
+
"Sunday",
|
|
45125
|
+
"Monday",
|
|
45126
|
+
"Tuesday",
|
|
45127
|
+
"Wednesday",
|
|
45128
|
+
"Thursday",
|
|
45129
|
+
"Friday",
|
|
45130
|
+
"Saturday"
|
|
45131
|
+
];
|
|
45132
|
+
/**
|
|
45133
|
+
* Format a date value using Excel date format
|
|
45134
|
+
* @param serial Excel serial number (days since 1900-01-01)
|
|
45135
|
+
* @param fmt Format string
|
|
45136
|
+
*/
|
|
45137
|
+
function formatDate(serial, fmt) {
|
|
45138
|
+
const date = excelToDate(serial, false);
|
|
45139
|
+
const year = date.getFullYear();
|
|
45140
|
+
const month = date.getMonth();
|
|
45141
|
+
const day = date.getDate();
|
|
45142
|
+
const hours = date.getHours();
|
|
45143
|
+
const minutes = date.getMinutes();
|
|
45144
|
+
const seconds = date.getSeconds();
|
|
45145
|
+
const dayOfWeek = date.getDay();
|
|
45146
|
+
const totalSeconds = serial * 86400;
|
|
45147
|
+
const fractionalSeconds = totalSeconds - Math.floor(totalSeconds);
|
|
45148
|
+
const hasAmPm = /AM\/PM|A\/P/i.test(fmt);
|
|
45149
|
+
const isPm = hours >= 12;
|
|
45150
|
+
const hours12 = hours % 12 || 12;
|
|
45151
|
+
let result = fmt.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi, "");
|
|
45152
|
+
result = processPlaceholders(result);
|
|
45153
|
+
const fracSecMatch = result.match(/ss\.(0+)/i);
|
|
45154
|
+
let fracSecStr = "";
|
|
45155
|
+
if (fracSecMatch) {
|
|
45156
|
+
const decPlaces = fracSecMatch[1].length;
|
|
45157
|
+
fracSecStr = Math.round(fractionalSeconds * Math.pow(10, decPlaces)).toString().padStart(decPlaces, "0");
|
|
45158
|
+
result = result.replace(/ss\.0+/gi, "\0SF\0");
|
|
45159
|
+
}
|
|
45160
|
+
result = result.replace(/yyyy/gi, "\0Y4\0");
|
|
45161
|
+
result = result.replace(/yy/gi, "\0Y2\0");
|
|
45162
|
+
result = result.replace(/mmmmm/gi, "\0MN5\0");
|
|
45163
|
+
result = result.replace(/mmmm/gi, "\0MN4\0");
|
|
45164
|
+
result = result.replace(/mmm/gi, "\0MN3\0");
|
|
45165
|
+
result = result.replace(/dddd/gi, "\0DN4\0");
|
|
45166
|
+
result = result.replace(/ddd/gi, "\0DN3\0");
|
|
45167
|
+
result = result.replace(/dd/gi, "\0D2\0");
|
|
45168
|
+
result = result.replace(/\bd\b/gi, "\0D1\0");
|
|
45169
|
+
result = result.replace(/hh/gi, "\0H2\0");
|
|
45170
|
+
result = result.replace(/\bh\b/gi, "\0H1\0");
|
|
45171
|
+
result = result.replace(/ss/gi, "\0S2\0");
|
|
45172
|
+
result = result.replace(/\bs\b/gi, "\0S1\0");
|
|
45173
|
+
if (/\x00H[12]\x00.*mm|mm.*\x00S[12]\x00/i.test(result)) result = result.replace(/mm/gi, "\0MI2\0");
|
|
45174
|
+
else result = result.replace(/mm/gi, "\0M2\0");
|
|
45175
|
+
result = result.replace(/\bm\b/gi, "\0M1\0");
|
|
45176
|
+
result = result.replace(/AM\/PM/gi, "\0AMPM\0");
|
|
45177
|
+
result = result.replace(/A\/P/gi, "\0AP\0");
|
|
45178
|
+
const hourVal = hasAmPm ? hours12 : hours;
|
|
45179
|
+
result = result.replace(/\x00Y4\x00/g, year.toString()).replace(/\x00Y2\x00/g, (year % 100).toString().padStart(2, "0")).replace(/\x00MN5\x00/g, MONTHS_LETTER[month]).replace(/\x00MN4\x00/g, MONTHS_LONG[month]).replace(/\x00MN3\x00/g, MONTHS_SHORT[month]).replace(/\x00M2\x00/g, (month + 1).toString().padStart(2, "0")).replace(/\x00M1\x00/g, (month + 1).toString()).replace(/\x00DN4\x00/g, DAYS_LONG[dayOfWeek]).replace(/\x00DN3\x00/g, DAYS_SHORT[dayOfWeek]).replace(/\x00D2\x00/g, day.toString().padStart(2, "0")).replace(/\x00D1\x00/g, day.toString()).replace(/\x00H2\x00/g, hourVal.toString().padStart(2, "0")).replace(/\x00H1\x00/g, hourVal.toString()).replace(/\x00MI2\x00/g, minutes.toString().padStart(2, "0")).replace(/\x00S2\x00/g, seconds.toString().padStart(2, "0")).replace(/\x00S1\x00/g, seconds.toString()).replace(/\x00SF\x00/g, seconds.toString().padStart(2, "0") + "." + fracSecStr).replace(/\x00AMPM\x00/g, isPm ? "PM" : "AM").replace(/\x00AP\x00/g, isPm ? "P" : "A");
|
|
45180
|
+
result = result.replace(/\\/g, "");
|
|
45181
|
+
return result;
|
|
45182
|
+
}
|
|
45183
|
+
/**
|
|
45184
|
+
* Format a number using "General" format
|
|
45185
|
+
*/
|
|
45186
|
+
function formatGeneral(val) {
|
|
45187
|
+
if (typeof val === "boolean") return val ? "TRUE" : "FALSE";
|
|
45188
|
+
if (typeof val === "string") return val;
|
|
45189
|
+
if (Number.isInteger(val)) return val.toString();
|
|
45190
|
+
return val.toPrecision(11).replace(/\.?0+$/, "").replace(/\.?0+e/, "e");
|
|
45191
|
+
}
|
|
45192
|
+
/**
|
|
45193
|
+
* Format a percentage value
|
|
45194
|
+
* @param val The decimal value (e.g., 0.25 for 25%)
|
|
45195
|
+
* @param fmt The format string containing %
|
|
45196
|
+
*/
|
|
45197
|
+
function formatPercentage(val, fmt) {
|
|
45198
|
+
const percentCount = (fmt.match(/%/g) || []).length;
|
|
45199
|
+
return formatNumberPattern(val * Math.pow(100, percentCount), fmt.replace(/%/g, "") || "0") + "%".repeat(percentCount);
|
|
45200
|
+
}
|
|
45201
|
+
/**
|
|
45202
|
+
* Format a number in scientific notation
|
|
45203
|
+
* @param val The number to format
|
|
45204
|
+
* @param fmt The format string (e.g., "0.00E+00")
|
|
45205
|
+
*/
|
|
45206
|
+
function formatScientific(val, fmt) {
|
|
45207
|
+
const sign$4 = val < 0 ? "-" : "";
|
|
45208
|
+
const absVal = Math.abs(val);
|
|
45209
|
+
if (absVal === 0) {
|
|
45210
|
+
const decMatch$1 = fmt.match(/\.([0#]+)E/i);
|
|
45211
|
+
const decPlaces$1 = decMatch$1 ? decMatch$1[1].length : 2;
|
|
45212
|
+
return "0." + "0".repeat(decPlaces$1) + "E+00";
|
|
45213
|
+
}
|
|
45214
|
+
const decMatch = fmt.match(/\.([0#]+)E/i);
|
|
45215
|
+
const decPlaces = decMatch ? decMatch[1].length : 2;
|
|
45216
|
+
const hasPlus = fmt.includes("E+");
|
|
45217
|
+
const exp = Math.floor(Math.log10(absVal));
|
|
45218
|
+
const mantissaStr = roundTo(absVal / Math.pow(10, exp), decPlaces).toFixed(decPlaces);
|
|
45219
|
+
const expSign = exp >= 0 ? hasPlus ? "+" : "" : "-";
|
|
45220
|
+
const expStr = pad0(Math.abs(exp), 2);
|
|
45221
|
+
return sign$4 + mantissaStr + "E" + expSign + expStr;
|
|
45222
|
+
}
|
|
45223
|
+
/**
|
|
45224
|
+
* Convert decimal to fraction using continued fraction algorithm
|
|
45225
|
+
*/
|
|
45226
|
+
function toFraction(val, maxDenom) {
|
|
45227
|
+
const sign$4 = val < 0 ? -1 : 1;
|
|
45228
|
+
let absVal = Math.abs(val);
|
|
45229
|
+
const whole = Math.floor(absVal);
|
|
45230
|
+
absVal -= whole;
|
|
45231
|
+
if (absVal < 1e-10) return [
|
|
45232
|
+
sign$4 * whole,
|
|
45233
|
+
0,
|
|
45234
|
+
1
|
|
45235
|
+
];
|
|
45236
|
+
let p0 = 0, p1 = 1;
|
|
45237
|
+
let q0 = 1, q1 = 0;
|
|
45238
|
+
let a = Math.floor(absVal);
|
|
45239
|
+
let p$1 = a;
|
|
45240
|
+
let q = 1;
|
|
45241
|
+
while (q1 < maxDenom) {
|
|
45242
|
+
a = Math.floor(absVal);
|
|
45243
|
+
p$1 = a * p1 + p0;
|
|
45244
|
+
q = a * q1 + q0;
|
|
45245
|
+
if (absVal - a < 1e-10) break;
|
|
45246
|
+
absVal = 1 / (absVal - a);
|
|
45247
|
+
p0 = p1;
|
|
45248
|
+
p1 = p$1;
|
|
45249
|
+
q0 = q1;
|
|
45250
|
+
q1 = q;
|
|
45251
|
+
}
|
|
45252
|
+
if (q > maxDenom) {
|
|
45253
|
+
q = q1;
|
|
45254
|
+
p$1 = p1;
|
|
45255
|
+
}
|
|
45256
|
+
return [
|
|
45257
|
+
sign$4 * whole,
|
|
45258
|
+
sign$4 * p$1,
|
|
45259
|
+
q
|
|
45260
|
+
];
|
|
45261
|
+
}
|
|
45262
|
+
/**
|
|
45263
|
+
* Format a number as a fraction
|
|
45264
|
+
* @param val The number to format
|
|
45265
|
+
* @param fmt The format string (e.g., "# ?/?", "# ??/??")
|
|
45266
|
+
*/
|
|
45267
|
+
function formatFraction(val, fmt) {
|
|
45268
|
+
const sign$4 = val < 0 ? "-" : "";
|
|
45269
|
+
const absVal = Math.abs(val);
|
|
45270
|
+
const fixedDenomMatch = fmt.match(/\?+\s*\/\s*(\d+)/);
|
|
45271
|
+
if (fixedDenomMatch) {
|
|
45272
|
+
const denom$1 = parseInt(fixedDenomMatch[1], 10);
|
|
45273
|
+
const whole$1 = Math.floor(absVal);
|
|
45274
|
+
const frac = absVal - whole$1;
|
|
45275
|
+
const numer$1 = Math.round(frac * denom$1);
|
|
45276
|
+
if (fmt.includes("#") || fmt.includes("0")) {
|
|
45277
|
+
if (numer$1 === 0) return sign$4 + whole$1.toString();
|
|
45278
|
+
return sign$4 + (whole$1 > 0 ? whole$1 + " " : "") + numer$1 + "/" + denom$1;
|
|
45279
|
+
}
|
|
45280
|
+
return sign$4 + (whole$1 * denom$1 + numer$1) + "/" + denom$1;
|
|
45281
|
+
}
|
|
45282
|
+
const denomMatch = fmt.match(/\/\s*(\?+)/);
|
|
45283
|
+
const maxDigits = denomMatch ? denomMatch[1].length : 2;
|
|
45284
|
+
const [whole, numer, denom] = toFraction(absVal, Math.pow(10, maxDigits) - 1);
|
|
45285
|
+
if (fmt.includes("#") && whole !== 0) {
|
|
45286
|
+
if (numer === 0) return sign$4 + Math.abs(whole).toString();
|
|
45287
|
+
return sign$4 + Math.abs(whole) + " " + Math.abs(numer) + "/" + denom;
|
|
45288
|
+
}
|
|
45289
|
+
if (numer === 0) return whole === 0 ? "0" : sign$4 + Math.abs(whole).toString();
|
|
45290
|
+
return sign$4 + (Math.abs(whole) * denom + Math.abs(numer)) + "/" + denom;
|
|
45291
|
+
}
|
|
45292
|
+
/**
|
|
45293
|
+
* Format elapsed time (e.g., [h]:mm:ss for durations > 24 hours)
|
|
45294
|
+
*/
|
|
45295
|
+
function formatElapsedTime(serial, fmt) {
|
|
45296
|
+
const totalSeconds = Math.round(serial * 86400);
|
|
45297
|
+
const totalMinutes = Math.floor(totalSeconds / 60);
|
|
45298
|
+
const totalHours = Math.floor(totalMinutes / 60);
|
|
45299
|
+
const seconds = totalSeconds % 60;
|
|
45300
|
+
const minutes = totalMinutes % 60;
|
|
45301
|
+
const hours = totalHours;
|
|
45302
|
+
let result = fmt;
|
|
45303
|
+
if (/\[h+\]/i.test(result)) result = result.replace(/\[h+\]/gi, hours.toString());
|
|
45304
|
+
if (/\[m+\]/i.test(result)) result = result.replace(/\[m+\]/gi, totalMinutes.toString());
|
|
45305
|
+
if (/\[s+\]/i.test(result)) result = result.replace(/\[s+\]/gi, totalSeconds.toString());
|
|
45306
|
+
result = result.replace(/mm/gi, minutes.toString().padStart(2, "0"));
|
|
45307
|
+
result = result.replace(/ss/gi, seconds.toString().padStart(2, "0"));
|
|
45308
|
+
return result;
|
|
45309
|
+
}
|
|
45310
|
+
/**
|
|
45311
|
+
* Format a number with the given pattern
|
|
45312
|
+
* Handles patterns like "0", "00", "#,##0", "0-0", "000-0000" etc.
|
|
45313
|
+
*/
|
|
45314
|
+
function formatNumberPattern(val, fmt) {
|
|
45315
|
+
const absVal = Math.abs(val);
|
|
45316
|
+
const sign$4 = val < 0 ? "-" : "";
|
|
45317
|
+
let trailingCommas = 0;
|
|
45318
|
+
let workFmt = fmt;
|
|
45319
|
+
while (workFmt.endsWith(",")) {
|
|
45320
|
+
trailingCommas++;
|
|
45321
|
+
workFmt = workFmt.slice(0, -1);
|
|
45322
|
+
}
|
|
45323
|
+
const scaledVal = absVal / Math.pow(1e3, trailingCommas);
|
|
45324
|
+
const decimalIdx = workFmt.indexOf(".");
|
|
45325
|
+
let intFmt = workFmt;
|
|
45326
|
+
let decFmt = "";
|
|
45327
|
+
if (decimalIdx !== -1) {
|
|
45328
|
+
intFmt = workFmt.substring(0, decimalIdx);
|
|
45329
|
+
decFmt = workFmt.substring(decimalIdx + 1);
|
|
45330
|
+
}
|
|
45331
|
+
const decimalPlaces = decFmt.replace(/[^0#?]/g, "").length;
|
|
45332
|
+
const [intPart, decPart = ""] = roundTo(scaledVal, decimalPlaces).toString().split(".");
|
|
45333
|
+
const hasLiteralInFormat = /[0#?][^0#?,.\s][0#?]/.test(intFmt);
|
|
45334
|
+
let formattedInt;
|
|
45335
|
+
if (hasLiteralInFormat) {
|
|
45336
|
+
const digitPlaceholders = intFmt.replace(/[^0#?]/g, "").length;
|
|
45337
|
+
let digits = intPart;
|
|
45338
|
+
if (digits.length < digitPlaceholders) digits = "0".repeat(digitPlaceholders - digits.length) + digits;
|
|
45339
|
+
formattedInt = "";
|
|
45340
|
+
let digitIndex = digits.length - digitPlaceholders;
|
|
45341
|
+
for (let i$2 = 0; i$2 < intFmt.length; i$2++) {
|
|
45342
|
+
const char = intFmt[i$2];
|
|
45343
|
+
if (char === "0" || char === "#" || char === "?") {
|
|
45344
|
+
if (digitIndex < digits.length) {
|
|
45345
|
+
formattedInt += digits[digitIndex];
|
|
45346
|
+
digitIndex++;
|
|
45347
|
+
}
|
|
45348
|
+
} else if (char !== ",") formattedInt += char;
|
|
45349
|
+
}
|
|
45350
|
+
} else {
|
|
45351
|
+
formattedInt = intPart;
|
|
45352
|
+
if (intFmt.includes(",")) formattedInt = commaify(intPart);
|
|
45353
|
+
const minIntDigits = (intFmt.match(/0/g) || []).length;
|
|
45354
|
+
if (formattedInt.length < minIntDigits) formattedInt = "0".repeat(minIntDigits - formattedInt.length) + formattedInt;
|
|
45355
|
+
}
|
|
45356
|
+
let formattedDec = "";
|
|
45357
|
+
if (decimalPlaces > 0) formattedDec = "." + (decPart + "0".repeat(decimalPlaces)).substring(0, decimalPlaces);
|
|
45358
|
+
return sign$4 + formattedInt + formattedDec;
|
|
45359
|
+
}
|
|
45360
|
+
/**
|
|
45361
|
+
* Remove quoted literal text markers and return the literal characters
|
|
45362
|
+
* Also handles backslash escape sequences
|
|
45363
|
+
*/
|
|
45364
|
+
function processQuotedText(fmt) {
|
|
45365
|
+
let result = "";
|
|
45366
|
+
let i$2 = 0;
|
|
45367
|
+
while (i$2 < fmt.length) if (fmt[i$2] === "\"") {
|
|
45368
|
+
i$2++;
|
|
45369
|
+
while (i$2 < fmt.length && fmt[i$2] !== "\"") {
|
|
45370
|
+
result += fmt[i$2];
|
|
45371
|
+
i$2++;
|
|
45372
|
+
}
|
|
45373
|
+
i$2++;
|
|
45374
|
+
} else if (fmt[i$2] === "\\" && i$2 + 1 < fmt.length) {
|
|
45375
|
+
i$2++;
|
|
45376
|
+
result += fmt[i$2];
|
|
45377
|
+
i$2++;
|
|
45378
|
+
} else {
|
|
45379
|
+
result += fmt[i$2];
|
|
45380
|
+
i$2++;
|
|
45381
|
+
}
|
|
45382
|
+
return result;
|
|
45383
|
+
}
|
|
45384
|
+
/**
|
|
45385
|
+
* Check if a condition matches (e.g., [>100], [<=50])
|
|
45386
|
+
*/
|
|
45387
|
+
function checkCondition(val, condition) {
|
|
45388
|
+
const match = condition.match(/\[(=|>|<|>=|<=|<>)(-?\d+(?:\.\d*)?)\]/);
|
|
45389
|
+
if (!match) return false;
|
|
45390
|
+
const op = match[1];
|
|
45391
|
+
const threshold = parseFloat(match[2]);
|
|
45392
|
+
switch (op) {
|
|
45393
|
+
case "=": return val === threshold;
|
|
45394
|
+
case ">": return val > threshold;
|
|
45395
|
+
case "<": return val < threshold;
|
|
45396
|
+
case ">=": return val >= threshold;
|
|
45397
|
+
case "<=": return val <= threshold;
|
|
45398
|
+
case "<>": return val !== threshold;
|
|
45399
|
+
default: return false;
|
|
45400
|
+
}
|
|
45401
|
+
}
|
|
45402
|
+
/**
|
|
45403
|
+
* Parse format string and handle positive/negative/zero/text sections
|
|
45404
|
+
* Excel format: positive;negative;zero;text
|
|
45405
|
+
* Also handles conditional formats like [>100]
|
|
45406
|
+
*/
|
|
45407
|
+
function chooseFormat(fmt, val) {
|
|
45408
|
+
if (typeof val === "string") {
|
|
45409
|
+
const sections$1 = splitFormat(fmt);
|
|
45410
|
+
if (sections$1.length >= 4 && sections$1[3]) return processQuotedText(sections$1[3]).replace(/@/g, val);
|
|
45411
|
+
return val;
|
|
45412
|
+
}
|
|
45413
|
+
if (typeof val === "boolean") return val ? "TRUE" : "FALSE";
|
|
45414
|
+
const sections = splitFormat(fmt);
|
|
45415
|
+
const condRegex = /\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/;
|
|
45416
|
+
if ((sections[0] && condRegex.test(sections[0]) || sections[1] && condRegex.test(sections[1])) && sections.length >= 2) {
|
|
45417
|
+
for (let i$2 = 0; i$2 < Math.min(sections.length, 2); i$2++) {
|
|
45418
|
+
const condMatch = sections[i$2].match(/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/);
|
|
45419
|
+
if (condMatch && checkCondition(val, condMatch[0])) return sections[i$2];
|
|
45420
|
+
}
|
|
45421
|
+
return sections[sections.length > 2 ? 2 : 1];
|
|
45422
|
+
}
|
|
45423
|
+
if (sections.length === 1) return sections[0];
|
|
45424
|
+
if (sections.length === 2) return val >= 0 ? sections[0] : sections[1];
|
|
45425
|
+
if (val > 0) return sections[0];
|
|
45426
|
+
if (val < 0) return sections[1];
|
|
45427
|
+
return sections[2] || sections[0];
|
|
45428
|
+
}
|
|
45429
|
+
/**
|
|
45430
|
+
* Check if format section is for negative values (2nd section in multi-section format)
|
|
45431
|
+
*/
|
|
45432
|
+
function isNegativeSection(fmt, selectedFmt) {
|
|
45433
|
+
const sections = splitFormat(fmt);
|
|
45434
|
+
return sections.length >= 2 && sections[1] === selectedFmt;
|
|
45435
|
+
}
|
|
45436
|
+
/**
|
|
45437
|
+
* Split format string by semicolons, respecting quoted strings and brackets
|
|
45438
|
+
*/
|
|
45439
|
+
function splitFormat(fmt) {
|
|
45440
|
+
const sections = [];
|
|
45441
|
+
let current = "";
|
|
45442
|
+
let inQuote = false;
|
|
45443
|
+
let inBracket = false;
|
|
45444
|
+
for (let i$2 = 0; i$2 < fmt.length; i$2++) {
|
|
45445
|
+
const char = fmt[i$2];
|
|
45446
|
+
if (char === "\"" && !inBracket) {
|
|
45447
|
+
inQuote = !inQuote;
|
|
45448
|
+
current += char;
|
|
45449
|
+
} else if (char === "[" && !inQuote) {
|
|
45450
|
+
inBracket = true;
|
|
45451
|
+
current += char;
|
|
45452
|
+
} else if (char === "]" && !inQuote) {
|
|
45453
|
+
inBracket = false;
|
|
45454
|
+
current += char;
|
|
45455
|
+
} else if (char === ";" && !inQuote && !inBracket) {
|
|
45456
|
+
sections.push(current);
|
|
45457
|
+
current = "";
|
|
45458
|
+
} else current += char;
|
|
45459
|
+
}
|
|
45460
|
+
sections.push(current);
|
|
45461
|
+
return sections;
|
|
45462
|
+
}
|
|
45463
|
+
/**
|
|
45464
|
+
* Main format function - formats a value according to Excel numFmt
|
|
45465
|
+
* @param fmt The Excel number format string (e.g., "0.00%", "#,##0", "yyyy-mm-dd")
|
|
45466
|
+
* @param val The value to format
|
|
45467
|
+
*/
|
|
45468
|
+
function format(fmt, val) {
|
|
45469
|
+
if (val == null) return "";
|
|
45470
|
+
if (isGeneral(fmt)) return formatGeneral(val);
|
|
45471
|
+
if (typeof val === "string") return chooseFormat(fmt, val);
|
|
45472
|
+
if (typeof val === "boolean") return val ? "TRUE" : "FALSE";
|
|
45473
|
+
let numVal = val;
|
|
45474
|
+
const selectedFmt = chooseFormat(fmt, numVal);
|
|
45475
|
+
if (numVal < 0 && isNegativeSection(fmt, selectedFmt)) numVal = Math.abs(numVal);
|
|
45476
|
+
let cleanFmt = selectedFmt.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi, "");
|
|
45477
|
+
cleanFmt = cleanFmt.replace(/\[(>|<|>=|<=|=|<>)-?\d+(\.\d+)?\]/g, "");
|
|
45478
|
+
cleanFmt = cleanFmt.replace(/\[\$[^\]]*\]/g, "");
|
|
45479
|
+
cleanFmt = processPlaceholders(cleanFmt);
|
|
45480
|
+
cleanFmt = processQuotedText(cleanFmt);
|
|
45481
|
+
if (/\[[hms]+\]/i.test(cleanFmt)) return formatElapsedTime(numVal, cleanFmt);
|
|
45482
|
+
if (isDateFormat(cleanFmt)) return formatDate(numVal, cleanFmt);
|
|
45483
|
+
if (cleanFmt.includes("%")) return formatPercentage(numVal, cleanFmt);
|
|
45484
|
+
if (/E[+-]?/i.test(cleanFmt)) return formatScientific(numVal, cleanFmt);
|
|
45485
|
+
if (/\?+\s*\/\s*[\d?]+/.test(cleanFmt)) return formatFraction(numVal, cleanFmt);
|
|
45486
|
+
if (cleanFmt.includes("(") && cleanFmt.includes(")") && numVal < 0) {
|
|
45487
|
+
const innerFmt = cleanFmt.replace(/\(|\)/g, "");
|
|
45488
|
+
return "(" + formatNumberPattern(-numVal, innerFmt) + ")";
|
|
45489
|
+
}
|
|
45490
|
+
if (cleanFmt === "@") return numVal.toString();
|
|
45491
|
+
let prefix = "";
|
|
45492
|
+
let suffix = "";
|
|
45493
|
+
const prefixMatch = cleanFmt.match(/^([^#0?.,]+)/);
|
|
45494
|
+
if (prefixMatch) {
|
|
45495
|
+
prefix = prefixMatch[1];
|
|
45496
|
+
cleanFmt = cleanFmt.substring(prefixMatch[0].length);
|
|
45497
|
+
}
|
|
45498
|
+
const suffixMatch = cleanFmt.match(/([^#0?.,]+)$/);
|
|
45499
|
+
if (suffixMatch && !suffixMatch[1].includes("%")) {
|
|
45500
|
+
suffix = suffixMatch[1];
|
|
45501
|
+
cleanFmt = cleanFmt.substring(0, cleanFmt.length - suffixMatch[0].length);
|
|
45502
|
+
}
|
|
45503
|
+
const formattedNum = formatNumberPattern(numVal, cleanFmt);
|
|
45504
|
+
return prefix + formattedNum + suffix;
|
|
45505
|
+
}
|
|
45506
|
+
|
|
45507
|
+
//#endregion
|
|
45508
|
+
//#region src/utils/sheet-utils.ts
|
|
45035
45509
|
/**
|
|
45036
45510
|
* Utility functions for ExcelTS
|
|
45037
45511
|
* Provides convenient helper functions for common spreadsheet operations
|
|
45038
|
-
* compatible with xlsx library's utils API but built on excelts native types
|
|
45039
45512
|
*/
|
|
45040
45513
|
/**
|
|
45514
|
+
* Get formatted display text for a cell value
|
|
45515
|
+
* Returns the value formatted according to the cell's numFmt
|
|
45516
|
+
* This matches Excel's display exactly
|
|
45517
|
+
*/
|
|
45518
|
+
function getCellDisplayText(cell) {
|
|
45519
|
+
const value = cell.value;
|
|
45520
|
+
const fmt = cell.numFmt || "General";
|
|
45521
|
+
if (value == null) return "";
|
|
45522
|
+
if (value instanceof Date) return format(fmt, dateToExcel(value, false));
|
|
45523
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "string") return format(fmt, value);
|
|
45524
|
+
return cell.text;
|
|
45525
|
+
}
|
|
45526
|
+
/**
|
|
45041
45527
|
* Decode column string to 0-indexed number
|
|
45042
|
-
* @example
|
|
45528
|
+
* @example decodeCol("A") => 0, decodeCol("Z") => 25, decodeCol("AA") => 26
|
|
45043
45529
|
*/
|
|
45044
|
-
function
|
|
45530
|
+
function decodeCol(colstr) {
|
|
45045
45531
|
return colCache.l2n(colstr.toUpperCase()) - 1;
|
|
45046
45532
|
}
|
|
45047
45533
|
/**
|
|
45048
45534
|
* Encode 0-indexed column number to string
|
|
45049
|
-
* @example
|
|
45535
|
+
* @example encodeCol(0) => "A", encodeCol(25) => "Z", encodeCol(26) => "AA"
|
|
45050
45536
|
*/
|
|
45051
|
-
function
|
|
45537
|
+
function encodeCol(col) {
|
|
45052
45538
|
return colCache.n2l(col + 1);
|
|
45053
45539
|
}
|
|
45054
45540
|
/**
|
|
45055
45541
|
* Decode row string to 0-indexed number
|
|
45056
|
-
* @example
|
|
45542
|
+
* @example decodeRow("1") => 0, decodeRow("10") => 9
|
|
45057
45543
|
*/
|
|
45058
|
-
function
|
|
45544
|
+
function decodeRow(rowstr) {
|
|
45059
45545
|
return parseInt(rowstr, 10) - 1;
|
|
45060
45546
|
}
|
|
45061
45547
|
/**
|
|
45062
45548
|
* Encode 0-indexed row number to string
|
|
45063
|
-
* @example
|
|
45549
|
+
* @example encodeRow(0) => "1", encodeRow(9) => "10"
|
|
45064
45550
|
*/
|
|
45065
|
-
function
|
|
45551
|
+
function encodeRow(row) {
|
|
45066
45552
|
return String(row + 1);
|
|
45067
45553
|
}
|
|
45068
45554
|
/**
|
|
45069
45555
|
* Decode cell address string to CellAddress object
|
|
45070
|
-
* @example
|
|
45556
|
+
* @example decodeCell("A1") => {c: 0, r: 0}, decodeCell("B2") => {c: 1, r: 1}
|
|
45071
45557
|
*/
|
|
45072
|
-
function
|
|
45558
|
+
function decodeCell(cstr) {
|
|
45073
45559
|
const addr = colCache.decodeAddress(cstr.toUpperCase());
|
|
45074
45560
|
return {
|
|
45075
45561
|
c: addr.col - 1,
|
|
@@ -45078,44 +45564,44 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45078
45564
|
}
|
|
45079
45565
|
/**
|
|
45080
45566
|
* Encode CellAddress object to cell address string
|
|
45081
|
-
* @example
|
|
45567
|
+
* @example encodeCell({c: 0, r: 0}) => "A1", encodeCell({c: 1, r: 1}) => "B2"
|
|
45082
45568
|
*/
|
|
45083
|
-
function
|
|
45569
|
+
function encodeCell(cell) {
|
|
45084
45570
|
return colCache.encodeAddress(cell.r + 1, cell.c + 1);
|
|
45085
45571
|
}
|
|
45086
45572
|
/**
|
|
45087
45573
|
* Decode range string to Range object
|
|
45088
|
-
* @example
|
|
45574
|
+
* @example decodeRange("A1:B2") => {s: {c: 0, r: 0}, e: {c: 1, r: 1}}
|
|
45089
45575
|
*/
|
|
45090
|
-
function
|
|
45576
|
+
function decodeRange(range$1) {
|
|
45091
45577
|
const idx = range$1.indexOf(":");
|
|
45092
45578
|
if (idx === -1) {
|
|
45093
|
-
const cell =
|
|
45579
|
+
const cell = decodeCell(range$1);
|
|
45094
45580
|
return {
|
|
45095
45581
|
s: cell,
|
|
45096
45582
|
e: { ...cell }
|
|
45097
45583
|
};
|
|
45098
45584
|
}
|
|
45099
45585
|
return {
|
|
45100
|
-
s:
|
|
45101
|
-
e:
|
|
45586
|
+
s: decodeCell(range$1.slice(0, idx)),
|
|
45587
|
+
e: decodeCell(range$1.slice(idx + 1))
|
|
45102
45588
|
};
|
|
45103
45589
|
}
|
|
45104
|
-
function
|
|
45590
|
+
function encodeRange(startOrRange, end) {
|
|
45105
45591
|
if (end === void 0) {
|
|
45106
45592
|
const range$1 = startOrRange;
|
|
45107
|
-
return
|
|
45593
|
+
return encodeRange(range$1.s, range$1.e);
|
|
45108
45594
|
}
|
|
45109
|
-
const startStr =
|
|
45110
|
-
const endStr =
|
|
45595
|
+
const startStr = encodeCell(startOrRange);
|
|
45596
|
+
const endStr = encodeCell(end);
|
|
45111
45597
|
return startStr === endStr ? startStr : `${startStr}:${endStr}`;
|
|
45112
45598
|
}
|
|
45113
45599
|
/**
|
|
45114
45600
|
* Create a worksheet from an array of objects (xlsx compatible)
|
|
45115
45601
|
* @example
|
|
45116
|
-
* const ws =
|
|
45602
|
+
* const ws = jsonToSheet([{name: "Alice", age: 30}, {name: "Bob", age: 25}])
|
|
45117
45603
|
*/
|
|
45118
|
-
function
|
|
45604
|
+
function jsonToSheet(data, opts) {
|
|
45119
45605
|
const o = opts || {};
|
|
45120
45606
|
const worksheet = new Workbook().addWorksheet("Sheet1");
|
|
45121
45607
|
if (data.length === 0) return worksheet;
|
|
@@ -45145,13 +45631,13 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45145
45631
|
/**
|
|
45146
45632
|
* Add data from an array of objects to an existing worksheet (xlsx compatible)
|
|
45147
45633
|
*/
|
|
45148
|
-
function
|
|
45634
|
+
function sheetAddJson(worksheet, data, opts) {
|
|
45149
45635
|
const o = opts || {};
|
|
45150
45636
|
if (data.length === 0) return worksheet;
|
|
45151
45637
|
let startRow = 1;
|
|
45152
45638
|
let startCol = 1;
|
|
45153
45639
|
if (o.origin !== void 0) if (typeof o.origin === "string") {
|
|
45154
|
-
const addr =
|
|
45640
|
+
const addr = decodeCell(o.origin);
|
|
45155
45641
|
startRow = addr.r + 1;
|
|
45156
45642
|
startCol = addr.c + 1;
|
|
45157
45643
|
} else if (typeof o.origin === "number") if (o.origin === -1) startRow = worksheet.rowCount + 1;
|
|
@@ -45187,18 +45673,18 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45187
45673
|
* Convert worksheet to JSON array (xlsx compatible)
|
|
45188
45674
|
* @example
|
|
45189
45675
|
* // Default: array of objects with first row as headers
|
|
45190
|
-
* const data =
|
|
45676
|
+
* const data = sheetToJson(worksheet)
|
|
45191
45677
|
* // => [{name: "Alice", age: 30}, {name: "Bob", age: 25}]
|
|
45192
45678
|
*
|
|
45193
45679
|
* // Array of arrays
|
|
45194
|
-
* const aoa =
|
|
45680
|
+
* const aoa = sheetToJson(worksheet, { header: 1 })
|
|
45195
45681
|
* // => [["name", "age"], ["Alice", 30], ["Bob", 25]]
|
|
45196
45682
|
*
|
|
45197
45683
|
* // Column letters as keys
|
|
45198
|
-
* const cols =
|
|
45684
|
+
* const cols = sheetToJson(worksheet, { header: "A" })
|
|
45199
45685
|
* // => [{A: "name", B: "age"}, {A: "Alice", B: 30}]
|
|
45200
45686
|
*/
|
|
45201
|
-
function
|
|
45687
|
+
function sheetToJson(worksheet, opts) {
|
|
45202
45688
|
const o = opts || {};
|
|
45203
45689
|
let startRow = 1;
|
|
45204
45690
|
let endRow = worksheet.rowCount;
|
|
@@ -45207,7 +45693,7 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45207
45693
|
if (o.range !== void 0) {
|
|
45208
45694
|
if (typeof o.range === "number") startRow = o.range + 1;
|
|
45209
45695
|
else if (typeof o.range === "string") {
|
|
45210
|
-
const r$2 =
|
|
45696
|
+
const r$2 = decodeRange(o.range);
|
|
45211
45697
|
startRow = r$2.s.r + 1;
|
|
45212
45698
|
endRow = r$2.e.r + 1;
|
|
45213
45699
|
startCol = r$2.s.c + 1;
|
|
@@ -45223,8 +45709,9 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45223
45709
|
const rowData = [];
|
|
45224
45710
|
let isEmpty = true;
|
|
45225
45711
|
for (let col = startCol; col <= endCol; col++) {
|
|
45226
|
-
const
|
|
45227
|
-
|
|
45712
|
+
const cell = worksheet.getCell(row, col);
|
|
45713
|
+
const val = o.raw === false ? getCellDisplayText(cell).trim() : cell.value;
|
|
45714
|
+
if (val != null && val !== "") {
|
|
45228
45715
|
rowData[col - startCol] = val;
|
|
45229
45716
|
isEmpty = false;
|
|
45230
45717
|
} else if (o.defval !== void 0) rowData[col - startCol] = o.defval;
|
|
@@ -45241,9 +45728,10 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45241
45728
|
const rowData = {};
|
|
45242
45729
|
let isEmpty = true;
|
|
45243
45730
|
for (let col = startCol; col <= endCol; col++) {
|
|
45244
|
-
const
|
|
45245
|
-
const
|
|
45246
|
-
|
|
45731
|
+
const cell = worksheet.getCell(row, col);
|
|
45732
|
+
const val = o.raw === false ? getCellDisplayText(cell).trim() : cell.value;
|
|
45733
|
+
const key$1 = encodeCol(col - 1);
|
|
45734
|
+
if (val != null && val !== "") {
|
|
45247
45735
|
rowData[key$1] = val;
|
|
45248
45736
|
isEmpty = false;
|
|
45249
45737
|
} else if (o.defval !== void 0) rowData[key$1] = o.defval;
|
|
@@ -45261,8 +45749,9 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45261
45749
|
for (let col = startCol; col <= endCol; col++) {
|
|
45262
45750
|
const colIdx = col - startCol;
|
|
45263
45751
|
const key$1 = headerOpt[colIdx] ?? `__EMPTY_${colIdx}`;
|
|
45264
|
-
const
|
|
45265
|
-
|
|
45752
|
+
const cell = worksheet.getCell(row, col);
|
|
45753
|
+
const val = o.raw === false ? getCellDisplayText(cell).trim() : cell.value;
|
|
45754
|
+
if (val != null && val !== "") {
|
|
45266
45755
|
rowData[key$1] = val;
|
|
45267
45756
|
isEmpty = false;
|
|
45268
45757
|
} else if (o.defval !== void 0) rowData[key$1] = o.defval;
|
|
@@ -45289,9 +45778,10 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45289
45778
|
const rowData = {};
|
|
45290
45779
|
let isEmpty = true;
|
|
45291
45780
|
for (let col = startCol; col <= endCol; col++) {
|
|
45292
|
-
const
|
|
45781
|
+
const cell = worksheet.getCell(row, col);
|
|
45782
|
+
const val = o.raw === false ? getCellDisplayText(cell).trim() : cell.value;
|
|
45293
45783
|
const key$1 = headers[col - startCol];
|
|
45294
|
-
if (val != null) {
|
|
45784
|
+
if (val != null && val !== "") {
|
|
45295
45785
|
rowData[key$1] = val;
|
|
45296
45786
|
isEmpty = false;
|
|
45297
45787
|
} else if (o.defval !== void 0) rowData[key$1] = o.defval;
|
|
@@ -45303,7 +45793,7 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45303
45793
|
/**
|
|
45304
45794
|
* Convert worksheet to CSV string
|
|
45305
45795
|
*/
|
|
45306
|
-
function
|
|
45796
|
+
function sheetToCsv(worksheet, opts) {
|
|
45307
45797
|
const o = opts || {};
|
|
45308
45798
|
const FS = o.FS ?? ",";
|
|
45309
45799
|
const RS = o.RS ?? "\n";
|
|
@@ -45333,17 +45823,17 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45333
45823
|
/**
|
|
45334
45824
|
* Create a new workbook
|
|
45335
45825
|
*/
|
|
45336
|
-
function
|
|
45826
|
+
function bookNew() {
|
|
45337
45827
|
return new Workbook();
|
|
45338
45828
|
}
|
|
45339
45829
|
/**
|
|
45340
45830
|
* Append worksheet to workbook (xlsx compatible)
|
|
45341
45831
|
* @example
|
|
45342
|
-
* const wb =
|
|
45343
|
-
* const ws =
|
|
45344
|
-
*
|
|
45832
|
+
* const wb = bookNew();
|
|
45833
|
+
* const ws = jsonToSheet([{a: 1, b: 2}]);
|
|
45834
|
+
* bookAppendSheet(wb, ws, "Sheet1");
|
|
45345
45835
|
*/
|
|
45346
|
-
function
|
|
45836
|
+
function bookAppendSheet(workbook, worksheet, name) {
|
|
45347
45837
|
const newWs = workbook.addWorksheet(name);
|
|
45348
45838
|
worksheet.eachRow({ includeEmpty: true }, (row, rowNumber) => {
|
|
45349
45839
|
row.eachCell({ includeEmpty: true }, (cell, colNumber) => {
|
|
@@ -45361,15 +45851,15 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45361
45851
|
/**
|
|
45362
45852
|
* Create a worksheet from an array of arrays (xlsx compatible)
|
|
45363
45853
|
* @example
|
|
45364
|
-
* const ws =
|
|
45854
|
+
* const ws = aoaToSheet([["Name", "Age"], ["Alice", 30], ["Bob", 25]])
|
|
45365
45855
|
*/
|
|
45366
|
-
function
|
|
45856
|
+
function aoaToSheet(data, opts) {
|
|
45367
45857
|
const worksheet = new Workbook().addWorksheet("Sheet1");
|
|
45368
45858
|
if (data.length === 0) return worksheet;
|
|
45369
45859
|
let startRow = 1;
|
|
45370
45860
|
let startCol = 1;
|
|
45371
45861
|
if (opts?.origin !== void 0) if (typeof opts.origin === "string") {
|
|
45372
|
-
const addr =
|
|
45862
|
+
const addr = decodeCell(opts.origin);
|
|
45373
45863
|
startRow = addr.r + 1;
|
|
45374
45864
|
startCol = addr.c + 1;
|
|
45375
45865
|
} else if (typeof opts.origin === "number") startRow = opts.origin + 1;
|
|
@@ -45388,12 +45878,12 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45388
45878
|
/**
|
|
45389
45879
|
* Add data from an array of arrays to an existing worksheet (xlsx compatible)
|
|
45390
45880
|
*/
|
|
45391
|
-
function
|
|
45881
|
+
function sheetAddAoa(worksheet, data, opts) {
|
|
45392
45882
|
if (data.length === 0) return worksheet;
|
|
45393
45883
|
let startRow = 1;
|
|
45394
45884
|
let startCol = 1;
|
|
45395
45885
|
if (opts?.origin !== void 0) if (typeof opts.origin === "string") {
|
|
45396
|
-
const addr =
|
|
45886
|
+
const addr = decodeCell(opts.origin);
|
|
45397
45887
|
startRow = addr.r + 1;
|
|
45398
45888
|
startCol = addr.c + 1;
|
|
45399
45889
|
} else if (typeof opts.origin === "number") if (opts.origin === -1) startRow = worksheet.rowCount + 1;
|
|
@@ -45413,7 +45903,7 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45413
45903
|
/**
|
|
45414
45904
|
* Convert worksheet to array of arrays
|
|
45415
45905
|
*/
|
|
45416
|
-
function
|
|
45906
|
+
function sheetToAoa(worksheet) {
|
|
45417
45907
|
const result = [];
|
|
45418
45908
|
worksheet.eachRow({ includeEmpty: true }, (row, rowNumber) => {
|
|
45419
45909
|
const rowData = [];
|
|
@@ -45425,23 +45915,23 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
45425
45915
|
return result;
|
|
45426
45916
|
}
|
|
45427
45917
|
const utils = {
|
|
45428
|
-
|
|
45429
|
-
|
|
45430
|
-
|
|
45431
|
-
|
|
45432
|
-
|
|
45433
|
-
|
|
45434
|
-
|
|
45435
|
-
|
|
45436
|
-
|
|
45437
|
-
|
|
45438
|
-
|
|
45439
|
-
|
|
45440
|
-
|
|
45441
|
-
|
|
45442
|
-
|
|
45443
|
-
|
|
45444
|
-
|
|
45918
|
+
decodeCol,
|
|
45919
|
+
encodeCol,
|
|
45920
|
+
decodeRow,
|
|
45921
|
+
encodeRow,
|
|
45922
|
+
decodeCell,
|
|
45923
|
+
encodeCell,
|
|
45924
|
+
decodeRange,
|
|
45925
|
+
encodeRange,
|
|
45926
|
+
jsonToSheet,
|
|
45927
|
+
sheetAddJson,
|
|
45928
|
+
sheetToJson,
|
|
45929
|
+
sheetToCsv,
|
|
45930
|
+
aoaToSheet,
|
|
45931
|
+
sheetAddAoa,
|
|
45932
|
+
sheetToAoa,
|
|
45933
|
+
bookNew,
|
|
45934
|
+
bookAppendSheet
|
|
45445
45935
|
};
|
|
45446
45936
|
|
|
45447
45937
|
//#endregion
|
|
@@ -45454,23 +45944,23 @@ exports.ReadingOrder = ReadingOrder;
|
|
|
45454
45944
|
exports.RelationshipType = RelationshipType;
|
|
45455
45945
|
exports.ValueType = ValueType;
|
|
45456
45946
|
exports.Workbook = Workbook;
|
|
45457
|
-
exports.
|
|
45458
|
-
exports.
|
|
45459
|
-
exports.
|
|
45460
|
-
exports.
|
|
45461
|
-
exports.
|
|
45462
|
-
exports.
|
|
45463
|
-
exports.
|
|
45464
|
-
exports.
|
|
45465
|
-
exports.
|
|
45466
|
-
exports.
|
|
45467
|
-
exports.
|
|
45468
|
-
exports.
|
|
45469
|
-
exports.
|
|
45470
|
-
exports.
|
|
45471
|
-
exports.
|
|
45472
|
-
exports.
|
|
45473
|
-
exports.
|
|
45947
|
+
exports.aoaToSheet = aoaToSheet;
|
|
45948
|
+
exports.bookAppendSheet = bookAppendSheet;
|
|
45949
|
+
exports.bookNew = bookNew;
|
|
45950
|
+
exports.decodeCell = decodeCell;
|
|
45951
|
+
exports.decodeCol = decodeCol;
|
|
45952
|
+
exports.decodeRange = decodeRange;
|
|
45953
|
+
exports.decodeRow = decodeRow;
|
|
45954
|
+
exports.encodeCell = encodeCell;
|
|
45955
|
+
exports.encodeCol = encodeCol;
|
|
45956
|
+
exports.encodeRange = encodeRange;
|
|
45957
|
+
exports.encodeRow = encodeRow;
|
|
45958
|
+
exports.jsonToSheet = jsonToSheet;
|
|
45959
|
+
exports.sheetAddAoa = sheetAddAoa;
|
|
45960
|
+
exports.sheetAddJson = sheetAddJson;
|
|
45961
|
+
exports.sheetToAoa = sheetToAoa;
|
|
45962
|
+
exports.sheetToCsv = sheetToCsv;
|
|
45963
|
+
exports.sheetToJson = sheetToJson;
|
|
45474
45964
|
exports.utils = utils;
|
|
45475
45965
|
return exports;
|
|
45476
45966
|
})({});
|