potatOS/copy-cat/jszip.min-7c1798d8.js

23 lines
94 KiB
JavaScript
Raw Normal View History

2023-11-12 14:57:16 +00:00
/**
* copy-cat: Copyright SquidDev 2023
*
* - @squid-dev/cc-web-term: Copyright SquidDev (BSD-3-Clause)
* - jszip: Copyright Stuart Knightley ((MIT OR GPL-3.0-or-later))
* - preact: Copyright (MIT)
* - setimmediate: Copyright YuzuJS (MIT)
* - style-inject: Copyright EGOIST (MIT)
* - tslib: Copyright Microsoft Corp. (0BSD)
*
* @license
*/define(function(){"use strict";/*!
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/main/LICENSE
*/!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSZip=e()}(function(){return(function e(t,r,n){function i(s,o){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!o&&h)return h(s,!0);if(a)return a(s,!0);var u=Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){return i(t[s][1][e]||e)},l,l.exports,e,t,r,n)}return r[s].exports}for(var a="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i})({1:[function(e,t,r){var n=e("./utils"),i=e("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,i,s,o,h,u,l=[],f=0,d=e.length,c=d,p="string"!==n.getTypeOf(e);f<e.length;)c=d-f,i=p?(t=e[f++],r=f<d?e[f++]:0,f<d?e[f++]:0):(t=e.charCodeAt(f++),r=f<d?e.charCodeAt(f++):0,f<d?e.charCodeAt(f++):0),s=t>>2,o=(3&t)<<4|r>>4,h=1<c?(15&r)<<2|i>>6:64,u=2<c?63&i:64,l.push(a.charAt(s)+a.charAt(o)+a.charAt(h)+a.charAt(u));return l.join("")},r.decode=function(e){var t,r,n,s,o,h,u=0,l=0,f="data:";if(e.substr(0,f.length)===f)throw Error("Invalid base64 input, it looks like a data url.");var d,c=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&c--,e.charAt(e.length-2)===a.charAt(64)&&c--,c%1!=0)throw Error("Invalid base64 input, bad content length.");for(d=i.uint8array?new Uint8Array(0|c):Array(0|c);u<e.length;)t=a.indexOf(e.charAt(u++))<<2|(s=a.indexOf(e.charAt(u++)))>>4,r=(15&s)<<4|(o=a.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(h=a.indexOf(e.charAt(u++))),d[l++]=t,64!==o&&(d[l++]=r),64!==h&&(d[l++]=n);return d}},{"./support":30,"./utils":32}],2:[function(e,t,r){var n=e("./external"),i=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),s=e("./stream/DataLengthProbe");function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new a).pipe(new s("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new s("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){var n=e("./stream/GenericWorker");r.STORE={magic:"\x00\x00",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){var n=e("./utils"),i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^i[255&(e^t[s])];return -1^e}(0|t,e,e.length,0):function(e,t,r,n){var a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^i[255&(e^t.charCodeAt(s))];return -1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){var n=null;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=t