@genai-fi/nanogpt 1.5.0 → 1.6.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/{DatasetBuilder-DU1G1OKX.js → DatasetBuilder-DRDW8tcM.js} +85 -86
- package/dist/Generator-BcR_14Cj.js +316 -0
- package/dist/{RealDiv-CSnvtN2E.js → RealDiv-Cl8k3YTx.js} +54 -62
- package/dist/{Reshape-BlylqwWy.js → Reshape-CKxKPKqi.js} +9 -12
- package/dist/Reshape-H5zZRgr9.js +16 -0
- package/dist/RoPECache-dYscFINl.js +722 -0
- package/dist/TeachableLLM.js +29 -34
- package/dist/api/beamer.js +5 -6
- package/dist/api/responses.js +11 -12
- package/dist/api/training.js +12 -14
- package/dist/axis_util-rF9RnwKE.js +37 -0
- package/dist/backend.js +5 -6
- package/dist/{backend_util-DAV0I34P.js → backend_util-Cpp0Gwlp.js} +180 -185
- package/dist/{binary_op_util-CrYk9LXL.js → binary_op_util-WY9YIl0q.js} +3 -7
- package/dist/broadcast_to-CGvLNiQ0.js +20 -0
- package/dist/checks/appendCache.js +7 -7
- package/dist/checks/attentionMask.js +9 -8
- package/dist/checks/check.js +1 -2
- package/dist/checks/gelu.js +6 -6
- package/dist/checks/index.js +24 -25
- package/dist/checks/matMulGelu.js +7 -7
- package/dist/checks/normRMS.js +14 -12
- package/dist/checks/normRMSGrad.js +9 -8
- package/dist/checks/packUnpack.js +7 -7
- package/dist/checks/qkv.js +1 -34
- package/dist/checks/rope.js +6 -6
- package/dist/checks/weights.js +1 -2
- package/dist/clip_by_value-D-UX9am5.js +13 -0
- package/dist/complex-Cl904TqN.js +13 -0
- package/dist/{complex_util-CkazZsaH.js → complex_util-BBlPAm-s.js} +1 -2
- package/dist/concat-Oip5acVY.js +14 -0
- package/dist/{concat_util-CWzvQQlK.js → concat_util-CY45Hf4F.js} +2 -3
- package/dist/data/docx.js +3 -4
- package/dist/data/pdf.js +11 -14
- package/dist/data/stream.js +1 -2
- package/dist/data/textLoader.js +16 -15
- package/dist/data-CV_i_H6B.js +11 -0
- package/dist/data.js +5 -12
- package/dist/dist-CMMLi-qO.js +2675 -0
- package/dist/{dist-BGVm64AY.js → dist-DeVH1nGn.js} +1465 -1573
- package/dist/{dist-CwK5S7Ls.js → dist-DyL7qSLJ.js} +2664 -2400
- package/dist/dropout16-CA31Ud5a.js +20 -0
- package/dist/dropout_util-SiFMbFXz.js +22 -0
- package/dist/{eventemitter3-D_qV3Lof.js → eventemitter3-wmfmOP_f.js} +2 -3
- package/dist/expand_dims-Dh3Fulyn.js +10 -0
- package/dist/floor-BwjmUb7X.js +8 -0
- package/dist/gather-B5Z1RFt5.js +14 -0
- package/dist/gatherSub-CRUfUzBa.js +22 -0
- package/dist/gelu-Xx9-ohH9.js +25 -0
- package/dist/{gpgpu_math-20tPK8LM.js → gpgpu_math-48m8q3jI.js} +265 -286
- package/dist/inference/Beamer.js +34 -27
- package/dist/inference/Generator.js +1 -273
- package/dist/inference/tokenisePrompt.js +5 -4
- package/dist/inference/types.d.ts +6 -0
- package/dist/inference/utilities.js +1 -2
- package/dist/{jszip.min-DKa1Rjyn.js → jszip.min-Btv48m44.js} +68 -64
- package/dist/{kernel_funcs_utils-ql8Y8qPn.js → kernel_funcs_utils-BYRpSfV_.js} +39 -42
- package/dist/layers/BaseLayer.js +9 -10
- package/dist/layers/GQA.js +45 -44
- package/dist/layers/HeadLayer.js +13 -13
- package/dist/layers/LoRA.js +17 -20
- package/dist/layers/MHA.d.ts +2 -2
- package/dist/layers/MHA.js +46 -45
- package/dist/layers/MLP.js +22 -21
- package/dist/layers/PositionEmbedding.js +14 -13
- package/dist/layers/RMSNorm.js +14 -13
- package/dist/layers/RoPECache.js +1 -338
- package/dist/layers/TiedEmbedding.js +15 -14
- package/dist/layers/TransformerBlock.d.ts +3 -9
- package/dist/layers/TransformerBlock.js +29 -30
- package/dist/layers/WeightStore.js +4 -5
- package/dist/layers-CFqEip3s.js +13 -0
- package/dist/layers.js +3 -11
- package/dist/loader/load.js +27 -24
- package/dist/loader/loadHF.js +3 -3
- package/dist/loader/loadTransformers.js +5 -6
- package/dist/loader/loadZipMeta.js +1 -2
- package/dist/loader/newZipLoad.js +1 -2
- package/dist/loader/oldZipLoad.js +8 -9
- package/dist/loader/save.js +15 -16
- package/dist/main.js +3281 -3463
- package/dist/{matMul16-CO1QhsRt.js → matMul16-tE26fnhf.js} +29 -27
- package/dist/{matMulGelu-CBoqTZM7.js → matMulGelu-ASUWlKqu.js} +33 -33
- package/dist/mat_mul-R9_DWmIT.js +16 -0
- package/dist/models/Llama.js +48 -49
- package/dist/models/NanoGPTV1.js +53 -54
- package/dist/models/NanoGPTV2.js +48 -49
- package/dist/models/Qwen3.js +48 -49
- package/dist/models/config.js +3 -8
- package/dist/models/factory.js +7 -8
- package/dist/models/model.d.ts +5 -7
- package/dist/models/model.js +1 -2
- package/dist/models-DyBpJJwM.js +13 -0
- package/dist/models.js +6 -14
- package/dist/mul16-C7sqgqik.js +41 -0
- package/dist/non_max_suppression_impl-B0H318rb.js +72 -0
- package/dist/not_equal-Bu3O8rh_.js +67 -0
- package/dist/one_hot-TEMPumJj.js +14 -0
- package/dist/ones-DpPXWa6A.js +13 -0
- package/dist/ops/adamAdjust.js +2 -3
- package/dist/ops/adamMoments.js +2 -3
- package/dist/ops/add16.js +2 -3
- package/dist/ops/appendCache.js +9 -8
- package/dist/ops/attentionMask.d.ts +1 -1
- package/dist/ops/attentionMask.js +8 -5
- package/dist/ops/concat16.js +5 -5
- package/dist/ops/cpu/adamAdjust.js +7 -8
- package/dist/ops/cpu/adamMoments.js +5 -5
- package/dist/ops/cpu/appendCache.js +3 -3
- package/dist/ops/cpu/attentionMask.js +12 -8
- package/dist/ops/cpu/fusedSoftmax.js +3 -3
- package/dist/ops/cpu/gatherSub.js +1 -12
- package/dist/ops/cpu/gelu.js +12 -13
- package/dist/ops/cpu/matMul16.js +7 -7
- package/dist/ops/cpu/matMulGelu.js +21 -18
- package/dist/ops/cpu/matMulMul.js +8 -9
- package/dist/ops/cpu/mulDropout.js +8 -9
- package/dist/ops/cpu/normRMS.js +12 -13
- package/dist/ops/cpu/qkv.js +14 -13
- package/dist/ops/cpu/rope.js +11 -8
- package/dist/ops/cpu/scatterSub.js +1 -12
- package/dist/ops/dot16.js +16 -17
- package/dist/ops/dropout.js +9 -8
- package/dist/ops/dropout16.js +1 -22
- package/dist/ops/gatherSub.js +3 -4
- package/dist/ops/gelu.js +1 -2
- package/dist/ops/globalNorm.js +10 -10
- package/dist/ops/grads/add16.js +16 -17
- package/dist/ops/grads/attentionMask.js +6 -7
- package/dist/ops/grads/dropout16.js +1 -1
- package/dist/ops/grads/gelu.js +1 -2
- package/dist/ops/grads/matMul16.js +1 -2
- package/dist/ops/grads/matMulGelu.js +6 -7
- package/dist/ops/grads/mul16.js +1 -1
- package/dist/ops/grads/normRMS.js +8 -9
- package/dist/ops/grads/pack16.js +1 -2
- package/dist/ops/grads/qkv.js +10 -10
- package/dist/ops/grads/rope.js +1 -2
- package/dist/ops/grads/silu.js +1 -2
- package/dist/ops/grads/softmax16.js +6 -7
- package/dist/ops/grads/unpack16.js +1 -2
- package/dist/ops/grads/utils.js +1 -2
- package/dist/ops/matMul16.d.ts +1 -1
- package/dist/ops/matMul16.js +1 -2
- package/dist/ops/matMulGelu.js +3 -4
- package/dist/ops/matMulMul.js +2 -3
- package/dist/ops/mul16.js +1 -43
- package/dist/ops/mulDrop.js +2 -3
- package/dist/ops/normRMS.js +2 -3
- package/dist/ops/pack16.js +1 -2
- package/dist/ops/qkv.js +2 -3
- package/dist/ops/reshape16.js +11 -11
- package/dist/ops/rope.js +1 -2
- package/dist/ops/scatterSub.js +3 -4
- package/dist/ops/silu.js +1 -2
- package/dist/ops/slice16.js +5 -5
- package/dist/ops/softmax16.js +3 -4
- package/dist/ops/sub16.js +3 -4
- package/dist/ops/sum16.js +3 -3
- package/dist/ops/transpose16.js +16 -15
- package/dist/ops/unpack16.js +1 -2
- package/dist/ops/webgl/adamAdjust.js +8 -9
- package/dist/ops/webgl/adamMoments.js +2 -3
- package/dist/ops/webgl/appendCache.js +2 -3
- package/dist/ops/webgl/attentionMask.js +2 -3
- package/dist/ops/webgl/dropout16.js +2 -3
- package/dist/ops/webgl/fusedSoftmax.js +13 -13
- package/dist/ops/webgl/gatherSub.js +2 -3
- package/dist/ops/webgl/gelu.js +11 -12
- package/dist/ops/webgl/log.js +10 -10
- package/dist/ops/webgl/matMul16.js +31 -24
- package/dist/ops/webgl/matMulGelu.js +1 -2
- package/dist/ops/webgl/matMulMul.js +3 -4
- package/dist/ops/webgl/mulDropout.js +2 -3
- package/dist/ops/webgl/normRMS.js +11 -10
- package/dist/ops/webgl/qkv.js +2 -3
- package/dist/ops/webgl/rope.js +4 -5
- package/dist/ops/webgl/scatterSub.js +2 -3
- package/dist/ops/webgpu/adamAdjust.js +13 -14
- package/dist/ops/webgpu/adamMoments.js +13 -14
- package/dist/ops/webgpu/add16.js +3 -4
- package/dist/ops/webgpu/appendCache.js +20 -21
- package/dist/ops/webgpu/attentionMask.js +18 -19
- package/dist/ops/webgpu/attentionMask32_program.js +7 -8
- package/dist/ops/webgpu/clipScale.js +11 -12
- package/dist/ops/webgpu/concat16.js +17 -18
- package/dist/ops/webgpu/dropout16.js +6 -7
- package/dist/ops/webgpu/gatherSub.js +11 -12
- package/dist/ops/webgpu/gelu.js +10 -11
- package/dist/ops/webgpu/index.js +17 -17
- package/dist/ops/webgpu/matMul16.js +74 -63
- package/dist/ops/webgpu/matMul16_program.d.ts +2 -1
- package/dist/ops/webgpu/matMul16_program.js +29 -21
- package/dist/ops/webgpu/mul16.js +3 -4
- package/dist/ops/webgpu/norm2.js +9 -10
- package/dist/ops/webgpu/normRMS.js +9 -10
- package/dist/ops/webgpu/normRMS16_program.js +1 -2
- package/dist/ops/webgpu/normRMS32_program.js +1 -2
- package/dist/ops/webgpu/normRMSGrad.js +30 -30
- package/dist/ops/webgpu/pack16.js +2 -3
- package/dist/ops/webgpu/pack16_program.js +3 -4
- package/dist/ops/webgpu/qkv.js +10 -11
- package/dist/ops/webgpu/rope.js +26 -27
- package/dist/ops/webgpu/scatterSub.js +12 -13
- package/dist/ops/webgpu/silu.js +10 -11
- package/dist/ops/webgpu/slice16.js +17 -18
- package/dist/ops/webgpu/softmax16.js +9 -9
- package/dist/ops/webgpu/softmax16_program.js +9 -10
- package/dist/ops/webgpu/softmax16_subgroup_program.js +11 -12
- package/dist/ops/webgpu/softmax16grad.js +8 -9
- package/dist/ops/webgpu/sub16.js +3 -4
- package/dist/ops/webgpu/sum16.js +16 -15
- package/dist/ops/webgpu/transpose16.js +13 -12
- package/dist/ops/webgpu/transpose16_program.js +3 -4
- package/dist/ops/webgpu/transpose16_shared_program.js +17 -18
- package/dist/ops/webgpu/unpack16.js +8 -9
- package/dist/ops/webgpu/utils/binary_op.js +20 -21
- package/dist/ops/webgpu/utils/deviceInfo.js +1 -2
- package/dist/ops/webgpu/utils/reductions.js +21 -20
- package/dist/ops-Be5ACU5R.js +13 -0
- package/dist/ops-C1UpdEYM.js +509 -0
- package/dist/{pack16-BhuXNUS7.js → pack16-BHO4t1-M.js} +14 -17
- package/dist/pad-Dy-1IP3A.js +13 -0
- package/dist/patches/webgpu_backend.js +18 -19
- package/dist/patches/webgpu_base.js +2 -3
- package/dist/patches/webgpu_program.js +21 -22
- package/dist/{pdf-Bzuk68Vy.js → pdf-CbnQ75VG.js} +380 -701
- package/dist/{picomatch-BO4HbNfo.js → picomatch--TW6gyBJ.js} +229 -291
- package/dist/qkv-BQfNPucX.js +42 -0
- package/dist/rand_util-_vCY93Uw.js +44 -0
- package/dist/random_normal-DUIT8kyC.js +11 -0
- package/dist/range-CYvQC3fW.js +13 -0
- package/dist/relu-C4XULT8A.js +8 -0
- package/dist/reshape-DJb1jgMt.js +8 -0
- package/dist/resize_nearest_neighbor-DAqcTYUe.js +188 -0
- package/dist/{chunk-CWhphoD1.js → rolldown-runtime-CwxnZyOB.js} +4 -5
- package/dist/{rope-BPu_uooz.js → rope-JjBVufF_.js} +6 -8
- package/dist/scatterSub-BOnqk-uY.js +27 -0
- package/dist/scatter_nd_util-BepMCpLY.js +34 -0
- package/dist/seedrandom-SHEGFK6H.js +282 -0
- package/dist/selu_util-DeOTf-sc.js +27 -0
- package/dist/shared-BIDMUBCs.js +1864 -0
- package/dist/{shared-CfTzpULd.js → shared-CX_iPI5K.js} +2 -3
- package/dist/silu-DsAE2cJ5.js +23 -0
- package/dist/slice-Dlb1FlzG.js +13 -0
- package/dist/{slice_util-Dve4TkDn.js → slice_util-BVgPRoij.js} +3 -4
- package/dist/softmax-Dpav_dWw.js +10 -0
- package/dist/split-DYnT8chz.js +11 -0
- package/dist/squeeze-B3XYGAlg.js +9 -0
- package/dist/stack-Dbbt9mIk.js +10 -0
- package/dist/step-DA-5DNu9.js +348 -0
- package/dist/{stream-BpAwcvHz.js → stream-BBe2apn4.js} +68 -88
- package/dist/sum-C8qNbFNp.js +13 -0
- package/dist/tensor-ALxWZfmz.js +7 -0
- package/dist/tensor1d-BHgkkhTE.js +9 -0
- package/dist/tensor2d-ARItvqVn.js +10 -0
- package/dist/tensor4d-D1zRBipJ.js +10 -0
- package/dist/tfjs_backend-CsXOum0h.js +685 -0
- package/dist/tile-DfyQ0KX-.js +10 -0
- package/dist/tokenise-DbS2Ea-T.js +14 -0
- package/dist/tokenise.js +6 -15
- package/dist/tokeniser/BaseTokeniser.js +5 -9
- package/dist/tokeniser/CharTokeniser.js +1 -2
- package/dist/tokeniser/bpe.js +19 -20
- package/dist/topk-BrU2pkrR.js +19 -0
- package/dist/training/AdamW.js +35 -31
- package/dist/training/BasicTrainer.js +56 -56
- package/dist/training/DatasetBuilder.js +1 -2
- package/dist/training/Evaluator.js +4 -4
- package/dist/training/LRScheduler.js +1 -2
- package/dist/training/PreTrainer.js +7 -8
- package/dist/training/SFTTrainer.js +7 -8
- package/dist/training/configure.js +16 -15
- package/dist/training/factory.js +1 -2
- package/dist/training/loss.js +1 -2
- package/dist/training/orthoGrad.js +2 -3
- package/dist/training/prepareData.js +18 -17
- package/dist/training/sparseCrossEntropy.js +38 -32
- package/dist/training/tasks/TokenStore.js +21 -22
- package/dist/training/tasks/tokenStream.js +1 -2
- package/dist/training/validateOptions.js +1 -2
- package/dist/training/validation.js +1 -2
- package/dist/transpose-BC-M_OoT.js +34 -0
- package/dist/unsorted_segment_sum-BelC7R-q.js +408 -0
- package/dist/utilities/arrayClose.js +5 -4
- package/dist/utilities/arrayShape.js +1 -2
- package/dist/utilities/datasetID.js +1 -2
- package/dist/utilities/dummy.js +15 -15
- package/dist/utilities/float16.js +10 -10
- package/dist/utilities/maxHeap.js +1 -2
- package/dist/utilities/multinomialCPU.d.ts +1 -2
- package/dist/utilities/multinomialCPU.js +6 -8
- package/dist/utilities/packed.js +2 -3
- package/dist/utilities/parameters.js +3 -4
- package/dist/utilities/performance.js +2 -3
- package/dist/utilities/profile.js +3 -4
- package/dist/utilities/random.js +1 -2
- package/dist/utilities/safetensors.js +14 -14
- package/dist/utilities/sentences.js +16 -13
- package/dist/utilities/tokenParse.js +1 -2
- package/dist/utilities/tokens.js +5 -6
- package/dist/utilities/topP.d.ts +1 -0
- package/dist/utilities/topP.js +20 -13
- package/dist/utilities/waitForModel.js +1 -2
- package/dist/utilities/weights.js +4 -4
- package/dist/utilities/yielder.js +1 -2
- package/dist/{v4-BK7K-jy_.js → v4-YCkfo8OR.js} +4 -7
- package/dist/{webgpu-IAn9VotJ.js → webgpu-BHX-uBym.js} +156 -163
- package/dist/{webgpu_program-B0PokuRJ.js → webgpu_program-DvkFqRlR.js} +28 -29
- package/dist/{webgpu_util-DfODg6XI.js → webgpu_util-5QTyovaf.js} +2 -3
- package/dist/zeros-hxKGkRfl.js +12 -0
- package/package.json +3 -3
- package/dist/Reshape-CwxdaU8n.js +0 -17
- package/dist/dist-Da20xy8E.js +0 -6375
- package/dist/gelu-B6637MKa.js +0 -27
- package/dist/selu_util-B_AFEfoz.js +0 -24
- package/dist/shared-24EoeHJl.js +0 -1314
- package/dist/silu-B6bvCgJ7.js +0 -25
- package/dist/tfjs_backend-h5weiy1O.js +0 -614
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as e, t } from "./
|
|
2
|
-
|
|
1
|
+
import { r as e, t } from "./rolldown-runtime-CwxnZyOB.js";
|
|
2
|
+
// node_modules/jszip/dist/jszip.min.js
|
|
3
3
|
var n = /* @__PURE__ */ t(((t, n) => {
|
|
4
4
|
(function(e) {
|
|
5
5
|
typeof t == "object" && n !== void 0 ? n.exports = e() : typeof define == "function" && define.amd ? define([], e) : (typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : this).JSZip = e();
|
|
@@ -636,7 +636,7 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
636
636
|
r.call(this, e);
|
|
637
637
|
}
|
|
638
638
|
e("../utils").inherits(i, r), i.prototype.readData = function(e) {
|
|
639
|
-
if (this.checkOffset(e), e === 0) return new Uint8Array();
|
|
639
|
+
if (this.checkOffset(e), e === 0) return /* @__PURE__ */ new Uint8Array();
|
|
640
640
|
var t = this.data.subarray(this.zero + this.index, this.zero + this.index + e);
|
|
641
641
|
return this.index += e, t;
|
|
642
642
|
}, t.exports = i;
|
|
@@ -1028,7 +1028,7 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1028
1028
|
applyCanBeUsed: {
|
|
1029
1029
|
uint8array: function() {
|
|
1030
1030
|
try {
|
|
1031
|
-
return r.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1;
|
|
1031
|
+
return r.uint8array && String.fromCharCode.apply(null, /* @__PURE__ */ new Uint8Array(1)).length === 1;
|
|
1032
1032
|
} catch {
|
|
1033
1033
|
return !1;
|
|
1034
1034
|
}
|
|
@@ -1208,8 +1208,7 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1208
1208
|
if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), 1 < this.disksCount) throw Error("Multi-volumes zip are not supported");
|
|
1209
1209
|
},
|
|
1210
1210
|
readLocalFiles: function() {
|
|
1211
|
-
var e, t;
|
|
1212
|
-
for (e = 0; e < this.files.length; e++) t = this.files[e], this.reader.setIndex(t.localHeaderOffset), this.checkSignature(a.LOCAL_FILE_HEADER), t.readLocalPart(this.reader), t.handleUTF8(), t.processAttributes();
|
|
1211
|
+
for (var e = 0, t; e < this.files.length; e++) t = this.files[e], this.reader.setIndex(t.localHeaderOffset), this.checkSignature(a.LOCAL_FILE_HEADER), t.readLocalPart(this.reader), t.handleUTF8(), t.processAttributes();
|
|
1213
1212
|
},
|
|
1214
1213
|
readCentralDir: function() {
|
|
1215
1214
|
var e;
|
|
@@ -1578,8 +1577,8 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1578
1577
|
var n = r.deflateInit2(this.strm, t.level, t.method, t.windowBits, t.memLevel, t.strategy);
|
|
1579
1578
|
if (n !== l) throw Error(o[n]);
|
|
1580
1579
|
if (t.header && r.deflateSetHeader(this.strm, t.header), t.dictionary) {
|
|
1581
|
-
var m;
|
|
1582
|
-
if (
|
|
1580
|
+
var m = typeof t.dictionary == "string" ? a.string2buf(t.dictionary) : c.call(t.dictionary) === "[object ArrayBuffer]" ? new Uint8Array(t.dictionary) : t.dictionary;
|
|
1581
|
+
if ((n = r.deflateSetDictionary(this.strm, m)) !== l) throw Error(o[n]);
|
|
1583
1582
|
this._dict_set = !0;
|
|
1584
1583
|
}
|
|
1585
1584
|
}
|
|
@@ -1591,7 +1590,7 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1591
1590
|
p.prototype.push = function(e, t) {
|
|
1592
1591
|
var n, o, s = this.strm, u = this.options.chunkSize;
|
|
1593
1592
|
if (this.ended) return !1;
|
|
1594
|
-
o = t === ~~t ? t : !0 === t ? 4 : 0, typeof e == "string" ?
|
|
1593
|
+
o = t === ~~t ? t : !0 === t ? 4 : 0, s.input = typeof e == "string" ? a.string2buf(e) : c.call(e) === "[object ArrayBuffer]" ? new Uint8Array(e) : e, s.next_in = 0, s.avail_in = s.input.length;
|
|
1595
1594
|
do {
|
|
1596
1595
|
if (s.avail_out === 0 && (s.output = new i.Buf8(u), s.next_out = 0, s.avail_out = u), (n = r.deflate(s, o)) !== 1 && n !== l) return this.onEnd(n), !(this.ended = !0);
|
|
1597
1596
|
s.avail_out !== 0 && (s.avail_in !== 0 || o !== 4 && o !== 2) || (this.options.to === "string" ? this.onData(a.buf2binstring(i.shrinkBuf(s.output, s.next_out))) : this.onData(i.shrinkBuf(s.output, s.next_out)));
|
|
@@ -1600,7 +1599,7 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1600
1599
|
}, p.prototype.onData = function(e) {
|
|
1601
1600
|
this.chunks.push(e);
|
|
1602
1601
|
}, p.prototype.onEnd = function(e) {
|
|
1603
|
-
e === l && (this.options.to === "string" ? this.
|
|
1602
|
+
e === l && (this.result = this.options.to === "string" ? this.chunks.join("") : i.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg;
|
|
1604
1603
|
}, n.Deflate = p, n.deflate = m, n.deflateRaw = function(e, t) {
|
|
1605
1604
|
return (t ||= {}).raw = !0, m(e, t);
|
|
1606
1605
|
}, n.gzip = function(e, t) {
|
|
@@ -1636,7 +1635,7 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1636
1635
|
d.prototype.push = function(e, t) {
|
|
1637
1636
|
var n, s, c, l, d, f, p = this.strm, m = this.options.chunkSize, h = this.options.dictionary, g = !1;
|
|
1638
1637
|
if (this.ended) return !1;
|
|
1639
|
-
s = t === ~~t ? t : !0 === t ? o.Z_FINISH : o.Z_NO_FLUSH, typeof e == "string" ?
|
|
1638
|
+
s = t === ~~t ? t : !0 === t ? o.Z_FINISH : o.Z_NO_FLUSH, p.input = typeof e == "string" ? a.binstring2buf(e) : u.call(e) === "[object ArrayBuffer]" ? new Uint8Array(e) : e, p.next_in = 0, p.avail_in = p.input.length;
|
|
1640
1639
|
do {
|
|
1641
1640
|
if (p.avail_out === 0 && (p.output = new i.Buf8(m), p.next_out = 0, p.avail_out = m), (n = r.inflate(p, o.Z_NO_FLUSH)) === o.Z_NEED_DICT && h && (f = typeof h == "string" ? a.string2buf(h) : u.call(h) === "[object ArrayBuffer]" ? new Uint8Array(h) : h, n = r.inflateSetDictionary(this.strm, f)), n === o.Z_BUF_ERROR && !0 === g && (n = o.Z_OK, g = !1), n !== o.Z_STREAM_END && n !== o.Z_OK) return this.onEnd(n), !(this.ended = !0);
|
|
1642
1641
|
p.next_out && (p.avail_out !== 0 && n !== o.Z_STREAM_END && (p.avail_in !== 0 || s !== o.Z_FINISH && s !== o.Z_SYNC_FLUSH) || (this.options.to === "string" ? (c = a.utf8border(p.output, p.next_out), l = p.next_out - c, d = a.buf2string(p.output, c), p.next_out = l, p.avail_out = m - l, l && i.arraySet(p.output, p.output, c, l, 0), this.onData(d)) : this.onData(i.shrinkBuf(p.output, p.next_out)))), p.avail_in === 0 && p.avail_out === 0 && (g = !0);
|
|
@@ -1645,7 +1644,7 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1645
1644
|
}, d.prototype.onData = function(e) {
|
|
1646
1645
|
this.chunks.push(e);
|
|
1647
1646
|
}, d.prototype.onEnd = function(e) {
|
|
1648
|
-
e === o.Z_OK && (this.options.to === "string" ? this.
|
|
1647
|
+
e === o.Z_OK && (this.result = this.options.to === "string" ? this.chunks.join("") : i.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg;
|
|
1649
1648
|
}, n.Inflate = d, n.inflate = f, n.inflateRaw = function(e, t) {
|
|
1650
1649
|
return (t ||= {}).raw = !0, f(e, t);
|
|
1651
1650
|
}, n.ungzip = f;
|
|
@@ -1678,8 +1677,7 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1678
1677
|
else for (var a = 0; a < r; a++) e[i + a] = t[n + a];
|
|
1679
1678
|
},
|
|
1680
1679
|
flattenChunks: function(e) {
|
|
1681
|
-
var t, n, r, i, a, o;
|
|
1682
|
-
for (t = r = 0, n = e.length; t < n; t++) r += e[t].length;
|
|
1680
|
+
for (var t = r = 0, n = e.length, r, i, a, o; t < n; t++) r += e[t].length;
|
|
1683
1681
|
for (o = new Uint8Array(r), t = i = 0, n = e.length; t < n; t++) a = e[t], o.set(a, i), i += a.length;
|
|
1684
1682
|
return o;
|
|
1685
1683
|
}
|
|
@@ -1703,7 +1701,7 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1703
1701
|
i = !1;
|
|
1704
1702
|
}
|
|
1705
1703
|
try {
|
|
1706
|
-
String.fromCharCode.apply(null, new Uint8Array(1));
|
|
1704
|
+
String.fromCharCode.apply(null, /* @__PURE__ */ new Uint8Array(1));
|
|
1707
1705
|
} catch {
|
|
1708
1706
|
a = !1;
|
|
1709
1707
|
}
|
|
@@ -1740,11 +1738,11 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1740
1738
|
}, { "./common": 41 }],
|
|
1741
1739
|
43: [function(e, t, n) {
|
|
1742
1740
|
t.exports = function(e, t, n, r) {
|
|
1743
|
-
for (var i = 65535 & e
|
|
1741
|
+
for (var i = 65535 & e, a = e >>> 16 & 65535, o = 0; n !== 0;) {
|
|
1744
1742
|
for (n -= o = 2e3 < n ? 2e3 : n; a = a + (i = i + t[r++] | 0) | 0, --o;);
|
|
1745
1743
|
i %= 65521, a %= 65521;
|
|
1746
1744
|
}
|
|
1747
|
-
return i | a << 16
|
|
1745
|
+
return i | a << 16;
|
|
1748
1746
|
};
|
|
1749
1747
|
}, {}],
|
|
1750
1748
|
44: [function(e, t, n) {
|
|
@@ -1824,8 +1822,8 @@ var n = /* @__PURE__ */ t(((t, n) => {
|
|
|
1824
1822
|
do
|
|
1825
1823
|
if (l[(n = t) + o] === m && l[n + o - 1] === p && l[n] === l[a] && l[++n] === l[a + 1]) {
|
|
1826
1824
|
a += 2, n++;
|
|
1827
|
-
do
|
|
1828
|
-
while (l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && a < f);
|
|
1825
|
+
do;
|
|
1826
|
+
while (l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && a < f);
|
|
1829
1827
|
if (r = w - (f - a), a = f - w, o < r) {
|
|
1830
1828
|
if (e.match_start = t, s <= (o = r)) break;
|
|
1831
1829
|
p = l[a + o - 1], m = l[a + o];
|
|
@@ -1852,11 +1850,12 @@ while (l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] ===
|
|
|
1852
1850
|
if (B(e), e.lookahead < T && t === l) return O;
|
|
1853
1851
|
if (e.lookahead === 0) break;
|
|
1854
1852
|
}
|
|
1855
|
-
if (n = 0, e.lookahead >= C && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + C - 1]) & e.hash_mask, n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), n !== 0 && e.strstart - n <= e.w_size - T && (e.match_length = z(e, n)), e.match_length >= C)
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1853
|
+
if (n = 0, e.lookahead >= C && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + C - 1]) & e.hash_mask, n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), n !== 0 && e.strstart - n <= e.w_size - T && (e.match_length = z(e, n)), e.match_length >= C) {
|
|
1854
|
+
if (r = a._tr_tally(e, e.strstart - e.match_start, e.match_length - C), e.lookahead -= e.match_length, e.match_length <= e.max_lazy_match && e.lookahead >= C) {
|
|
1855
|
+
for (e.match_length--; e.strstart++, e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + C - 1]) & e.hash_mask, n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart, --e.match_length != 0;);
|
|
1856
|
+
e.strstart++;
|
|
1857
|
+
} else e.strstart += e.match_length, e.match_length = 0, e.ins_h = e.window[e.strstart], e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + 1]) & e.hash_mask;
|
|
1858
|
+
} else r = a._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++;
|
|
1860
1859
|
if (r && (I(e, !1), e.strm.avail_out === 0)) return O;
|
|
1861
1860
|
}
|
|
1862
1861
|
return e.insert = e.strstart < C - 1 ? e.strstart : C - 1, t === u ? (I(e, !0), e.strm.avail_out === 0 ? A : j) : e.last_lit && (I(e, !1), e.strm.avail_out === 0) ? O : k;
|
|
@@ -1931,37 +1930,45 @@ while (l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] ===
|
|
|
1931
1930
|
var n, i, o, c;
|
|
1932
1931
|
if (!e || !e.state || 5 < t || t < 0) return e ? M(e, f) : f;
|
|
1933
1932
|
if (i = e.state, !e.output || !e.input && e.avail_in !== 0 || i.status === 666 && t !== u) return M(e, e.avail_out === 0 ? -5 : f);
|
|
1934
|
-
if (i.strm = e, n = i.last_flush, i.last_flush = t, i.status === E)
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1933
|
+
if (i.strm = e, n = i.last_flush, i.last_flush = t, i.status === E) {
|
|
1934
|
+
if (i.wrap === 2) e.adler = 0, L(i, 31), L(i, 139), L(i, 8), i.gzhead ? (L(i, +!!i.gzhead.text + (i.gzhead.hcrc ? 2 : 0) + (i.gzhead.extra ? 4 : 0) + (i.gzhead.name ? 8 : 0) + (i.gzhead.comment ? 16 : 0)), L(i, 255 & i.gzhead.time), L(i, i.gzhead.time >> 8 & 255), L(i, i.gzhead.time >> 16 & 255), L(i, i.gzhead.time >> 24 & 255), L(i, i.level === 9 ? 2 : 2 <= i.strategy || i.level < 2 ? 4 : 0), L(i, 255 & i.gzhead.os), i.gzhead.extra && i.gzhead.extra.length && (L(i, 255 & i.gzhead.extra.length), L(i, i.gzhead.extra.length >> 8 & 255)), i.gzhead.hcrc && (e.adler = s(e.adler, i.pending_buf, i.pending, 0)), i.gzindex = 0, i.status = 69) : (L(i, 0), L(i, 0), L(i, 0), L(i, 0), L(i, 0), L(i, i.level === 9 ? 2 : 2 <= i.strategy || i.level < 2 ? 4 : 0), L(i, 3), i.status = D);
|
|
1935
|
+
else {
|
|
1936
|
+
var p = g + (i.w_bits - 8 << 4) << 8;
|
|
1937
|
+
p |= (2 <= i.strategy || i.level < 2 ? 0 : i.level < 6 ? 1 : i.level === 6 ? 2 : 3) << 6, i.strstart !== 0 && (p |= 32), p += 31 - p % 31, i.status = D, R(i, p), i.strstart !== 0 && (R(i, e.adler >>> 16), R(i, 65535 & e.adler)), e.adler = 1;
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
if (i.status === 69) {
|
|
1941
|
+
if (i.gzhead.extra) {
|
|
1942
|
+
for (o = i.pending; i.gzindex < (65535 & i.gzhead.extra.length) && (i.pending !== i.pending_buf_size || (i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), F(e), o = i.pending, i.pending !== i.pending_buf_size));) L(i, 255 & i.gzhead.extra[i.gzindex]), i.gzindex++;
|
|
1943
|
+
i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), i.gzindex === i.gzhead.extra.length && (i.gzindex = 0, i.status = 73);
|
|
1944
|
+
} else i.status = 73;
|
|
1945
|
+
}
|
|
1946
|
+
if (i.status === 73) {
|
|
1947
|
+
if (i.gzhead.name) {
|
|
1948
|
+
o = i.pending;
|
|
1949
|
+
do {
|
|
1950
|
+
if (i.pending === i.pending_buf_size && (i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), F(e), o = i.pending, i.pending === i.pending_buf_size)) {
|
|
1951
|
+
c = 1;
|
|
1952
|
+
break;
|
|
1953
|
+
}
|
|
1954
|
+
c = i.gzindex < i.gzhead.name.length ? 255 & i.gzhead.name.charCodeAt(i.gzindex++) : 0, L(i, c);
|
|
1955
|
+
} while (c !== 0);
|
|
1956
|
+
i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), c === 0 && (i.gzindex = 0, i.status = 91);
|
|
1957
|
+
} else i.status = 91;
|
|
1958
|
+
}
|
|
1959
|
+
if (i.status === 91) {
|
|
1960
|
+
if (i.gzhead.comment) {
|
|
1961
|
+
o = i.pending;
|
|
1962
|
+
do {
|
|
1963
|
+
if (i.pending === i.pending_buf_size && (i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), F(e), o = i.pending, i.pending === i.pending_buf_size)) {
|
|
1964
|
+
c = 1;
|
|
1965
|
+
break;
|
|
1966
|
+
}
|
|
1967
|
+
c = i.gzindex < i.gzhead.comment.length ? 255 & i.gzhead.comment.charCodeAt(i.gzindex++) : 0, L(i, c);
|
|
1968
|
+
} while (c !== 0);
|
|
1969
|
+
i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), c === 0 && (i.status = 103);
|
|
1970
|
+
} else i.status = 103;
|
|
1938
1971
|
}
|
|
1939
|
-
if (i.status === 69) if (i.gzhead.extra) {
|
|
1940
|
-
for (o = i.pending; i.gzindex < (65535 & i.gzhead.extra.length) && (i.pending !== i.pending_buf_size || (i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), F(e), o = i.pending, i.pending !== i.pending_buf_size));) L(i, 255 & i.gzhead.extra[i.gzindex]), i.gzindex++;
|
|
1941
|
-
i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), i.gzindex === i.gzhead.extra.length && (i.gzindex = 0, i.status = 73);
|
|
1942
|
-
} else i.status = 73;
|
|
1943
|
-
if (i.status === 73) if (i.gzhead.name) {
|
|
1944
|
-
o = i.pending;
|
|
1945
|
-
do {
|
|
1946
|
-
if (i.pending === i.pending_buf_size && (i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), F(e), o = i.pending, i.pending === i.pending_buf_size)) {
|
|
1947
|
-
c = 1;
|
|
1948
|
-
break;
|
|
1949
|
-
}
|
|
1950
|
-
c = i.gzindex < i.gzhead.name.length ? 255 & i.gzhead.name.charCodeAt(i.gzindex++) : 0, L(i, c);
|
|
1951
|
-
} while (c !== 0);
|
|
1952
|
-
i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), c === 0 && (i.gzindex = 0, i.status = 91);
|
|
1953
|
-
} else i.status = 91;
|
|
1954
|
-
if (i.status === 91) if (i.gzhead.comment) {
|
|
1955
|
-
o = i.pending;
|
|
1956
|
-
do {
|
|
1957
|
-
if (i.pending === i.pending_buf_size && (i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), F(e), o = i.pending, i.pending === i.pending_buf_size)) {
|
|
1958
|
-
c = 1;
|
|
1959
|
-
break;
|
|
1960
|
-
}
|
|
1961
|
-
c = i.gzindex < i.gzhead.comment.length ? 255 & i.gzhead.comment.charCodeAt(i.gzindex++) : 0, L(i, c);
|
|
1962
|
-
} while (c !== 0);
|
|
1963
|
-
i.gzhead.hcrc && i.pending > o && (e.adler = s(e.adler, i.pending_buf, i.pending - o, o)), c === 0 && (i.status = 103);
|
|
1964
|
-
} else i.status = 103;
|
|
1965
1972
|
if (i.status === 103 && (i.gzhead.hcrc ? (i.pending + 2 > i.pending_buf_size && F(e), i.pending + 2 <= i.pending_buf_size && (L(i, 255 & e.adler), L(i, e.adler >> 8 & 255), e.adler = 0, i.status = D)) : i.status = D), i.pending !== 0) {
|
|
1966
1973
|
if (F(e), e.avail_out === 0) return i.last_flush = -1, d;
|
|
1967
1974
|
} else if (e.avail_in === 0 && N(t) <= N(n) && t !== u) return M(e, -5);
|
|
@@ -1984,8 +1991,8 @@ while (l[++a] === l[++n] && l[++a] === l[++n] && l[++a] === l[++n] && l[++a] ===
|
|
|
1984
1991
|
}
|
|
1985
1992
|
if (e.match_length = 0, e.lookahead >= C && 0 < e.strstart && (r = s[i = e.strstart - 1]) === s[++i] && r === s[++i] && r === s[++i]) {
|
|
1986
1993
|
o = e.strstart + w;
|
|
1987
|
-
do
|
|
1988
|
-
while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && i < o);
|
|
1994
|
+
do;
|
|
1995
|
+
while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && i < o);
|
|
1989
1996
|
e.match_length = w - (o - i), e.match_length > e.lookahead && (e.match_length = e.lookahead);
|
|
1990
1997
|
}
|
|
1991
1998
|
if (e.match_length >= C ? (n = a._tr_tally(e, 1, e.match_length - C), e.lookahead -= e.match_length, e.strstart += e.match_length, e.match_length = 0) : (n = a._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++), n && (I(e, !1), e.strm.avail_out === 0)) return O;
|
|
@@ -2487,7 +2494,7 @@ while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[+
|
|
|
2487
2494
|
if (v === 0) break e;
|
|
2488
2495
|
v--, b += p[g++] << x, x += 8;
|
|
2489
2496
|
}
|
|
2490
|
-
if (b !== (
|
|
2497
|
+
if (b !== (0 | n.total)) {
|
|
2491
2498
|
e.msg = "incorrect length check", n.mode = 30;
|
|
2492
2499
|
break;
|
|
2493
2500
|
}
|
|
@@ -2501,7 +2508,6 @@ while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[+
|
|
|
2501
2508
|
I = -3;
|
|
2502
2509
|
break e;
|
|
2503
2510
|
case 31: return -4;
|
|
2504
|
-
case 32:
|
|
2505
2511
|
default: return d;
|
|
2506
2512
|
}
|
|
2507
2513
|
return e.next_out = _, e.avail_out = y, e.next_in = g, e.avail_in = v, n.hold = b, n.bits = x, (n.wsize || C !== e.avail_out && n.mode < 30 && (n.mode < 27 || t !== 4)) && T(e, e.output, e.next_out, C - e.avail_out) ? (n.mode = 31, -4) : (S -= e.avail_in, C -= e.avail_out, e.total_in += S, e.total_out += C, n.total += C, n.wrap && C && (e.adler = n.check = n.flags ? a(n.check, m, C, e.next_out - C) : i(n.check, m, C, e.next_out - C)), e.data_type = n.bits + (n.last ? 64 : 0) + (n.mode === 12 ? 128 : 0) + (n.mode === 20 || n.mode === 15 ? 256 : 0), (S == 0 && C === 0 || t === 4) && I === u && (I = -5), I);
|
|
@@ -2668,7 +2674,7 @@ while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[+
|
|
|
2668
2674
|
for (w = 0; w < c; w++) t[n + w] !== 0 && (d[I[t[n + w]]++] = w);
|
|
2669
2675
|
if (v = e === 0 ? (N = L = d, 19) : e === 1 ? (N = i, P -= 257, L = a, R -= 257, 256) : (N = o, L = s, -1), C = T, _ = u, k = w = M = 0, h = -1, g = (j = 1 << (O = D)) - 1, e === 1 && 852 < j || e === 2 && 592 < j) return 1;
|
|
2670
2676
|
for (;;) {
|
|
2671
|
-
for (y = C - k, x = d[w] < v ? (b = 0, d[w]) : d[w] > v ? (b = L[R + d[w]], N[P + d[w]]) : (b = 96, 0), p = 1 << C - k, T = m = 1 << O; l[_ + (M >> k) + (m -= p)] = y << 24 | b << 16 | x
|
|
2677
|
+
for (y = C - k, x = d[w] < v ? (b = 0, d[w]) : d[w] > v ? (b = L[R + d[w]], N[P + d[w]]) : (b = 96, 0), p = 1 << C - k, T = m = 1 << O; l[_ + (M >> k) + (m -= p)] = y << 24 | b << 16 | x, m !== 0;);
|
|
2672
2678
|
for (p = 1 << C - 1; M & p;) p >>= 1;
|
|
2673
2679
|
if (p === 0 ? M = 0 : (M &= p - 1, M += p), w++, --F[C] == 0) {
|
|
2674
2680
|
if (C === E) break;
|
|
@@ -2677,7 +2683,7 @@ while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[+
|
|
|
2677
2683
|
if (D < C && (M & g) !== h) {
|
|
2678
2684
|
for (k === 0 && (k = D), _ += T, A = 1 << (O = C - k); O + k < E && !((A -= F[O + k]) <= 0);) O++, A <<= 1;
|
|
2679
2685
|
if (j += 1 << O, e === 1 && 852 < j || e === 2 && 592 < j) return 1;
|
|
2680
|
-
l[h = M & g] = D << 24 | O << 16 | _ - u
|
|
2686
|
+
l[h = M & g] = D << 24 | O << 16 | _ - u;
|
|
2681
2687
|
}
|
|
2682
2688
|
}
|
|
2683
2689
|
return M !== 0 && (l[_ + M] = C - k << 24 | 4194304), f.bits = D, 0;
|
|
@@ -2844,8 +2850,7 @@ while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[+
|
|
|
2844
2850
|
}
|
|
2845
2851
|
}
|
|
2846
2852
|
function H(e) {
|
|
2847
|
-
var t;
|
|
2848
|
-
for (t = 0; t < u; t++) e.dyn_ltree[2 * t] = 0;
|
|
2853
|
+
for (var t = 0; t < u; t++) e.dyn_ltree[2 * t] = 0;
|
|
2849
2854
|
for (t = 0; t < d; t++) e.dyn_dtree[2 * t] = 0;
|
|
2850
2855
|
for (t = 0; t < f; t++) e.bl_tree[2 * t] = 0;
|
|
2851
2856
|
e.dyn_ltree[2 * _] = 1, e.opt_len = e.static_len = 0, e.last_lit = e.matches = 0;
|
|
@@ -2901,7 +2906,7 @@ while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[+
|
|
|
2901
2906
|
var X = !1;
|
|
2902
2907
|
function Z(e, t, n, i) {
|
|
2903
2908
|
R(e, (s << 1) + +!!i, 3), function(e, t, n, i) {
|
|
2904
|
-
U(e),
|
|
2909
|
+
U(e), L(e, n), L(e, ~n), r.arraySet(e.pending_buf, e.window, t, n, e.pending), e.pending += n;
|
|
2905
2910
|
}(e, t, n, !0);
|
|
2906
2911
|
}
|
|
2907
2912
|
n._tr_init = function(e) {
|
|
@@ -3029,5 +3034,4 @@ while (r === s[++i] && r === s[++i] && r === s[++i] && r === s[++i] && r === s[+
|
|
|
3029
3034
|
}, {}, [10])(10);
|
|
3030
3035
|
});
|
|
3031
3036
|
}));
|
|
3032
|
-
//#endregion
|
|
3033
3037
|
export { n as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as l } from "./backend_util-
|
|
3
|
-
import { Z as u, a as d } from "./gpgpu_math-
|
|
4
|
-
|
|
1
|
+
import { Bn as e, C as t, Pn as n, _i as r, lt as i, mr as a, pt as o, qi as s, qt as c } from "./dist-CMMLi-qO.js";
|
|
2
|
+
import { r as l } from "./backend_util-Cpp0Gwlp.js";
|
|
3
|
+
import { Z as u, a as d } from "./gpgpu_math-48m8q3jI.js";
|
|
4
|
+
// node_modules/@tensorflow/tfjs-backend-webgl/dist/binaryop_gpu.js
|
|
5
5
|
var f = "\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n", p = class {
|
|
6
|
-
constructor(e,
|
|
7
|
-
this.variableNames = ["A", "B"], this.outputShape = n
|
|
6
|
+
constructor(e, n, r) {
|
|
7
|
+
this.variableNames = ["A", "B"], this.outputShape = t(n, r), this.enableShapeUniforms = d(this.outputShape.length), this.userCode = `
|
|
8
8
|
float binaryOperation(float a, float b) {
|
|
9
9
|
${e}
|
|
10
10
|
}
|
|
@@ -17,8 +17,7 @@ var f = "\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n", p = class {
|
|
|
17
17
|
`;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
//#region node_modules/@tensorflow/tfjs-backend-webgl/dist/packing_util.js
|
|
20
|
+
// node_modules/@tensorflow/tfjs-backend-webgl/dist/packing_util.js
|
|
22
21
|
function m(e, t) {
|
|
23
22
|
return [
|
|
24
23
|
"x",
|
|
@@ -38,25 +37,25 @@ function g(e, t) {
|
|
|
38
37
|
for (let r = 0; r < e; r++) n += t[r], r < e - 1 && (n += ",");
|
|
39
38
|
return n;
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
//#region node_modules/@tensorflow/tfjs-backend-webgl/dist/binaryop_packed_gpu.js
|
|
40
|
+
// node_modules/@tensorflow/tfjs-backend-webgl/dist/binaryop_packed_gpu.js
|
|
43
41
|
var _ = "\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN : result.g;\n result.b = isNaN.b ? NAN : result.b;\n result.a = isNaN.a ? NAN : result.a;\n", v = class {
|
|
44
|
-
constructor(e,
|
|
45
|
-
this.variableNames = ["A", "B"], this.supportsBroadcasting = !0, this.packedInputs = !0, this.packedOutput = !0, this.outputShape = n
|
|
42
|
+
constructor(e, n, r, i = !1) {
|
|
43
|
+
this.variableNames = ["A", "B"], this.supportsBroadcasting = !0, this.packedInputs = !0, this.packedOutput = !0, this.outputShape = t(n, r);
|
|
46
44
|
let a = this.outputShape.length;
|
|
47
45
|
this.enableShapeUniforms = d(a);
|
|
48
46
|
let o = "";
|
|
49
|
-
if (i)
|
|
50
|
-
|
|
47
|
+
if (i) {
|
|
48
|
+
if (a === 0 || s(this.outputShape) === 1) o = "\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";
|
|
49
|
+
else if (o = `
|
|
51
50
|
${u(a)} coords = getOutputCoords();
|
|
52
51
|
`, a === 1) this.enableShapeUniforms ? o += "\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n " : o += `
|
|
53
52
|
result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;
|
|
54
53
|
result.z = 0.;
|
|
55
54
|
result.w = 0.;
|
|
56
55
|
`;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
else {
|
|
57
|
+
let e = h("coords", a);
|
|
58
|
+
this.enableShapeUniforms ? o += `
|
|
60
59
|
bool nextRowOutOfBounds =
|
|
61
60
|
(${e[a - 2]} + 1) >= outShape[${a} - 2];
|
|
62
61
|
bool nextColOutOfBounds =
|
|
@@ -73,6 +72,7 @@ var _ = "\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN :
|
|
|
73
72
|
result.z = nextRowOutOfBounds ? 0. : result.z;
|
|
74
73
|
result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;
|
|
75
74
|
`;
|
|
75
|
+
}
|
|
76
76
|
}
|
|
77
77
|
this.userCode = `
|
|
78
78
|
vec4 binaryOperation(vec4 a, vec4 b) {
|
|
@@ -91,8 +91,7 @@ var _ = "\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN :
|
|
|
91
91
|
`;
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
|
|
95
|
-
//#region node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Identity.js
|
|
94
|
+
// node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Identity.js
|
|
96
95
|
function y(e) {
|
|
97
96
|
let { inputs: t, backend: n } = e, { x: r } = t;
|
|
98
97
|
return n.incRef(r.dataId), {
|
|
@@ -102,12 +101,11 @@ function y(e) {
|
|
|
102
101
|
};
|
|
103
102
|
}
|
|
104
103
|
var b = {
|
|
105
|
-
kernelName:
|
|
104
|
+
kernelName: n,
|
|
106
105
|
backendName: "webgl",
|
|
107
106
|
kernelFunc: y
|
|
108
107
|
};
|
|
109
|
-
|
|
110
|
-
//#region node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Complex.js
|
|
108
|
+
// node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Complex.js
|
|
111
109
|
function x(e) {
|
|
112
110
|
let { inputs: t, backend: n } = e, { real: r, imag: i } = t, a = n.makeTensorInfo(r.shape, "complex64"), o = n.texData.get(a.dataId);
|
|
113
111
|
return o.complexTensorInfos = {
|
|
@@ -122,16 +120,16 @@ function x(e) {
|
|
|
122
120
|
}, a;
|
|
123
121
|
}
|
|
124
122
|
var S = {
|
|
125
|
-
kernelName:
|
|
123
|
+
kernelName: c,
|
|
126
124
|
backendName: "webgl",
|
|
127
125
|
kernelFunc: x
|
|
128
126
|
}, C = "return (a < 0.) ? b * a : a;", w = "\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";
|
|
129
127
|
function T(e) {
|
|
130
|
-
let { inputs:
|
|
131
|
-
return
|
|
128
|
+
let { inputs: t, backend: n, attrs: i } = e, { x: a } = t, { alpha: s } = i, c = n.makeTensorInfo([], "float32", o(s, "float32")), l = r().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new v(w, a.shape, c.shape) : new p(C, a.shape, c.shape), u = n.runWebGLProgram(l, [a, c], "float32");
|
|
129
|
+
return n.disposeIntermediateTensorInfo(c), u;
|
|
132
130
|
}
|
|
133
131
|
var E = {
|
|
134
|
-
kernelName:
|
|
132
|
+
kernelName: e,
|
|
135
133
|
backendName: "webgl",
|
|
136
134
|
kernelFunc: T
|
|
137
135
|
}, D = "return (a < 0.) ? b * a : a;", O = "\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";
|
|
@@ -140,7 +138,7 @@ function k(e) {
|
|
|
140
138
|
return n.runWebGLProgram(o, [i, a], "float32");
|
|
141
139
|
}
|
|
142
140
|
var A = {
|
|
143
|
-
kernelName:
|
|
141
|
+
kernelName: a,
|
|
144
142
|
backendName: "webgl",
|
|
145
143
|
kernelFunc: k
|
|
146
144
|
}, j = class {
|
|
@@ -185,37 +183,37 @@ function q({ opSnippet: e, packedOpSnippet: t, cpuKernelImpl: n, dtype: i }) {
|
|
|
185
183
|
return d = u ? new G(s.shape, t) : new j(s.shape, e), c.runWebGLProgram(d, [s], l);
|
|
186
184
|
};
|
|
187
185
|
}
|
|
188
|
-
function J({ opSnippet:
|
|
186
|
+
function J({ opSnippet: e, packedOpSnippet: t, checkOutOfBounds: n = !1, supportsComplex: a = !1, cpuKernelImpl: o, dtype: s }) {
|
|
189
187
|
return ({ inputs: c, backend: u }) => {
|
|
190
188
|
let { a: d, b: f } = c, m = u;
|
|
191
189
|
if (a && d.dtype === "complex64") {
|
|
192
|
-
let
|
|
193
|
-
let [
|
|
194
|
-
dataId:
|
|
195
|
-
dtype:
|
|
190
|
+
let t = m.texData.get(d.dataId), n = m.texData.get(f.dataId), [r, a] = [[t.complexTensorInfos.real, n.complexTensorInfos.real], [t.complexTensorInfos.imag, n.complexTensorInfos.imag]].map((t) => {
|
|
191
|
+
let [n, r] = t, a = {
|
|
192
|
+
dataId: n.dataId,
|
|
193
|
+
dtype: n.dtype,
|
|
196
194
|
shape: d.shape
|
|
197
195
|
}, o = {
|
|
198
|
-
dataId:
|
|
199
|
-
dtype:
|
|
196
|
+
dataId: r.dataId,
|
|
197
|
+
dtype: r.dtype,
|
|
200
198
|
shape: f.shape
|
|
201
|
-
}, s = new p(
|
|
202
|
-
return m.runWebGLProgram(s, [a, o],
|
|
199
|
+
}, s = new p(e, d.shape, f.shape);
|
|
200
|
+
return m.runWebGLProgram(s, [a, o], i(n.dtype, r.dtype));
|
|
203
201
|
}), o = x({
|
|
204
202
|
inputs: {
|
|
205
|
-
real:
|
|
203
|
+
real: r,
|
|
206
204
|
imag: a
|
|
207
205
|
},
|
|
208
206
|
backend: m
|
|
209
207
|
});
|
|
210
|
-
return m.disposeIntermediateTensorInfo(
|
|
208
|
+
return m.disposeIntermediateTensorInfo(r), m.disposeIntermediateTensorInfo(a), o;
|
|
211
209
|
}
|
|
212
|
-
let h = s ||
|
|
210
|
+
let h = s || i(d.dtype, f.dtype);
|
|
213
211
|
if ((d.dtype === "string" || f.dtype === "string" || m.shouldExecuteOnCPU([d, f])) && o != null) {
|
|
214
212
|
let e = m.texData.get(d.dataId).values, t = m.texData.get(f.dataId).values, n = d.dtype === "string" ? l(e) : e, r = d.dtype === "string" ? l(t) : t, [i, a] = o(d.shape, f.shape, n, r, h), s = m.makeTensorInfo(a, h), c = m.texData.get(s.dataId);
|
|
215
213
|
return c.values = i, s;
|
|
216
214
|
}
|
|
217
|
-
let g = r().getBool("WEBGL_PACK_BINARY_OPERATIONS") &&
|
|
218
|
-
return _ = g ? new v(
|
|
215
|
+
let g = r().getBool("WEBGL_PACK_BINARY_OPERATIONS") && t != null, _;
|
|
216
|
+
return _ = g ? new v(t, d.shape, f.shape, n) : new p(e, d.shape, f.shape), m.runWebGLProgram(_, [d, f], h);
|
|
219
217
|
};
|
|
220
218
|
}
|
|
221
219
|
function Y(e, t = !1) {
|
|
@@ -228,5 +226,4 @@ function Y(e, t = !1) {
|
|
|
228
226
|
if (e === "sigmoid") return t ? W : z;
|
|
229
227
|
throw Error(`Activation ${e} has not been implemented for the WebGL backend.`);
|
|
230
228
|
}
|
|
231
|
-
//#endregion
|
|
232
229
|
export { f as S, _, G as a, m as b, R as c, E as d, x as f, v as g, b as h, q as i, j as l, y as m, J as n, P as o, S as p, Y as r, M as s, K as t, A as u, h as v, p as x, g as y };
|
package/dist/layers/BaseLayer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as e, h as t, m as n } from "../dist-CMMLi-qO.js";
|
|
2
2
|
import r from "./WeightStore.js";
|
|
3
|
-
|
|
3
|
+
// lib/layers/BaseLayer.ts
|
|
4
4
|
var i = class {
|
|
5
5
|
parent;
|
|
6
6
|
config;
|
|
@@ -58,19 +58,18 @@ var i = class {
|
|
|
58
58
|
}
|
|
59
59
|
checkpointingFn(r, ...i) {
|
|
60
60
|
let a = this.trainableVariables;
|
|
61
|
-
return
|
|
62
|
-
let o =
|
|
61
|
+
return n((...n) => {
|
|
62
|
+
let o = n[n.length - 1], s = n.slice(0, i.length), c = this.forward(r, ...s);
|
|
63
63
|
return o(s), {
|
|
64
64
|
value: c,
|
|
65
|
-
gradFunc: (
|
|
66
|
-
let o =
|
|
67
|
-
|
|
68
|
-
let c =
|
|
69
|
-
return
|
|
65
|
+
gradFunc: (n, i) => {
|
|
66
|
+
let o = e().state.activeTape;
|
|
67
|
+
e().state.activeTape = [];
|
|
68
|
+
let c = t((...e) => this.forward(r, ...e.slice(0, s.length)))([...i, ...a], n);
|
|
69
|
+
return e().state.activeTape = o, c;
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
})(...i, ...a);
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
//#endregion
|
|
76
75
|
export { i as default };
|