jvs-docx-ui 0.1.0 → 0.1.1

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.
@@ -1,4 +1,4 @@
1
- (function(gt,st){typeof exports=="object"&&typeof module<"u"?st(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],st):(gt=typeof globalThis<"u"?globalThis:gt||self,st(gt.JvsDocxUi={},gt.Vue))})(this,(function(gt,st){"use strict";var Ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ie(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Dt(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Vt={exports:{}};/*!
1
+ (function(pe,ne){typeof exports=="object"&&typeof module<"u"?ne(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],ne):(pe=typeof globalThis<"u"?globalThis:pe||self,ne(pe.JvsDocxUi={},pe.Vue))})(this,(function(pe,ne){"use strict";var De=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $t(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Le(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qe={exports:{}};/*!
2
2
 
3
3
  JSZip v3.10.2 - A JavaScript class for generating and reading zip files
4
4
  <http://stuartk.com/jszip>
@@ -8,31 +8,31 @@
8
8
 
9
9
  JSZip uses the library pako released under the MIT license :
10
10
  https://github.com/nodeca/pako/blob/main/LICENSE
11
- */var ne;function Oe(){return ne||(ne=1,(function(s,e){(function(t){s.exports=t()})(function(){return(function t(r,n,a){function i(g,_){if(!n[g]){if(!r[g]){var v=typeof Dt=="function"&&Dt;if(!_&&v)return v(g,!0);if(l)return l(g,!0);var y=new Error("Cannot find module '"+g+"'");throw y.code="MODULE_NOT_FOUND",y}var u=n[g]={exports:{}};r[g][0].call(u.exports,function(b){var d=r[g][1][b];return i(d||b)},u,u.exports,t,r,n,a)}return n[g].exports}for(var l=typeof Dt=="function"&&Dt,c=0;c<a.length;c++)i(a[c]);return i})({1:[function(t,r,n){var a=t("./utils"),i=t("./support"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(c){for(var g,_,v,y,u,b,d,f=[],p=0,k=c.length,C=k,P=a.getTypeOf(c)!=="string";p<c.length;)C=k-p,v=P?(g=c[p++],_=p<k?c[p++]:0,p<k?c[p++]:0):(g=c.charCodeAt(p++),_=p<k?c.charCodeAt(p++):0,p<k?c.charCodeAt(p++):0),y=g>>2,u=(3&g)<<4|_>>4,b=1<C?(15&_)<<2|v>>6:64,d=2<C?63&v:64,f.push(l.charAt(y)+l.charAt(u)+l.charAt(b)+l.charAt(d));return f.join("")},n.decode=function(c){var g,_,v,y,u,b,d=0,f=0,p="data:";if(c.substr(0,p.length)===p)throw new Error("Invalid base64 input, it looks like a data url.");var k,C=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===l.charAt(64)&&C--,c.charAt(c.length-2)===l.charAt(64)&&C--,C%1!=0)throw new Error("Invalid base64 input, bad content length.");for(k=i.uint8array?new Uint8Array(0|C):new Array(0|C);d<c.length;)g=l.indexOf(c.charAt(d++))<<2|(y=l.indexOf(c.charAt(d++)))>>4,_=(15&y)<<4|(u=l.indexOf(c.charAt(d++)))>>2,v=(3&u)<<6|(b=l.indexOf(c.charAt(d++))),k[f++]=g,u!==64&&(k[f++]=_),b!==64&&(k[f++]=v);return k}},{"./support":30,"./utils":32}],2:[function(t,r,n){var a=t("./external"),i=t("./stream/DataWorker"),l=t("./stream/Crc32Probe"),c=t("./stream/DataLengthProbe");function g(_,v,y,u,b){this.compressedSize=_,this.uncompressedSize=v,this.crc32=y,this.compression=u,this.compressedContent=b}g.prototype={getContentWorker:function(){var _=new i(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),v=this;return _.on("end",function(){if(this.streamInfo.data_length!==v.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),_},getCompressedWorker:function(){return new i(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(_,v,y){return _.pipe(new l).pipe(new c("uncompressedSize")).pipe(v.compressWorker(y)).pipe(new c("compressedSize")).withStreamInfo("compression",v)},r.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,r,n){var a=t("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},n.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,r,n){var a=t("./utils"),i=(function(){for(var l,c=[],g=0;g<256;g++){l=g;for(var _=0;_<8;_++)l=1&l?3988292384^l>>>1:l>>>1;c[g]=l}return c})();r.exports=function(l,c){return l!==void 0&&l.length?a.getTypeOf(l)!=="string"?(function(g,_,v,y){var u=i,b=y+v;g^=-1;for(var d=y;d<b;d++)g=g>>>8^u[255&(g^_[d])];return-1^g})(0|c,l,l.length,0):(function(g,_,v,y){var u=i,b=y+v;g^=-1;for(var d=y;d<b;d++)g=g>>>8^u[255&(g^_.charCodeAt(d))];return-1^g})(0|c,l,l.length,0):0}},{"./utils":32}],5:[function(t,r,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(t,r,n){var a=null;a=typeof Promise<"u"?Promise:t("lie"),r.exports={Promise:a}},{lie:37}],7:[function(t,r,n){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=t("pako"),l=t("./utils"),c=t("./stream/GenericWorker"),g=a?"uint8array":"array";function _(v,y){c.call(this,"FlateWorker/"+v),this._pako=null,this._pakoAction=v,this._pakoOptions=y,this.meta={}}n.magic="\b\0",l.inherits(_,c),_.prototype.processChunk=function(v){this.meta=v.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(g,v.data),!1)},_.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},_.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},_.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var v=this;this._pako.onData=function(y){v.push({data:y,meta:v.meta})}},n.compressWorker=function(v){return new _("Deflate",v)},n.uncompressWorker=function(){return new _("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,r,n){function a(u,b){var d,f="";for(d=0;d<b;d++)f+=String.fromCharCode(255&u),u>>>=8;return f}function i(u,b,d,f,p,k){var C,P,A=u.file,I=u.compression,T=k!==g.utf8encode,$=l.transformTo("string",k(A.name)),F=l.transformTo("string",g.utf8encode(A.name)),W=A.comment,J=l.transformTo("string",k(W)),S=l.transformTo("string",g.utf8encode(W)),O=F.length!==A.name.length,h=S.length!==W.length,L="",et="",H="",rt=A.dir,Z=A.date,tt={crc32:0,compressedSize:0,uncompressedSize:0};b&&!d||(tt.crc32=u.crc32,tt.compressedSize=u.compressedSize,tt.uncompressedSize=u.uncompressedSize);var R=0;b&&(R|=8),T||!O&&!h||(R|=2048);var M=0,Q=0;rt&&(M|=16),p==="UNIX"?(Q=798,M|=(function(X,ut){var vt=X;return X||(vt=ut?16893:33204),(65535&vt)<<16})(A.unixPermissions,rt)):(Q=20,M|=(function(X){return 63&(X||0)})(A.dosPermissions)),C=Z.getUTCHours(),C<<=6,C|=Z.getUTCMinutes(),C<<=5,C|=Z.getUTCSeconds()/2,P=Z.getUTCFullYear()-1980,P<<=4,P|=Z.getUTCMonth()+1,P<<=5,P|=Z.getUTCDate(),O&&(et=a(1,1)+a(_($),4)+F,L+="up"+a(et.length,2)+et),h&&(H=a(1,1)+a(_(J),4)+S,L+="uc"+a(H.length,2)+H);var q="";return q+=`
12
- \0`,q+=a(R,2),q+=I.magic,q+=a(C,2),q+=a(P,2),q+=a(tt.crc32,4),q+=a(tt.compressedSize,4),q+=a(tt.uncompressedSize,4),q+=a($.length,2),q+=a(L.length,2),{fileRecord:v.LOCAL_FILE_HEADER+q+$+L,dirRecord:v.CENTRAL_FILE_HEADER+a(Q,2)+q+a(J.length,2)+"\0\0\0\0"+a(M,4)+a(f,4)+$+L+J}}var l=t("../utils"),c=t("../stream/GenericWorker"),g=t("../utf8"),_=t("../crc32"),v=t("../signature");function y(u,b,d,f){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=b,this.zipPlatform=d,this.encodeFileName=f,this.streamFiles=u,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(y,c),y.prototype.push=function(u){var b=u.meta.percent||0,d=this.entriesCount,f=this._sources.length;this.accumulate?this.contentBuffer.push(u):(this.bytesWritten+=u.data.length,c.prototype.push.call(this,{data:u.data,meta:{currentFile:this.currentFile,percent:d?(b+100*(d-f-1))/d:100}}))},y.prototype.openedSource=function(u){this.currentSourceOffset=this.bytesWritten,this.currentFile=u.file.name;var b=this.streamFiles&&!u.file.dir;if(b){var d=i(u,b,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:d.fileRecord,meta:{percent:0}})}else this.accumulate=!0},y.prototype.closedSource=function(u){this.accumulate=!1;var b=this.streamFiles&&!u.file.dir,d=i(u,b,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(d.dirRecord),b)this.push({data:(function(f){return v.DATA_DESCRIPTOR+a(f.crc32,4)+a(f.compressedSize,4)+a(f.uncompressedSize,4)})(u),meta:{percent:100}});else for(this.push({data:d.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},y.prototype.flush=function(){for(var u=this.bytesWritten,b=0;b<this.dirRecords.length;b++)this.push({data:this.dirRecords[b],meta:{percent:100}});var d=this.bytesWritten-u,f=(function(p,k,C,P,A){var I=l.transformTo("string",A(P));return v.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(p,2)+a(p,2)+a(k,4)+a(C,4)+a(I.length,2)+I})(this.dirRecords.length,d,u,this.zipComment,this.encodeFileName);this.push({data:f,meta:{percent:100}})},y.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},y.prototype.registerPrevious=function(u){this._sources.push(u);var b=this;return u.on("data",function(d){b.processChunk(d)}),u.on("end",function(){b.closedSource(b.previous.streamInfo),b._sources.length?b.prepareNextSource():b.end()}),u.on("error",function(d){b.error(d)}),this},y.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},y.prototype.error=function(u){var b=this._sources;if(!c.prototype.error.call(this,u))return!1;for(var d=0;d<b.length;d++)try{b[d].error(u)}catch{}return!0},y.prototype.lock=function(){c.prototype.lock.call(this);for(var u=this._sources,b=0;b<u.length;b++)u[b].lock()},r.exports=y},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,r,n){var a=t("../compressions"),i=t("./ZipFileWorker");n.generateWorker=function(l,c,g){var _=new i(c.streamFiles,g,c.platform,c.encodeFileName),v=0;try{l.forEach(function(y,u){v++;var b=(function(k,C){var P=k||C,A=a[P];if(!A)throw new Error(P+" is not a valid compression method !");return A})(u.options.compression,c.compression),d=u.options.compressionOptions||c.compressionOptions||{},f=u.dir,p=u.date;u._compressWorker(b,d).withStreamInfo("file",{name:y,dir:f,date:p,comment:u.comment||"",unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions}).pipe(_)}),_.entriesCount=v}catch(y){_.error(y)}return _}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,r,n){function a(){if(!(this instanceof a))return new a;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 i=new a;for(var l in this)typeof this[l]!="function"&&(i[l]=this[l]);return i}}(a.prototype=t("./object")).loadAsync=t("./load"),a.support=t("./support"),a.defaults=t("./defaults"),a.version="3.10.2",a.loadAsync=function(i,l){return new a().loadAsync(i,l)},a.external=t("./external"),r.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,r,n){var a=t("./utils"),i=t("./external"),l=t("./utf8"),c=t("./zipEntries"),g=t("./stream/Crc32Probe"),_=t("./nodejsUtils");function v(y){return new i.Promise(function(u,b){var d=y.decompressed.getContentWorker().pipe(new g);d.on("error",function(f){b(f)}).on("end",function(){d.streamInfo.crc32!==y.decompressed.crc32?b(new Error("Corrupted zip : CRC32 mismatch")):u()}).resume()})}r.exports=function(y,u){var b=this;return u=a.extend(u||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:l.utf8decode}),_.isNode&&_.isStream(y)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",y,!0,u.optimizedBinaryString,u.base64).then(function(d){var f=new c(u);return f.load(d),f}).then(function(d){var f=[i.Promise.resolve(d)],p=d.files;if(u.checkCRC32)for(var k=0;k<p.length;k++)f.push(v(p[k]));return i.Promise.all(f)}).then(function(d){for(var f=d.shift(),p=f.files,k=0;k<p.length;k++){var C=p[k],P=C.fileNameStr,A=a.resolve(C.fileNameStr);b.file(A,C.decompressed,{binary:!0,optimizedBinaryString:!0,date:C.date,dir:C.dir,comment:C.fileCommentStr.length?C.fileCommentStr:null,unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions,createFolders:u.createFolders}),C.dir||(b.file(A).unsafeOriginalName=P)}return f.zipComment.length&&(b.comment=f.zipComment),b})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,r,n){var a=t("../utils"),i=t("../stream/GenericWorker");function l(c,g){i.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(g)}a.inherits(l,i),l.prototype._bindStream=function(c){var g=this;(this._stream=c).pause(),c.on("data",function(_){g.push({data:_,meta:{percent:0}})}).on("error",function(_){g.isPaused?this.generatedError=_:g.error(_)}).on("end",function(){g.isPaused?g._upstreamEnded=!0:g.end()})},l.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},l.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=l},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,r,n){var a=t("readable-stream").Readable;function i(l,c,g){a.call(this,c),this._helper=l;var _=this;l.on("data",function(v,y){_.push(v)||_._helper.pause(),g&&g(y)}).on("error",function(v){_.emit("error",v)}).on("end",function(){_.push(null)})}t("../utils").inherits(i,a),i.prototype._read=function(){this._helper.resume()},r.exports=i},{"../utils":32,"readable-stream":16}],14:[function(t,r,n){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(a,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(a,i);if(typeof a=="number")throw new Error('The "data" argument must not be a number');return new Buffer(a,i)},allocBuffer:function(a){if(Buffer.alloc)return Buffer.alloc(a);var i=new Buffer(a);return i.fill(0),i},isBuffer:function(a){return Buffer.isBuffer(a)},isStream:function(a){return a&&typeof a.on=="function"&&typeof a.pause=="function"&&typeof a.resume=="function"}}},{}],15:[function(t,r,n){function a(A,I,T){var $,F=l.getTypeOf(I),W=l.extend(T||{},_);W.date=W.date||new Date,W.compression!==null&&(W.compression=W.compression.toUpperCase()),typeof W.unixPermissions=="string"&&(W.unixPermissions=parseInt(W.unixPermissions,8)),W.unixPermissions&&16384&W.unixPermissions&&(W.dir=!0),W.dosPermissions&&16&W.dosPermissions&&(W.dir=!0),W.dir&&(A=p(A)),W.createFolders&&($=f(A))&&k.call(this,$,!0);var J=F==="string"&&W.binary===!1&&W.base64===!1;T&&T.binary!==void 0||(W.binary=!J),(I instanceof v&&I.uncompressedSize===0||W.dir||!I||I.length===0)&&(W.base64=!1,W.binary=!0,I="",W.compression="STORE",F="string");var S=null;S=I instanceof v||I instanceof c?I:b.isNode&&b.isStream(I)?new d(A,I):l.prepareContent(A,I,W.binary,W.optimizedBinaryString,W.base64);var O=new y(A,S,W);this.files[A]=O}var i=t("./utf8"),l=t("./utils"),c=t("./stream/GenericWorker"),g=t("./stream/StreamHelper"),_=t("./defaults"),v=t("./compressedObject"),y=t("./zipObject"),u=t("./generate"),b=t("./nodejsUtils"),d=t("./nodejs/NodejsStreamInputAdapter"),f=function(A){A.slice(-1)==="/"&&(A=A.substring(0,A.length-1));var I=A.lastIndexOf("/");return 0<I?A.substring(0,I):""},p=function(A){return A.slice(-1)!=="/"&&(A+="/"),A},k=function(A,I){return I=I!==void 0?I:_.createFolders,A=p(A),this.files[A]||a.call(this,A,null,{dir:!0,createFolders:I}),this.files[A]};function C(A){return Object.prototype.toString.call(A)==="[object RegExp]"}var P={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(A){var I,T,$;for(I in this.files)$=this.files[I],(T=I.slice(this.root.length,I.length))&&I.slice(0,this.root.length)===this.root&&A(T,$)},filter:function(A){var I=[];return this.forEach(function(T,$){A(T,$)&&I.push($)}),I},file:function(A,I,T){if(arguments.length!==1)return A=this.root+A,a.call(this,A,I,T),this;if(C(A)){var $=A;return this.filter(function(W,J){return!J.dir&&$.test(W)})}var F=this.files[this.root+A];return F&&!F.dir?F:null},folder:function(A){if(!A)return this;if(C(A))return this.filter(function(F,W){return W.dir&&A.test(F)});var I=this.root+A,T=k.call(this,I),$=this.clone();return $.root=T.name,$},remove:function(A){A=this.root+A;var I=this.files[A];if(I||(A.slice(-1)!=="/"&&(A+="/"),I=this.files[A]),I&&!I.dir)delete this.files[A];else for(var T=this.filter(function(F,W){return W.name.slice(0,A.length)===A}),$=0;$<T.length;$++)delete this.files[T[$].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(A){var I,T={};try{if((T=l.extend(A||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=T.type.toLowerCase(),T.compression=T.compression.toUpperCase(),T.type==="binarystring"&&(T.type="string"),!T.type)throw new Error("No output type specified.");l.checkSupport(T.type),T.platform!=="darwin"&&T.platform!=="freebsd"&&T.platform!=="linux"&&T.platform!=="sunos"||(T.platform="UNIX"),T.platform==="win32"&&(T.platform="DOS");var $=T.comment||this.comment||"";I=u.generateWorker(this,T,$)}catch(F){(I=new c("error")).error(F)}return new g(I,T.type||"string",T.mimeType)},generateAsync:function(A,I){return this.generateInternalStream(A).accumulate(I)},generateNodeStream:function(A,I){return(A=A||{}).type||(A.type="nodebuffer"),this.generateInternalStream(A).toNodejsStream(I)}};r.exports=P},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,r,n){r.exports=t("stream")},{stream:void 0}],17:[function(t,r,n){var a=t("./DataReader");function i(l){a.call(this,l);for(var c=0;c<this.data.length;c++)l[c]=255&l[c]}t("../utils").inherits(i,a),i.prototype.byteAt=function(l){return this.data[this.zero+l]},i.prototype.lastIndexOfSignature=function(l){for(var c=l.charCodeAt(0),g=l.charCodeAt(1),_=l.charCodeAt(2),v=l.charCodeAt(3),y=this.length-4;0<=y;--y)if(this.data[y]===c&&this.data[y+1]===g&&this.data[y+2]===_&&this.data[y+3]===v)return y-this.zero;return-1},i.prototype.readAndCheckSignature=function(l){var c=l.charCodeAt(0),g=l.charCodeAt(1),_=l.charCodeAt(2),v=l.charCodeAt(3),y=this.readData(4);return c===y[0]&&g===y[1]&&_===y[2]&&v===y[3]},i.prototype.readData=function(l){if(this.checkOffset(l),l===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},r.exports=i},{"../utils":32,"./DataReader":18}],18:[function(t,r,n){var a=t("../utils");function i(l){this.data=l,this.length=l.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(l){this.checkIndex(this.index+l)},checkIndex:function(l){if(this.length<this.zero+l||l<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+l+"). Corrupted zip ?")},setIndex:function(l){this.checkIndex(l),this.index=l},skip:function(l){this.setIndex(this.index+l)},byteAt:function(){},readInt:function(l){var c,g=0;for(this.checkOffset(l),c=this.index+l-1;c>=this.index;c--)g=(g<<8)+this.byteAt(c);return this.index+=l,g},readString:function(l){return a.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},r.exports=i},{"../utils":32}],19:[function(t,r,n){var a=t("./Uint8ArrayReader");function i(l){a.call(this,l)}t("../utils").inherits(i,a),i.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,r,n){var a=t("./DataReader");function i(l){a.call(this,l)}t("../utils").inherits(i,a),i.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},i.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},i.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},i.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(t,r,n){var a=t("./ArrayReader");function i(l){a.call(this,l)}t("../utils").inherits(i,a),i.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(t,r,n){var a=t("../utils"),i=t("../support"),l=t("./ArrayReader"),c=t("./StringReader"),g=t("./NodeBufferReader"),_=t("./Uint8ArrayReader");r.exports=function(v){var y=a.getTypeOf(v);return a.checkSupport(y),y!=="string"||i.uint8array?y==="nodebuffer"?new g(v):i.uint8array?new _(a.transformTo("uint8array",v)):new l(a.transformTo("array",v)):new c(v)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,r,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,r,n){var a=t("./GenericWorker"),i=t("../utils");function l(c){a.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(l,a),l.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(t,r,n){var a=t("./GenericWorker"),i=t("../crc32");function l(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(l,a),l.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,r,n){var a=t("../utils"),i=t("./GenericWorker");function l(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}a.inherits(l,i),l.prototype.processChunk=function(c){if(c){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(t,r,n){var a=t("../utils"),i=t("./GenericWorker");function l(c){i.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(_){g.dataIsReady=!0,g.data=_,g.max=_&&_.length||0,g.type=a.getTypeOf(_),g.isPaused||g._tickAndRepeat()},function(_){g.error(_)})}a.inherits(l,i),l.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,g=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,g);break;case"uint8array":c=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":c=this.data.slice(this.index,g)}return this.index=g,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(t,r,n){function a(i){this.name=i||"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}a.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,l){return this._listeners[i].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,l){if(this._listeners[i])for(var c=0;c<this._listeners[i].length;c++)this._listeners[i][c].call(this,l)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var l=this;return i.on("data",function(c){l.processChunk(c)}),i.on("end",function(){l.end()}),i.on("error",function(c){l.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,l){return this.extraStreamInfo[i]=l,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},r.exports=a},{}],29:[function(t,r,n){var a=t("../utils"),i=t("./ConvertWorker"),l=t("./GenericWorker"),c=t("../base64"),g=t("../support"),_=t("../external"),v=null;if(g.nodestream)try{v=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function y(b,d){return new _.Promise(function(f,p){var k=[],C=b._internalType,P=b._outputType,A=b._mimeType;b.on("data",function(I,T){k.push(I),d&&d(T)}).on("error",function(I){k=[],p(I)}).on("end",function(){try{var I=(function(T,$,F){switch(T){case"blob":return a.newBlob(a.transformTo("arraybuffer",$),F);case"base64":return c.encode($);default:return a.transformTo(T,$)}})(P,(function(T,$){var F,W=0,J=null,S=0;for(F=0;F<$.length;F++)S+=$[F].length;switch(T){case"string":return $.join("");case"array":return Array.prototype.concat.apply([],$);case"uint8array":for(J=new Uint8Array(S),F=0;F<$.length;F++)J.set($[F],W),W+=$[F].length;return J;case"nodebuffer":return Buffer.concat($);default:throw new Error("concat : unsupported type '"+T+"'")}})(C,k),A);f(I)}catch(T){p(T)}k=[]}).resume()})}function u(b,d,f){var p=d;switch(d){case"blob":case"arraybuffer":p="uint8array";break;case"base64":p="string"}try{this._internalType=p,this._outputType=d,this._mimeType=f,a.checkSupport(p),this._worker=b.pipe(new i(p)),b.lock()}catch(k){this._worker=new l("error"),this._worker.error(k)}}u.prototype={accumulate:function(b){return y(this,b)},on:function(b,d){var f=this;return b==="data"?this._worker.on(b,function(p){d.call(f,p.data,p.meta)}):this._worker.on(b,function(){a.delay(d,arguments,f)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(b){if(a.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new v(this,{objectMode:this._outputType!=="nodebuffer"},b)}},r.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,r,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",n.nodebuffer=typeof Buffer<"u",n.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")n.blob=!1;else{var a=new ArrayBuffer(0);try{n.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(a),n.blob=i.getBlob("application/zip").size===0}catch{n.blob=!1}}}try{n.nodestream=!!t("readable-stream").Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(t,r,n){for(var a=t("./utils"),i=t("./support"),l=t("./nodejsUtils"),c=t("./stream/GenericWorker"),g=new Array(256),_=0;_<256;_++)g[_]=252<=_?6:248<=_?5:240<=_?4:224<=_?3:192<=_?2:1;g[254]=g[254]=1;function v(){c.call(this,"utf-8 decode"),this.leftOver=null}function y(){c.call(this,"utf-8 encode")}n.utf8encode=function(u){return i.nodebuffer?l.newBufferFrom(u,"utf-8"):(function(b){var d,f,p,k,C,P=b.length,A=0;for(k=0;k<P;k++)(64512&(f=b.charCodeAt(k)))==55296&&k+1<P&&(64512&(p=b.charCodeAt(k+1)))==56320&&(f=65536+(f-55296<<10)+(p-56320),k++),A+=f<128?1:f<2048?2:f<65536?3:4;for(d=i.uint8array?new Uint8Array(A):new Array(A),k=C=0;C<A;k++)(64512&(f=b.charCodeAt(k)))==55296&&k+1<P&&(64512&(p=b.charCodeAt(k+1)))==56320&&(f=65536+(f-55296<<10)+(p-56320),k++),f<128?d[C++]=f:(f<2048?d[C++]=192|f>>>6:(f<65536?d[C++]=224|f>>>12:(d[C++]=240|f>>>18,d[C++]=128|f>>>12&63),d[C++]=128|f>>>6&63),d[C++]=128|63&f);return d})(u)},n.utf8decode=function(u){return i.nodebuffer?a.transformTo("nodebuffer",u).toString("utf-8"):(function(b){var d,f,p,k,C=b.length,P=new Array(2*C);for(d=f=0;d<C;)if((p=b[d++])<128)P[f++]=p;else if(4<(k=g[p]))P[f++]=65533,d+=k-1;else{for(p&=k===2?31:k===3?15:7;1<k&&d<C;)p=p<<6|63&b[d++],k--;1<k?P[f++]=65533:p<65536?P[f++]=p:(p-=65536,P[f++]=55296|p>>10&1023,P[f++]=56320|1023&p)}return P.length!==f&&(P.subarray?P=P.subarray(0,f):P.length=f),a.applyFromCharCode(P)})(u=a.transformTo(i.uint8array?"uint8array":"array",u))},a.inherits(v,c),v.prototype.processChunk=function(u){var b=a.transformTo(i.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var d=b;(b=new Uint8Array(d.length+this.leftOver.length)).set(this.leftOver,0),b.set(d,this.leftOver.length)}else b=this.leftOver.concat(b);this.leftOver=null}var f=(function(k,C){var P;for((C=C||k.length)>k.length&&(C=k.length),P=C-1;0<=P&&(192&k[P])==128;)P--;return P<0||P===0?C:P+g[k[P]]>C?P:C})(b),p=b;f!==b.length&&(i.uint8array?(p=b.subarray(0,f),this.leftOver=b.subarray(f,b.length)):(p=b.slice(0,f),this.leftOver=b.slice(f,b.length))),this.push({data:n.utf8decode(p),meta:u.meta})},v.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=v,a.inherits(y,c),y.prototype.processChunk=function(u){this.push({data:n.utf8encode(u.data),meta:u.meta})},n.Utf8EncodeWorker=y},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,r,n){var a=t("./support"),i=t("./base64"),l=t("./nodejsUtils"),c=t("./external");function g(d){return d}function _(d,f){for(var p=0;p<d.length;++p)f[p]=255&d.charCodeAt(p);return f}t("setimmediate"),n.newBlob=function(d,f){n.checkSupport("blob");try{return new Blob([d],{type:f})}catch{try{var p=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return p.append(d),p.getBlob(f)}catch{throw new Error("Bug : can't construct the Blob.")}}};var v={stringifyByChunk:function(d,f,p){var k=[],C=0,P=d.length;if(P<=p)return String.fromCharCode.apply(null,d);for(;C<P;)f==="array"||f==="nodebuffer"?k.push(String.fromCharCode.apply(null,d.slice(C,Math.min(C+p,P)))):k.push(String.fromCharCode.apply(null,d.subarray(C,Math.min(C+p,P)))),C+=p;return k.join("")},stringifyByChar:function(d){for(var f="",p=0;p<d.length;p++)f+=String.fromCharCode(d[p]);return f},applyCanBeUsed:{uint8array:(function(){try{return a.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return a.nodebuffer&&String.fromCharCode.apply(null,l.allocBuffer(1)).length===1}catch{return!1}})()}};function y(d){var f=65536,p=n.getTypeOf(d),k=!0;if(p==="uint8array"?k=v.applyCanBeUsed.uint8array:p==="nodebuffer"&&(k=v.applyCanBeUsed.nodebuffer),k)for(;1<f;)try{return v.stringifyByChunk(d,p,f)}catch{f=Math.floor(f/2)}return v.stringifyByChar(d)}function u(d,f){for(var p=0;p<d.length;p++)f[p]=d[p];return f}n.applyFromCharCode=y;var b={};b.string={string:g,array:function(d){return _(d,new Array(d.length))},arraybuffer:function(d){return b.string.uint8array(d).buffer},uint8array:function(d){return _(d,new Uint8Array(d.length))},nodebuffer:function(d){return _(d,l.allocBuffer(d.length))}},b.array={string:y,array:g,arraybuffer:function(d){return new Uint8Array(d).buffer},uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return l.newBufferFrom(d)}},b.arraybuffer={string:function(d){return y(new Uint8Array(d))},array:function(d){return u(new Uint8Array(d),new Array(d.byteLength))},arraybuffer:g,uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return l.newBufferFrom(new Uint8Array(d))}},b.uint8array={string:y,array:function(d){return u(d,new Array(d.length))},arraybuffer:function(d){return d.buffer},uint8array:g,nodebuffer:function(d){return l.newBufferFrom(d)}},b.nodebuffer={string:y,array:function(d){return u(d,new Array(d.length))},arraybuffer:function(d){return b.nodebuffer.uint8array(d).buffer},uint8array:function(d){return u(d,new Uint8Array(d.length))},nodebuffer:g},n.transformTo=function(d,f){if(f=f||"",!d)return f;n.checkSupport(d);var p=n.getTypeOf(f);return b[p][d](f)},n.resolve=function(d){for(var f=d.split("/"),p=[],k=0;k<f.length;k++){var C=f[k];C==="."||C===""&&k!==0&&k!==f.length-1||(C===".."?p.pop():p.push(C))}return p.join("/")},n.getTypeOf=function(d){if(typeof d=="string")return"string";var f=Object.prototype.toString.call(d);return f==="[object Array]"?"array":a.nodebuffer&&l.isBuffer(d)?"nodebuffer":a.uint8array&&f==="[object Uint8Array]"?"uint8array":a.arraybuffer&&f==="[object ArrayBuffer]"?"arraybuffer":void 0},n.checkSupport=function(d){if(!a[d.toLowerCase()])throw new Error(d+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(d){var f,p,k="";for(p=0;p<(d||"").length;p++)k+="\\x"+((f=d.charCodeAt(p))<16?"0":"")+f.toString(16).toUpperCase();return k},n.delay=function(d,f,p){setImmediate(function(){d.apply(p||null,f||[])})},n.inherits=function(d,f){function p(){}p.prototype=f.prototype,d.prototype=new p},n.extend=function(){var d,f,p={};for(d=0;d<arguments.length;d++)for(f in arguments[d])Object.prototype.hasOwnProperty.call(arguments[d],f)&&p[f]===void 0&&(p[f]=arguments[d][f]);return p},n.prepareContent=function(d,f,p,k,C){return c.Promise.resolve(f).then(function(P){return a.blob&&(P instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(P))!==-1)?Blob.prototype.arrayBuffer!==void 0?P.arrayBuffer():typeof FileReader<"u"?new c.Promise(function(A,I){var T=new FileReader;T.onload=function($){A($.target.result)},T.onerror=function($){I($.target.error)},T.readAsArrayBuffer(P)}):c.Promise.reject(new Error(d+" is a Blob, but we have no way of reading it.")):P}).then(function(P){var A=n.getTypeOf(P);return A?(A==="arraybuffer"?P=n.transformTo("uint8array",P):A==="string"&&(C?P=i.decode(P):p&&k!==!0&&(P=(function(I){return _(I,a.uint8array?new Uint8Array(I.length):new Array(I.length))})(P))),P):c.Promise.reject(new Error("Can't read the data of '"+d+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,r,n){var a=t("./reader/readerFor"),i=t("./utils"),l=t("./signature"),c=t("./zipEntry"),g=t("./support");function _(v){this.files=[],this.loadOptions=v}_.prototype={checkSignature:function(v){if(!this.reader.readAndCheckSignature(v)){this.reader.index-=4;var y=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(y)+", expected "+i.pretty(v)+")")}},isSignature:function(v,y){var u=this.reader.index;this.reader.setIndex(v);var b=this.reader.readString(4)===y;return this.reader.setIndex(u),b},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 v=this.reader.readData(this.zipCommentLength),y=g.uint8array?"uint8array":"array",u=i.transformTo(y,v);this.zipComment=this.loadOptions.decodeFileName(u)},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 v,y,u,b=this.zip64EndOfCentralSize-44;0<b;)v=this.reader.readInt(2),y=this.reader.readInt(4),u=this.reader.readData(y),this.zip64ExtensibleData[v]={id:v,length:y,value:u}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var v,y;for(v=0;v<this.files.length;v++)y=this.files[v],this.reader.setIndex(y.localHeaderOffset),this.checkSignature(l.LOCAL_FILE_HEADER),y.readLocalPart(this.reader),y.handleUTF8(),y.processAttributes()},readCentralDir:function(){var v;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(l.CENTRAL_FILE_HEADER);)(v=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(v);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var v=this.reader.lastIndexOfSignature(l.CENTRAL_DIRECTORY_END);if(v<0)throw this.isSignature(0,l.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):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");this.reader.setIndex(v);var y=v;if(this.checkSignature(l.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(v=this.reader.lastIndexOfSignature(l.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(v),this.checkSignature(l.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,l.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(l.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(l.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var u=this.centralDirOffset+this.centralDirSize;this.zip64&&(u+=20,u+=12+this.zip64EndOfCentralSize);var b=y-u;if(0<b)this.isSignature(y,l.CENTRAL_FILE_HEADER)||(this.reader.zero=b);else if(b<0)throw new Error("Corrupted zip: missing "+Math.abs(b)+" bytes.")},prepareReader:function(v){this.reader=a(v)},load:function(v){this.prepareReader(v),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=_},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,r,n){var a=t("./reader/readerFor"),i=t("./utils"),l=t("./compressedObject"),c=t("./crc32"),g=t("./utf8"),_=t("./compressions"),v=t("./support");function y(u,b){this.options=u,this.loadOptions=b}y.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(u){var b,d;if(u.skip(22),this.fileNameLength=u.readInt(2),d=u.readInt(2),this.fileName=u.readData(this.fileNameLength),u.skip(d),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((b=(function(f){for(var p in _)if(Object.prototype.hasOwnProperty.call(_,p)&&_[p].magic===f)return _[p];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new l(this.compressedSize,this.uncompressedSize,this.crc32,b,u.readData(this.compressedSize))},readCentralPart:function(u){this.versionMadeBy=u.readInt(2),u.skip(2),this.bitFlag=u.readInt(2),this.compressionMethod=u.readString(2),this.date=u.readDate(),this.crc32=u.readInt(4),this.compressedSize=u.readInt(4),this.uncompressedSize=u.readInt(4);var b=u.readInt(2);if(this.extraFieldsLength=u.readInt(2),this.fileCommentLength=u.readInt(2),this.diskNumberStart=u.readInt(2),this.internalFileAttributes=u.readInt(2),this.externalFileAttributes=u.readInt(4),this.localHeaderOffset=u.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");u.skip(b),this.readExtraFields(u),this.parseZIP64ExtraField(u),this.fileComment=u.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var u=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),u==0&&(this.dosPermissions=63&this.externalFileAttributes),u==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=a(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var b,d,f,p=u.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});u.index+4<p;)b=u.readInt(2),d=u.readInt(2),f=u.readData(d),this.extraFields[b]={id:b,length:d,value:f};u.setIndex(p)},handleUTF8:function(){var u=v.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=g.utf8decode(this.fileName),this.fileCommentStr=g.utf8decode(this.fileComment);else{var b=this.findExtraFieldUnicodePath();if(b!==null)this.fileNameStr=b;else{var d=i.transformTo(u,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(d)}var f=this.findExtraFieldUnicodeComment();if(f!==null)this.fileCommentStr=f;else{var p=i.transformTo(u,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(p)}}},findExtraFieldUnicodePath:function(){var u=this.extraFields[28789];if(u){var b=a(u.value);return b.readInt(1)!==1||c(this.fileName)!==b.readInt(4)?null:g.utf8decode(b.readData(u.length-5))}return null},findExtraFieldUnicodeComment:function(){var u=this.extraFields[25461];if(u){var b=a(u.value);return b.readInt(1)!==1||c(this.fileComment)!==b.readInt(4)?null:g.utf8decode(b.readData(u.length-5))}return null}},r.exports=y},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,r,n){function a(b,d,f){this.name=b,this.dir=f.dir,this.date=f.date,this.comment=f.comment,this.unixPermissions=f.unixPermissions,this.dosPermissions=f.dosPermissions,this._data=d,this._dataBinary=f.binary,this.options={compression:f.compression,compressionOptions:f.compressionOptions}}var i=t("./stream/StreamHelper"),l=t("./stream/DataWorker"),c=t("./utf8"),g=t("./compressedObject"),_=t("./stream/GenericWorker");a.prototype={internalStream:function(b){var d=null,f="string";try{if(!b)throw new Error("No output type specified.");var p=(f=b.toLowerCase())==="string"||f==="text";f!=="binarystring"&&f!=="text"||(f="string"),d=this._decompressWorker();var k=!this._dataBinary;k&&!p&&(d=d.pipe(new c.Utf8EncodeWorker)),!k&&p&&(d=d.pipe(new c.Utf8DecodeWorker))}catch(C){(d=new _("error")).error(C)}return new i(d,f,"")},async:function(b,d){return this.internalStream(b).accumulate(d)},nodeStream:function(b,d){return this.internalStream(b||"nodebuffer").toNodejsStream(d)},_compressWorker:function(b,d){if(this._data instanceof g&&this._data.compression.magic===b.magic)return this._data.getCompressedWorker();var f=this._decompressWorker();return this._dataBinary||(f=f.pipe(new c.Utf8EncodeWorker)),g.createWorkerFrom(f,b,d)},_decompressWorker:function(){return this._data instanceof g?this._data.getContentWorker():this._data instanceof _?this._data:new l(this._data)}};for(var v=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],y=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<v.length;u++)a.prototype[v[u]]=y;r.exports=a},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,r,n){(function(a){var i,l,c=a.MutationObserver||a.WebKitMutationObserver;if(c){var g=0,_=new c(b),v=a.document.createTextNode("");_.observe(v,{characterData:!0}),i=function(){v.data=g=++g%2}}else if(a.setImmediate||a.MessageChannel===void 0)i="document"in a&&"onreadystatechange"in a.document.createElement("script")?function(){var d=a.document.createElement("script");d.onreadystatechange=function(){b(),d.onreadystatechange=null,d.parentNode.removeChild(d),d=null},a.document.documentElement.appendChild(d)}:function(){setTimeout(b,0)};else{var y=new a.MessageChannel;y.port1.onmessage=b,i=function(){y.port2.postMessage(0)}}var u=[];function b(){var d,f;l=!0;for(var p=u.length;p;){for(f=u,u=[],d=-1;++d<p;)f[d]();p=u.length}l=!1}r.exports=function(d){u.push(d)!==1||l||i()}}).call(this,typeof Ot<"u"?Ot:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,r,n){var a=t("immediate");function i(){}var l={},c=["REJECTED"],g=["FULFILLED"],_=["PENDING"];function v(p){if(typeof p!="function")throw new TypeError("resolver must be a function");this.state=_,this.queue=[],this.outcome=void 0,p!==i&&d(this,p)}function y(p,k,C){this.promise=p,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}function u(p,k,C){a(function(){var P;try{P=k(C)}catch(A){return l.reject(p,A)}P===p?l.reject(p,new TypeError("Cannot resolve promise with itself")):l.resolve(p,P)})}function b(p){var k=p&&p.then;if(p&&(typeof p=="object"||typeof p=="function")&&typeof k=="function")return function(){k.apply(p,arguments)}}function d(p,k){var C=!1;function P(T){C||(C=!0,l.reject(p,T))}function A(T){C||(C=!0,l.resolve(p,T))}var I=f(function(){k(A,P)});I.status==="error"&&P(I.value)}function f(p,k){var C={};try{C.value=p(k),C.status="success"}catch(P){C.status="error",C.value=P}return C}(r.exports=v).prototype.finally=function(p){if(typeof p!="function")return this;var k=this.constructor;return this.then(function(C){return k.resolve(p()).then(function(){return C})},function(C){return k.resolve(p()).then(function(){throw C})})},v.prototype.catch=function(p){return this.then(null,p)},v.prototype.then=function(p,k){if(typeof p!="function"&&this.state===g||typeof k!="function"&&this.state===c)return this;var C=new this.constructor(i);return this.state!==_?u(C,this.state===g?p:k,this.outcome):this.queue.push(new y(C,p,k)),C},y.prototype.callFulfilled=function(p){l.resolve(this.promise,p)},y.prototype.otherCallFulfilled=function(p){u(this.promise,this.onFulfilled,p)},y.prototype.callRejected=function(p){l.reject(this.promise,p)},y.prototype.otherCallRejected=function(p){u(this.promise,this.onRejected,p)},l.resolve=function(p,k){var C=f(b,k);if(C.status==="error")return l.reject(p,C.value);var P=C.value;if(P)d(p,P);else{p.state=g,p.outcome=k;for(var A=-1,I=p.queue.length;++A<I;)p.queue[A].callFulfilled(k)}return p},l.reject=function(p,k){p.state=c,p.outcome=k;for(var C=-1,P=p.queue.length;++C<P;)p.queue[C].callRejected(k);return p},v.resolve=function(p){return p instanceof this?p:l.resolve(new this(i),p)},v.reject=function(p){var k=new this(i);return l.reject(k,p)},v.all=function(p){var k=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=p.length,P=!1;if(!C)return this.resolve([]);for(var A=new Array(C),I=0,T=-1,$=new this(i);++T<C;)F(p[T],T);return $;function F(W,J){k.resolve(W).then(function(S){A[J]=S,++I!==C||P||(P=!0,l.resolve($,A))},function(S){P||(P=!0,l.reject($,S))})}},v.race=function(p){var k=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=p.length,P=!1;if(!C)return this.resolve([]);for(var A=-1,I=new this(i);++A<C;)T=p[A],k.resolve(T).then(function($){P||(P=!0,l.resolve(I,$))},function($){P||(P=!0,l.reject(I,$))});var T;return I}},{immediate:36}],38:[function(t,r,n){var a={};(0,t("./lib/utils/common").assign)(a,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),r.exports=a},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,r,n){var a=t("./zlib/deflate"),i=t("./utils/common"),l=t("./utils/strings"),c=t("./zlib/messages"),g=t("./zlib/zstream"),_=Object.prototype.toString,v=0,y=-1,u=0,b=8;function d(p){if(!(this instanceof d))return new d(p);this.options=i.assign({level:y,method:b,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},p||{});var k=this.options;k.raw&&0<k.windowBits?k.windowBits=-k.windowBits:k.gzip&&0<k.windowBits&&k.windowBits<16&&(k.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new g,this.strm.avail_out=0;var C=a.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(C!==v)throw new Error(c[C]);if(k.header&&a.deflateSetHeader(this.strm,k.header),k.dictionary){var P;if(P=typeof k.dictionary=="string"?l.string2buf(k.dictionary):_.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(C=a.deflateSetDictionary(this.strm,P))!==v)throw new Error(c[C]);this._dict_set=!0}}function f(p,k){var C=new d(k);if(C.push(p,!0),C.err)throw C.msg||c[C.err];return C.result}d.prototype.push=function(p,k){var C,P,A=this.strm,I=this.options.chunkSize;if(this.ended)return!1;P=k===~~k?k:k===!0?4:0,typeof p=="string"?A.input=l.string2buf(p):_.call(p)==="[object ArrayBuffer]"?A.input=new Uint8Array(p):A.input=p,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new i.Buf8(I),A.next_out=0,A.avail_out=I),(C=a.deflate(A,P))!==1&&C!==v)return this.onEnd(C),!(this.ended=!0);A.avail_out!==0&&(A.avail_in!==0||P!==4&&P!==2)||(this.options.to==="string"?this.onData(l.buf2binstring(i.shrinkBuf(A.output,A.next_out))):this.onData(i.shrinkBuf(A.output,A.next_out)))}while((0<A.avail_in||A.avail_out===0)&&C!==1);return P===4?(C=a.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===v):P!==2||(this.onEnd(v),!(A.avail_out=0))},d.prototype.onData=function(p){this.chunks.push(p)},d.prototype.onEnd=function(p){p===v&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},n.Deflate=d,n.deflate=f,n.deflateRaw=function(p,k){return(k=k||{}).raw=!0,f(p,k)},n.gzip=function(p,k){return(k=k||{}).gzip=!0,f(p,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,r,n){var a=t("./zlib/inflate"),i=t("./utils/common"),l=t("./utils/strings"),c=t("./zlib/constants"),g=t("./zlib/messages"),_=t("./zlib/zstream"),v=t("./zlib/gzheader"),y=Object.prototype.toString;function u(d){if(!(this instanceof u))return new u(d);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},d||{});var f=this.options;f.raw&&0<=f.windowBits&&f.windowBits<16&&(f.windowBits=-f.windowBits,f.windowBits===0&&(f.windowBits=-15)),!(0<=f.windowBits&&f.windowBits<16)||d&&d.windowBits||(f.windowBits+=32),15<f.windowBits&&f.windowBits<48&&(15&f.windowBits)==0&&(f.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _,this.strm.avail_out=0;var p=a.inflateInit2(this.strm,f.windowBits);if(p!==c.Z_OK)throw new Error(g[p]);this.header=new v,a.inflateGetHeader(this.strm,this.header)}function b(d,f){var p=new u(f);if(p.push(d,!0),p.err)throw p.msg||g[p.err];return p.result}u.prototype.push=function(d,f){var p,k,C,P,A,I,T=this.strm,$=this.options.chunkSize,F=this.options.dictionary,W=!1;if(this.ended)return!1;k=f===~~f?f:f===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof d=="string"?T.input=l.binstring2buf(d):y.call(d)==="[object ArrayBuffer]"?T.input=new Uint8Array(d):T.input=d,T.next_in=0,T.avail_in=T.input.length;do{if(T.avail_out===0&&(T.output=new i.Buf8($),T.next_out=0,T.avail_out=$),(p=a.inflate(T,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&F&&(I=typeof F=="string"?l.string2buf(F):y.call(F)==="[object ArrayBuffer]"?new Uint8Array(F):F,p=a.inflateSetDictionary(this.strm,I)),p===c.Z_BUF_ERROR&&W===!0&&(p=c.Z_OK,W=!1),p!==c.Z_STREAM_END&&p!==c.Z_OK)return this.onEnd(p),!(this.ended=!0);T.next_out&&(T.avail_out!==0&&p!==c.Z_STREAM_END&&(T.avail_in!==0||k!==c.Z_FINISH&&k!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=l.utf8border(T.output,T.next_out),P=T.next_out-C,A=l.buf2string(T.output,C),T.next_out=P,T.avail_out=$-P,P&&i.arraySet(T.output,T.output,C,P,0),this.onData(A)):this.onData(i.shrinkBuf(T.output,T.next_out)))),T.avail_in===0&&T.avail_out===0&&(W=!0)}while((0<T.avail_in||T.avail_out===0)&&p!==c.Z_STREAM_END);return p===c.Z_STREAM_END&&(k=c.Z_FINISH),k===c.Z_FINISH?(p=a.inflateEnd(this.strm),this.onEnd(p),this.ended=!0,p===c.Z_OK):k!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(T.avail_out=0))},u.prototype.onData=function(d){this.chunks.push(d)},u.prototype.onEnd=function(d){d===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=d,this.msg=this.strm.msg},n.Inflate=u,n.inflate=b,n.inflateRaw=function(d,f){return(f=f||{}).raw=!0,b(d,f)},n.ungzip=b},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,r,n){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";n.assign=function(c){for(var g=Array.prototype.slice.call(arguments,1);g.length;){var _=g.shift();if(_){if(typeof _!="object")throw new TypeError(_+"must be non-object");for(var v in _)_.hasOwnProperty(v)&&(c[v]=_[v])}}return c},n.shrinkBuf=function(c,g){return c.length===g?c:c.subarray?c.subarray(0,g):(c.length=g,c)};var i={arraySet:function(c,g,_,v,y){if(g.subarray&&c.subarray)c.set(g.subarray(_,_+v),y);else for(var u=0;u<v;u++)c[y+u]=g[_+u]},flattenChunks:function(c){var g,_,v,y,u,b;for(g=v=0,_=c.length;g<_;g++)v+=c[g].length;for(b=new Uint8Array(v),g=y=0,_=c.length;g<_;g++)u=c[g],b.set(u,y),y+=u.length;return b}},l={arraySet:function(c,g,_,v,y){for(var u=0;u<v;u++)c[y+u]=g[_+u]},flattenChunks:function(c){return[].concat.apply([],c)}};n.setTyped=function(c){c?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,l))},n.setTyped(a)},{}],42:[function(t,r,n){var a=t("./common"),i=!0,l=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{l=!1}for(var c=new a.Buf8(256),g=0;g<256;g++)c[g]=252<=g?6:248<=g?5:240<=g?4:224<=g?3:192<=g?2:1;function _(v,y){if(y<65537&&(v.subarray&&l||!v.subarray&&i))return String.fromCharCode.apply(null,a.shrinkBuf(v,y));for(var u="",b=0;b<y;b++)u+=String.fromCharCode(v[b]);return u}c[254]=c[254]=1,n.string2buf=function(v){var y,u,b,d,f,p=v.length,k=0;for(d=0;d<p;d++)(64512&(u=v.charCodeAt(d)))==55296&&d+1<p&&(64512&(b=v.charCodeAt(d+1)))==56320&&(u=65536+(u-55296<<10)+(b-56320),d++),k+=u<128?1:u<2048?2:u<65536?3:4;for(y=new a.Buf8(k),d=f=0;f<k;d++)(64512&(u=v.charCodeAt(d)))==55296&&d+1<p&&(64512&(b=v.charCodeAt(d+1)))==56320&&(u=65536+(u-55296<<10)+(b-56320),d++),u<128?y[f++]=u:(u<2048?y[f++]=192|u>>>6:(u<65536?y[f++]=224|u>>>12:(y[f++]=240|u>>>18,y[f++]=128|u>>>12&63),y[f++]=128|u>>>6&63),y[f++]=128|63&u);return y},n.buf2binstring=function(v){return _(v,v.length)},n.binstring2buf=function(v){for(var y=new a.Buf8(v.length),u=0,b=y.length;u<b;u++)y[u]=v.charCodeAt(u);return y},n.buf2string=function(v,y){var u,b,d,f,p=y||v.length,k=new Array(2*p);for(u=b=0;u<p;)if((d=v[u++])<128)k[b++]=d;else if(4<(f=c[d]))k[b++]=65533,u+=f-1;else{for(d&=f===2?31:f===3?15:7;1<f&&u<p;)d=d<<6|63&v[u++],f--;1<f?k[b++]=65533:d<65536?k[b++]=d:(d-=65536,k[b++]=55296|d>>10&1023,k[b++]=56320|1023&d)}return _(k,b)},n.utf8border=function(v,y){var u;for((y=y||v.length)>v.length&&(y=v.length),u=y-1;0<=u&&(192&v[u])==128;)u--;return u<0||u===0?y:u+c[v[u]]>y?u:y}},{"./common":41}],43:[function(t,r,n){r.exports=function(a,i,l,c){for(var g=65535&a|0,_=a>>>16&65535|0,v=0;l!==0;){for(l-=v=2e3<l?2e3:l;_=_+(g=g+i[c++]|0)|0,--v;);g%=65521,_%=65521}return g|_<<16|0}},{}],44:[function(t,r,n){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,r,n){var a=(function(){for(var i,l=[],c=0;c<256;c++){i=c;for(var g=0;g<8;g++)i=1&i?3988292384^i>>>1:i>>>1;l[c]=i}return l})();r.exports=function(i,l,c,g){var _=a,v=g+c;i^=-1;for(var y=g;y<v;y++)i=i>>>8^_[255&(i^l[y])];return-1^i}},{}],46:[function(t,r,n){var a,i=t("../utils/common"),l=t("./trees"),c=t("./adler32"),g=t("./crc32"),_=t("./messages"),v=0,y=4,u=0,b=-2,d=-1,f=4,p=2,k=8,C=9,P=286,A=30,I=19,T=2*P+1,$=15,F=3,W=258,J=W+F+1,S=42,O=113,h=1,L=2,et=3,H=4;function rt(o,D){return o.msg=_[D],D}function Z(o){return(o<<1)-(4<o?9:0)}function tt(o){for(var D=o.length;0<=--D;)o[D]=0}function R(o){var D=o.state,z=D.pending;z>o.avail_out&&(z=o.avail_out),z!==0&&(i.arraySet(o.output,D.pending_buf,D.pending_out,z,o.next_out),o.next_out+=z,D.pending_out+=z,o.total_out+=z,o.avail_out-=z,D.pending-=z,D.pending===0&&(D.pending_out=0))}function M(o,D){l._tr_flush_block(o,0<=o.block_start?o.block_start:-1,o.strstart-o.block_start,D),o.block_start=o.strstart,R(o.strm)}function Q(o,D){o.pending_buf[o.pending++]=D}function q(o,D){o.pending_buf[o.pending++]=D>>>8&255,o.pending_buf[o.pending++]=255&D}function X(o,D){var z,w,m=o.max_chain_length,E=o.strstart,j=o.prev_length,U=o.nice_match,N=o.strstart>o.w_size-J?o.strstart-(o.w_size-J):0,V=o.window,Y=o.w_mask,G=o.prev,K=o.strstart+W,ct=V[E+j-1],at=V[E+j];o.prev_length>=o.good_match&&(m>>=2),U>o.lookahead&&(U=o.lookahead);do if(V[(z=D)+j]===at&&V[z+j-1]===ct&&V[z]===V[E]&&V[++z]===V[E+1]){E+=2,z++;do;while(V[++E]===V[++z]&&V[++E]===V[++z]&&V[++E]===V[++z]&&V[++E]===V[++z]&&V[++E]===V[++z]&&V[++E]===V[++z]&&V[++E]===V[++z]&&V[++E]===V[++z]&&E<K);if(w=W-(K-E),E=K-W,j<w){if(o.match_start=D,U<=(j=w))break;ct=V[E+j-1],at=V[E+j]}}while((D=G[D&Y])>N&&--m!=0);return j<=o.lookahead?j:o.lookahead}function ut(o){var D,z,w,m,E,j,U,N,V,Y,G=o.w_size;do{if(m=o.window_size-o.lookahead-o.strstart,o.strstart>=G+(G-J)){for(i.arraySet(o.window,o.window,G,G,0),o.match_start-=G,o.strstart-=G,o.block_start-=G,D=z=o.hash_size;w=o.head[--D],o.head[D]=G<=w?w-G:0,--z;);for(D=z=G;w=o.prev[--D],o.prev[D]=G<=w?w-G:0,--z;);m+=G}if(o.strm.avail_in===0)break;if(j=o.strm,U=o.window,N=o.strstart+o.lookahead,V=m,Y=void 0,Y=j.avail_in,V<Y&&(Y=V),z=Y===0?0:(j.avail_in-=Y,i.arraySet(U,j.input,j.next_in,Y,N),j.state.wrap===1?j.adler=c(j.adler,U,Y,N):j.state.wrap===2&&(j.adler=g(j.adler,U,Y,N)),j.next_in+=Y,j.total_in+=Y,Y),o.lookahead+=z,o.lookahead+o.insert>=F)for(E=o.strstart-o.insert,o.ins_h=o.window[E],o.ins_h=(o.ins_h<<o.hash_shift^o.window[E+1])&o.hash_mask;o.insert&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[E+F-1])&o.hash_mask,o.prev[E&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=E,E++,o.insert--,!(o.lookahead+o.insert<F)););}while(o.lookahead<J&&o.strm.avail_in!==0)}function vt(o,D){for(var z,w;;){if(o.lookahead<J){if(ut(o),o.lookahead<J&&D===v)return h;if(o.lookahead===0)break}if(z=0,o.lookahead>=F&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+F-1])&o.hash_mask,z=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart),z!==0&&o.strstart-z<=o.w_size-J&&(o.match_length=X(o,z)),o.match_length>=F)if(w=l._tr_tally(o,o.strstart-o.match_start,o.match_length-F),o.lookahead-=o.match_length,o.match_length<=o.max_lazy_match&&o.lookahead>=F){for(o.match_length--;o.strstart++,o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+F-1])&o.hash_mask,z=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart,--o.match_length!=0;);o.strstart++}else o.strstart+=o.match_length,o.match_length=0,o.ins_h=o.window[o.strstart],o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+1])&o.hash_mask;else w=l._tr_tally(o,0,o.window[o.strstart]),o.lookahead--,o.strstart++;if(w&&(M(o,!1),o.strm.avail_out===0))return h}return o.insert=o.strstart<F-1?o.strstart:F-1,D===y?(M(o,!0),o.strm.avail_out===0?et:H):o.last_lit&&(M(o,!1),o.strm.avail_out===0)?h:L}function nt(o,D){for(var z,w,m;;){if(o.lookahead<J){if(ut(o),o.lookahead<J&&D===v)return h;if(o.lookahead===0)break}if(z=0,o.lookahead>=F&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+F-1])&o.hash_mask,z=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart),o.prev_length=o.match_length,o.prev_match=o.match_start,o.match_length=F-1,z!==0&&o.prev_length<o.max_lazy_match&&o.strstart-z<=o.w_size-J&&(o.match_length=X(o,z),o.match_length<=5&&(o.strategy===1||o.match_length===F&&4096<o.strstart-o.match_start)&&(o.match_length=F-1)),o.prev_length>=F&&o.match_length<=o.prev_length){for(m=o.strstart+o.lookahead-F,w=l._tr_tally(o,o.strstart-1-o.prev_match,o.prev_length-F),o.lookahead-=o.prev_length-1,o.prev_length-=2;++o.strstart<=m&&(o.ins_h=(o.ins_h<<o.hash_shift^o.window[o.strstart+F-1])&o.hash_mask,z=o.prev[o.strstart&o.w_mask]=o.head[o.ins_h],o.head[o.ins_h]=o.strstart),--o.prev_length!=0;);if(o.match_available=0,o.match_length=F-1,o.strstart++,w&&(M(o,!1),o.strm.avail_out===0))return h}else if(o.match_available){if((w=l._tr_tally(o,0,o.window[o.strstart-1]))&&M(o,!1),o.strstart++,o.lookahead--,o.strm.avail_out===0)return h}else o.match_available=1,o.strstart++,o.lookahead--}return o.match_available&&(w=l._tr_tally(o,0,o.window[o.strstart-1]),o.match_available=0),o.insert=o.strstart<F-1?o.strstart:F-1,D===y?(M(o,!0),o.strm.avail_out===0?et:H):o.last_lit&&(M(o,!1),o.strm.avail_out===0)?h:L}function ot(o,D,z,w,m){this.good_length=o,this.max_lazy=D,this.nice_length=z,this.max_chain=w,this.func=m}function mt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=k,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*T),this.dyn_dtree=new i.Buf16(2*(2*A+1)),this.bl_tree=new i.Buf16(2*(2*I+1)),tt(this.dyn_ltree),tt(this.dyn_dtree),tt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16($+1),this.heap=new i.Buf16(2*P+1),tt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*P+1),tt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function dt(o){var D;return o&&o.state?(o.total_in=o.total_out=0,o.data_type=p,(D=o.state).pending=0,D.pending_out=0,D.wrap<0&&(D.wrap=-D.wrap),D.status=D.wrap?S:O,o.adler=D.wrap===2?0:1,D.last_flush=v,l._tr_init(D),u):rt(o,b)}function St(o){var D=dt(o);return D===u&&(function(z){z.window_size=2*z.w_size,tt(z.head),z.max_lazy_match=a[z.level].max_lazy,z.good_match=a[z.level].good_length,z.nice_match=a[z.level].nice_length,z.max_chain_length=a[z.level].max_chain,z.strstart=0,z.block_start=0,z.lookahead=0,z.insert=0,z.match_length=z.prev_length=F-1,z.match_available=0,z.ins_h=0})(o.state),D}function _t(o,D,z,w,m,E){if(!o)return b;var j=1;if(D===d&&(D=6),w<0?(j=0,w=-w):15<w&&(j=2,w-=16),m<1||C<m||z!==k||w<8||15<w||D<0||9<D||E<0||f<E)return rt(o,b);w===8&&(w=9);var U=new mt;return(o.state=U).strm=o,U.wrap=j,U.gzhead=null,U.w_bits=w,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=m+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+F-1)/F),U.window=new i.Buf8(2*U.w_size),U.head=new i.Buf16(U.hash_size),U.prev=new i.Buf16(U.w_size),U.lit_bufsize=1<<m+6,U.pending_buf_size=4*U.lit_bufsize,U.pending_buf=new i.Buf8(U.pending_buf_size),U.d_buf=1*U.lit_bufsize,U.l_buf=3*U.lit_bufsize,U.level=D,U.strategy=E,U.method=z,St(o)}a=[new ot(0,0,0,0,function(o,D){var z=65535;for(z>o.pending_buf_size-5&&(z=o.pending_buf_size-5);;){if(o.lookahead<=1){if(ut(o),o.lookahead===0&&D===v)return h;if(o.lookahead===0)break}o.strstart+=o.lookahead,o.lookahead=0;var w=o.block_start+z;if((o.strstart===0||o.strstart>=w)&&(o.lookahead=o.strstart-w,o.strstart=w,M(o,!1),o.strm.avail_out===0)||o.strstart-o.block_start>=o.w_size-J&&(M(o,!1),o.strm.avail_out===0))return h}return o.insert=0,D===y?(M(o,!0),o.strm.avail_out===0?et:H):(o.strstart>o.block_start&&(M(o,!1),o.strm.avail_out),h)}),new ot(4,4,8,4,vt),new ot(4,5,16,8,vt),new ot(4,6,32,32,vt),new ot(4,4,16,16,nt),new ot(8,16,32,32,nt),new ot(8,16,128,128,nt),new ot(8,32,128,256,nt),new ot(32,128,258,1024,nt),new ot(32,258,258,4096,nt)],n.deflateInit=function(o,D){return _t(o,D,k,15,8,0)},n.deflateInit2=_t,n.deflateReset=St,n.deflateResetKeep=dt,n.deflateSetHeader=function(o,D){return o&&o.state?o.state.wrap!==2?b:(o.state.gzhead=D,u):b},n.deflate=function(o,D){var z,w,m,E;if(!o||!o.state||5<D||D<0)return o?rt(o,b):b;if(w=o.state,!o.output||!o.input&&o.avail_in!==0||w.status===666&&D!==y)return rt(o,o.avail_out===0?-5:b);if(w.strm=o,z=w.last_flush,w.last_flush=D,w.status===S)if(w.wrap===2)o.adler=0,Q(w,31),Q(w,139),Q(w,8),w.gzhead?(Q(w,(w.gzhead.text?1:0)+(w.gzhead.hcrc?2:0)+(w.gzhead.extra?4:0)+(w.gzhead.name?8:0)+(w.gzhead.comment?16:0)),Q(w,255&w.gzhead.time),Q(w,w.gzhead.time>>8&255),Q(w,w.gzhead.time>>16&255),Q(w,w.gzhead.time>>24&255),Q(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),Q(w,255&w.gzhead.os),w.gzhead.extra&&w.gzhead.extra.length&&(Q(w,255&w.gzhead.extra.length),Q(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(o.adler=g(o.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=69):(Q(w,0),Q(w,0),Q(w,0),Q(w,0),Q(w,0),Q(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),Q(w,3),w.status=O);else{var j=k+(w.w_bits-8<<4)<<8;j|=(2<=w.strategy||w.level<2?0:w.level<6?1:w.level===6?2:3)<<6,w.strstart!==0&&(j|=32),j+=31-j%31,w.status=O,q(w,j),w.strstart!==0&&(q(w,o.adler>>>16),q(w,65535&o.adler)),o.adler=1}if(w.status===69)if(w.gzhead.extra){for(m=w.pending;w.gzindex<(65535&w.gzhead.extra.length)&&(w.pending!==w.pending_buf_size||(w.gzhead.hcrc&&w.pending>m&&(o.adler=g(o.adler,w.pending_buf,w.pending-m,m)),R(o),m=w.pending,w.pending!==w.pending_buf_size));)Q(w,255&w.gzhead.extra[w.gzindex]),w.gzindex++;w.gzhead.hcrc&&w.pending>m&&(o.adler=g(o.adler,w.pending_buf,w.pending-m,m)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=73)}else w.status=73;if(w.status===73)if(w.gzhead.name){m=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>m&&(o.adler=g(o.adler,w.pending_buf,w.pending-m,m)),R(o),m=w.pending,w.pending===w.pending_buf_size)){E=1;break}E=w.gzindex<w.gzhead.name.length?255&w.gzhead.name.charCodeAt(w.gzindex++):0,Q(w,E)}while(E!==0);w.gzhead.hcrc&&w.pending>m&&(o.adler=g(o.adler,w.pending_buf,w.pending-m,m)),E===0&&(w.gzindex=0,w.status=91)}else w.status=91;if(w.status===91)if(w.gzhead.comment){m=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>m&&(o.adler=g(o.adler,w.pending_buf,w.pending-m,m)),R(o),m=w.pending,w.pending===w.pending_buf_size)){E=1;break}E=w.gzindex<w.gzhead.comment.length?255&w.gzhead.comment.charCodeAt(w.gzindex++):0,Q(w,E)}while(E!==0);w.gzhead.hcrc&&w.pending>m&&(o.adler=g(o.adler,w.pending_buf,w.pending-m,m)),E===0&&(w.status=103)}else w.status=103;if(w.status===103&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&R(o),w.pending+2<=w.pending_buf_size&&(Q(w,255&o.adler),Q(w,o.adler>>8&255),o.adler=0,w.status=O)):w.status=O),w.pending!==0){if(R(o),o.avail_out===0)return w.last_flush=-1,u}else if(o.avail_in===0&&Z(D)<=Z(z)&&D!==y)return rt(o,-5);if(w.status===666&&o.avail_in!==0)return rt(o,-5);if(o.avail_in!==0||w.lookahead!==0||D!==v&&w.status!==666){var U=w.strategy===2?(function(N,V){for(var Y;;){if(N.lookahead===0&&(ut(N),N.lookahead===0)){if(V===v)return h;break}if(N.match_length=0,Y=l._tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++,Y&&(M(N,!1),N.strm.avail_out===0))return h}return N.insert=0,V===y?(M(N,!0),N.strm.avail_out===0?et:H):N.last_lit&&(M(N,!1),N.strm.avail_out===0)?h:L})(w,D):w.strategy===3?(function(N,V){for(var Y,G,K,ct,at=N.window;;){if(N.lookahead<=W){if(ut(N),N.lookahead<=W&&V===v)return h;if(N.lookahead===0)break}if(N.match_length=0,N.lookahead>=F&&0<N.strstart&&(G=at[K=N.strstart-1])===at[++K]&&G===at[++K]&&G===at[++K]){ct=N.strstart+W;do;while(G===at[++K]&&G===at[++K]&&G===at[++K]&&G===at[++K]&&G===at[++K]&&G===at[++K]&&G===at[++K]&&G===at[++K]&&K<ct);N.match_length=W-(ct-K),N.match_length>N.lookahead&&(N.match_length=N.lookahead)}if(N.match_length>=F?(Y=l._tr_tally(N,1,N.match_length-F),N.lookahead-=N.match_length,N.strstart+=N.match_length,N.match_length=0):(Y=l._tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++),Y&&(M(N,!1),N.strm.avail_out===0))return h}return N.insert=0,V===y?(M(N,!0),N.strm.avail_out===0?et:H):N.last_lit&&(M(N,!1),N.strm.avail_out===0)?h:L})(w,D):a[w.level].func(w,D);if(U!==et&&U!==H||(w.status=666),U===h||U===et)return o.avail_out===0&&(w.last_flush=-1),u;if(U===L&&(D===1?l._tr_align(w):D!==5&&(l._tr_stored_block(w,0,0,!1),D===3&&(tt(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),R(o),o.avail_out===0))return w.last_flush=-1,u}return D!==y?u:w.wrap<=0?1:(w.wrap===2?(Q(w,255&o.adler),Q(w,o.adler>>8&255),Q(w,o.adler>>16&255),Q(w,o.adler>>24&255),Q(w,255&o.total_in),Q(w,o.total_in>>8&255),Q(w,o.total_in>>16&255),Q(w,o.total_in>>24&255)):(q(w,o.adler>>>16),q(w,65535&o.adler)),R(o),0<w.wrap&&(w.wrap=-w.wrap),w.pending!==0?u:1)},n.deflateEnd=function(o){var D;return o&&o.state?(D=o.state.status)!==S&&D!==69&&D!==73&&D!==91&&D!==103&&D!==O&&D!==666?rt(o,b):(o.state=null,D===O?rt(o,-3):u):b},n.deflateSetDictionary=function(o,D){var z,w,m,E,j,U,N,V,Y=D.length;if(!o||!o.state||(E=(z=o.state).wrap)===2||E===1&&z.status!==S||z.lookahead)return b;for(E===1&&(o.adler=c(o.adler,D,Y,0)),z.wrap=0,Y>=z.w_size&&(E===0&&(tt(z.head),z.strstart=0,z.block_start=0,z.insert=0),V=new i.Buf8(z.w_size),i.arraySet(V,D,Y-z.w_size,z.w_size,0),D=V,Y=z.w_size),j=o.avail_in,U=o.next_in,N=o.input,o.avail_in=Y,o.next_in=0,o.input=D,ut(z);z.lookahead>=F;){for(w=z.strstart,m=z.lookahead-(F-1);z.ins_h=(z.ins_h<<z.hash_shift^z.window[w+F-1])&z.hash_mask,z.prev[w&z.w_mask]=z.head[z.ins_h],z.head[z.ins_h]=w,w++,--m;);z.strstart=w,z.lookahead=F-1,ut(z)}return z.strstart+=z.lookahead,z.block_start=z.strstart,z.insert=z.lookahead,z.lookahead=0,z.match_length=z.prev_length=F-1,z.match_available=0,o.next_in=U,o.input=N,o.avail_in=j,z.wrap=E,u},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,r,n){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,r,n){r.exports=function(a,i){var l,c,g,_,v,y,u,b,d,f,p,k,C,P,A,I,T,$,F,W,J,S,O,h,L;l=a.state,c=a.next_in,h=a.input,g=c+(a.avail_in-5),_=a.next_out,L=a.output,v=_-(i-a.avail_out),y=_+(a.avail_out-257),u=l.dmax,b=l.wsize,d=l.whave,f=l.wnext,p=l.window,k=l.hold,C=l.bits,P=l.lencode,A=l.distcode,I=(1<<l.lenbits)-1,T=(1<<l.distbits)-1;t:do{C<15&&(k+=h[c++]<<C,C+=8,k+=h[c++]<<C,C+=8),$=P[k&I];e:for(;;){if(k>>>=F=$>>>24,C-=F,(F=$>>>16&255)===0)L[_++]=65535&$;else{if(!(16&F)){if((64&F)==0){$=P[(65535&$)+(k&(1<<F)-1)];continue e}if(32&F){l.mode=12;break t}a.msg="invalid literal/length code",l.mode=30;break t}W=65535&$,(F&=15)&&(C<F&&(k+=h[c++]<<C,C+=8),W+=k&(1<<F)-1,k>>>=F,C-=F),C<15&&(k+=h[c++]<<C,C+=8,k+=h[c++]<<C,C+=8),$=A[k&T];r:for(;;){if(k>>>=F=$>>>24,C-=F,!(16&(F=$>>>16&255))){if((64&F)==0){$=A[(65535&$)+(k&(1<<F)-1)];continue r}a.msg="invalid distance code",l.mode=30;break t}if(J=65535&$,C<(F&=15)&&(k+=h[c++]<<C,(C+=8)<F&&(k+=h[c++]<<C,C+=8)),u<(J+=k&(1<<F)-1)){a.msg="invalid distance too far back",l.mode=30;break t}if(k>>>=F,C-=F,(F=_-v)<J){if(d<(F=J-F)&&l.sane){a.msg="invalid distance too far back",l.mode=30;break t}if(O=p,(S=0)===f){if(S+=b-F,F<W){for(W-=F;L[_++]=p[S++],--F;);S=_-J,O=L}}else if(f<F){if(S+=b+f-F,(F-=f)<W){for(W-=F;L[_++]=p[S++],--F;);if(S=0,f<W){for(W-=F=f;L[_++]=p[S++],--F;);S=_-J,O=L}}}else if(S+=f-F,F<W){for(W-=F;L[_++]=p[S++],--F;);S=_-J,O=L}for(;2<W;)L[_++]=O[S++],L[_++]=O[S++],L[_++]=O[S++],W-=3;W&&(L[_++]=O[S++],1<W&&(L[_++]=O[S++]))}else{for(S=_-J;L[_++]=L[S++],L[_++]=L[S++],L[_++]=L[S++],2<(W-=3););W&&(L[_++]=L[S++],1<W&&(L[_++]=L[S++]))}break}}break}}while(c<g&&_<y);c-=W=C>>3,k&=(1<<(C-=W<<3))-1,a.next_in=c,a.next_out=_,a.avail_in=c<g?g-c+5:5-(c-g),a.avail_out=_<y?y-_+257:257-(_-y),l.hold=k,l.bits=C}},{}],49:[function(t,r,n){var a=t("../utils/common"),i=t("./adler32"),l=t("./crc32"),c=t("./inffast"),g=t("./inftrees"),_=1,v=2,y=0,u=-2,b=1,d=852,f=592;function p(S){return(S>>>24&255)+(S>>>8&65280)+((65280&S)<<8)+((255&S)<<24)}function k(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function C(S){var O;return S&&S.state?(O=S.state,S.total_in=S.total_out=O.total=0,S.msg="",O.wrap&&(S.adler=1&O.wrap),O.mode=b,O.last=0,O.havedict=0,O.dmax=32768,O.head=null,O.hold=0,O.bits=0,O.lencode=O.lendyn=new a.Buf32(d),O.distcode=O.distdyn=new a.Buf32(f),O.sane=1,O.back=-1,y):u}function P(S){var O;return S&&S.state?((O=S.state).wsize=0,O.whave=0,O.wnext=0,C(S)):u}function A(S,O){var h,L;return S&&S.state?(L=S.state,O<0?(h=0,O=-O):(h=1+(O>>4),O<48&&(O&=15)),O&&(O<8||15<O)?u:(L.window!==null&&L.wbits!==O&&(L.window=null),L.wrap=h,L.wbits=O,P(S))):u}function I(S,O){var h,L;return S?(L=new k,(S.state=L).window=null,(h=A(S,O))!==y&&(S.state=null),h):u}var T,$,F=!0;function W(S){if(F){var O;for(T=new a.Buf32(512),$=new a.Buf32(32),O=0;O<144;)S.lens[O++]=8;for(;O<256;)S.lens[O++]=9;for(;O<280;)S.lens[O++]=7;for(;O<288;)S.lens[O++]=8;for(g(_,S.lens,0,288,T,0,S.work,{bits:9}),O=0;O<32;)S.lens[O++]=5;g(v,S.lens,0,32,$,0,S.work,{bits:5}),F=!1}S.lencode=T,S.lenbits=9,S.distcode=$,S.distbits=5}function J(S,O,h,L){var et,H=S.state;return H.window===null&&(H.wsize=1<<H.wbits,H.wnext=0,H.whave=0,H.window=new a.Buf8(H.wsize)),L>=H.wsize?(a.arraySet(H.window,O,h-H.wsize,H.wsize,0),H.wnext=0,H.whave=H.wsize):(L<(et=H.wsize-H.wnext)&&(et=L),a.arraySet(H.window,O,h-L,et,H.wnext),(L-=et)?(a.arraySet(H.window,O,h-L,L,0),H.wnext=L,H.whave=H.wsize):(H.wnext+=et,H.wnext===H.wsize&&(H.wnext=0),H.whave<H.wsize&&(H.whave+=et))),0}n.inflateReset=P,n.inflateReset2=A,n.inflateResetKeep=C,n.inflateInit=function(S){return I(S,15)},n.inflateInit2=I,n.inflate=function(S,O){var h,L,et,H,rt,Z,tt,R,M,Q,q,X,ut,vt,nt,ot,mt,dt,St,_t,o,D,z,w,m=0,E=new a.Buf8(4),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!S||!S.state||!S.output||!S.input&&S.avail_in!==0)return u;(h=S.state).mode===12&&(h.mode=13),rt=S.next_out,et=S.output,tt=S.avail_out,H=S.next_in,L=S.input,Z=S.avail_in,R=h.hold,M=h.bits,Q=Z,q=tt,D=y;t:for(;;)switch(h.mode){case b:if(h.wrap===0){h.mode=13;break}for(;M<16;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}if(2&h.wrap&&R===35615){E[h.check=0]=255&R,E[1]=R>>>8&255,h.check=l(h.check,E,2,0),M=R=0,h.mode=2;break}if(h.flags=0,h.head&&(h.head.done=!1),!(1&h.wrap)||(((255&R)<<8)+(R>>8))%31){S.msg="incorrect header check",h.mode=30;break}if((15&R)!=8){S.msg="unknown compression method",h.mode=30;break}if(M-=4,o=8+(15&(R>>>=4)),h.wbits===0)h.wbits=o;else if(o>h.wbits){S.msg="invalid window size",h.mode=30;break}h.dmax=1<<o,S.adler=h.check=1,h.mode=512&R?10:12,M=R=0;break;case 2:for(;M<16;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}if(h.flags=R,(255&h.flags)!=8){S.msg="unknown compression method",h.mode=30;break}if(57344&h.flags){S.msg="unknown header flags set",h.mode=30;break}h.head&&(h.head.text=R>>8&1),512&h.flags&&(E[0]=255&R,E[1]=R>>>8&255,h.check=l(h.check,E,2,0)),M=R=0,h.mode=3;case 3:for(;M<32;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}h.head&&(h.head.time=R),512&h.flags&&(E[0]=255&R,E[1]=R>>>8&255,E[2]=R>>>16&255,E[3]=R>>>24&255,h.check=l(h.check,E,4,0)),M=R=0,h.mode=4;case 4:for(;M<16;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}h.head&&(h.head.xflags=255&R,h.head.os=R>>8),512&h.flags&&(E[0]=255&R,E[1]=R>>>8&255,h.check=l(h.check,E,2,0)),M=R=0,h.mode=5;case 5:if(1024&h.flags){for(;M<16;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}h.length=R,h.head&&(h.head.extra_len=R),512&h.flags&&(E[0]=255&R,E[1]=R>>>8&255,h.check=l(h.check,E,2,0)),M=R=0}else h.head&&(h.head.extra=null);h.mode=6;case 6:if(1024&h.flags&&(Z<(X=h.length)&&(X=Z),X&&(h.head&&(o=h.head.extra_len-h.length,h.head.extra||(h.head.extra=new Array(h.head.extra_len)),a.arraySet(h.head.extra,L,H,X,o)),512&h.flags&&(h.check=l(h.check,L,X,H)),Z-=X,H+=X,h.length-=X),h.length))break t;h.length=0,h.mode=7;case 7:if(2048&h.flags){if(Z===0)break t;for(X=0;o=L[H+X++],h.head&&o&&h.length<65536&&(h.head.name+=String.fromCharCode(o)),o&&X<Z;);if(512&h.flags&&(h.check=l(h.check,L,X,H)),Z-=X,H+=X,o)break t}else h.head&&(h.head.name=null);h.length=0,h.mode=8;case 8:if(4096&h.flags){if(Z===0)break t;for(X=0;o=L[H+X++],h.head&&o&&h.length<65536&&(h.head.comment+=String.fromCharCode(o)),o&&X<Z;);if(512&h.flags&&(h.check=l(h.check,L,X,H)),Z-=X,H+=X,o)break t}else h.head&&(h.head.comment=null);h.mode=9;case 9:if(512&h.flags){for(;M<16;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}if(R!==(65535&h.check)){S.msg="header crc mismatch",h.mode=30;break}M=R=0}h.head&&(h.head.hcrc=h.flags>>9&1,h.head.done=!0),S.adler=h.check=0,h.mode=12;break;case 10:for(;M<32;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}S.adler=h.check=p(R),M=R=0,h.mode=11;case 11:if(h.havedict===0)return S.next_out=rt,S.avail_out=tt,S.next_in=H,S.avail_in=Z,h.hold=R,h.bits=M,2;S.adler=h.check=1,h.mode=12;case 12:if(O===5||O===6)break t;case 13:if(h.last){R>>>=7&M,M-=7&M,h.mode=27;break}for(;M<3;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}switch(h.last=1&R,M-=1,3&(R>>>=1)){case 0:h.mode=14;break;case 1:if(W(h),h.mode=20,O!==6)break;R>>>=2,M-=2;break t;case 2:h.mode=17;break;case 3:S.msg="invalid block type",h.mode=30}R>>>=2,M-=2;break;case 14:for(R>>>=7&M,M-=7&M;M<32;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}if((65535&R)!=(R>>>16^65535)){S.msg="invalid stored block lengths",h.mode=30;break}if(h.length=65535&R,M=R=0,h.mode=15,O===6)break t;case 15:h.mode=16;case 16:if(X=h.length){if(Z<X&&(X=Z),tt<X&&(X=tt),X===0)break t;a.arraySet(et,L,H,X,rt),Z-=X,H+=X,tt-=X,rt+=X,h.length-=X;break}h.mode=12;break;case 17:for(;M<14;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}if(h.nlen=257+(31&R),R>>>=5,M-=5,h.ndist=1+(31&R),R>>>=5,M-=5,h.ncode=4+(15&R),R>>>=4,M-=4,286<h.nlen||30<h.ndist){S.msg="too many length or distance symbols",h.mode=30;break}h.have=0,h.mode=18;case 18:for(;h.have<h.ncode;){for(;M<3;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}h.lens[j[h.have++]]=7&R,R>>>=3,M-=3}for(;h.have<19;)h.lens[j[h.have++]]=0;if(h.lencode=h.lendyn,h.lenbits=7,z={bits:h.lenbits},D=g(0,h.lens,0,19,h.lencode,0,h.work,z),h.lenbits=z.bits,D){S.msg="invalid code lengths set",h.mode=30;break}h.have=0,h.mode=19;case 19:for(;h.have<h.nlen+h.ndist;){for(;ot=(m=h.lencode[R&(1<<h.lenbits)-1])>>>16&255,mt=65535&m,!((nt=m>>>24)<=M);){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}if(mt<16)R>>>=nt,M-=nt,h.lens[h.have++]=mt;else{if(mt===16){for(w=nt+2;M<w;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}if(R>>>=nt,M-=nt,h.have===0){S.msg="invalid bit length repeat",h.mode=30;break}o=h.lens[h.have-1],X=3+(3&R),R>>>=2,M-=2}else if(mt===17){for(w=nt+3;M<w;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}M-=nt,o=0,X=3+(7&(R>>>=nt)),R>>>=3,M-=3}else{for(w=nt+7;M<w;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}M-=nt,o=0,X=11+(127&(R>>>=nt)),R>>>=7,M-=7}if(h.have+X>h.nlen+h.ndist){S.msg="invalid bit length repeat",h.mode=30;break}for(;X--;)h.lens[h.have++]=o}}if(h.mode===30)break;if(h.lens[256]===0){S.msg="invalid code -- missing end-of-block",h.mode=30;break}if(h.lenbits=9,z={bits:h.lenbits},D=g(_,h.lens,0,h.nlen,h.lencode,0,h.work,z),h.lenbits=z.bits,D){S.msg="invalid literal/lengths set",h.mode=30;break}if(h.distbits=6,h.distcode=h.distdyn,z={bits:h.distbits},D=g(v,h.lens,h.nlen,h.ndist,h.distcode,0,h.work,z),h.distbits=z.bits,D){S.msg="invalid distances set",h.mode=30;break}if(h.mode=20,O===6)break t;case 20:h.mode=21;case 21:if(6<=Z&&258<=tt){S.next_out=rt,S.avail_out=tt,S.next_in=H,S.avail_in=Z,h.hold=R,h.bits=M,c(S,q),rt=S.next_out,et=S.output,tt=S.avail_out,H=S.next_in,L=S.input,Z=S.avail_in,R=h.hold,M=h.bits,h.mode===12&&(h.back=-1);break}for(h.back=0;ot=(m=h.lencode[R&(1<<h.lenbits)-1])>>>16&255,mt=65535&m,!((nt=m>>>24)<=M);){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}if(ot&&(240&ot)==0){for(dt=nt,St=ot,_t=mt;ot=(m=h.lencode[_t+((R&(1<<dt+St)-1)>>dt)])>>>16&255,mt=65535&m,!(dt+(nt=m>>>24)<=M);){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}R>>>=dt,M-=dt,h.back+=dt}if(R>>>=nt,M-=nt,h.back+=nt,h.length=mt,ot===0){h.mode=26;break}if(32&ot){h.back=-1,h.mode=12;break}if(64&ot){S.msg="invalid literal/length code",h.mode=30;break}h.extra=15&ot,h.mode=22;case 22:if(h.extra){for(w=h.extra;M<w;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}h.length+=R&(1<<h.extra)-1,R>>>=h.extra,M-=h.extra,h.back+=h.extra}h.was=h.length,h.mode=23;case 23:for(;ot=(m=h.distcode[R&(1<<h.distbits)-1])>>>16&255,mt=65535&m,!((nt=m>>>24)<=M);){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}if((240&ot)==0){for(dt=nt,St=ot,_t=mt;ot=(m=h.distcode[_t+((R&(1<<dt+St)-1)>>dt)])>>>16&255,mt=65535&m,!(dt+(nt=m>>>24)<=M);){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}R>>>=dt,M-=dt,h.back+=dt}if(R>>>=nt,M-=nt,h.back+=nt,64&ot){S.msg="invalid distance code",h.mode=30;break}h.offset=mt,h.extra=15&ot,h.mode=24;case 24:if(h.extra){for(w=h.extra;M<w;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}h.offset+=R&(1<<h.extra)-1,R>>>=h.extra,M-=h.extra,h.back+=h.extra}if(h.offset>h.dmax){S.msg="invalid distance too far back",h.mode=30;break}h.mode=25;case 25:if(tt===0)break t;if(X=q-tt,h.offset>X){if((X=h.offset-X)>h.whave&&h.sane){S.msg="invalid distance too far back",h.mode=30;break}ut=X>h.wnext?(X-=h.wnext,h.wsize-X):h.wnext-X,X>h.length&&(X=h.length),vt=h.window}else vt=et,ut=rt-h.offset,X=h.length;for(tt<X&&(X=tt),tt-=X,h.length-=X;et[rt++]=vt[ut++],--X;);h.length===0&&(h.mode=21);break;case 26:if(tt===0)break t;et[rt++]=h.length,tt--,h.mode=21;break;case 27:if(h.wrap){for(;M<32;){if(Z===0)break t;Z--,R|=L[H++]<<M,M+=8}if(q-=tt,S.total_out+=q,h.total+=q,q&&(S.adler=h.check=h.flags?l(h.check,et,q,rt-q):i(h.check,et,q,rt-q)),q=tt,(h.flags?R:p(R))!==h.check){S.msg="incorrect data check",h.mode=30;break}M=R=0}h.mode=28;case 28:if(h.wrap&&h.flags){for(;M<32;){if(Z===0)break t;Z--,R+=L[H++]<<M,M+=8}if(R!==(4294967295&h.total)){S.msg="incorrect length check",h.mode=30;break}M=R=0}h.mode=29;case 29:D=1;break t;case 30:D=-3;break t;case 31:return-4;case 32:default:return u}return S.next_out=rt,S.avail_out=tt,S.next_in=H,S.avail_in=Z,h.hold=R,h.bits=M,(h.wsize||q!==S.avail_out&&h.mode<30&&(h.mode<27||O!==4))&&J(S,S.output,S.next_out,q-S.avail_out)?(h.mode=31,-4):(Q-=S.avail_in,q-=S.avail_out,S.total_in+=Q,S.total_out+=q,h.total+=q,h.wrap&&q&&(S.adler=h.check=h.flags?l(h.check,et,q,S.next_out-q):i(h.check,et,q,S.next_out-q)),S.data_type=h.bits+(h.last?64:0)+(h.mode===12?128:0)+(h.mode===20||h.mode===15?256:0),(Q==0&&q===0||O===4)&&D===y&&(D=-5),D)},n.inflateEnd=function(S){if(!S||!S.state)return u;var O=S.state;return O.window&&(O.window=null),S.state=null,y},n.inflateGetHeader=function(S,O){var h;return S&&S.state?(2&(h=S.state).wrap)==0?u:((h.head=O).done=!1,y):u},n.inflateSetDictionary=function(S,O){var h,L=O.length;return S&&S.state?(h=S.state).wrap!==0&&h.mode!==11?u:h.mode===11&&i(1,O,L,0)!==h.check?-3:J(S,O,L,L)?(h.mode=31,-4):(h.havedict=1,y):u},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,r,n){var a=t("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],g=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(_,v,y,u,b,d,f,p){var k,C,P,A,I,T,$,F,W,J=p.bits,S=0,O=0,h=0,L=0,et=0,H=0,rt=0,Z=0,tt=0,R=0,M=null,Q=0,q=new a.Buf16(16),X=new a.Buf16(16),ut=null,vt=0;for(S=0;S<=15;S++)q[S]=0;for(O=0;O<u;O++)q[v[y+O]]++;for(et=J,L=15;1<=L&&q[L]===0;L--);if(L<et&&(et=L),L===0)return b[d++]=20971520,b[d++]=20971520,p.bits=1,0;for(h=1;h<L&&q[h]===0;h++);for(et<h&&(et=h),S=Z=1;S<=15;S++)if(Z<<=1,(Z-=q[S])<0)return-1;if(0<Z&&(_===0||L!==1))return-1;for(X[1]=0,S=1;S<15;S++)X[S+1]=X[S]+q[S];for(O=0;O<u;O++)v[y+O]!==0&&(f[X[v[y+O]]++]=O);if(T=_===0?(M=ut=f,19):_===1?(M=i,Q-=257,ut=l,vt-=257,256):(M=c,ut=g,-1),S=h,I=d,rt=O=R=0,P=-1,A=(tt=1<<(H=et))-1,_===1&&852<tt||_===2&&592<tt)return 1;for(;;){for($=S-rt,W=f[O]<T?(F=0,f[O]):f[O]>T?(F=ut[vt+f[O]],M[Q+f[O]]):(F=96,0),k=1<<S-rt,h=C=1<<H;b[I+(R>>rt)+(C-=k)]=$<<24|F<<16|W|0,C!==0;);for(k=1<<S-1;R&k;)k>>=1;if(k!==0?(R&=k-1,R+=k):R=0,O++,--q[S]==0){if(S===L)break;S=v[y+f[O]]}if(et<S&&(R&A)!==P){for(rt===0&&(rt=et),I+=h,Z=1<<(H=S-rt);H+rt<L&&!((Z-=q[H+rt])<=0);)H++,Z<<=1;if(tt+=1<<H,_===1&&852<tt||_===2&&592<tt)return 1;b[P=R&A]=et<<24|H<<16|I-d|0}}return R!==0&&(b[I+R]=S-rt<<24|64<<16|0),p.bits=et,0}},{"../utils/common":41}],51:[function(t,r,n){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,r,n){var a=t("../utils/common"),i=0,l=1;function c(m){for(var E=m.length;0<=--E;)m[E]=0}var g=0,_=29,v=256,y=v+1+_,u=30,b=19,d=2*y+1,f=15,p=16,k=7,C=256,P=16,A=17,I=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],$=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],W=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=new Array(2*(y+2));c(J);var S=new Array(2*u);c(S);var O=new Array(512);c(O);var h=new Array(256);c(h);var L=new Array(_);c(L);var et,H,rt,Z=new Array(u);function tt(m,E,j,U,N){this.static_tree=m,this.extra_bits=E,this.extra_base=j,this.elems=U,this.max_length=N,this.has_stree=m&&m.length}function R(m,E){this.dyn_tree=m,this.max_code=0,this.stat_desc=E}function M(m){return m<256?O[m]:O[256+(m>>>7)]}function Q(m,E){m.pending_buf[m.pending++]=255&E,m.pending_buf[m.pending++]=E>>>8&255}function q(m,E,j){m.bi_valid>p-j?(m.bi_buf|=E<<m.bi_valid&65535,Q(m,m.bi_buf),m.bi_buf=E>>p-m.bi_valid,m.bi_valid+=j-p):(m.bi_buf|=E<<m.bi_valid&65535,m.bi_valid+=j)}function X(m,E,j){q(m,j[2*E],j[2*E+1])}function ut(m,E){for(var j=0;j|=1&m,m>>>=1,j<<=1,0<--E;);return j>>>1}function vt(m,E,j){var U,N,V=new Array(f+1),Y=0;for(U=1;U<=f;U++)V[U]=Y=Y+j[U-1]<<1;for(N=0;N<=E;N++){var G=m[2*N+1];G!==0&&(m[2*N]=ut(V[G]++,G))}}function nt(m){var E;for(E=0;E<y;E++)m.dyn_ltree[2*E]=0;for(E=0;E<u;E++)m.dyn_dtree[2*E]=0;for(E=0;E<b;E++)m.bl_tree[2*E]=0;m.dyn_ltree[2*C]=1,m.opt_len=m.static_len=0,m.last_lit=m.matches=0}function ot(m){8<m.bi_valid?Q(m,m.bi_buf):0<m.bi_valid&&(m.pending_buf[m.pending++]=m.bi_buf),m.bi_buf=0,m.bi_valid=0}function mt(m,E,j,U){var N=2*E,V=2*j;return m[N]<m[V]||m[N]===m[V]&&U[E]<=U[j]}function dt(m,E,j){for(var U=m.heap[j],N=j<<1;N<=m.heap_len&&(N<m.heap_len&&mt(E,m.heap[N+1],m.heap[N],m.depth)&&N++,!mt(E,U,m.heap[N],m.depth));)m.heap[j]=m.heap[N],j=N,N<<=1;m.heap[j]=U}function St(m,E,j){var U,N,V,Y,G=0;if(m.last_lit!==0)for(;U=m.pending_buf[m.d_buf+2*G]<<8|m.pending_buf[m.d_buf+2*G+1],N=m.pending_buf[m.l_buf+G],G++,U===0?X(m,N,E):(X(m,(V=h[N])+v+1,E),(Y=T[V])!==0&&q(m,N-=L[V],Y),X(m,V=M(--U),j),(Y=$[V])!==0&&q(m,U-=Z[V],Y)),G<m.last_lit;);X(m,C,E)}function _t(m,E){var j,U,N,V=E.dyn_tree,Y=E.stat_desc.static_tree,G=E.stat_desc.has_stree,K=E.stat_desc.elems,ct=-1;for(m.heap_len=0,m.heap_max=d,j=0;j<K;j++)V[2*j]!==0?(m.heap[++m.heap_len]=ct=j,m.depth[j]=0):V[2*j+1]=0;for(;m.heap_len<2;)V[2*(N=m.heap[++m.heap_len]=ct<2?++ct:0)]=1,m.depth[N]=0,m.opt_len--,G&&(m.static_len-=Y[2*N+1]);for(E.max_code=ct,j=m.heap_len>>1;1<=j;j--)dt(m,V,j);for(N=K;j=m.heap[1],m.heap[1]=m.heap[m.heap_len--],dt(m,V,1),U=m.heap[1],m.heap[--m.heap_max]=j,m.heap[--m.heap_max]=U,V[2*N]=V[2*j]+V[2*U],m.depth[N]=(m.depth[j]>=m.depth[U]?m.depth[j]:m.depth[U])+1,V[2*j+1]=V[2*U+1]=N,m.heap[1]=N++,dt(m,V,1),2<=m.heap_len;);m.heap[--m.heap_max]=m.heap[1],(function(at,wt){var zt,xt,Ft,ft,Wt,re,Ct=wt.dyn_tree,ze=wt.max_code,wn=wt.stat_desc.static_tree,_n=wt.stat_desc.has_stree,Sn=wt.stat_desc.extra_bits,Fe=wt.stat_desc.extra_base,It=wt.stat_desc.max_length,Zt=0;for(ft=0;ft<=f;ft++)at.bl_count[ft]=0;for(Ct[2*at.heap[at.heap_max]+1]=0,zt=at.heap_max+1;zt<d;zt++)It<(ft=Ct[2*Ct[2*(xt=at.heap[zt])+1]+1]+1)&&(ft=It,Zt++),Ct[2*xt+1]=ft,ze<xt||(at.bl_count[ft]++,Wt=0,Fe<=xt&&(Wt=Sn[xt-Fe]),re=Ct[2*xt],at.opt_len+=re*(ft+Wt),_n&&(at.static_len+=re*(wn[2*xt+1]+Wt)));if(Zt!==0){do{for(ft=It-1;at.bl_count[ft]===0;)ft--;at.bl_count[ft]--,at.bl_count[ft+1]+=2,at.bl_count[It]--,Zt-=2}while(0<Zt);for(ft=It;ft!==0;ft--)for(xt=at.bl_count[ft];xt!==0;)ze<(Ft=at.heap[--zt])||(Ct[2*Ft+1]!==ft&&(at.opt_len+=(ft-Ct[2*Ft+1])*Ct[2*Ft],Ct[2*Ft+1]=ft),xt--)}})(m,E),vt(V,ct,m.bl_count)}function o(m,E,j){var U,N,V=-1,Y=E[1],G=0,K=7,ct=4;for(Y===0&&(K=138,ct=3),E[2*(j+1)+1]=65535,U=0;U<=j;U++)N=Y,Y=E[2*(U+1)+1],++G<K&&N===Y||(G<ct?m.bl_tree[2*N]+=G:N!==0?(N!==V&&m.bl_tree[2*N]++,m.bl_tree[2*P]++):G<=10?m.bl_tree[2*A]++:m.bl_tree[2*I]++,V=N,ct=(G=0)===Y?(K=138,3):N===Y?(K=6,3):(K=7,4))}function D(m,E,j){var U,N,V=-1,Y=E[1],G=0,K=7,ct=4;for(Y===0&&(K=138,ct=3),U=0;U<=j;U++)if(N=Y,Y=E[2*(U+1)+1],!(++G<K&&N===Y)){if(G<ct)for(;X(m,N,m.bl_tree),--G!=0;);else N!==0?(N!==V&&(X(m,N,m.bl_tree),G--),X(m,P,m.bl_tree),q(m,G-3,2)):G<=10?(X(m,A,m.bl_tree),q(m,G-3,3)):(X(m,I,m.bl_tree),q(m,G-11,7));V=N,ct=(G=0)===Y?(K=138,3):N===Y?(K=6,3):(K=7,4)}}c(Z);var z=!1;function w(m,E,j,U){q(m,(g<<1)+(U?1:0),3),(function(N,V,Y,G){ot(N),Q(N,Y),Q(N,~Y),a.arraySet(N.pending_buf,N.window,V,Y,N.pending),N.pending+=Y})(m,E,j)}n._tr_init=function(m){z||((function(){var E,j,U,N,V,Y=new Array(f+1);for(N=U=0;N<_-1;N++)for(L[N]=U,E=0;E<1<<T[N];E++)h[U++]=N;for(h[U-1]=N,N=V=0;N<16;N++)for(Z[N]=V,E=0;E<1<<$[N];E++)O[V++]=N;for(V>>=7;N<u;N++)for(Z[N]=V<<7,E=0;E<1<<$[N]-7;E++)O[256+V++]=N;for(j=0;j<=f;j++)Y[j]=0;for(E=0;E<=143;)J[2*E+1]=8,E++,Y[8]++;for(;E<=255;)J[2*E+1]=9,E++,Y[9]++;for(;E<=279;)J[2*E+1]=7,E++,Y[7]++;for(;E<=287;)J[2*E+1]=8,E++,Y[8]++;for(vt(J,y+1,Y),E=0;E<u;E++)S[2*E+1]=5,S[2*E]=ut(E,5);et=new tt(J,T,v+1,y,f),H=new tt(S,$,0,u,f),rt=new tt(new Array(0),F,0,b,k)})(),z=!0),m.l_desc=new R(m.dyn_ltree,et),m.d_desc=new R(m.dyn_dtree,H),m.bl_desc=new R(m.bl_tree,rt),m.bi_buf=0,m.bi_valid=0,nt(m)},n._tr_stored_block=w,n._tr_flush_block=function(m,E,j,U){var N,V,Y=0;0<m.level?(m.strm.data_type===2&&(m.strm.data_type=(function(G){var K,ct=4093624447;for(K=0;K<=31;K++,ct>>>=1)if(1&ct&&G.dyn_ltree[2*K]!==0)return i;if(G.dyn_ltree[18]!==0||G.dyn_ltree[20]!==0||G.dyn_ltree[26]!==0)return l;for(K=32;K<v;K++)if(G.dyn_ltree[2*K]!==0)return l;return i})(m)),_t(m,m.l_desc),_t(m,m.d_desc),Y=(function(G){var K;for(o(G,G.dyn_ltree,G.l_desc.max_code),o(G,G.dyn_dtree,G.d_desc.max_code),_t(G,G.bl_desc),K=b-1;3<=K&&G.bl_tree[2*W[K]+1]===0;K--);return G.opt_len+=3*(K+1)+5+5+4,K})(m),N=m.opt_len+3+7>>>3,(V=m.static_len+3+7>>>3)<=N&&(N=V)):N=V=j+5,j+4<=N&&E!==-1?w(m,E,j,U):m.strategy===4||V===N?(q(m,2+(U?1:0),3),St(m,J,S)):(q(m,4+(U?1:0),3),(function(G,K,ct,at){var wt;for(q(G,K-257,5),q(G,ct-1,5),q(G,at-4,4),wt=0;wt<at;wt++)q(G,G.bl_tree[2*W[wt]+1],3);D(G,G.dyn_ltree,K-1),D(G,G.dyn_dtree,ct-1)})(m,m.l_desc.max_code+1,m.d_desc.max_code+1,Y+1),St(m,m.dyn_ltree,m.dyn_dtree)),nt(m),U&&ot(m)},n._tr_tally=function(m,E,j){return m.pending_buf[m.d_buf+2*m.last_lit]=E>>>8&255,m.pending_buf[m.d_buf+2*m.last_lit+1]=255&E,m.pending_buf[m.l_buf+m.last_lit]=255&j,m.last_lit++,E===0?m.dyn_ltree[2*j]++:(m.matches++,E--,m.dyn_ltree[2*(h[j]+v+1)]++,m.dyn_dtree[2*M(E)]++),m.last_lit===m.lit_bufsize-1},n._tr_align=function(m){q(m,2,3),X(m,C,J),(function(E){E.bi_valid===16?(Q(E,E.bi_buf),E.bi_buf=0,E.bi_valid=0):8<=E.bi_valid&&(E.pending_buf[E.pending++]=255&E.bi_buf,E.bi_buf>>=8,E.bi_valid-=8)})(m)}},{"../utils/common":41}],53:[function(t,r,n){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,r,n){(function(a){(function(i,l){if(!i.setImmediate){var c,g,_,v,y=1,u={},b=!1,d=i.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(i);f=f&&f.setTimeout?f:i,c={}.toString.call(i.process)==="[object process]"?function(P){process.nextTick(function(){k(P)})}:(function(){if(i.postMessage&&!i.importScripts){var P=!0,A=i.onmessage;return i.onmessage=function(){P=!1},i.postMessage("","*"),i.onmessage=A,P}})()?(v="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",C,!1):i.attachEvent("onmessage",C),function(P){i.postMessage(v+P,"*")}):i.MessageChannel?((_=new MessageChannel).port1.onmessage=function(P){k(P.data)},function(P){_.port2.postMessage(P)}):d&&"onreadystatechange"in d.createElement("script")?(g=d.documentElement,function(P){var A=d.createElement("script");A.onreadystatechange=function(){k(P),A.onreadystatechange=null,g.removeChild(A),A=null},g.appendChild(A)}):function(P){setTimeout(k,0,P)},f.setImmediate=function(P){typeof P!="function"&&(P=new Function(""+P));for(var A=new Array(arguments.length-1),I=0;I<A.length;I++)A[I]=arguments[I+1];var T={callback:P,args:A};return u[y]=T,c(y),y++},f.clearImmediate=p}function p(P){delete u[P]}function k(P){if(b)setTimeout(k,0,P);else{var A=u[P];if(A){b=!0;try{(function(I){var T=I.callback,$=I.args;switch($.length){case 0:T();break;case 1:T($[0]);break;case 2:T($[0],$[1]);break;case 3:T($[0],$[1],$[2]);break;default:T.apply(l,$)}})(A)}finally{p(P),b=!1}}}}function C(P){P.source===i&&typeof P.data=="string"&&P.data.indexOf(v)===0&&k(+P.data.slice(v.length))}})(typeof self>"u"?a===void 0?this:a:self)}).call(this,typeof Ot<"u"?Ot:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Vt)),Vt.exports}var De=Oe();const Le=Ie(De);/*
11
+ */var it;function jt(){return it||(it=1,(function(s,t){(function(e){s.exports=e()})(function(){return(function e(r,n,a){function i(g,_){if(!n[g]){if(!r[g]){var y=typeof Le=="function"&&Le;if(!_&&y)return y(g,!0);if(o)return o(g,!0);var b=new Error("Cannot find module '"+g+"'");throw b.code="MODULE_NOT_FOUND",b}var d=n[g]={exports:{}};r[g][0].call(d.exports,function(v){var u=r[g][1][v];return i(u||v)},d,d.exports,e,r,n,a)}return n[g].exports}for(var o=typeof Le=="function"&&Le,c=0;c<a.length;c++)i(a[c]);return i})({1:[function(e,r,n){var a=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(c){for(var g,_,y,b,d,v,u,f=[],p=0,k=c.length,C=k,A=a.getTypeOf(c)!=="string";p<c.length;)C=k-p,y=A?(g=c[p++],_=p<k?c[p++]:0,p<k?c[p++]:0):(g=c.charCodeAt(p++),_=p<k?c.charCodeAt(p++):0,p<k?c.charCodeAt(p++):0),b=g>>2,d=(3&g)<<4|_>>4,v=1<C?(15&_)<<2|y>>6:64,u=2<C?63&y:64,f.push(o.charAt(b)+o.charAt(d)+o.charAt(v)+o.charAt(u));return f.join("")},n.decode=function(c){var g,_,y,b,d,v,u=0,f=0,p="data:";if(c.substr(0,p.length)===p)throw new Error("Invalid base64 input, it looks like a data url.");var k,C=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===o.charAt(64)&&C--,c.charAt(c.length-2)===o.charAt(64)&&C--,C%1!=0)throw new Error("Invalid base64 input, bad content length.");for(k=i.uint8array?new Uint8Array(0|C):new Array(0|C);u<c.length;)g=o.indexOf(c.charAt(u++))<<2|(b=o.indexOf(c.charAt(u++)))>>4,_=(15&b)<<4|(d=o.indexOf(c.charAt(u++)))>>2,y=(3&d)<<6|(v=o.indexOf(c.charAt(u++))),k[f++]=g,d!==64&&(k[f++]=_),v!==64&&(k[f++]=y);return k}},{"./support":30,"./utils":32}],2:[function(e,r,n){var a=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),c=e("./stream/DataLengthProbe");function g(_,y,b,d,v){this.compressedSize=_,this.uncompressedSize=y,this.crc32=b,this.compression=d,this.compressedContent=v}g.prototype={getContentWorker:function(){var _=new i(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),y=this;return _.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),_},getCompressedWorker:function(){return new i(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(_,y,b){return _.pipe(new o).pipe(new c("uncompressedSize")).pipe(y.compressWorker(b)).pipe(new c("compressedSize")).withStreamInfo("compression",y)},r.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,r,n){var a=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,r,n){var a=e("./utils"),i=(function(){for(var o,c=[],g=0;g<256;g++){o=g;for(var _=0;_<8;_++)o=1&o?3988292384^o>>>1:o>>>1;c[g]=o}return c})();r.exports=function(o,c){return o!==void 0&&o.length?a.getTypeOf(o)!=="string"?(function(g,_,y,b){var d=i,v=b+y;g^=-1;for(var u=b;u<v;u++)g=g>>>8^d[255&(g^_[u])];return-1^g})(0|c,o,o.length,0):(function(g,_,y,b){var d=i,v=b+y;g^=-1;for(var u=b;u<v;u++)g=g>>>8^d[255&(g^_.charCodeAt(u))];return-1^g})(0|c,o,o.length,0):0}},{"./utils":32}],5:[function(e,r,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,r,n){var a=null;a=typeof Promise<"u"?Promise:e("lie"),r.exports={Promise:a}},{lie:37}],7:[function(e,r,n){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=e("pako"),o=e("./utils"),c=e("./stream/GenericWorker"),g=a?"uint8array":"array";function _(y,b){c.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=b,this.meta={}}n.magic="\b\0",o.inherits(_,c),_.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(g,y.data),!1)},_.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},_.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},_.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(b){y.push({data:b,meta:y.meta})}},n.compressWorker=function(y){return new _("Deflate",y)},n.uncompressWorker=function(){return new _("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,r,n){function a(d,v){var u,f="";for(u=0;u<v;u++)f+=String.fromCharCode(255&d),d>>>=8;return f}function i(d,v,u,f,p,k){var C,A,E=d.file,D=d.compression,F=k!==g.utf8encode,H=o.transformTo("string",k(E.name)),I=o.transformTo("string",g.utf8encode(E.name)),$=E.comment,G=o.transformTo("string",k($)),S=o.transformTo("string",g.utf8encode($)),M=I.length!==E.name.length,h=S.length!==$.length,O="",te="",W="",re=E.dir,Z=E.date,ee={crc32:0,compressedSize:0,uncompressedSize:0};v&&!u||(ee.crc32=d.crc32,ee.compressedSize=d.compressedSize,ee.uncompressedSize=d.uncompressedSize);var R=0;v&&(R|=8),F||!M&&!h||(R|=2048);var B=0,Q=0;re&&(B|=16),p==="UNIX"?(Q=798,B|=(function(q,ue){var ve=q;return q||(ve=ue?16893:33204),(65535&ve)<<16})(E.unixPermissions,re)):(Q=20,B|=(function(q){return 63&(q||0)})(E.dosPermissions)),C=Z.getUTCHours(),C<<=6,C|=Z.getUTCMinutes(),C<<=5,C|=Z.getUTCSeconds()/2,A=Z.getUTCFullYear()-1980,A<<=4,A|=Z.getUTCMonth()+1,A<<=5,A|=Z.getUTCDate(),M&&(te=a(1,1)+a(_(H),4)+I,O+="up"+a(te.length,2)+te),h&&(W=a(1,1)+a(_(G),4)+S,O+="uc"+a(W.length,2)+W);var Y="";return Y+=`
12
+ \0`,Y+=a(R,2),Y+=D.magic,Y+=a(C,2),Y+=a(A,2),Y+=a(ee.crc32,4),Y+=a(ee.compressedSize,4),Y+=a(ee.uncompressedSize,4),Y+=a(H.length,2),Y+=a(O.length,2),{fileRecord:y.LOCAL_FILE_HEADER+Y+H+O,dirRecord:y.CENTRAL_FILE_HEADER+a(Q,2)+Y+a(G.length,2)+"\0\0\0\0"+a(B,4)+a(f,4)+H+O+G}}var o=e("../utils"),c=e("../stream/GenericWorker"),g=e("../utf8"),_=e("../crc32"),y=e("../signature");function b(d,v,u,f){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=v,this.zipPlatform=u,this.encodeFileName=f,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(b,c),b.prototype.push=function(d){var v=d.meta.percent||0,u=this.entriesCount,f=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,c.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:u?(v+100*(u-f-1))/u:100}}))},b.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var v=this.streamFiles&&!d.file.dir;if(v){var u=i(d,v,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:u.fileRecord,meta:{percent:0}})}else this.accumulate=!0},b.prototype.closedSource=function(d){this.accumulate=!1;var v=this.streamFiles&&!d.file.dir,u=i(d,v,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(u.dirRecord),v)this.push({data:(function(f){return y.DATA_DESCRIPTOR+a(f.crc32,4)+a(f.compressedSize,4)+a(f.uncompressedSize,4)})(d),meta:{percent:100}});else for(this.push({data:u.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},b.prototype.flush=function(){for(var d=this.bytesWritten,v=0;v<this.dirRecords.length;v++)this.push({data:this.dirRecords[v],meta:{percent:100}});var u=this.bytesWritten-d,f=(function(p,k,C,A,E){var D=o.transformTo("string",E(A));return y.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(p,2)+a(p,2)+a(k,4)+a(C,4)+a(D.length,2)+D})(this.dirRecords.length,u,d,this.zipComment,this.encodeFileName);this.push({data:f,meta:{percent:100}})},b.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},b.prototype.registerPrevious=function(d){this._sources.push(d);var v=this;return d.on("data",function(u){v.processChunk(u)}),d.on("end",function(){v.closedSource(v.previous.streamInfo),v._sources.length?v.prepareNextSource():v.end()}),d.on("error",function(u){v.error(u)}),this},b.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},b.prototype.error=function(d){var v=this._sources;if(!c.prototype.error.call(this,d))return!1;for(var u=0;u<v.length;u++)try{v[u].error(d)}catch{}return!0},b.prototype.lock=function(){c.prototype.lock.call(this);for(var d=this._sources,v=0;v<d.length;v++)d[v].lock()},r.exports=b},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,r,n){var a=e("../compressions"),i=e("./ZipFileWorker");n.generateWorker=function(o,c,g){var _=new i(c.streamFiles,g,c.platform,c.encodeFileName),y=0;try{o.forEach(function(b,d){y++;var v=(function(k,C){var A=k||C,E=a[A];if(!E)throw new Error(A+" is not a valid compression method !");return E})(d.options.compression,c.compression),u=d.options.compressionOptions||c.compressionOptions||{},f=d.dir,p=d.date;d._compressWorker(v,u).withStreamInfo("file",{name:b,dir:f,date:p,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(_)}),_.entriesCount=y}catch(b){_.error(b)}return _}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,r,n){function a(){if(!(this instanceof a))return new a;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 i=new a;for(var o in this)typeof this[o]!="function"&&(i[o]=this[o]);return i}}(a.prototype=e("./object")).loadAsync=e("./load"),a.support=e("./support"),a.defaults=e("./defaults"),a.version="3.10.2",a.loadAsync=function(i,o){return new a().loadAsync(i,o)},a.external=e("./external"),r.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,r,n){var a=e("./utils"),i=e("./external"),o=e("./utf8"),c=e("./zipEntries"),g=e("./stream/Crc32Probe"),_=e("./nodejsUtils");function y(b){return new i.Promise(function(d,v){var u=b.decompressed.getContentWorker().pipe(new g);u.on("error",function(f){v(f)}).on("end",function(){u.streamInfo.crc32!==b.decompressed.crc32?v(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}r.exports=function(b,d){var v=this;return d=a.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),_.isNode&&_.isStream(b)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",b,!0,d.optimizedBinaryString,d.base64).then(function(u){var f=new c(d);return f.load(u),f}).then(function(u){var f=[i.Promise.resolve(u)],p=u.files;if(d.checkCRC32)for(var k=0;k<p.length;k++)f.push(y(p[k]));return i.Promise.all(f)}).then(function(u){for(var f=u.shift(),p=f.files,k=0;k<p.length;k++){var C=p[k],A=C.fileNameStr,E=a.resolve(C.fileNameStr);v.file(E,C.decompressed,{binary:!0,optimizedBinaryString:!0,date:C.date,dir:C.dir,comment:C.fileCommentStr.length?C.fileCommentStr:null,unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions,createFolders:d.createFolders}),C.dir||(v.file(E).unsafeOriginalName=A)}return f.zipComment.length&&(v.comment=f.zipComment),v})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,r,n){var a=e("../utils"),i=e("../stream/GenericWorker");function o(c,g){i.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(g)}a.inherits(o,i),o.prototype._bindStream=function(c){var g=this;(this._stream=c).pause(),c.on("data",function(_){g.push({data:_,meta:{percent:0}})}).on("error",function(_){g.isPaused?this.generatedError=_:g.error(_)}).on("end",function(){g.isPaused?g._upstreamEnded=!0:g.end()})},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,r,n){var a=e("readable-stream").Readable;function i(o,c,g){a.call(this,c),this._helper=o;var _=this;o.on("data",function(y,b){_.push(y)||_._helper.pause(),g&&g(b)}).on("error",function(y){_.emit("error",y)}).on("end",function(){_.push(null)})}e("../utils").inherits(i,a),i.prototype._read=function(){this._helper.resume()},r.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,r,n){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(a,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(a,i);if(typeof a=="number")throw new Error('The "data" argument must not be a number');return new Buffer(a,i)},allocBuffer:function(a){if(Buffer.alloc)return Buffer.alloc(a);var i=new Buffer(a);return i.fill(0),i},isBuffer:function(a){return Buffer.isBuffer(a)},isStream:function(a){return a&&typeof a.on=="function"&&typeof a.pause=="function"&&typeof a.resume=="function"}}},{}],15:[function(e,r,n){function a(E,D,F){var H,I=o.getTypeOf(D),$=o.extend(F||{},_);$.date=$.date||new Date,$.compression!==null&&($.compression=$.compression.toUpperCase()),typeof $.unixPermissions=="string"&&($.unixPermissions=parseInt($.unixPermissions,8)),$.unixPermissions&&16384&$.unixPermissions&&($.dir=!0),$.dosPermissions&&16&$.dosPermissions&&($.dir=!0),$.dir&&(E=p(E)),$.createFolders&&(H=f(E))&&k.call(this,H,!0);var G=I==="string"&&$.binary===!1&&$.base64===!1;F&&F.binary!==void 0||($.binary=!G),(D instanceof y&&D.uncompressedSize===0||$.dir||!D||D.length===0)&&($.base64=!1,$.binary=!0,D="",$.compression="STORE",I="string");var S=null;S=D instanceof y||D instanceof c?D:v.isNode&&v.isStream(D)?new u(E,D):o.prepareContent(E,D,$.binary,$.optimizedBinaryString,$.base64);var M=new b(E,S,$);this.files[E]=M}var i=e("./utf8"),o=e("./utils"),c=e("./stream/GenericWorker"),g=e("./stream/StreamHelper"),_=e("./defaults"),y=e("./compressedObject"),b=e("./zipObject"),d=e("./generate"),v=e("./nodejsUtils"),u=e("./nodejs/NodejsStreamInputAdapter"),f=function(E){E.slice(-1)==="/"&&(E=E.substring(0,E.length-1));var D=E.lastIndexOf("/");return 0<D?E.substring(0,D):""},p=function(E){return E.slice(-1)!=="/"&&(E+="/"),E},k=function(E,D){return D=D!==void 0?D:_.createFolders,E=p(E),this.files[E]||a.call(this,E,null,{dir:!0,createFolders:D}),this.files[E]};function C(E){return Object.prototype.toString.call(E)==="[object RegExp]"}var A={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(E){var D,F,H;for(D in this.files)H=this.files[D],(F=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&E(F,H)},filter:function(E){var D=[];return this.forEach(function(F,H){E(F,H)&&D.push(H)}),D},file:function(E,D,F){if(arguments.length!==1)return E=this.root+E,a.call(this,E,D,F),this;if(C(E)){var H=E;return this.filter(function($,G){return!G.dir&&H.test($)})}var I=this.files[this.root+E];return I&&!I.dir?I:null},folder:function(E){if(!E)return this;if(C(E))return this.filter(function(I,$){return $.dir&&E.test(I)});var D=this.root+E,F=k.call(this,D),H=this.clone();return H.root=F.name,H},remove:function(E){E=this.root+E;var D=this.files[E];if(D||(E.slice(-1)!=="/"&&(E+="/"),D=this.files[E]),D&&!D.dir)delete this.files[E];else for(var F=this.filter(function(I,$){return $.name.slice(0,E.length)===E}),H=0;H<F.length;H++)delete this.files[F[H].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(E){var D,F={};try{if((F=o.extend(E||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=F.type.toLowerCase(),F.compression=F.compression.toUpperCase(),F.type==="binarystring"&&(F.type="string"),!F.type)throw new Error("No output type specified.");o.checkSupport(F.type),F.platform!=="darwin"&&F.platform!=="freebsd"&&F.platform!=="linux"&&F.platform!=="sunos"||(F.platform="UNIX"),F.platform==="win32"&&(F.platform="DOS");var H=F.comment||this.comment||"";D=d.generateWorker(this,F,H)}catch(I){(D=new c("error")).error(I)}return new g(D,F.type||"string",F.mimeType)},generateAsync:function(E,D){return this.generateInternalStream(E).accumulate(D)},generateNodeStream:function(E,D){return(E=E||{}).type||(E.type="nodebuffer"),this.generateInternalStream(E).toNodejsStream(D)}};r.exports=A},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,r,n){r.exports=e("stream")},{stream:void 0}],17:[function(e,r,n){var a=e("./DataReader");function i(o){a.call(this,o);for(var c=0;c<this.data.length;c++)o[c]=255&o[c]}e("../utils").inherits(i,a),i.prototype.byteAt=function(o){return this.data[this.zero+o]},i.prototype.lastIndexOfSignature=function(o){for(var c=o.charCodeAt(0),g=o.charCodeAt(1),_=o.charCodeAt(2),y=o.charCodeAt(3),b=this.length-4;0<=b;--b)if(this.data[b]===c&&this.data[b+1]===g&&this.data[b+2]===_&&this.data[b+3]===y)return b-this.zero;return-1},i.prototype.readAndCheckSignature=function(o){var c=o.charCodeAt(0),g=o.charCodeAt(1),_=o.charCodeAt(2),y=o.charCodeAt(3),b=this.readData(4);return c===b[0]&&g===b[1]&&_===b[2]&&y===b[3]},i.prototype.readData=function(o){if(this.checkOffset(o),o===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,c},r.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,r,n){var a=e("../utils");function i(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var c,g=0;for(this.checkOffset(o),c=this.index+o-1;c>=this.index;c--)g=(g<<8)+this.byteAt(c);return this.index+=o,g},readString:function(o){return a.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},r.exports=i},{"../utils":32}],19:[function(e,r,n){var a=e("./Uint8ArrayReader");function i(o){a.call(this,o)}e("../utils").inherits(i,a),i.prototype.readData=function(o){this.checkOffset(o);var c=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,r,n){var a=e("./DataReader");function i(o){a.call(this,o)}e("../utils").inherits(i,a),i.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},i.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},i.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},i.prototype.readData=function(o){this.checkOffset(o);var c=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,r,n){var a=e("./ArrayReader");function i(o){a.call(this,o)}e("../utils").inherits(i,a),i.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,r,n){var a=e("../utils"),i=e("../support"),o=e("./ArrayReader"),c=e("./StringReader"),g=e("./NodeBufferReader"),_=e("./Uint8ArrayReader");r.exports=function(y){var b=a.getTypeOf(y);return a.checkSupport(b),b!=="string"||i.uint8array?b==="nodebuffer"?new g(y):i.uint8array?new _(a.transformTo("uint8array",y)):new o(a.transformTo("array",y)):new c(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,r,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,r,n){var a=e("./GenericWorker"),i=e("../utils");function o(c){a.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(o,a),o.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,r,n){var a=e("./GenericWorker"),i=e("../crc32");function o(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,a),o.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,r,n){var a=e("../utils"),i=e("./GenericWorker");function o(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}a.inherits(o,i),o.prototype.processChunk=function(c){if(c){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,r,n){var a=e("../utils"),i=e("./GenericWorker");function o(c){i.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(_){g.dataIsReady=!0,g.data=_,g.max=_&&_.length||0,g.type=a.getTypeOf(_),g.isPaused||g._tickAndRepeat()},function(_){g.error(_)})}a.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,g=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,g);break;case"uint8array":c=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":c=this.data.slice(this.index,g)}return this.index=g,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,r,n){function a(i){this.name=i||"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}a.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,o){return this._listeners[i].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,o){if(this._listeners[i])for(var c=0;c<this._listeners[i].length;c++)this._listeners[i][c].call(this,o)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var o=this;return i.on("data",function(c){o.processChunk(c)}),i.on("end",function(){o.end()}),i.on("error",function(c){o.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,o){return this.extraStreamInfo[i]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},r.exports=a},{}],29:[function(e,r,n){var a=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),c=e("../base64"),g=e("../support"),_=e("../external"),y=null;if(g.nodestream)try{y=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(v,u){return new _.Promise(function(f,p){var k=[],C=v._internalType,A=v._outputType,E=v._mimeType;v.on("data",function(D,F){k.push(D),u&&u(F)}).on("error",function(D){k=[],p(D)}).on("end",function(){try{var D=(function(F,H,I){switch(F){case"blob":return a.newBlob(a.transformTo("arraybuffer",H),I);case"base64":return c.encode(H);default:return a.transformTo(F,H)}})(A,(function(F,H){var I,$=0,G=null,S=0;for(I=0;I<H.length;I++)S+=H[I].length;switch(F){case"string":return H.join("");case"array":return Array.prototype.concat.apply([],H);case"uint8array":for(G=new Uint8Array(S),I=0;I<H.length;I++)G.set(H[I],$),$+=H[I].length;return G;case"nodebuffer":return Buffer.concat(H);default:throw new Error("concat : unsupported type '"+F+"'")}})(C,k),E);f(D)}catch(F){p(F)}k=[]}).resume()})}function d(v,u,f){var p=u;switch(u){case"blob":case"arraybuffer":p="uint8array";break;case"base64":p="string"}try{this._internalType=p,this._outputType=u,this._mimeType=f,a.checkSupport(p),this._worker=v.pipe(new i(p)),v.lock()}catch(k){this._worker=new o("error"),this._worker.error(k)}}d.prototype={accumulate:function(v){return b(this,v)},on:function(v,u){var f=this;return v==="data"?this._worker.on(v,function(p){u.call(f,p.data,p.meta)}):this._worker.on(v,function(){a.delay(u,arguments,f)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(v){if(a.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new y(this,{objectMode:this._outputType!=="nodebuffer"},v)}},r.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,r,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",n.nodebuffer=typeof Buffer<"u",n.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")n.blob=!1;else{var a=new ArrayBuffer(0);try{n.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(a),n.blob=i.getBlob("application/zip").size===0}catch{n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,r,n){for(var a=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),c=e("./stream/GenericWorker"),g=new Array(256),_=0;_<256;_++)g[_]=252<=_?6:248<=_?5:240<=_?4:224<=_?3:192<=_?2:1;g[254]=g[254]=1;function y(){c.call(this,"utf-8 decode"),this.leftOver=null}function b(){c.call(this,"utf-8 encode")}n.utf8encode=function(d){return i.nodebuffer?o.newBufferFrom(d,"utf-8"):(function(v){var u,f,p,k,C,A=v.length,E=0;for(k=0;k<A;k++)(64512&(f=v.charCodeAt(k)))==55296&&k+1<A&&(64512&(p=v.charCodeAt(k+1)))==56320&&(f=65536+(f-55296<<10)+(p-56320),k++),E+=f<128?1:f<2048?2:f<65536?3:4;for(u=i.uint8array?new Uint8Array(E):new Array(E),k=C=0;C<E;k++)(64512&(f=v.charCodeAt(k)))==55296&&k+1<A&&(64512&(p=v.charCodeAt(k+1)))==56320&&(f=65536+(f-55296<<10)+(p-56320),k++),f<128?u[C++]=f:(f<2048?u[C++]=192|f>>>6:(f<65536?u[C++]=224|f>>>12:(u[C++]=240|f>>>18,u[C++]=128|f>>>12&63),u[C++]=128|f>>>6&63),u[C++]=128|63&f);return u})(d)},n.utf8decode=function(d){return i.nodebuffer?a.transformTo("nodebuffer",d).toString("utf-8"):(function(v){var u,f,p,k,C=v.length,A=new Array(2*C);for(u=f=0;u<C;)if((p=v[u++])<128)A[f++]=p;else if(4<(k=g[p]))A[f++]=65533,u+=k-1;else{for(p&=k===2?31:k===3?15:7;1<k&&u<C;)p=p<<6|63&v[u++],k--;1<k?A[f++]=65533:p<65536?A[f++]=p:(p-=65536,A[f++]=55296|p>>10&1023,A[f++]=56320|1023&p)}return A.length!==f&&(A.subarray?A=A.subarray(0,f):A.length=f),a.applyFromCharCode(A)})(d=a.transformTo(i.uint8array?"uint8array":"array",d))},a.inherits(y,c),y.prototype.processChunk=function(d){var v=a.transformTo(i.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var u=v;(v=new Uint8Array(u.length+this.leftOver.length)).set(this.leftOver,0),v.set(u,this.leftOver.length)}else v=this.leftOver.concat(v);this.leftOver=null}var f=(function(k,C){var A;for((C=C||k.length)>k.length&&(C=k.length),A=C-1;0<=A&&(192&k[A])==128;)A--;return A<0||A===0?C:A+g[k[A]]>C?A:C})(v),p=v;f!==v.length&&(i.uint8array?(p=v.subarray(0,f),this.leftOver=v.subarray(f,v.length)):(p=v.slice(0,f),this.leftOver=v.slice(f,v.length))),this.push({data:n.utf8decode(p),meta:d.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=y,a.inherits(b,c),b.prototype.processChunk=function(d){this.push({data:n.utf8encode(d.data),meta:d.meta})},n.Utf8EncodeWorker=b},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,r,n){var a=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),c=e("./external");function g(u){return u}function _(u,f){for(var p=0;p<u.length;++p)f[p]=255&u.charCodeAt(p);return f}e("setimmediate"),n.newBlob=function(u,f){n.checkSupport("blob");try{return new Blob([u],{type:f})}catch{try{var p=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return p.append(u),p.getBlob(f)}catch{throw new Error("Bug : can't construct the Blob.")}}};var y={stringifyByChunk:function(u,f,p){var k=[],C=0,A=u.length;if(A<=p)return String.fromCharCode.apply(null,u);for(;C<A;)f==="array"||f==="nodebuffer"?k.push(String.fromCharCode.apply(null,u.slice(C,Math.min(C+p,A)))):k.push(String.fromCharCode.apply(null,u.subarray(C,Math.min(C+p,A)))),C+=p;return k.join("")},stringifyByChar:function(u){for(var f="",p=0;p<u.length;p++)f+=String.fromCharCode(u[p]);return f},applyCanBeUsed:{uint8array:(function(){try{return a.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return a.nodebuffer&&String.fromCharCode.apply(null,o.allocBuffer(1)).length===1}catch{return!1}})()}};function b(u){var f=65536,p=n.getTypeOf(u),k=!0;if(p==="uint8array"?k=y.applyCanBeUsed.uint8array:p==="nodebuffer"&&(k=y.applyCanBeUsed.nodebuffer),k)for(;1<f;)try{return y.stringifyByChunk(u,p,f)}catch{f=Math.floor(f/2)}return y.stringifyByChar(u)}function d(u,f){for(var p=0;p<u.length;p++)f[p]=u[p];return f}n.applyFromCharCode=b;var v={};v.string={string:g,array:function(u){return _(u,new Array(u.length))},arraybuffer:function(u){return v.string.uint8array(u).buffer},uint8array:function(u){return _(u,new Uint8Array(u.length))},nodebuffer:function(u){return _(u,o.allocBuffer(u.length))}},v.array={string:b,array:g,arraybuffer:function(u){return new Uint8Array(u).buffer},uint8array:function(u){return new Uint8Array(u)},nodebuffer:function(u){return o.newBufferFrom(u)}},v.arraybuffer={string:function(u){return b(new Uint8Array(u))},array:function(u){return d(new Uint8Array(u),new Array(u.byteLength))},arraybuffer:g,uint8array:function(u){return new Uint8Array(u)},nodebuffer:function(u){return o.newBufferFrom(new Uint8Array(u))}},v.uint8array={string:b,array:function(u){return d(u,new Array(u.length))},arraybuffer:function(u){return u.buffer},uint8array:g,nodebuffer:function(u){return o.newBufferFrom(u)}},v.nodebuffer={string:b,array:function(u){return d(u,new Array(u.length))},arraybuffer:function(u){return v.nodebuffer.uint8array(u).buffer},uint8array:function(u){return d(u,new Uint8Array(u.length))},nodebuffer:g},n.transformTo=function(u,f){if(f=f||"",!u)return f;n.checkSupport(u);var p=n.getTypeOf(f);return v[p][u](f)},n.resolve=function(u){for(var f=u.split("/"),p=[],k=0;k<f.length;k++){var C=f[k];C==="."||C===""&&k!==0&&k!==f.length-1||(C===".."?p.pop():p.push(C))}return p.join("/")},n.getTypeOf=function(u){if(typeof u=="string")return"string";var f=Object.prototype.toString.call(u);return f==="[object Array]"?"array":a.nodebuffer&&o.isBuffer(u)?"nodebuffer":a.uint8array&&f==="[object Uint8Array]"?"uint8array":a.arraybuffer&&f==="[object ArrayBuffer]"?"arraybuffer":void 0},n.checkSupport=function(u){if(!a[u.toLowerCase()])throw new Error(u+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(u){var f,p,k="";for(p=0;p<(u||"").length;p++)k+="\\x"+((f=u.charCodeAt(p))<16?"0":"")+f.toString(16).toUpperCase();return k},n.delay=function(u,f,p){setImmediate(function(){u.apply(p||null,f||[])})},n.inherits=function(u,f){function p(){}p.prototype=f.prototype,u.prototype=new p},n.extend=function(){var u,f,p={};for(u=0;u<arguments.length;u++)for(f in arguments[u])Object.prototype.hasOwnProperty.call(arguments[u],f)&&p[f]===void 0&&(p[f]=arguments[u][f]);return p},n.prepareContent=function(u,f,p,k,C){return c.Promise.resolve(f).then(function(A){return a.blob&&(A instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(A))!==-1)?Blob.prototype.arrayBuffer!==void 0?A.arrayBuffer():typeof FileReader<"u"?new c.Promise(function(E,D){var F=new FileReader;F.onload=function(H){E(H.target.result)},F.onerror=function(H){D(H.target.error)},F.readAsArrayBuffer(A)}):c.Promise.reject(new Error(u+" is a Blob, but we have no way of reading it.")):A}).then(function(A){var E=n.getTypeOf(A);return E?(E==="arraybuffer"?A=n.transformTo("uint8array",A):E==="string"&&(C?A=i.decode(A):p&&k!==!0&&(A=(function(D){return _(D,a.uint8array?new Uint8Array(D.length):new Array(D.length))})(A))),A):c.Promise.reject(new Error("Can't read the data of '"+u+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,r,n){var a=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),c=e("./zipEntry"),g=e("./support");function _(y){this.files=[],this.loadOptions=y}_.prototype={checkSignature:function(y){if(!this.reader.readAndCheckSignature(y)){this.reader.index-=4;var b=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(b)+", expected "+i.pretty(y)+")")}},isSignature:function(y,b){var d=this.reader.index;this.reader.setIndex(y);var v=this.reader.readString(4)===b;return this.reader.setIndex(d),v},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 y=this.reader.readData(this.zipCommentLength),b=g.uint8array?"uint8array":"array",d=i.transformTo(b,y);this.zipComment=this.loadOptions.decodeFileName(d)},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 y,b,d,v=this.zip64EndOfCentralSize-44;0<v;)y=this.reader.readInt(2),b=this.reader.readInt(4),d=this.reader.readData(b),this.zip64ExtensibleData[y]={id:y,length:b,value:d}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var y,b;for(y=0;y<this.files.length;y++)b=this.files[y],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8(),b.processAttributes()},readCentralDir:function(){var y;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(y=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(y);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var y=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(y<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):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");this.reader.setIndex(y);var b=y;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(y=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(y),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var v=b-d;if(0<v)this.isSignature(b,o.CENTRAL_FILE_HEADER)||(this.reader.zero=v);else if(v<0)throw new Error("Corrupted zip: missing "+Math.abs(v)+" bytes.")},prepareReader:function(y){this.reader=a(y)},load:function(y){this.prepareReader(y),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=_},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,r,n){var a=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),c=e("./crc32"),g=e("./utf8"),_=e("./compressions"),y=e("./support");function b(d,v){this.options=d,this.loadOptions=v}b.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(d){var v,u;if(d.skip(22),this.fileNameLength=d.readInt(2),u=d.readInt(2),this.fileName=d.readData(this.fileNameLength),d.skip(u),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((v=(function(f){for(var p in _)if(Object.prototype.hasOwnProperty.call(_,p)&&_[p].magic===f)return _[p];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,v,d.readData(this.compressedSize))},readCentralPart:function(d){this.versionMadeBy=d.readInt(2),d.skip(2),this.bitFlag=d.readInt(2),this.compressionMethod=d.readString(2),this.date=d.readDate(),this.crc32=d.readInt(4),this.compressedSize=d.readInt(4),this.uncompressedSize=d.readInt(4);var v=d.readInt(2);if(this.extraFieldsLength=d.readInt(2),this.fileCommentLength=d.readInt(2),this.diskNumberStart=d.readInt(2),this.internalFileAttributes=d.readInt(2),this.externalFileAttributes=d.readInt(4),this.localHeaderOffset=d.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");d.skip(v),this.readExtraFields(d),this.parseZIP64ExtraField(d),this.fileComment=d.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var d=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=a(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var v,u,f,p=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4<p;)v=d.readInt(2),u=d.readInt(2),f=d.readData(u),this.extraFields[v]={id:v,length:u,value:f};d.setIndex(p)},handleUTF8:function(){var d=y.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=g.utf8decode(this.fileName),this.fileCommentStr=g.utf8decode(this.fileComment);else{var v=this.findExtraFieldUnicodePath();if(v!==null)this.fileNameStr=v;else{var u=i.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(u)}var f=this.findExtraFieldUnicodeComment();if(f!==null)this.fileCommentStr=f;else{var p=i.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(p)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var v=a(d.value);return v.readInt(1)!==1||c(this.fileName)!==v.readInt(4)?null:g.utf8decode(v.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var v=a(d.value);return v.readInt(1)!==1||c(this.fileComment)!==v.readInt(4)?null:g.utf8decode(v.readData(d.length-5))}return null}},r.exports=b},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,r,n){function a(v,u,f){this.name=v,this.dir=f.dir,this.date=f.date,this.comment=f.comment,this.unixPermissions=f.unixPermissions,this.dosPermissions=f.dosPermissions,this._data=u,this._dataBinary=f.binary,this.options={compression:f.compression,compressionOptions:f.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),c=e("./utf8"),g=e("./compressedObject"),_=e("./stream/GenericWorker");a.prototype={internalStream:function(v){var u=null,f="string";try{if(!v)throw new Error("No output type specified.");var p=(f=v.toLowerCase())==="string"||f==="text";f!=="binarystring"&&f!=="text"||(f="string"),u=this._decompressWorker();var k=!this._dataBinary;k&&!p&&(u=u.pipe(new c.Utf8EncodeWorker)),!k&&p&&(u=u.pipe(new c.Utf8DecodeWorker))}catch(C){(u=new _("error")).error(C)}return new i(u,f,"")},async:function(v,u){return this.internalStream(v).accumulate(u)},nodeStream:function(v,u){return this.internalStream(v||"nodebuffer").toNodejsStream(u)},_compressWorker:function(v,u){if(this._data instanceof g&&this._data.compression.magic===v.magic)return this._data.getCompressedWorker();var f=this._decompressWorker();return this._dataBinary||(f=f.pipe(new c.Utf8EncodeWorker)),g.createWorkerFrom(f,v,u)},_decompressWorker:function(){return this._data instanceof g?this._data.getContentWorker():this._data instanceof _?this._data:new o(this._data)}};for(var y=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],b=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<y.length;d++)a.prototype[y[d]]=b;r.exports=a},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,r,n){(function(a){var i,o,c=a.MutationObserver||a.WebKitMutationObserver;if(c){var g=0,_=new c(v),y=a.document.createTextNode("");_.observe(y,{characterData:!0}),i=function(){y.data=g=++g%2}}else if(a.setImmediate||a.MessageChannel===void 0)i="document"in a&&"onreadystatechange"in a.document.createElement("script")?function(){var u=a.document.createElement("script");u.onreadystatechange=function(){v(),u.onreadystatechange=null,u.parentNode.removeChild(u),u=null},a.document.documentElement.appendChild(u)}:function(){setTimeout(v,0)};else{var b=new a.MessageChannel;b.port1.onmessage=v,i=function(){b.port2.postMessage(0)}}var d=[];function v(){var u,f;o=!0;for(var p=d.length;p;){for(f=d,d=[],u=-1;++u<p;)f[u]();p=d.length}o=!1}r.exports=function(u){d.push(u)!==1||o||i()}}).call(this,typeof De<"u"?De:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(e,r,n){var a=e("immediate");function i(){}var o={},c=["REJECTED"],g=["FULFILLED"],_=["PENDING"];function y(p){if(typeof p!="function")throw new TypeError("resolver must be a function");this.state=_,this.queue=[],this.outcome=void 0,p!==i&&u(this,p)}function b(p,k,C){this.promise=p,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}function d(p,k,C){a(function(){var A;try{A=k(C)}catch(E){return o.reject(p,E)}A===p?o.reject(p,new TypeError("Cannot resolve promise with itself")):o.resolve(p,A)})}function v(p){var k=p&&p.then;if(p&&(typeof p=="object"||typeof p=="function")&&typeof k=="function")return function(){k.apply(p,arguments)}}function u(p,k){var C=!1;function A(F){C||(C=!0,o.reject(p,F))}function E(F){C||(C=!0,o.resolve(p,F))}var D=f(function(){k(E,A)});D.status==="error"&&A(D.value)}function f(p,k){var C={};try{C.value=p(k),C.status="success"}catch(A){C.status="error",C.value=A}return C}(r.exports=y).prototype.finally=function(p){if(typeof p!="function")return this;var k=this.constructor;return this.then(function(C){return k.resolve(p()).then(function(){return C})},function(C){return k.resolve(p()).then(function(){throw C})})},y.prototype.catch=function(p){return this.then(null,p)},y.prototype.then=function(p,k){if(typeof p!="function"&&this.state===g||typeof k!="function"&&this.state===c)return this;var C=new this.constructor(i);return this.state!==_?d(C,this.state===g?p:k,this.outcome):this.queue.push(new b(C,p,k)),C},b.prototype.callFulfilled=function(p){o.resolve(this.promise,p)},b.prototype.otherCallFulfilled=function(p){d(this.promise,this.onFulfilled,p)},b.prototype.callRejected=function(p){o.reject(this.promise,p)},b.prototype.otherCallRejected=function(p){d(this.promise,this.onRejected,p)},o.resolve=function(p,k){var C=f(v,k);if(C.status==="error")return o.reject(p,C.value);var A=C.value;if(A)u(p,A);else{p.state=g,p.outcome=k;for(var E=-1,D=p.queue.length;++E<D;)p.queue[E].callFulfilled(k)}return p},o.reject=function(p,k){p.state=c,p.outcome=k;for(var C=-1,A=p.queue.length;++C<A;)p.queue[C].callRejected(k);return p},y.resolve=function(p){return p instanceof this?p:o.resolve(new this(i),p)},y.reject=function(p){var k=new this(i);return o.reject(k,p)},y.all=function(p){var k=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=p.length,A=!1;if(!C)return this.resolve([]);for(var E=new Array(C),D=0,F=-1,H=new this(i);++F<C;)I(p[F],F);return H;function I($,G){k.resolve($).then(function(S){E[G]=S,++D!==C||A||(A=!0,o.resolve(H,E))},function(S){A||(A=!0,o.reject(H,S))})}},y.race=function(p){var k=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=p.length,A=!1;if(!C)return this.resolve([]);for(var E=-1,D=new this(i);++E<C;)F=p[E],k.resolve(F).then(function(H){A||(A=!0,o.resolve(D,H))},function(H){A||(A=!0,o.reject(D,H))});var F;return D}},{immediate:36}],38:[function(e,r,n){var a={};(0,e("./lib/utils/common").assign)(a,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),r.exports=a},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,r,n){var a=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),c=e("./zlib/messages"),g=e("./zlib/zstream"),_=Object.prototype.toString,y=0,b=-1,d=0,v=8;function u(p){if(!(this instanceof u))return new u(p);this.options=i.assign({level:b,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},p||{});var k=this.options;k.raw&&0<k.windowBits?k.windowBits=-k.windowBits:k.gzip&&0<k.windowBits&&k.windowBits<16&&(k.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new g,this.strm.avail_out=0;var C=a.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(C!==y)throw new Error(c[C]);if(k.header&&a.deflateSetHeader(this.strm,k.header),k.dictionary){var A;if(A=typeof k.dictionary=="string"?o.string2buf(k.dictionary):_.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(C=a.deflateSetDictionary(this.strm,A))!==y)throw new Error(c[C]);this._dict_set=!0}}function f(p,k){var C=new u(k);if(C.push(p,!0),C.err)throw C.msg||c[C.err];return C.result}u.prototype.push=function(p,k){var C,A,E=this.strm,D=this.options.chunkSize;if(this.ended)return!1;A=k===~~k?k:k===!0?4:0,typeof p=="string"?E.input=o.string2buf(p):_.call(p)==="[object ArrayBuffer]"?E.input=new Uint8Array(p):E.input=p,E.next_in=0,E.avail_in=E.input.length;do{if(E.avail_out===0&&(E.output=new i.Buf8(D),E.next_out=0,E.avail_out=D),(C=a.deflate(E,A))!==1&&C!==y)return this.onEnd(C),!(this.ended=!0);E.avail_out!==0&&(E.avail_in!==0||A!==4&&A!==2)||(this.options.to==="string"?this.onData(o.buf2binstring(i.shrinkBuf(E.output,E.next_out))):this.onData(i.shrinkBuf(E.output,E.next_out)))}while((0<E.avail_in||E.avail_out===0)&&C!==1);return A===4?(C=a.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===y):A!==2||(this.onEnd(y),!(E.avail_out=0))},u.prototype.onData=function(p){this.chunks.push(p)},u.prototype.onEnd=function(p){p===y&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},n.Deflate=u,n.deflate=f,n.deflateRaw=function(p,k){return(k=k||{}).raw=!0,f(p,k)},n.gzip=function(p,k){return(k=k||{}).gzip=!0,f(p,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,r,n){var a=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),c=e("./zlib/constants"),g=e("./zlib/messages"),_=e("./zlib/zstream"),y=e("./zlib/gzheader"),b=Object.prototype.toString;function d(u){if(!(this instanceof d))return new d(u);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},u||{});var f=this.options;f.raw&&0<=f.windowBits&&f.windowBits<16&&(f.windowBits=-f.windowBits,f.windowBits===0&&(f.windowBits=-15)),!(0<=f.windowBits&&f.windowBits<16)||u&&u.windowBits||(f.windowBits+=32),15<f.windowBits&&f.windowBits<48&&(15&f.windowBits)==0&&(f.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _,this.strm.avail_out=0;var p=a.inflateInit2(this.strm,f.windowBits);if(p!==c.Z_OK)throw new Error(g[p]);this.header=new y,a.inflateGetHeader(this.strm,this.header)}function v(u,f){var p=new d(f);if(p.push(u,!0),p.err)throw p.msg||g[p.err];return p.result}d.prototype.push=function(u,f){var p,k,C,A,E,D,F=this.strm,H=this.options.chunkSize,I=this.options.dictionary,$=!1;if(this.ended)return!1;k=f===~~f?f:f===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof u=="string"?F.input=o.binstring2buf(u):b.call(u)==="[object ArrayBuffer]"?F.input=new Uint8Array(u):F.input=u,F.next_in=0,F.avail_in=F.input.length;do{if(F.avail_out===0&&(F.output=new i.Buf8(H),F.next_out=0,F.avail_out=H),(p=a.inflate(F,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&I&&(D=typeof I=="string"?o.string2buf(I):b.call(I)==="[object ArrayBuffer]"?new Uint8Array(I):I,p=a.inflateSetDictionary(this.strm,D)),p===c.Z_BUF_ERROR&&$===!0&&(p=c.Z_OK,$=!1),p!==c.Z_STREAM_END&&p!==c.Z_OK)return this.onEnd(p),!(this.ended=!0);F.next_out&&(F.avail_out!==0&&p!==c.Z_STREAM_END&&(F.avail_in!==0||k!==c.Z_FINISH&&k!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=o.utf8border(F.output,F.next_out),A=F.next_out-C,E=o.buf2string(F.output,C),F.next_out=A,F.avail_out=H-A,A&&i.arraySet(F.output,F.output,C,A,0),this.onData(E)):this.onData(i.shrinkBuf(F.output,F.next_out)))),F.avail_in===0&&F.avail_out===0&&($=!0)}while((0<F.avail_in||F.avail_out===0)&&p!==c.Z_STREAM_END);return p===c.Z_STREAM_END&&(k=c.Z_FINISH),k===c.Z_FINISH?(p=a.inflateEnd(this.strm),this.onEnd(p),this.ended=!0,p===c.Z_OK):k!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(F.avail_out=0))},d.prototype.onData=function(u){this.chunks.push(u)},d.prototype.onEnd=function(u){u===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg},n.Inflate=d,n.inflate=v,n.inflateRaw=function(u,f){return(f=f||{}).raw=!0,v(u,f)},n.ungzip=v},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,r,n){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";n.assign=function(c){for(var g=Array.prototype.slice.call(arguments,1);g.length;){var _=g.shift();if(_){if(typeof _!="object")throw new TypeError(_+"must be non-object");for(var y in _)_.hasOwnProperty(y)&&(c[y]=_[y])}}return c},n.shrinkBuf=function(c,g){return c.length===g?c:c.subarray?c.subarray(0,g):(c.length=g,c)};var i={arraySet:function(c,g,_,y,b){if(g.subarray&&c.subarray)c.set(g.subarray(_,_+y),b);else for(var d=0;d<y;d++)c[b+d]=g[_+d]},flattenChunks:function(c){var g,_,y,b,d,v;for(g=y=0,_=c.length;g<_;g++)y+=c[g].length;for(v=new Uint8Array(y),g=b=0,_=c.length;g<_;g++)d=c[g],v.set(d,b),b+=d.length;return v}},o={arraySet:function(c,g,_,y,b){for(var d=0;d<y;d++)c[b+d]=g[_+d]},flattenChunks:function(c){return[].concat.apply([],c)}};n.setTyped=function(c){c?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(a)},{}],42:[function(e,r,n){var a=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var c=new a.Buf8(256),g=0;g<256;g++)c[g]=252<=g?6:248<=g?5:240<=g?4:224<=g?3:192<=g?2:1;function _(y,b){if(b<65537&&(y.subarray&&o||!y.subarray&&i))return String.fromCharCode.apply(null,a.shrinkBuf(y,b));for(var d="",v=0;v<b;v++)d+=String.fromCharCode(y[v]);return d}c[254]=c[254]=1,n.string2buf=function(y){var b,d,v,u,f,p=y.length,k=0;for(u=0;u<p;u++)(64512&(d=y.charCodeAt(u)))==55296&&u+1<p&&(64512&(v=y.charCodeAt(u+1)))==56320&&(d=65536+(d-55296<<10)+(v-56320),u++),k+=d<128?1:d<2048?2:d<65536?3:4;for(b=new a.Buf8(k),u=f=0;f<k;u++)(64512&(d=y.charCodeAt(u)))==55296&&u+1<p&&(64512&(v=y.charCodeAt(u+1)))==56320&&(d=65536+(d-55296<<10)+(v-56320),u++),d<128?b[f++]=d:(d<2048?b[f++]=192|d>>>6:(d<65536?b[f++]=224|d>>>12:(b[f++]=240|d>>>18,b[f++]=128|d>>>12&63),b[f++]=128|d>>>6&63),b[f++]=128|63&d);return b},n.buf2binstring=function(y){return _(y,y.length)},n.binstring2buf=function(y){for(var b=new a.Buf8(y.length),d=0,v=b.length;d<v;d++)b[d]=y.charCodeAt(d);return b},n.buf2string=function(y,b){var d,v,u,f,p=b||y.length,k=new Array(2*p);for(d=v=0;d<p;)if((u=y[d++])<128)k[v++]=u;else if(4<(f=c[u]))k[v++]=65533,d+=f-1;else{for(u&=f===2?31:f===3?15:7;1<f&&d<p;)u=u<<6|63&y[d++],f--;1<f?k[v++]=65533:u<65536?k[v++]=u:(u-=65536,k[v++]=55296|u>>10&1023,k[v++]=56320|1023&u)}return _(k,v)},n.utf8border=function(y,b){var d;for((b=b||y.length)>y.length&&(b=y.length),d=b-1;0<=d&&(192&y[d])==128;)d--;return d<0||d===0?b:d+c[y[d]]>b?d:b}},{"./common":41}],43:[function(e,r,n){r.exports=function(a,i,o,c){for(var g=65535&a|0,_=a>>>16&65535|0,y=0;o!==0;){for(o-=y=2e3<o?2e3:o;_=_+(g=g+i[c++]|0)|0,--y;);g%=65521,_%=65521}return g|_<<16|0}},{}],44:[function(e,r,n){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,r,n){var a=(function(){for(var i,o=[],c=0;c<256;c++){i=c;for(var g=0;g<8;g++)i=1&i?3988292384^i>>>1:i>>>1;o[c]=i}return o})();r.exports=function(i,o,c,g){var _=a,y=g+c;i^=-1;for(var b=g;b<y;b++)i=i>>>8^_[255&(i^o[b])];return-1^i}},{}],46:[function(e,r,n){var a,i=e("../utils/common"),o=e("./trees"),c=e("./adler32"),g=e("./crc32"),_=e("./messages"),y=0,b=4,d=0,v=-2,u=-1,f=4,p=2,k=8,C=9,A=286,E=30,D=19,F=2*A+1,H=15,I=3,$=258,G=$+I+1,S=42,M=113,h=1,O=2,te=3,W=4;function re(l,L){return l.msg=_[L],L}function Z(l){return(l<<1)-(4<l?9:0)}function ee(l){for(var L=l.length;0<=--L;)l[L]=0}function R(l){var L=l.state,z=L.pending;z>l.avail_out&&(z=l.avail_out),z!==0&&(i.arraySet(l.output,L.pending_buf,L.pending_out,z,l.next_out),l.next_out+=z,L.pending_out+=z,l.total_out+=z,l.avail_out-=z,L.pending-=z,L.pending===0&&(L.pending_out=0))}function B(l,L){o._tr_flush_block(l,0<=l.block_start?l.block_start:-1,l.strstart-l.block_start,L),l.block_start=l.strstart,R(l.strm)}function Q(l,L){l.pending_buf[l.pending++]=L}function Y(l,L){l.pending_buf[l.pending++]=L>>>8&255,l.pending_buf[l.pending++]=255&L}function q(l,L){var z,w,m=l.max_chain_length,P=l.strstart,j=l.prev_length,U=l.nice_match,N=l.strstart>l.w_size-G?l.strstart-(l.w_size-G):0,V=l.window,J=l.w_mask,X=l.prev,K=l.strstart+$,ce=V[P+j-1],se=V[P+j];l.prev_length>=l.good_match&&(m>>=2),U>l.lookahead&&(U=l.lookahead);do if(V[(z=L)+j]===se&&V[z+j-1]===ce&&V[z]===V[P]&&V[++z]===V[P+1]){P+=2,z++;do;while(V[++P]===V[++z]&&V[++P]===V[++z]&&V[++P]===V[++z]&&V[++P]===V[++z]&&V[++P]===V[++z]&&V[++P]===V[++z]&&V[++P]===V[++z]&&V[++P]===V[++z]&&P<K);if(w=$-(K-P),P=K-$,j<w){if(l.match_start=L,U<=(j=w))break;ce=V[P+j-1],se=V[P+j]}}while((L=X[L&J])>N&&--m!=0);return j<=l.lookahead?j:l.lookahead}function ue(l){var L,z,w,m,P,j,U,N,V,J,X=l.w_size;do{if(m=l.window_size-l.lookahead-l.strstart,l.strstart>=X+(X-G)){for(i.arraySet(l.window,l.window,X,X,0),l.match_start-=X,l.strstart-=X,l.block_start-=X,L=z=l.hash_size;w=l.head[--L],l.head[L]=X<=w?w-X:0,--z;);for(L=z=X;w=l.prev[--L],l.prev[L]=X<=w?w-X:0,--z;);m+=X}if(l.strm.avail_in===0)break;if(j=l.strm,U=l.window,N=l.strstart+l.lookahead,V=m,J=void 0,J=j.avail_in,V<J&&(J=V),z=J===0?0:(j.avail_in-=J,i.arraySet(U,j.input,j.next_in,J,N),j.state.wrap===1?j.adler=c(j.adler,U,J,N):j.state.wrap===2&&(j.adler=g(j.adler,U,J,N)),j.next_in+=J,j.total_in+=J,J),l.lookahead+=z,l.lookahead+l.insert>=I)for(P=l.strstart-l.insert,l.ins_h=l.window[P],l.ins_h=(l.ins_h<<l.hash_shift^l.window[P+1])&l.hash_mask;l.insert&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[P+I-1])&l.hash_mask,l.prev[P&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=P,P++,l.insert--,!(l.lookahead+l.insert<I)););}while(l.lookahead<G&&l.strm.avail_in!==0)}function ve(l,L){for(var z,w;;){if(l.lookahead<G){if(ue(l),l.lookahead<G&&L===y)return h;if(l.lookahead===0)break}if(z=0,l.lookahead>=I&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+I-1])&l.hash_mask,z=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),z!==0&&l.strstart-z<=l.w_size-G&&(l.match_length=q(l,z)),l.match_length>=I)if(w=o._tr_tally(l,l.strstart-l.match_start,l.match_length-I),l.lookahead-=l.match_length,l.match_length<=l.max_lazy_match&&l.lookahead>=I){for(l.match_length--;l.strstart++,l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+I-1])&l.hash_mask,z=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart,--l.match_length!=0;);l.strstart++}else l.strstart+=l.match_length,l.match_length=0,l.ins_h=l.window[l.strstart],l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+1])&l.hash_mask;else w=o._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++;if(w&&(B(l,!1),l.strm.avail_out===0))return h}return l.insert=l.strstart<I-1?l.strstart:I-1,L===b?(B(l,!0),l.strm.avail_out===0?te:W):l.last_lit&&(B(l,!1),l.strm.avail_out===0)?h:O}function ae(l,L){for(var z,w,m;;){if(l.lookahead<G){if(ue(l),l.lookahead<G&&L===y)return h;if(l.lookahead===0)break}if(z=0,l.lookahead>=I&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+I-1])&l.hash_mask,z=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),l.prev_length=l.match_length,l.prev_match=l.match_start,l.match_length=I-1,z!==0&&l.prev_length<l.max_lazy_match&&l.strstart-z<=l.w_size-G&&(l.match_length=q(l,z),l.match_length<=5&&(l.strategy===1||l.match_length===I&&4096<l.strstart-l.match_start)&&(l.match_length=I-1)),l.prev_length>=I&&l.match_length<=l.prev_length){for(m=l.strstart+l.lookahead-I,w=o._tr_tally(l,l.strstart-1-l.prev_match,l.prev_length-I),l.lookahead-=l.prev_length-1,l.prev_length-=2;++l.strstart<=m&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+I-1])&l.hash_mask,z=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),--l.prev_length!=0;);if(l.match_available=0,l.match_length=I-1,l.strstart++,w&&(B(l,!1),l.strm.avail_out===0))return h}else if(l.match_available){if((w=o._tr_tally(l,0,l.window[l.strstart-1]))&&B(l,!1),l.strstart++,l.lookahead--,l.strm.avail_out===0)return h}else l.match_available=1,l.strstart++,l.lookahead--}return l.match_available&&(w=o._tr_tally(l,0,l.window[l.strstart-1]),l.match_available=0),l.insert=l.strstart<I-1?l.strstart:I-1,L===b?(B(l,!0),l.strm.avail_out===0?te:W):l.last_lit&&(B(l,!1),l.strm.avail_out===0)?h:O}function oe(l,L,z,w,m){this.good_length=l,this.max_lazy=L,this.nice_length=z,this.max_chain=w,this.func=m}function ge(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=k,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*F),this.dyn_dtree=new i.Buf16(2*(2*E+1)),this.bl_tree=new i.Buf16(2*(2*D+1)),ee(this.dyn_ltree),ee(this.dyn_dtree),ee(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(H+1),this.heap=new i.Buf16(2*A+1),ee(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*A+1),ee(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function de(l){var L;return l&&l.state?(l.total_in=l.total_out=0,l.data_type=p,(L=l.state).pending=0,L.pending_out=0,L.wrap<0&&(L.wrap=-L.wrap),L.status=L.wrap?S:M,l.adler=L.wrap===2?0:1,L.last_flush=y,o._tr_init(L),d):re(l,v)}function Se(l){var L=de(l);return L===d&&(function(z){z.window_size=2*z.w_size,ee(z.head),z.max_lazy_match=a[z.level].max_lazy,z.good_match=a[z.level].good_length,z.nice_match=a[z.level].nice_length,z.max_chain_length=a[z.level].max_chain,z.strstart=0,z.block_start=0,z.lookahead=0,z.insert=0,z.match_length=z.prev_length=I-1,z.match_available=0,z.ins_h=0})(l.state),L}function _e(l,L,z,w,m,P){if(!l)return v;var j=1;if(L===u&&(L=6),w<0?(j=0,w=-w):15<w&&(j=2,w-=16),m<1||C<m||z!==k||w<8||15<w||L<0||9<L||P<0||f<P)return re(l,v);w===8&&(w=9);var U=new ge;return(l.state=U).strm=l,U.wrap=j,U.gzhead=null,U.w_bits=w,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=m+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+I-1)/I),U.window=new i.Buf8(2*U.w_size),U.head=new i.Buf16(U.hash_size),U.prev=new i.Buf16(U.w_size),U.lit_bufsize=1<<m+6,U.pending_buf_size=4*U.lit_bufsize,U.pending_buf=new i.Buf8(U.pending_buf_size),U.d_buf=1*U.lit_bufsize,U.l_buf=3*U.lit_bufsize,U.level=L,U.strategy=P,U.method=z,Se(l)}a=[new oe(0,0,0,0,function(l,L){var z=65535;for(z>l.pending_buf_size-5&&(z=l.pending_buf_size-5);;){if(l.lookahead<=1){if(ue(l),l.lookahead===0&&L===y)return h;if(l.lookahead===0)break}l.strstart+=l.lookahead,l.lookahead=0;var w=l.block_start+z;if((l.strstart===0||l.strstart>=w)&&(l.lookahead=l.strstart-w,l.strstart=w,B(l,!1),l.strm.avail_out===0)||l.strstart-l.block_start>=l.w_size-G&&(B(l,!1),l.strm.avail_out===0))return h}return l.insert=0,L===b?(B(l,!0),l.strm.avail_out===0?te:W):(l.strstart>l.block_start&&(B(l,!1),l.strm.avail_out),h)}),new oe(4,4,8,4,ve),new oe(4,5,16,8,ve),new oe(4,6,32,32,ve),new oe(4,4,16,16,ae),new oe(8,16,32,32,ae),new oe(8,16,128,128,ae),new oe(8,32,128,256,ae),new oe(32,128,258,1024,ae),new oe(32,258,258,4096,ae)],n.deflateInit=function(l,L){return _e(l,L,k,15,8,0)},n.deflateInit2=_e,n.deflateReset=Se,n.deflateResetKeep=de,n.deflateSetHeader=function(l,L){return l&&l.state?l.state.wrap!==2?v:(l.state.gzhead=L,d):v},n.deflate=function(l,L){var z,w,m,P;if(!l||!l.state||5<L||L<0)return l?re(l,v):v;if(w=l.state,!l.output||!l.input&&l.avail_in!==0||w.status===666&&L!==b)return re(l,l.avail_out===0?-5:v);if(w.strm=l,z=w.last_flush,w.last_flush=L,w.status===S)if(w.wrap===2)l.adler=0,Q(w,31),Q(w,139),Q(w,8),w.gzhead?(Q(w,(w.gzhead.text?1:0)+(w.gzhead.hcrc?2:0)+(w.gzhead.extra?4:0)+(w.gzhead.name?8:0)+(w.gzhead.comment?16:0)),Q(w,255&w.gzhead.time),Q(w,w.gzhead.time>>8&255),Q(w,w.gzhead.time>>16&255),Q(w,w.gzhead.time>>24&255),Q(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),Q(w,255&w.gzhead.os),w.gzhead.extra&&w.gzhead.extra.length&&(Q(w,255&w.gzhead.extra.length),Q(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(l.adler=g(l.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=69):(Q(w,0),Q(w,0),Q(w,0),Q(w,0),Q(w,0),Q(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),Q(w,3),w.status=M);else{var j=k+(w.w_bits-8<<4)<<8;j|=(2<=w.strategy||w.level<2?0:w.level<6?1:w.level===6?2:3)<<6,w.strstart!==0&&(j|=32),j+=31-j%31,w.status=M,Y(w,j),w.strstart!==0&&(Y(w,l.adler>>>16),Y(w,65535&l.adler)),l.adler=1}if(w.status===69)if(w.gzhead.extra){for(m=w.pending;w.gzindex<(65535&w.gzhead.extra.length)&&(w.pending!==w.pending_buf_size||(w.gzhead.hcrc&&w.pending>m&&(l.adler=g(l.adler,w.pending_buf,w.pending-m,m)),R(l),m=w.pending,w.pending!==w.pending_buf_size));)Q(w,255&w.gzhead.extra[w.gzindex]),w.gzindex++;w.gzhead.hcrc&&w.pending>m&&(l.adler=g(l.adler,w.pending_buf,w.pending-m,m)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=73)}else w.status=73;if(w.status===73)if(w.gzhead.name){m=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>m&&(l.adler=g(l.adler,w.pending_buf,w.pending-m,m)),R(l),m=w.pending,w.pending===w.pending_buf_size)){P=1;break}P=w.gzindex<w.gzhead.name.length?255&w.gzhead.name.charCodeAt(w.gzindex++):0,Q(w,P)}while(P!==0);w.gzhead.hcrc&&w.pending>m&&(l.adler=g(l.adler,w.pending_buf,w.pending-m,m)),P===0&&(w.gzindex=0,w.status=91)}else w.status=91;if(w.status===91)if(w.gzhead.comment){m=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>m&&(l.adler=g(l.adler,w.pending_buf,w.pending-m,m)),R(l),m=w.pending,w.pending===w.pending_buf_size)){P=1;break}P=w.gzindex<w.gzhead.comment.length?255&w.gzhead.comment.charCodeAt(w.gzindex++):0,Q(w,P)}while(P!==0);w.gzhead.hcrc&&w.pending>m&&(l.adler=g(l.adler,w.pending_buf,w.pending-m,m)),P===0&&(w.status=103)}else w.status=103;if(w.status===103&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&R(l),w.pending+2<=w.pending_buf_size&&(Q(w,255&l.adler),Q(w,l.adler>>8&255),l.adler=0,w.status=M)):w.status=M),w.pending!==0){if(R(l),l.avail_out===0)return w.last_flush=-1,d}else if(l.avail_in===0&&Z(L)<=Z(z)&&L!==b)return re(l,-5);if(w.status===666&&l.avail_in!==0)return re(l,-5);if(l.avail_in!==0||w.lookahead!==0||L!==y&&w.status!==666){var U=w.strategy===2?(function(N,V){for(var J;;){if(N.lookahead===0&&(ue(N),N.lookahead===0)){if(V===y)return h;break}if(N.match_length=0,J=o._tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++,J&&(B(N,!1),N.strm.avail_out===0))return h}return N.insert=0,V===b?(B(N,!0),N.strm.avail_out===0?te:W):N.last_lit&&(B(N,!1),N.strm.avail_out===0)?h:O})(w,L):w.strategy===3?(function(N,V){for(var J,X,K,ce,se=N.window;;){if(N.lookahead<=$){if(ue(N),N.lookahead<=$&&V===y)return h;if(N.lookahead===0)break}if(N.match_length=0,N.lookahead>=I&&0<N.strstart&&(X=se[K=N.strstart-1])===se[++K]&&X===se[++K]&&X===se[++K]){ce=N.strstart+$;do;while(X===se[++K]&&X===se[++K]&&X===se[++K]&&X===se[++K]&&X===se[++K]&&X===se[++K]&&X===se[++K]&&X===se[++K]&&K<ce);N.match_length=$-(ce-K),N.match_length>N.lookahead&&(N.match_length=N.lookahead)}if(N.match_length>=I?(J=o._tr_tally(N,1,N.match_length-I),N.lookahead-=N.match_length,N.strstart+=N.match_length,N.match_length=0):(J=o._tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++),J&&(B(N,!1),N.strm.avail_out===0))return h}return N.insert=0,V===b?(B(N,!0),N.strm.avail_out===0?te:W):N.last_lit&&(B(N,!1),N.strm.avail_out===0)?h:O})(w,L):a[w.level].func(w,L);if(U!==te&&U!==W||(w.status=666),U===h||U===te)return l.avail_out===0&&(w.last_flush=-1),d;if(U===O&&(L===1?o._tr_align(w):L!==5&&(o._tr_stored_block(w,0,0,!1),L===3&&(ee(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),R(l),l.avail_out===0))return w.last_flush=-1,d}return L!==b?d:w.wrap<=0?1:(w.wrap===2?(Q(w,255&l.adler),Q(w,l.adler>>8&255),Q(w,l.adler>>16&255),Q(w,l.adler>>24&255),Q(w,255&l.total_in),Q(w,l.total_in>>8&255),Q(w,l.total_in>>16&255),Q(w,l.total_in>>24&255)):(Y(w,l.adler>>>16),Y(w,65535&l.adler)),R(l),0<w.wrap&&(w.wrap=-w.wrap),w.pending!==0?d:1)},n.deflateEnd=function(l){var L;return l&&l.state?(L=l.state.status)!==S&&L!==69&&L!==73&&L!==91&&L!==103&&L!==M&&L!==666?re(l,v):(l.state=null,L===M?re(l,-3):d):v},n.deflateSetDictionary=function(l,L){var z,w,m,P,j,U,N,V,J=L.length;if(!l||!l.state||(P=(z=l.state).wrap)===2||P===1&&z.status!==S||z.lookahead)return v;for(P===1&&(l.adler=c(l.adler,L,J,0)),z.wrap=0,J>=z.w_size&&(P===0&&(ee(z.head),z.strstart=0,z.block_start=0,z.insert=0),V=new i.Buf8(z.w_size),i.arraySet(V,L,J-z.w_size,z.w_size,0),L=V,J=z.w_size),j=l.avail_in,U=l.next_in,N=l.input,l.avail_in=J,l.next_in=0,l.input=L,ue(z);z.lookahead>=I;){for(w=z.strstart,m=z.lookahead-(I-1);z.ins_h=(z.ins_h<<z.hash_shift^z.window[w+I-1])&z.hash_mask,z.prev[w&z.w_mask]=z.head[z.ins_h],z.head[z.ins_h]=w,w++,--m;);z.strstart=w,z.lookahead=I-1,ue(z)}return z.strstart+=z.lookahead,z.block_start=z.strstart,z.insert=z.lookahead,z.lookahead=0,z.match_length=z.prev_length=I-1,z.match_available=0,l.next_in=U,l.input=N,l.avail_in=j,z.wrap=P,d},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,r,n){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,r,n){r.exports=function(a,i){var o,c,g,_,y,b,d,v,u,f,p,k,C,A,E,D,F,H,I,$,G,S,M,h,O;o=a.state,c=a.next_in,h=a.input,g=c+(a.avail_in-5),_=a.next_out,O=a.output,y=_-(i-a.avail_out),b=_+(a.avail_out-257),d=o.dmax,v=o.wsize,u=o.whave,f=o.wnext,p=o.window,k=o.hold,C=o.bits,A=o.lencode,E=o.distcode,D=(1<<o.lenbits)-1,F=(1<<o.distbits)-1;e:do{C<15&&(k+=h[c++]<<C,C+=8,k+=h[c++]<<C,C+=8),H=A[k&D];t:for(;;){if(k>>>=I=H>>>24,C-=I,(I=H>>>16&255)===0)O[_++]=65535&H;else{if(!(16&I)){if((64&I)==0){H=A[(65535&H)+(k&(1<<I)-1)];continue t}if(32&I){o.mode=12;break e}a.msg="invalid literal/length code",o.mode=30;break e}$=65535&H,(I&=15)&&(C<I&&(k+=h[c++]<<C,C+=8),$+=k&(1<<I)-1,k>>>=I,C-=I),C<15&&(k+=h[c++]<<C,C+=8,k+=h[c++]<<C,C+=8),H=E[k&F];r:for(;;){if(k>>>=I=H>>>24,C-=I,!(16&(I=H>>>16&255))){if((64&I)==0){H=E[(65535&H)+(k&(1<<I)-1)];continue r}a.msg="invalid distance code",o.mode=30;break e}if(G=65535&H,C<(I&=15)&&(k+=h[c++]<<C,(C+=8)<I&&(k+=h[c++]<<C,C+=8)),d<(G+=k&(1<<I)-1)){a.msg="invalid distance too far back",o.mode=30;break e}if(k>>>=I,C-=I,(I=_-y)<G){if(u<(I=G-I)&&o.sane){a.msg="invalid distance too far back",o.mode=30;break e}if(M=p,(S=0)===f){if(S+=v-I,I<$){for($-=I;O[_++]=p[S++],--I;);S=_-G,M=O}}else if(f<I){if(S+=v+f-I,(I-=f)<$){for($-=I;O[_++]=p[S++],--I;);if(S=0,f<$){for($-=I=f;O[_++]=p[S++],--I;);S=_-G,M=O}}}else if(S+=f-I,I<$){for($-=I;O[_++]=p[S++],--I;);S=_-G,M=O}for(;2<$;)O[_++]=M[S++],O[_++]=M[S++],O[_++]=M[S++],$-=3;$&&(O[_++]=M[S++],1<$&&(O[_++]=M[S++]))}else{for(S=_-G;O[_++]=O[S++],O[_++]=O[S++],O[_++]=O[S++],2<($-=3););$&&(O[_++]=O[S++],1<$&&(O[_++]=O[S++]))}break}}break}}while(c<g&&_<b);c-=$=C>>3,k&=(1<<(C-=$<<3))-1,a.next_in=c,a.next_out=_,a.avail_in=c<g?g-c+5:5-(c-g),a.avail_out=_<b?b-_+257:257-(_-b),o.hold=k,o.bits=C}},{}],49:[function(e,r,n){var a=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),c=e("./inffast"),g=e("./inftrees"),_=1,y=2,b=0,d=-2,v=1,u=852,f=592;function p(S){return(S>>>24&255)+(S>>>8&65280)+((65280&S)<<8)+((255&S)<<24)}function k(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function C(S){var M;return S&&S.state?(M=S.state,S.total_in=S.total_out=M.total=0,S.msg="",M.wrap&&(S.adler=1&M.wrap),M.mode=v,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new a.Buf32(u),M.distcode=M.distdyn=new a.Buf32(f),M.sane=1,M.back=-1,b):d}function A(S){var M;return S&&S.state?((M=S.state).wsize=0,M.whave=0,M.wnext=0,C(S)):d}function E(S,M){var h,O;return S&&S.state?(O=S.state,M<0?(h=0,M=-M):(h=1+(M>>4),M<48&&(M&=15)),M&&(M<8||15<M)?d:(O.window!==null&&O.wbits!==M&&(O.window=null),O.wrap=h,O.wbits=M,A(S))):d}function D(S,M){var h,O;return S?(O=new k,(S.state=O).window=null,(h=E(S,M))!==b&&(S.state=null),h):d}var F,H,I=!0;function $(S){if(I){var M;for(F=new a.Buf32(512),H=new a.Buf32(32),M=0;M<144;)S.lens[M++]=8;for(;M<256;)S.lens[M++]=9;for(;M<280;)S.lens[M++]=7;for(;M<288;)S.lens[M++]=8;for(g(_,S.lens,0,288,F,0,S.work,{bits:9}),M=0;M<32;)S.lens[M++]=5;g(y,S.lens,0,32,H,0,S.work,{bits:5}),I=!1}S.lencode=F,S.lenbits=9,S.distcode=H,S.distbits=5}function G(S,M,h,O){var te,W=S.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new a.Buf8(W.wsize)),O>=W.wsize?(a.arraySet(W.window,M,h-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(O<(te=W.wsize-W.wnext)&&(te=O),a.arraySet(W.window,M,h-O,te,W.wnext),(O-=te)?(a.arraySet(W.window,M,h-O,O,0),W.wnext=O,W.whave=W.wsize):(W.wnext+=te,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=te))),0}n.inflateReset=A,n.inflateReset2=E,n.inflateResetKeep=C,n.inflateInit=function(S){return D(S,15)},n.inflateInit2=D,n.inflate=function(S,M){var h,O,te,W,re,Z,ee,R,B,Q,Y,q,ue,ve,ae,oe,ge,de,Se,_e,l,L,z,w,m=0,P=new a.Buf8(4),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!S||!S.state||!S.output||!S.input&&S.avail_in!==0)return d;(h=S.state).mode===12&&(h.mode=13),re=S.next_out,te=S.output,ee=S.avail_out,W=S.next_in,O=S.input,Z=S.avail_in,R=h.hold,B=h.bits,Q=Z,Y=ee,L=b;e:for(;;)switch(h.mode){case v:if(h.wrap===0){h.mode=13;break}for(;B<16;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}if(2&h.wrap&&R===35615){P[h.check=0]=255&R,P[1]=R>>>8&255,h.check=o(h.check,P,2,0),B=R=0,h.mode=2;break}if(h.flags=0,h.head&&(h.head.done=!1),!(1&h.wrap)||(((255&R)<<8)+(R>>8))%31){S.msg="incorrect header check",h.mode=30;break}if((15&R)!=8){S.msg="unknown compression method",h.mode=30;break}if(B-=4,l=8+(15&(R>>>=4)),h.wbits===0)h.wbits=l;else if(l>h.wbits){S.msg="invalid window size",h.mode=30;break}h.dmax=1<<l,S.adler=h.check=1,h.mode=512&R?10:12,B=R=0;break;case 2:for(;B<16;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}if(h.flags=R,(255&h.flags)!=8){S.msg="unknown compression method",h.mode=30;break}if(57344&h.flags){S.msg="unknown header flags set",h.mode=30;break}h.head&&(h.head.text=R>>8&1),512&h.flags&&(P[0]=255&R,P[1]=R>>>8&255,h.check=o(h.check,P,2,0)),B=R=0,h.mode=3;case 3:for(;B<32;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}h.head&&(h.head.time=R),512&h.flags&&(P[0]=255&R,P[1]=R>>>8&255,P[2]=R>>>16&255,P[3]=R>>>24&255,h.check=o(h.check,P,4,0)),B=R=0,h.mode=4;case 4:for(;B<16;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}h.head&&(h.head.xflags=255&R,h.head.os=R>>8),512&h.flags&&(P[0]=255&R,P[1]=R>>>8&255,h.check=o(h.check,P,2,0)),B=R=0,h.mode=5;case 5:if(1024&h.flags){for(;B<16;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}h.length=R,h.head&&(h.head.extra_len=R),512&h.flags&&(P[0]=255&R,P[1]=R>>>8&255,h.check=o(h.check,P,2,0)),B=R=0}else h.head&&(h.head.extra=null);h.mode=6;case 6:if(1024&h.flags&&(Z<(q=h.length)&&(q=Z),q&&(h.head&&(l=h.head.extra_len-h.length,h.head.extra||(h.head.extra=new Array(h.head.extra_len)),a.arraySet(h.head.extra,O,W,q,l)),512&h.flags&&(h.check=o(h.check,O,q,W)),Z-=q,W+=q,h.length-=q),h.length))break e;h.length=0,h.mode=7;case 7:if(2048&h.flags){if(Z===0)break e;for(q=0;l=O[W+q++],h.head&&l&&h.length<65536&&(h.head.name+=String.fromCharCode(l)),l&&q<Z;);if(512&h.flags&&(h.check=o(h.check,O,q,W)),Z-=q,W+=q,l)break e}else h.head&&(h.head.name=null);h.length=0,h.mode=8;case 8:if(4096&h.flags){if(Z===0)break e;for(q=0;l=O[W+q++],h.head&&l&&h.length<65536&&(h.head.comment+=String.fromCharCode(l)),l&&q<Z;);if(512&h.flags&&(h.check=o(h.check,O,q,W)),Z-=q,W+=q,l)break e}else h.head&&(h.head.comment=null);h.mode=9;case 9:if(512&h.flags){for(;B<16;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}if(R!==(65535&h.check)){S.msg="header crc mismatch",h.mode=30;break}B=R=0}h.head&&(h.head.hcrc=h.flags>>9&1,h.head.done=!0),S.adler=h.check=0,h.mode=12;break;case 10:for(;B<32;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}S.adler=h.check=p(R),B=R=0,h.mode=11;case 11:if(h.havedict===0)return S.next_out=re,S.avail_out=ee,S.next_in=W,S.avail_in=Z,h.hold=R,h.bits=B,2;S.adler=h.check=1,h.mode=12;case 12:if(M===5||M===6)break e;case 13:if(h.last){R>>>=7&B,B-=7&B,h.mode=27;break}for(;B<3;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}switch(h.last=1&R,B-=1,3&(R>>>=1)){case 0:h.mode=14;break;case 1:if($(h),h.mode=20,M!==6)break;R>>>=2,B-=2;break e;case 2:h.mode=17;break;case 3:S.msg="invalid block type",h.mode=30}R>>>=2,B-=2;break;case 14:for(R>>>=7&B,B-=7&B;B<32;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}if((65535&R)!=(R>>>16^65535)){S.msg="invalid stored block lengths",h.mode=30;break}if(h.length=65535&R,B=R=0,h.mode=15,M===6)break e;case 15:h.mode=16;case 16:if(q=h.length){if(Z<q&&(q=Z),ee<q&&(q=ee),q===0)break e;a.arraySet(te,O,W,q,re),Z-=q,W+=q,ee-=q,re+=q,h.length-=q;break}h.mode=12;break;case 17:for(;B<14;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}if(h.nlen=257+(31&R),R>>>=5,B-=5,h.ndist=1+(31&R),R>>>=5,B-=5,h.ncode=4+(15&R),R>>>=4,B-=4,286<h.nlen||30<h.ndist){S.msg="too many length or distance symbols",h.mode=30;break}h.have=0,h.mode=18;case 18:for(;h.have<h.ncode;){for(;B<3;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}h.lens[j[h.have++]]=7&R,R>>>=3,B-=3}for(;h.have<19;)h.lens[j[h.have++]]=0;if(h.lencode=h.lendyn,h.lenbits=7,z={bits:h.lenbits},L=g(0,h.lens,0,19,h.lencode,0,h.work,z),h.lenbits=z.bits,L){S.msg="invalid code lengths set",h.mode=30;break}h.have=0,h.mode=19;case 19:for(;h.have<h.nlen+h.ndist;){for(;oe=(m=h.lencode[R&(1<<h.lenbits)-1])>>>16&255,ge=65535&m,!((ae=m>>>24)<=B);){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}if(ge<16)R>>>=ae,B-=ae,h.lens[h.have++]=ge;else{if(ge===16){for(w=ae+2;B<w;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}if(R>>>=ae,B-=ae,h.have===0){S.msg="invalid bit length repeat",h.mode=30;break}l=h.lens[h.have-1],q=3+(3&R),R>>>=2,B-=2}else if(ge===17){for(w=ae+3;B<w;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}B-=ae,l=0,q=3+(7&(R>>>=ae)),R>>>=3,B-=3}else{for(w=ae+7;B<w;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}B-=ae,l=0,q=11+(127&(R>>>=ae)),R>>>=7,B-=7}if(h.have+q>h.nlen+h.ndist){S.msg="invalid bit length repeat",h.mode=30;break}for(;q--;)h.lens[h.have++]=l}}if(h.mode===30)break;if(h.lens[256]===0){S.msg="invalid code -- missing end-of-block",h.mode=30;break}if(h.lenbits=9,z={bits:h.lenbits},L=g(_,h.lens,0,h.nlen,h.lencode,0,h.work,z),h.lenbits=z.bits,L){S.msg="invalid literal/lengths set",h.mode=30;break}if(h.distbits=6,h.distcode=h.distdyn,z={bits:h.distbits},L=g(y,h.lens,h.nlen,h.ndist,h.distcode,0,h.work,z),h.distbits=z.bits,L){S.msg="invalid distances set",h.mode=30;break}if(h.mode=20,M===6)break e;case 20:h.mode=21;case 21:if(6<=Z&&258<=ee){S.next_out=re,S.avail_out=ee,S.next_in=W,S.avail_in=Z,h.hold=R,h.bits=B,c(S,Y),re=S.next_out,te=S.output,ee=S.avail_out,W=S.next_in,O=S.input,Z=S.avail_in,R=h.hold,B=h.bits,h.mode===12&&(h.back=-1);break}for(h.back=0;oe=(m=h.lencode[R&(1<<h.lenbits)-1])>>>16&255,ge=65535&m,!((ae=m>>>24)<=B);){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}if(oe&&(240&oe)==0){for(de=ae,Se=oe,_e=ge;oe=(m=h.lencode[_e+((R&(1<<de+Se)-1)>>de)])>>>16&255,ge=65535&m,!(de+(ae=m>>>24)<=B);){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}R>>>=de,B-=de,h.back+=de}if(R>>>=ae,B-=ae,h.back+=ae,h.length=ge,oe===0){h.mode=26;break}if(32&oe){h.back=-1,h.mode=12;break}if(64&oe){S.msg="invalid literal/length code",h.mode=30;break}h.extra=15&oe,h.mode=22;case 22:if(h.extra){for(w=h.extra;B<w;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}h.length+=R&(1<<h.extra)-1,R>>>=h.extra,B-=h.extra,h.back+=h.extra}h.was=h.length,h.mode=23;case 23:for(;oe=(m=h.distcode[R&(1<<h.distbits)-1])>>>16&255,ge=65535&m,!((ae=m>>>24)<=B);){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}if((240&oe)==0){for(de=ae,Se=oe,_e=ge;oe=(m=h.distcode[_e+((R&(1<<de+Se)-1)>>de)])>>>16&255,ge=65535&m,!(de+(ae=m>>>24)<=B);){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}R>>>=de,B-=de,h.back+=de}if(R>>>=ae,B-=ae,h.back+=ae,64&oe){S.msg="invalid distance code",h.mode=30;break}h.offset=ge,h.extra=15&oe,h.mode=24;case 24:if(h.extra){for(w=h.extra;B<w;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}h.offset+=R&(1<<h.extra)-1,R>>>=h.extra,B-=h.extra,h.back+=h.extra}if(h.offset>h.dmax){S.msg="invalid distance too far back",h.mode=30;break}h.mode=25;case 25:if(ee===0)break e;if(q=Y-ee,h.offset>q){if((q=h.offset-q)>h.whave&&h.sane){S.msg="invalid distance too far back",h.mode=30;break}ue=q>h.wnext?(q-=h.wnext,h.wsize-q):h.wnext-q,q>h.length&&(q=h.length),ve=h.window}else ve=te,ue=re-h.offset,q=h.length;for(ee<q&&(q=ee),ee-=q,h.length-=q;te[re++]=ve[ue++],--q;);h.length===0&&(h.mode=21);break;case 26:if(ee===0)break e;te[re++]=h.length,ee--,h.mode=21;break;case 27:if(h.wrap){for(;B<32;){if(Z===0)break e;Z--,R|=O[W++]<<B,B+=8}if(Y-=ee,S.total_out+=Y,h.total+=Y,Y&&(S.adler=h.check=h.flags?o(h.check,te,Y,re-Y):i(h.check,te,Y,re-Y)),Y=ee,(h.flags?R:p(R))!==h.check){S.msg="incorrect data check",h.mode=30;break}B=R=0}h.mode=28;case 28:if(h.wrap&&h.flags){for(;B<32;){if(Z===0)break e;Z--,R+=O[W++]<<B,B+=8}if(R!==(4294967295&h.total)){S.msg="incorrect length check",h.mode=30;break}B=R=0}h.mode=29;case 29:L=1;break e;case 30:L=-3;break e;case 31:return-4;case 32:default:return d}return S.next_out=re,S.avail_out=ee,S.next_in=W,S.avail_in=Z,h.hold=R,h.bits=B,(h.wsize||Y!==S.avail_out&&h.mode<30&&(h.mode<27||M!==4))&&G(S,S.output,S.next_out,Y-S.avail_out)?(h.mode=31,-4):(Q-=S.avail_in,Y-=S.avail_out,S.total_in+=Q,S.total_out+=Y,h.total+=Y,h.wrap&&Y&&(S.adler=h.check=h.flags?o(h.check,te,Y,S.next_out-Y):i(h.check,te,Y,S.next_out-Y)),S.data_type=h.bits+(h.last?64:0)+(h.mode===12?128:0)+(h.mode===20||h.mode===15?256:0),(Q==0&&Y===0||M===4)&&L===b&&(L=-5),L)},n.inflateEnd=function(S){if(!S||!S.state)return d;var M=S.state;return M.window&&(M.window=null),S.state=null,b},n.inflateGetHeader=function(S,M){var h;return S&&S.state?(2&(h=S.state).wrap)==0?d:((h.head=M).done=!1,b):d},n.inflateSetDictionary=function(S,M){var h,O=M.length;return S&&S.state?(h=S.state).wrap!==0&&h.mode!==11?d:h.mode===11&&i(1,M,O,0)!==h.check?-3:G(S,M,O,O)?(h.mode=31,-4):(h.havedict=1,b):d},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,r,n){var a=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],g=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(_,y,b,d,v,u,f,p){var k,C,A,E,D,F,H,I,$,G=p.bits,S=0,M=0,h=0,O=0,te=0,W=0,re=0,Z=0,ee=0,R=0,B=null,Q=0,Y=new a.Buf16(16),q=new a.Buf16(16),ue=null,ve=0;for(S=0;S<=15;S++)Y[S]=0;for(M=0;M<d;M++)Y[y[b+M]]++;for(te=G,O=15;1<=O&&Y[O]===0;O--);if(O<te&&(te=O),O===0)return v[u++]=20971520,v[u++]=20971520,p.bits=1,0;for(h=1;h<O&&Y[h]===0;h++);for(te<h&&(te=h),S=Z=1;S<=15;S++)if(Z<<=1,(Z-=Y[S])<0)return-1;if(0<Z&&(_===0||O!==1))return-1;for(q[1]=0,S=1;S<15;S++)q[S+1]=q[S]+Y[S];for(M=0;M<d;M++)y[b+M]!==0&&(f[q[y[b+M]]++]=M);if(F=_===0?(B=ue=f,19):_===1?(B=i,Q-=257,ue=o,ve-=257,256):(B=c,ue=g,-1),S=h,D=u,re=M=R=0,A=-1,E=(ee=1<<(W=te))-1,_===1&&852<ee||_===2&&592<ee)return 1;for(;;){for(H=S-re,$=f[M]<F?(I=0,f[M]):f[M]>F?(I=ue[ve+f[M]],B[Q+f[M]]):(I=96,0),k=1<<S-re,h=C=1<<W;v[D+(R>>re)+(C-=k)]=H<<24|I<<16|$|0,C!==0;);for(k=1<<S-1;R&k;)k>>=1;if(k!==0?(R&=k-1,R+=k):R=0,M++,--Y[S]==0){if(S===O)break;S=y[b+f[M]]}if(te<S&&(R&E)!==A){for(re===0&&(re=te),D+=h,Z=1<<(W=S-re);W+re<O&&!((Z-=Y[W+re])<=0);)W++,Z<<=1;if(ee+=1<<W,_===1&&852<ee||_===2&&592<ee)return 1;v[A=R&E]=te<<24|W<<16|D-u|0}}return R!==0&&(v[D+R]=S-re<<24|64<<16|0),p.bits=te,0}},{"../utils/common":41}],51:[function(e,r,n){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,r,n){var a=e("../utils/common"),i=0,o=1;function c(m){for(var P=m.length;0<=--P;)m[P]=0}var g=0,_=29,y=256,b=y+1+_,d=30,v=19,u=2*b+1,f=15,p=16,k=7,C=256,A=16,E=17,D=18,F=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],H=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],$=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],G=new Array(2*(b+2));c(G);var S=new Array(2*d);c(S);var M=new Array(512);c(M);var h=new Array(256);c(h);var O=new Array(_);c(O);var te,W,re,Z=new Array(d);function ee(m,P,j,U,N){this.static_tree=m,this.extra_bits=P,this.extra_base=j,this.elems=U,this.max_length=N,this.has_stree=m&&m.length}function R(m,P){this.dyn_tree=m,this.max_code=0,this.stat_desc=P}function B(m){return m<256?M[m]:M[256+(m>>>7)]}function Q(m,P){m.pending_buf[m.pending++]=255&P,m.pending_buf[m.pending++]=P>>>8&255}function Y(m,P,j){m.bi_valid>p-j?(m.bi_buf|=P<<m.bi_valid&65535,Q(m,m.bi_buf),m.bi_buf=P>>p-m.bi_valid,m.bi_valid+=j-p):(m.bi_buf|=P<<m.bi_valid&65535,m.bi_valid+=j)}function q(m,P,j){Y(m,j[2*P],j[2*P+1])}function ue(m,P){for(var j=0;j|=1&m,m>>>=1,j<<=1,0<--P;);return j>>>1}function ve(m,P,j){var U,N,V=new Array(f+1),J=0;for(U=1;U<=f;U++)V[U]=J=J+j[U-1]<<1;for(N=0;N<=P;N++){var X=m[2*N+1];X!==0&&(m[2*N]=ue(V[X]++,X))}}function ae(m){var P;for(P=0;P<b;P++)m.dyn_ltree[2*P]=0;for(P=0;P<d;P++)m.dyn_dtree[2*P]=0;for(P=0;P<v;P++)m.bl_tree[2*P]=0;m.dyn_ltree[2*C]=1,m.opt_len=m.static_len=0,m.last_lit=m.matches=0}function oe(m){8<m.bi_valid?Q(m,m.bi_buf):0<m.bi_valid&&(m.pending_buf[m.pending++]=m.bi_buf),m.bi_buf=0,m.bi_valid=0}function ge(m,P,j,U){var N=2*P,V=2*j;return m[N]<m[V]||m[N]===m[V]&&U[P]<=U[j]}function de(m,P,j){for(var U=m.heap[j],N=j<<1;N<=m.heap_len&&(N<m.heap_len&&ge(P,m.heap[N+1],m.heap[N],m.depth)&&N++,!ge(P,U,m.heap[N],m.depth));)m.heap[j]=m.heap[N],j=N,N<<=1;m.heap[j]=U}function Se(m,P,j){var U,N,V,J,X=0;if(m.last_lit!==0)for(;U=m.pending_buf[m.d_buf+2*X]<<8|m.pending_buf[m.d_buf+2*X+1],N=m.pending_buf[m.l_buf+X],X++,U===0?q(m,N,P):(q(m,(V=h[N])+y+1,P),(J=F[V])!==0&&Y(m,N-=O[V],J),q(m,V=B(--U),j),(J=H[V])!==0&&Y(m,U-=Z[V],J)),X<m.last_lit;);q(m,C,P)}function _e(m,P){var j,U,N,V=P.dyn_tree,J=P.stat_desc.static_tree,X=P.stat_desc.has_stree,K=P.stat_desc.elems,ce=-1;for(m.heap_len=0,m.heap_max=u,j=0;j<K;j++)V[2*j]!==0?(m.heap[++m.heap_len]=ce=j,m.depth[j]=0):V[2*j+1]=0;for(;m.heap_len<2;)V[2*(N=m.heap[++m.heap_len]=ce<2?++ce:0)]=1,m.depth[N]=0,m.opt_len--,X&&(m.static_len-=J[2*N+1]);for(P.max_code=ce,j=m.heap_len>>1;1<=j;j--)de(m,V,j);for(N=K;j=m.heap[1],m.heap[1]=m.heap[m.heap_len--],de(m,V,1),U=m.heap[1],m.heap[--m.heap_max]=j,m.heap[--m.heap_max]=U,V[2*N]=V[2*j]+V[2*U],m.depth[N]=(m.depth[j]>=m.depth[U]?m.depth[j]:m.depth[U])+1,V[2*j+1]=V[2*U+1]=N,m.heap[1]=N++,de(m,V,1),2<=m.heap_len;);m.heap[--m.heap_max]=m.heap[1],(function(se,we){var Fe,xe,Ie,fe,Ge,st,Ce=we.dyn_tree,Dt=we.max_code,En=we.stat_desc.static_tree,Nn=we.stat_desc.has_stree,Bn=we.stat_desc.extra_bits,Lt=we.stat_desc.extra_base,Oe=we.stat_desc.max_length,Xe=0;for(fe=0;fe<=f;fe++)se.bl_count[fe]=0;for(Ce[2*se.heap[se.heap_max]+1]=0,Fe=se.heap_max+1;Fe<u;Fe++)Oe<(fe=Ce[2*Ce[2*(xe=se.heap[Fe])+1]+1]+1)&&(fe=Oe,Xe++),Ce[2*xe+1]=fe,Dt<xe||(se.bl_count[fe]++,Ge=0,Lt<=xe&&(Ge=Bn[xe-Lt]),st=Ce[2*xe],se.opt_len+=st*(fe+Ge),Nn&&(se.static_len+=st*(En[2*xe+1]+Ge)));if(Xe!==0){do{for(fe=Oe-1;se.bl_count[fe]===0;)fe--;se.bl_count[fe]--,se.bl_count[fe+1]+=2,se.bl_count[Oe]--,Xe-=2}while(0<Xe);for(fe=Oe;fe!==0;fe--)for(xe=se.bl_count[fe];xe!==0;)Dt<(Ie=se.heap[--Fe])||(Ce[2*Ie+1]!==fe&&(se.opt_len+=(fe-Ce[2*Ie+1])*Ce[2*Ie],Ce[2*Ie+1]=fe),xe--)}})(m,P),ve(V,ce,m.bl_count)}function l(m,P,j){var U,N,V=-1,J=P[1],X=0,K=7,ce=4;for(J===0&&(K=138,ce=3),P[2*(j+1)+1]=65535,U=0;U<=j;U++)N=J,J=P[2*(U+1)+1],++X<K&&N===J||(X<ce?m.bl_tree[2*N]+=X:N!==0?(N!==V&&m.bl_tree[2*N]++,m.bl_tree[2*A]++):X<=10?m.bl_tree[2*E]++:m.bl_tree[2*D]++,V=N,ce=(X=0)===J?(K=138,3):N===J?(K=6,3):(K=7,4))}function L(m,P,j){var U,N,V=-1,J=P[1],X=0,K=7,ce=4;for(J===0&&(K=138,ce=3),U=0;U<=j;U++)if(N=J,J=P[2*(U+1)+1],!(++X<K&&N===J)){if(X<ce)for(;q(m,N,m.bl_tree),--X!=0;);else N!==0?(N!==V&&(q(m,N,m.bl_tree),X--),q(m,A,m.bl_tree),Y(m,X-3,2)):X<=10?(q(m,E,m.bl_tree),Y(m,X-3,3)):(q(m,D,m.bl_tree),Y(m,X-11,7));V=N,ce=(X=0)===J?(K=138,3):N===J?(K=6,3):(K=7,4)}}c(Z);var z=!1;function w(m,P,j,U){Y(m,(g<<1)+(U?1:0),3),(function(N,V,J,X){oe(N),Q(N,J),Q(N,~J),a.arraySet(N.pending_buf,N.window,V,J,N.pending),N.pending+=J})(m,P,j)}n._tr_init=function(m){z||((function(){var P,j,U,N,V,J=new Array(f+1);for(N=U=0;N<_-1;N++)for(O[N]=U,P=0;P<1<<F[N];P++)h[U++]=N;for(h[U-1]=N,N=V=0;N<16;N++)for(Z[N]=V,P=0;P<1<<H[N];P++)M[V++]=N;for(V>>=7;N<d;N++)for(Z[N]=V<<7,P=0;P<1<<H[N]-7;P++)M[256+V++]=N;for(j=0;j<=f;j++)J[j]=0;for(P=0;P<=143;)G[2*P+1]=8,P++,J[8]++;for(;P<=255;)G[2*P+1]=9,P++,J[9]++;for(;P<=279;)G[2*P+1]=7,P++,J[7]++;for(;P<=287;)G[2*P+1]=8,P++,J[8]++;for(ve(G,b+1,J),P=0;P<d;P++)S[2*P+1]=5,S[2*P]=ue(P,5);te=new ee(G,F,y+1,b,f),W=new ee(S,H,0,d,f),re=new ee(new Array(0),I,0,v,k)})(),z=!0),m.l_desc=new R(m.dyn_ltree,te),m.d_desc=new R(m.dyn_dtree,W),m.bl_desc=new R(m.bl_tree,re),m.bi_buf=0,m.bi_valid=0,ae(m)},n._tr_stored_block=w,n._tr_flush_block=function(m,P,j,U){var N,V,J=0;0<m.level?(m.strm.data_type===2&&(m.strm.data_type=(function(X){var K,ce=4093624447;for(K=0;K<=31;K++,ce>>>=1)if(1&ce&&X.dyn_ltree[2*K]!==0)return i;if(X.dyn_ltree[18]!==0||X.dyn_ltree[20]!==0||X.dyn_ltree[26]!==0)return o;for(K=32;K<y;K++)if(X.dyn_ltree[2*K]!==0)return o;return i})(m)),_e(m,m.l_desc),_e(m,m.d_desc),J=(function(X){var K;for(l(X,X.dyn_ltree,X.l_desc.max_code),l(X,X.dyn_dtree,X.d_desc.max_code),_e(X,X.bl_desc),K=v-1;3<=K&&X.bl_tree[2*$[K]+1]===0;K--);return X.opt_len+=3*(K+1)+5+5+4,K})(m),N=m.opt_len+3+7>>>3,(V=m.static_len+3+7>>>3)<=N&&(N=V)):N=V=j+5,j+4<=N&&P!==-1?w(m,P,j,U):m.strategy===4||V===N?(Y(m,2+(U?1:0),3),Se(m,G,S)):(Y(m,4+(U?1:0),3),(function(X,K,ce,se){var we;for(Y(X,K-257,5),Y(X,ce-1,5),Y(X,se-4,4),we=0;we<se;we++)Y(X,X.bl_tree[2*$[we]+1],3);L(X,X.dyn_ltree,K-1),L(X,X.dyn_dtree,ce-1)})(m,m.l_desc.max_code+1,m.d_desc.max_code+1,J+1),Se(m,m.dyn_ltree,m.dyn_dtree)),ae(m),U&&oe(m)},n._tr_tally=function(m,P,j){return m.pending_buf[m.d_buf+2*m.last_lit]=P>>>8&255,m.pending_buf[m.d_buf+2*m.last_lit+1]=255&P,m.pending_buf[m.l_buf+m.last_lit]=255&j,m.last_lit++,P===0?m.dyn_ltree[2*j]++:(m.matches++,P--,m.dyn_ltree[2*(h[j]+y+1)]++,m.dyn_dtree[2*B(P)]++),m.last_lit===m.lit_bufsize-1},n._tr_align=function(m){Y(m,2,3),q(m,C,G),(function(P){P.bi_valid===16?(Q(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):8<=P.bi_valid&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)})(m)}},{"../utils/common":41}],53:[function(e,r,n){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,r,n){(function(a){(function(i,o){if(!i.setImmediate){var c,g,_,y,b=1,d={},v=!1,u=i.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(i);f=f&&f.setTimeout?f:i,c={}.toString.call(i.process)==="[object process]"?function(A){process.nextTick(function(){k(A)})}:(function(){if(i.postMessage&&!i.importScripts){var A=!0,E=i.onmessage;return i.onmessage=function(){A=!1},i.postMessage("","*"),i.onmessage=E,A}})()?(y="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",C,!1):i.attachEvent("onmessage",C),function(A){i.postMessage(y+A,"*")}):i.MessageChannel?((_=new MessageChannel).port1.onmessage=function(A){k(A.data)},function(A){_.port2.postMessage(A)}):u&&"onreadystatechange"in u.createElement("script")?(g=u.documentElement,function(A){var E=u.createElement("script");E.onreadystatechange=function(){k(A),E.onreadystatechange=null,g.removeChild(E),E=null},g.appendChild(E)}):function(A){setTimeout(k,0,A)},f.setImmediate=function(A){typeof A!="function"&&(A=new Function(""+A));for(var E=new Array(arguments.length-1),D=0;D<E.length;D++)E[D]=arguments[D+1];var F={callback:A,args:E};return d[b]=F,c(b),b++},f.clearImmediate=p}function p(A){delete d[A]}function k(A){if(v)setTimeout(k,0,A);else{var E=d[A];if(E){v=!0;try{(function(D){var F=D.callback,H=D.args;switch(H.length){case 0:F();break;case 1:F(H[0]);break;case 2:F(H[0],H[1]);break;case 3:F(H[0],H[1],H[2]);break;default:F.apply(o,H)}})(E)}finally{p(A),v=!1}}}}function C(A){A.source===i&&typeof A.data=="string"&&A.data.indexOf(y)===0&&k(+A.data.slice(y.length))}})(typeof self>"u"?a===void 0?this:a:self)}).call(this,typeof De<"u"?De:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(qe)),qe.exports}var Ut=jt();const Ht=$t(Ut);/*
13
13
  * @license
14
14
  * docx-preview <https://github.com/VolodymyrBaydalka/docxjs>
15
15
  * Released under Apache License 2.0 <https://github.com/VolodymyrBaydalka/docxjs/blob/master/LICENSE>
16
16
  * Copyright Volodymyr Baydalka
17
- */var ht;(function(s){s.OfficeDocument="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",s.FontTable="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",s.Image="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",s.Numbering="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",s.Styles="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",s.StylesWithEffects="http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects",s.Theme="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",s.Settings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",s.WebSettings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",s.Hyperlink="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",s.Footnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",s.Endnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",s.Footer="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",s.Header="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",s.ExtendedProperties="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",s.CoreProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",s.CustomProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/custom-properties",s.Comments="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",s.CommentsExtended="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",s.AltChunk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk"})(ht||(ht={}));function je(s,e){return e.elements(s).map(t=>({id:e.attr(t,"Id"),type:e.attr(t,"Type"),target:e.attr(t,"Target"),targetMode:e.attr(t,"TargetMode")}))}function $e(s){return s==null?void 0:s.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()}function Gt(s){return/^[^"'].*\s.*[^"']$/.test(s)?`'${s}'`:s}function Lt(s){let e=s.lastIndexOf("/")+1,t=e==0?"":s.substring(0,e),r=e==0?s:s.substring(e);return[t,r]}function Xt(s,e){try{const t="http://docx/";return new URL(s,t+e).toString().substring(t.length)}catch{return`${e}${s}`}}function Pt(s,e){return s.reduce((t,r)=>(t[e(r)]=r,t),{})}function Ue(s){return new Promise((e,t)=>{const r=new FileReader;r.onloadend=()=>e(r.result),r.onerror=()=>t(),r.readAsDataURL(s)})}function qt(s){return s&&typeof s=="object"&&!Array.isArray(s)}function Yt(s){return typeof s=="string"||s instanceof String}function jt(s,...e){if(!e.length)return s;const t=e.shift();if(qt(s)&&qt(t))for(const r in t)if(qt(t[r])){const n=s[r]??(s[r]={});jt(n,t[r])}else s[r]=t[r];return jt(s,...e)}function Mt(s){return Array.isArray(s)?s:[s]}function He(s,e,t){return e>s?e:t<s?t:s}const ae={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},pt={Dxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt",min:.25,max:12},Point:{mul:1,unit:"pt"},Percent:{mul:.02,unit:"%"}};function se(s,e=pt.Dxa){if(s==null||/.+(p[xt]|[%])$/.test(s))return s;var t=parseInt(s)*e.mul;return e.min&&e.max&&(t=He(t,e.min,e.max)),`${t.toFixed(2)}${e.unit}`}function We(s,e=!1){switch(s){case"1":return!0;case"0":return!1;case"on":return!0;case"off":return!1;case"true":return!0;case"false":return!1;default:return e}}function ie(s,e,t){if(s.namespaceURI!=ae.wordml)return!1;switch(s.localName){case"color":e.color=t.attr(s,"val");break;case"sz":e.fontSize=t.lengthAttr(s,"val",pt.FontSize);break;default:return!1}return!0}function Ze(s,e=!1){e&&(s=s.replace(/<[?].*[?]>/,"")),s=Ge(s);const t=new DOMParser().parseFromString(s,"application/xml"),r=Ve(t);if(r)throw new Error(r);return t}function Ve(s){var e;return(e=s.getElementsByTagName("parsererror")[0])==null?void 0:e.textContent}function Ge(s){return s.charCodeAt(0)===65279?s.substring(1):s}function Xe(s){return new XMLSerializer().serializeToString(s)}class oe{elements(e,t=null){const r=[];for(let n=0,a=e.childNodes.length;n<a;n++){let i=e.childNodes.item(n);i.nodeType==Node.ELEMENT_NODE&&(t==null||i.localName==t)&&r.push(i)}return r}element(e,t){for(let r=0,n=e.childNodes.length;r<n;r++){let a=e.childNodes.item(r);if(a.nodeType==1&&a.localName==t)return a}return null}elementAttr(e,t,r){var n=this.element(e,t);return n?this.attr(n,r):void 0}attrs(e){return Array.from(e.attributes)}attr(e,t){for(let r=0,n=e.attributes.length;r<n;r++){let a=e.attributes.item(r);if(a.localName==t)return a.value}return null}intAttr(e,t,r=null){var n=this.attr(e,t);return n?parseInt(n):r}hexAttr(e,t,r=null){var n=this.attr(e,t);return n?parseInt(n,16):r}floatAttr(e,t,r=null){var n=this.attr(e,t);return n?parseFloat(n):r}boolAttr(e,t,r=null){return We(this.attr(e,t),r)}lengthAttr(e,t,r=pt.Dxa){return se(this.attr(e,t),r)}}const x=new oe;class kt{constructor(e,t){this._package=e,this.path=t}async load(){this.rels=await this._package.loadRelationships(this.path);const e=await this._package.load(this.path),t=this._package.parseXmlDocument(e);this._package.options.keepOrigin&&(this._xmlDocument=t),this.parseXml(t.firstElementChild)}save(){this._package.update(this.path,Xe(this._xmlDocument))}parseXml(e){}}const qe={embedRegular:"regular",embedBold:"bold",embedItalic:"italic",embedBoldItalic:"boldItalic"};function Ye(s,e){return e.elements(s).map(t=>Je(t,e))}function Je(s,e){let t={name:e.attr(s,"name"),embedFontRefs:[]};for(let r of e.elements(s))switch(r.localName){case"family":t.family=e.attr(r,"val");break;case"altName":t.altName=e.attr(r,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":t.embedFontRefs.push(Ke(r,e));break}return t}function Ke(s,e){return{id:e.attr(s,"id"),key:e.attr(s,"fontKey"),type:qe[s.localName]}}class Qe extends kt{parseXml(e){this.fonts=Ye(e,this._package.xmlParser)}}function tr(s,e){return e.elements(s).map(t=>({extension:e.attr(t,"Extension"),partName:e.attr(t,"PartName"),contentType:e.attr(t,"ContentType")}))}class Jt{constructor(e,t){this._zip=e,this.options=t,this.xmlParser=new oe}get(e){const t=er(e);return this._zip.files[t]??this._zip.files[t.replace(/\//g,"\\")]}update(e,t){this._zip.file(e,t)}static async load(e,t){const r=await Le.loadAsync(e);return new Jt(r,t)}save(e="blob"){return this._zip.generateAsync({type:e})}load(e,t="string"){var r;return((r=this.get(e))==null?void 0:r.async(t))??Promise.resolve(null)}async loadRelationships(e=null){let t="_rels/.rels";if(e!=null){const[n,a]=Lt(e);t=`${n}_rels/${a}.rels`}const r=await this.load(t);return r?je(this.parseXmlDocument(r).firstElementChild,this.xmlParser):null}async loadContentTypes(){const e=await this.load("[Content_Types].xml");return e?tr(this.parseXmlDocument(e).firstElementChild,this.xmlParser):[]}parseXmlDocument(e){return Ze(e,this.options.trimXmlDeclaration)}}function er(s){return s.startsWith("/")?s.substr(1):s}class rr extends kt{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.body=this._documentParser.parseDocumentFile(e)}}function $t(s,e){return{type:e.attr(s,"val"),color:e.attr(s,"color"),size:e.lengthAttr(s,"sz",pt.Border),offset:e.lengthAttr(s,"space",pt.Point),frame:e.boolAttr(s,"frame"),shadow:e.boolAttr(s,"shadow")}}function nr(s,e){var t={};for(let r of e.elements(s))switch(r.localName){case"left":t.left=$t(r,e);break;case"top":t.top=$t(r,e);break;case"right":t.right=$t(r,e);break;case"bottom":t.bottom=$t(r,e);break}return t}var le;(function(s){s.Continuous="continuous",s.NextPage="nextPage",s.NextColumn="nextColumn",s.EvenPage="evenPage",s.OddPage="oddPage"})(le||(le={}));function ce(s,e=x){var t={};for(let r of e.elements(s))switch(r.localName){case"pgSz":t.pageSize={width:e.lengthAttr(r,"w"),height:e.lengthAttr(r,"h"),orientation:e.attr(r,"orient")};break;case"type":t.type=e.attr(r,"val");break;case"pgMar":t.pageMargins={left:e.lengthAttr(r,"left"),right:e.lengthAttr(r,"right"),top:e.lengthAttr(r,"top"),bottom:e.lengthAttr(r,"bottom"),header:e.lengthAttr(r,"header"),footer:e.lengthAttr(r,"footer"),gutter:e.lengthAttr(r,"gutter")};break;case"cols":t.columns=ar(r,e);break;case"headerReference":(t.headerRefs??(t.headerRefs=[])).push(he(r,e));break;case"footerReference":(t.footerRefs??(t.footerRefs=[])).push(he(r,e));break;case"titlePg":t.titlePage=e.boolAttr(r,"val",!0);break;case"pgBorders":t.pageBorders=nr(r,e);break;case"pgNumType":t.pageNumber=sr(r,e);break}return t}function ar(s,e){return{numberOfColumns:e.intAttr(s,"num"),space:e.lengthAttr(s,"space"),separator:e.boolAttr(s,"sep"),equalWidth:e.boolAttr(s,"equalWidth",!0),columns:e.elements(s,"col").map(t=>({width:e.lengthAttr(t,"w"),space:e.lengthAttr(t,"space")}))}}function sr(s,e){return{chapSep:e.attr(s,"chapSep"),chapStyle:e.attr(s,"chapStyle"),format:e.attr(s,"fmt"),start:e.intAttr(s,"start")}}function he(s,e){return{id:e.attr(s,"id"),type:e.attr(s,"type")}}function ir(s,e){return{before:e.lengthAttr(s,"before"),after:e.lengthAttr(s,"after"),line:e.intAttr(s,"line"),lineRule:e.attr(s,"lineRule")}}function Kt(s,e){let t={};for(let r of e.elements(s))or(r,t,e);return t}function or(s,e,t){return!!ie(s,e,t)}function ue(s,e){let t={};for(let r of e.elements(s))de(r,t,e);return t}function de(s,e,t){if(s.namespaceURI!=ae.wordml)return!1;if(ie(s,e,t))return!0;switch(s.localName){case"tabs":e.tabs=lr(s,t);break;case"sectPr":e.sectionProps=ce(s,t);break;case"numPr":e.numbering=cr(s,t);break;case"spacing":return e.lineSpacing=ir(s,t),!1;case"textAlignment":return e.textAlignment=t.attr(s,"val"),!1;case"keepLines":e.keepLines=t.boolAttr(s,"val",!0);break;case"keepNext":e.keepNext=t.boolAttr(s,"val",!0);break;case"pageBreakBefore":e.pageBreakBefore=t.boolAttr(s,"val",!0);break;case"outlineLvl":e.outlineLevel=t.intAttr(s,"val");break;case"pStyle":e.styleName=t.attr(s,"val");break;case"rPr":e.runProps=Kt(s,t);break;default:return!1}return!0}function lr(s,e){return e.elements(s,"tab").map(t=>({position:e.lengthAttr(t,"pos"),leader:e.attr(t,"leader"),style:e.attr(t,"val")}))}function cr(s,e){var t={};for(let r of e.elements(s))switch(r.localName){case"numId":t.id=e.attr(r,"val");break;case"ilvl":t.level=e.intAttr(r,"val");break}return t}function hr(s,e){let t={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let r of e.elements(s))switch(r.localName){case"num":t.numberings.push(ur(r,e));break;case"abstractNum":t.abstractNumberings.push(dr(r,e));break;case"numPicBullet":t.bulletPictures.push(pr(r,e));break}return t}function ur(s,e){let t={id:e.attr(s,"numId"),overrides:[]};for(let r of e.elements(s))switch(r.localName){case"abstractNumId":t.abstractId=e.attr(r,"val");break;case"lvlOverride":t.overrides.push(fr(r,e));break}return t}function dr(s,e){let t={id:e.attr(s,"abstractNumId"),levels:[]};for(let r of e.elements(s))switch(r.localName){case"name":t.name=e.attr(r,"val");break;case"multiLevelType":t.multiLevelType=e.attr(r,"val");break;case"numStyleLink":t.numberingStyleLink=e.attr(r,"val");break;case"styleLink":t.styleLink=e.attr(r,"val");break;case"lvl":t.levels.push(fe(r,e));break}return t}function fe(s,e){let t={level:e.intAttr(s,"ilvl")};for(let r of e.elements(s))switch(r.localName){case"start":t.start=e.attr(r,"val");break;case"lvlRestart":t.restart=e.intAttr(r,"val");break;case"numFmt":t.format=e.attr(r,"val");break;case"lvlText":t.text=e.attr(r,"val");break;case"lvlJc":t.justification=e.attr(r,"val");break;case"lvlPicBulletId":t.bulletPictureId=e.attr(r,"val");break;case"pStyle":t.paragraphStyle=e.attr(r,"val");break;case"pPr":t.paragraphProps=ue(r,e);break;case"rPr":t.runProps=Kt(r,e);break}return t}function fr(s,e){let t={level:e.intAttr(s,"ilvl")};for(let r of e.elements(s))switch(r.localName){case"startOverride":t.start=e.intAttr(r,"val");break;case"lvl":t.numberingLevel=fe(r,e);break}return t}function pr(s,e){var t=e.element(s,"pict"),r=t&&e.element(t,"shape"),n=r&&e.element(r,"imagedata");return n?{id:e.attr(s,"numPicBulletId"),referenceId:e.attr(n,"id"),style:e.attr(r,"style")}:null}class mr extends kt{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){Object.assign(this,hr(e,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(e)}}class gr extends kt{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.styles=this._documentParser.parseStylesFile(e)}}var B;(function(s){s.Document="document",s.Paragraph="paragraph",s.Run="run",s.Break="break",s.NoBreakHyphen="noBreakHyphen",s.Table="table",s.Row="row",s.Cell="cell",s.Hyperlink="hyperlink",s.SmartTag="smartTag",s.Drawing="drawing",s.Image="image",s.Text="text",s.Tab="tab",s.Symbol="symbol",s.BookmarkStart="bookmarkStart",s.BookmarkEnd="bookmarkEnd",s.Footer="footer",s.Header="header",s.FootnoteReference="footnoteReference",s.EndnoteReference="endnoteReference",s.Footnote="footnote",s.Endnote="endnote",s.SimpleField="simpleField",s.ComplexField="complexField",s.Instruction="instruction",s.VmlPicture="vmlPicture",s.MmlMath="mmlMath",s.MmlMathParagraph="mmlMathParagraph",s.MmlFraction="mmlFraction",s.MmlFunction="mmlFunction",s.MmlFunctionName="mmlFunctionName",s.MmlNumerator="mmlNumerator",s.MmlDenominator="mmlDenominator",s.MmlRadical="mmlRadical",s.MmlBase="mmlBase",s.MmlDegree="mmlDegree",s.MmlSuperscript="mmlSuperscript",s.MmlSubscript="mmlSubscript",s.MmlPreSubSuper="mmlPreSubSuper",s.MmlSubArgument="mmlSubArgument",s.MmlSuperArgument="mmlSuperArgument",s.MmlNary="mmlNary",s.MmlDelimiter="mmlDelimiter",s.MmlRun="mmlRun",s.MmlEquationArray="mmlEquationArray",s.MmlLimit="mmlLimit",s.MmlLimitLower="mmlLimitLower",s.MmlMatrix="mmlMatrix",s.MmlMatrixRow="mmlMatrixRow",s.MmlBox="mmlBox",s.MmlBar="mmlBar",s.MmlGroupChar="mmlGroupChar",s.VmlElement="vmlElement",s.Inserted="inserted",s.Deleted="deleted",s.DeletedText="deletedText",s.Comment="comment",s.CommentReference="commentReference",s.CommentRangeStart="commentRangeStart",s.CommentRangeEnd="commentRangeEnd",s.AltChunk="altChunk"})(B||(B={}));class At{constructor(){this.children=[],this.cssStyle={}}}class br extends At{constructor(){super(...arguments),this.type=B.Header}}class vr extends At{constructor(){super(...arguments),this.type=B.Footer}}class pe extends kt{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(e)}}class yr extends pe{createRootElement(){return new br}}class kr extends pe{createRootElement(){return new vr}}function wr(s,e){const t={};for(let r of e.elements(s))switch(r.localName){case"Template":t.template=r.textContent;break;case"Pages":t.pages=Bt(r.textContent);break;case"Words":t.words=Bt(r.textContent);break;case"Characters":t.characters=Bt(r.textContent);break;case"Application":t.application=r.textContent;break;case"Lines":t.lines=Bt(r.textContent);break;case"Paragraphs":t.paragraphs=Bt(r.textContent);break;case"Company":t.company=r.textContent;break;case"AppVersion":t.appVersion=r.textContent;break}return t}function Bt(s){if(!(typeof s>"u"))return parseInt(s)}class _r extends kt{parseXml(e){this.props=wr(e,this._package.xmlParser)}}function Sr(s,e){const t={};for(let r of e.elements(s))switch(r.localName){case"title":t.title=r.textContent;break;case"description":t.description=r.textContent;break;case"subject":t.subject=r.textContent;break;case"creator":t.creator=r.textContent;break;case"keywords":t.keywords=r.textContent;break;case"language":t.language=r.textContent;break;case"lastModifiedBy":t.lastModifiedBy=r.textContent;break;case"revision":r.textContent&&(t.revision=parseInt(r.textContent));break}return t}class xr extends kt{parseXml(e){this.props=Sr(e,this._package.xmlParser)}}class Cr{}function Pr(s,e){var t=new Cr,r=e.element(s,"themeElements");for(let n of e.elements(r))switch(n.localName){case"clrScheme":t.colorScheme=Ar(n,e);break;case"fontScheme":t.fontScheme=Er(n,e);break}return t}function Ar(s,e){var t={name:e.attr(s,"name"),colors:{}};for(let a of e.elements(s)){var r=e.element(a,"srgbClr"),n=e.element(a,"sysClr");r?t.colors[a.localName]=e.attr(r,"val"):n&&(t.colors[a.localName]=e.attr(n,"lastClr"))}return t}function Er(s,e){var t={name:e.attr(s,"name")};for(let r of e.elements(s))switch(r.localName){case"majorFont":t.majorFont=me(r,e);break;case"minorFont":t.minorFont=me(r,e);break}return t}function me(s,e){return{latinTypeface:e.elementAttr(s,"latin","typeface"),eaTypeface:e.elementAttr(s,"ea","typeface"),csTypeface:e.elementAttr(s,"cs","typeface")}}class Nr extends kt{constructor(e,t){super(e,t)}parseXml(e){this.theme=Pr(e,this._package.xmlParser)}}class ge{}class Mr extends ge{constructor(){super(...arguments),this.type=B.Footnote}}class Br extends ge{constructor(){super(...arguments),this.type=B.Endnote}}class be extends kt{constructor(e,t,r){super(e,t),this._documentParser=r}}class Tr extends be{constructor(e,t,r){super(e,t,r)}parseXml(e){this.notes=this._documentParser.parseNotes(e,"footnote",Mr)}}class Rr extends be{constructor(e,t,r){super(e,t,r)}parseXml(e){this.notes=this._documentParser.parseNotes(e,"endnote",Br)}}function zr(s,e){var t={};for(let r of e.elements(s))switch(r.localName){case"defaultTabStop":t.defaultTabStop=e.lengthAttr(r,"val");break;case"footnotePr":t.footnoteProps=ve(r,e);break;case"endnotePr":t.endnoteProps=ve(r,e);break;case"autoHyphenation":t.autoHyphenation=e.boolAttr(r,"val");break;case"evenAndOddHeaders":t.evenAndOddHeaders=e.boolAttr(r,"val",!0);break}return t}function ve(s,e){var t={defaultNoteIds:[]};for(let r of e.elements(s))switch(r.localName){case"numFmt":t.nummeringFormat=e.attr(r,"val");break;case"footnote":case"endnote":t.defaultNoteIds.push(e.attr(r,"id"));break}return t}class Fr extends kt{constructor(e,t){super(e,t)}parseXml(e){this.settings=zr(e,this._package.xmlParser)}}function Ir(s,e){return e.elements(s,"property").map(t=>{const r=t.firstChild;return{formatId:e.attr(t,"fmtid"),name:e.attr(t,"name"),type:r.nodeName,value:r.textContent}})}class Or extends kt{parseXml(e){this.props=Ir(e,this._package.xmlParser)}}class Dr extends kt{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.comments=this._documentParser.parseComments(e),this.commentMap=Pt(this.comments,t=>t.id)}}class Lr extends kt{constructor(e,t){super(e,t),this.comments=[]}parseXml(e){const t=this._package.xmlParser;for(let r of t.elements(e,"commentEx"))this.comments.push({paraId:t.attr(r,"paraId"),paraIdParent:t.attr(r,"paraIdParent"),done:t.boolAttr(r,"done")});this.commentMap=Pt(this.comments,r=>r.paraId)}}const jr=[{type:ht.OfficeDocument,target:"word/document.xml"},{type:ht.ExtendedProperties,target:"docProps/app.xml"},{type:ht.CoreProperties,target:"docProps/core.xml"},{type:ht.CustomProperties,target:"docProps/custom.xml"}];class Qt{constructor(){this.parts=[],this.partsMap={},this.contentTypes=[]}static async load(e,t,r){var n=new Qt;return n._options=r,n._parser=t,n._package=await Jt.load(e,r),n.rels=await n._package.loadRelationships(),n.contentTypes=await n._package.loadContentTypes(),await Promise.all(jr.map(a=>{const i=n.rels.find(l=>l.type===a.type)??a;return n.loadRelationshipPart(i.target,i.type)})),n}save(e="blob"){return this._package.save(e)}async loadRelationshipPart(e,t){var n;if(this.partsMap[e])return this.partsMap[e];if(!this._package.get(e))return null;let r=null;switch(t){case ht.OfficeDocument:this.documentPart=r=new rr(this._package,e,this._parser);break;case ht.FontTable:this.fontTablePart=r=new Qe(this._package,e);break;case ht.Numbering:this.numberingPart=r=new mr(this._package,e,this._parser);break;case ht.Styles:this.stylesPart=r=new gr(this._package,e,this._parser);break;case ht.Theme:this.themePart=r=new Nr(this._package,e);break;case ht.Footnotes:this.footnotesPart=r=new Tr(this._package,e,this._parser);break;case ht.Endnotes:this.endnotesPart=r=new Rr(this._package,e,this._parser);break;case ht.Footer:r=new kr(this._package,e,this._parser);break;case ht.Header:r=new yr(this._package,e,this._parser);break;case ht.CoreProperties:this.corePropsPart=r=new xr(this._package,e);break;case ht.ExtendedProperties:this.extendedPropsPart=r=new _r(this._package,e);break;case ht.CustomProperties:r=new Or(this._package,e);break;case ht.Settings:this.settingsPart=r=new Fr(this._package,e);break;case ht.Comments:this.commentsPart=r=new Dr(this._package,e,this._parser);break;case ht.CommentsExtended:this.commentsExtendedPart=r=new Lr(this._package,e);break}if(r==null)return Promise.resolve(null);if(this.partsMap[e]=r,this.parts.push(r),await r.load(),((n=r.rels)==null?void 0:n.length)>0){const[a]=Lt(r.path);await Promise.all(r.rels.map(i=>this.loadRelationshipPart(Xt(i.target,a),i.type)))}return r}async loadDocumentImage(e,t){const r=this.getPathById(t??this.documentPart,e);return r?this.blobToURL(await this._package.load(r,"blob"),r):null}async loadNumberingImage(e){const t=this.getPathById(this.numberingPart,e);return t?this.blobToURL(await this._package.load(t,"blob"),t):null}async loadFont(e,t){const r=this.getPathById(this.fontTablePart,e);if(!r)return null;const n=await this._package.load(r,"uint8array");return n&&this.blobToURL(new Blob([$r(n,t)]),r)}async loadAltChunk(e,t){const r=this.getPathById(t??this.documentPart,e);return r?this._package.load(r,"string"):Promise.resolve(null)}blobToURL(e,t){if(!e)return null;if(t){const r=this.contentTypes.find(n=>n.partName===t||n.extension&&t.endsWith(`.${n.extension}`));e=r?new Blob([e],{type:r.contentType}):e}return this._options.useBase64URL?Ue(e):URL.createObjectURL(e)}findPartByRelId(e,t=null){var r=(t.rels??this.rels).find(a=>a.id==e);const n=t?Lt(t.path)[0]:"";return r?this.partsMap[Xt(r.target,n)]:null}getPathById(e,t){const r=e.rels.find(a=>a.id==t),[n]=Lt(e.path);return r?Xt(r.target,n):null}}function $r(s,e){const r=e.replace(/{|}|-/g,""),n=new Array(16);for(let a=0;a<16;a++)n[16-a-1]=parseInt(r.substring(a*2,a*2+2),16);for(let a=0;a<32;a++)s[a]=s[a]^n[a%16];return s}function Ur(s,e){return{type:B.BookmarkStart,id:e.attr(s,"id"),name:e.attr(s,"name"),colFirst:e.intAttr(s,"colFirst"),colLast:e.intAttr(s,"colLast")}}function Hr(s,e){return{type:B.BookmarkEnd,id:e.attr(s,"id")}}class Wr extends At{constructor(){super(...arguments),this.type=B.VmlElement,this.attrs={}}}function ye(s,e){var t=new Wr;switch(s.localName){case"rect":t.tagName="rect",Object.assign(t.attrs,{width:"100%",height:"100%"});break;case"oval":t.tagName="ellipse",Object.assign(t.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":t.tagName="line";break;case"shape":t.tagName="g";break;case"textbox":t.tagName="foreignObject",Object.assign(t.attrs,{width:"100%",height:"100%"});break;default:return null}for(const r of x.attrs(s))switch(r.localName){case"style":t.cssStyleText=r.value;break;case"fillcolor":t.attrs.fill=r.value;break;case"from":const[n,a]=ke(r.value);Object.assign(t.attrs,{x1:n,y1:a});break;case"to":const[i,l]=ke(r.value);Object.assign(t.attrs,{x2:i,y2:l});break}for(const r of x.elements(s))switch(r.localName){case"stroke":Object.assign(t.attrs,Zr(r));break;case"fill":Object.assign(t.attrs,Vr());break;case"imagedata":t.tagName="image",Object.assign(t.attrs,{width:"100%",height:"100%"}),t.imageHref={id:x.attr(r,"id"),title:x.attr(r,"title")};break;case"txbxContent":t.children.push(...e.parseBodyElements(r));break;default:const n=ye(r,e);n&&t.children.push(n);break}return t}function Zr(s){return{stroke:x.attr(s,"color"),"stroke-width":x.lengthAttr(s,"weight",pt.Emu)??"1px"}}function Vr(s){return{}}function ke(s){return s.split(",")}class Gr extends At{constructor(){super(...arguments),this.type=B.Comment}}class Xr extends At{constructor(e){super(),this.id=e,this.type=B.CommentReference}}class qr extends At{constructor(e){super(),this.id=e,this.type=B.CommentRangeStart}}class Yr extends At{constructor(e){super(),this.id=e,this.type=B.CommentRangeEnd}}var Ut={shd:"inherit",color:"black",borderColor:"black",highlight:"transparent"};const Jr=[],we={oMath:B.MmlMath,oMathPara:B.MmlMathParagraph,f:B.MmlFraction,func:B.MmlFunction,fName:B.MmlFunctionName,num:B.MmlNumerator,den:B.MmlDenominator,rad:B.MmlRadical,deg:B.MmlDegree,e:B.MmlBase,sSup:B.MmlSuperscript,sSub:B.MmlSubscript,sPre:B.MmlPreSubSuper,sup:B.MmlSuperArgument,sub:B.MmlSubArgument,d:B.MmlDelimiter,nary:B.MmlNary,eqArr:B.MmlEquationArray,lim:B.MmlLimit,limLow:B.MmlLimitLower,m:B.MmlMatrix,mr:B.MmlMatrixRow,box:B.MmlBox,bar:B.MmlBar,groupChr:B.MmlGroupChar};class Kr{constructor(e){this.options={ignoreWidth:!1,debug:!1,...e}}parseNotes(e,t,r){var n=[];for(let a of x.elements(e,t)){const i=new r;i.id=x.attr(a,"id"),i.noteType=x.attr(a,"type"),i.children=this.parseBodyElements(a),n.push(i)}return n}parseComments(e){var t=[];for(let r of x.elements(e,"comment")){const n=new Gr;n.id=x.attr(r,"id"),n.author=x.attr(r,"author"),n.initials=x.attr(r,"initials"),n.date=x.attr(r,"date"),n.children=this.parseBodyElements(r),t.push(n)}return t}parseDocumentFile(e){var t=x.element(e,"body"),r=x.element(e,"background"),n=x.element(t,"sectPr");return{type:B.Document,children:this.parseBodyElements(t),props:n?ce(n,x):{},cssStyle:r?this.parseBackground(r):{}}}parseBackground(e){var t={},r=Et.colorAttr(e,"color");return r&&(t["background-color"]=r),t}parseBodyElements(e){var t=[];for(const r of x.elements(e))switch(r.localName){case"p":t.push(this.parseParagraph(r));break;case"altChunk":t.push(this.parseAltChunk(r));break;case"tbl":t.push(this.parseTable(r));break;case"sdt":t.push(...this.parseSdt(r,n=>this.parseBodyElements(n)));break}return t}parseStylesFile(e){var t=[];for(const r of x.elements(e))switch(r.localName){case"style":t.push(this.parseStyle(r));break;case"docDefaults":t.push(this.parseDefaultStyles(r));break}return t}parseDefaultStyles(e){var t={id:null,name:null,target:null,basedOn:null,styles:[]};for(const a of x.elements(e))switch(a.localName){case"rPrDefault":var r=x.element(a,"rPr");r&&t.styles.push({target:"span",values:this.parseDefaultProperties(r,{})});break;case"pPrDefault":var n=x.element(a,"pPr");n&&t.styles.push({target:"p",values:this.parseDefaultProperties(n,{})});break}return t}parseStyle(e){var t={id:x.attr(e,"styleId"),isDefault:x.boolAttr(e,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch(x.attr(e,"type")){case"paragraph":t.target="p";break;case"table":t.target="table";break;case"character":t.target="span";break}for(const r of x.elements(e))switch(r.localName){case"basedOn":t.basedOn=x.attr(r,"val");break;case"name":t.name=x.attr(r,"val");break;case"link":t.linked=x.attr(r,"val");break;case"next":t.next=x.attr(r,"val");break;case"aliases":t.aliases=x.attr(r,"val").split(",");break;case"pPr":t.styles.push({target:"p",values:this.parseDefaultProperties(r,{})}),t.paragraphProps=ue(r,x);break;case"rPr":t.styles.push({target:"span",values:this.parseDefaultProperties(r,{})}),t.runProps=Kt(r,x);break;case"tblPr":case"tcPr":t.styles.push({target:"td",values:this.parseDefaultProperties(r,{})});break;case"tblStylePr":for(let n of this.parseTableStyle(r))t.styles.push(n);break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:this.options.debug&&console.warn(`DOCX: Unknown style element: ${r.localName}`)}return t}parseTableStyle(e){var t=[],r=x.attr(e,"type"),n="",a="";switch(r){case"firstRow":a=".first-row",n="tr.first-row td";break;case"lastRow":a=".last-row",n="tr.last-row td";break;case"firstCol":a=".first-col",n="td.first-col";break;case"lastCol":a=".last-col",n="td.last-col";break;case"band1Vert":a=":not(.no-vband)",n="td.odd-col";break;case"band2Vert":a=":not(.no-vband)",n="td.even-col";break;case"band1Horz":a=":not(.no-hband)",n="tr.odd-row";break;case"band2Horz":a=":not(.no-hband)",n="tr.even-row";break;default:return[]}for(const i of x.elements(e))switch(i.localName){case"pPr":t.push({target:`${n} p`,mod:a,values:this.parseDefaultProperties(i,{})});break;case"rPr":t.push({target:`${n} span`,mod:a,values:this.parseDefaultProperties(i,{})});break;case"tblPr":case"tcPr":t.push({target:n,mod:a,values:this.parseDefaultProperties(i,{})});break}return t}parseNumberingFile(e){const t=[],r=[],n=[];for(const a of x.elements(e))switch(a.localName){case"abstractNum":t.push(...this.parseAbstractNumbering(a,n));break;case"numPicBullet":n.push(this.parseNumberingPicBullet(a));break;case"num":r.push({numId:x.attr(a,"numId"),abstractNumId:x.elementAttr(a,"abstractNumId","val")});break}return r.flatMap(a=>t.filter(i=>a.abstractNumId==i.id).map(i=>({...i,id:a.numId})))}parseNumberingPicBullet(e){var t=x.element(e,"pict"),r=t&&x.element(t,"shape"),n=r&&x.element(r,"imagedata");return n?{id:x.intAttr(e,"numPicBulletId"),src:x.attr(n,"id"),style:x.attr(r,"style")}:null}parseAbstractNumbering(e,t){var r=[],n=x.attr(e,"abstractNumId");for(const a of x.elements(e))switch(a.localName){case"lvl":r.push(this.parseNumberingLevel(n,a,t));break}return r}parseNumberingLevel(e,t,r){var n={id:e,level:x.intAttr(t,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};for(const i of x.elements(t))switch(i.localName){case"start":n.start=x.intAttr(i,"val");break;case"pPr":this.parseDefaultProperties(i,n.pStyle);break;case"rPr":this.parseDefaultProperties(i,n.rStyle);break;case"lvlPicBulletId":var a=x.intAttr(i,"val");n.bullet=r.find(l=>(l==null?void 0:l.id)==a);break;case"lvlText":n.levelText=x.attr(i,"val");break;case"pStyle":n.pStyleName=x.attr(i,"val");break;case"numFmt":n.format=x.attr(i,"val");break;case"suff":n.suff=x.attr(i,"val");break}return n}parseSdt(e,t){const r=x.element(e,"sdtContent");return r?t(r):[]}parseChange(e,t,r){var n;return{type:e,children:((n=r(t))==null?void 0:n.children)??[],id:x.attr(t,"id"),author:x.attr(t,"author"),date:x.attr(t,"date")}}parseAltChunk(e){return{type:B.AltChunk,children:[],id:x.attr(e,"id")}}parseParagraph(e){var t={type:B.Paragraph,children:[]};for(let r of x.elements(e))switch(r.localName){case"pPr":this.parseParagraphProperties(r,t);break;case"r":t.children.push(this.parseRun(r,t));break;case"hyperlink":t.children.push(this.parseHyperlink(r,t));break;case"smartTag":t.children.push(this.parseSmartTag(r,t));break;case"bookmarkStart":t.children.push(Ur(r,x));break;case"bookmarkEnd":t.children.push(Hr(r,x));break;case"commentRangeStart":t.children.push(new qr(x.attr(r,"id")));break;case"commentRangeEnd":t.children.push(new Yr(x.attr(r,"id")));break;case"oMath":case"oMathPara":t.children.push(this.parseMathElement(r));break;case"sdt":t.children.push(...this.parseSdt(r,n=>this.parseParagraph(n).children));break;case"ins":t.children.push(this.parseChange(B.Inserted,r,n=>this.parseParagraph(n)));break;case"del":t.children.push(this.parseChange(B.Deleted,r,n=>this.parseParagraph(n)));break}return t}parseParagraphProperties(e,t){this.parseDefaultProperties(e,t.cssStyle={},null,r=>{if(de(r,t,x))return!0;switch(r.localName){case"pStyle":t.styleName=x.attr(r,"val");break;case"cnfStyle":t.className=lt.classNameOfCnfStyle(r);break;case"framePr":this.parseFrame(r,t);break;case"rPr":break;default:return!1}return!0})}parseFrame(e,t){var r=x.attr(e,"dropCap");r=="drop"&&(t.cssStyle.float="left")}parseHyperlink(e,t){var r={type:B.Hyperlink,parent:t,children:[]};r.anchor=x.attr(e,"anchor"),r.id=x.attr(e,"id");for(const n of x.elements(e))switch(n.localName){case"r":r.children.push(this.parseRun(n,r));break}return r}parseSmartTag(e,t){var r={type:B.SmartTag,parent:t,children:[]},n=x.attr(e,"uri"),a=x.attr(e,"element");n&&(r.uri=n),a&&(r.element=a);for(const i of x.elements(e))switch(i.localName){case"r":r.children.push(this.parseRun(i,r));break;case"smartTag":r.children.push(this.parseSmartTag(i,r));break}return r}parseRun(e,t){var r={type:B.Run,parent:t,children:[]};for(let n of x.elements(e))switch(n=this.checkAlternateContent(n),n==null?void 0:n.localName){case"t":r.children.push({type:B.Text,text:n.textContent});break;case"delText":r.children.push({type:B.DeletedText,text:n.textContent});break;case"commentReference":r.children.push(new Xr(x.attr(n,"id")));break;case"fldSimple":r.children.push({type:B.SimpleField,instruction:x.attr(n,"instr"),lock:x.boolAttr(n,"lock",!1),dirty:x.boolAttr(n,"dirty",!1)});break;case"instrText":r.fieldRun=!0,r.children.push({type:B.Instruction,text:n.textContent});break;case"fldChar":r.fieldRun=!0,r.children.push({type:B.ComplexField,charType:x.attr(n,"fldCharType"),lock:x.boolAttr(n,"lock",!1),dirty:x.boolAttr(n,"dirty",!1)});break;case"noBreakHyphen":r.children.push({type:B.NoBreakHyphen});break;case"br":r.children.push({type:B.Break,break:x.attr(n,"type")||"textWrapping"});break;case"lastRenderedPageBreak":r.children.push({type:B.Break,break:"lastRenderedPageBreak"});break;case"sym":r.children.push({type:B.Symbol,font:Gt(x.attr(n,"font")),char:x.hexAttr(n,"char")});break;case"tab":r.children.push({type:B.Tab});break;case"footnoteReference":r.children.push({type:B.FootnoteReference,id:x.attr(n,"id")});break;case"endnoteReference":r.children.push({type:B.EndnoteReference,id:x.attr(n,"id")});break;case"drawing":let a=this.parseDrawing(n);a&&r.children.push(a);break;case"pict":r.children.push(this.parseVmlPicture(n));break;case"rPr":this.parseRunProperties(n,r);break}return r}parseMathElement(e){const t=`${e.localName}Pr`,r={type:we[e.localName],children:[]};for(const a of x.elements(e))if(we[a.localName])r.children.push(this.parseMathElement(a));else if(a.localName=="r"){var n=this.parseRun(a);n.type=B.MmlRun,r.children.push(n)}else a.localName==t&&(r.props=this.parseMathProperies(a));return r}parseMathProperies(e){const t={};for(const r of x.elements(e))switch(r.localName){case"chr":t.char=x.attr(r,"val");break;case"vertJc":t.verticalJustification=x.attr(r,"val");break;case"pos":t.position=x.attr(r,"val");break;case"degHide":t.hideDegree=x.boolAttr(r,"val");break;case"begChr":t.beginChar=x.attr(r,"val");break;case"endChr":t.endChar=x.attr(r,"val");break}return t}parseRunProperties(e,t){this.parseDefaultProperties(e,t.cssStyle={},null,r=>{switch(r.localName){case"rStyle":t.styleName=x.attr(r,"val");break;case"vertAlign":t.verticalAlign=lt.valueOfVertAlign(r,!0);break;default:return!1}return!0})}parseVmlPicture(e){const t={type:B.VmlPicture,children:[]};for(const r of x.elements(e)){const n=ye(r,this);n&&t.children.push(n)}return t}checkAlternateContent(e){var a;if(e.localName!="AlternateContent")return e;var t=x.element(e,"Choice");if(t){var r=x.attr(t,"Requires"),n=e.lookupNamespaceURI(r);if(Jr.includes(n))return t.firstElementChild}return(a=x.element(e,"Fallback"))==null?void 0:a.firstElementChild}parseDrawing(e){for(var t of x.elements(e))switch(t.localName){case"inline":case"anchor":return this.parseDrawingWrapper(t)}}parseDrawingWrapper(e){var t={type:B.Drawing,children:[],cssStyle:{}},r=e.localName=="anchor";let n=null,a=x.boolAttr(e,"simplePos");x.boolAttr(e,"behindDoc");let i={relative:"page",align:"left",offset:"0"},l={relative:"page",align:"top",offset:"0"};for(var c of x.elements(e))switch(c.localName){case"simplePos":a&&(i.offset=x.lengthAttr(c,"x",pt.Emu),l.offset=x.lengthAttr(c,"y",pt.Emu));break;case"extent":t.cssStyle.width=x.lengthAttr(c,"cx",pt.Emu),t.cssStyle.height=x.lengthAttr(c,"cy",pt.Emu);break;case"positionH":case"positionV":if(!a){let y=c.localName=="positionH"?i:l;var g=x.element(c,"align"),_=x.element(c,"posOffset");y.relative=x.attr(c,"relativeFrom")??y.relative,g&&(y.align=g.textContent),_&&(y.offset=se(_.textContent,pt.Emu))}break;case"wrapTopAndBottom":n="wrapTopAndBottom";break;case"wrapNone":n="wrapNone";break;case"graphic":var v=this.parseGraphic(c);v&&t.children.push(v);break}return n=="wrapTopAndBottom"?(t.cssStyle.display="block",i.align&&(t.cssStyle["text-align"]=i.align,t.cssStyle.width="100%")):n=="wrapNone"?(t.cssStyle.display="block",t.cssStyle.position="relative",t.cssStyle.width="0px",t.cssStyle.height="0px",i.offset&&(t.cssStyle.left=i.offset),l.offset&&(t.cssStyle.top=l.offset)):r&&(i.align=="left"||i.align=="right")&&(t.cssStyle.float=i.align),t}parseGraphic(e){var t=x.element(e,"graphicData");for(let r of x.elements(t))switch(r.localName){case"pic":return this.parsePicture(r)}return null}parsePicture(e){var t={type:B.Image,src:"",cssStyle:{}},r=x.element(e,"blipFill"),n=x.element(r,"blip"),a=x.element(r,"srcRect");t.src=x.attr(n,"embed"),a&&(t.srcRect=[x.intAttr(a,"l",0)/1e5,x.intAttr(a,"t",0)/1e5,x.intAttr(a,"r",0)/1e5,x.intAttr(a,"b",0)/1e5]);var i=x.element(e,"spPr"),l=x.element(i,"xfrm");if(t.cssStyle.position="relative",l){t.rotation=x.intAttr(l,"rot",0)/6e4;for(var c of x.elements(l))switch(c.localName){case"ext":t.cssStyle.width=x.lengthAttr(c,"cx",pt.Emu),t.cssStyle.height=x.lengthAttr(c,"cy",pt.Emu);break;case"off":t.cssStyle.left=x.lengthAttr(c,"x",pt.Emu),t.cssStyle.top=x.lengthAttr(c,"y",pt.Emu);break}}return t}parseTable(e){var t={type:B.Table,children:[]};for(const r of x.elements(e))switch(r.localName){case"tr":t.children.push(this.parseTableRow(r));break;case"tblGrid":t.columns=this.parseTableColumns(r);break;case"tblPr":this.parseTableProperties(r,t);break}return t}parseTableColumns(e){var t=[];for(const r of x.elements(e))switch(r.localName){case"gridCol":t.push({width:x.lengthAttr(r,"w")});break}return t}parseTableProperties(e,t){switch(t.cssStyle={},t.cellStyle={},this.parseDefaultProperties(e,t.cssStyle,t.cellStyle,r=>{switch(r.localName){case"tblStyle":t.styleName=x.attr(r,"val");break;case"tblLook":t.className=lt.classNameOftblLook(r);break;case"tblpPr":this.parseTablePosition(r,t);break;case"tblStyleColBandSize":t.colBandSize=x.intAttr(r,"val");break;case"tblStyleRowBandSize":t.rowBandSize=x.intAttr(r,"val");break;case"hidden":t.cssStyle.display="none";break;default:return!1}return!0}),t.cssStyle["text-align"]){case"center":delete t.cssStyle["text-align"],t.cssStyle["margin-left"]="auto",t.cssStyle["margin-right"]="auto";break;case"right":delete t.cssStyle["text-align"],t.cssStyle["margin-left"]="auto";break}}parseTablePosition(e,t){var r=x.lengthAttr(e,"topFromText"),n=x.lengthAttr(e,"bottomFromText"),a=x.lengthAttr(e,"rightFromText"),i=x.lengthAttr(e,"leftFromText");t.cssStyle.float="left",t.cssStyle["margin-bottom"]=lt.addSize(t.cssStyle["margin-bottom"],n),t.cssStyle["margin-left"]=lt.addSize(t.cssStyle["margin-left"],i),t.cssStyle["margin-right"]=lt.addSize(t.cssStyle["margin-right"],a),t.cssStyle["margin-top"]=lt.addSize(t.cssStyle["margin-top"],r)}parseTableRow(e){var t={type:B.Row,children:[]};for(const r of x.elements(e))switch(r.localName){case"tc":t.children.push(this.parseTableCell(r));break;case"trPr":case"tblPrEx":this.parseTableRowProperties(r,t);break}return t}parseTableRowProperties(e,t){t.cssStyle=this.parseDefaultProperties(e,{},null,r=>{switch(r.localName){case"cnfStyle":t.className=lt.classNameOfCnfStyle(r);break;case"tblHeader":t.isHeader=x.boolAttr(r,"val");break;case"gridBefore":t.gridBefore=x.intAttr(r,"val");break;case"gridAfter":t.gridAfter=x.intAttr(r,"val");break;default:return!1}return!0})}parseTableCell(e){var t={type:B.Cell,children:[]};for(const r of x.elements(e))switch(r.localName){case"tbl":t.children.push(this.parseTable(r));break;case"p":t.children.push(this.parseParagraph(r));break;case"tcPr":this.parseTableCellProperties(r,t);break}return t}parseTableCellProperties(e,t){t.cssStyle=this.parseDefaultProperties(e,{},null,r=>{switch(r.localName){case"gridSpan":t.span=x.intAttr(r,"val",null);break;case"vMerge":t.verticalMerge=x.attr(r,"val")??"continue";break;case"cnfStyle":t.className=lt.classNameOfCnfStyle(r);break;default:return!1}return!0}),this.parseTableCellVerticalText(e,t)}parseTableCellVerticalText(e,t){const r={btLr:{writingMode:"vertical-rl",transform:"rotate(180deg)"},lrTb:{writingMode:"vertical-lr",transform:"none"},tbRl:{writingMode:"vertical-rl",transform:"none"}};for(const n of x.elements(e))if(n.localName==="textDirection"){const a=x.attr(n,"val"),i=r[a]||{writingMode:"horizontal-tb"};t.cssStyle["writing-mode"]=i.writingMode,t.cssStyle.transform=i.transform}}parseDefaultProperties(e,t=null,r=null,n=null){t=t||{};for(const a of x.elements(e))if(!(n!=null&&n(a)))switch(a.localName){case"jc":t["text-align"]=lt.valueOfJc(a);break;case"textAlignment":t["vertical-align"]=lt.valueOfTextAlignment(a);break;case"color":t.color=Et.colorAttr(a,"val",null,Ut.color);break;case"sz":t["font-size"]=t["min-height"]=x.lengthAttr(a,"val",pt.FontSize);break;case"shd":t["background-color"]=Et.colorAttr(a,"fill",null,Ut.shd);break;case"highlight":t["background-color"]=Et.colorAttr(a,"val",null,Ut.highlight);break;case"vertAlign":break;case"position":t.verticalAlign=x.lengthAttr(a,"val",pt.FontSize);break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":t.width=lt.valueOfSize(a,"w");break;case"trHeight":this.parseTrHeight(a,t);break;case"strike":t["text-decoration"]=x.boolAttr(a,"val",!0)?"line-through":"none";break;case"b":t["font-weight"]=x.boolAttr(a,"val",!0)?"bold":"normal";break;case"i":t["font-style"]=x.boolAttr(a,"val",!0)?"italic":"normal";break;case"caps":t["text-transform"]=x.boolAttr(a,"val",!0)?"uppercase":"none";break;case"smallCaps":t["font-variant"]=x.boolAttr(a,"val",!0)?"small-caps":"none";break;case"u":this.parseUnderline(a,t);break;case"ind":case"tblInd":this.parseIndentation(a,t);break;case"rFonts":this.parseFont(a,t);break;case"tblBorders":this.parseBorderProperties(a,r||t);break;case"tblCellSpacing":t["border-spacing"]=lt.valueOfMargin(a),t["border-collapse"]="separate";break;case"pBdr":this.parseBorderProperties(a,t);break;case"bdr":t.border=lt.valueOfBorder(a);break;case"tcBorders":this.parseBorderProperties(a,t);break;case"vanish":x.boolAttr(a,"val",!0)&&(t.display="none");break;case"kern":break;case"noWrap":break;case"tblCellMar":case"tcMar":this.parseMarginProperties(a,r||t);break;case"tblLayout":t["table-layout"]=lt.valueOfTblLayout(a);break;case"vAlign":t["vertical-align"]=lt.valueOfTextAlignment(a);break;case"spacing":e.localName=="pPr"&&this.parseSpacing(a,t);break;case"wordWrap":x.boolAttr(a,"val")&&(t["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":t.hyphens=x.boolAttr(a,"val",!0)?"none":"auto";break;case"lang":t.$lang=x.attr(a,"val");break;case"rtl":case"bidi":x.boolAttr(a,"val",!0)&&(t.direction="rtl");break;case"bCs":case"iCs":case"szCs":case"tabs":case"outlineLvl":case"contextualSpacing":case"tblStyleColBandSize":case"tblStyleRowBandSize":case"webHidden":case"pageBreakBefore":case"suppressLineNumbers":case"keepLines":case"keepNext":case"widowControl":case"noProof":break;default:this.options.debug&&console.warn(`DOCX: Unknown document element: ${e.localName}.${a.localName}`);break}return t}parseUnderline(e,t){var r=x.attr(e,"val");if(r!=null){switch(r){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":t["text-decoration"]="underline dashed";break;case"dotted":case"dottedHeavy":t["text-decoration"]="underline dotted";break;case"double":t["text-decoration"]="underline double";break;case"single":case"thick":t["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":t["text-decoration"]="underline wavy";break;case"words":t["text-decoration"]="underline";break;case"none":t["text-decoration"]="none";break}var n=Et.colorAttr(e,"color");n&&(t["text-decoration-color"]=n)}}parseFont(e,t){var r=x.attr(e,"ascii"),n=lt.themeValue(e,"asciiTheme"),a=x.attr(e,"eastAsia"),i=[r,n,a].filter(l=>l).map(l=>Gt(l));i.length>0&&(t["font-family"]=[...new Set(i)].join(", "))}parseIndentation(e,t){var r=x.lengthAttr(e,"firstLine"),n=x.lengthAttr(e,"hanging"),a=x.lengthAttr(e,"left"),i=x.lengthAttr(e,"start"),l=x.lengthAttr(e,"right"),c=x.lengthAttr(e,"end");r&&(t["text-indent"]=r),n&&(t["text-indent"]=`-${n}`),(a||i)&&(t["margin-inline-start"]=a||i),(l||c)&&(t["margin-inline-end"]=l||c)}parseSpacing(e,t){var r=x.lengthAttr(e,"before"),n=x.lengthAttr(e,"after"),a=x.intAttr(e,"line",null),i=x.attr(e,"lineRule");if(r&&(t["margin-top"]=r),n&&(t["margin-bottom"]=n),a!==null)switch(i){case"auto":t["line-height"]=`${(a/240).toFixed(2)}`;break;case"atLeast":t["line-height"]=`calc(100% + ${a/20}pt)`;break;default:t["line-height"]=t["min-height"]=`${a/20}pt`;break}}parseMarginProperties(e,t){for(const r of x.elements(e))switch(r.localName){case"left":t["padding-left"]=lt.valueOfMargin(r);break;case"right":t["padding-right"]=lt.valueOfMargin(r);break;case"top":t["padding-top"]=lt.valueOfMargin(r);break;case"bottom":t["padding-bottom"]=lt.valueOfMargin(r);break}}parseTrHeight(e,t){switch(x.attr(e,"hRule")){case"exact":t.height=x.lengthAttr(e,"val");break;case"atLeast":default:t.height=x.lengthAttr(e,"val");break}}parseBorderProperties(e,t){for(const r of x.elements(e))switch(r.localName){case"start":case"left":t["border-left"]=lt.valueOfBorder(r);break;case"end":case"right":t["border-right"]=lt.valueOfBorder(r);break;case"top":t["border-top"]=lt.valueOfBorder(r);break;case"bottom":t["border-bottom"]=lt.valueOfBorder(r);break}}}const Qr=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"];class Et{static colorAttr(e,t,r=null,n="black"){var a=x.attr(e,t);if(a)return a=="auto"?n:Qr.includes(a)?a:`#${a}`;var i=x.attr(e,"themeColor");return i?`var(--docx-${i}-color)`:r}}class lt{static themeValue(e,t){var r=x.attr(e,t);return r?`var(--docx-${r}-font)`:null}static valueOfSize(e,t){var r=pt.Dxa;switch(x.attr(e,"type")){case"dxa":break;case"pct":r=pt.Percent;break;case"auto":return"auto"}return x.lengthAttr(e,t,r)}static valueOfMargin(e){return x.lengthAttr(e,"w")}static valueOfBorder(e){var t=lt.parseBorderType(x.attr(e,"val"));if(t=="none")return"none";var r=Et.colorAttr(e,"color"),n=x.lengthAttr(e,"sz",pt.Border);return`${n} ${t} ${r=="auto"?Ut.borderColor:r}`}static parseBorderType(e){switch(e){case"single":return"solid";case"dashDotStroked":return"solid";case"dashed":return"dashed";case"dashSmallGap":return"dashed";case"dotDash":return"dotted";case"dotDotDash":return"dotted";case"dotted":return"dotted";case"double":return"double";case"doubleWave":return"double";case"inset":return"inset";case"nil":return"none";case"none":return"none";case"outset":return"outset";case"thick":return"solid";case"thickThinLargeGap":return"solid";case"thickThinMediumGap":return"solid";case"thickThinSmallGap":return"solid";case"thinThickLargeGap":return"solid";case"thinThickMediumGap":return"solid";case"thinThickSmallGap":return"solid";case"thinThickThinLargeGap":return"solid";case"thinThickThinMediumGap":return"solid";case"thinThickThinSmallGap":return"solid";case"threeDEmboss":return"solid";case"threeDEngrave":return"solid";case"triple":return"double";case"wave":return"solid"}return"solid"}static valueOfTblLayout(e){var t=x.attr(e,"val");return t=="fixed"?"fixed":"auto"}static classNameOfCnfStyle(e){const t=x.attr(e,"val"),r=["first-row","last-row","first-col","last-col","odd-col","even-col","odd-row","even-row","ne-cell","nw-cell","se-cell","sw-cell"];if(t)return r.filter((a,i)=>t[i]=="1").join(" ");const n=["firstRow","lastRow","firstColumn","lastColumn","oddVBand","evenVBand","oddHBand","evenHBand","firstRowLastColumn","firstRowFirstColumn","lastRowLastColumn","lastRowFirstColumn"];return r.filter((a,i)=>x.boolAttr(e,n[i])).join(" ")}static valueOfJc(e){var t=x.attr(e,"val");switch(t){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return t}static valueOfVertAlign(e,t=!1){var r=x.attr(e,"val");switch(r){case"subscript":return"sub";case"superscript":return t?"sup":"super"}return t?null:r}static valueOfTextAlignment(e){var t=x.attr(e,"val");switch(t){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return t}static addSize(e,t){return e==null?t:t==null?e:`calc(${e} + ${t})`}static classNameOftblLook(e){const t=x.hexAttr(e,"val",0);let r="";return(x.boolAttr(e,"firstRow")||t&32)&&(r+=" first-row"),(x.boolAttr(e,"lastRow")||t&64)&&(r+=" last-row"),(x.boolAttr(e,"firstColumn")||t&128)&&(r+=" first-col"),(x.boolAttr(e,"lastColumn")||t&256)&&(r+=" last-col"),(x.boolAttr(e,"noHBand")||t&512)&&(r+=" no-hband"),(x.boolAttr(e,"noVBand")||t&1024)&&(r+=" no-vband"),r.trim()}}const _e={pos:0,leader:"none",style:"left"},tn=50;function en(s=document.body){const e=document.createElement("div");e.style.width="100pt",s.appendChild(e);const t=100/e.offsetWidth;return s.removeChild(e),t}function rn(s,e,t,r=72/96){const n=s.closest("p"),a=s.getBoundingClientRect(),i=n.getBoundingClientRect(),l=getComputedStyle(n),c=(e==null?void 0:e.length)>0?e.map(k=>({pos:Se(k.position),leader:k.leader,style:k.style})).sort((k,C)=>k.pos-C.pos):[_e],g=c[c.length-1],_=i.width*r,v=Se(t);let y=g.pos+v;if(y<_)for(;y<_&&c.length<tn;y+=v)c.push({..._e,pos:y});const u=parseFloat(l.marginLeft),b=i.left+u,d=(a.left-b)*r,f=c.find(k=>k.style!="clear"&&k.pos>d);if(f==null)return;let p=1;if(f.style=="right"||f.style=="center"){const k=Array.from(n.querySelectorAll(`.${s.className}`)),C=k.indexOf(s)+1,P=document.createRange();P.setStart(s,1),C<k.length?P.setEndBefore(k[C]):P.setEndAfter(n);const A=f.style=="center"?.5:1,I=P.getBoundingClientRect(),T=I.left+A*I.width-(i.left-u);p=f.pos-T*r}else p=f.pos-d;switch(s.innerHTML="&nbsp;",s.style.textDecoration="inherit",s.style.wordSpacing=`${p.toFixed(0)}pt`,f.leader){case"dot":case"middleDot":s.style.textDecoration="underline",s.style.textDecorationStyle="dotted";break;case"hyphen":case"heavy":case"underscore":s.style.textDecoration="underline";break}}function Se(s){return parseFloat(s)}var it;(function(s){s.html="http://www.w3.org/1999/xhtml",s.svg="http://www.w3.org/2000/svg",s.mathML="http://www.w3.org/1998/Math/MathML"})(it||(it={}));function Tt(s){if(Yt(s))return document.createTextNode(s);if(s instanceof Node)return s;const{ns:e,tagName:t,className:r,style:n,children:a,...i}=s;if(t==="#fragment"){const c=document.createDocumentFragment();return a&&a.forEach(g=>c.appendChild(Tt(g))),c}if(t==="#comment")return document.createComment(a?a[0]:"");const l=e?document.createElementNS(e,t):document.createElement(t);if(r&&l.setAttribute("class",r),n&&(Yt(n)?l.setAttribute("style",n):Object.assign(l.style,n)),i)for(const[c,g]of Object.entries(i))g!==void 0&&(l[c]=g);return a&&a.forEach(c=>l.appendChild(Tt(c))),l}function nn(...s){return s.filter(Boolean).join(" ")}class an{constructor(){this.className="docx",this.styleMap={},this.currentPart=null,this.tableVerticalMerges=[],this.currentVerticalMerge=null,this.tableCellPositions=[],this.currentCellPosition=null,this.footnoteMap={},this.endnoteMap={},this.currentEndnoteIds=[],this.usedHederFooterParts=[],this.currentTabs=[],this.commentMap={},this.tasks=[],this.postRenderTasks=[],this.h=Tt}async render(e,t){var a;this.document=e,this.options=t,this.className=t.className,this.rootSelector=t.inWrapper?`.${this.className}-wrapper`:":root",this.h=t.h??Tt,this.styleMap=null,this.tasks=[],this.options.renderComments&&globalThis.Highlight&&(this.commentHighlight=new Highlight);const r=[...this.renderDefaultStyle()];e.themePart&&r.push(...this.renderTheme(e.themePart)),e.stylesPart!=null&&(this.styleMap=this.processStyles(e.stylesPart.styles),r.push(...this.renderStyles(e.stylesPart.styles))),e.numberingPart&&(this.prodessNumberings(e.numberingPart.domNumberings),r.push(...await this.renderNumbering(e.numberingPart.domNumberings))),e.footnotesPart&&(this.footnoteMap=Pt(e.footnotesPart.notes,i=>i.id)),e.endnotesPart&&(this.endnoteMap=Pt(e.endnotesPart.notes,i=>i.id)),e.settingsPart&&(this.defaultTabSize=(a=e.settingsPart.settings)==null?void 0:a.defaultTabStop),!t.ignoreFonts&&e.fontTablePart&&r.push(...await this.renderFontTable(e.fontTablePart));var n=this.renderSections(e.documentPart.body);return this.options.inWrapper?r.push(this.renderWrapper(n)):r.push(...n),this.commentHighlight&&t.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),this.postRenderTasks.forEach(i=>i()),await Promise.allSettled(this.tasks),this.refreshTabStops(),r}renderTheme(e){var i,l;const t={},r=(i=e.theme)==null?void 0:i.fontScheme;r&&(r.majorFont&&(t["--docx-majorHAnsi-font"]=r.majorFont.latinTypeface),r.minorFont&&(t["--docx-minorHAnsi-font"]=r.minorFont.latinTypeface));const n=(l=e.theme)==null?void 0:l.colorScheme;if(n)for(let[c,g]of Object.entries(n.colors))t[`--docx-${c}-color`]=`#${g}`;const a=this.styleToString(`.${this.className}`,t);return[this.h({tagName:"#comment",children:["docxjs document theme values"]}),this.h({tagName:"style",children:[a]})]}async renderFontTable(e){const t=[];for(let r of e.fonts)for(let n of r.embedFontRefs)try{const a=await this.document.loadFont(n.id,n.key),i={"font-family":Gt(r.name),src:`url(${a})`};(n.type=="bold"||n.type=="boldItalic")&&(i["font-weight"]="bold"),(n.type=="italic"||n.type=="boldItalic")&&(i["font-style"]="italic"),t.push(this.h({tagName:"#comment",children:[`docxjs ${r.name} font`]})),t.push(this.h({tagName:"style",children:[this.styleToString("@font-face",i)]}))}catch{this.options.debug&&console.warn(`Can't load font with id ${n.id} and key ${n.key}`)}return t}processStyleName(e){return e?`${this.className}_${$e(e)}`:this.className}processStyles(e){const t=Pt(e.filter(n=>n.id!=null),n=>n.id);for(const n of e.filter(a=>a.basedOn)){var r=t[n.basedOn];if(r){n.paragraphProps=jt(n.paragraphProps,r.paragraphProps),n.runProps=jt(n.runProps,r.runProps);for(const a of r.styles){const i=n.styles.find(l=>l.target==a.target);i?this.copyStyleProperties(a.values,i.values):n.styles.push({...a,values:{...a.values}})}}else this.options.debug&&console.warn(`Can't find base style ${n.basedOn}`)}for(let n of e)n.cssName=this.processStyleName(n.id);return t}prodessNumberings(e){var t;for(let r of e.filter(n=>n.pStyleName)){const n=this.findStyle(r.pStyleName);(t=n==null?void 0:n.paragraphProps)!=null&&t.numbering&&(n.paragraphProps.numbering.level=r.level)}}processElement(e){if(e.children)for(var t of e.children)t.parent=e,t.type==B.Table?this.processTable(t):this.processElement(t)}processTable(e){for(var t of e.children)for(var r of t.children)r.cssStyle=this.copyStyleProperties(e.cellStyle,r.cssStyle,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]),this.processElement(r)}copyStyleProperties(e,t,r=null){if(!e)return t;t==null&&(t={}),r==null&&(r=Object.getOwnPropertyNames(e));for(var n of r)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n]);return t}createPageElement(e,t,r){const n={...r};return t&&(t.pageMargins&&(n.paddingLeft=t.pageMargins.left,n.paddingRight=t.pageMargins.right,n.paddingTop=t.pageMargins.top,n.paddingBottom=t.pageMargins.bottom),t.pageSize&&(this.options.ignoreWidth||(n.width=t.pageSize.width),this.options.ignoreHeight||(n.minHeight=t.pageSize.height))),this.h({tagName:"section",className:e,style:n})}createSectionContent(e){const t={};return e.columns&&e.columns.numberOfColumns&&(t.columnCount=`${e.columns.numberOfColumns}`,t.columnGap=e.columns.space,e.columns.separator&&(t.columnRule="1px solid black")),this.h({tagName:"article",style:t})}renderSections(e){const t=[];this.processElement(e);const r=this.splitBySection(e.children,e.props),n=this.groupByPageBreaks(r);let a=null;for(let l=0,c=n.length;l<c;l++){this.currentFootnoteIds=[];let _=n[l][0].sectProps;const v=this.createPageElement(this.className,_,e.cssStyle);this.options.renderHeaders&&this.renderHeaderFooter(_.headerRefs,_,t.length,a!=_,v);for(const y of n[l]){var i=this.createSectionContent(y.sectProps);this.renderElements(y.elements,i),v.appendChild(i),_=y.sectProps}if(this.options.renderFootnotes){const y=this.renderNotes(this.currentFootnoteIds,this.footnoteMap);y&&v.appendChild(y)}if(this.options.renderEndnotes&&l==c-1){const y=this.renderNotes(this.currentEndnoteIds,this.endnoteMap);y&&v.appendChild(y)}this.options.renderFooters&&this.renderHeaderFooter(_.footerRefs,_,t.length,a!=_,v),t.push(v),a=_}return t}renderHeaderFooter(e,t,r,n,a){var g,_;if(!e)return;const i=((_=(g=this.document.settingsPart)==null?void 0:g.settings)==null?void 0:_.evenAndOddHeaders)??!1;var l=(t.titlePage&&n?e.find(v=>v.type=="first"):null)??(r%2==1&&i?e.find(v=>v.type=="even"):null)??e.find(v=>v.type=="default"),c=l&&this.document.findPartByRelId(l.id,this.document.documentPart);if(c){this.currentPart=c,this.usedHederFooterParts.includes(c.path)||(this.processElement(c.rootElement),this.usedHederFooterParts.push(c.path));const[v]=this.renderElements([c.rootElement],a);t!=null&&t.pageMargins&&(c.rootElement.type===B.Header?(v.style.marginTop=`calc(${t.pageMargins.header} - ${t.pageMargins.top})`,v.style.minHeight=`calc(${t.pageMargins.top} - ${t.pageMargins.header})`):c.rootElement.type===B.Footer&&(v.style.marginBottom=`calc(${t.pageMargins.footer} - ${t.pageMargins.bottom})`,v.style.minHeight=`calc(${t.pageMargins.bottom} - ${t.pageMargins.footer})`)),this.currentPart=null}}isPageBreakElement(e){return e.type!=B.Break?!1:e.break=="lastRenderedPageBreak"?!this.options.ignoreLastRenderedPageBreak:e.break=="page"}isPageBreakSection(e,t){var r,n,a,i,l,c;return!e||!t?!1:((r=e.pageSize)==null?void 0:r.orientation)!=((n=t.pageSize)==null?void 0:n.orientation)||((a=e.pageSize)==null?void 0:a.width)!=((i=t.pageSize)==null?void 0:i.width)||((l=e.pageSize)==null?void 0:l.height)!=((c=t.pageSize)==null?void 0:c.height)}splitBySection(e,t){var v;var r={sectProps:null,elements:[],pageBreak:!1},n=[r];for(let y of e){if(y.type==B.Paragraph){const u=y,b=this.findStyle(u.styleName);(u.pageBreakBefore||(v=b==null?void 0:b.paragraphProps)!=null&&v.pageBreakBefore)&&(r.sectProps=a,r.pageBreak=!0,r={sectProps:null,elements:[],pageBreak:!1},n.push(r))}if(r.elements.push(y),y.type==B.Paragraph){const u=y;var a=u.sectionProps,i=-1,l=-1;if(this.options.breakPages&&u.children&&(i=u.children.findIndex(b=>{var d;return l=((d=b.children)==null?void 0:d.findIndex(this.isPageBreakElement.bind(this)))??-1,l!=-1})),(a||i!=-1)&&(r.sectProps=a,r.pageBreak=i!=-1,r={sectProps:null,elements:[],pageBreak:!1},n.push(r)),i!=-1){let b=u.children[i],d=l<b.children.length-1;if(i<u.children.length-1||d){var c=y.children,g={...y,children:c.slice(i)};if(y.children=c.slice(0,i),r.elements.push(g),d){let f=b.children,p={...b,children:f.slice(0,l)};y.children.push(p),b.children=f.slice(l)}}}}}let _=null;for(let y=n.length-1;y>=0;y--)n[y].sectProps==null?n[y].sectProps=_??t:_=n[y].sectProps;return n}groupByPageBreaks(e){let t=[],r;const n=[t];for(let a of e)t.push(a),(this.options.ignoreLastRenderedPageBreak||a.pageBreak||this.isPageBreakSection(r,a.sectProps))&&n.push(t=[]),r=a.sectProps;return n.filter(a=>a.length>0)}renderWrapper(e){return this.h({tagName:"div",className:`${this.className}-wrapper`,children:e})}renderDefaultStyle(){var e=this.className,t=`
18
- .${e}-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; }
19
- .${e}-wrapper>section.${e} { background: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); margin-bottom: 30px; }`;this.options.hideWrapperOnPrint&&(t=`@media not print { ${t} }`);var r=`${t}
20
- .${e} { color: black; hyphens: auto; text-underline-position: from-font; }
21
- section.${e} { box-sizing: border-box; display: flex; flex-flow: column nowrap; position: relative; overflow: hidden; }
22
- section.${e}>article { margin-bottom: auto; z-index: 1; }
23
- section.${e}>footer { z-index: 1; }
24
- .${e} table { border-collapse: collapse; }
25
- .${e} table td, .${e} table th { vertical-align: top; }
26
- .${e} p { margin: 0pt; min-height: 1em; }
27
- .${e} span { white-space: pre-wrap; overflow-wrap: break-word; }
28
- .${e} a { color: inherit; text-decoration: inherit; }
29
- .${e} svg { fill: transparent; }
17
+ */var he;(function(s){s.OfficeDocument="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",s.FontTable="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",s.Image="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",s.Numbering="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",s.Styles="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",s.StylesWithEffects="http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects",s.Theme="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",s.Settings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",s.WebSettings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",s.Hyperlink="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",s.Footnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",s.Endnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",s.Footer="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",s.Header="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",s.ExtendedProperties="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",s.CoreProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",s.CustomProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/custom-properties",s.Comments="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",s.CommentsExtended="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",s.AltChunk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk"})(he||(he={}));function Wt(s,t){return t.elements(s).map(e=>({id:t.attr(e,"Id"),type:t.attr(e,"Type"),target:t.attr(e,"Target"),targetMode:t.attr(e,"TargetMode")}))}function Zt(s){return s==null?void 0:s.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()}function Ye(s){return/^[^"'].*\s.*[^"']$/.test(s)?`'${s}'`:s}function $e(s){let t=s.lastIndexOf("/")+1,e=t==0?"":s.substring(0,t),r=t==0?s:s.substring(t);return[e,r]}function Je(s,t){try{const e="http://docx/";return new URL(s,e+t).toString().substring(e.length)}catch{return`${t}${s}`}}function Pe(s,t){return s.reduce((e,r)=>(e[t(r)]=r,e),{})}function Vt(s){return new Promise((t,e)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=()=>e(),r.readAsDataURL(s)})}function Ke(s){return s&&typeof s=="object"&&!Array.isArray(s)}function Qe(s){return typeof s=="string"||s instanceof String}function je(s,...t){if(!t.length)return s;const e=t.shift();if(Ke(s)&&Ke(e))for(const r in e)if(Ke(e[r])){const n=s[r]??(s[r]={});je(n,e[r])}else s[r]=e[r];return je(s,...t)}function Me(s){return Array.isArray(s)?s:[s]}function Gt(s,t,e){return t>s?t:e<s?e:s}const ot={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},me={Dxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt",min:.25,max:12},Point:{mul:1,unit:"pt"},Percent:{mul:.02,unit:"%"}};function lt(s,t=me.Dxa){if(s==null||/.+(p[xt]|[%])$/.test(s))return s;var e=parseInt(s)*t.mul;return t.min&&t.max&&(e=Gt(e,t.min,t.max)),`${e.toFixed(2)}${t.unit}`}function Xt(s,t=!1){switch(s){case"1":return!0;case"0":return!1;case"on":return!0;case"off":return!1;case"true":return!0;case"false":return!1;default:return t}}function ct(s,t,e){if(s.namespaceURI!=ot.wordml)return!1;switch(s.localName){case"color":t.color=e.attr(s,"val");break;case"sz":t.fontSize=e.lengthAttr(s,"val",me.FontSize);break;default:return!1}return!0}function qt(s,t=!1){t&&(s=s.replace(/<[?].*[?]>/,"")),s=Jt(s);const e=new DOMParser().parseFromString(s,"application/xml"),r=Yt(e);if(r)throw new Error(r);return e}function Yt(s){var t;return(t=s.getElementsByTagName("parsererror")[0])==null?void 0:t.textContent}function Jt(s){return s.charCodeAt(0)===65279?s.substring(1):s}function Kt(s){return new XMLSerializer().serializeToString(s)}class ht{elements(t,e=null){const r=[];for(let n=0,a=t.childNodes.length;n<a;n++){let i=t.childNodes.item(n);i.nodeType==Node.ELEMENT_NODE&&(e==null||i.localName==e)&&r.push(i)}return r}element(t,e){for(let r=0,n=t.childNodes.length;r<n;r++){let a=t.childNodes.item(r);if(a.nodeType==1&&a.localName==e)return a}return null}elementAttr(t,e,r){var n=this.element(t,e);return n?this.attr(n,r):void 0}attrs(t){return Array.from(t.attributes)}attr(t,e){for(let r=0,n=t.attributes.length;r<n;r++){let a=t.attributes.item(r);if(a.localName==e)return a.value}return null}intAttr(t,e,r=null){var n=this.attr(t,e);return n?parseInt(n):r}hexAttr(t,e,r=null){var n=this.attr(t,e);return n?parseInt(n,16):r}floatAttr(t,e,r=null){var n=this.attr(t,e);return n?parseFloat(n):r}boolAttr(t,e,r=null){return Xt(this.attr(t,e),r)}lengthAttr(t,e,r=me.Dxa){return lt(this.attr(t,e),r)}}const x=new ht;class ke{constructor(t,e){this._package=t,this.path=e}async load(){this.rels=await this._package.loadRelationships(this.path);const t=await this._package.load(this.path),e=this._package.parseXmlDocument(t);this._package.options.keepOrigin&&(this._xmlDocument=e),this.parseXml(e.firstElementChild)}save(){this._package.update(this.path,Kt(this._xmlDocument))}parseXml(t){}}const Qt={embedRegular:"regular",embedBold:"bold",embedItalic:"italic",embedBoldItalic:"boldItalic"};function er(s,t){return t.elements(s).map(e=>tr(e,t))}function tr(s,t){let e={name:t.attr(s,"name"),embedFontRefs:[]};for(let r of t.elements(s))switch(r.localName){case"family":e.family=t.attr(r,"val");break;case"altName":e.altName=t.attr(r,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":e.embedFontRefs.push(rr(r,t));break}return e}function rr(s,t){return{id:t.attr(s,"id"),key:t.attr(s,"fontKey"),type:Qt[s.localName]}}class nr extends ke{parseXml(t){this.fonts=er(t,this._package.xmlParser)}}function ar(s,t){return t.elements(s).map(e=>({extension:t.attr(e,"Extension"),partName:t.attr(e,"PartName"),contentType:t.attr(e,"ContentType")}))}class et{constructor(t,e){this._zip=t,this.options=e,this.xmlParser=new ht}get(t){const e=sr(t);return this._zip.files[e]??this._zip.files[e.replace(/\//g,"\\")]}update(t,e){this._zip.file(t,e)}static async load(t,e){const r=await Ht.loadAsync(t);return new et(r,e)}save(t="blob"){return this._zip.generateAsync({type:t})}load(t,e="string"){var r;return((r=this.get(t))==null?void 0:r.async(e))??Promise.resolve(null)}async loadRelationships(t=null){let e="_rels/.rels";if(t!=null){const[n,a]=$e(t);e=`${n}_rels/${a}.rels`}const r=await this.load(e);return r?Wt(this.parseXmlDocument(r).firstElementChild,this.xmlParser):null}async loadContentTypes(){const t=await this.load("[Content_Types].xml");return t?ar(this.parseXmlDocument(t).firstElementChild,this.xmlParser):[]}parseXmlDocument(t){return qt(t,this.options.trimXmlDeclaration)}}function sr(s){return s.startsWith("/")?s.substr(1):s}class ir extends ke{constructor(t,e,r){super(t,e),this._documentParser=r}parseXml(t){this.body=this._documentParser.parseDocumentFile(t)}}function Ue(s,t){return{type:t.attr(s,"val"),color:t.attr(s,"color"),size:t.lengthAttr(s,"sz",me.Border),offset:t.lengthAttr(s,"space",me.Point),frame:t.boolAttr(s,"frame"),shadow:t.boolAttr(s,"shadow")}}function or(s,t){var e={};for(let r of t.elements(s))switch(r.localName){case"left":e.left=Ue(r,t);break;case"top":e.top=Ue(r,t);break;case"right":e.right=Ue(r,t);break;case"bottom":e.bottom=Ue(r,t);break}return e}var ut;(function(s){s.Continuous="continuous",s.NextPage="nextPage",s.NextColumn="nextColumn",s.EvenPage="evenPage",s.OddPage="oddPage"})(ut||(ut={}));function dt(s,t=x){var e={};for(let r of t.elements(s))switch(r.localName){case"pgSz":e.pageSize={width:t.lengthAttr(r,"w"),height:t.lengthAttr(r,"h"),orientation:t.attr(r,"orient")};break;case"type":e.type=t.attr(r,"val");break;case"pgMar":e.pageMargins={left:t.lengthAttr(r,"left"),right:t.lengthAttr(r,"right"),top:t.lengthAttr(r,"top"),bottom:t.lengthAttr(r,"bottom"),header:t.lengthAttr(r,"header"),footer:t.lengthAttr(r,"footer"),gutter:t.lengthAttr(r,"gutter")};break;case"cols":e.columns=lr(r,t);break;case"headerReference":(e.headerRefs??(e.headerRefs=[])).push(ft(r,t));break;case"footerReference":(e.footerRefs??(e.footerRefs=[])).push(ft(r,t));break;case"titlePg":e.titlePage=t.boolAttr(r,"val",!0);break;case"pgBorders":e.pageBorders=or(r,t);break;case"pgNumType":e.pageNumber=cr(r,t);break}return e}function lr(s,t){return{numberOfColumns:t.intAttr(s,"num"),space:t.lengthAttr(s,"space"),separator:t.boolAttr(s,"sep"),equalWidth:t.boolAttr(s,"equalWidth",!0),columns:t.elements(s,"col").map(e=>({width:t.lengthAttr(e,"w"),space:t.lengthAttr(e,"space")}))}}function cr(s,t){return{chapSep:t.attr(s,"chapSep"),chapStyle:t.attr(s,"chapStyle"),format:t.attr(s,"fmt"),start:t.intAttr(s,"start")}}function ft(s,t){return{id:t.attr(s,"id"),type:t.attr(s,"type")}}function hr(s,t){return{before:t.lengthAttr(s,"before"),after:t.lengthAttr(s,"after"),line:t.intAttr(s,"line"),lineRule:t.attr(s,"lineRule")}}function tt(s,t){let e={};for(let r of t.elements(s))ur(r,e,t);return e}function ur(s,t,e){return!!ct(s,t,e)}function pt(s,t){let e={};for(let r of t.elements(s))mt(r,e,t);return e}function mt(s,t,e){if(s.namespaceURI!=ot.wordml)return!1;if(ct(s,t,e))return!0;switch(s.localName){case"tabs":t.tabs=dr(s,e);break;case"sectPr":t.sectionProps=dt(s,e);break;case"numPr":t.numbering=fr(s,e);break;case"spacing":return t.lineSpacing=hr(s,e),!1;case"textAlignment":return t.textAlignment=e.attr(s,"val"),!1;case"keepLines":t.keepLines=e.boolAttr(s,"val",!0);break;case"keepNext":t.keepNext=e.boolAttr(s,"val",!0);break;case"pageBreakBefore":t.pageBreakBefore=e.boolAttr(s,"val",!0);break;case"outlineLvl":t.outlineLevel=e.intAttr(s,"val");break;case"pStyle":t.styleName=e.attr(s,"val");break;case"rPr":t.runProps=tt(s,e);break;default:return!1}return!0}function dr(s,t){return t.elements(s,"tab").map(e=>({position:t.lengthAttr(e,"pos"),leader:t.attr(e,"leader"),style:t.attr(e,"val")}))}function fr(s,t){var e={};for(let r of t.elements(s))switch(r.localName){case"numId":e.id=t.attr(r,"val");break;case"ilvl":e.level=t.intAttr(r,"val");break}return e}function pr(s,t){let e={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let r of t.elements(s))switch(r.localName){case"num":e.numberings.push(mr(r,t));break;case"abstractNum":e.abstractNumberings.push(gr(r,t));break;case"numPicBullet":e.bulletPictures.push(vr(r,t));break}return e}function mr(s,t){let e={id:t.attr(s,"numId"),overrides:[]};for(let r of t.elements(s))switch(r.localName){case"abstractNumId":e.abstractId=t.attr(r,"val");break;case"lvlOverride":e.overrides.push(br(r,t));break}return e}function gr(s,t){let e={id:t.attr(s,"abstractNumId"),levels:[]};for(let r of t.elements(s))switch(r.localName){case"name":e.name=t.attr(r,"val");break;case"multiLevelType":e.multiLevelType=t.attr(r,"val");break;case"numStyleLink":e.numberingStyleLink=t.attr(r,"val");break;case"styleLink":e.styleLink=t.attr(r,"val");break;case"lvl":e.levels.push(gt(r,t));break}return e}function gt(s,t){let e={level:t.intAttr(s,"ilvl")};for(let r of t.elements(s))switch(r.localName){case"start":e.start=t.attr(r,"val");break;case"lvlRestart":e.restart=t.intAttr(r,"val");break;case"numFmt":e.format=t.attr(r,"val");break;case"lvlText":e.text=t.attr(r,"val");break;case"lvlJc":e.justification=t.attr(r,"val");break;case"lvlPicBulletId":e.bulletPictureId=t.attr(r,"val");break;case"pStyle":e.paragraphStyle=t.attr(r,"val");break;case"pPr":e.paragraphProps=pt(r,t);break;case"rPr":e.runProps=tt(r,t);break}return e}function br(s,t){let e={level:t.intAttr(s,"ilvl")};for(let r of t.elements(s))switch(r.localName){case"startOverride":e.start=t.intAttr(r,"val");break;case"lvl":e.numberingLevel=gt(r,t);break}return e}function vr(s,t){var e=t.element(s,"pict"),r=e&&t.element(e,"shape"),n=r&&t.element(r,"imagedata");return n?{id:t.attr(s,"numPicBulletId"),referenceId:t.attr(n,"id"),style:t.attr(r,"style")}:null}class yr extends ke{constructor(t,e,r){super(t,e),this._documentParser=r}parseXml(t){Object.assign(this,pr(t,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(t)}}class kr extends ke{constructor(t,e,r){super(t,e),this._documentParser=r}parseXml(t){this.styles=this._documentParser.parseStylesFile(t)}}var T;(function(s){s.Document="document",s.Paragraph="paragraph",s.Run="run",s.Break="break",s.NoBreakHyphen="noBreakHyphen",s.Table="table",s.Row="row",s.Cell="cell",s.Hyperlink="hyperlink",s.SmartTag="smartTag",s.Drawing="drawing",s.Image="image",s.Text="text",s.Tab="tab",s.Symbol="symbol",s.BookmarkStart="bookmarkStart",s.BookmarkEnd="bookmarkEnd",s.Footer="footer",s.Header="header",s.FootnoteReference="footnoteReference",s.EndnoteReference="endnoteReference",s.Footnote="footnote",s.Endnote="endnote",s.SimpleField="simpleField",s.ComplexField="complexField",s.Instruction="instruction",s.VmlPicture="vmlPicture",s.MmlMath="mmlMath",s.MmlMathParagraph="mmlMathParagraph",s.MmlFraction="mmlFraction",s.MmlFunction="mmlFunction",s.MmlFunctionName="mmlFunctionName",s.MmlNumerator="mmlNumerator",s.MmlDenominator="mmlDenominator",s.MmlRadical="mmlRadical",s.MmlBase="mmlBase",s.MmlDegree="mmlDegree",s.MmlSuperscript="mmlSuperscript",s.MmlSubscript="mmlSubscript",s.MmlPreSubSuper="mmlPreSubSuper",s.MmlSubArgument="mmlSubArgument",s.MmlSuperArgument="mmlSuperArgument",s.MmlNary="mmlNary",s.MmlDelimiter="mmlDelimiter",s.MmlRun="mmlRun",s.MmlEquationArray="mmlEquationArray",s.MmlLimit="mmlLimit",s.MmlLimitLower="mmlLimitLower",s.MmlMatrix="mmlMatrix",s.MmlMatrixRow="mmlMatrixRow",s.MmlBox="mmlBox",s.MmlBar="mmlBar",s.MmlGroupChar="mmlGroupChar",s.VmlElement="vmlElement",s.Inserted="inserted",s.Deleted="deleted",s.DeletedText="deletedText",s.Comment="comment",s.CommentReference="commentReference",s.CommentRangeStart="commentRangeStart",s.CommentRangeEnd="commentRangeEnd",s.AltChunk="altChunk"})(T||(T={}));class Ae{constructor(){this.children=[],this.cssStyle={}}}class wr extends Ae{constructor(){super(...arguments),this.type=T.Header}}class _r extends Ae{constructor(){super(...arguments),this.type=T.Footer}}class bt extends ke{constructor(t,e,r){super(t,e),this._documentParser=r}parseXml(t){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(t)}}class Sr extends bt{createRootElement(){return new wr}}class xr extends bt{createRootElement(){return new _r}}function Cr(s,t){const e={};for(let r of t.elements(s))switch(r.localName){case"Template":e.template=r.textContent;break;case"Pages":e.pages=Te(r.textContent);break;case"Words":e.words=Te(r.textContent);break;case"Characters":e.characters=Te(r.textContent);break;case"Application":e.application=r.textContent;break;case"Lines":e.lines=Te(r.textContent);break;case"Paragraphs":e.paragraphs=Te(r.textContent);break;case"Company":e.company=r.textContent;break;case"AppVersion":e.appVersion=r.textContent;break}return e}function Te(s){if(!(typeof s>"u"))return parseInt(s)}class Pr extends ke{parseXml(t){this.props=Cr(t,this._package.xmlParser)}}function Ar(s,t){const e={};for(let r of t.elements(s))switch(r.localName){case"title":e.title=r.textContent;break;case"description":e.description=r.textContent;break;case"subject":e.subject=r.textContent;break;case"creator":e.creator=r.textContent;break;case"keywords":e.keywords=r.textContent;break;case"language":e.language=r.textContent;break;case"lastModifiedBy":e.lastModifiedBy=r.textContent;break;case"revision":r.textContent&&(e.revision=parseInt(r.textContent));break}return e}class Er extends ke{parseXml(t){this.props=Ar(t,this._package.xmlParser)}}class Nr{}function Br(s,t){var e=new Nr,r=t.element(s,"themeElements");for(let n of t.elements(r))switch(n.localName){case"clrScheme":e.colorScheme=Mr(n,t);break;case"fontScheme":e.fontScheme=Tr(n,t);break}return e}function Mr(s,t){var e={name:t.attr(s,"name"),colors:{}};for(let a of t.elements(s)){var r=t.element(a,"srgbClr"),n=t.element(a,"sysClr");r?e.colors[a.localName]=t.attr(r,"val"):n&&(e.colors[a.localName]=t.attr(n,"lastClr"))}return e}function Tr(s,t){var e={name:t.attr(s,"name")};for(let r of t.elements(s))switch(r.localName){case"majorFont":e.majorFont=vt(r,t);break;case"minorFont":e.minorFont=vt(r,t);break}return e}function vt(s,t){return{latinTypeface:t.elementAttr(s,"latin","typeface"),eaTypeface:t.elementAttr(s,"ea","typeface"),csTypeface:t.elementAttr(s,"cs","typeface")}}class Rr extends ke{constructor(t,e){super(t,e)}parseXml(t){this.theme=Br(t,this._package.xmlParser)}}class yt{}class zr extends yt{constructor(){super(...arguments),this.type=T.Footnote}}class Fr extends yt{constructor(){super(...arguments),this.type=T.Endnote}}class kt extends ke{constructor(t,e,r){super(t,e),this._documentParser=r}}class Ir extends kt{constructor(t,e,r){super(t,e,r)}parseXml(t){this.notes=this._documentParser.parseNotes(t,"footnote",zr)}}class Or extends kt{constructor(t,e,r){super(t,e,r)}parseXml(t){this.notes=this._documentParser.parseNotes(t,"endnote",Fr)}}function Dr(s,t){var e={};for(let r of t.elements(s))switch(r.localName){case"defaultTabStop":e.defaultTabStop=t.lengthAttr(r,"val");break;case"footnotePr":e.footnoteProps=wt(r,t);break;case"endnotePr":e.endnoteProps=wt(r,t);break;case"autoHyphenation":e.autoHyphenation=t.boolAttr(r,"val");break;case"evenAndOddHeaders":e.evenAndOddHeaders=t.boolAttr(r,"val",!0);break}return e}function wt(s,t){var e={defaultNoteIds:[]};for(let r of t.elements(s))switch(r.localName){case"numFmt":e.nummeringFormat=t.attr(r,"val");break;case"footnote":case"endnote":e.defaultNoteIds.push(t.attr(r,"id"));break}return e}class Lr extends ke{constructor(t,e){super(t,e)}parseXml(t){this.settings=Dr(t,this._package.xmlParser)}}function $r(s,t){return t.elements(s,"property").map(e=>{const r=e.firstChild;return{formatId:t.attr(e,"fmtid"),name:t.attr(e,"name"),type:r.nodeName,value:r.textContent}})}class jr extends ke{parseXml(t){this.props=$r(t,this._package.xmlParser)}}class Ur extends ke{constructor(t,e,r){super(t,e),this._documentParser=r}parseXml(t){this.comments=this._documentParser.parseComments(t),this.commentMap=Pe(this.comments,e=>e.id)}}class Hr extends ke{constructor(t,e){super(t,e),this.comments=[]}parseXml(t){const e=this._package.xmlParser;for(let r of e.elements(t,"commentEx"))this.comments.push({paraId:e.attr(r,"paraId"),paraIdParent:e.attr(r,"paraIdParent"),done:e.boolAttr(r,"done")});this.commentMap=Pe(this.comments,r=>r.paraId)}}const Wr=[{type:he.OfficeDocument,target:"word/document.xml"},{type:he.ExtendedProperties,target:"docProps/app.xml"},{type:he.CoreProperties,target:"docProps/core.xml"},{type:he.CustomProperties,target:"docProps/custom.xml"}];class rt{constructor(){this.parts=[],this.partsMap={},this.contentTypes=[]}static async load(t,e,r){var n=new rt;return n._options=r,n._parser=e,n._package=await et.load(t,r),n.rels=await n._package.loadRelationships(),n.contentTypes=await n._package.loadContentTypes(),await Promise.all(Wr.map(a=>{const i=n.rels.find(o=>o.type===a.type)??a;return n.loadRelationshipPart(i.target,i.type)})),n}save(t="blob"){return this._package.save(t)}async loadRelationshipPart(t,e){var n;if(this.partsMap[t])return this.partsMap[t];if(!this._package.get(t))return null;let r=null;switch(e){case he.OfficeDocument:this.documentPart=r=new ir(this._package,t,this._parser);break;case he.FontTable:this.fontTablePart=r=new nr(this._package,t);break;case he.Numbering:this.numberingPart=r=new yr(this._package,t,this._parser);break;case he.Styles:this.stylesPart=r=new kr(this._package,t,this._parser);break;case he.Theme:this.themePart=r=new Rr(this._package,t);break;case he.Footnotes:this.footnotesPart=r=new Ir(this._package,t,this._parser);break;case he.Endnotes:this.endnotesPart=r=new Or(this._package,t,this._parser);break;case he.Footer:r=new xr(this._package,t,this._parser);break;case he.Header:r=new Sr(this._package,t,this._parser);break;case he.CoreProperties:this.corePropsPart=r=new Er(this._package,t);break;case he.ExtendedProperties:this.extendedPropsPart=r=new Pr(this._package,t);break;case he.CustomProperties:r=new jr(this._package,t);break;case he.Settings:this.settingsPart=r=new Lr(this._package,t);break;case he.Comments:this.commentsPart=r=new Ur(this._package,t,this._parser);break;case he.CommentsExtended:this.commentsExtendedPart=r=new Hr(this._package,t);break}if(r==null)return Promise.resolve(null);if(this.partsMap[t]=r,this.parts.push(r),await r.load(),((n=r.rels)==null?void 0:n.length)>0){const[a]=$e(r.path);await Promise.all(r.rels.map(i=>this.loadRelationshipPart(Je(i.target,a),i.type)))}return r}async loadDocumentImage(t,e){const r=this.getPathById(e??this.documentPart,t);return r?this.blobToURL(await this._package.load(r,"blob"),r):null}async loadNumberingImage(t){const e=this.getPathById(this.numberingPart,t);return e?this.blobToURL(await this._package.load(e,"blob"),e):null}async loadFont(t,e){const r=this.getPathById(this.fontTablePart,t);if(!r)return null;const n=await this._package.load(r,"uint8array");return n&&this.blobToURL(new Blob([Zr(n,e)]),r)}async loadAltChunk(t,e){const r=this.getPathById(e??this.documentPart,t);return r?this._package.load(r,"string"):Promise.resolve(null)}blobToURL(t,e){if(!t)return null;if(e){const r=this.contentTypes.find(n=>n.partName===e||n.extension&&e.endsWith(`.${n.extension}`));t=r?new Blob([t],{type:r.contentType}):t}return this._options.useBase64URL?Vt(t):URL.createObjectURL(t)}findPartByRelId(t,e=null){var r=(e.rels??this.rels).find(a=>a.id==t);const n=e?$e(e.path)[0]:"";return r?this.partsMap[Je(r.target,n)]:null}getPathById(t,e){const r=t.rels.find(a=>a.id==e),[n]=$e(t.path);return r?Je(r.target,n):null}}function Zr(s,t){const r=t.replace(/{|}|-/g,""),n=new Array(16);for(let a=0;a<16;a++)n[16-a-1]=parseInt(r.substring(a*2,a*2+2),16);for(let a=0;a<32;a++)s[a]=s[a]^n[a%16];return s}function Vr(s,t){return{type:T.BookmarkStart,id:t.attr(s,"id"),name:t.attr(s,"name"),colFirst:t.intAttr(s,"colFirst"),colLast:t.intAttr(s,"colLast")}}function Gr(s,t){return{type:T.BookmarkEnd,id:t.attr(s,"id")}}class Xr extends Ae{constructor(){super(...arguments),this.type=T.VmlElement,this.attrs={}}}function _t(s,t){var e=new Xr;switch(s.localName){case"rect":e.tagName="rect",Object.assign(e.attrs,{width:"100%",height:"100%"});break;case"oval":e.tagName="ellipse",Object.assign(e.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":e.tagName="line";break;case"shape":e.tagName="g";break;case"textbox":e.tagName="foreignObject",Object.assign(e.attrs,{width:"100%",height:"100%"});break;default:return null}for(const r of x.attrs(s))switch(r.localName){case"style":e.cssStyleText=r.value;break;case"fillcolor":e.attrs.fill=r.value;break;case"from":const[n,a]=St(r.value);Object.assign(e.attrs,{x1:n,y1:a});break;case"to":const[i,o]=St(r.value);Object.assign(e.attrs,{x2:i,y2:o});break}for(const r of x.elements(s))switch(r.localName){case"stroke":Object.assign(e.attrs,qr(r));break;case"fill":Object.assign(e.attrs,Yr());break;case"imagedata":e.tagName="image",Object.assign(e.attrs,{width:"100%",height:"100%"}),e.imageHref={id:x.attr(r,"id"),title:x.attr(r,"title")};break;case"txbxContent":e.children.push(...t.parseBodyElements(r));break;default:const n=_t(r,t);n&&e.children.push(n);break}return e}function qr(s){return{stroke:x.attr(s,"color"),"stroke-width":x.lengthAttr(s,"weight",me.Emu)??"1px"}}function Yr(s){return{}}function St(s){return s.split(",")}class Jr extends Ae{constructor(){super(...arguments),this.type=T.Comment}}class Kr extends Ae{constructor(t){super(),this.id=t,this.type=T.CommentReference}}class Qr extends Ae{constructor(t){super(),this.id=t,this.type=T.CommentRangeStart}}class en extends Ae{constructor(t){super(),this.id=t,this.type=T.CommentRangeEnd}}var He={shd:"inherit",color:"black",borderColor:"black",highlight:"transparent"};const tn=[],xt={oMath:T.MmlMath,oMathPara:T.MmlMathParagraph,f:T.MmlFraction,func:T.MmlFunction,fName:T.MmlFunctionName,num:T.MmlNumerator,den:T.MmlDenominator,rad:T.MmlRadical,deg:T.MmlDegree,e:T.MmlBase,sSup:T.MmlSuperscript,sSub:T.MmlSubscript,sPre:T.MmlPreSubSuper,sup:T.MmlSuperArgument,sub:T.MmlSubArgument,d:T.MmlDelimiter,nary:T.MmlNary,eqArr:T.MmlEquationArray,lim:T.MmlLimit,limLow:T.MmlLimitLower,m:T.MmlMatrix,mr:T.MmlMatrixRow,box:T.MmlBox,bar:T.MmlBar,groupChr:T.MmlGroupChar};class rn{constructor(t){this.options={ignoreWidth:!1,debug:!1,...t}}parseNotes(t,e,r){var n=[];for(let a of x.elements(t,e)){const i=new r;i.id=x.attr(a,"id"),i.noteType=x.attr(a,"type"),i.children=this.parseBodyElements(a),n.push(i)}return n}parseComments(t){var e=[];for(let r of x.elements(t,"comment")){const n=new Jr;n.id=x.attr(r,"id"),n.author=x.attr(r,"author"),n.initials=x.attr(r,"initials"),n.date=x.attr(r,"date"),n.children=this.parseBodyElements(r),e.push(n)}return e}parseDocumentFile(t){var e=x.element(t,"body"),r=x.element(t,"background"),n=x.element(e,"sectPr");return{type:T.Document,children:this.parseBodyElements(e),props:n?dt(n,x):{},cssStyle:r?this.parseBackground(r):{}}}parseBackground(t){var e={},r=Ne.colorAttr(t,"color");return r&&(e["background-color"]=r),e}parseBodyElements(t){var e=[];for(const r of x.elements(t))switch(r.localName){case"p":e.push(this.parseParagraph(r));break;case"altChunk":e.push(this.parseAltChunk(r));break;case"tbl":e.push(this.parseTable(r));break;case"sdt":e.push(...this.parseSdt(r,n=>this.parseBodyElements(n)));break}return e}parseStylesFile(t){var e=[];for(const r of x.elements(t))switch(r.localName){case"style":e.push(this.parseStyle(r));break;case"docDefaults":e.push(this.parseDefaultStyles(r));break}return e}parseDefaultStyles(t){var e={id:null,name:null,target:null,basedOn:null,styles:[]};for(const a of x.elements(t))switch(a.localName){case"rPrDefault":var r=x.element(a,"rPr");r&&e.styles.push({target:"span",values:this.parseDefaultProperties(r,{})});break;case"pPrDefault":var n=x.element(a,"pPr");n&&e.styles.push({target:"p",values:this.parseDefaultProperties(n,{})});break}return e}parseStyle(t){var e={id:x.attr(t,"styleId"),isDefault:x.boolAttr(t,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch(x.attr(t,"type")){case"paragraph":e.target="p";break;case"table":e.target="table";break;case"character":e.target="span";break}for(const r of x.elements(t))switch(r.localName){case"basedOn":e.basedOn=x.attr(r,"val");break;case"name":e.name=x.attr(r,"val");break;case"link":e.linked=x.attr(r,"val");break;case"next":e.next=x.attr(r,"val");break;case"aliases":e.aliases=x.attr(r,"val").split(",");break;case"pPr":e.styles.push({target:"p",values:this.parseDefaultProperties(r,{})}),e.paragraphProps=pt(r,x);break;case"rPr":e.styles.push({target:"span",values:this.parseDefaultProperties(r,{})}),e.runProps=tt(r,x);break;case"tblPr":case"tcPr":e.styles.push({target:"td",values:this.parseDefaultProperties(r,{})});break;case"tblStylePr":for(let n of this.parseTableStyle(r))e.styles.push(n);break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:this.options.debug&&console.warn(`DOCX: Unknown style element: ${r.localName}`)}return e}parseTableStyle(t){var e=[],r=x.attr(t,"type"),n="",a="";switch(r){case"firstRow":a=".first-row",n="tr.first-row td";break;case"lastRow":a=".last-row",n="tr.last-row td";break;case"firstCol":a=".first-col",n="td.first-col";break;case"lastCol":a=".last-col",n="td.last-col";break;case"band1Vert":a=":not(.no-vband)",n="td.odd-col";break;case"band2Vert":a=":not(.no-vband)",n="td.even-col";break;case"band1Horz":a=":not(.no-hband)",n="tr.odd-row";break;case"band2Horz":a=":not(.no-hband)",n="tr.even-row";break;default:return[]}for(const i of x.elements(t))switch(i.localName){case"pPr":e.push({target:`${n} p`,mod:a,values:this.parseDefaultProperties(i,{})});break;case"rPr":e.push({target:`${n} span`,mod:a,values:this.parseDefaultProperties(i,{})});break;case"tblPr":case"tcPr":e.push({target:n,mod:a,values:this.parseDefaultProperties(i,{})});break}return e}parseNumberingFile(t){const e=[],r=[],n=[];for(const a of x.elements(t))switch(a.localName){case"abstractNum":e.push(...this.parseAbstractNumbering(a,n));break;case"numPicBullet":n.push(this.parseNumberingPicBullet(a));break;case"num":r.push({numId:x.attr(a,"numId"),abstractNumId:x.elementAttr(a,"abstractNumId","val")});break}return r.flatMap(a=>e.filter(i=>a.abstractNumId==i.id).map(i=>({...i,id:a.numId})))}parseNumberingPicBullet(t){var e=x.element(t,"pict"),r=e&&x.element(e,"shape"),n=r&&x.element(r,"imagedata");return n?{id:x.intAttr(t,"numPicBulletId"),src:x.attr(n,"id"),style:x.attr(r,"style")}:null}parseAbstractNumbering(t,e){var r=[],n=x.attr(t,"abstractNumId");for(const a of x.elements(t))switch(a.localName){case"lvl":r.push(this.parseNumberingLevel(n,a,e));break}return r}parseNumberingLevel(t,e,r){var n={id:t,level:x.intAttr(e,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};for(const i of x.elements(e))switch(i.localName){case"start":n.start=x.intAttr(i,"val");break;case"pPr":this.parseDefaultProperties(i,n.pStyle);break;case"rPr":this.parseDefaultProperties(i,n.rStyle);break;case"lvlPicBulletId":var a=x.intAttr(i,"val");n.bullet=r.find(o=>(o==null?void 0:o.id)==a);break;case"lvlText":n.levelText=x.attr(i,"val");break;case"pStyle":n.pStyleName=x.attr(i,"val");break;case"numFmt":n.format=x.attr(i,"val");break;case"suff":n.suff=x.attr(i,"val");break}return n}parseSdt(t,e){const r=x.element(t,"sdtContent");return r?e(r):[]}parseChange(t,e,r){var n;return{type:t,children:((n=r(e))==null?void 0:n.children)??[],id:x.attr(e,"id"),author:x.attr(e,"author"),date:x.attr(e,"date")}}parseAltChunk(t){return{type:T.AltChunk,children:[],id:x.attr(t,"id")}}parseParagraph(t){var e={type:T.Paragraph,children:[]};for(let r of x.elements(t))switch(r.localName){case"pPr":this.parseParagraphProperties(r,e);break;case"r":e.children.push(this.parseRun(r,e));break;case"hyperlink":e.children.push(this.parseHyperlink(r,e));break;case"smartTag":e.children.push(this.parseSmartTag(r,e));break;case"bookmarkStart":e.children.push(Vr(r,x));break;case"bookmarkEnd":e.children.push(Gr(r,x));break;case"commentRangeStart":e.children.push(new Qr(x.attr(r,"id")));break;case"commentRangeEnd":e.children.push(new en(x.attr(r,"id")));break;case"oMath":case"oMathPara":e.children.push(this.parseMathElement(r));break;case"sdt":e.children.push(...this.parseSdt(r,n=>this.parseParagraph(n).children));break;case"ins":e.children.push(this.parseChange(T.Inserted,r,n=>this.parseParagraph(n)));break;case"del":e.children.push(this.parseChange(T.Deleted,r,n=>this.parseParagraph(n)));break}return e}parseParagraphProperties(t,e){this.parseDefaultProperties(t,e.cssStyle={},null,r=>{if(mt(r,e,x))return!0;switch(r.localName){case"pStyle":e.styleName=x.attr(r,"val");break;case"cnfStyle":e.className=le.classNameOfCnfStyle(r);break;case"framePr":this.parseFrame(r,e);break;case"rPr":break;default:return!1}return!0})}parseFrame(t,e){var r=x.attr(t,"dropCap");r=="drop"&&(e.cssStyle.float="left")}parseHyperlink(t,e){var r={type:T.Hyperlink,parent:e,children:[]};r.anchor=x.attr(t,"anchor"),r.id=x.attr(t,"id");for(const n of x.elements(t))switch(n.localName){case"r":r.children.push(this.parseRun(n,r));break}return r}parseSmartTag(t,e){var r={type:T.SmartTag,parent:e,children:[]},n=x.attr(t,"uri"),a=x.attr(t,"element");n&&(r.uri=n),a&&(r.element=a);for(const i of x.elements(t))switch(i.localName){case"r":r.children.push(this.parseRun(i,r));break;case"smartTag":r.children.push(this.parseSmartTag(i,r));break}return r}parseRun(t,e){var r={type:T.Run,parent:e,children:[]};for(let n of x.elements(t))switch(n=this.checkAlternateContent(n),n==null?void 0:n.localName){case"t":r.children.push({type:T.Text,text:n.textContent});break;case"delText":r.children.push({type:T.DeletedText,text:n.textContent});break;case"commentReference":r.children.push(new Kr(x.attr(n,"id")));break;case"fldSimple":r.children.push({type:T.SimpleField,instruction:x.attr(n,"instr"),lock:x.boolAttr(n,"lock",!1),dirty:x.boolAttr(n,"dirty",!1)});break;case"instrText":r.fieldRun=!0,r.children.push({type:T.Instruction,text:n.textContent});break;case"fldChar":r.fieldRun=!0,r.children.push({type:T.ComplexField,charType:x.attr(n,"fldCharType"),lock:x.boolAttr(n,"lock",!1),dirty:x.boolAttr(n,"dirty",!1)});break;case"noBreakHyphen":r.children.push({type:T.NoBreakHyphen});break;case"br":r.children.push({type:T.Break,break:x.attr(n,"type")||"textWrapping"});break;case"lastRenderedPageBreak":r.children.push({type:T.Break,break:"lastRenderedPageBreak"});break;case"sym":r.children.push({type:T.Symbol,font:Ye(x.attr(n,"font")),char:x.hexAttr(n,"char")});break;case"tab":r.children.push({type:T.Tab});break;case"footnoteReference":r.children.push({type:T.FootnoteReference,id:x.attr(n,"id")});break;case"endnoteReference":r.children.push({type:T.EndnoteReference,id:x.attr(n,"id")});break;case"drawing":let a=this.parseDrawing(n);a&&r.children.push(a);break;case"pict":r.children.push(this.parseVmlPicture(n));break;case"rPr":this.parseRunProperties(n,r);break}return r}parseMathElement(t){const e=`${t.localName}Pr`,r={type:xt[t.localName],children:[]};for(const a of x.elements(t))if(xt[a.localName])r.children.push(this.parseMathElement(a));else if(a.localName=="r"){var n=this.parseRun(a);n.type=T.MmlRun,r.children.push(n)}else a.localName==e&&(r.props=this.parseMathProperies(a));return r}parseMathProperies(t){const e={};for(const r of x.elements(t))switch(r.localName){case"chr":e.char=x.attr(r,"val");break;case"vertJc":e.verticalJustification=x.attr(r,"val");break;case"pos":e.position=x.attr(r,"val");break;case"degHide":e.hideDegree=x.boolAttr(r,"val");break;case"begChr":e.beginChar=x.attr(r,"val");break;case"endChr":e.endChar=x.attr(r,"val");break}return e}parseRunProperties(t,e){this.parseDefaultProperties(t,e.cssStyle={},null,r=>{switch(r.localName){case"rStyle":e.styleName=x.attr(r,"val");break;case"vertAlign":e.verticalAlign=le.valueOfVertAlign(r,!0);break;default:return!1}return!0})}parseVmlPicture(t){const e={type:T.VmlPicture,children:[]};for(const r of x.elements(t)){const n=_t(r,this);n&&e.children.push(n)}return e}checkAlternateContent(t){var a;if(t.localName!="AlternateContent")return t;var e=x.element(t,"Choice");if(e){var r=x.attr(e,"Requires"),n=t.lookupNamespaceURI(r);if(tn.includes(n))return e.firstElementChild}return(a=x.element(t,"Fallback"))==null?void 0:a.firstElementChild}parseDrawing(t){for(var e of x.elements(t))switch(e.localName){case"inline":case"anchor":return this.parseDrawingWrapper(e)}}parseDrawingWrapper(t){var e={type:T.Drawing,children:[],cssStyle:{}},r=t.localName=="anchor";let n=null,a=x.boolAttr(t,"simplePos");x.boolAttr(t,"behindDoc");let i={relative:"page",align:"left",offset:"0"},o={relative:"page",align:"top",offset:"0"};for(var c of x.elements(t))switch(c.localName){case"simplePos":a&&(i.offset=x.lengthAttr(c,"x",me.Emu),o.offset=x.lengthAttr(c,"y",me.Emu));break;case"extent":e.cssStyle.width=x.lengthAttr(c,"cx",me.Emu),e.cssStyle.height=x.lengthAttr(c,"cy",me.Emu);break;case"positionH":case"positionV":if(!a){let b=c.localName=="positionH"?i:o;var g=x.element(c,"align"),_=x.element(c,"posOffset");b.relative=x.attr(c,"relativeFrom")??b.relative,g&&(b.align=g.textContent),_&&(b.offset=lt(_.textContent,me.Emu))}break;case"wrapTopAndBottom":n="wrapTopAndBottom";break;case"wrapNone":n="wrapNone";break;case"graphic":var y=this.parseGraphic(c);y&&e.children.push(y);break}return n=="wrapTopAndBottom"?(e.cssStyle.display="block",i.align&&(e.cssStyle["text-align"]=i.align,e.cssStyle.width="100%")):n=="wrapNone"?(e.cssStyle.display="block",e.cssStyle.position="relative",e.cssStyle.width="0px",e.cssStyle.height="0px",i.offset&&(e.cssStyle.left=i.offset),o.offset&&(e.cssStyle.top=o.offset)):r&&(i.align=="left"||i.align=="right")&&(e.cssStyle.float=i.align),e}parseGraphic(t){var e=x.element(t,"graphicData");for(let r of x.elements(e))switch(r.localName){case"pic":return this.parsePicture(r)}return null}parsePicture(t){var e={type:T.Image,src:"",cssStyle:{}},r=x.element(t,"blipFill"),n=x.element(r,"blip"),a=x.element(r,"srcRect");e.src=x.attr(n,"embed"),a&&(e.srcRect=[x.intAttr(a,"l",0)/1e5,x.intAttr(a,"t",0)/1e5,x.intAttr(a,"r",0)/1e5,x.intAttr(a,"b",0)/1e5]);var i=x.element(t,"spPr"),o=x.element(i,"xfrm");if(e.cssStyle.position="relative",o){e.rotation=x.intAttr(o,"rot",0)/6e4;for(var c of x.elements(o))switch(c.localName){case"ext":e.cssStyle.width=x.lengthAttr(c,"cx",me.Emu),e.cssStyle.height=x.lengthAttr(c,"cy",me.Emu);break;case"off":e.cssStyle.left=x.lengthAttr(c,"x",me.Emu),e.cssStyle.top=x.lengthAttr(c,"y",me.Emu);break}}return e}parseTable(t){var e={type:T.Table,children:[]};for(const r of x.elements(t))switch(r.localName){case"tr":e.children.push(this.parseTableRow(r));break;case"tblGrid":e.columns=this.parseTableColumns(r);break;case"tblPr":this.parseTableProperties(r,e);break}return e}parseTableColumns(t){var e=[];for(const r of x.elements(t))switch(r.localName){case"gridCol":e.push({width:x.lengthAttr(r,"w")});break}return e}parseTableProperties(t,e){switch(e.cssStyle={},e.cellStyle={},this.parseDefaultProperties(t,e.cssStyle,e.cellStyle,r=>{switch(r.localName){case"tblStyle":e.styleName=x.attr(r,"val");break;case"tblLook":e.className=le.classNameOftblLook(r);break;case"tblpPr":this.parseTablePosition(r,e);break;case"tblStyleColBandSize":e.colBandSize=x.intAttr(r,"val");break;case"tblStyleRowBandSize":e.rowBandSize=x.intAttr(r,"val");break;case"hidden":e.cssStyle.display="none";break;default:return!1}return!0}),e.cssStyle["text-align"]){case"center":delete e.cssStyle["text-align"],e.cssStyle["margin-left"]="auto",e.cssStyle["margin-right"]="auto";break;case"right":delete e.cssStyle["text-align"],e.cssStyle["margin-left"]="auto";break}}parseTablePosition(t,e){var r=x.lengthAttr(t,"topFromText"),n=x.lengthAttr(t,"bottomFromText"),a=x.lengthAttr(t,"rightFromText"),i=x.lengthAttr(t,"leftFromText");e.cssStyle.float="left",e.cssStyle["margin-bottom"]=le.addSize(e.cssStyle["margin-bottom"],n),e.cssStyle["margin-left"]=le.addSize(e.cssStyle["margin-left"],i),e.cssStyle["margin-right"]=le.addSize(e.cssStyle["margin-right"],a),e.cssStyle["margin-top"]=le.addSize(e.cssStyle["margin-top"],r)}parseTableRow(t){var e={type:T.Row,children:[]};for(const r of x.elements(t))switch(r.localName){case"tc":e.children.push(this.parseTableCell(r));break;case"trPr":case"tblPrEx":this.parseTableRowProperties(r,e);break}return e}parseTableRowProperties(t,e){e.cssStyle=this.parseDefaultProperties(t,{},null,r=>{switch(r.localName){case"cnfStyle":e.className=le.classNameOfCnfStyle(r);break;case"tblHeader":e.isHeader=x.boolAttr(r,"val");break;case"gridBefore":e.gridBefore=x.intAttr(r,"val");break;case"gridAfter":e.gridAfter=x.intAttr(r,"val");break;default:return!1}return!0})}parseTableCell(t){var e={type:T.Cell,children:[]};for(const r of x.elements(t))switch(r.localName){case"tbl":e.children.push(this.parseTable(r));break;case"p":e.children.push(this.parseParagraph(r));break;case"tcPr":this.parseTableCellProperties(r,e);break}return e}parseTableCellProperties(t,e){e.cssStyle=this.parseDefaultProperties(t,{},null,r=>{switch(r.localName){case"gridSpan":e.span=x.intAttr(r,"val",null);break;case"vMerge":e.verticalMerge=x.attr(r,"val")??"continue";break;case"cnfStyle":e.className=le.classNameOfCnfStyle(r);break;default:return!1}return!0}),this.parseTableCellVerticalText(t,e)}parseTableCellVerticalText(t,e){const r={btLr:{writingMode:"vertical-rl",transform:"rotate(180deg)"},lrTb:{writingMode:"vertical-lr",transform:"none"},tbRl:{writingMode:"vertical-rl",transform:"none"}};for(const n of x.elements(t))if(n.localName==="textDirection"){const a=x.attr(n,"val"),i=r[a]||{writingMode:"horizontal-tb"};e.cssStyle["writing-mode"]=i.writingMode,e.cssStyle.transform=i.transform}}parseDefaultProperties(t,e=null,r=null,n=null){e=e||{};for(const a of x.elements(t))if(!(n!=null&&n(a)))switch(a.localName){case"jc":e["text-align"]=le.valueOfJc(a);break;case"textAlignment":e["vertical-align"]=le.valueOfTextAlignment(a);break;case"color":e.color=Ne.colorAttr(a,"val",null,He.color);break;case"sz":e["font-size"]=e["min-height"]=x.lengthAttr(a,"val",me.FontSize);break;case"shd":e["background-color"]=Ne.colorAttr(a,"fill",null,He.shd);break;case"highlight":e["background-color"]=Ne.colorAttr(a,"val",null,He.highlight);break;case"vertAlign":break;case"position":e.verticalAlign=x.lengthAttr(a,"val",me.FontSize);break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":e.width=le.valueOfSize(a,"w");break;case"trHeight":this.parseTrHeight(a,e);break;case"strike":e["text-decoration"]=x.boolAttr(a,"val",!0)?"line-through":"none";break;case"b":e["font-weight"]=x.boolAttr(a,"val",!0)?"bold":"normal";break;case"i":e["font-style"]=x.boolAttr(a,"val",!0)?"italic":"normal";break;case"caps":e["text-transform"]=x.boolAttr(a,"val",!0)?"uppercase":"none";break;case"smallCaps":e["font-variant"]=x.boolAttr(a,"val",!0)?"small-caps":"none";break;case"u":this.parseUnderline(a,e);break;case"ind":case"tblInd":this.parseIndentation(a,e);break;case"rFonts":this.parseFont(a,e);break;case"tblBorders":this.parseBorderProperties(a,r||e);break;case"tblCellSpacing":e["border-spacing"]=le.valueOfMargin(a),e["border-collapse"]="separate";break;case"pBdr":this.parseBorderProperties(a,e);break;case"bdr":e.border=le.valueOfBorder(a);break;case"tcBorders":this.parseBorderProperties(a,e);break;case"vanish":x.boolAttr(a,"val",!0)&&(e.display="none");break;case"kern":break;case"noWrap":break;case"tblCellMar":case"tcMar":this.parseMarginProperties(a,r||e);break;case"tblLayout":e["table-layout"]=le.valueOfTblLayout(a);break;case"vAlign":e["vertical-align"]=le.valueOfTextAlignment(a);break;case"spacing":t.localName=="pPr"&&this.parseSpacing(a,e);break;case"wordWrap":x.boolAttr(a,"val")&&(e["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":e.hyphens=x.boolAttr(a,"val",!0)?"none":"auto";break;case"lang":e.$lang=x.attr(a,"val");break;case"rtl":case"bidi":x.boolAttr(a,"val",!0)&&(e.direction="rtl");break;case"bCs":case"iCs":case"szCs":case"tabs":case"outlineLvl":case"contextualSpacing":case"tblStyleColBandSize":case"tblStyleRowBandSize":case"webHidden":case"pageBreakBefore":case"suppressLineNumbers":case"keepLines":case"keepNext":case"widowControl":case"noProof":break;default:this.options.debug&&console.warn(`DOCX: Unknown document element: ${t.localName}.${a.localName}`);break}return e}parseUnderline(t,e){var r=x.attr(t,"val");if(r!=null){switch(r){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":e["text-decoration"]="underline dashed";break;case"dotted":case"dottedHeavy":e["text-decoration"]="underline dotted";break;case"double":e["text-decoration"]="underline double";break;case"single":case"thick":e["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":e["text-decoration"]="underline wavy";break;case"words":e["text-decoration"]="underline";break;case"none":e["text-decoration"]="none";break}var n=Ne.colorAttr(t,"color");n&&(e["text-decoration-color"]=n)}}parseFont(t,e){var r=x.attr(t,"ascii"),n=le.themeValue(t,"asciiTheme"),a=x.attr(t,"eastAsia"),i=[r,n,a].filter(o=>o).map(o=>Ye(o));i.length>0&&(e["font-family"]=[...new Set(i)].join(", "))}parseIndentation(t,e){var r=x.lengthAttr(t,"firstLine"),n=x.lengthAttr(t,"hanging"),a=x.lengthAttr(t,"left"),i=x.lengthAttr(t,"start"),o=x.lengthAttr(t,"right"),c=x.lengthAttr(t,"end");r&&(e["text-indent"]=r),n&&(e["text-indent"]=`-${n}`),(a||i)&&(e["margin-inline-start"]=a||i),(o||c)&&(e["margin-inline-end"]=o||c)}parseSpacing(t,e){var r=x.lengthAttr(t,"before"),n=x.lengthAttr(t,"after"),a=x.intAttr(t,"line",null),i=x.attr(t,"lineRule");if(r&&(e["margin-top"]=r),n&&(e["margin-bottom"]=n),a!==null)switch(i){case"auto":e["line-height"]=`${(a/240).toFixed(2)}`;break;case"atLeast":e["line-height"]=`calc(100% + ${a/20}pt)`;break;default:e["line-height"]=e["min-height"]=`${a/20}pt`;break}}parseMarginProperties(t,e){for(const r of x.elements(t))switch(r.localName){case"left":e["padding-left"]=le.valueOfMargin(r);break;case"right":e["padding-right"]=le.valueOfMargin(r);break;case"top":e["padding-top"]=le.valueOfMargin(r);break;case"bottom":e["padding-bottom"]=le.valueOfMargin(r);break}}parseTrHeight(t,e){switch(x.attr(t,"hRule")){case"exact":e.height=x.lengthAttr(t,"val");break;case"atLeast":default:e.height=x.lengthAttr(t,"val");break}}parseBorderProperties(t,e){for(const r of x.elements(t))switch(r.localName){case"start":case"left":e["border-left"]=le.valueOfBorder(r);break;case"end":case"right":e["border-right"]=le.valueOfBorder(r);break;case"top":e["border-top"]=le.valueOfBorder(r);break;case"bottom":e["border-bottom"]=le.valueOfBorder(r);break}}}const nn=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"];class Ne{static colorAttr(t,e,r=null,n="black"){var a=x.attr(t,e);if(a)return a=="auto"?n:nn.includes(a)?a:`#${a}`;var i=x.attr(t,"themeColor");return i?`var(--docx-${i}-color)`:r}}class le{static themeValue(t,e){var r=x.attr(t,e);return r?`var(--docx-${r}-font)`:null}static valueOfSize(t,e){var r=me.Dxa;switch(x.attr(t,"type")){case"dxa":break;case"pct":r=me.Percent;break;case"auto":return"auto"}return x.lengthAttr(t,e,r)}static valueOfMargin(t){return x.lengthAttr(t,"w")}static valueOfBorder(t){var e=le.parseBorderType(x.attr(t,"val"));if(e=="none")return"none";var r=Ne.colorAttr(t,"color"),n=x.lengthAttr(t,"sz",me.Border);return`${n} ${e} ${r=="auto"?He.borderColor:r}`}static parseBorderType(t){switch(t){case"single":return"solid";case"dashDotStroked":return"solid";case"dashed":return"dashed";case"dashSmallGap":return"dashed";case"dotDash":return"dotted";case"dotDotDash":return"dotted";case"dotted":return"dotted";case"double":return"double";case"doubleWave":return"double";case"inset":return"inset";case"nil":return"none";case"none":return"none";case"outset":return"outset";case"thick":return"solid";case"thickThinLargeGap":return"solid";case"thickThinMediumGap":return"solid";case"thickThinSmallGap":return"solid";case"thinThickLargeGap":return"solid";case"thinThickMediumGap":return"solid";case"thinThickSmallGap":return"solid";case"thinThickThinLargeGap":return"solid";case"thinThickThinMediumGap":return"solid";case"thinThickThinSmallGap":return"solid";case"threeDEmboss":return"solid";case"threeDEngrave":return"solid";case"triple":return"double";case"wave":return"solid"}return"solid"}static valueOfTblLayout(t){var e=x.attr(t,"val");return e=="fixed"?"fixed":"auto"}static classNameOfCnfStyle(t){const e=x.attr(t,"val"),r=["first-row","last-row","first-col","last-col","odd-col","even-col","odd-row","even-row","ne-cell","nw-cell","se-cell","sw-cell"];if(e)return r.filter((a,i)=>e[i]=="1").join(" ");const n=["firstRow","lastRow","firstColumn","lastColumn","oddVBand","evenVBand","oddHBand","evenHBand","firstRowLastColumn","firstRowFirstColumn","lastRowLastColumn","lastRowFirstColumn"];return r.filter((a,i)=>x.boolAttr(t,n[i])).join(" ")}static valueOfJc(t){var e=x.attr(t,"val");switch(e){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return e}static valueOfVertAlign(t,e=!1){var r=x.attr(t,"val");switch(r){case"subscript":return"sub";case"superscript":return e?"sup":"super"}return e?null:r}static valueOfTextAlignment(t){var e=x.attr(t,"val");switch(e){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return e}static addSize(t,e){return t==null?e:e==null?t:`calc(${t} + ${e})`}static classNameOftblLook(t){const e=x.hexAttr(t,"val",0);let r="";return(x.boolAttr(t,"firstRow")||e&32)&&(r+=" first-row"),(x.boolAttr(t,"lastRow")||e&64)&&(r+=" last-row"),(x.boolAttr(t,"firstColumn")||e&128)&&(r+=" first-col"),(x.boolAttr(t,"lastColumn")||e&256)&&(r+=" last-col"),(x.boolAttr(t,"noHBand")||e&512)&&(r+=" no-hband"),(x.boolAttr(t,"noVBand")||e&1024)&&(r+=" no-vband"),r.trim()}}const Ct={pos:0,leader:"none",style:"left"},an=50;function sn(s=document.body){const t=document.createElement("div");t.style.width="100pt",s.appendChild(t);const e=100/t.offsetWidth;return s.removeChild(t),e}function on(s,t,e,r=72/96){const n=s.closest("p"),a=s.getBoundingClientRect(),i=n.getBoundingClientRect(),o=getComputedStyle(n),c=(t==null?void 0:t.length)>0?t.map(k=>({pos:Pt(k.position),leader:k.leader,style:k.style})).sort((k,C)=>k.pos-C.pos):[Ct],g=c[c.length-1],_=i.width*r,y=Pt(e);let b=g.pos+y;if(b<_)for(;b<_&&c.length<an;b+=y)c.push({...Ct,pos:b});const d=parseFloat(o.marginLeft),v=i.left+d,u=(a.left-v)*r,f=c.find(k=>k.style!="clear"&&k.pos>u);if(f==null)return;let p=1;if(f.style=="right"||f.style=="center"){const k=Array.from(n.querySelectorAll(`.${s.className}`)),C=k.indexOf(s)+1,A=document.createRange();A.setStart(s,1),C<k.length?A.setEndBefore(k[C]):A.setEndAfter(n);const E=f.style=="center"?.5:1,D=A.getBoundingClientRect(),F=D.left+E*D.width-(i.left-d);p=f.pos-F*r}else p=f.pos-u;switch(s.innerHTML="&nbsp;",s.style.textDecoration="inherit",s.style.wordSpacing=`${p.toFixed(0)}pt`,f.leader){case"dot":case"middleDot":s.style.textDecoration="underline",s.style.textDecorationStyle="dotted";break;case"hyphen":case"heavy":case"underscore":s.style.textDecoration="underline";break}}function Pt(s){return parseFloat(s)}var ie;(function(s){s.html="http://www.w3.org/1999/xhtml",s.svg="http://www.w3.org/2000/svg",s.mathML="http://www.w3.org/1998/Math/MathML"})(ie||(ie={}));function Re(s){if(Qe(s))return document.createTextNode(s);if(s instanceof Node)return s;const{ns:t,tagName:e,className:r,style:n,children:a,...i}=s;if(e==="#fragment"){const c=document.createDocumentFragment();return a&&a.forEach(g=>c.appendChild(Re(g))),c}if(e==="#comment")return document.createComment(a?a[0]:"");const o=t?document.createElementNS(t,e):document.createElement(e);if(r&&o.setAttribute("class",r),n&&(Qe(n)?o.setAttribute("style",n):Object.assign(o.style,n)),i)for(const[c,g]of Object.entries(i))g!==void 0&&(o[c]=g);return a&&a.forEach(c=>o.appendChild(Re(c))),o}function ln(...s){return s.filter(Boolean).join(" ")}class cn{constructor(){this.className="docx",this.styleMap={},this.currentPart=null,this.tableVerticalMerges=[],this.currentVerticalMerge=null,this.tableCellPositions=[],this.currentCellPosition=null,this.footnoteMap={},this.endnoteMap={},this.currentEndnoteIds=[],this.usedHederFooterParts=[],this.currentTabs=[],this.commentMap={},this.tasks=[],this.postRenderTasks=[],this.h=Re}async render(t,e){var a;this.document=t,this.options=e,this.className=e.className,this.rootSelector=e.inWrapper?`.${this.className}-wrapper`:":root",this.h=e.h??Re,this.styleMap=null,this.tasks=[],this.options.renderComments&&globalThis.Highlight&&(this.commentHighlight=new Highlight);const r=[...this.renderDefaultStyle()];t.themePart&&r.push(...this.renderTheme(t.themePart)),t.stylesPart!=null&&(this.styleMap=this.processStyles(t.stylesPart.styles),r.push(...this.renderStyles(t.stylesPart.styles))),t.numberingPart&&(this.prodessNumberings(t.numberingPart.domNumberings),r.push(...await this.renderNumbering(t.numberingPart.domNumberings))),t.footnotesPart&&(this.footnoteMap=Pe(t.footnotesPart.notes,i=>i.id)),t.endnotesPart&&(this.endnoteMap=Pe(t.endnotesPart.notes,i=>i.id)),t.settingsPart&&(this.defaultTabSize=(a=t.settingsPart.settings)==null?void 0:a.defaultTabStop),!e.ignoreFonts&&t.fontTablePart&&r.push(...await this.renderFontTable(t.fontTablePart));var n=this.renderSections(t.documentPart.body);return this.options.inWrapper?r.push(this.renderWrapper(n)):r.push(...n),this.commentHighlight&&e.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),this.postRenderTasks.forEach(i=>i()),await Promise.allSettled(this.tasks),this.refreshTabStops(),r}renderTheme(t){var i,o;const e={},r=(i=t.theme)==null?void 0:i.fontScheme;r&&(r.majorFont&&(e["--docx-majorHAnsi-font"]=r.majorFont.latinTypeface),r.minorFont&&(e["--docx-minorHAnsi-font"]=r.minorFont.latinTypeface));const n=(o=t.theme)==null?void 0:o.colorScheme;if(n)for(let[c,g]of Object.entries(n.colors))e[`--docx-${c}-color`]=`#${g}`;const a=this.styleToString(`.${this.className}`,e);return[this.h({tagName:"#comment",children:["docxjs document theme values"]}),this.h({tagName:"style",children:[a]})]}async renderFontTable(t){const e=[];for(let r of t.fonts)for(let n of r.embedFontRefs)try{const a=await this.document.loadFont(n.id,n.key),i={"font-family":Ye(r.name),src:`url(${a})`};(n.type=="bold"||n.type=="boldItalic")&&(i["font-weight"]="bold"),(n.type=="italic"||n.type=="boldItalic")&&(i["font-style"]="italic"),e.push(this.h({tagName:"#comment",children:[`docxjs ${r.name} font`]})),e.push(this.h({tagName:"style",children:[this.styleToString("@font-face",i)]}))}catch{this.options.debug&&console.warn(`Can't load font with id ${n.id} and key ${n.key}`)}return e}processStyleName(t){return t?`${this.className}_${Zt(t)}`:this.className}processStyles(t){const e=Pe(t.filter(n=>n.id!=null),n=>n.id);for(const n of t.filter(a=>a.basedOn)){var r=e[n.basedOn];if(r){n.paragraphProps=je(n.paragraphProps,r.paragraphProps),n.runProps=je(n.runProps,r.runProps);for(const a of r.styles){const i=n.styles.find(o=>o.target==a.target);i?this.copyStyleProperties(a.values,i.values):n.styles.push({...a,values:{...a.values}})}}else this.options.debug&&console.warn(`Can't find base style ${n.basedOn}`)}for(let n of t)n.cssName=this.processStyleName(n.id);return e}prodessNumberings(t){var e;for(let r of t.filter(n=>n.pStyleName)){const n=this.findStyle(r.pStyleName);(e=n==null?void 0:n.paragraphProps)!=null&&e.numbering&&(n.paragraphProps.numbering.level=r.level)}}processElement(t){if(t.children)for(var e of t.children)e.parent=t,e.type==T.Table?this.processTable(e):this.processElement(e)}processTable(t){for(var e of t.children)for(var r of e.children)r.cssStyle=this.copyStyleProperties(t.cellStyle,r.cssStyle,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]),this.processElement(r)}copyStyleProperties(t,e,r=null){if(!t)return e;e==null&&(e={}),r==null&&(r=Object.getOwnPropertyNames(t));for(var n of r)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n]);return e}createPageElement(t,e,r){const n={...r};return e&&(e.pageMargins&&(n.paddingLeft=e.pageMargins.left,n.paddingRight=e.pageMargins.right,n.paddingTop=e.pageMargins.top,n.paddingBottom=e.pageMargins.bottom),e.pageSize&&(this.options.ignoreWidth||(n.width=e.pageSize.width),this.options.ignoreHeight||(n.minHeight=e.pageSize.height))),this.h({tagName:"section",className:t,style:n})}createSectionContent(t){const e={};return t.columns&&t.columns.numberOfColumns&&(e.columnCount=`${t.columns.numberOfColumns}`,e.columnGap=t.columns.space,t.columns.separator&&(e.columnRule="1px solid black")),this.h({tagName:"article",style:e})}renderSections(t){const e=[];this.processElement(t);const r=this.splitBySection(t.children,t.props),n=this.groupByPageBreaks(r);let a=null;for(let o=0,c=n.length;o<c;o++){this.currentFootnoteIds=[];let _=n[o][0].sectProps;const y=this.createPageElement(this.className,_,t.cssStyle);this.options.renderHeaders&&this.renderHeaderFooter(_.headerRefs,_,e.length,a!=_,y);for(const b of n[o]){var i=this.createSectionContent(b.sectProps);this.renderElements(b.elements,i),y.appendChild(i),_=b.sectProps}if(this.options.renderFootnotes){const b=this.renderNotes(this.currentFootnoteIds,this.footnoteMap);b&&y.appendChild(b)}if(this.options.renderEndnotes&&o==c-1){const b=this.renderNotes(this.currentEndnoteIds,this.endnoteMap);b&&y.appendChild(b)}this.options.renderFooters&&this.renderHeaderFooter(_.footerRefs,_,e.length,a!=_,y),e.push(y),a=_}return e}renderHeaderFooter(t,e,r,n,a){var g,_;if(!t)return;const i=((_=(g=this.document.settingsPart)==null?void 0:g.settings)==null?void 0:_.evenAndOddHeaders)??!1;var o=(e.titlePage&&n?t.find(y=>y.type=="first"):null)??(r%2==1&&i?t.find(y=>y.type=="even"):null)??t.find(y=>y.type=="default"),c=o&&this.document.findPartByRelId(o.id,this.document.documentPart);if(c){this.currentPart=c,this.usedHederFooterParts.includes(c.path)||(this.processElement(c.rootElement),this.usedHederFooterParts.push(c.path));const[y]=this.renderElements([c.rootElement],a);e!=null&&e.pageMargins&&(c.rootElement.type===T.Header?(y.style.marginTop=`calc(${e.pageMargins.header} - ${e.pageMargins.top})`,y.style.minHeight=`calc(${e.pageMargins.top} - ${e.pageMargins.header})`):c.rootElement.type===T.Footer&&(y.style.marginBottom=`calc(${e.pageMargins.footer} - ${e.pageMargins.bottom})`,y.style.minHeight=`calc(${e.pageMargins.bottom} - ${e.pageMargins.footer})`)),this.currentPart=null}}isPageBreakElement(t){return t.type!=T.Break?!1:t.break=="lastRenderedPageBreak"?!this.options.ignoreLastRenderedPageBreak:t.break=="page"}isPageBreakSection(t,e){var r,n,a,i,o,c;return!t||!e?!1:((r=t.pageSize)==null?void 0:r.orientation)!=((n=e.pageSize)==null?void 0:n.orientation)||((a=t.pageSize)==null?void 0:a.width)!=((i=e.pageSize)==null?void 0:i.width)||((o=t.pageSize)==null?void 0:o.height)!=((c=e.pageSize)==null?void 0:c.height)}splitBySection(t,e){var y;var r={sectProps:null,elements:[],pageBreak:!1},n=[r];for(let b of t){if(b.type==T.Paragraph){const d=b,v=this.findStyle(d.styleName);(d.pageBreakBefore||(y=v==null?void 0:v.paragraphProps)!=null&&y.pageBreakBefore)&&(r.sectProps=a,r.pageBreak=!0,r={sectProps:null,elements:[],pageBreak:!1},n.push(r))}if(r.elements.push(b),b.type==T.Paragraph){const d=b;var a=d.sectionProps,i=-1,o=-1;if(this.options.breakPages&&d.children&&(i=d.children.findIndex(v=>{var u;return o=((u=v.children)==null?void 0:u.findIndex(this.isPageBreakElement.bind(this)))??-1,o!=-1})),(a||i!=-1)&&(r.sectProps=a,r.pageBreak=i!=-1,r={sectProps:null,elements:[],pageBreak:!1},n.push(r)),i!=-1){let v=d.children[i],u=o<v.children.length-1;if(i<d.children.length-1||u){var c=b.children,g={...b,children:c.slice(i)};if(b.children=c.slice(0,i),r.elements.push(g),u){let f=v.children,p={...v,children:f.slice(0,o)};b.children.push(p),v.children=f.slice(o)}}}}}let _=null;for(let b=n.length-1;b>=0;b--)n[b].sectProps==null?n[b].sectProps=_??e:_=n[b].sectProps;return n}groupByPageBreaks(t){let e=[],r;const n=[e];for(let a of t)e.push(a),(this.options.ignoreLastRenderedPageBreak||a.pageBreak||this.isPageBreakSection(r,a.sectProps))&&n.push(e=[]),r=a.sectProps;return n.filter(a=>a.length>0)}renderWrapper(t){return this.h({tagName:"div",className:`${this.className}-wrapper`,children:t})}renderDefaultStyle(){var t=this.className,e=`
18
+ .${t}-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; }
19
+ .${t}-wrapper>section.${t} { background: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); margin-bottom: 30px; }`;this.options.hideWrapperOnPrint&&(e=`@media not print { ${e} }`);var r=`${e}
20
+ .${t} { color: black; hyphens: auto; text-underline-position: from-font; }
21
+ section.${t} { box-sizing: border-box; display: flex; flex-flow: column nowrap; position: relative; overflow: hidden; }
22
+ section.${t}>article { margin-bottom: auto; z-index: 1; }
23
+ section.${t}>footer { z-index: 1; }
24
+ .${t} table { border-collapse: collapse; }
25
+ .${t} table td, .${t} table th { vertical-align: top; }
26
+ .${t} p { margin: 0pt; min-height: 1em; }
27
+ .${t} span { white-space: pre-wrap; overflow-wrap: break-word; }
28
+ .${t} a { color: inherit; text-decoration: inherit; }
29
+ .${t} svg { fill: transparent; }
30
30
  `;return this.options.renderComments&&(r+=`
31
- .${e}-comment-ref { cursor: default; }
32
- .${e}-comment-popover { display: none; z-index: 1000; padding: 0.5rem; background: white; position: absolute; box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.25); width: 30ch; }
33
- .${e}-comment-ref:hover~.${e}-comment-popover { display: block; }
34
- .${e}-comment-author,.${e}-comment-date { font-size: 0.875rem; color: #888; }
35
- `),[this.h({tagName:"#comment",children:["docxjs library predefined styles"]}),this.h({tagName:"style",children:[r]})]}async renderNumbering(e){var t="",r=[];for(var n of e){var a=`p.${this.numberingClass(n.id,n.level)}`,i="none";if(n.bullet){let l=`--${this.className}-${n.bullet.src}`.toLowerCase();t+=this.styleToString(`${a}:before`,{content:"' '",display:"inline-block",background:`var(${l})`},n.bullet.style);try{const c=await this.document.loadNumberingImage(n.bullet.src);t+=`${this.rootSelector} { ${l}: url(${c}) }`}catch{this.options.debug&&console.warn(`Can't load numbering image with src ${n.bullet.src}`)}}else if(n.levelText){let l=this.numberingCounter(n.id,n.level);const c=l+" "+(n.start-1);n.level>0&&(t+=this.styleToString(`p.${this.numberingClass(n.id,n.level-1)}`,{"counter-set":c})),r.push(c),t+=this.styleToString(`${a}:before`,{content:this.levelTextToContent(n.levelText,n.suff,n.id,this.numFormatToCssValue(n.format)),"counter-increment":l,...n.rStyle})}else i=this.numFormatToCssValue(n.format);t+=this.styleToString(a,{display:"list-item","list-style-position":"inside","list-style-type":i,...n.pStyle})}return r.length>0&&(t+=this.styleToString(this.rootSelector,{"counter-reset":r.join(" ")})),[this.h({tagName:"#comment",children:["docxjs document numbering styles"]}),this.h({tagName:"style",children:[t]})]}renderStyles(e){var t="";const r=this.styleMap,n=Pt(e.filter(c=>c.isDefault),c=>c.target);for(const c of e){var a=c.styles;if(c.linked){var i=c.linked&&r[c.linked];i?a=a.concat(i.styles):this.options.debug&&console.warn(`Can't find linked style ${c.linked}`)}for(const g of a){var l=`${c.target??""}.${c.cssName}`;c.target!=g.target&&(l+=` ${g.target}`),n[c.target]==c&&(l=`.${this.className} ${c.target}, `+l),t+=this.styleToString(l,g.values)}}return[this.h({tagName:"#comment",children:["docxjs document styles"]}),this.h({tagName:"style",children:[t]})]}renderNotes(e,t){var r=e.map(n=>t[n]).filter(n=>n);if(r.length>0)return this.h({tagName:"ol",children:this.renderElements(r)})}renderElement(e){switch(e.type){case B.Paragraph:return this.renderParagraph(e);case B.BookmarkStart:return this.renderBookmarkStart(e);case B.BookmarkEnd:return null;case B.Run:return this.renderRun(e);case B.Table:return this.renderTable(e);case B.Row:return this.renderTableRow(e);case B.Cell:return this.renderTableCell(e);case B.Hyperlink:return this.renderHyperlink(e);case B.SmartTag:return this.renderSmartTag(e);case B.Drawing:return this.renderDrawing(e);case B.Image:return this.renderImage(e);case B.Text:return this.renderText(e);case B.Text:return this.renderText(e);case B.DeletedText:return this.renderDeletedText(e);case B.Tab:return this.renderTab(e);case B.Symbol:return this.renderSymbol(e);case B.Break:return this.renderBreak(e);case B.Footer:return this.renderContainer(e,"footer");case B.Header:return this.renderContainer(e,"header");case B.Footnote:case B.Endnote:return this.renderContainer(e,"li");case B.FootnoteReference:return this.renderFootnoteReference(e);case B.EndnoteReference:return this.renderEndnoteReference(e);case B.NoBreakHyphen:return this.h({tagName:"wbr"});case B.VmlPicture:return this.renderVmlPicture(e);case B.VmlElement:return this.renderVmlElement(e);case B.MmlMath:return this.renderContainerNS(e,it.mathML,"math",{xmlns:it.mathML});case B.MmlMathParagraph:return this.renderContainer(e,"span");case B.MmlFraction:return this.renderContainerNS(e,it.mathML,"mfrac");case B.MmlBase:return this.renderContainerNS(e,it.mathML,e.parent.type==B.MmlMatrixRow?"mtd":"mrow");case B.MmlNumerator:case B.MmlDenominator:case B.MmlFunction:case B.MmlLimit:case B.MmlBox:return this.renderContainerNS(e,it.mathML,"mrow");case B.MmlGroupChar:return this.renderMmlGroupChar(e);case B.MmlLimitLower:return this.renderContainerNS(e,it.mathML,"munder");case B.MmlMatrix:return this.renderContainerNS(e,it.mathML,"mtable");case B.MmlMatrixRow:return this.renderContainerNS(e,it.mathML,"mtr");case B.MmlRadical:return this.renderMmlRadical(e);case B.MmlSuperscript:return this.renderContainerNS(e,it.mathML,"msup");case B.MmlSubscript:return this.renderContainerNS(e,it.mathML,"msub");case B.MmlDegree:case B.MmlSuperArgument:case B.MmlSubArgument:return this.renderContainerNS(e,it.mathML,"mn");case B.MmlFunctionName:return this.renderContainerNS(e,it.mathML,"ms");case B.MmlDelimiter:return this.renderMmlDelimiter(e);case B.MmlRun:return this.renderMmlRun(e);case B.MmlNary:return this.renderMmlNary(e);case B.MmlPreSubSuper:return this.renderMmlPreSubSuper(e);case B.MmlBar:return this.renderMmlBar(e);case B.MmlEquationArray:return this.renderMllList(e);case B.Inserted:return this.renderInserted(e);case B.Deleted:return this.renderDeleted(e);case B.CommentRangeStart:return this.renderCommentRangeStart(e);case B.CommentRangeEnd:return this.renderCommentRangeEnd(e);case B.CommentReference:return this.renderCommentReference(e);case B.AltChunk:return this.renderAltChunk(e)}return null}renderElements(e,t){if(e==null)return null;var r=e.flatMap(n=>this.renderElement(n)).filter(n=>n!=null);return t&&r.forEach(n=>t.appendChild(Yt(n)?document.createTextNode(n):n)),r}renderContainer(e,t,r){return this.h({tagName:t,children:this.renderElements(e.children),...r})}renderContainerNS(e,t,r,n){return this.h({ns:t,tagName:r,children:this.renderElements(e.children),...n})}renderParagraph(e){var a,i;var t=this.toHTML(e,it.html,"p");const r=this.findStyle(e.styleName);e.tabs??(e.tabs=(a=r==null?void 0:r.paragraphProps)==null?void 0:a.tabs);const n=e.numbering??((i=r==null?void 0:r.paragraphProps)==null?void 0:i.numbering);return n&&t.classList.add(this.numberingClass(n.id,n.level)),t}renderHyperlink(e){const t=this.toH(e,it.html,"a");if(t.href="",e.id){const r=this.document.documentPart.rels.find(n=>n.id==e.id&&n.targetMode==="External");t.href=(r==null?void 0:r.target)??t.href}return e.anchor&&(t.href+=`#${e.anchor}`),this.h(t)}renderSmartTag(e){return this.renderContainer(e,"span")}renderCommentRangeStart(e){var n;if(!this.options.renderComments)return null;const t=new Range;(n=this.commentHighlight)==null||n.add(t);const r=this.h({tagName:"#comment",children:[`start of comment #${e.id}`]});return this.later(()=>t.setStart(r,0)),this.commentMap[e.id]=t,r}renderCommentRangeEnd(e){if(!this.options.renderComments)return null;const t=this.commentMap[e.id],r=this.h({tagName:"#comment",children:[`end of comment #${e.id}`]});return this.later(()=>t==null?void 0:t.setEnd(r,0)),r}renderCommentReference(e){var a;if(!this.options.renderComments)return null;var t=(a=this.document.commentsPart)==null?void 0:a.commentMap[e.id];if(!t)return null;const r=this.h({tagName:"span",className:`${this.className}-comment-ref`,children:["💬"]}),n=this.h({tagName:"div",className:`${this.className}-comment-popover`,children:[this.h({tagName:"div",className:`${this.className}-comment-author`,children:[t.author]}),this.h({tagName:"div",className:`${this.className}-comment-date`,children:[new Date(t.date).toLocaleString()]}),...this.renderElements(t.children)]});return this.h({tagName:"#fragment",children:[this.h({tagName:"#comment",children:[`comment #${t.id} by ${t.author} on ${t.date}`]}),r,n]})}renderAltChunk(e){if(!this.options.renderAltChunks)return null;var t=this.h({tagName:"iframe"});return this.tasks.push(this.document.loadAltChunk(e.id,this.currentPart).then(r=>{t.srcdoc=r})),t}renderDrawing(e){var t=this.toHTML(e,it.html,"div");return t.style.display="inline-block",t.style.position="relative",t.style.textIndent="0px",t}renderImage(e){var c;let t=this.toHTML(e,it.html,"img",[]),r=(c=e.cssStyle)==null?void 0:c.transform;if(e.srcRect&&e.srcRect.some(g=>g!=0)){var[n,a,i,l]=e.srcRect;r=`scale(${1/(1-n-i)}, ${1/(1-a-l)})`,t.style["clip-path"]=`rect(${(100*a).toFixed(2)}% ${(100*(1-i)).toFixed(2)}% ${(100*(1-l)).toFixed(2)}% ${(100*n).toFixed(2)}%)`}return e.rotation&&(r=`rotate(${e.rotation}deg) ${r??""}`),t.style.transform=r==null?void 0:r.trim(),this.document&&this.tasks.push(this.document.loadDocumentImage(e.src,this.currentPart).then(g=>{t.src=g})),t}renderText(e){return this.h(e.text)}renderDeletedText(e){return this.options.renderChanges?this.renderText(e):null}renderBreak(e){return e.break=="textWrapping"?this.h({tagName:"br"}):null}renderInserted(e){return this.options.renderChanges?this.renderChange(e,"ins"):this.renderElements(e.children)}renderDeleted(e){return this.options.renderChanges?this.renderChange(e,"del"):null}renderChange(e,t){return this.renderContainer(e,t,{dateTime:e.date})}renderSymbol(e){return this.h({tagName:"span",children:[String.fromCharCode(e.char)],style:{fontFamily:e.font}})}renderFootnoteReference(e){return this.currentFootnoteIds.push(e.id),this.h({tagName:"sup",children:[`${this.currentFootnoteIds.length}`]})}renderEndnoteReference(e){return this.currentEndnoteIds.push(e.id),this.h({tagName:"sup",children:[`${this.currentEndnoteIds.length}`]})}renderTab(e){var n;var t=this.h({tagName:"span",children:[" "]});if(this.options.experimental){t.className=this.tabStopClass();var r=(n=sn(e,B.Paragraph))==null?void 0:n.tabs;this.currentTabs.push({stops:r,span:t})}return t}renderBookmarkStart(e){return this.h({tagName:"span",id:e.name})}renderRun(e){if(e.fieldRun)return null;let t=this.renderElements(e.children);e.verticalAlign&&(t=[this.h({tagName:e.verticalAlign,children:this.renderElements(e.children)})]);const r=this.toHTML(e,it.html,"span",t);return e.id&&(r.id=e.id),r}renderTable(e){this.tableCellPositions.push(this.currentCellPosition),this.tableVerticalMerges.push(this.currentVerticalMerge),this.currentVerticalMerge={},this.currentCellPosition={col:0,row:0};const t=[];return e.columns&&t.push(this.renderTableColumns(e.columns)),t.push(...this.renderElements(e.children)),this.currentVerticalMerge=this.tableVerticalMerges.pop(),this.currentCellPosition=this.tableCellPositions.pop(),this.toHTML(e,it.html,"table",t)}renderTableColumns(e){const t=e.map(r=>this.h({tagName:"col",style:{width:r.width}}));return this.h({tagName:"colgroup",children:t})}renderTableRow(e){this.currentCellPosition.col=0;const t=[];return e.gridBefore&&t.push(this.renderTableCellPlaceholder(e.gridBefore)),t.push(...this.renderElements(e.children)),e.gridAfter&&t.push(this.renderTableCellPlaceholder(e.gridAfter)),this.currentCellPosition.row++,this.toHTML(e,it.html,"tr",t)}renderTableCellPlaceholder(e){return this.h({tagName:"td",colSpan:e,style:{border:"none"}})}renderTableCell(e){let t=this.toHTML(e,it.html,"td");const r=this.currentCellPosition.col;return e.verticalMerge?e.verticalMerge=="restart"?(this.currentVerticalMerge[r]=t,t.rowSpan=1):this.currentVerticalMerge[r]&&(this.currentVerticalMerge[r].rowSpan+=1,t.style.display="none"):this.currentVerticalMerge[r]=null,e.span&&(t.colSpan=e.span),this.currentCellPosition.col+=t.colSpan,t}renderVmlPicture(e){return this.renderContainer(e,"div")}renderVmlElement(e){var n,a;var t=this.h({ns:it.svg,tagName:"svg",style:e.cssStyleText});const r=this.renderVmlChildElement(e);return(n=e.imageHref)!=null&&n.id&&this.tasks.push((a=this.document)==null?void 0:a.loadDocumentImage(e.imageHref.id,this.currentPart).then(i=>r.setAttribute("href",i))),t.appendChild(r),requestAnimationFrame(()=>{const i=t.firstElementChild.getBBox();t.setAttribute("width",`${Math.ceil(i.x+i.width)}`),t.setAttribute("height",`${Math.ceil(i.y+i.height)}`)}),t}renderVmlChildElement(e){const t=this.createSvgElement(e.tagName);Object.entries(e.attrs).forEach(([r,n])=>t.setAttribute(r,n));for(let r of e.children)r.type==B.VmlElement?t.appendChild(this.renderVmlChildElement(r)):t.appendChild(...Mt(this.renderElement(r)));return t}renderMmlRadical(e){var n;const t=e.children.find(a=>a.type==B.MmlBase);if((n=e.props)!=null&&n.hideDegree)return this.createMathMLElement("msqrt",null,this.renderElements([t]));const r=e.children.find(a=>a.type==B.MmlDegree);return this.createMathMLElement("mroot",null,this.renderElements([t,r]))}renderMmlDelimiter(e){const t=[];return t.push(this.createMathMLElement("mo",null,[e.props.beginChar??"("])),t.push(...this.renderElements(e.children)),t.push(this.createMathMLElement("mo",null,[e.props.endChar??")"])),this.createMathMLElement("mrow",null,t)}renderMmlNary(e){var g;const t=[],r=Pt(e.children,_=>_.type),n=r[B.MmlSuperArgument],a=r[B.MmlSubArgument],i=n?this.createMathMLElement("mo",null,Mt(this.renderElement(n))):null,l=a?this.createMathMLElement("mo",null,Mt(this.renderElement(a))):null,c=this.createMathMLElement("mo",null,[((g=e.props)==null?void 0:g.char)??"∫"]);return i||l?t.push(this.createMathMLElement("munderover",null,[c,l,i])):i?t.push(this.createMathMLElement("mover",null,[c,i])):l?t.push(this.createMathMLElement("munder",null,[c,l])):t.push(c),t.push(...this.renderElements(r[B.MmlBase].children)),this.createMathMLElement("mrow",null,t)}renderMmlPreSubSuper(e){const t=[],r=Pt(e.children,g=>g.type),n=r[B.MmlSuperArgument],a=r[B.MmlSubArgument],i=n?this.createMathMLElement("mo",null,Mt(this.renderElement(n))):null,l=a?this.createMathMLElement("mo",null,Mt(this.renderElement(a))):null,c=this.createMathMLElement("mo",null);return t.push(this.createMathMLElement("msubsup",null,[c,l,i])),t.push(...this.renderElements(r[B.MmlBase].children)),this.createMathMLElement("mrow",null,t)}renderMmlGroupChar(e){const t=e.props.verticalJustification==="bot"?"mover":"munder",r=this.renderContainerNS(e,it.mathML,t);return e.props.char&&r.appendChild(this.createMathMLElement("mo",null,[e.props.char])),r}renderMmlBar(e){const t={};switch(e.props.position){case"top":t.textDecoration="overline";break;case"bottom":t.textDecoration="underline";break}return this.renderContainerNS(e,it.mathML,"mrow",{style:t})}renderMmlRun(e){return this.toHTML(e,it.mathML,"ms")}renderMllList(e){const t=this.renderElements(e.children).map(r=>this.createMathMLElement("mtr",null,[this.createMathMLElement("mtd",null,[r])]));return this.toHTML(e,it.mathML,"mtable",t)}toH(e,t,r,n=null){const{$lang:a,...i}=e.cssStyle??{},l=nn(e.className,e.styleName&&this.processStyleName(e.styleName));return{ns:t,tagName:r,className:l,lang:a,style:i,children:n??this.renderElements(e.children)}}toHTML(e,t,r,n=null){return this.h(this.toH(e,t,r,n))}findStyle(e){var t;return e&&((t=this.styleMap)==null?void 0:t[e])}numberingClass(e,t){return`${this.className}-num-${e}-${t}`}tabStopClass(){return`${this.className}-tab-stop`}styleToString(e,t,r=null){let n=`${e} {\r
36
- `;for(const a in t)a.startsWith("$")||(n+=` ${a}: ${t[a]};\r
31
+ .${t}-comment-ref { cursor: default; }
32
+ .${t}-comment-popover { display: none; z-index: 1000; padding: 0.5rem; background: white; position: absolute; box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.25); width: 30ch; }
33
+ .${t}-comment-ref:hover~.${t}-comment-popover { display: block; }
34
+ .${t}-comment-author,.${t}-comment-date { font-size: 0.875rem; color: #888; }
35
+ `),[this.h({tagName:"#comment",children:["docxjs library predefined styles"]}),this.h({tagName:"style",children:[r]})]}async renderNumbering(t){var e="",r=[];for(var n of t){var a=`p.${this.numberingClass(n.id,n.level)}`,i="none";if(n.bullet){let o=`--${this.className}-${n.bullet.src}`.toLowerCase();e+=this.styleToString(`${a}:before`,{content:"' '",display:"inline-block",background:`var(${o})`},n.bullet.style);try{const c=await this.document.loadNumberingImage(n.bullet.src);e+=`${this.rootSelector} { ${o}: url(${c}) }`}catch{this.options.debug&&console.warn(`Can't load numbering image with src ${n.bullet.src}`)}}else if(n.levelText){let o=this.numberingCounter(n.id,n.level);const c=o+" "+(n.start-1);n.level>0&&(e+=this.styleToString(`p.${this.numberingClass(n.id,n.level-1)}`,{"counter-set":c})),r.push(c),e+=this.styleToString(`${a}:before`,{content:this.levelTextToContent(n.levelText,n.suff,n.id,this.numFormatToCssValue(n.format)),"counter-increment":o,...n.rStyle})}else i=this.numFormatToCssValue(n.format);e+=this.styleToString(a,{display:"list-item","list-style-position":"inside","list-style-type":i,...n.pStyle})}return r.length>0&&(e+=this.styleToString(this.rootSelector,{"counter-reset":r.join(" ")})),[this.h({tagName:"#comment",children:["docxjs document numbering styles"]}),this.h({tagName:"style",children:[e]})]}renderStyles(t){var e="";const r=this.styleMap,n=Pe(t.filter(c=>c.isDefault),c=>c.target);for(const c of t){var a=c.styles;if(c.linked){var i=c.linked&&r[c.linked];i?a=a.concat(i.styles):this.options.debug&&console.warn(`Can't find linked style ${c.linked}`)}for(const g of a){var o=`${c.target??""}.${c.cssName}`;c.target!=g.target&&(o+=` ${g.target}`),n[c.target]==c&&(o=`.${this.className} ${c.target}, `+o),e+=this.styleToString(o,g.values)}}return[this.h({tagName:"#comment",children:["docxjs document styles"]}),this.h({tagName:"style",children:[e]})]}renderNotes(t,e){var r=t.map(n=>e[n]).filter(n=>n);if(r.length>0)return this.h({tagName:"ol",children:this.renderElements(r)})}renderElement(t){switch(t.type){case T.Paragraph:return this.renderParagraph(t);case T.BookmarkStart:return this.renderBookmarkStart(t);case T.BookmarkEnd:return null;case T.Run:return this.renderRun(t);case T.Table:return this.renderTable(t);case T.Row:return this.renderTableRow(t);case T.Cell:return this.renderTableCell(t);case T.Hyperlink:return this.renderHyperlink(t);case T.SmartTag:return this.renderSmartTag(t);case T.Drawing:return this.renderDrawing(t);case T.Image:return this.renderImage(t);case T.Text:return this.renderText(t);case T.Text:return this.renderText(t);case T.DeletedText:return this.renderDeletedText(t);case T.Tab:return this.renderTab(t);case T.Symbol:return this.renderSymbol(t);case T.Break:return this.renderBreak(t);case T.Footer:return this.renderContainer(t,"footer");case T.Header:return this.renderContainer(t,"header");case T.Footnote:case T.Endnote:return this.renderContainer(t,"li");case T.FootnoteReference:return this.renderFootnoteReference(t);case T.EndnoteReference:return this.renderEndnoteReference(t);case T.NoBreakHyphen:return this.h({tagName:"wbr"});case T.VmlPicture:return this.renderVmlPicture(t);case T.VmlElement:return this.renderVmlElement(t);case T.MmlMath:return this.renderContainerNS(t,ie.mathML,"math",{xmlns:ie.mathML});case T.MmlMathParagraph:return this.renderContainer(t,"span");case T.MmlFraction:return this.renderContainerNS(t,ie.mathML,"mfrac");case T.MmlBase:return this.renderContainerNS(t,ie.mathML,t.parent.type==T.MmlMatrixRow?"mtd":"mrow");case T.MmlNumerator:case T.MmlDenominator:case T.MmlFunction:case T.MmlLimit:case T.MmlBox:return this.renderContainerNS(t,ie.mathML,"mrow");case T.MmlGroupChar:return this.renderMmlGroupChar(t);case T.MmlLimitLower:return this.renderContainerNS(t,ie.mathML,"munder");case T.MmlMatrix:return this.renderContainerNS(t,ie.mathML,"mtable");case T.MmlMatrixRow:return this.renderContainerNS(t,ie.mathML,"mtr");case T.MmlRadical:return this.renderMmlRadical(t);case T.MmlSuperscript:return this.renderContainerNS(t,ie.mathML,"msup");case T.MmlSubscript:return this.renderContainerNS(t,ie.mathML,"msub");case T.MmlDegree:case T.MmlSuperArgument:case T.MmlSubArgument:return this.renderContainerNS(t,ie.mathML,"mn");case T.MmlFunctionName:return this.renderContainerNS(t,ie.mathML,"ms");case T.MmlDelimiter:return this.renderMmlDelimiter(t);case T.MmlRun:return this.renderMmlRun(t);case T.MmlNary:return this.renderMmlNary(t);case T.MmlPreSubSuper:return this.renderMmlPreSubSuper(t);case T.MmlBar:return this.renderMmlBar(t);case T.MmlEquationArray:return this.renderMllList(t);case T.Inserted:return this.renderInserted(t);case T.Deleted:return this.renderDeleted(t);case T.CommentRangeStart:return this.renderCommentRangeStart(t);case T.CommentRangeEnd:return this.renderCommentRangeEnd(t);case T.CommentReference:return this.renderCommentReference(t);case T.AltChunk:return this.renderAltChunk(t)}return null}renderElements(t,e){if(t==null)return null;var r=t.flatMap(n=>this.renderElement(n)).filter(n=>n!=null);return e&&r.forEach(n=>e.appendChild(Qe(n)?document.createTextNode(n):n)),r}renderContainer(t,e,r){return this.h({tagName:e,children:this.renderElements(t.children),...r})}renderContainerNS(t,e,r,n){return this.h({ns:e,tagName:r,children:this.renderElements(t.children),...n})}renderParagraph(t){var a,i;var e=this.toHTML(t,ie.html,"p");const r=this.findStyle(t.styleName);t.tabs??(t.tabs=(a=r==null?void 0:r.paragraphProps)==null?void 0:a.tabs);const n=t.numbering??((i=r==null?void 0:r.paragraphProps)==null?void 0:i.numbering);return n&&e.classList.add(this.numberingClass(n.id,n.level)),e}renderHyperlink(t){const e=this.toH(t,ie.html,"a");if(e.href="",t.id){const r=this.document.documentPart.rels.find(n=>n.id==t.id&&n.targetMode==="External");e.href=(r==null?void 0:r.target)??e.href}return t.anchor&&(e.href+=`#${t.anchor}`),this.h(e)}renderSmartTag(t){return this.renderContainer(t,"span")}renderCommentRangeStart(t){var n;if(!this.options.renderComments)return null;const e=new Range;(n=this.commentHighlight)==null||n.add(e);const r=this.h({tagName:"#comment",children:[`start of comment #${t.id}`]});return this.later(()=>e.setStart(r,0)),this.commentMap[t.id]=e,r}renderCommentRangeEnd(t){if(!this.options.renderComments)return null;const e=this.commentMap[t.id],r=this.h({tagName:"#comment",children:[`end of comment #${t.id}`]});return this.later(()=>e==null?void 0:e.setEnd(r,0)),r}renderCommentReference(t){var a;if(!this.options.renderComments)return null;var e=(a=this.document.commentsPart)==null?void 0:a.commentMap[t.id];if(!e)return null;const r=this.h({tagName:"span",className:`${this.className}-comment-ref`,children:["💬"]}),n=this.h({tagName:"div",className:`${this.className}-comment-popover`,children:[this.h({tagName:"div",className:`${this.className}-comment-author`,children:[e.author]}),this.h({tagName:"div",className:`${this.className}-comment-date`,children:[new Date(e.date).toLocaleString()]}),...this.renderElements(e.children)]});return this.h({tagName:"#fragment",children:[this.h({tagName:"#comment",children:[`comment #${e.id} by ${e.author} on ${e.date}`]}),r,n]})}renderAltChunk(t){if(!this.options.renderAltChunks)return null;var e=this.h({tagName:"iframe"});return this.tasks.push(this.document.loadAltChunk(t.id,this.currentPart).then(r=>{e.srcdoc=r})),e}renderDrawing(t){var e=this.toHTML(t,ie.html,"div");return e.style.display="inline-block",e.style.position="relative",e.style.textIndent="0px",e}renderImage(t){var c;let e=this.toHTML(t,ie.html,"img",[]),r=(c=t.cssStyle)==null?void 0:c.transform;if(t.srcRect&&t.srcRect.some(g=>g!=0)){var[n,a,i,o]=t.srcRect;r=`scale(${1/(1-n-i)}, ${1/(1-a-o)})`,e.style["clip-path"]=`rect(${(100*a).toFixed(2)}% ${(100*(1-i)).toFixed(2)}% ${(100*(1-o)).toFixed(2)}% ${(100*n).toFixed(2)}%)`}return t.rotation&&(r=`rotate(${t.rotation}deg) ${r??""}`),e.style.transform=r==null?void 0:r.trim(),this.document&&this.tasks.push(this.document.loadDocumentImage(t.src,this.currentPart).then(g=>{e.src=g})),e}renderText(t){return this.h(t.text)}renderDeletedText(t){return this.options.renderChanges?this.renderText(t):null}renderBreak(t){return t.break=="textWrapping"?this.h({tagName:"br"}):null}renderInserted(t){return this.options.renderChanges?this.renderChange(t,"ins"):this.renderElements(t.children)}renderDeleted(t){return this.options.renderChanges?this.renderChange(t,"del"):null}renderChange(t,e){return this.renderContainer(t,e,{dateTime:t.date})}renderSymbol(t){return this.h({tagName:"span",children:[String.fromCharCode(t.char)],style:{fontFamily:t.font}})}renderFootnoteReference(t){return this.currentFootnoteIds.push(t.id),this.h({tagName:"sup",children:[`${this.currentFootnoteIds.length}`]})}renderEndnoteReference(t){return this.currentEndnoteIds.push(t.id),this.h({tagName:"sup",children:[`${this.currentEndnoteIds.length}`]})}renderTab(t){var n;var e=this.h({tagName:"span",children:[" "]});if(this.options.experimental){e.className=this.tabStopClass();var r=(n=hn(t,T.Paragraph))==null?void 0:n.tabs;this.currentTabs.push({stops:r,span:e})}return e}renderBookmarkStart(t){return this.h({tagName:"span",id:t.name})}renderRun(t){if(t.fieldRun)return null;let e=this.renderElements(t.children);t.verticalAlign&&(e=[this.h({tagName:t.verticalAlign,children:this.renderElements(t.children)})]);const r=this.toHTML(t,ie.html,"span",e);return t.id&&(r.id=t.id),r}renderTable(t){this.tableCellPositions.push(this.currentCellPosition),this.tableVerticalMerges.push(this.currentVerticalMerge),this.currentVerticalMerge={},this.currentCellPosition={col:0,row:0};const e=[];return t.columns&&e.push(this.renderTableColumns(t.columns)),e.push(...this.renderElements(t.children)),this.currentVerticalMerge=this.tableVerticalMerges.pop(),this.currentCellPosition=this.tableCellPositions.pop(),this.toHTML(t,ie.html,"table",e)}renderTableColumns(t){const e=t.map(r=>this.h({tagName:"col",style:{width:r.width}}));return this.h({tagName:"colgroup",children:e})}renderTableRow(t){this.currentCellPosition.col=0;const e=[];return t.gridBefore&&e.push(this.renderTableCellPlaceholder(t.gridBefore)),e.push(...this.renderElements(t.children)),t.gridAfter&&e.push(this.renderTableCellPlaceholder(t.gridAfter)),this.currentCellPosition.row++,this.toHTML(t,ie.html,"tr",e)}renderTableCellPlaceholder(t){return this.h({tagName:"td",colSpan:t,style:{border:"none"}})}renderTableCell(t){let e=this.toHTML(t,ie.html,"td");const r=this.currentCellPosition.col;return t.verticalMerge?t.verticalMerge=="restart"?(this.currentVerticalMerge[r]=e,e.rowSpan=1):this.currentVerticalMerge[r]&&(this.currentVerticalMerge[r].rowSpan+=1,e.style.display="none"):this.currentVerticalMerge[r]=null,t.span&&(e.colSpan=t.span),this.currentCellPosition.col+=e.colSpan,e}renderVmlPicture(t){return this.renderContainer(t,"div")}renderVmlElement(t){var n,a;var e=this.h({ns:ie.svg,tagName:"svg",style:t.cssStyleText});const r=this.renderVmlChildElement(t);return(n=t.imageHref)!=null&&n.id&&this.tasks.push((a=this.document)==null?void 0:a.loadDocumentImage(t.imageHref.id,this.currentPart).then(i=>r.setAttribute("href",i))),e.appendChild(r),requestAnimationFrame(()=>{const i=e.firstElementChild.getBBox();e.setAttribute("width",`${Math.ceil(i.x+i.width)}`),e.setAttribute("height",`${Math.ceil(i.y+i.height)}`)}),e}renderVmlChildElement(t){const e=this.createSvgElement(t.tagName);Object.entries(t.attrs).forEach(([r,n])=>e.setAttribute(r,n));for(let r of t.children)r.type==T.VmlElement?e.appendChild(this.renderVmlChildElement(r)):e.appendChild(...Me(this.renderElement(r)));return e}renderMmlRadical(t){var n;const e=t.children.find(a=>a.type==T.MmlBase);if((n=t.props)!=null&&n.hideDegree)return this.createMathMLElement("msqrt",null,this.renderElements([e]));const r=t.children.find(a=>a.type==T.MmlDegree);return this.createMathMLElement("mroot",null,this.renderElements([e,r]))}renderMmlDelimiter(t){const e=[];return e.push(this.createMathMLElement("mo",null,[t.props.beginChar??"("])),e.push(...this.renderElements(t.children)),e.push(this.createMathMLElement("mo",null,[t.props.endChar??")"])),this.createMathMLElement("mrow",null,e)}renderMmlNary(t){var g;const e=[],r=Pe(t.children,_=>_.type),n=r[T.MmlSuperArgument],a=r[T.MmlSubArgument],i=n?this.createMathMLElement("mo",null,Me(this.renderElement(n))):null,o=a?this.createMathMLElement("mo",null,Me(this.renderElement(a))):null,c=this.createMathMLElement("mo",null,[((g=t.props)==null?void 0:g.char)??"∫"]);return i||o?e.push(this.createMathMLElement("munderover",null,[c,o,i])):i?e.push(this.createMathMLElement("mover",null,[c,i])):o?e.push(this.createMathMLElement("munder",null,[c,o])):e.push(c),e.push(...this.renderElements(r[T.MmlBase].children)),this.createMathMLElement("mrow",null,e)}renderMmlPreSubSuper(t){const e=[],r=Pe(t.children,g=>g.type),n=r[T.MmlSuperArgument],a=r[T.MmlSubArgument],i=n?this.createMathMLElement("mo",null,Me(this.renderElement(n))):null,o=a?this.createMathMLElement("mo",null,Me(this.renderElement(a))):null,c=this.createMathMLElement("mo",null);return e.push(this.createMathMLElement("msubsup",null,[c,o,i])),e.push(...this.renderElements(r[T.MmlBase].children)),this.createMathMLElement("mrow",null,e)}renderMmlGroupChar(t){const e=t.props.verticalJustification==="bot"?"mover":"munder",r=this.renderContainerNS(t,ie.mathML,e);return t.props.char&&r.appendChild(this.createMathMLElement("mo",null,[t.props.char])),r}renderMmlBar(t){const e={};switch(t.props.position){case"top":e.textDecoration="overline";break;case"bottom":e.textDecoration="underline";break}return this.renderContainerNS(t,ie.mathML,"mrow",{style:e})}renderMmlRun(t){return this.toHTML(t,ie.mathML,"ms")}renderMllList(t){const e=this.renderElements(t.children).map(r=>this.createMathMLElement("mtr",null,[this.createMathMLElement("mtd",null,[r])]));return this.toHTML(t,ie.mathML,"mtable",e)}toH(t,e,r,n=null){const{$lang:a,...i}=t.cssStyle??{},o=ln(t.className,t.styleName&&this.processStyleName(t.styleName));return{ns:e,tagName:r,className:o,lang:a,style:i,children:n??this.renderElements(t.children)}}toHTML(t,e,r,n=null){return this.h(this.toH(t,e,r,n))}findStyle(t){var e;return t&&((e=this.styleMap)==null?void 0:e[t])}numberingClass(t,e){return`${this.className}-num-${t}-${e}`}tabStopClass(){return`${this.className}-tab-stop`}styleToString(t,e,r=null){let n=`${t} {\r
36
+ `;for(const a in e)a.startsWith("$")||(n+=` ${a}: ${e[a]};\r
37
37
  `);return r&&(n+=r),n+`}\r
38
- `}numberingCounter(e,t){return`${this.className}-num-${e}-${t}`}levelTextToContent(e,t,r,n){const a={tab:"\\9",space:"\\a0"};var i=e.replace(/%\d*/g,l=>{let c=parseInt(l.substring(1),10)-1;return`"counter(${this.numberingCounter(r,c)}, ${n})"`});return`"${i}${a[t]??""}"`}numFormatToCssValue(e){var t={none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"};return t[e]??e}refreshTabStops(){this.options.experimental&&setTimeout(()=>{const e=en();for(let t of this.currentTabs)rn(t.span,t.stops,this.defaultTabSize,e)},500)}createElementNS(e,t,r,n){return this.h({ns:e,tagName:t,children:n,...r})}createElement(e,t,r){return this.createElementNS(it.html,e,t,r)}createMathMLElement(e,t,r){return this.createElementNS(it.mathML,e,t,r)}createSvgElement(e,t,r){return this.createElementNS(it.svg,e,t,r)}later(e){this.postRenderTasks.push(e)}}function sn(s,e){for(var t=s.parent;t!=null&&t.type!=e;)t=t.parent;return t}const Ht={ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0,hideWrapperOnPrint:!1,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1,renderAltChunks:!0,h:Tt};function te(s,e){const t={...Ht,...e};return Qt.load(s,new Kr(t),t)}async function ee(s,e){const t={...Ht,...e};return await new an().render(s,t)}async function on(s,e,t,r){const n=await te(s,r),a=await ee(n,r);t??(t=e),t.innerHTML="",e.innerHTML="";for(let i of a)(i.nodeName==="STYLE"?t:e).appendChild(i);return n}const Nt="application/vnd.openxmlformats-officedocument.wordprocessingml.document";async function xe(s){if(!s)throw new Error("未提供有效的文档数据源");if(s instanceof Blob)return s.type?s:new Blob([s],{type:Nt});if(s instanceof ArrayBuffer)return new Blob([s],{type:Nt});if(s instanceof Uint8Array)return new Blob([s.buffer],{type:Nt});if(typeof s=="string"){const e=s.trim();if(!e)throw new Error("文档数据源字符串为空");if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("blob:")){const i=await fetch(e);if(!i.ok)throw new Error(`加载远程文档失败 (${i.status} ${i.statusText})`);const l=await i.arrayBuffer();return new Blob([l],{type:Nt})}const t=e.includes("base64,")?e.split("base64,")[1]||"":e,r=window.atob(t.replace(/\s/g,"")),n=r.length,a=new Uint8Array(n);for(let i=0;i<n;i++)a[i]=r.charCodeAt(i);return new Blob([a.buffer],{type:Nt})}throw new Error("不支持的文档数据格式")}function Ce(s,e="未命名文档"){const t=(e||"未命名文档").trim(),r=/\.docx$/i.test(t)?t:`${t}.docx`,n=URL.createObjectURL(s),a=document.createElement("a");a.href=n,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>{URL.revokeObjectURL(n)},1e3)}const Pe={width:"595.30pt",height:"841.90pt"},yt={top:"72.00pt",bottom:"72.00pt",left:"90.00pt",right:"90.00pt",header:"42.55pt",footer:"49.60pt"};function bt(s,e=12){if(typeof s!="string"||!s.trim())return!1;const t=parseFloat(s);return!Number.isNaN(t)&&t>=e}function Ae(s){var b;const e=(b=s==null?void 0:s.documentPart)==null?void 0:b.body;if(!e)return;const t=e.props??(e.props={}),r=Array.isArray(e.children)?e.children:[];let n=Pe.width,a=Pe.height,i=yt.top,l=yt.bottom,c=yt.left,g=yt.right,_=yt.header,v=yt.footer;const y=[];for(const d of r)(d==null?void 0:d.type)==="paragraph"&&d.sectionProps&&y.push(d.sectionProps);y.push(t);for(let d=y.length-1;d>=0;d--){const f=y[d];f!=null&&f.pageSize&&(bt(f.pageSize.width,100)&&(n=f.pageSize.width),bt(f.pageSize.height,100)&&(a=f.pageSize.height)),f!=null&&f.pageMargins&&(bt(f.pageMargins.top,12)&&(i=f.pageMargins.top),bt(f.pageMargins.bottom,12)&&(l=f.pageMargins.bottom),bt(f.pageMargins.left,12)&&(c=f.pageMargins.left),bt(f.pageMargins.right,12)&&(g=f.pageMargins.right),bt(f.pageMargins.header,0)&&(_=f.pageMargins.header),bt(f.pageMargins.footer,0)&&(v=f.pageMargins.footer))}let u=Ee(t,{width:n,height:a,top:i,bottom:l,left:c,right:g,header:_,footer:v});for(let d=r.length-1;d>=0;d--){const f=r[d];(f==null?void 0:f.type)==="paragraph"&&f.sectionProps&&(f.sectionProps=Ee(f.sectionProps,{width:u.pageSize.width,height:u.pageSize.height,top:u.pageMargins.top,bottom:u.pageMargins.bottom,left:u.pageMargins.left,right:u.pageMargins.right,header:u.pageMargins.header,footer:u.pageMargins.footer}),u=f.sectionProps)}}function Ee(s,e){const t=s.pageSize??(s.pageSize={});bt(t.width,100)||(t.width=e.width),bt(t.height,100)||(t.height=e.height);const r=s.pageMargins??(s.pageMargins={});return bt(r.top,12)||(r.top=e.top),bt(r.bottom,12)||(r.bottom=e.bottom),bt(r.left,12)||(r.left=e.left),bt(r.right,12)||(r.right=e.right),bt(r.header,0)||(r.header=e.header),bt(r.footer,0)||(r.footer=e.footer),s}function Rt(s,e){return!s||s.type!=="break"?!1:s.break==="page"||!e&&s.break==="lastRenderedPageBreak"}function Ne(s,e){return s?Rt(s,e)?!0:Array.isArray(s.children)?s.children.some(t=>Ne(t,e)):!1:!1}function ln(s,e){if(s.length===0)return!1;for(const t of s){if(!t||t.type!=="run"||!Array.isArray(t.children))return!1;for(const r of t.children)if(!Rt(r,e))return!1}return!0}function cn(s,e){if(!s||s.type!=="paragraph")return[s];const t=s.sectionProps??null;t&&delete s.sectionProps;const r=Array.isArray(s.children)?s.children:[],n=[];for(const c of r)c&&c.type!=="run"&&Array.isArray(c.children)&&Ne(c,e)&&(n.push({type:"run",children:[{type:"break",break:"page"}]}),Me(c,e)),n.push(c);const a=[];let i=[];for(const c of n){if(!c||c.type!=="run"||!Array.isArray(c.children)){i.push(c);continue}let g=[];for(const _ of c.children)Rt(_,e)?(g.length>0&&(i.push({...c,children:g}),g=[]),i.push({type:"run",children:[{type:"break",break:"page"}]}),a.push(i),i=[]):g.push(_);g.length>0&&i.push({...c,children:g})}(i.length>0||a.length===0)&&a.push(i);const l=a.map((c,g)=>a.length>1&&ln(c,e)?{type:"paragraph",cssStyle:{margin:"0pt","min-height":"0pt","line-height":"0pt"},children:c}:{...s,pageBreakBefore:g===0?s.pageBreakBefore:!1,cssStyle:g<a.length-1?{...s.cssStyle||{},"margin-bottom":"0pt"}:{...s.cssStyle||{}},children:c});if(t){const c=l[l.length-1];c.children.some(_=>Array.isArray(_==null?void 0:_.children)&&_.children.some(v=>Rt(v,e)))?l.push({type:"paragraph",cssStyle:{margin:"0pt","min-height":"0pt","line-height":"0pt"},sectionProps:t,children:t.type!=="continuous"?[{type:"run",children:[{type:"break",break:"page"}]}]:[]}):(c.sectionProps=t,t.type!=="continuous"&&c.children.push({type:"run",children:[{type:"break",break:"page"}]}))}return l}function Me(s,e){if(!(!s||!Array.isArray(s.children))){s.children=s.children.filter(t=>!Rt(t,e));for(const t of s.children)Me(t,e)}}function hn(s,e=!1){var n;const t=(n=s==null?void 0:s.documentPart)==null?void 0:n.body;if(!t||!Array.isArray(t.children))return;Ae(s);const r=[];for(const a of t.children)(a==null?void 0:a.type)==="paragraph"?r.push(...cn(a,e)):r.push(a);t.children=r}function un(s,e="docx"){const r=s.querySelector(`.${e}-wrapper`)??s,n=Array.from(r.querySelectorAll(`:scope > section.${e}`));for(const l of n)dn(l);let a=0;const i=500;for(let l=0;l<n.length&&a<i;l++){const c=n[l],g=window.getComputedStyle(c),_=parseFloat(g.minHeight||"0");if(!_||Number.isNaN(_)||_<200)continue;const v=8;if(c.scrollHeight<=_+v)continue;const y=Array.from(c.querySelectorAll(":scope > article"));if(y.length===0)continue;const u=y[0];if(y.length>1)for(let J=1;J<y.length;J++){const S=y[J];for(;S.firstChild;)u.appendChild(S.firstChild);S.remove()}const b=Array.from(u.children);if(b.length===0)continue;const d=parseFloat(g.paddingTop||"0"),f=parseFloat(g.paddingBottom||"0"),p=c.querySelector(":scope > header"),k=c.querySelector(":scope > footer"),C=p?p.offsetHeight:0,P=k?k.offsetHeight:0,A=Math.max(120,_-d-f-C-P),I=u.getBoundingClientRect();let T=-1;for(let J=0;J<b.length;J++)if(b[J].getBoundingClientRect().bottom-I.top>A+v){T=J;break}if(T===-1)continue;const $=b[T];if($.tagName==="TABLE"){const J=pn($,I.top,A,v,T===0);if(J){const S=Be(c,u,p,k,[J,...b.slice(T+1)],!1);c.after(S),n.splice(l+1,0,S),a++;continue}}if(T===0){if(b.length<=1)continue;T=1}const F=b.slice(T),W=Be(c,u,p,k,F,!0);c.after(W),n.splice(l+1,0,W),a++}for(const l of n)fn(l)}function dn(s){const e=window.getComputedStyle(s);parseFloat(e.paddingLeft||"0")<16&&(s.style.paddingLeft=yt.left),parseFloat(e.paddingRight||"0")<16&&(s.style.paddingRight=yt.right),parseFloat(e.paddingTop||"0")<16&&(s.style.paddingTop=yt.top),parseFloat(e.paddingBottom||"0")<16&&(s.style.paddingBottom=yt.bottom)}function fn(s){if(s.querySelector(":scope > .jvs-docx-crop-marks"))return;const e=window.getComputedStyle(s),t=e.paddingTop||yt.top,r=e.paddingBottom||yt.bottom,n=e.paddingLeft||yt.left,a=e.paddingRight||yt.right,i=document.createElement("div");i.className="jvs-docx-crop-marks",i.setAttribute("aria-hidden","true"),i.style.cssText="position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden;";const l="18px",c="#c0c4cc",g=document.createElement("span");g.style.cssText=`position:absolute;left:calc(${n} - ${l});top:calc(${t} - ${l});width:${l};height:${l};border-right:1px solid ${c};border-bottom:1px solid ${c};`;const _=document.createElement("span");_.style.cssText=`position:absolute;right:calc(${a} - ${l});top:calc(${t} - ${l});width:${l};height:${l};border-left:1px solid ${c};border-bottom:1px solid ${c};`;const v=document.createElement("span");v.style.cssText=`position:absolute;left:calc(${n} - ${l});bottom:calc(${r} - ${l});width:${l};height:${l};border-right:1px solid ${c};border-top:1px solid ${c};`;const y=document.createElement("span");y.style.cssText=`position:absolute;right:calc(${a} - ${l});bottom:calc(${r} - ${l});width:${l};height:${l};border-left:1px solid ${c};border-top:1px solid ${c};`,i.append(g,_,v,y),s.prepend(i)}function pn(s,e,t,r,n){const a=s.querySelector("tbody")??s,i=Array.from(a.querySelectorAll(":scope > tr"));if(i.length<=1)return null;let l=-1;for(let u=0;u<i.length;u++)if(i[u].getBoundingClientRect().bottom-e>t+r){l=u;break}if(l===-1)return null;if(l===0){if(!n)return null;l=1}for(let u=0;u<l;u++){const b=Array.from(i[u].children);for(let d=0;d<b.length;d++){const f=b[d],p=f.rowSpan||1;if(u+p>l){const k=u+p-l;f.rowSpan=l-u;const P=Array.from(i[l].children)[d];P&&P.style.display==="none"&&(P.style.display="",P.rowSpan=k)}}}const c=s.cloneNode(!1),g=s.querySelector(":scope > colgroup");g&&c.appendChild(g.cloneNode(!0));const _=s.querySelector(":scope > thead");_&&c.appendChild(_.cloneNode(!0));const v=a===s?c:a.cloneNode(!1),y=i.slice(l);for(const u of y)v.appendChild(u);return a!==s&&c.appendChild(v),c}function Be(s,e,t,r,n,a){const i=s.cloneNode(!1);t&&i.appendChild(t.cloneNode(!0));const l=e.cloneNode(!1);let c=0;if(a)for(;c<n.length-1&&mn(n[c]);)c++;for(let g=0;g<n.length;g++)g<c?n[g].remove():l.appendChild(n[g]);return i.appendChild(l),r&&i.appendChild(r.cloneNode(!0)),i}function mn(s){return s.tagName!=="P"||s.querySelector("img, svg, table, hr, iframe")?!1:(s.textContent??"").trim().length===0}const gn={class:"jvs-docx-viewer"},bn={key:0,class:"jvs-docx-viewer__overlay"},vn={key:1,class:"jvs-docx-viewer__overlay jvs-docx-viewer__overlay--error"},yn={class:"jvs-docx-viewer__state-desc"},kn={key:2,class:"jvs-docx-viewer__overlay"},Te=((s,e)=>{const t=s.__vccOpts||s;for(const[r,n]of e)t[r]=n;return t})(st.defineComponent({name:"JvsDocx",__name:"index",props:{fileContent:{default:void 0},fileUrl:{default:void 0},fileName:{default:"未命名文档.docx"},options:{default:()=>({})}},emits:["rendered","error","change"],setup(s,{expose:e,emit:t}){const r=s,n=t,a=st.ref(null),i=st.ref(!1),l=st.ref(""),c=st.ref(!1),g=st.ref(r.fileName),_=st.shallowRef(null),v=st.shallowRef(null);function y(){return{...Ht,className:"docx",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!1,ignoreFonts:!1,breakPages:!0,ignoreLastRenderedPageBreak:!1,experimental:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!0,...r.options}}async function u(P,A){i.value=!0,l.value="";try{const I=await xe(P);A?g.value=A:P instanceof File&&P.name&&(g.value=P.name),await st.nextTick();const T=a.value;if(!T)throw new Error("docxjs 预览容器未挂载");T.innerHTML="";const $=y(),F=await te(I,$);Ae(F),$.breakPages!==!1&&hn(F,!!$.ignoreLastRenderedPageBreak);const W=await ee(F,$);for(const J of W)T.appendChild(J);return $.breakPages!==!1&&un(T,$.className||"docx"),T.scrollTop=0,_.value=I,v.value=F,c.value=!0,n("rendered",F),n("change",I),F}catch(I){const T=I instanceof Error?I:new Error((I==null?void 0:I.message)||"docxjs 文档解析失败");throw l.value=T.message,c.value=!1,n("error",T),T}finally{i.value=!1}}async function b(P,A){return u(P,A)}async function d(P,A=!0){if(!_.value)throw new Error("当前暂无可导出的文档,请先导入 .docx 文件");const I=P||g.value||r.fileName||"未命名文档.docx";return A&&Ce(_.value,I),_.value}function f(){a.value&&(a.value.innerHTML=""),_.value=null,v.value=null,c.value=!1,l.value="",i.value=!1,n("change",null)}function p(){return v.value}function k(){return _.value}function C(){return a.value}return st.watch(()=>r.fileName,P=>{P&&(g.value=P)}),st.watch(()=>[r.fileContent,r.fileUrl],async([P,A])=>{const I=P??A;if(I)try{await u(I,r.fileName)}catch{}else(P===null||A==="")&&f()}),st.onMounted(async()=>{const P=r.fileContent??r.fileUrl;if(P)try{await u(P,r.fileName)}catch{}}),st.onBeforeUnmount(()=>{f()}),e({importDocxFile:u,renderDocx:b,exportDocxFile:d,clear:f,getWordDocument:p,getBlob:k,getContainer:C}),(P,A)=>(st.openBlock(),st.createElementBlock("div",gn,[st.createElementVNode("div",{ref_key:"previewContainerRef",ref:a,class:"jvs-docx-viewer__container"},null,512),i.value?(st.openBlock(),st.createElementBlock("div",bn,[...A[0]||(A[0]=[st.createElementVNode("div",{class:"jvs-docx-viewer__spinner"},null,-1),st.createElementVNode("p",{class:"jvs-docx-viewer__state-text"},"正在使用 docxjs 解析并渲染文档...",-1)])])):l.value?(st.openBlock(),st.createElementBlock("div",vn,[A[1]||(A[1]=st.createStaticVNode('<svg viewBox="0 0 24 24" width="40" height="40" fill="none" stroke="currentColor" stroke-width="1.6" data-v-ebacf228><circle cx="12" cy="12" r="10" data-v-ebacf228></circle><line x1="12" y1="8" x2="12" y2="12" data-v-ebacf228></line><line x1="12" y1="16" x2="12.01" y2="16" data-v-ebacf228></line></svg><p class="jvs-docx-viewer__state-title" data-v-ebacf228>文档渲染失败</p>',2)),st.createElementVNode("p",yn,st.toDisplayString(l.value),1)])):c.value?st.createCommentVNode("",!0):(st.openBlock(),st.createElementBlock("div",kn,[...A[2]||(A[2]=[st.createStaticVNode('<div class="jvs-docx-viewer__empty-icon" data-v-ebacf228><svg viewBox="0 0 24 24" width="44" height="44" fill="none" stroke="currentColor" stroke-width="1.5" data-v-ebacf228><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-ebacf228></path><polyline points="14 2 14 8 20 8" data-v-ebacf228></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-ebacf228></line><line x1="16" y1="17" x2="8" y2="17" data-v-ebacf228></line><line x1="10" y1="9" x2="8" y2="9" data-v-ebacf228></line></svg></div><p class="jvs-docx-viewer__state-title" data-v-ebacf228>暂无预览文档</p><p class="jvs-docx-viewer__state-desc" data-v-ebacf228>请点击顶部「导入文件」选择本地 .docx 文件加载预览</p>',3)])]))]))}}),[["__scopeId","data-v-ebacf228"]]),Re={install(s){s.component("JvsDocx",Te)}};gt.DOCX_MIME_TYPE=Nt,gt.JvsDocx=Te,gt.JvsDocxUiPlugin=Re,gt.default=Re,gt.defaultOptions=Ht,gt.downloadDocxBlob=Ce,gt.normalizeDocxSourceToBlob=xe,gt.parseAsync=te,gt.renderAsync=on,gt.renderDocument=ee,Object.defineProperties(gt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
38
+ `}numberingCounter(t,e){return`${this.className}-num-${t}-${e}`}levelTextToContent(t,e,r,n){const a={tab:"\\9",space:"\\a0"};var i=t.replace(/%\d*/g,o=>{let c=parseInt(o.substring(1),10)-1;return`"counter(${this.numberingCounter(r,c)}, ${n})"`});return`"${i}${a[e]??""}"`}numFormatToCssValue(t){var e={none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"};return e[t]??t}refreshTabStops(){this.options.experimental&&setTimeout(()=>{const t=sn();for(let e of this.currentTabs)on(e.span,e.stops,this.defaultTabSize,t)},500)}createElementNS(t,e,r,n){return this.h({ns:t,tagName:e,children:n,...r})}createElement(t,e,r){return this.createElementNS(ie.html,t,e,r)}createMathMLElement(t,e,r){return this.createElementNS(ie.mathML,t,e,r)}createSvgElement(t,e,r){return this.createElementNS(ie.svg,t,e,r)}later(t){this.postRenderTasks.push(t)}}function hn(s,t){for(var e=s.parent;e!=null&&e.type!=t;)e=e.parent;return e}const We={ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0,hideWrapperOnPrint:!1,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1,renderAltChunks:!0,h:Re};function nt(s,t){const e={...We,...t};return rt.load(s,new rn(e),e)}async function at(s,t){const e={...We,...t};return await new cn().render(s,e)}async function un(s,t,e,r){const n=await nt(s,r),a=await at(n,r);e??(e=t),e.innerHTML="",t.innerHTML="";for(let i of a)(i.nodeName==="STYLE"?e:t).appendChild(i);return n}const Ee="application/vnd.openxmlformats-officedocument.wordprocessingml.document";function dn(s){if(s.byteLength<4)return!1;const t=new Uint8Array(s,0,4);return t[0]===80&&t[1]===75&&t[2]===3&&t[3]===4}function fn(s){if(s.byteLength<8)return!1;const t=new Uint8Array(s,0,8);return t[0]===208&&t[1]===207&&t[2]===17&&t[3]===224&&t[4]===161&&t[5]===177&&t[6]===26&&t[7]===225}function Be(s){if(!s||s.byteLength===0)throw new Error("获取到的文档文件为空(0 字节)");if(!dn(s)){if(fn(s))throw new Error("当前文件为旧版二进制 .doc 格式(Word 97-2003),请转换为 .docx 格式后再预览");try{const t=new Uint8Array(s,0,Math.min(s.byteLength,1024)),e=new TextDecoder("utf-8").decode(t).trim();if(e.startsWith("{")&&e.endsWith("}")){const r=JSON.parse(e),n=r.msg||r.message||r.error||"接口返回非文档数据";throw new Error(`加载文档失败:${n}`)}if(/^<!DOCTYPE\s+html|^<html/i.test(e))throw new Error("文件链接返回了 HTML 页面而非 .docx 文档流,请检查链接地址或鉴权状态")}catch(t){if(t instanceof Error&&t.message.startsWith("加载文档失败:")||t instanceof Error&&t.message.startsWith("文件链接返回了"))throw t}throw new Error("无效的 .docx 文件内容,请确认文件未损坏且为标准 .docx 格式")}}function At(s){const t=s.trim();if(!t||t.startsWith("data:"))return!1;if(/^(https?:\/\/|\/\/|\/|\.\/|\.\.\/|blob:)/i.test(t)||/\.docx(\?.*|#.*)?$/i.test(t)||(t.includes("?")||t.includes("&")||t.includes("="))&&(t.includes("?")||t.includes("&")))return!0;const e=t.replace(/\s/g,"");return!!(!/^[A-Za-z0-9+/]+={0,2}$/.test(e)||e.length<256&&e.includes("/"))}function Et(s,t){if(t){const e=t.match(/filename\*\s*=\s*UTF-8''([^;]+)/i);if(e!=null&&e[1])try{return decodeURIComponent(e[1].trim().replace(/^["']|["']$/g,""))}catch{}const r=t.match(/filename\s*=\s*("?)([^";]+)\1/i);if(r!=null&&r[2])try{return decodeURIComponent(r[2].trim())}catch{return r[2].trim()}}try{const e=s.split("#")[0]||"",[r,n]=e.split("?");if(n){const i=new URLSearchParams(n),o=i.get("fileName")||i.get("filename")||i.get("name")||i.get("title");if(o)return decodeURIComponent(o)}const a=decodeURIComponent((r||"").split("/").pop()||"").trim();if(a&&a!=="download"&&a!=="preview")return a}catch{}return"未命名文档.docx"}async function Ze(s,t){var o;const e=s.trim();if(!e)throw new Error("文件链接地址不能为空");const r={method:"GET",...t==null?void 0:t.requestInit,headers:{...(o=t==null?void 0:t.requestInit)==null?void 0:o.headers,...t==null?void 0:t.headers}};let n,a=null;if(t!=null&&t.customFetch){const c=await t.customFetch(e,r);if(c instanceof Response){if(!c.ok)throw new Error(`加载远程文档失败 (${c.status} ${c.statusText})`);a=c.headers.get("content-disposition"),n=await c.arrayBuffer()}else c instanceof Blob?n=await c.arrayBuffer():c instanceof Uint8Array?n=c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength):n=c}else{const c=await fetch(e,r);if(!c.ok)throw new Error(`加载远程文档失败 (${c.status} ${c.statusText})`);a=c.headers.get("content-disposition"),n=await c.arrayBuffer()}Be(n);const i=(t==null?void 0:t.fileName)||Et(e,a);return{blob:new Blob([n],{type:Ee}),fileName:i}}async function Ve(s,t){if(!s)throw new Error("未提供有效的文档数据源");if(typeof s=="object"&&!(s instanceof Blob)&&!(s instanceof ArrayBuffer)&&!(s instanceof Uint8Array)){const e={...t,fileName:s.fileName||(t==null?void 0:t.fileName),headers:{...t==null?void 0:t.headers,...s.headers},requestInit:s.requestInit||(t==null?void 0:t.requestInit)},r=s.content??s.fileUrl??s.url;if(!r)throw new Error("文档配置对象中未提供 url 或 content");return Ve(r,e)}if(s instanceof File){const e=await s.arrayBuffer();return Be(e),{blob:new Blob([e],{type:Ee}),fileName:(t==null?void 0:t.fileName)||s.name||"未命名文档.docx"}}if(s instanceof Blob){const e=await s.arrayBuffer();return Be(e),{blob:new Blob([e],{type:Ee}),fileName:(t==null?void 0:t.fileName)||"未命名文档.docx"}}if(s instanceof ArrayBuffer)return Be(s),{blob:new Blob([s],{type:Ee}),fileName:(t==null?void 0:t.fileName)||"未命名文档.docx"};if(s instanceof Uint8Array){const e=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return Be(e),{blob:new Blob([e],{type:Ee}),fileName:(t==null?void 0:t.fileName)||"未命名文档.docx"}}if(typeof s=="string"){const e=s.trim();if(!e)throw new Error("文档数据源字符串为空");if(At(e))return Ze(e,t);const r=e.includes("base64,")?e.split("base64,")[1]||"":e;let n;try{n=window.atob(r.replace(/\s/g,""))}catch{return Ze(e,t)}const a=n.length,i=new Uint8Array(a);for(let c=0;c<a;c++)i[c]=n.charCodeAt(c);const o=i.buffer;return Be(o),{blob:new Blob([o],{type:Ee}),fileName:(t==null?void 0:t.fileName)||"未命名文档.docx"}}throw new Error("不支持的文档数据格式")}async function pn(s,t){return(await Ve(s,t)).blob}function Nt(s,t="未命名文档"){const e=(t||"未命名文档").trim(),r=/\.docx$/i.test(e)?e:`${e}.docx`,n=URL.createObjectURL(s),a=document.createElement("a");a.href=n,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>{URL.revokeObjectURL(n)},1e3)}const Bt={width:"595.30pt",height:"841.90pt"},ye={top:"72.00pt",bottom:"72.00pt",left:"90.00pt",right:"90.00pt",header:"42.55pt",footer:"49.60pt"};function be(s,t=12){if(typeof s!="string"||!s.trim())return!1;const e=parseFloat(s);return!Number.isNaN(e)&&e>=t}function Mt(s){var v;const t=(v=s==null?void 0:s.documentPart)==null?void 0:v.body;if(!t)return;const e=t.props??(t.props={}),r=Array.isArray(t.children)?t.children:[];let n=Bt.width,a=Bt.height,i=ye.top,o=ye.bottom,c=ye.left,g=ye.right,_=ye.header,y=ye.footer;const b=[];for(const u of r)(u==null?void 0:u.type)==="paragraph"&&u.sectionProps&&b.push(u.sectionProps);b.push(e);for(let u=b.length-1;u>=0;u--){const f=b[u];f!=null&&f.pageSize&&(be(f.pageSize.width,100)&&(n=f.pageSize.width),be(f.pageSize.height,100)&&(a=f.pageSize.height)),f!=null&&f.pageMargins&&(be(f.pageMargins.top,12)&&(i=f.pageMargins.top),be(f.pageMargins.bottom,12)&&(o=f.pageMargins.bottom),be(f.pageMargins.left,12)&&(c=f.pageMargins.left),be(f.pageMargins.right,12)&&(g=f.pageMargins.right),be(f.pageMargins.header,0)&&(_=f.pageMargins.header),be(f.pageMargins.footer,0)&&(y=f.pageMargins.footer))}let d=Tt(e,{width:n,height:a,top:i,bottom:o,left:c,right:g,header:_,footer:y});for(let u=r.length-1;u>=0;u--){const f=r[u];(f==null?void 0:f.type)==="paragraph"&&f.sectionProps&&(f.sectionProps=Tt(f.sectionProps,{width:d.pageSize.width,height:d.pageSize.height,top:d.pageMargins.top,bottom:d.pageMargins.bottom,left:d.pageMargins.left,right:d.pageMargins.right,header:d.pageMargins.header,footer:d.pageMargins.footer}),d=f.sectionProps)}}function Tt(s,t){const e=s.pageSize??(s.pageSize={});be(e.width,100)||(e.width=t.width),be(e.height,100)||(e.height=t.height);const r=s.pageMargins??(s.pageMargins={});return be(r.top,12)||(r.top=t.top),be(r.bottom,12)||(r.bottom=t.bottom),be(r.left,12)||(r.left=t.left),be(r.right,12)||(r.right=t.right),be(r.header,0)||(r.header=t.header),be(r.footer,0)||(r.footer=t.footer),s}function ze(s,t){return!s||s.type!=="break"?!1:s.break==="page"||!t&&s.break==="lastRenderedPageBreak"}function Rt(s,t){return s?ze(s,t)?!0:Array.isArray(s.children)?s.children.some(e=>Rt(e,t)):!1:!1}function mn(s,t){if(s.length===0)return!1;for(const e of s){if(!e||e.type!=="run"||!Array.isArray(e.children))return!1;for(const r of e.children)if(!ze(r,t))return!1}return!0}function gn(s,t){if(!s||s.type!=="paragraph")return[s];const e=s.sectionProps??null;e&&delete s.sectionProps;const r=Array.isArray(s.children)?s.children:[],n=[];for(const c of r)c&&c.type!=="run"&&Array.isArray(c.children)&&Rt(c,t)&&(n.push({type:"run",children:[{type:"break",break:"page"}]}),zt(c,t)),n.push(c);const a=[];let i=[];for(const c of n){if(!c||c.type!=="run"||!Array.isArray(c.children)){i.push(c);continue}let g=[];for(const _ of c.children)ze(_,t)?(g.length>0&&(i.push({...c,children:g}),g=[]),i.push({type:"run",children:[{type:"break",break:"page"}]}),a.push(i),i=[]):g.push(_);g.length>0&&i.push({...c,children:g})}(i.length>0||a.length===0)&&a.push(i);const o=a.map((c,g)=>a.length>1&&mn(c,t)?{type:"paragraph",cssStyle:{margin:"0pt","min-height":"0pt","line-height":"0pt"},children:c}:{...s,pageBreakBefore:g===0?s.pageBreakBefore:!1,cssStyle:g<a.length-1?{...s.cssStyle||{},"margin-bottom":"0pt"}:{...s.cssStyle||{}},children:c});if(e){const c=o[o.length-1];c.children.some(_=>Array.isArray(_==null?void 0:_.children)&&_.children.some(y=>ze(y,t)))?o.push({type:"paragraph",cssStyle:{margin:"0pt","min-height":"0pt","line-height":"0pt"},sectionProps:e,children:e.type!=="continuous"?[{type:"run",children:[{type:"break",break:"page"}]}]:[]}):(c.sectionProps=e,e.type!=="continuous"&&c.children.push({type:"run",children:[{type:"break",break:"page"}]}))}return o}function zt(s,t){if(!(!s||!Array.isArray(s.children))){s.children=s.children.filter(e=>!ze(e,t));for(const e of s.children)zt(e,t)}}function bn(s,t=!1){var n;const e=(n=s==null?void 0:s.documentPart)==null?void 0:n.body;if(!e||!Array.isArray(e.children))return;Mt(s);const r=[];for(const a of e.children)(a==null?void 0:a.type)==="paragraph"?r.push(...gn(a,t)):r.push(a);e.children=r}function vn(s,t="docx"){const r=s.querySelector(`.${t}-wrapper`)??s,n=Array.from(r.querySelectorAll(`:scope > section.${t}`));for(const o of n)yn(o);let a=0;const i=500;for(let o=0;o<n.length&&a<i;o++){const c=n[o],g=window.getComputedStyle(c),_=parseFloat(g.minHeight||"0");if(!_||Number.isNaN(_)||_<200)continue;const y=8;if(c.scrollHeight<=_+y)continue;const b=Array.from(c.querySelectorAll(":scope > article"));if(b.length===0)continue;const d=b[0];if(b.length>1)for(let G=1;G<b.length;G++){const S=b[G];for(;S.firstChild;)d.appendChild(S.firstChild);S.remove()}const v=Array.from(d.children);if(v.length===0)continue;const u=parseFloat(g.paddingTop||"0"),f=parseFloat(g.paddingBottom||"0"),p=c.querySelector(":scope > header"),k=c.querySelector(":scope > footer"),C=p?p.offsetHeight:0,A=k?k.offsetHeight:0,E=Math.max(120,_-u-f-C-A),D=d.getBoundingClientRect();let F=-1;for(let G=0;G<v.length;G++)if(v[G].getBoundingClientRect().bottom-D.top>E+y){F=G;break}if(F===-1)continue;const H=v[F];if(H.tagName==="TABLE"){const G=wn(H,D.top,E,y,F===0);if(G){const S=Ft(c,d,p,k,[G,...v.slice(F+1)],!1);c.after(S),n.splice(o+1,0,S),a++;continue}}if(F===0){if(v.length<=1)continue;F=1}const I=v.slice(F),$=Ft(c,d,p,k,I,!0);c.after($),n.splice(o+1,0,$),a++}for(const o of n)kn(o)}function yn(s){const t=window.getComputedStyle(s);parseFloat(t.paddingLeft||"0")<16&&(s.style.paddingLeft=ye.left),parseFloat(t.paddingRight||"0")<16&&(s.style.paddingRight=ye.right),parseFloat(t.paddingTop||"0")<16&&(s.style.paddingTop=ye.top),parseFloat(t.paddingBottom||"0")<16&&(s.style.paddingBottom=ye.bottom)}function kn(s){if(s.querySelector(":scope > .jvs-docx-crop-marks"))return;const t=window.getComputedStyle(s),e=t.paddingTop||ye.top,r=t.paddingBottom||ye.bottom,n=t.paddingLeft||ye.left,a=t.paddingRight||ye.right,i=document.createElement("div");i.className="jvs-docx-crop-marks",i.setAttribute("aria-hidden","true"),i.style.cssText="position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden;";const o="18px",c="#c0c4cc",g=document.createElement("span");g.style.cssText=`position:absolute;left:calc(${n} - ${o});top:calc(${e} - ${o});width:${o};height:${o};border-right:1px solid ${c};border-bottom:1px solid ${c};`;const _=document.createElement("span");_.style.cssText=`position:absolute;right:calc(${a} - ${o});top:calc(${e} - ${o});width:${o};height:${o};border-left:1px solid ${c};border-bottom:1px solid ${c};`;const y=document.createElement("span");y.style.cssText=`position:absolute;left:calc(${n} - ${o});bottom:calc(${r} - ${o});width:${o};height:${o};border-right:1px solid ${c};border-top:1px solid ${c};`;const b=document.createElement("span");b.style.cssText=`position:absolute;right:calc(${a} - ${o});bottom:calc(${r} - ${o});width:${o};height:${o};border-left:1px solid ${c};border-top:1px solid ${c};`,i.append(g,_,y,b),s.prepend(i)}function wn(s,t,e,r,n){const a=s.querySelector("tbody")??s,i=Array.from(a.querySelectorAll(":scope > tr"));if(i.length<=1)return null;let o=-1;for(let d=0;d<i.length;d++)if(i[d].getBoundingClientRect().bottom-t>e+r){o=d;break}if(o===-1)return null;if(o===0){if(!n)return null;o=1}for(let d=0;d<o;d++){const v=Array.from(i[d].children);for(let u=0;u<v.length;u++){const f=v[u],p=f.rowSpan||1;if(d+p>o){const k=d+p-o;f.rowSpan=o-d;const A=Array.from(i[o].children)[u];A&&A.style.display==="none"&&(A.style.display="",A.rowSpan=k)}}}const c=s.cloneNode(!1),g=s.querySelector(":scope > colgroup");g&&c.appendChild(g.cloneNode(!0));const _=s.querySelector(":scope > thead");_&&c.appendChild(_.cloneNode(!0));const y=a===s?c:a.cloneNode(!1),b=i.slice(o);for(const d of b)y.appendChild(d);return a!==s&&c.appendChild(y),c}function Ft(s,t,e,r,n,a){const i=s.cloneNode(!1);e&&i.appendChild(e.cloneNode(!0));const o=t.cloneNode(!1);let c=0;if(a)for(;c<n.length-1&&_n(n[c]);)c++;for(let g=0;g<n.length;g++)g<c?n[g].remove():o.appendChild(n[g]);return i.appendChild(o),r&&i.appendChild(r.cloneNode(!0)),i}function _n(s){return s.tagName!=="P"||s.querySelector("img, svg, table, hr, iframe")?!1:(s.textContent??"").trim().length===0}const Sn={class:"jvs-docx-viewer"},xn={key:0,class:"jvs-docx-viewer__overlay"},Cn={key:1,class:"jvs-docx-viewer__overlay jvs-docx-viewer__overlay--error"},Pn={class:"jvs-docx-viewer__state-desc"},An={key:2,class:"jvs-docx-viewer__overlay"},It=((s,t)=>{const e=s.__vccOpts||s;for(const[r,n]of t)e[r]=n;return e})(ne.defineComponent({name:"JvsDocx",__name:"index",props:{fileContent:{default:void 0},fileUrl:{default:void 0},url:{default:void 0},src:{default:void 0},modelValue:{default:void 0},fileName:{default:""},requestHeaders:{default:void 0},requestInit:{default:void 0},customFetch:{type:Function,default:void 0},options:{default:()=>({})}},emits:["rendered","loaded","error","change"],setup(s,{expose:t,emit:e}){const r=s,n=e,a=ne.ref(null),i=ne.ref(!1),o=ne.ref(""),c=ne.ref(!1),g=ne.ref(r.fileName||"未命名文档.docx"),_=ne.shallowRef(null),y=ne.shallowRef(null);let b=0;const d=ne.computed(()=>r.fileContent??r.fileUrl??r.url??r.src??r.modelValue);function v(){return{...We,className:"docx",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!1,ignoreFonts:!1,breakPages:!0,ignoreLastRenderedPageBreak:!1,experimental:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!0,...r.options}}function u($){const G=typeof $=="string"?{fileName:$}:{...$};return{fileName:G.fileName||r.fileName||void 0,headers:{...r.requestHeaders,...G.headers},requestInit:G.requestInit??r.requestInit,customFetch:G.customFetch??r.customFetch}}async function f($,G,S){await ne.nextTick();const M=a.value;if(!M)throw new Error("docxjs 预览容器未挂载");const h=v(),O=await nt($,h);if(S!==b)return O;Mt(O),h.breakPages!==!1&&bn(O,!!h.ignoreLastRenderedPageBreak);const te=await at(O,h);if(S!==b)return O;M.innerHTML="";for(const W of te)M.appendChild(W);return h.breakPages!==!1&&vn(M,h.className||"docx"),M.scrollTop=0,g.value=G||r.fileName||"未命名文档.docx",_.value=$,y.value=O,c.value=!0,n("rendered",O),n("loaded",{fileName:g.value,blob:$,document:O}),n("change",$),O}async function p($,G){const S=++b;i.value=!0,o.value="";try{const M=u(G),{blob:h,fileName:O}=await Ve($,M);return S!==b?y.value:await f(h,O,S)}catch(M){if(S===b){const h=M instanceof Error?M:new Error((M==null?void 0:M.message)||"docxjs 文档加载失败");o.value=h.message,c.value=!1,n("error",h)}throw M}finally{S===b&&(i.value=!1)}}async function k($,G){const S=++b;i.value=!0,o.value="";try{const M=u(G),{blob:h,fileName:O}=await Ze($,M);return S!==b?y.value:await f(h,O,S)}catch(M){if(S===b){const h=M instanceof Error?M:new Error((M==null?void 0:M.message)||"远程文档链接加载失败");o.value=h.message,c.value=!1,n("error",h)}throw M}finally{S===b&&(i.value=!1)}}async function C($,G){return p($,G)}async function A($,G=!0){if(!_.value)throw new Error("当前暂无可导出的文档,请先加载 .docx 文件");const S=$||g.value||r.fileName||"未命名文档.docx";return G&&Nt(_.value,S),_.value}function E(){b++,a.value&&(a.value.innerHTML=""),_.value=null,y.value=null,c.value=!1,o.value="",i.value=!1,n("change",null)}function D(){return y.value}function F(){return _.value}function H(){return g.value}function I(){return a.value}return ne.watch(()=>r.fileName,$=>{$&&(g.value=$)}),ne.watch(d,async $=>{if($)try{await p($,r.fileName||void 0)}catch{}else($===null||$==="")&&E()}),ne.onMounted(async()=>{if(d.value)try{await p(d.value,r.fileName||void 0)}catch{}}),ne.onBeforeUnmount(()=>{E()}),t({importDocxFile:p,loadFromUrl:k,renderDocx:C,exportDocxFile:A,clear:E,getWordDocument:D,getBlob:F,getFileName:H,getContainer:I}),($,G)=>(ne.openBlock(),ne.createElementBlock("div",Sn,[ne.createElementVNode("div",{ref_key:"previewContainerRef",ref:a,class:"jvs-docx-viewer__container"},null,512),i.value?(ne.openBlock(),ne.createElementBlock("div",xn,[...G[0]||(G[0]=[ne.createElementVNode("div",{class:"jvs-docx-viewer__spinner"},null,-1),ne.createElementVNode("p",{class:"jvs-docx-viewer__state-text"},"正在使用 docxjs 加载并渲染文档...",-1)])])):o.value?(ne.openBlock(),ne.createElementBlock("div",Cn,[G[1]||(G[1]=ne.createStaticVNode('<svg viewBox="0 0 24 24" width="40" height="40" fill="none" stroke="currentColor" stroke-width="1.6" data-v-34e07d63><circle cx="12" cy="12" r="10" data-v-34e07d63></circle><line x1="12" y1="8" x2="12" y2="12" data-v-34e07d63></line><line x1="12" y1="16" x2="12.01" y2="16" data-v-34e07d63></line></svg><p class="jvs-docx-viewer__state-title" data-v-34e07d63>文档渲染失败</p>',2)),ne.createElementVNode("p",Pn,ne.toDisplayString(o.value),1)])):c.value?ne.createCommentVNode("",!0):(ne.openBlock(),ne.createElementBlock("div",An,[...G[2]||(G[2]=[ne.createStaticVNode('<div class="jvs-docx-viewer__empty-icon" data-v-34e07d63><svg viewBox="0 0 24 24" width="44" height="44" fill="none" stroke="currentColor" stroke-width="1.5" data-v-34e07d63><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-34e07d63></path><polyline points="14 2 14 8 20 8" data-v-34e07d63></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-34e07d63></line><line x1="16" y1="17" x2="8" y2="17" data-v-34e07d63></line><line x1="10" y1="9" x2="8" y2="9" data-v-34e07d63></line></svg></div><p class="jvs-docx-viewer__state-title" data-v-34e07d63>暂无预览文档</p><p class="jvs-docx-viewer__state-desc" data-v-34e07d63> 请通过顶部「导入文件」、「加载链接」或传入文件地址/数据流进行预览 </p>',3)])]))]))}}),[["__scopeId","data-v-34e07d63"]]),Ot={install(s){s.component("JvsDocx",It)}};pe.DOCX_MIME_TYPE=Ee,pe.JvsDocx=It,pe.JvsDocxUiPlugin=Ot,pe.default=Ot,pe.defaultOptions=We,pe.downloadDocxBlob=Nt,pe.extractFileNameFromUrl=Et,pe.fetchDocxFromUrl=Ze,pe.isLikelyUrlString=At,pe.normalizeDocxSource=Ve,pe.normalizeDocxSourceToBlob=pn,pe.parseAsync=nt,pe.renderAsync=un,pe.renderDocument=at,Object.defineProperties(pe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));