@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
3 lines (2 loc) • 37.3 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("kendo.pako-esm.cmn.chunk.js")):"function"==typeof define&&define.amd?define(["exports","kendo.pako-esm.cmn.chunk"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).kendo=t.kendo||{},t.kendo._globals=t.kendo._globals||{},t.kendo._globals.JszipEsmCmnChunk={}),t.kendo._globals.PakoEsmCmnChunk)}(this,(function(t,e){var r={Promise:Promise},i={base64:!0,array:!0,string:!0,nodebuffer:!1,nodestream:!1,get arraybuffer(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},get uint8array(){return"undefined"!=typeof Uint8Array},get blob(){return n()}},n=function(){var t;if("undefined"==typeof ArrayBuffer)t=!1;else{var e=new ArrayBuffer(0);try{t=0===new Blob([e],{type:"application/zip"}).size}catch(e){t=!1}}return n=function(){return t},t},s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(t){return t}function a(t,e){for(var r=0;r<t.length;++r)e[r]=255&t.charCodeAt(r);return e}function h(t,e,r){var i=[],n=0,s=t.length;if(s<=r)return String.fromCharCode.apply(null,t);for(;n<s;)"array"===e?i.push(String.fromCharCode.apply(null,t.slice(n,Math.min(n+r,s)))):i.push(String.fromCharCode.apply(null,t.subarray(n,Math.min(n+r,s)))),n+=r;return i.join("")}var u=function(){var t;try{t=i.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){t=!1}return u=function(){return t},t};function c(t){var e=65536,r=m(t),i=!0;if("uint8array"===r&&(i=u()),i)for(;e>1;)try{return h(t,r,e)}catch(t){e=Math.floor(e/2)}return function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}(t)}var p=c;function d(t,e){for(var r=0;r<t.length;r++)e[r]=t[r];return e}var f={string:{string:o,array:function(t){return a(t,new Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return a(t,new Uint8Array(t.length))}},array:{string:c,array:o,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)}},arraybuffer:{string:function(t){return c(new Uint8Array(t))},array:function(t){return d(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:o,uint8array:function(t){return new Uint8Array(t)}},uint8array:{string:c,array:function(t){return d(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:o}},l=function(t,e){if(e||(e=""),!t)return e;y(t);var r=m(e);return f[r][t](e)},m=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":i.uint8array&&t instanceof Uint8Array?"uint8array":i.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},y=function(t){if(!i[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},g=65535,v=-1,k=function(t){var e,r,i="";for(r=0;r<(t||"").length;r++)i+="\\x"+((e=t.charCodeAt(r))<16?"0":"")+e.toString(16).toUpperCase();return i},w=function(t,e,r){setTimeout((function(){t.apply(r||null,e||[])}),0)},S=function(){var t,e,r=arguments,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.hasOwnProperty.call(r[t],e)&&void 0===i[e]&&(i[e]=r[t][e]);return i},b=function(t,e,n,o,h){return r.Promise.resolve(e).then((function(t){return i.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new r.Promise((function(e,r){var i=new FileReader;i.onload=function(t){e(t.target.result)},i.onerror=function(t){r(t.target.error)},i.readAsArrayBuffer(t)})):t})).then((function(e){var u,c=m(e);return c?("arraybuffer"===c?e=l("uint8array",e):"string"===c&&(h?e=function(t){var e,r,n,o,a,h,u=0,c=0,p="data:";if(t.substr(0,5)===p)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===s.charAt(64)&&f--,t.charAt(t.length-2)===s.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=i.uint8array?new Uint8Array(0|f):new Array(0|f);u<t.length;)e=s.indexOf(t.charAt(u++))<<2|(o=s.indexOf(t.charAt(u++)))>>4,r=(15&o)<<4|(a=s.indexOf(t.charAt(u++)))>>2,n=(3&a)<<6|(h=s.indexOf(t.charAt(u++))),d[c++]=e,64!==a&&(d[c++]=r),64!==h&&(d[c++]=n);return d}(e):n&&!0!==o&&(e=a(u=e,i.uint8array?new Uint8Array(u.length):new Array(u.length)))),e):r.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))},C=function(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null};C.prototype.push=function(t){this.emit("data",t)},C.prototype.end=function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},C.prototype.error=function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},C.prototype.on=function(t,e){return this._listeners[t].push(e),this},C.prototype.cleanUp=function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},C.prototype.emit=function(t,e){if(this._listeners[t])for(var r=0;r<this._listeners[t].length;r++)this._listeners[t][r].call(this,e)},C.prototype.pipe=function(t){return t.registerPrevious(this)},C.prototype.registerPrevious=function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},C.prototype.pause=function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},C.prototype.resume=function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var t=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},C.prototype.flush=function(){},C.prototype.processChunk=function(t){this.push(t)},C.prototype.withStreamInfo=function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},C.prototype.mergeStreamInfo=function(){for(var t in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},C.prototype.lock=function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},C.prototype.toString=function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t};var _=function(t){for(var e=new Array(256),r=0;r<256;r++)e[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;return e[254]=e[254]=1,_=function(t){return e[t]},e[t]},x=function(t){return function(t){var e,r,n,s,o,a=t.length,h=0;for(s=0;s<a;s++)55296==(64512&(r=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=t.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(n-56320),s++),h+=r<128?1:r<2048?2:r<65536?3:4;for(e=i.uint8array?new Uint8Array(h):new Array(h),o=0,s=0;o<h;s++)55296==(64512&(r=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=t.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(n-56320),s++),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e}(t)},I=function(t){return function(t){var e,r,i,n,s=t.length,o=new Array(2*s);for(r=0,e=0;e<s;)if((i=t[e++])<128)o[r++]=i;else if((n=_(i))>4)o[r++]=65533,e+=n-1;else{for(i&=2===n?31:3===n?15:7;n>1&&e<s;)i=i<<6|63&t[e++],n--;n>1?o[r++]=65533:i<65536?o[r++]=i:(i-=65536,o[r++]=55296|i>>10&1023,o[r++]=56320|1023&i)}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),p(o)}(t=l(i.uint8array?"uint8array":"array",t))},O=function(t){function e(){t.call(this,"utf-8 decode"),this.leftOver=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(t){var e=l(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var n=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+_(t[r])>e?r:e}(e),s=e;n!==e.length&&(i.uint8array?(s=e.subarray(0,n),this.leftOver=e.subarray(n,e.length)):(s=e.slice(0,n),this.leftOver=e.slice(n,e.length))),this.push({data:I(s),meta:t.meta})},e.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:I(this.leftOver),meta:{}}),this.leftOver=null)},e}(C),z=function(t){function e(){t.call(this,"utf-8 encode")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(t){this.push({data:x(t.data),meta:t.meta})},e}(C),A=function(t){function e(e){t.call(this,"ConvertWorker to "+e),this.destType=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(t){this.push({data:l(this.destType,t.data),meta:t.meta})},e}(C);function P(t,e,r){switch(t){case"blob":return function(t,e){return y("blob"),new Blob([t],{type:e})}(l("arraybuffer",e),r);case"base64":return function(t){for(var e,r,i,n,o,a,h,u=[],c=0,p=t.length,d=p,f="string"!=typeof t;c<t.length;)d=p-c,f?(e=t[c++],r=c<p?t[c++]:0,i=c<p?t[c++]:0):(e=t.charCodeAt(c++),r=c<p?t.charCodeAt(c++):0,i=c<p?t.charCodeAt(c++):0),n=e>>2,o=(3&e)<<4|r>>4,a=d>1?(15&r)<<2|i>>6:64,h=d>2?63&i:64,u.push(s.charAt(n)+s.charAt(o)+s.charAt(a)+s.charAt(h));return u.join("")}(e);default:return l(t,e)}}function E(t,e){return new r.Promise((function(r,i){var n=[],s=t._internalType,o=t._outputType,a=t._mimeType;t.on("data",(function(t,r){n.push(t),e&&e(r)})).on("error",(function(t){n=[],i(t)})).on("end",(function(){try{var t=P(o,function(t,e){var r,i=0,n=null,s=0;for(r=0;r<e.length;r++)s+=e[r].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(n=new Uint8Array(s),r=0;r<e.length;r++)n.set(e[r],i),i+=e[r].length;return n;default:throw new Error("concat : unsupported type '"+t+"'")}}(s,n),a);r(t)}catch(t){i(t)}n=[]})).resume()}))}var F=function(t,e,r){var i=e;switch(e){case"blob":case"arraybuffer":i="uint8array";break;case"base64":i="string"}try{this._internalType=i,this._outputType=e,this._mimeType=r,y(i),this._worker=t.pipe(new A(i)),t.lock()}catch(t){this._worker=new C("error"),this._worker.error(t)}};F.prototype.accumulate=function(t){return E(this,t)},F.prototype.on=function(t,e){var r=this;return"data"===t?this._worker.on(t,(function(t){e.call(r,t.data,t.meta)})):this._worker.on(t,(function(){w(e,arguments,r)})),this},F.prototype.resume=function(){return w(this._worker.resume,[],this._worker),this},F.prototype.pause=function(){return this._worker.pause(),this};var D=!0,U=Object.freeze({__proto__:null,base64:!1,binary:!1,dir:!1,createFolders:D,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null}),R=function(t){function e(e){t.call(this,"DataWorker");var r=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(t){r.dataIsReady=!0,r.data=t,r.max=t&&t.length||0,r.type=m(t),r.isPaused||r._tickAndRepeat()}),(function(t){r.error(t)}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.cleanUp=function(){t.prototype.cleanUp.call(this),this.data=null},e.prototype.resume=function(){return!!t.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,w(this._tickAndRepeat,[],this)),!0)},e.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(w(this._tickAndRepeat,[],this),this._tickScheduled=!0))},e.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e}(C),N=function(t){function e(e){t.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(e){if(e){var r=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=r+e.data.length}t.prototype.processChunk.call(this,e)},e}(C),T=function(){for(var t=[],e=0;e<256;e++){for(var r=e,i=0;i<8;i++)r=1&r?3988292384^r>>>1:r>>>1;t[e]=r}return T=function(){return t},t};function B(t,e){return void 0!==t&&t.length?"string"!==m(t)?function(t,e,r,i){var n=T(),s=i+r;t=~t;for(var o=i;o<s;o++)t=t>>>8^n[255&(t^e[o])];return~t}(0|e,t,t.length,0):function(t,e,r,i){var n=T(),s=i+r;t=~t;for(var o=i;o<s;o++)t=t>>>8^n[255&(t^e.charCodeAt(o))];return~t}(0|e,t,t.length,0):0}var W=function(t){function e(){t.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(t){this.streamInfo.crc32=B(t.data,this.streamInfo.crc32||0),this.push(t)},e}(C),j=function(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n};j.prototype.getContentWorker=function(){var t=new R(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new N("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},j.prototype.getCompressedWorker=function(){return new R(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)},j.createWorkerFrom=function(t,e,r){return t.pipe(new W).pipe(new N("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new N("compressedSize")).withStreamInfo("compression",e)};var L=function(t,e,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=e,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};L.prototype.internalStream=function(t){var e=null,r="string";try{if(!t)throw new Error("No output type specified.");var i="string"===(r=t.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),e=this._decompressWorker();var n=!this._dataBinary;n&&!i&&(e=e.pipe(new z)),!n&&i&&(e=e.pipe(new O))}catch(t){(e=new C("error")).error(t)}return new F(e,r,"")},L.prototype.async=function(t,e){return this.internalStream(t).accumulate(e)},L.prototype._compressWorker=function(t,e){if(this._data instanceof j&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new z)),j.createWorkerFrom(r,t,e)},L.prototype._decompressWorker=function(){return this._data instanceof j?this._data.getContentWorker():this._data instanceof C?this._data:new R(this._data)};var Z=function(){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array?"uint8array":"array";Z=function(){return t}},M=function(t){function r(e,r){t.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=r,this.meta={}}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(l(Z(),t.data),!1)},r.prototype.flush=function(){t.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},r.prototype.cleanUp=function(){t.prototype.cleanUp.call(this),this._pako=null},r.prototype._createPako=function(){var t=this,r={raw:!0,level:this._pakoOptions.level||-1};this._pako="Deflate"===this._pakoAction?new e.D(r):new e.I(r),this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r}(C),J={magic:"\b\0",compressWorker:function(t){return new M("Deflate",t)},uncompressWorker:function(){return new M("Inflate",{})}},K={STORE:{magic:"\0\0",compressWorker:function(){return new C("STORE compression")},uncompressWorker:function(){return new C("STORE decompression")}},DEFLATE:J},H="PK",X="PK",q="PK",Y="PK",G="PK",Q=function(t,e){var r,i="";for(r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i},V=function(t,e,r,i,n,s){var o,a,h=t.file,u=t.compression,c=s!==x,p=l("string",s(h.name)),d=l("string",x(h.name)),f=h.comment,m=l("string",s(f)),y=l("string",x(f)),g=d.length!==h.name.length,v=y.length!==f.length,k="",w="",S="",b=h.dir,C=h.date,_={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(_.crc32=t.crc32,_.compressedSize=t.compressedSize,_.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),c||!g&&!v||(I|=2048);var O=0,z=0;b&&(O|=16),"UNIX"===n?(z=798,O|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(h.unixPermissions,b)):(z=20,O|=function(t){return 63&(t||0)}(h.dosPermissions)),o=C.getUTCHours(),o<<=6,o|=C.getUTCMinutes(),o<<=5,o|=C.getUTCSeconds()/2,a=C.getUTCFullYear()-1980,a<<=4,a|=C.getUTCMonth()+1,a<<=5,a|=C.getUTCDate(),g&&(w=Q(1,1)+Q(B(p),4)+d,k+="up"+Q(w.length,2)+w),v&&(S=Q(1,1)+Q(B(m),4)+y,k+="uc"+Q(S.length,2)+S);var A="";return A+="\n\0",A+=Q(I,2),A+=u.magic,A+=Q(o,2),A+=Q(a,2),A+=Q(_.crc32,4),A+=Q(_.compressedSize,4),A+=Q(_.uncompressedSize,4),A+=Q(p.length,2),A+=Q(k.length,2),{fileRecord:H+A+p+k,dirRecord:X+Q(z,2)+A+Q(m.length,2)+"\0\0\0\0"+Q(O,4)+Q(i,4)+p+k+m}},$=function(t){return"PK\b"+Q(t.crc32,4)+Q(t.compressedSize,4)+Q(t.uncompressedSize,4)},tt=function(t){function e(e,r,i,n){t.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=r,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(e){var r=e.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,t.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(r+100*(i-n-1))/i:100}}))},e.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=V(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},e.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=V(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:$(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},e.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var r=this.bytesWritten-t,i=function(t,e,r,i,n){var s=l("string",n(i));return q+"\0\0\0\0"+Q(t,2)+Q(t,2)+Q(e,4)+Q(r,4)+Q(s.length,2)+s}(this.dirRecords.length,r,t,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},e.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},e.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},e.prototype.resume=function(){return!!t.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},e.prototype.error=function(e){var r=this._sources;if(!t.prototype.error.call(this,e))return!1;for(var i=0;i<r.length;i++)try{r[i].error(e)}catch(t){}return!0},e.prototype.lock=function(){t.prototype.lock.call(this);for(var e=this._sources,r=0;r<e.length;r++)e[r].lock()},e}(C),et=function(t,e,r){var i=new tt(e.streamFiles,r,e.platform,e.encodeFileName),n=0;try{t.forEach((function(t,r){n++;var s=function(t,e){var r=t||e,i=K[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,e.compression),o=r.options.compressionOptions||e.compressionOptions||{},a=r.dir,h=r.date;r._compressWorker(s,o).withStreamInfo("file",{name:t,dir:a,date:h,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(i)})),i.entriesCount=n}catch(t){i.error(t)}return i},rt=function(t){this.data=t,this.length=t.length,this.index=0,this.zero=0};rt.prototype.checkOffset=function(t){this.checkIndex(this.index+t)},rt.prototype.checkIndex=function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},rt.prototype.setIndex=function(t){this.checkIndex(t),this.index=t},rt.prototype.skip=function(t){this.setIndex(this.index+t)},rt.prototype.byteAt=function(t){},rt.prototype.readInt=function(t){var e,r=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},rt.prototype.readString=function(t){return l("string",this.readData(t))},rt.prototype.readData=function(t){},rt.prototype.lastIndexOfSignature=function(t){},rt.prototype.readAndCheckSignature=function(t){},rt.prototype.readDate=function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))};var it=function(t){function e(e){t.call(this,e);for(var r=0;r<this.data.length;r++)e[r]=255&e[r]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.byteAt=function(t){return this.data[this.zero+t]},e.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2),n=t.charCodeAt(3),s=this.length-4;s>=0;--s)if(this.data[s]===e&&this.data[s+1]===r&&this.data[s+2]===i&&this.data[s+3]===n)return s-this.zero;return-1},e.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2),n=t.charCodeAt(3),s=this.readData(4);return e===s[0]&&r===s[1]&&i===s[2]&&n===s[3]},e.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e}(rt),nt=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},e.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},e.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},e.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e}(rt),st=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e}(it);function ot(t){var e=m(t);return y(e),"string"!==e||i.uint8array?i.uint8array?new st(l("uint8array",t)):new it(l("array",t)):new nt(t)}var at=function(t,e){this.options=t,this.loadOptions=e};at.prototype.isEncrypted=function(){return!(1&~this.bitFlag)},at.prototype.useUTF8=function(){return!(2048&~this.bitFlag)},at.prototype.readLocalPart=function(t){var e,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in K)if(K.hasOwnProperty(e)&&K[e].magic===t)return K[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+k(this.compressionMethod)+" unknown (inner file : "+l("string",this.fileName)+")");this.decompressed=new j(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},at.prototype.readCentralPart=function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},at.prototype.processAttributes=function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},at.prototype.parseZIP64ExtraField=function(t){if(this.extraFields[1]){var e=ot(this.extraFields[1].value);this.uncompressedSize===v&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===v&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===v&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===v&&(this.diskNumberStart=e.readInt(4))}},at.prototype.readExtraFields=function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index<n;)e=t.readInt(2),r=t.readInt(2),i=t.readData(r),this.extraFields[e]={id:e,length:r,value:i}},at.prototype.handleUTF8=function(){var t=i.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=I(this.fileName),this.fileCommentStr=I(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var r=l(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var s=l(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},at.prototype.findExtraFieldUnicodePath=function(){var t=this.extraFields[28789];if(t){var e=ot(t.value);return 1!==e.readInt(1)||B(this.fileName)!==e.readInt(4)?null:I(e.readData(t.length-5))}return null},at.prototype.findExtraFieldUnicodeComment=function(){var t=this.extraFields[25461];if(t){var e=ot(t.value);return 1!==e.readInt(1)||B(this.fileComment)!==e.readInt(4)?null:I(e.readData(t.length-5))}return null};var ht=function(t){this.files=[],this.loadOptions=t};function ut(t){return new r.Promise((function(e,r){var i=t.decompressed.getContentWorker().pipe(new W);i.on("error",(function(t){r(t)})).on("end",(function(){i.streamInfo.crc32!==t.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}function ct(t,e){var i=this;return e=S(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:I}),b("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var r=new ht(e);return r.load(t),r})).then((function(t){var i=[r.Promise.resolve(t)],n=t.files;if(e.checkCRC32)for(var s=0;s<n.length;s++)i.push(ut(n[s]));return r.Promise.all(i)})).then((function(t){for(var r=t.shift(),n=r.files,s=0;s<n.length;s++){var o=n[s];i.file(o.fileNameStr,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:e.createFolders})}return r.zipComment.length&&(i.comment=r.zipComment),i}))}ht.prototype.checkSignature=function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+k(e)+", expected "+k(t)+")")}},ht.prototype.isSignature=function(t,e){var r=this.reader.index;this.reader.setIndex(t);var i=this.reader.readString(4)===e;return this.reader.setIndex(r),i},ht.prototype.readBlockEndOfCentral=function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=i.uint8array?"uint8array":"array",r=l(e,t);this.zipComment=this.loadOptions.decodeFileName(r)},ht.prototype.readBlockZip64EndOfCentral=function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,r,i=this.zip64EndOfCentralSize-44;0<i;)t=this.reader.readInt(2),e=this.reader.readInt(4),r=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:r}},ht.prototype.readBlockZip64EndOfCentralLocator=function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},ht.prototype.readLocalFiles=function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(H),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},ht.prototype.readCentralDir=function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(X);)(t=new at({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},ht.prototype.readEndOfCentral=function(){var t=this.reader.lastIndexOfSignature(q);if(t<0)throw!this.isSignature(0,H)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(t);var e=t;if(this.checkSignature(q),this.readBlockEndOfCentral(),this.diskNumber===g||this.diskWithCentralDirStart===g||this.centralDirRecordsOnThisDisk===g||this.centralDirRecords===g||this.centralDirSize===v||this.centralDirOffset===v){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(Y))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(Y),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,G)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(G),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(G),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var i=e-r;if(i>0)this.isSignature(e,X)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},ht.prototype.prepareReader=function(t){this.reader=ot(t)},ht.prototype.load=function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()};var pt=function(t,e,r){var i,n=m(e),s=S(r||{},U);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(t=ft(t)),s.createFolders&&(i=dt(t))&<.call(this,i,!0);var o="string"===n&&!1===s.binary&&!1===s.base64;r&&void 0!==r.binary||(s.binary=!o),(e instanceof j&&0===e.uncompressedSize||s.dir||!e||0===e.length)&&(s.base64=!1,s.binary=!0,e="",s.compression="STORE",n="string");var a=null;a=e instanceof j||e instanceof C?e:b(t,e,s.binary,s.optimizedBinaryString,s.base64);var h=new L(t,a,s);this.files[t]=h},dt=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},ft=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},lt=function(t,e){return e=void 0!==e?e:D,t=ft(t),this.files[t]||pt.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function mt(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var yt=function t(){if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new t;for(var r in this)"function"!=typeof this[r]&&(e[r]=this[r]);return e}},gt={support:{configurable:!0},defaults:{configurable:!0},version:{configurable:!0},external:{configurable:!0}};yt.prototype.load=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},yt.prototype.forEach=function(t){var e,r,i;for(e in this.files)i=this.files[e],(r=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(r,i)},yt.prototype.filter=function(t){var e=[];return this.forEach((function(r,i){t(r,i)&&e.push(i)})),e},yt.prototype.file=function(t,e,r){if(1===arguments.length){if(mt(t)){var i=t;return this.filter((function(t,e){return!e.dir&&i.test(t)}))}var n=this.files[this.root+t];return n&&!n.dir?n:null}return t=this.root+t,pt.call(this,t,e,r),this},yt.prototype.folder=function(t){if(!t)return this;if(mt(t))return this.filter((function(e,r){return r.dir&&t.test(e)}));var e=this.root+t,r=lt.call(this,e),i=this.clone();return i.root=r.name,i},yt.prototype.remove=function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter((function(e,r){return r.name.slice(0,t.length)===t})),i=0;i<r.length;i++)delete this.files[r[i].name];return this},yt.prototype.generate=function(t){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},yt.prototype.generateInternalStream=function(t){var e,r={};try{if((r=S(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:x})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");y(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var i=r.comment||this.comment||"";e=et(this,r,i)}catch(t){(e=new C("error")).error(t)}return new F(e,r.type||"string",r.mimeType)},yt.prototype.generateAsync=function(t,e){return this.generateInternalStream(t).accumulate(e)},yt.prototype.loadAsync=function(t,e){return ct.apply(this,[t,e])},yt.loadAsync=function(t,e){return(new yt).loadAsync(t,e)},gt.support.get=function(){return i},gt.defaults.get=function(){return U},gt.version.get=function(){return"3.2.2-esm"},gt.external.get=function(){return r},Object.defineProperties(yt,gt),t.J=yt,t.__meta__={id:"jszip-esm.cmn.chunk",name:"JszipEsmCmnChunk",category:"web",description:"A reusable outputed chunk of code",depends:["pako-esm.cmn.chunk"],hidden:!0,chunk:!0}}));
//# sourceMappingURL=kendo.jszip-esm.cmn.chunk.min.js.map