@pretextbook/import 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,95 @@
1
+ "use strict";const Ue=require("@pretextbook/format"),Me=require("@pretextbook/latex-pretext"),We=require("@pretextbook/remark-pretext"),he=["\\documentclass","\\begin{document}","\\begin{","\\section","\\chapter","\\title","\\author"],pe=["# ","## ","### ","#### "];function Jt(c){const a=c.trim();return!a||a.startsWith("<")?"pretext":he.some(t=>a.includes(t))?"latex":pe.some(t=>a.startsWith(t))?"markdown":"pretext"}const Ze=[{kind:"presentation",category:"latex_fonts",macros:["textrm","textit","textbf","textsc","texttt"]}],re={kind:"presentation",category:"tex_fonts",pairs:[{from:"rm",to:"textrm"},{from:"em",to:"emph"},{from:"it",to:"textit"},{from:"itshape",to:"textit"},{from:"bf",to:"textbf"},{from:"bfseries",to:"textbf"},{from:"sf",to:"textsf"},{from:"sffamily",to:"textss"},{from:"textsl",to:"testsl"}]},He=[{kind:"accessibility",category:"consistency",macros:["renewcommand"]}],Ke=[{kind:"unused",category:"conditionals",macros:["if","fi","iffalse","then","else","loop","repeat"]},{kind:"presentation",category:"font_size",macros:["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge","normalfont"]},{kind:"presentation",category:"spacing_vertical",macros:["smallskip","medskip","bigskip","vfil","vfill"]},{kind:"presentation",category:"archaic_tex",macros:["centerline","centering","noindent","par","linebreak"]},{kind:"mistake",category:"nonstructural",macros:["ensuremath"]},{kind:"archaic",category:"low_level_tex",macros:["relax","makeatletter","makeatother","csname","endcsname","shipout","noexpand","expandafter","clearpage"]},{kind:"archaic",category:"file_manipulation",macros:["newwrite","newread","immediate","write","write18","read","readline","readfile","openin","openout","jobname"]}],Xe=[{kind:"archaic",category:"low_level_tex",macros:["catcode","newtheorem","maketitle","setlength"]}],Ge=[{kind:"publisher",category:"zzzzz",macros:["theoremstyle","makeindex","allowdisplaybreaks","frontmatter","mainmatter","appendix","numberwithin","setcounter","tableofcontents","FloatBarrier"]}],Ye=[{kind:"archaic",category:"use_newcommand_only",macros:["def","let","edef","gdef","xdef","global","long"]}],Ve=[{kind:"presentation",category:"spacing_horizontal",macros:[{name:"hspace",arity:1}]},{kind:"other",category:"other",macros:[{name:"date",arity:1}]},{kind:"accessibility",category:"colors",macros:[{name:"color",arity:1},{name:"textcolor",arity:1},{name:"mathcolor",arity:1},{name:"definecolor",arity:3}]}],Je=[{kind:"presentation",category:"nonstructural",environments:["center","minipage"]}];function ne(c){return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ie(c,a){let t=c;const f=[];for(const{from:s,to:r}of a.pairs){let n,i;a.category==="tex_fonts"?(n=`\\{ *\\\\${ne(s)}\\b *`,i=`\\${r}{`):(n=`\\\\${ne(s)}\\b *`,i=`\\${r}`);const l=new RegExp(n,"g"),p=t.match(l);p&&(f.push({action:"replace",severity:"info",kind:a.kind,category:a.category,macro:s,replacement:r,occurrences:p.length}),t=t.replace(l,i))}return{output:t,warnings:f}}function qe(c){let a=c;const t=[],f=a.match(/\(\\ref\{([^{}]+)\}\)/g);f&&(t.push({action:"rewrite",severity:"info",kind:"presentation",category:"math_refs",macro:"(\\ref{...})",replacement:"\\eqref{...}",occurrences:f.length}),a=a.replace(/\(\\ref\{([^{}]+)\}\)/g,"\\eqref{$1}")),a=a.replace(/(\\vfil)l\b/g,"$1"),a=a.replace(/(\\vfil)(\s*\\vfil\b)+\b/g,"$1");const s=a.match(/(\\vfil)\b/g);return s&&(t.push({action:"rewrite",severity:"info",kind:"presentation",category:"spacing_vertical",macro:"vfil",replacement:"\\vspace{1in}",occurrences:s.length}),a=a.replace(/(\\vfil)\b/g,"\\vspace{1in}")),a=a.replace(/\\vskip\*? *([0-9]+|-) *([a-zA-Z]+).*/g,"\\vspace{$1$2}"),a=a.replace(/(\\vspace)\*? */g,"$1"),a=a.replace(/(\\vspace) *\{([0-9]+|-) *([a-zA-Z]+).*?\}/g,"$1{$2$3}"),{output:a,warnings:t}}function Qe(c){const a=c.split("\\begin{document}");if(a.length<2)return{preamble:"",body:c,bibliography:""};const t=a[0];let f=a.slice(1).join("\\begin{document}"),s="";if(/\\begin\{thebibliography\}/.test(f)){const[r,...n]=f.split("\\begin{thebibliography}");f=r,s=n.join("\\begin{thebibliography}")}return{preamble:t,body:f,bibliography:s}}function me(c){return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tr(c,a,t){const f=me(c);if(a==="hasarg"){let s=`\\\\${f}\\b\\*?`;for(let r=0;r<t;r+=1)s+="\\{[^{}]*\\}";return new RegExp(`(${s})`,"g")}return a==="line"?new RegExp(`(\\\\${f}\\b.*)`,"g"):new RegExp(`(\\\\${f}\\b)`,"g")}function ut(c,a,t,f){const{type:s="",action:r="mark",extra:n="",save:i=!1}=t;"macros"in a&&a.macros[0];let l=c;const p=a.macros;for(const b of p){const y=typeof b=="string"?b:b.name,x=typeof b=="string"?0:b.arity,d=tr(y,s,x),_=l.match(d);!_||_.length===0||(i&&f.push({action:"save",severity:"warning",kind:a.kind,category:a.category,macro:y,occurrences:_.length,examples:_.slice(0,5),message:n||void 0}),r==="delete"?(f.push({action:"delete",severity:"info",kind:a.kind,category:a.category,macro:y,occurrences:_.length,message:n||void 0}),l=l.replace(d,"")):f.push({action:"anomaly",severity:"warning",kind:a.kind,category:a.category,macro:y,occurrences:_.length,message:n||void 0,examples:_.slice(0,5)}))}return l}function er(c,a,t){let f=c;for(const s of a.environments){const r=me(s),n=new RegExp(`(\\\\(begin|end)\\{\\s*${r}\\})`,"g"),i=f.match(n);i&&i.length>0&&(t.push({action:"delete",severity:"info",kind:a.kind,category:a.category,macro:s,occurrences:i.length}),f=f.replace(n,""))}return f}function rr(c){const a=[],t=Qe(c);let{preamble:f,body:s}=t;const{bibliography:r}=t;for(const p of Ke)f=ut(f,p,{action:"delete"},a),s=ut(s,p,{action:"delete"},a);for(const p of He)f=ut(f,p,{type:"line",action:"delete",extra:"in the preamble",save:!0},a),s=ut(s,p,{type:"line",action:"delete",extra:"in the main text",save:!0},a);for(const p of Ye)f=ut(f,p,{type:"line",action:"delete",extra:"in the preamble",save:!0},a),s=ut(s,p,{type:"line",action:"delete",extra:"in the main text",save:!0},a);for(const p of Ve)f=ut(f,p,{type:"hasarg",action:"delete"},a),s=ut(s,p,{type:"hasarg",action:"delete"},a);for(const p of Xe)f=ut(f,p,{type:"line",action:"delete"},a),s=ut(s,p,{type:"line",action:"delete"},a);for(const p of Ge)f=ut(f,p,{type:"line",action:"delete",extra:"this is a publisher choice in PreTeXt"},a),s=ut(s,p,{type:"line",action:"delete",extra:"this is a publisher choice in PreTeXt"},a);for(const p of Ze)s=ut(s,p,{action:"mark"},a);for(const p of Je)s=er(s,p,a);const n=c.includes("\\begin{document}"),i=r.length>0;let l=f;return n?l+=`\\begin{document}
2
+ `+s:l=s,i&&(l+=`\\begin{thebibliography}
3
+ `+r),{output:l,warnings:a}}function nr(c){let a=c;return a=a.replace(/\s+%.*/g,""),a=a.replace(/([^\\])%.*/g,"$1"),a=a.replace(/^%.*/,""),a}function ir(c){return c.replace(/(.*\{)([^{}]+)(\}.*)/,(a,t,f,s)=>{const r=String(f).replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"-");return`${t}${r}${s}`})}function sr(c){let a=c;return a=a.replace(/> */g,"\\gt "),a=a.replace(/< */g,"\\lt "),a=a.replace(/(\\(ref|eqref|cref|Cref|label)\{([^{}]+)\})/g,ir),a}function ar(c){let a=c;return a=a.replace(/\\begin +/g,"\\begin"),a=a.replace(/\\chapter +/g,"\\chapter"),a=a.replace(/\\section +/g,"\\section"),a=a.replace(/\\section\*/g,"\\section"),a=nr(a),a=sr(a),a=a.replace(/\\end\{document\}.*/s,""),a=a.replace(/^\s+/,""),a=a.replace(/\n{3,}/g,`
4
+
5
+ `),a}function se(c,a=0,t="{",f="}"){let s=c.trimStart();if(!s)return["",""];let r="",n="",i=a;if(i===0&&s[0]!==t)return["",s];for(i===0&&(n=t,i=1,s=s.substring(1));i>0&&s;){const l=s[0];l===t&&r!=="\\"?i+=1:l===f&&r!=="\\"&&(i-=1),n+=l,r==="\\"&&l==="\\"?r=`
6
+ `:r=l,s=s.substring(1)}return i===0?[n,s]:["",n.substring(1)]}function ge(c){const a=[];let t=ar(c).replace(/(\n *){3,}/g,`
7
+
8
+ `);const f=qe(t);t=f.output,a.push(...f.warnings);const s=ie(t,re);t=s.output,a.push(...s.warnings);const r=ie(t,re);t=r.output,a.push(...r.warnings);const n=rr(t);return t=n.output.replace(/(\n *){3,}/g,`
9
+
10
+ `),a.push(...n.warnings),{output:t,warnings:a}}function _e(c){const a="\\begin{document}",t="\\end{document}",f=c.indexOf(a);if(f===-1)return{preamble:"",body:c};const s=c.slice(0,f).trim(),r=c.slice(f+a.length),n=r.indexOf(t),i=(n===-1?r:r.slice(0,n)).trim();return{preamble:s,body:i}}function ae(c,a){const f=new RegExp(`\\\\${a}(?![a-zA-Z])`).exec(c);if(!f)return"";let s=c.slice(f.index+f[0].length).trimStart();if(s.startsWith("[")){const[n,i]=se(s,0,"[","]");n&&(s=i.trimStart())}const[r]=se(s);return r?r.slice(1,-1).trim():""}const or=/^[ \t]*(\\(?:new|renew|provide)command\*?|\\DeclareMathOperator\*?|\\newenvironment\*?)\b/;function oe(c){let a=0;for(let t=0;t<c.length;t++){if(c[t]==="\\"){t++;continue}c[t]==="{"?a++:c[t]==="}"&&a--}return a}function cr(c){const a=c.split(`
11
+ `),t=[];let f=0;for(;f<a.length;){if(!or.test(a[f])){f++;continue}let s=a[f],r=oe(a[f]);for(f++;r>0&&f<a.length;)s+=`
12
+ `+a[f],r+=oe(a[f]),f++;t.push(s.trim())}return t.join(`
13
+ `)}function lr(c){const a=/\\documentclass(?:\[[^\]]*\])?\{([^}]+)\}/.exec(c);return a?a[1].trim():"article"}function ur(c){const a=c.replace(/(^|[^\\])%[^\n]*/gm,"$1");return{documentClass:lr(a),title:ae(a,"title"),author:ae(a,"author"),macros:cr(a)}}function fr(c){if(typeof c=="string")return c;if(typeof c=="object"&&c!==null&&"value"in c){const a=c.value;if(typeof a=="string")return a;if(a!=null)return String(a)}return String(c)}function be(c){return c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ye(c){return c.replace(/\\LaTeX\b/g,"LaTeX").replace(/\\TeX\b/g,"TeX").replace(/\\thanks\{[^{}]*(?:\{[^{}]*\}[^{}]*)?\}/g,"").replace(/\\inst\{[^{}]*\}/g,"").replace(/\\email\{[^{}]*\}/g,"").replace(/\\[a-zA-Z]+\{([^{}]*)\}/g,"$1").replace(/\\\s/g," ").replace(/~/g," ").replace(/\s+/g," ").trim()}function dr(c){const a=[];if(c.macros){const t=c.macros.split(`
14
+ `).map(f=>` ${f}`).join(`
15
+ `);a.push(` <macros>
16
+ ${t}
17
+ </macros>`)}if(c.author){const t=c.author.split(/\s+\\and\s+/)[0].trim(),f=be(ye(t));f&&a.push(` <author>
18
+ <personname>${f}</personname>
19
+ </author>`)}return a.length===0?"":`<docinfo>
20
+ ${a.join(`
21
+ `)}
22
+ </docinfo>`}function hr(c,a){const t=c.replace(/^\s*<p\s*\/>\s*/g,"").replace(/^\s*<p>\s*<\/p>\s*/g,"").trim();if(!t)return"";const s=/<chapter[\s>]/.test(t)?"book":"article",r=dr(a),n=a.title?` <title>${be(ye(a.title))}</title>
23
+ `:"",i=`<${s}>
24
+ ${n}${t}
25
+ </${s}>`;return`<pretext>
26
+ ${[r,i].filter(Boolean).join(`
27
+ `)}
28
+ </pretext>`}function Ft(c){const a=c.trim();return a?Ue.formatPretext(a):""}function ve(c){const a=c.trim();if(!a)return{pretext:"",cleanedLatex:"",warnings:[]};const{preamble:t,body:f}=_e(a),s=ur(t),r=f?[`\\documentclass{${s.documentClass}}`,s.macros,"\\begin{document}",f,"\\end{document}"].filter(Boolean).join(`
29
+ `):a,{output:n,warnings:i}=ge(r);if(!n.trim())return{pretext:"",cleanedLatex:n,warnings:i};const l=f?n+`
30
+ \\end{document}`:n,p=fr(Me.latexToPretext(l)).trim();if(!p)return{pretext:"",cleanedLatex:n,warnings:i};const b=hr(p,s);return{pretext:b?Ft(b):"",cleanedLatex:n,warnings:i}}function we(c){const a=c.trim();if(!a)return{pretext:"",cleanedMarkdown:""};const t=String(We.markdownToPretext(a)).trim();return{pretext:t?Ft(t):"",cleanedMarkdown:a}}function xe(c){return c instanceof Error&&c.message.trim()?c.message.trim():"Could not convert source content to PreTeXt."}function ke(c,a){const t=Jt(c),f=a??t;try{if(f==="pretext")return{sourceFormat:f,detectedSourceFormat:t,pretextSource:Ft(c),warnings:[]};if(f==="markdown"){const{pretext:i,cleanedMarkdown:l}=we(c);return{sourceFormat:f,detectedSourceFormat:t,pretextSource:i,cleanedNativeSource:l,warnings:[]}}const{pretext:s,cleanedLatex:r,warnings:n}=ve(c);return{sourceFormat:f,detectedSourceFormat:t,pretextSource:s,cleanedNativeSource:r,warnings:n}}catch(s){return{sourceFormat:f,detectedSourceFormat:t,pretextError:xe(s),warnings:[]}}}var Ct=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pr(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}function Tt(c){throw new Error('Could not dynamically require "'+c+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jt={exports:{}};var ce;function mr(){return ce||(ce=1,(function(c,a){(function(t){c.exports=t()})(function(){return(function t(f,s,r){function n(p,b){if(!s[p]){if(!f[p]){var y=typeof Tt=="function"&&Tt;if(!b&&y)return y(p,!0);if(i)return i(p,!0);var x=new Error("Cannot find module '"+p+"'");throw x.code="MODULE_NOT_FOUND",x}var d=s[p]={exports:{}};f[p][0].call(d.exports,function(_){var u=f[p][1][_];return n(u||_)},d,d.exports,t,f,s,r)}return s[p].exports}for(var i=typeof Tt=="function"&&Tt,l=0;l<r.length;l++)n(r[l]);return n})({1:[function(t,f,s){var r=t("./utils"),n=t("./support"),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";s.encode=function(l){for(var p,b,y,x,d,_,u,m=[],h=0,v=l.length,S=v,z=r.getTypeOf(l)!=="string";h<l.length;)S=v-h,y=z?(p=l[h++],b=h<v?l[h++]:0,h<v?l[h++]:0):(p=l.charCodeAt(h++),b=h<v?l.charCodeAt(h++):0,h<v?l.charCodeAt(h++):0),x=p>>2,d=(3&p)<<4|b>>4,_=1<S?(15&b)<<2|y>>6:64,u=2<S?63&y:64,m.push(i.charAt(x)+i.charAt(d)+i.charAt(_)+i.charAt(u));return m.join("")},s.decode=function(l){var p,b,y,x,d,_,u=0,m=0,h="data:";if(l.substr(0,h.length)===h)throw new Error("Invalid base64 input, it looks like a data url.");var v,S=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===i.charAt(64)&&S--,l.charAt(l.length-2)===i.charAt(64)&&S--,S%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=n.uint8array?new Uint8Array(0|S):new Array(0|S);u<l.length;)p=i.indexOf(l.charAt(u++))<<2|(x=i.indexOf(l.charAt(u++)))>>4,b=(15&x)<<4|(d=i.indexOf(l.charAt(u++)))>>2,y=(3&d)<<6|(_=i.indexOf(l.charAt(u++))),v[m++]=p,d!==64&&(v[m++]=b),_!==64&&(v[m++]=y);return v}},{"./support":30,"./utils":32}],2:[function(t,f,s){var r=t("./external"),n=t("./stream/DataWorker"),i=t("./stream/Crc32Probe"),l=t("./stream/DataLengthProbe");function p(b,y,x,d,_){this.compressedSize=b,this.uncompressedSize=y,this.crc32=x,this.compression=d,this.compressedContent=_}p.prototype={getContentWorker:function(){var b=new n(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),y=this;return b.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),b},getCompressedWorker:function(){return new n(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},p.createWorkerFrom=function(b,y,x){return b.pipe(new i).pipe(new l("uncompressedSize")).pipe(y.compressWorker(x)).pipe(new l("compressedSize")).withStreamInfo("compression",y)},f.exports=p},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,f,s){var r=t("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},s.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,f,s){var r=t("./utils"),n=(function(){for(var i,l=[],p=0;p<256;p++){i=p;for(var b=0;b<8;b++)i=1&i?3988292384^i>>>1:i>>>1;l[p]=i}return l})();f.exports=function(i,l){return i!==void 0&&i.length?r.getTypeOf(i)!=="string"?(function(p,b,y,x){var d=n,_=x+y;p^=-1;for(var u=x;u<_;u++)p=p>>>8^d[255&(p^b[u])];return-1^p})(0|l,i,i.length,0):(function(p,b,y,x){var d=n,_=x+y;p^=-1;for(var u=x;u<_;u++)p=p>>>8^d[255&(p^b.charCodeAt(u))];return-1^p})(0|l,i,i.length,0):0}},{"./utils":32}],5:[function(t,f,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(t,f,s){var r=null;r=typeof Promise<"u"?Promise:t("lie"),f.exports={Promise:r}},{lie:37}],7:[function(t,f,s){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",n=t("pako"),i=t("./utils"),l=t("./stream/GenericWorker"),p=r?"uint8array":"array";function b(y,x){l.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=x,this.meta={}}s.magic="\b\0",i.inherits(b,l),b.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(i.transformTo(p,y.data),!1)},b.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},b.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},b.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(x){y.push({data:x,meta:y.meta})}},s.compressWorker=function(y){return new b("Deflate",y)},s.uncompressWorker=function(){return new b("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,f,s){function r(d,_){var u,m="";for(u=0;u<_;u++)m+=String.fromCharCode(255&d),d>>>=8;return m}function n(d,_,u,m,h,v){var S,z,E=d.file,P=d.compression,I=v!==p.utf8encode,L=i.transformTo("string",v(E.name)),F=i.transformTo("string",p.utf8encode(E.name)),U=E.comment,Y=i.transformTo("string",v(U)),k=i.transformTo("string",p.utf8encode(U)),B=F.length!==E.name.length,o=k.length!==U.length,$="",Q="",M="",tt=E.dir,W=E.date,q={crc32:0,compressedSize:0,uncompressedSize:0};_&&!u||(q.crc32=d.crc32,q.compressedSize=d.compressedSize,q.uncompressedSize=d.uncompressedSize);var O=0;_&&(O|=8),I||!B&&!o||(O|=2048);var T=0,J=0;tt&&(T|=16),h==="UNIX"?(J=798,T|=(function(K,st){var lt=K;return K||(lt=st?16893:33204),(65535&lt)<<16})(E.unixPermissions,tt)):(J=20,T|=(function(K){return 63&(K||0)})(E.dosPermissions)),S=W.getUTCHours(),S<<=6,S|=W.getUTCMinutes(),S<<=5,S|=W.getUTCSeconds()/2,z=W.getUTCFullYear()-1980,z<<=4,z|=W.getUTCMonth()+1,z<<=5,z|=W.getUTCDate(),B&&(Q=r(1,1)+r(b(L),4)+F,$+="up"+r(Q.length,2)+Q),o&&(M=r(1,1)+r(b(Y),4)+k,$+="uc"+r(M.length,2)+M);var X="";return X+=`
31
+ \0`,X+=r(O,2),X+=P.magic,X+=r(S,2),X+=r(z,2),X+=r(q.crc32,4),X+=r(q.compressedSize,4),X+=r(q.uncompressedSize,4),X+=r(L.length,2),X+=r($.length,2),{fileRecord:y.LOCAL_FILE_HEADER+X+L+$,dirRecord:y.CENTRAL_FILE_HEADER+r(J,2)+X+r(Y.length,2)+"\0\0\0\0"+r(T,4)+r(m,4)+L+$+Y}}var i=t("../utils"),l=t("../stream/GenericWorker"),p=t("../utf8"),b=t("../crc32"),y=t("../signature");function x(d,_,u,m){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=_,this.zipPlatform=u,this.encodeFileName=m,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}i.inherits(x,l),x.prototype.push=function(d){var _=d.meta.percent||0,u=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,l.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:u?(_+100*(u-m-1))/u:100}}))},x.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var _=this.streamFiles&&!d.file.dir;if(_){var u=n(d,_,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:u.fileRecord,meta:{percent:0}})}else this.accumulate=!0},x.prototype.closedSource=function(d){this.accumulate=!1;var _=this.streamFiles&&!d.file.dir,u=n(d,_,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(u.dirRecord),_)this.push({data:(function(m){return y.DATA_DESCRIPTOR+r(m.crc32,4)+r(m.compressedSize,4)+r(m.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},x.prototype.flush=function(){for(var d=this.bytesWritten,_=0;_<this.dirRecords.length;_++)this.push({data:this.dirRecords[_],meta:{percent:100}});var u=this.bytesWritten-d,m=(function(h,v,S,z,E){var P=i.transformTo("string",E(z));return y.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(h,2)+r(h,2)+r(v,4)+r(S,4)+r(P.length,2)+P})(this.dirRecords.length,u,d,this.zipComment,this.encodeFileName);this.push({data:m,meta:{percent:100}})},x.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},x.prototype.registerPrevious=function(d){this._sources.push(d);var _=this;return d.on("data",function(u){_.processChunk(u)}),d.on("end",function(){_.closedSource(_.previous.streamInfo),_._sources.length?_.prepareNextSource():_.end()}),d.on("error",function(u){_.error(u)}),this},x.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},x.prototype.error=function(d){var _=this._sources;if(!l.prototype.error.call(this,d))return!1;for(var u=0;u<_.length;u++)try{_[u].error(d)}catch{}return!0},x.prototype.lock=function(){l.prototype.lock.call(this);for(var d=this._sources,_=0;_<d.length;_++)d[_].lock()},f.exports=x},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,f,s){var r=t("../compressions"),n=t("./ZipFileWorker");s.generateWorker=function(i,l,p){var b=new n(l.streamFiles,p,l.platform,l.encodeFileName),y=0;try{i.forEach(function(x,d){y++;var _=(function(v,S){var z=v||S,E=r[z];if(!E)throw new Error(z+" is not a valid compression method !");return E})(d.options.compression,l.compression),u=d.options.compressionOptions||l.compressionOptions||{},m=d.dir,h=d.date;d._compressWorker(_,u).withStreamInfo("file",{name:x,dir:m,date:h,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(b)}),b.entriesCount=y}catch(x){b.error(x)}return b}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,f,s){function r(){if(!(this instanceof r))return new r;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 n=new r;for(var i in this)typeof this[i]!="function"&&(n[i]=this[i]);return n}}(r.prototype=t("./object")).loadAsync=t("./load"),r.support=t("./support"),r.defaults=t("./defaults"),r.version="3.10.1",r.loadAsync=function(n,i){return new r().loadAsync(n,i)},r.external=t("./external"),f.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,f,s){var r=t("./utils"),n=t("./external"),i=t("./utf8"),l=t("./zipEntries"),p=t("./stream/Crc32Probe"),b=t("./nodejsUtils");function y(x){return new n.Promise(function(d,_){var u=x.decompressed.getContentWorker().pipe(new p);u.on("error",function(m){_(m)}).on("end",function(){u.streamInfo.crc32!==x.decompressed.crc32?_(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}f.exports=function(x,d){var _=this;return d=r.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:i.utf8decode}),b.isNode&&b.isStream(x)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip file",x,!0,d.optimizedBinaryString,d.base64).then(function(u){var m=new l(d);return m.load(u),m}).then(function(u){var m=[n.Promise.resolve(u)],h=u.files;if(d.checkCRC32)for(var v=0;v<h.length;v++)m.push(y(h[v]));return n.Promise.all(m)}).then(function(u){for(var m=u.shift(),h=m.files,v=0;v<h.length;v++){var S=h[v],z=S.fileNameStr,E=r.resolve(S.fileNameStr);_.file(E,S.decompressed,{binary:!0,optimizedBinaryString:!0,date:S.date,dir:S.dir,comment:S.fileCommentStr.length?S.fileCommentStr:null,unixPermissions:S.unixPermissions,dosPermissions:S.dosPermissions,createFolders:d.createFolders}),S.dir||(_.file(E).unsafeOriginalName=z)}return m.zipComment.length&&(_.comment=m.zipComment),_})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,f,s){var r=t("../utils"),n=t("../stream/GenericWorker");function i(l,p){n.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(p)}r.inherits(i,n),i.prototype._bindStream=function(l){var p=this;(this._stream=l).pause(),l.on("data",function(b){p.push({data:b,meta:{percent:0}})}).on("error",function(b){p.isPaused?this.generatedError=b:p.error(b)}).on("end",function(){p.isPaused?p._upstreamEnded=!0:p.end()})},i.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},i.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},f.exports=i},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,f,s){var r=t("readable-stream").Readable;function n(i,l,p){r.call(this,l),this._helper=i;var b=this;i.on("data",function(y,x){b.push(y)||b._helper.pause(),p&&p(x)}).on("error",function(y){b.emit("error",y)}).on("end",function(){b.push(null)})}t("../utils").inherits(n,r),n.prototype._read=function(){this._helper.resume()},f.exports=n},{"../utils":32,"readable-stream":16}],14:[function(t,f,s){f.exports={isNode:typeof Buffer<"u",newBufferFrom:function(r,n){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(r,n);if(typeof r=="number")throw new Error('The "data" argument must not be a number');return new Buffer(r,n)},allocBuffer:function(r){if(Buffer.alloc)return Buffer.alloc(r);var n=new Buffer(r);return n.fill(0),n},isBuffer:function(r){return Buffer.isBuffer(r)},isStream:function(r){return r&&typeof r.on=="function"&&typeof r.pause=="function"&&typeof r.resume=="function"}}},{}],15:[function(t,f,s){function r(E,P,I){var L,F=i.getTypeOf(P),U=i.extend(I||{},b);U.date=U.date||new Date,U.compression!==null&&(U.compression=U.compression.toUpperCase()),typeof U.unixPermissions=="string"&&(U.unixPermissions=parseInt(U.unixPermissions,8)),U.unixPermissions&&16384&U.unixPermissions&&(U.dir=!0),U.dosPermissions&&16&U.dosPermissions&&(U.dir=!0),U.dir&&(E=h(E)),U.createFolders&&(L=m(E))&&v.call(this,L,!0);var Y=F==="string"&&U.binary===!1&&U.base64===!1;I&&I.binary!==void 0||(U.binary=!Y),(P instanceof y&&P.uncompressedSize===0||U.dir||!P||P.length===0)&&(U.base64=!1,U.binary=!0,P="",U.compression="STORE",F="string");var k=null;k=P instanceof y||P instanceof l?P:_.isNode&&_.isStream(P)?new u(E,P):i.prepareContent(E,P,U.binary,U.optimizedBinaryString,U.base64);var B=new x(E,k,U);this.files[E]=B}var n=t("./utf8"),i=t("./utils"),l=t("./stream/GenericWorker"),p=t("./stream/StreamHelper"),b=t("./defaults"),y=t("./compressedObject"),x=t("./zipObject"),d=t("./generate"),_=t("./nodejsUtils"),u=t("./nodejs/NodejsStreamInputAdapter"),m=function(E){E.slice(-1)==="/"&&(E=E.substring(0,E.length-1));var P=E.lastIndexOf("/");return 0<P?E.substring(0,P):""},h=function(E){return E.slice(-1)!=="/"&&(E+="/"),E},v=function(E,P){return P=P!==void 0?P:b.createFolders,E=h(E),this.files[E]||r.call(this,E,null,{dir:!0,createFolders:P}),this.files[E]};function S(E){return Object.prototype.toString.call(E)==="[object RegExp]"}var z={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(E){var P,I,L;for(P in this.files)L=this.files[P],(I=P.slice(this.root.length,P.length))&&P.slice(0,this.root.length)===this.root&&E(I,L)},filter:function(E){var P=[];return this.forEach(function(I,L){E(I,L)&&P.push(L)}),P},file:function(E,P,I){if(arguments.length!==1)return E=this.root+E,r.call(this,E,P,I),this;if(S(E)){var L=E;return this.filter(function(U,Y){return!Y.dir&&L.test(U)})}var F=this.files[this.root+E];return F&&!F.dir?F:null},folder:function(E){if(!E)return this;if(S(E))return this.filter(function(F,U){return U.dir&&E.test(F)});var P=this.root+E,I=v.call(this,P),L=this.clone();return L.root=I.name,L},remove:function(E){E=this.root+E;var P=this.files[E];if(P||(E.slice(-1)!=="/"&&(E+="/"),P=this.files[E]),P&&!P.dir)delete this.files[E];else for(var I=this.filter(function(F,U){return U.name.slice(0,E.length)===E}),L=0;L<I.length;L++)delete this.files[I[L].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 P,I={};try{if((I=i.extend(E||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=I.type.toLowerCase(),I.compression=I.compression.toUpperCase(),I.type==="binarystring"&&(I.type="string"),!I.type)throw new Error("No output type specified.");i.checkSupport(I.type),I.platform!=="darwin"&&I.platform!=="freebsd"&&I.platform!=="linux"&&I.platform!=="sunos"||(I.platform="UNIX"),I.platform==="win32"&&(I.platform="DOS");var L=I.comment||this.comment||"";P=d.generateWorker(this,I,L)}catch(F){(P=new l("error")).error(F)}return new p(P,I.type||"string",I.mimeType)},generateAsync:function(E,P){return this.generateInternalStream(E).accumulate(P)},generateNodeStream:function(E,P){return(E=E||{}).type||(E.type="nodebuffer"),this.generateInternalStream(E).toNodejsStream(P)}};f.exports=z},{"./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,f,s){f.exports=t("stream")},{stream:void 0}],17:[function(t,f,s){var r=t("./DataReader");function n(i){r.call(this,i);for(var l=0;l<this.data.length;l++)i[l]=255&i[l]}t("../utils").inherits(n,r),n.prototype.byteAt=function(i){return this.data[this.zero+i]},n.prototype.lastIndexOfSignature=function(i){for(var l=i.charCodeAt(0),p=i.charCodeAt(1),b=i.charCodeAt(2),y=i.charCodeAt(3),x=this.length-4;0<=x;--x)if(this.data[x]===l&&this.data[x+1]===p&&this.data[x+2]===b&&this.data[x+3]===y)return x-this.zero;return-1},n.prototype.readAndCheckSignature=function(i){var l=i.charCodeAt(0),p=i.charCodeAt(1),b=i.charCodeAt(2),y=i.charCodeAt(3),x=this.readData(4);return l===x[0]&&p===x[1]&&b===x[2]&&y===x[3]},n.prototype.readData=function(i){if(this.checkOffset(i),i===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},f.exports=n},{"../utils":32,"./DataReader":18}],18:[function(t,f,s){var r=t("../utils");function n(i){this.data=i,this.length=i.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(i){this.checkIndex(this.index+i)},checkIndex:function(i){if(this.length<this.zero+i||i<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+i+"). Corrupted zip ?")},setIndex:function(i){this.checkIndex(i),this.index=i},skip:function(i){this.setIndex(this.index+i)},byteAt:function(){},readInt:function(i){var l,p=0;for(this.checkOffset(i),l=this.index+i-1;l>=this.index;l--)p=(p<<8)+this.byteAt(l);return this.index+=i,p},readString:function(i){return r.transformTo("string",this.readData(i))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var i=this.readInt(4);return new Date(Date.UTC(1980+(i>>25&127),(i>>21&15)-1,i>>16&31,i>>11&31,i>>5&63,(31&i)<<1))}},f.exports=n},{"../utils":32}],19:[function(t,f,s){var r=t("./Uint8ArrayReader");function n(i){r.call(this,i)}t("../utils").inherits(n,r),n.prototype.readData=function(i){this.checkOffset(i);var l=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},f.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,f,s){var r=t("./DataReader");function n(i){r.call(this,i)}t("../utils").inherits(n,r),n.prototype.byteAt=function(i){return this.data.charCodeAt(this.zero+i)},n.prototype.lastIndexOfSignature=function(i){return this.data.lastIndexOf(i)-this.zero},n.prototype.readAndCheckSignature=function(i){return i===this.readData(4)},n.prototype.readData=function(i){this.checkOffset(i);var l=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},f.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,f,s){var r=t("./ArrayReader");function n(i){r.call(this,i)}t("../utils").inherits(n,r),n.prototype.readData=function(i){if(this.checkOffset(i),i===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},f.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,f,s){var r=t("../utils"),n=t("../support"),i=t("./ArrayReader"),l=t("./StringReader"),p=t("./NodeBufferReader"),b=t("./Uint8ArrayReader");f.exports=function(y){var x=r.getTypeOf(y);return r.checkSupport(x),x!=="string"||n.uint8array?x==="nodebuffer"?new p(y):n.uint8array?new b(r.transformTo("uint8array",y)):new i(r.transformTo("array",y)):new l(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,f,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,f,s){var r=t("./GenericWorker"),n=t("../utils");function i(l){r.call(this,"ConvertWorker to "+l),this.destType=l}n.inherits(i,r),i.prototype.processChunk=function(l){this.push({data:n.transformTo(this.destType,l.data),meta:l.meta})},f.exports=i},{"../utils":32,"./GenericWorker":28}],25:[function(t,f,s){var r=t("./GenericWorker"),n=t("../crc32");function i(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(i,r),i.prototype.processChunk=function(l){this.streamInfo.crc32=n(l.data,this.streamInfo.crc32||0),this.push(l)},f.exports=i},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,f,s){var r=t("../utils"),n=t("./GenericWorker");function i(l){n.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}r.inherits(i,n),i.prototype.processChunk=function(l){if(l){var p=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=p+l.data.length}n.prototype.processChunk.call(this,l)},f.exports=i},{"../utils":32,"./GenericWorker":28}],27:[function(t,f,s){var r=t("../utils"),n=t("./GenericWorker");function i(l){n.call(this,"DataWorker");var p=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(b){p.dataIsReady=!0,p.data=b,p.max=b&&b.length||0,p.type=r.getTypeOf(b),p.isPaused||p._tickAndRepeat()},function(b){p.error(b)})}r.inherits(i,n),i.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},i.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},i.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},i.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,p=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,p);break;case"uint8array":l=this.data.subarray(this.index,p);break;case"array":case"nodebuffer":l=this.data.slice(this.index,p)}return this.index=p,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},f.exports=i},{"../utils":32,"./GenericWorker":28}],28:[function(t,f,s){function r(n){this.name=n||"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}r.prototype={push:function(n){this.emit("data",n)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(n){this.emit("error",n)}return!0},error:function(n){return!this.isFinished&&(this.isPaused?this.generatedError=n:(this.isFinished=!0,this.emit("error",n),this.previous&&this.previous.error(n),this.cleanUp()),!0)},on:function(n,i){return this._listeners[n].push(i),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(n,i){if(this._listeners[n])for(var l=0;l<this._listeners[n].length;l++)this._listeners[n][l].call(this,i)},pipe:function(n){return n.registerPrevious(this)},registerPrevious:function(n){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=n.streamInfo,this.mergeStreamInfo(),this.previous=n;var i=this;return n.on("data",function(l){i.processChunk(l)}),n.on("end",function(){i.end()}),n.on("error",function(l){i.error(l)}),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 n=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),n=!0),this.previous&&this.previous.resume(),!n},flush:function(){},processChunk:function(n){this.push(n)},withStreamInfo:function(n,i){return this.extraStreamInfo[n]=i,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var n in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,n)&&(this.streamInfo[n]=this.extraStreamInfo[n])},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 n="Worker "+this.name;return this.previous?this.previous+" -> "+n:n}},f.exports=r},{}],29:[function(t,f,s){var r=t("../utils"),n=t("./ConvertWorker"),i=t("./GenericWorker"),l=t("../base64"),p=t("../support"),b=t("../external"),y=null;if(p.nodestream)try{y=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function x(_,u){return new b.Promise(function(m,h){var v=[],S=_._internalType,z=_._outputType,E=_._mimeType;_.on("data",function(P,I){v.push(P),u&&u(I)}).on("error",function(P){v=[],h(P)}).on("end",function(){try{var P=(function(I,L,F){switch(I){case"blob":return r.newBlob(r.transformTo("arraybuffer",L),F);case"base64":return l.encode(L);default:return r.transformTo(I,L)}})(z,(function(I,L){var F,U=0,Y=null,k=0;for(F=0;F<L.length;F++)k+=L[F].length;switch(I){case"string":return L.join("");case"array":return Array.prototype.concat.apply([],L);case"uint8array":for(Y=new Uint8Array(k),F=0;F<L.length;F++)Y.set(L[F],U),U+=L[F].length;return Y;case"nodebuffer":return Buffer.concat(L);default:throw new Error("concat : unsupported type '"+I+"'")}})(S,v),E);m(P)}catch(I){h(I)}v=[]}).resume()})}function d(_,u,m){var h=u;switch(u){case"blob":case"arraybuffer":h="uint8array";break;case"base64":h="string"}try{this._internalType=h,this._outputType=u,this._mimeType=m,r.checkSupport(h),this._worker=_.pipe(new n(h)),_.lock()}catch(v){this._worker=new i("error"),this._worker.error(v)}}d.prototype={accumulate:function(_){return x(this,_)},on:function(_,u){var m=this;return _==="data"?this._worker.on(_,function(h){u.call(m,h.data,h.meta)}):this._worker.on(_,function(){r.delay(u,arguments,m)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(_){if(r.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new y(this,{objectMode:this._outputType!=="nodebuffer"},_)}},f.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,f,s){if(s.base64=!0,s.array=!0,s.string=!0,s.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",s.nodebuffer=typeof Buffer<"u",s.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")s.blob=!1;else{var r=new ArrayBuffer(0);try{s.blob=new Blob([r],{type:"application/zip"}).size===0}catch{try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(r),s.blob=n.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!t("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(t,f,s){for(var r=t("./utils"),n=t("./support"),i=t("./nodejsUtils"),l=t("./stream/GenericWorker"),p=new Array(256),b=0;b<256;b++)p[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;p[254]=p[254]=1;function y(){l.call(this,"utf-8 decode"),this.leftOver=null}function x(){l.call(this,"utf-8 encode")}s.utf8encode=function(d){return n.nodebuffer?i.newBufferFrom(d,"utf-8"):(function(_){var u,m,h,v,S,z=_.length,E=0;for(v=0;v<z;v++)(64512&(m=_.charCodeAt(v)))==55296&&v+1<z&&(64512&(h=_.charCodeAt(v+1)))==56320&&(m=65536+(m-55296<<10)+(h-56320),v++),E+=m<128?1:m<2048?2:m<65536?3:4;for(u=n.uint8array?new Uint8Array(E):new Array(E),v=S=0;S<E;v++)(64512&(m=_.charCodeAt(v)))==55296&&v+1<z&&(64512&(h=_.charCodeAt(v+1)))==56320&&(m=65536+(m-55296<<10)+(h-56320),v++),m<128?u[S++]=m:(m<2048?u[S++]=192|m>>>6:(m<65536?u[S++]=224|m>>>12:(u[S++]=240|m>>>18,u[S++]=128|m>>>12&63),u[S++]=128|m>>>6&63),u[S++]=128|63&m);return u})(d)},s.utf8decode=function(d){return n.nodebuffer?r.transformTo("nodebuffer",d).toString("utf-8"):(function(_){var u,m,h,v,S=_.length,z=new Array(2*S);for(u=m=0;u<S;)if((h=_[u++])<128)z[m++]=h;else if(4<(v=p[h]))z[m++]=65533,u+=v-1;else{for(h&=v===2?31:v===3?15:7;1<v&&u<S;)h=h<<6|63&_[u++],v--;1<v?z[m++]=65533:h<65536?z[m++]=h:(h-=65536,z[m++]=55296|h>>10&1023,z[m++]=56320|1023&h)}return z.length!==m&&(z.subarray?z=z.subarray(0,m):z.length=m),r.applyFromCharCode(z)})(d=r.transformTo(n.uint8array?"uint8array":"array",d))},r.inherits(y,l),y.prototype.processChunk=function(d){var _=r.transformTo(n.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var u=_;(_=new Uint8Array(u.length+this.leftOver.length)).set(this.leftOver,0),_.set(u,this.leftOver.length)}else _=this.leftOver.concat(_);this.leftOver=null}var m=(function(v,S){var z;for((S=S||v.length)>v.length&&(S=v.length),z=S-1;0<=z&&(192&v[z])==128;)z--;return z<0||z===0?S:z+p[v[z]]>S?z:S})(_),h=_;m!==_.length&&(n.uint8array?(h=_.subarray(0,m),this.leftOver=_.subarray(m,_.length)):(h=_.slice(0,m),this.leftOver=_.slice(m,_.length))),this.push({data:s.utf8decode(h),meta:d.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=y,r.inherits(x,l),x.prototype.processChunk=function(d){this.push({data:s.utf8encode(d.data),meta:d.meta})},s.Utf8EncodeWorker=x},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,f,s){var r=t("./support"),n=t("./base64"),i=t("./nodejsUtils"),l=t("./external");function p(u){return u}function b(u,m){for(var h=0;h<u.length;++h)m[h]=255&u.charCodeAt(h);return m}t("setimmediate"),s.newBlob=function(u,m){s.checkSupport("blob");try{return new Blob([u],{type:m})}catch{try{var h=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return h.append(u),h.getBlob(m)}catch{throw new Error("Bug : can't construct the Blob.")}}};var y={stringifyByChunk:function(u,m,h){var v=[],S=0,z=u.length;if(z<=h)return String.fromCharCode.apply(null,u);for(;S<z;)m==="array"||m==="nodebuffer"?v.push(String.fromCharCode.apply(null,u.slice(S,Math.min(S+h,z)))):v.push(String.fromCharCode.apply(null,u.subarray(S,Math.min(S+h,z)))),S+=h;return v.join("")},stringifyByChar:function(u){for(var m="",h=0;h<u.length;h++)m+=String.fromCharCode(u[h]);return m},applyCanBeUsed:{uint8array:(function(){try{return r.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return r.nodebuffer&&String.fromCharCode.apply(null,i.allocBuffer(1)).length===1}catch{return!1}})()}};function x(u){var m=65536,h=s.getTypeOf(u),v=!0;if(h==="uint8array"?v=y.applyCanBeUsed.uint8array:h==="nodebuffer"&&(v=y.applyCanBeUsed.nodebuffer),v)for(;1<m;)try{return y.stringifyByChunk(u,h,m)}catch{m=Math.floor(m/2)}return y.stringifyByChar(u)}function d(u,m){for(var h=0;h<u.length;h++)m[h]=u[h];return m}s.applyFromCharCode=x;var _={};_.string={string:p,array:function(u){return b(u,new Array(u.length))},arraybuffer:function(u){return _.string.uint8array(u).buffer},uint8array:function(u){return b(u,new Uint8Array(u.length))},nodebuffer:function(u){return b(u,i.allocBuffer(u.length))}},_.array={string:x,array:p,arraybuffer:function(u){return new Uint8Array(u).buffer},uint8array:function(u){return new Uint8Array(u)},nodebuffer:function(u){return i.newBufferFrom(u)}},_.arraybuffer={string:function(u){return x(new Uint8Array(u))},array:function(u){return d(new Uint8Array(u),new Array(u.byteLength))},arraybuffer:p,uint8array:function(u){return new Uint8Array(u)},nodebuffer:function(u){return i.newBufferFrom(new Uint8Array(u))}},_.uint8array={string:x,array:function(u){return d(u,new Array(u.length))},arraybuffer:function(u){return u.buffer},uint8array:p,nodebuffer:function(u){return i.newBufferFrom(u)}},_.nodebuffer={string:x,array:function(u){return d(u,new Array(u.length))},arraybuffer:function(u){return _.nodebuffer.uint8array(u).buffer},uint8array:function(u){return d(u,new Uint8Array(u.length))},nodebuffer:p},s.transformTo=function(u,m){if(m=m||"",!u)return m;s.checkSupport(u);var h=s.getTypeOf(m);return _[h][u](m)},s.resolve=function(u){for(var m=u.split("/"),h=[],v=0;v<m.length;v++){var S=m[v];S==="."||S===""&&v!==0&&v!==m.length-1||(S===".."?h.pop():h.push(S))}return h.join("/")},s.getTypeOf=function(u){return typeof u=="string"?"string":Object.prototype.toString.call(u)==="[object Array]"?"array":r.nodebuffer&&i.isBuffer(u)?"nodebuffer":r.uint8array&&u instanceof Uint8Array?"uint8array":r.arraybuffer&&u instanceof ArrayBuffer?"arraybuffer":void 0},s.checkSupport=function(u){if(!r[u.toLowerCase()])throw new Error(u+" is not supported by this platform")},s.MAX_VALUE_16BITS=65535,s.MAX_VALUE_32BITS=-1,s.pretty=function(u){var m,h,v="";for(h=0;h<(u||"").length;h++)v+="\\x"+((m=u.charCodeAt(h))<16?"0":"")+m.toString(16).toUpperCase();return v},s.delay=function(u,m,h){setImmediate(function(){u.apply(h||null,m||[])})},s.inherits=function(u,m){function h(){}h.prototype=m.prototype,u.prototype=new h},s.extend=function(){var u,m,h={};for(u=0;u<arguments.length;u++)for(m in arguments[u])Object.prototype.hasOwnProperty.call(arguments[u],m)&&h[m]===void 0&&(h[m]=arguments[u][m]);return h},s.prepareContent=function(u,m,h,v,S){return l.Promise.resolve(m).then(function(z){return r.blob&&(z instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(z))!==-1)&&typeof FileReader<"u"?new l.Promise(function(E,P){var I=new FileReader;I.onload=function(L){E(L.target.result)},I.onerror=function(L){P(L.target.error)},I.readAsArrayBuffer(z)}):z}).then(function(z){var E=s.getTypeOf(z);return E?(E==="arraybuffer"?z=s.transformTo("uint8array",z):E==="string"&&(S?z=n.decode(z):h&&v!==!0&&(z=(function(P){return b(P,r.uint8array?new Uint8Array(P.length):new Array(P.length))})(z))),z):l.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(t,f,s){var r=t("./reader/readerFor"),n=t("./utils"),i=t("./signature"),l=t("./zipEntry"),p=t("./support");function b(y){this.files=[],this.loadOptions=y}b.prototype={checkSignature:function(y){if(!this.reader.readAndCheckSignature(y)){this.reader.index-=4;var x=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(x)+", expected "+n.pretty(y)+")")}},isSignature:function(y,x){var d=this.reader.index;this.reader.setIndex(y);var _=this.reader.readString(4)===x;return this.reader.setIndex(d),_},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),x=p.uint8array?"uint8array":"array",d=n.transformTo(x,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,x,d,_=this.zip64EndOfCentralSize-44;0<_;)y=this.reader.readInt(2),x=this.reader.readInt(4),d=this.reader.readData(x),this.zip64ExtensibleData[y]={id:y,length:x,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,x;for(y=0;y<this.files.length;y++)x=this.files[y],this.reader.setIndex(x.localHeaderOffset),this.checkSignature(i.LOCAL_FILE_HEADER),x.readLocalPart(this.reader),x.handleUTF8(),x.processAttributes()},readCentralDir:function(){var y;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(i.CENTRAL_FILE_HEADER);)(y=new l({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(i.CENTRAL_DIRECTORY_END);if(y<0)throw this.isSignature(0,i.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 x=y;if(this.checkSignature(i.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(y=this.reader.lastIndexOfSignature(i.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(i.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,i.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(i.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(i.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var _=x-d;if(0<_)this.isSignature(x,i.CENTRAL_FILE_HEADER)||(this.reader.zero=_);else if(_<0)throw new Error("Corrupted zip: missing "+Math.abs(_)+" bytes.")},prepareReader:function(y){this.reader=r(y)},load:function(y){this.prepareReader(y),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},f.exports=b},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,f,s){var r=t("./reader/readerFor"),n=t("./utils"),i=t("./compressedObject"),l=t("./crc32"),p=t("./utf8"),b=t("./compressions"),y=t("./support");function x(d,_){this.options=d,this.loadOptions=_}x.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(d){var _,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((_=(function(m){for(var h in b)if(Object.prototype.hasOwnProperty.call(b,h)&&b[h].magic===m)return b[h];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new i(this.compressedSize,this.uncompressedSize,this.crc32,_,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 _=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(_),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=r(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var _,u,m,h=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4<h;)_=d.readInt(2),u=d.readInt(2),m=d.readData(u),this.extraFields[_]={id:_,length:u,value:m};d.setIndex(h)},handleUTF8:function(){var d=y.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=p.utf8decode(this.fileName),this.fileCommentStr=p.utf8decode(this.fileComment);else{var _=this.findExtraFieldUnicodePath();if(_!==null)this.fileNameStr=_;else{var u=n.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(u)}var m=this.findExtraFieldUnicodeComment();if(m!==null)this.fileCommentStr=m;else{var h=n.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(h)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var _=r(d.value);return _.readInt(1)!==1||l(this.fileName)!==_.readInt(4)?null:p.utf8decode(_.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var _=r(d.value);return _.readInt(1)!==1||l(this.fileComment)!==_.readInt(4)?null:p.utf8decode(_.readData(d.length-5))}return null}},f.exports=x},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,f,s){function r(_,u,m){this.name=_,this.dir=m.dir,this.date=m.date,this.comment=m.comment,this.unixPermissions=m.unixPermissions,this.dosPermissions=m.dosPermissions,this._data=u,this._dataBinary=m.binary,this.options={compression:m.compression,compressionOptions:m.compressionOptions}}var n=t("./stream/StreamHelper"),i=t("./stream/DataWorker"),l=t("./utf8"),p=t("./compressedObject"),b=t("./stream/GenericWorker");r.prototype={internalStream:function(_){var u=null,m="string";try{if(!_)throw new Error("No output type specified.");var h=(m=_.toLowerCase())==="string"||m==="text";m!=="binarystring"&&m!=="text"||(m="string"),u=this._decompressWorker();var v=!this._dataBinary;v&&!h&&(u=u.pipe(new l.Utf8EncodeWorker)),!v&&h&&(u=u.pipe(new l.Utf8DecodeWorker))}catch(S){(u=new b("error")).error(S)}return new n(u,m,"")},async:function(_,u){return this.internalStream(_).accumulate(u)},nodeStream:function(_,u){return this.internalStream(_||"nodebuffer").toNodejsStream(u)},_compressWorker:function(_,u){if(this._data instanceof p&&this._data.compression.magic===_.magic)return this._data.getCompressedWorker();var m=this._decompressWorker();return this._dataBinary||(m=m.pipe(new l.Utf8EncodeWorker)),p.createWorkerFrom(m,_,u)},_decompressWorker:function(){return this._data instanceof p?this._data.getContentWorker():this._data instanceof b?this._data:new i(this._data)}};for(var y=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],x=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<y.length;d++)r.prototype[y[d]]=x;f.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,f,s){(function(r){var n,i,l=r.MutationObserver||r.WebKitMutationObserver;if(l){var p=0,b=new l(_),y=r.document.createTextNode("");b.observe(y,{characterData:!0}),n=function(){y.data=p=++p%2}}else if(r.setImmediate||r.MessageChannel===void 0)n="document"in r&&"onreadystatechange"in r.document.createElement("script")?function(){var u=r.document.createElement("script");u.onreadystatechange=function(){_(),u.onreadystatechange=null,u.parentNode.removeChild(u),u=null},r.document.documentElement.appendChild(u)}:function(){setTimeout(_,0)};else{var x=new r.MessageChannel;x.port1.onmessage=_,n=function(){x.port2.postMessage(0)}}var d=[];function _(){var u,m;i=!0;for(var h=d.length;h;){for(m=d,d=[],u=-1;++u<h;)m[u]();h=d.length}i=!1}f.exports=function(u){d.push(u)!==1||i||n()}}).call(this,typeof Ct<"u"?Ct:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,f,s){var r=t("immediate");function n(){}var i={},l=["REJECTED"],p=["FULFILLED"],b=["PENDING"];function y(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=b,this.queue=[],this.outcome=void 0,h!==n&&u(this,h)}function x(h,v,S){this.promise=h,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof S=="function"&&(this.onRejected=S,this.callRejected=this.otherCallRejected)}function d(h,v,S){r(function(){var z;try{z=v(S)}catch(E){return i.reject(h,E)}z===h?i.reject(h,new TypeError("Cannot resolve promise with itself")):i.resolve(h,z)})}function _(h){var v=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof v=="function")return function(){v.apply(h,arguments)}}function u(h,v){var S=!1;function z(I){S||(S=!0,i.reject(h,I))}function E(I){S||(S=!0,i.resolve(h,I))}var P=m(function(){v(E,z)});P.status==="error"&&z(P.value)}function m(h,v){var S={};try{S.value=h(v),S.status="success"}catch(z){S.status="error",S.value=z}return S}(f.exports=y).prototype.finally=function(h){if(typeof h!="function")return this;var v=this.constructor;return this.then(function(S){return v.resolve(h()).then(function(){return S})},function(S){return v.resolve(h()).then(function(){throw S})})},y.prototype.catch=function(h){return this.then(null,h)},y.prototype.then=function(h,v){if(typeof h!="function"&&this.state===p||typeof v!="function"&&this.state===l)return this;var S=new this.constructor(n);return this.state!==b?d(S,this.state===p?h:v,this.outcome):this.queue.push(new x(S,h,v)),S},x.prototype.callFulfilled=function(h){i.resolve(this.promise,h)},x.prototype.otherCallFulfilled=function(h){d(this.promise,this.onFulfilled,h)},x.prototype.callRejected=function(h){i.reject(this.promise,h)},x.prototype.otherCallRejected=function(h){d(this.promise,this.onRejected,h)},i.resolve=function(h,v){var S=m(_,v);if(S.status==="error")return i.reject(h,S.value);var z=S.value;if(z)u(h,z);else{h.state=p,h.outcome=v;for(var E=-1,P=h.queue.length;++E<P;)h.queue[E].callFulfilled(v)}return h},i.reject=function(h,v){h.state=l,h.outcome=v;for(var S=-1,z=h.queue.length;++S<z;)h.queue[S].callRejected(v);return h},y.resolve=function(h){return h instanceof this?h:i.resolve(new this(n),h)},y.reject=function(h){var v=new this(n);return i.reject(v,h)},y.all=function(h){var v=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=h.length,z=!1;if(!S)return this.resolve([]);for(var E=new Array(S),P=0,I=-1,L=new this(n);++I<S;)F(h[I],I);return L;function F(U,Y){v.resolve(U).then(function(k){E[Y]=k,++P!==S||z||(z=!0,i.resolve(L,E))},function(k){z||(z=!0,i.reject(L,k))})}},y.race=function(h){var v=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=h.length,z=!1;if(!S)return this.resolve([]);for(var E=-1,P=new this(n);++E<S;)I=h[E],v.resolve(I).then(function(L){z||(z=!0,i.resolve(P,L))},function(L){z||(z=!0,i.reject(P,L))});var I;return P}},{immediate:36}],38:[function(t,f,s){var r={};(0,t("./lib/utils/common").assign)(r,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),f.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,f,s){var r=t("./zlib/deflate"),n=t("./utils/common"),i=t("./utils/strings"),l=t("./zlib/messages"),p=t("./zlib/zstream"),b=Object.prototype.toString,y=0,x=-1,d=0,_=8;function u(h){if(!(this instanceof u))return new u(h);this.options=n.assign({level:x,method:_,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},h||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new p,this.strm.avail_out=0;var S=r.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(S!==y)throw new Error(l[S]);if(v.header&&r.deflateSetHeader(this.strm,v.header),v.dictionary){var z;if(z=typeof v.dictionary=="string"?i.string2buf(v.dictionary):b.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(S=r.deflateSetDictionary(this.strm,z))!==y)throw new Error(l[S]);this._dict_set=!0}}function m(h,v){var S=new u(v);if(S.push(h,!0),S.err)throw S.msg||l[S.err];return S.result}u.prototype.push=function(h,v){var S,z,E=this.strm,P=this.options.chunkSize;if(this.ended)return!1;z=v===~~v?v:v===!0?4:0,typeof h=="string"?E.input=i.string2buf(h):b.call(h)==="[object ArrayBuffer]"?E.input=new Uint8Array(h):E.input=h,E.next_in=0,E.avail_in=E.input.length;do{if(E.avail_out===0&&(E.output=new n.Buf8(P),E.next_out=0,E.avail_out=P),(S=r.deflate(E,z))!==1&&S!==y)return this.onEnd(S),!(this.ended=!0);E.avail_out!==0&&(E.avail_in!==0||z!==4&&z!==2)||(this.options.to==="string"?this.onData(i.buf2binstring(n.shrinkBuf(E.output,E.next_out))):this.onData(n.shrinkBuf(E.output,E.next_out)))}while((0<E.avail_in||E.avail_out===0)&&S!==1);return z===4?(S=r.deflateEnd(this.strm),this.onEnd(S),this.ended=!0,S===y):z!==2||(this.onEnd(y),!(E.avail_out=0))},u.prototype.onData=function(h){this.chunks.push(h)},u.prototype.onEnd=function(h){h===y&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},s.Deflate=u,s.deflate=m,s.deflateRaw=function(h,v){return(v=v||{}).raw=!0,m(h,v)},s.gzip=function(h,v){return(v=v||{}).gzip=!0,m(h,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,f,s){var r=t("./zlib/inflate"),n=t("./utils/common"),i=t("./utils/strings"),l=t("./zlib/constants"),p=t("./zlib/messages"),b=t("./zlib/zstream"),y=t("./zlib/gzheader"),x=Object.prototype.toString;function d(u){if(!(this instanceof d))return new d(u);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},u||{});var m=this.options;m.raw&&0<=m.windowBits&&m.windowBits<16&&(m.windowBits=-m.windowBits,m.windowBits===0&&(m.windowBits=-15)),!(0<=m.windowBits&&m.windowBits<16)||u&&u.windowBits||(m.windowBits+=32),15<m.windowBits&&m.windowBits<48&&(15&m.windowBits)==0&&(m.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b,this.strm.avail_out=0;var h=r.inflateInit2(this.strm,m.windowBits);if(h!==l.Z_OK)throw new Error(p[h]);this.header=new y,r.inflateGetHeader(this.strm,this.header)}function _(u,m){var h=new d(m);if(h.push(u,!0),h.err)throw h.msg||p[h.err];return h.result}d.prototype.push=function(u,m){var h,v,S,z,E,P,I=this.strm,L=this.options.chunkSize,F=this.options.dictionary,U=!1;if(this.ended)return!1;v=m===~~m?m:m===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof u=="string"?I.input=i.binstring2buf(u):x.call(u)==="[object ArrayBuffer]"?I.input=new Uint8Array(u):I.input=u,I.next_in=0,I.avail_in=I.input.length;do{if(I.avail_out===0&&(I.output=new n.Buf8(L),I.next_out=0,I.avail_out=L),(h=r.inflate(I,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&F&&(P=typeof F=="string"?i.string2buf(F):x.call(F)==="[object ArrayBuffer]"?new Uint8Array(F):F,h=r.inflateSetDictionary(this.strm,P)),h===l.Z_BUF_ERROR&&U===!0&&(h=l.Z_OK,U=!1),h!==l.Z_STREAM_END&&h!==l.Z_OK)return this.onEnd(h),!(this.ended=!0);I.next_out&&(I.avail_out!==0&&h!==l.Z_STREAM_END&&(I.avail_in!==0||v!==l.Z_FINISH&&v!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(S=i.utf8border(I.output,I.next_out),z=I.next_out-S,E=i.buf2string(I.output,S),I.next_out=z,I.avail_out=L-z,z&&n.arraySet(I.output,I.output,S,z,0),this.onData(E)):this.onData(n.shrinkBuf(I.output,I.next_out)))),I.avail_in===0&&I.avail_out===0&&(U=!0)}while((0<I.avail_in||I.avail_out===0)&&h!==l.Z_STREAM_END);return h===l.Z_STREAM_END&&(v=l.Z_FINISH),v===l.Z_FINISH?(h=r.inflateEnd(this.strm),this.onEnd(h),this.ended=!0,h===l.Z_OK):v!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(I.avail_out=0))},d.prototype.onData=function(u){this.chunks.push(u)},d.prototype.onEnd=function(u){u===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg},s.Inflate=d,s.inflate=_,s.inflateRaw=function(u,m){return(m=m||{}).raw=!0,_(u,m)},s.ungzip=_},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,f,s){var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";s.assign=function(l){for(var p=Array.prototype.slice.call(arguments,1);p.length;){var b=p.shift();if(b){if(typeof b!="object")throw new TypeError(b+"must be non-object");for(var y in b)b.hasOwnProperty(y)&&(l[y]=b[y])}}return l},s.shrinkBuf=function(l,p){return l.length===p?l:l.subarray?l.subarray(0,p):(l.length=p,l)};var n={arraySet:function(l,p,b,y,x){if(p.subarray&&l.subarray)l.set(p.subarray(b,b+y),x);else for(var d=0;d<y;d++)l[x+d]=p[b+d]},flattenChunks:function(l){var p,b,y,x,d,_;for(p=y=0,b=l.length;p<b;p++)y+=l[p].length;for(_=new Uint8Array(y),p=x=0,b=l.length;p<b;p++)d=l[p],_.set(d,x),x+=d.length;return _}},i={arraySet:function(l,p,b,y,x){for(var d=0;d<y;d++)l[x+d]=p[b+d]},flattenChunks:function(l){return[].concat.apply([],l)}};s.setTyped=function(l){l?(s.Buf8=Uint8Array,s.Buf16=Uint16Array,s.Buf32=Int32Array,s.assign(s,n)):(s.Buf8=Array,s.Buf16=Array,s.Buf32=Array,s.assign(s,i))},s.setTyped(r)},{}],42:[function(t,f,s){var r=t("./common"),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{i=!1}for(var l=new r.Buf8(256),p=0;p<256;p++)l[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;function b(y,x){if(x<65537&&(y.subarray&&i||!y.subarray&&n))return String.fromCharCode.apply(null,r.shrinkBuf(y,x));for(var d="",_=0;_<x;_++)d+=String.fromCharCode(y[_]);return d}l[254]=l[254]=1,s.string2buf=function(y){var x,d,_,u,m,h=y.length,v=0;for(u=0;u<h;u++)(64512&(d=y.charCodeAt(u)))==55296&&u+1<h&&(64512&(_=y.charCodeAt(u+1)))==56320&&(d=65536+(d-55296<<10)+(_-56320),u++),v+=d<128?1:d<2048?2:d<65536?3:4;for(x=new r.Buf8(v),u=m=0;m<v;u++)(64512&(d=y.charCodeAt(u)))==55296&&u+1<h&&(64512&(_=y.charCodeAt(u+1)))==56320&&(d=65536+(d-55296<<10)+(_-56320),u++),d<128?x[m++]=d:(d<2048?x[m++]=192|d>>>6:(d<65536?x[m++]=224|d>>>12:(x[m++]=240|d>>>18,x[m++]=128|d>>>12&63),x[m++]=128|d>>>6&63),x[m++]=128|63&d);return x},s.buf2binstring=function(y){return b(y,y.length)},s.binstring2buf=function(y){for(var x=new r.Buf8(y.length),d=0,_=x.length;d<_;d++)x[d]=y.charCodeAt(d);return x},s.buf2string=function(y,x){var d,_,u,m,h=x||y.length,v=new Array(2*h);for(d=_=0;d<h;)if((u=y[d++])<128)v[_++]=u;else if(4<(m=l[u]))v[_++]=65533,d+=m-1;else{for(u&=m===2?31:m===3?15:7;1<m&&d<h;)u=u<<6|63&y[d++],m--;1<m?v[_++]=65533:u<65536?v[_++]=u:(u-=65536,v[_++]=55296|u>>10&1023,v[_++]=56320|1023&u)}return b(v,_)},s.utf8border=function(y,x){var d;for((x=x||y.length)>y.length&&(x=y.length),d=x-1;0<=d&&(192&y[d])==128;)d--;return d<0||d===0?x:d+l[y[d]]>x?d:x}},{"./common":41}],43:[function(t,f,s){f.exports=function(r,n,i,l){for(var p=65535&r|0,b=r>>>16&65535|0,y=0;i!==0;){for(i-=y=2e3<i?2e3:i;b=b+(p=p+n[l++]|0)|0,--y;);p%=65521,b%=65521}return p|b<<16|0}},{}],44:[function(t,f,s){f.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,f,s){var r=(function(){for(var n,i=[],l=0;l<256;l++){n=l;for(var p=0;p<8;p++)n=1&n?3988292384^n>>>1:n>>>1;i[l]=n}return i})();f.exports=function(n,i,l,p){var b=r,y=p+l;n^=-1;for(var x=p;x<y;x++)n=n>>>8^b[255&(n^i[x])];return-1^n}},{}],46:[function(t,f,s){var r,n=t("../utils/common"),i=t("./trees"),l=t("./adler32"),p=t("./crc32"),b=t("./messages"),y=0,x=4,d=0,_=-2,u=-1,m=4,h=2,v=8,S=9,z=286,E=30,P=19,I=2*z+1,L=15,F=3,U=258,Y=U+F+1,k=42,B=113,o=1,$=2,Q=3,M=4;function tt(e,D){return e.msg=b[D],D}function W(e){return(e<<1)-(4<e?9:0)}function q(e){for(var D=e.length;0<=--D;)e[D]=0}function O(e){var D=e.state,R=D.pending;R>e.avail_out&&(R=e.avail_out),R!==0&&(n.arraySet(e.output,D.pending_buf,D.pending_out,R,e.next_out),e.next_out+=R,D.pending_out+=R,e.total_out+=R,e.avail_out-=R,D.pending-=R,D.pending===0&&(D.pending_out=0))}function T(e,D){i._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,D),e.block_start=e.strstart,O(e.strm)}function J(e,D){e.pending_buf[e.pending++]=D}function X(e,D){e.pending_buf[e.pending++]=D>>>8&255,e.pending_buf[e.pending++]=255&D}function K(e,D){var R,w,g=e.max_chain_length,A=e.strstart,j=e.prev_length,N=e.nice_match,C=e.strstart>e.w_size-Y?e.strstart-(e.w_size-Y):0,Z=e.window,G=e.w_mask,H=e.prev,V=e.strstart+U,it=Z[A+j-1],rt=Z[A+j];e.prev_length>=e.good_match&&(g>>=2),N>e.lookahead&&(N=e.lookahead);do if(Z[(R=D)+j]===rt&&Z[R+j-1]===it&&Z[R]===Z[A]&&Z[++R]===Z[A+1]){A+=2,R++;do;while(Z[++A]===Z[++R]&&Z[++A]===Z[++R]&&Z[++A]===Z[++R]&&Z[++A]===Z[++R]&&Z[++A]===Z[++R]&&Z[++A]===Z[++R]&&Z[++A]===Z[++R]&&Z[++A]===Z[++R]&&A<V);if(w=U-(V-A),A=V-U,j<w){if(e.match_start=D,N<=(j=w))break;it=Z[A+j-1],rt=Z[A+j]}}while((D=H[D&G])>C&&--g!=0);return j<=e.lookahead?j:e.lookahead}function st(e){var D,R,w,g,A,j,N,C,Z,G,H=e.w_size;do{if(g=e.window_size-e.lookahead-e.strstart,e.strstart>=H+(H-Y)){for(n.arraySet(e.window,e.window,H,H,0),e.match_start-=H,e.strstart-=H,e.block_start-=H,D=R=e.hash_size;w=e.head[--D],e.head[D]=H<=w?w-H:0,--R;);for(D=R=H;w=e.prev[--D],e.prev[D]=H<=w?w-H:0,--R;);g+=H}if(e.strm.avail_in===0)break;if(j=e.strm,N=e.window,C=e.strstart+e.lookahead,Z=g,G=void 0,G=j.avail_in,Z<G&&(G=Z),R=G===0?0:(j.avail_in-=G,n.arraySet(N,j.input,j.next_in,G,C),j.state.wrap===1?j.adler=l(j.adler,N,G,C):j.state.wrap===2&&(j.adler=p(j.adler,N,G,C)),j.next_in+=G,j.total_in+=G,G),e.lookahead+=R,e.lookahead+e.insert>=F)for(A=e.strstart-e.insert,e.ins_h=e.window[A],e.ins_h=(e.ins_h<<e.hash_shift^e.window[A+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[A+F-1])&e.hash_mask,e.prev[A&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=A,A++,e.insert--,!(e.lookahead+e.insert<F)););}while(e.lookahead<Y&&e.strm.avail_in!==0)}function lt(e,D){for(var R,w;;){if(e.lookahead<Y){if(st(e),e.lookahead<Y&&D===y)return o;if(e.lookahead===0)break}if(R=0,e.lookahead>=F&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,R=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),R!==0&&e.strstart-R<=e.w_size-Y&&(e.match_length=K(e,R)),e.match_length>=F)if(w=i._tr_tally(e,e.strstart-e.match_start,e.match_length-F),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=F){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,R=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,--e.match_length!=0;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else w=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(w&&(T(e,!1),e.strm.avail_out===0))return o}return e.insert=e.strstart<F-1?e.strstart:F-1,D===x?(T(e,!0),e.strm.avail_out===0?Q:M):e.last_lit&&(T(e,!1),e.strm.avail_out===0)?o:$}function et(e,D){for(var R,w,g;;){if(e.lookahead<Y){if(st(e),e.lookahead<Y&&D===y)return o;if(e.lookahead===0)break}if(R=0,e.lookahead>=F&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,R=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=F-1,R!==0&&e.prev_length<e.max_lazy_match&&e.strstart-R<=e.w_size-Y&&(e.match_length=K(e,R),e.match_length<=5&&(e.strategy===1||e.match_length===F&&4096<e.strstart-e.match_start)&&(e.match_length=F-1)),e.prev_length>=F&&e.match_length<=e.prev_length){for(g=e.strstart+e.lookahead-F,w=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-F),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=g&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,R=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),--e.prev_length!=0;);if(e.match_available=0,e.match_length=F-1,e.strstart++,w&&(T(e,!1),e.strm.avail_out===0))return o}else if(e.match_available){if((w=i._tr_tally(e,0,e.window[e.strstart-1]))&&T(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return o}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(w=i._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<F-1?e.strstart:F-1,D===x?(T(e,!0),e.strm.avail_out===0?Q:M):e.last_lit&&(T(e,!1),e.strm.avail_out===0)?o:$}function nt(e,D,R,w,g){this.good_length=e,this.max_lazy=D,this.nice_length=R,this.max_chain=w,this.func=g}function ct(){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=v,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 n.Buf16(2*I),this.dyn_dtree=new n.Buf16(2*(2*E+1)),this.bl_tree=new n.Buf16(2*(2*P+1)),q(this.dyn_ltree),q(this.dyn_dtree),q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(L+1),this.heap=new n.Buf16(2*z+1),q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*z+1),q(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 at(e){var D;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=h,(D=e.state).pending=0,D.pending_out=0,D.wrap<0&&(D.wrap=-D.wrap),D.status=D.wrap?k:B,e.adler=D.wrap===2?0:1,D.last_flush=y,i._tr_init(D),d):tt(e,_)}function ht(e){var D=at(e);return D===d&&(function(R){R.window_size=2*R.w_size,q(R.head),R.max_lazy_match=r[R.level].max_lazy,R.good_match=r[R.level].good_length,R.nice_match=r[R.level].nice_length,R.max_chain_length=r[R.level].max_chain,R.strstart=0,R.block_start=0,R.lookahead=0,R.insert=0,R.match_length=R.prev_length=F-1,R.match_available=0,R.ins_h=0})(e.state),D}function dt(e,D,R,w,g,A){if(!e)return _;var j=1;if(D===u&&(D=6),w<0?(j=0,w=-w):15<w&&(j=2,w-=16),g<1||S<g||R!==v||w<8||15<w||D<0||9<D||A<0||m<A)return tt(e,_);w===8&&(w=9);var N=new ct;return(e.state=N).strm=e,N.wrap=j,N.gzhead=null,N.w_bits=w,N.w_size=1<<N.w_bits,N.w_mask=N.w_size-1,N.hash_bits=g+7,N.hash_size=1<<N.hash_bits,N.hash_mask=N.hash_size-1,N.hash_shift=~~((N.hash_bits+F-1)/F),N.window=new n.Buf8(2*N.w_size),N.head=new n.Buf16(N.hash_size),N.prev=new n.Buf16(N.w_size),N.lit_bufsize=1<<g+6,N.pending_buf_size=4*N.lit_bufsize,N.pending_buf=new n.Buf8(N.pending_buf_size),N.d_buf=1*N.lit_bufsize,N.l_buf=3*N.lit_bufsize,N.level=D,N.strategy=A,N.method=R,ht(e)}r=[new nt(0,0,0,0,function(e,D){var R=65535;for(R>e.pending_buf_size-5&&(R=e.pending_buf_size-5);;){if(e.lookahead<=1){if(st(e),e.lookahead===0&&D===y)return o;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var w=e.block_start+R;if((e.strstart===0||e.strstart>=w)&&(e.lookahead=e.strstart-w,e.strstart=w,T(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Y&&(T(e,!1),e.strm.avail_out===0))return o}return e.insert=0,D===x?(T(e,!0),e.strm.avail_out===0?Q:M):(e.strstart>e.block_start&&(T(e,!1),e.strm.avail_out),o)}),new nt(4,4,8,4,lt),new nt(4,5,16,8,lt),new nt(4,6,32,32,lt),new nt(4,4,16,16,et),new nt(8,16,32,32,et),new nt(8,16,128,128,et),new nt(8,32,128,256,et),new nt(32,128,258,1024,et),new nt(32,258,258,4096,et)],s.deflateInit=function(e,D){return dt(e,D,v,15,8,0)},s.deflateInit2=dt,s.deflateReset=ht,s.deflateResetKeep=at,s.deflateSetHeader=function(e,D){return e&&e.state?e.state.wrap!==2?_:(e.state.gzhead=D,d):_},s.deflate=function(e,D){var R,w,g,A;if(!e||!e.state||5<D||D<0)return e?tt(e,_):_;if(w=e.state,!e.output||!e.input&&e.avail_in!==0||w.status===666&&D!==x)return tt(e,e.avail_out===0?-5:_);if(w.strm=e,R=w.last_flush,w.last_flush=D,w.status===k)if(w.wrap===2)e.adler=0,J(w,31),J(w,139),J(w,8),w.gzhead?(J(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)),J(w,255&w.gzhead.time),J(w,w.gzhead.time>>8&255),J(w,w.gzhead.time>>16&255),J(w,w.gzhead.time>>24&255),J(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),J(w,255&w.gzhead.os),w.gzhead.extra&&w.gzhead.extra.length&&(J(w,255&w.gzhead.extra.length),J(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(e.adler=p(e.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=69):(J(w,0),J(w,0),J(w,0),J(w,0),J(w,0),J(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),J(w,3),w.status=B);else{var j=v+(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=B,X(w,j),w.strstart!==0&&(X(w,e.adler>>>16),X(w,65535&e.adler)),e.adler=1}if(w.status===69)if(w.gzhead.extra){for(g=w.pending;w.gzindex<(65535&w.gzhead.extra.length)&&(w.pending!==w.pending_buf_size||(w.gzhead.hcrc&&w.pending>g&&(e.adler=p(e.adler,w.pending_buf,w.pending-g,g)),O(e),g=w.pending,w.pending!==w.pending_buf_size));)J(w,255&w.gzhead.extra[w.gzindex]),w.gzindex++;w.gzhead.hcrc&&w.pending>g&&(e.adler=p(e.adler,w.pending_buf,w.pending-g,g)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=73)}else w.status=73;if(w.status===73)if(w.gzhead.name){g=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>g&&(e.adler=p(e.adler,w.pending_buf,w.pending-g,g)),O(e),g=w.pending,w.pending===w.pending_buf_size)){A=1;break}A=w.gzindex<w.gzhead.name.length?255&w.gzhead.name.charCodeAt(w.gzindex++):0,J(w,A)}while(A!==0);w.gzhead.hcrc&&w.pending>g&&(e.adler=p(e.adler,w.pending_buf,w.pending-g,g)),A===0&&(w.gzindex=0,w.status=91)}else w.status=91;if(w.status===91)if(w.gzhead.comment){g=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>g&&(e.adler=p(e.adler,w.pending_buf,w.pending-g,g)),O(e),g=w.pending,w.pending===w.pending_buf_size)){A=1;break}A=w.gzindex<w.gzhead.comment.length?255&w.gzhead.comment.charCodeAt(w.gzindex++):0,J(w,A)}while(A!==0);w.gzhead.hcrc&&w.pending>g&&(e.adler=p(e.adler,w.pending_buf,w.pending-g,g)),A===0&&(w.status=103)}else w.status=103;if(w.status===103&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&O(e),w.pending+2<=w.pending_buf_size&&(J(w,255&e.adler),J(w,e.adler>>8&255),e.adler=0,w.status=B)):w.status=B),w.pending!==0){if(O(e),e.avail_out===0)return w.last_flush=-1,d}else if(e.avail_in===0&&W(D)<=W(R)&&D!==x)return tt(e,-5);if(w.status===666&&e.avail_in!==0)return tt(e,-5);if(e.avail_in!==0||w.lookahead!==0||D!==y&&w.status!==666){var N=w.strategy===2?(function(C,Z){for(var G;;){if(C.lookahead===0&&(st(C),C.lookahead===0)){if(Z===y)return o;break}if(C.match_length=0,G=i._tr_tally(C,0,C.window[C.strstart]),C.lookahead--,C.strstart++,G&&(T(C,!1),C.strm.avail_out===0))return o}return C.insert=0,Z===x?(T(C,!0),C.strm.avail_out===0?Q:M):C.last_lit&&(T(C,!1),C.strm.avail_out===0)?o:$})(w,D):w.strategy===3?(function(C,Z){for(var G,H,V,it,rt=C.window;;){if(C.lookahead<=U){if(st(C),C.lookahead<=U&&Z===y)return o;if(C.lookahead===0)break}if(C.match_length=0,C.lookahead>=F&&0<C.strstart&&(H=rt[V=C.strstart-1])===rt[++V]&&H===rt[++V]&&H===rt[++V]){it=C.strstart+U;do;while(H===rt[++V]&&H===rt[++V]&&H===rt[++V]&&H===rt[++V]&&H===rt[++V]&&H===rt[++V]&&H===rt[++V]&&H===rt[++V]&&V<it);C.match_length=U-(it-V),C.match_length>C.lookahead&&(C.match_length=C.lookahead)}if(C.match_length>=F?(G=i._tr_tally(C,1,C.match_length-F),C.lookahead-=C.match_length,C.strstart+=C.match_length,C.match_length=0):(G=i._tr_tally(C,0,C.window[C.strstart]),C.lookahead--,C.strstart++),G&&(T(C,!1),C.strm.avail_out===0))return o}return C.insert=0,Z===x?(T(C,!0),C.strm.avail_out===0?Q:M):C.last_lit&&(T(C,!1),C.strm.avail_out===0)?o:$})(w,D):r[w.level].func(w,D);if(N!==Q&&N!==M||(w.status=666),N===o||N===Q)return e.avail_out===0&&(w.last_flush=-1),d;if(N===$&&(D===1?i._tr_align(w):D!==5&&(i._tr_stored_block(w,0,0,!1),D===3&&(q(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),O(e),e.avail_out===0))return w.last_flush=-1,d}return D!==x?d:w.wrap<=0?1:(w.wrap===2?(J(w,255&e.adler),J(w,e.adler>>8&255),J(w,e.adler>>16&255),J(w,e.adler>>24&255),J(w,255&e.total_in),J(w,e.total_in>>8&255),J(w,e.total_in>>16&255),J(w,e.total_in>>24&255)):(X(w,e.adler>>>16),X(w,65535&e.adler)),O(e),0<w.wrap&&(w.wrap=-w.wrap),w.pending!==0?d:1)},s.deflateEnd=function(e){var D;return e&&e.state?(D=e.state.status)!==k&&D!==69&&D!==73&&D!==91&&D!==103&&D!==B&&D!==666?tt(e,_):(e.state=null,D===B?tt(e,-3):d):_},s.deflateSetDictionary=function(e,D){var R,w,g,A,j,N,C,Z,G=D.length;if(!e||!e.state||(A=(R=e.state).wrap)===2||A===1&&R.status!==k||R.lookahead)return _;for(A===1&&(e.adler=l(e.adler,D,G,0)),R.wrap=0,G>=R.w_size&&(A===0&&(q(R.head),R.strstart=0,R.block_start=0,R.insert=0),Z=new n.Buf8(R.w_size),n.arraySet(Z,D,G-R.w_size,R.w_size,0),D=Z,G=R.w_size),j=e.avail_in,N=e.next_in,C=e.input,e.avail_in=G,e.next_in=0,e.input=D,st(R);R.lookahead>=F;){for(w=R.strstart,g=R.lookahead-(F-1);R.ins_h=(R.ins_h<<R.hash_shift^R.window[w+F-1])&R.hash_mask,R.prev[w&R.w_mask]=R.head[R.ins_h],R.head[R.ins_h]=w,w++,--g;);R.strstart=w,R.lookahead=F-1,st(R)}return R.strstart+=R.lookahead,R.block_start=R.strstart,R.insert=R.lookahead,R.lookahead=0,R.match_length=R.prev_length=F-1,R.match_available=0,e.next_in=N,e.input=C,e.avail_in=j,R.wrap=A,d},s.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,f,s){f.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,f,s){f.exports=function(r,n){var i,l,p,b,y,x,d,_,u,m,h,v,S,z,E,P,I,L,F,U,Y,k,B,o,$;i=r.state,l=r.next_in,o=r.input,p=l+(r.avail_in-5),b=r.next_out,$=r.output,y=b-(n-r.avail_out),x=b+(r.avail_out-257),d=i.dmax,_=i.wsize,u=i.whave,m=i.wnext,h=i.window,v=i.hold,S=i.bits,z=i.lencode,E=i.distcode,P=(1<<i.lenbits)-1,I=(1<<i.distbits)-1;t:do{S<15&&(v+=o[l++]<<S,S+=8,v+=o[l++]<<S,S+=8),L=z[v&P];e:for(;;){if(v>>>=F=L>>>24,S-=F,(F=L>>>16&255)===0)$[b++]=65535&L;else{if(!(16&F)){if((64&F)==0){L=z[(65535&L)+(v&(1<<F)-1)];continue e}if(32&F){i.mode=12;break t}r.msg="invalid literal/length code",i.mode=30;break t}U=65535&L,(F&=15)&&(S<F&&(v+=o[l++]<<S,S+=8),U+=v&(1<<F)-1,v>>>=F,S-=F),S<15&&(v+=o[l++]<<S,S+=8,v+=o[l++]<<S,S+=8),L=E[v&I];r:for(;;){if(v>>>=F=L>>>24,S-=F,!(16&(F=L>>>16&255))){if((64&F)==0){L=E[(65535&L)+(v&(1<<F)-1)];continue r}r.msg="invalid distance code",i.mode=30;break t}if(Y=65535&L,S<(F&=15)&&(v+=o[l++]<<S,(S+=8)<F&&(v+=o[l++]<<S,S+=8)),d<(Y+=v&(1<<F)-1)){r.msg="invalid distance too far back",i.mode=30;break t}if(v>>>=F,S-=F,(F=b-y)<Y){if(u<(F=Y-F)&&i.sane){r.msg="invalid distance too far back",i.mode=30;break t}if(B=h,(k=0)===m){if(k+=_-F,F<U){for(U-=F;$[b++]=h[k++],--F;);k=b-Y,B=$}}else if(m<F){if(k+=_+m-F,(F-=m)<U){for(U-=F;$[b++]=h[k++],--F;);if(k=0,m<U){for(U-=F=m;$[b++]=h[k++],--F;);k=b-Y,B=$}}}else if(k+=m-F,F<U){for(U-=F;$[b++]=h[k++],--F;);k=b-Y,B=$}for(;2<U;)$[b++]=B[k++],$[b++]=B[k++],$[b++]=B[k++],U-=3;U&&($[b++]=B[k++],1<U&&($[b++]=B[k++]))}else{for(k=b-Y;$[b++]=$[k++],$[b++]=$[k++],$[b++]=$[k++],2<(U-=3););U&&($[b++]=$[k++],1<U&&($[b++]=$[k++]))}break}}break}}while(l<p&&b<x);l-=U=S>>3,v&=(1<<(S-=U<<3))-1,r.next_in=l,r.next_out=b,r.avail_in=l<p?p-l+5:5-(l-p),r.avail_out=b<x?x-b+257:257-(b-x),i.hold=v,i.bits=S}},{}],49:[function(t,f,s){var r=t("../utils/common"),n=t("./adler32"),i=t("./crc32"),l=t("./inffast"),p=t("./inftrees"),b=1,y=2,x=0,d=-2,_=1,u=852,m=592;function h(k){return(k>>>24&255)+(k>>>8&65280)+((65280&k)<<8)+((255&k)<<24)}function v(){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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function S(k){var B;return k&&k.state?(B=k.state,k.total_in=k.total_out=B.total=0,k.msg="",B.wrap&&(k.adler=1&B.wrap),B.mode=_,B.last=0,B.havedict=0,B.dmax=32768,B.head=null,B.hold=0,B.bits=0,B.lencode=B.lendyn=new r.Buf32(u),B.distcode=B.distdyn=new r.Buf32(m),B.sane=1,B.back=-1,x):d}function z(k){var B;return k&&k.state?((B=k.state).wsize=0,B.whave=0,B.wnext=0,S(k)):d}function E(k,B){var o,$;return k&&k.state?($=k.state,B<0?(o=0,B=-B):(o=1+(B>>4),B<48&&(B&=15)),B&&(B<8||15<B)?d:($.window!==null&&$.wbits!==B&&($.window=null),$.wrap=o,$.wbits=B,z(k))):d}function P(k,B){var o,$;return k?($=new v,(k.state=$).window=null,(o=E(k,B))!==x&&(k.state=null),o):d}var I,L,F=!0;function U(k){if(F){var B;for(I=new r.Buf32(512),L=new r.Buf32(32),B=0;B<144;)k.lens[B++]=8;for(;B<256;)k.lens[B++]=9;for(;B<280;)k.lens[B++]=7;for(;B<288;)k.lens[B++]=8;for(p(b,k.lens,0,288,I,0,k.work,{bits:9}),B=0;B<32;)k.lens[B++]=5;p(y,k.lens,0,32,L,0,k.work,{bits:5}),F=!1}k.lencode=I,k.lenbits=9,k.distcode=L,k.distbits=5}function Y(k,B,o,$){var Q,M=k.state;return M.window===null&&(M.wsize=1<<M.wbits,M.wnext=0,M.whave=0,M.window=new r.Buf8(M.wsize)),$>=M.wsize?(r.arraySet(M.window,B,o-M.wsize,M.wsize,0),M.wnext=0,M.whave=M.wsize):($<(Q=M.wsize-M.wnext)&&(Q=$),r.arraySet(M.window,B,o-$,Q,M.wnext),($-=Q)?(r.arraySet(M.window,B,o-$,$,0),M.wnext=$,M.whave=M.wsize):(M.wnext+=Q,M.wnext===M.wsize&&(M.wnext=0),M.whave<M.wsize&&(M.whave+=Q))),0}s.inflateReset=z,s.inflateReset2=E,s.inflateResetKeep=S,s.inflateInit=function(k){return P(k,15)},s.inflateInit2=P,s.inflate=function(k,B){var o,$,Q,M,tt,W,q,O,T,J,X,K,st,lt,et,nt,ct,at,ht,dt,e,D,R,w,g=0,A=new r.Buf8(4),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!k||!k.state||!k.output||!k.input&&k.avail_in!==0)return d;(o=k.state).mode===12&&(o.mode=13),tt=k.next_out,Q=k.output,q=k.avail_out,M=k.next_in,$=k.input,W=k.avail_in,O=o.hold,T=o.bits,J=W,X=q,D=x;t:for(;;)switch(o.mode){case _:if(o.wrap===0){o.mode=13;break}for(;T<16;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}if(2&o.wrap&&O===35615){A[o.check=0]=255&O,A[1]=O>>>8&255,o.check=i(o.check,A,2,0),T=O=0,o.mode=2;break}if(o.flags=0,o.head&&(o.head.done=!1),!(1&o.wrap)||(((255&O)<<8)+(O>>8))%31){k.msg="incorrect header check",o.mode=30;break}if((15&O)!=8){k.msg="unknown compression method",o.mode=30;break}if(T-=4,e=8+(15&(O>>>=4)),o.wbits===0)o.wbits=e;else if(e>o.wbits){k.msg="invalid window size",o.mode=30;break}o.dmax=1<<e,k.adler=o.check=1,o.mode=512&O?10:12,T=O=0;break;case 2:for(;T<16;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}if(o.flags=O,(255&o.flags)!=8){k.msg="unknown compression method",o.mode=30;break}if(57344&o.flags){k.msg="unknown header flags set",o.mode=30;break}o.head&&(o.head.text=O>>8&1),512&o.flags&&(A[0]=255&O,A[1]=O>>>8&255,o.check=i(o.check,A,2,0)),T=O=0,o.mode=3;case 3:for(;T<32;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}o.head&&(o.head.time=O),512&o.flags&&(A[0]=255&O,A[1]=O>>>8&255,A[2]=O>>>16&255,A[3]=O>>>24&255,o.check=i(o.check,A,4,0)),T=O=0,o.mode=4;case 4:for(;T<16;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}o.head&&(o.head.xflags=255&O,o.head.os=O>>8),512&o.flags&&(A[0]=255&O,A[1]=O>>>8&255,o.check=i(o.check,A,2,0)),T=O=0,o.mode=5;case 5:if(1024&o.flags){for(;T<16;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}o.length=O,o.head&&(o.head.extra_len=O),512&o.flags&&(A[0]=255&O,A[1]=O>>>8&255,o.check=i(o.check,A,2,0)),T=O=0}else o.head&&(o.head.extra=null);o.mode=6;case 6:if(1024&o.flags&&(W<(K=o.length)&&(K=W),K&&(o.head&&(e=o.head.extra_len-o.length,o.head.extra||(o.head.extra=new Array(o.head.extra_len)),r.arraySet(o.head.extra,$,M,K,e)),512&o.flags&&(o.check=i(o.check,$,K,M)),W-=K,M+=K,o.length-=K),o.length))break t;o.length=0,o.mode=7;case 7:if(2048&o.flags){if(W===0)break t;for(K=0;e=$[M+K++],o.head&&e&&o.length<65536&&(o.head.name+=String.fromCharCode(e)),e&&K<W;);if(512&o.flags&&(o.check=i(o.check,$,K,M)),W-=K,M+=K,e)break t}else o.head&&(o.head.name=null);o.length=0,o.mode=8;case 8:if(4096&o.flags){if(W===0)break t;for(K=0;e=$[M+K++],o.head&&e&&o.length<65536&&(o.head.comment+=String.fromCharCode(e)),e&&K<W;);if(512&o.flags&&(o.check=i(o.check,$,K,M)),W-=K,M+=K,e)break t}else o.head&&(o.head.comment=null);o.mode=9;case 9:if(512&o.flags){for(;T<16;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}if(O!==(65535&o.check)){k.msg="header crc mismatch",o.mode=30;break}T=O=0}o.head&&(o.head.hcrc=o.flags>>9&1,o.head.done=!0),k.adler=o.check=0,o.mode=12;break;case 10:for(;T<32;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}k.adler=o.check=h(O),T=O=0,o.mode=11;case 11:if(o.havedict===0)return k.next_out=tt,k.avail_out=q,k.next_in=M,k.avail_in=W,o.hold=O,o.bits=T,2;k.adler=o.check=1,o.mode=12;case 12:if(B===5||B===6)break t;case 13:if(o.last){O>>>=7&T,T-=7&T,o.mode=27;break}for(;T<3;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}switch(o.last=1&O,T-=1,3&(O>>>=1)){case 0:o.mode=14;break;case 1:if(U(o),o.mode=20,B!==6)break;O>>>=2,T-=2;break t;case 2:o.mode=17;break;case 3:k.msg="invalid block type",o.mode=30}O>>>=2,T-=2;break;case 14:for(O>>>=7&T,T-=7&T;T<32;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}if((65535&O)!=(O>>>16^65535)){k.msg="invalid stored block lengths",o.mode=30;break}if(o.length=65535&O,T=O=0,o.mode=15,B===6)break t;case 15:o.mode=16;case 16:if(K=o.length){if(W<K&&(K=W),q<K&&(K=q),K===0)break t;r.arraySet(Q,$,M,K,tt),W-=K,M+=K,q-=K,tt+=K,o.length-=K;break}o.mode=12;break;case 17:for(;T<14;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}if(o.nlen=257+(31&O),O>>>=5,T-=5,o.ndist=1+(31&O),O>>>=5,T-=5,o.ncode=4+(15&O),O>>>=4,T-=4,286<o.nlen||30<o.ndist){k.msg="too many length or distance symbols",o.mode=30;break}o.have=0,o.mode=18;case 18:for(;o.have<o.ncode;){for(;T<3;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}o.lens[j[o.have++]]=7&O,O>>>=3,T-=3}for(;o.have<19;)o.lens[j[o.have++]]=0;if(o.lencode=o.lendyn,o.lenbits=7,R={bits:o.lenbits},D=p(0,o.lens,0,19,o.lencode,0,o.work,R),o.lenbits=R.bits,D){k.msg="invalid code lengths set",o.mode=30;break}o.have=0,o.mode=19;case 19:for(;o.have<o.nlen+o.ndist;){for(;nt=(g=o.lencode[O&(1<<o.lenbits)-1])>>>16&255,ct=65535&g,!((et=g>>>24)<=T);){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}if(ct<16)O>>>=et,T-=et,o.lens[o.have++]=ct;else{if(ct===16){for(w=et+2;T<w;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}if(O>>>=et,T-=et,o.have===0){k.msg="invalid bit length repeat",o.mode=30;break}e=o.lens[o.have-1],K=3+(3&O),O>>>=2,T-=2}else if(ct===17){for(w=et+3;T<w;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}T-=et,e=0,K=3+(7&(O>>>=et)),O>>>=3,T-=3}else{for(w=et+7;T<w;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}T-=et,e=0,K=11+(127&(O>>>=et)),O>>>=7,T-=7}if(o.have+K>o.nlen+o.ndist){k.msg="invalid bit length repeat",o.mode=30;break}for(;K--;)o.lens[o.have++]=e}}if(o.mode===30)break;if(o.lens[256]===0){k.msg="invalid code -- missing end-of-block",o.mode=30;break}if(o.lenbits=9,R={bits:o.lenbits},D=p(b,o.lens,0,o.nlen,o.lencode,0,o.work,R),o.lenbits=R.bits,D){k.msg="invalid literal/lengths set",o.mode=30;break}if(o.distbits=6,o.distcode=o.distdyn,R={bits:o.distbits},D=p(y,o.lens,o.nlen,o.ndist,o.distcode,0,o.work,R),o.distbits=R.bits,D){k.msg="invalid distances set",o.mode=30;break}if(o.mode=20,B===6)break t;case 20:o.mode=21;case 21:if(6<=W&&258<=q){k.next_out=tt,k.avail_out=q,k.next_in=M,k.avail_in=W,o.hold=O,o.bits=T,l(k,X),tt=k.next_out,Q=k.output,q=k.avail_out,M=k.next_in,$=k.input,W=k.avail_in,O=o.hold,T=o.bits,o.mode===12&&(o.back=-1);break}for(o.back=0;nt=(g=o.lencode[O&(1<<o.lenbits)-1])>>>16&255,ct=65535&g,!((et=g>>>24)<=T);){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}if(nt&&(240&nt)==0){for(at=et,ht=nt,dt=ct;nt=(g=o.lencode[dt+((O&(1<<at+ht)-1)>>at)])>>>16&255,ct=65535&g,!(at+(et=g>>>24)<=T);){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}O>>>=at,T-=at,o.back+=at}if(O>>>=et,T-=et,o.back+=et,o.length=ct,nt===0){o.mode=26;break}if(32&nt){o.back=-1,o.mode=12;break}if(64&nt){k.msg="invalid literal/length code",o.mode=30;break}o.extra=15&nt,o.mode=22;case 22:if(o.extra){for(w=o.extra;T<w;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}o.length+=O&(1<<o.extra)-1,O>>>=o.extra,T-=o.extra,o.back+=o.extra}o.was=o.length,o.mode=23;case 23:for(;nt=(g=o.distcode[O&(1<<o.distbits)-1])>>>16&255,ct=65535&g,!((et=g>>>24)<=T);){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}if((240&nt)==0){for(at=et,ht=nt,dt=ct;nt=(g=o.distcode[dt+((O&(1<<at+ht)-1)>>at)])>>>16&255,ct=65535&g,!(at+(et=g>>>24)<=T);){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}O>>>=at,T-=at,o.back+=at}if(O>>>=et,T-=et,o.back+=et,64&nt){k.msg="invalid distance code",o.mode=30;break}o.offset=ct,o.extra=15&nt,o.mode=24;case 24:if(o.extra){for(w=o.extra;T<w;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}o.offset+=O&(1<<o.extra)-1,O>>>=o.extra,T-=o.extra,o.back+=o.extra}if(o.offset>o.dmax){k.msg="invalid distance too far back",o.mode=30;break}o.mode=25;case 25:if(q===0)break t;if(K=X-q,o.offset>K){if((K=o.offset-K)>o.whave&&o.sane){k.msg="invalid distance too far back",o.mode=30;break}st=K>o.wnext?(K-=o.wnext,o.wsize-K):o.wnext-K,K>o.length&&(K=o.length),lt=o.window}else lt=Q,st=tt-o.offset,K=o.length;for(q<K&&(K=q),q-=K,o.length-=K;Q[tt++]=lt[st++],--K;);o.length===0&&(o.mode=21);break;case 26:if(q===0)break t;Q[tt++]=o.length,q--,o.mode=21;break;case 27:if(o.wrap){for(;T<32;){if(W===0)break t;W--,O|=$[M++]<<T,T+=8}if(X-=q,k.total_out+=X,o.total+=X,X&&(k.adler=o.check=o.flags?i(o.check,Q,X,tt-X):n(o.check,Q,X,tt-X)),X=q,(o.flags?O:h(O))!==o.check){k.msg="incorrect data check",o.mode=30;break}T=O=0}o.mode=28;case 28:if(o.wrap&&o.flags){for(;T<32;){if(W===0)break t;W--,O+=$[M++]<<T,T+=8}if(O!==(4294967295&o.total)){k.msg="incorrect length check",o.mode=30;break}T=O=0}o.mode=29;case 29:D=1;break t;case 30:D=-3;break t;case 31:return-4;default:return d}return k.next_out=tt,k.avail_out=q,k.next_in=M,k.avail_in=W,o.hold=O,o.bits=T,(o.wsize||X!==k.avail_out&&o.mode<30&&(o.mode<27||B!==4))&&Y(k,k.output,k.next_out,X-k.avail_out)?(o.mode=31,-4):(J-=k.avail_in,X-=k.avail_out,k.total_in+=J,k.total_out+=X,o.total+=X,o.wrap&&X&&(k.adler=o.check=o.flags?i(o.check,Q,X,k.next_out-X):n(o.check,Q,X,k.next_out-X)),k.data_type=o.bits+(o.last?64:0)+(o.mode===12?128:0)+(o.mode===20||o.mode===15?256:0),(J==0&&X===0||B===4)&&D===x&&(D=-5),D)},s.inflateEnd=function(k){if(!k||!k.state)return d;var B=k.state;return B.window&&(B.window=null),k.state=null,x},s.inflateGetHeader=function(k,B){var o;return k&&k.state?(2&(o=k.state).wrap)==0?d:((o.head=B).done=!1,x):d},s.inflateSetDictionary=function(k,B){var o,$=B.length;return k&&k.state?(o=k.state).wrap!==0&&o.mode!==11?d:o.mode===11&&n(1,B,$,0)!==o.check?-3:Y(k,B,$,$)?(o.mode=31,-4):(o.havedict=1,x):d},s.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,f,s){var r=t("../utils/common"),n=[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],i=[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],l=[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],p=[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];f.exports=function(b,y,x,d,_,u,m,h){var v,S,z,E,P,I,L,F,U,Y=h.bits,k=0,B=0,o=0,$=0,Q=0,M=0,tt=0,W=0,q=0,O=0,T=null,J=0,X=new r.Buf16(16),K=new r.Buf16(16),st=null,lt=0;for(k=0;k<=15;k++)X[k]=0;for(B=0;B<d;B++)X[y[x+B]]++;for(Q=Y,$=15;1<=$&&X[$]===0;$--);if($<Q&&(Q=$),$===0)return _[u++]=20971520,_[u++]=20971520,h.bits=1,0;for(o=1;o<$&&X[o]===0;o++);for(Q<o&&(Q=o),k=W=1;k<=15;k++)if(W<<=1,(W-=X[k])<0)return-1;if(0<W&&(b===0||$!==1))return-1;for(K[1]=0,k=1;k<15;k++)K[k+1]=K[k]+X[k];for(B=0;B<d;B++)y[x+B]!==0&&(m[K[y[x+B]]++]=B);if(I=b===0?(T=st=m,19):b===1?(T=n,J-=257,st=i,lt-=257,256):(T=l,st=p,-1),k=o,P=u,tt=B=O=0,z=-1,E=(q=1<<(M=Q))-1,b===1&&852<q||b===2&&592<q)return 1;for(;;){for(L=k-tt,U=m[B]<I?(F=0,m[B]):m[B]>I?(F=st[lt+m[B]],T[J+m[B]]):(F=96,0),v=1<<k-tt,o=S=1<<M;_[P+(O>>tt)+(S-=v)]=L<<24|F<<16|U|0,S!==0;);for(v=1<<k-1;O&v;)v>>=1;if(v!==0?(O&=v-1,O+=v):O=0,B++,--X[k]==0){if(k===$)break;k=y[x+m[B]]}if(Q<k&&(O&E)!==z){for(tt===0&&(tt=Q),P+=o,W=1<<(M=k-tt);M+tt<$&&!((W-=X[M+tt])<=0);)M++,W<<=1;if(q+=1<<M,b===1&&852<q||b===2&&592<q)return 1;_[z=O&E]=Q<<24|M<<16|P-u|0}}return O!==0&&(_[P+O]=k-tt<<24|64<<16|0),h.bits=Q,0}},{"../utils/common":41}],51:[function(t,f,s){f.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,f,s){var r=t("../utils/common"),n=0,i=1;function l(g){for(var A=g.length;0<=--A;)g[A]=0}var p=0,b=29,y=256,x=y+1+b,d=30,_=19,u=2*x+1,m=15,h=16,v=7,S=256,z=16,E=17,P=18,I=[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],L=[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],U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Y=new Array(2*(x+2));l(Y);var k=new Array(2*d);l(k);var B=new Array(512);l(B);var o=new Array(256);l(o);var $=new Array(b);l($);var Q,M,tt,W=new Array(d);function q(g,A,j,N,C){this.static_tree=g,this.extra_bits=A,this.extra_base=j,this.elems=N,this.max_length=C,this.has_stree=g&&g.length}function O(g,A){this.dyn_tree=g,this.max_code=0,this.stat_desc=A}function T(g){return g<256?B[g]:B[256+(g>>>7)]}function J(g,A){g.pending_buf[g.pending++]=255&A,g.pending_buf[g.pending++]=A>>>8&255}function X(g,A,j){g.bi_valid>h-j?(g.bi_buf|=A<<g.bi_valid&65535,J(g,g.bi_buf),g.bi_buf=A>>h-g.bi_valid,g.bi_valid+=j-h):(g.bi_buf|=A<<g.bi_valid&65535,g.bi_valid+=j)}function K(g,A,j){X(g,j[2*A],j[2*A+1])}function st(g,A){for(var j=0;j|=1&g,g>>>=1,j<<=1,0<--A;);return j>>>1}function lt(g,A,j){var N,C,Z=new Array(m+1),G=0;for(N=1;N<=m;N++)Z[N]=G=G+j[N-1]<<1;for(C=0;C<=A;C++){var H=g[2*C+1];H!==0&&(g[2*C]=st(Z[H]++,H))}}function et(g){var A;for(A=0;A<x;A++)g.dyn_ltree[2*A]=0;for(A=0;A<d;A++)g.dyn_dtree[2*A]=0;for(A=0;A<_;A++)g.bl_tree[2*A]=0;g.dyn_ltree[2*S]=1,g.opt_len=g.static_len=0,g.last_lit=g.matches=0}function nt(g){8<g.bi_valid?J(g,g.bi_buf):0<g.bi_valid&&(g.pending_buf[g.pending++]=g.bi_buf),g.bi_buf=0,g.bi_valid=0}function ct(g,A,j,N){var C=2*A,Z=2*j;return g[C]<g[Z]||g[C]===g[Z]&&N[A]<=N[j]}function at(g,A,j){for(var N=g.heap[j],C=j<<1;C<=g.heap_len&&(C<g.heap_len&&ct(A,g.heap[C+1],g.heap[C],g.depth)&&C++,!ct(A,N,g.heap[C],g.depth));)g.heap[j]=g.heap[C],j=C,C<<=1;g.heap[j]=N}function ht(g,A,j){var N,C,Z,G,H=0;if(g.last_lit!==0)for(;N=g.pending_buf[g.d_buf+2*H]<<8|g.pending_buf[g.d_buf+2*H+1],C=g.pending_buf[g.l_buf+H],H++,N===0?K(g,C,A):(K(g,(Z=o[C])+y+1,A),(G=I[Z])!==0&&X(g,C-=$[Z],G),K(g,Z=T(--N),j),(G=L[Z])!==0&&X(g,N-=W[Z],G)),H<g.last_lit;);K(g,S,A)}function dt(g,A){var j,N,C,Z=A.dyn_tree,G=A.stat_desc.static_tree,H=A.stat_desc.has_stree,V=A.stat_desc.elems,it=-1;for(g.heap_len=0,g.heap_max=u,j=0;j<V;j++)Z[2*j]!==0?(g.heap[++g.heap_len]=it=j,g.depth[j]=0):Z[2*j+1]=0;for(;g.heap_len<2;)Z[2*(C=g.heap[++g.heap_len]=it<2?++it:0)]=1,g.depth[C]=0,g.opt_len--,H&&(g.static_len-=G[2*C+1]);for(A.max_code=it,j=g.heap_len>>1;1<=j;j--)at(g,Z,j);for(C=V;j=g.heap[1],g.heap[1]=g.heap[g.heap_len--],at(g,Z,1),N=g.heap[1],g.heap[--g.heap_max]=j,g.heap[--g.heap_max]=N,Z[2*C]=Z[2*j]+Z[2*N],g.depth[C]=(g.depth[j]>=g.depth[N]?g.depth[j]:g.depth[N])+1,Z[2*j+1]=Z[2*N+1]=C,g.heap[1]=C++,at(g,Z,1),2<=g.heap_len;);g.heap[--g.heap_max]=g.heap[1],(function(rt,ft){var yt,pt,vt,ot,zt,$t,mt=ft.dyn_tree,te=ft.max_code,je=ft.stat_desc.static_tree,Le=ft.stat_desc.has_stree,Ne=ft.stat_desc.extra_bits,ee=ft.stat_desc.extra_base,wt=ft.stat_desc.max_length,At=0;for(ot=0;ot<=m;ot++)rt.bl_count[ot]=0;for(mt[2*rt.heap[rt.heap_max]+1]=0,yt=rt.heap_max+1;yt<u;yt++)wt<(ot=mt[2*mt[2*(pt=rt.heap[yt])+1]+1]+1)&&(ot=wt,At++),mt[2*pt+1]=ot,te<pt||(rt.bl_count[ot]++,zt=0,ee<=pt&&(zt=Ne[pt-ee]),$t=mt[2*pt],rt.opt_len+=$t*(ot+zt),Le&&(rt.static_len+=$t*(je[2*pt+1]+zt)));if(At!==0){do{for(ot=wt-1;rt.bl_count[ot]===0;)ot--;rt.bl_count[ot]--,rt.bl_count[ot+1]+=2,rt.bl_count[wt]--,At-=2}while(0<At);for(ot=wt;ot!==0;ot--)for(pt=rt.bl_count[ot];pt!==0;)te<(vt=rt.heap[--yt])||(mt[2*vt+1]!==ot&&(rt.opt_len+=(ot-mt[2*vt+1])*mt[2*vt],mt[2*vt+1]=ot),pt--)}})(g,A),lt(Z,it,g.bl_count)}function e(g,A,j){var N,C,Z=-1,G=A[1],H=0,V=7,it=4;for(G===0&&(V=138,it=3),A[2*(j+1)+1]=65535,N=0;N<=j;N++)C=G,G=A[2*(N+1)+1],++H<V&&C===G||(H<it?g.bl_tree[2*C]+=H:C!==0?(C!==Z&&g.bl_tree[2*C]++,g.bl_tree[2*z]++):H<=10?g.bl_tree[2*E]++:g.bl_tree[2*P]++,Z=C,it=(H=0)===G?(V=138,3):C===G?(V=6,3):(V=7,4))}function D(g,A,j){var N,C,Z=-1,G=A[1],H=0,V=7,it=4;for(G===0&&(V=138,it=3),N=0;N<=j;N++)if(C=G,G=A[2*(N+1)+1],!(++H<V&&C===G)){if(H<it)for(;K(g,C,g.bl_tree),--H!=0;);else C!==0?(C!==Z&&(K(g,C,g.bl_tree),H--),K(g,z,g.bl_tree),X(g,H-3,2)):H<=10?(K(g,E,g.bl_tree),X(g,H-3,3)):(K(g,P,g.bl_tree),X(g,H-11,7));Z=C,it=(H=0)===G?(V=138,3):C===G?(V=6,3):(V=7,4)}}l(W);var R=!1;function w(g,A,j,N){X(g,(p<<1)+(N?1:0),3),(function(C,Z,G,H){nt(C),J(C,G),J(C,~G),r.arraySet(C.pending_buf,C.window,Z,G,C.pending),C.pending+=G})(g,A,j)}s._tr_init=function(g){R||((function(){var A,j,N,C,Z,G=new Array(m+1);for(C=N=0;C<b-1;C++)for($[C]=N,A=0;A<1<<I[C];A++)o[N++]=C;for(o[N-1]=C,C=Z=0;C<16;C++)for(W[C]=Z,A=0;A<1<<L[C];A++)B[Z++]=C;for(Z>>=7;C<d;C++)for(W[C]=Z<<7,A=0;A<1<<L[C]-7;A++)B[256+Z++]=C;for(j=0;j<=m;j++)G[j]=0;for(A=0;A<=143;)Y[2*A+1]=8,A++,G[8]++;for(;A<=255;)Y[2*A+1]=9,A++,G[9]++;for(;A<=279;)Y[2*A+1]=7,A++,G[7]++;for(;A<=287;)Y[2*A+1]=8,A++,G[8]++;for(lt(Y,x+1,G),A=0;A<d;A++)k[2*A+1]=5,k[2*A]=st(A,5);Q=new q(Y,I,y+1,x,m),M=new q(k,L,0,d,m),tt=new q(new Array(0),F,0,_,v)})(),R=!0),g.l_desc=new O(g.dyn_ltree,Q),g.d_desc=new O(g.dyn_dtree,M),g.bl_desc=new O(g.bl_tree,tt),g.bi_buf=0,g.bi_valid=0,et(g)},s._tr_stored_block=w,s._tr_flush_block=function(g,A,j,N){var C,Z,G=0;0<g.level?(g.strm.data_type===2&&(g.strm.data_type=(function(H){var V,it=4093624447;for(V=0;V<=31;V++,it>>>=1)if(1&it&&H.dyn_ltree[2*V]!==0)return n;if(H.dyn_ltree[18]!==0||H.dyn_ltree[20]!==0||H.dyn_ltree[26]!==0)return i;for(V=32;V<y;V++)if(H.dyn_ltree[2*V]!==0)return i;return n})(g)),dt(g,g.l_desc),dt(g,g.d_desc),G=(function(H){var V;for(e(H,H.dyn_ltree,H.l_desc.max_code),e(H,H.dyn_dtree,H.d_desc.max_code),dt(H,H.bl_desc),V=_-1;3<=V&&H.bl_tree[2*U[V]+1]===0;V--);return H.opt_len+=3*(V+1)+5+5+4,V})(g),C=g.opt_len+3+7>>>3,(Z=g.static_len+3+7>>>3)<=C&&(C=Z)):C=Z=j+5,j+4<=C&&A!==-1?w(g,A,j,N):g.strategy===4||Z===C?(X(g,2+(N?1:0),3),ht(g,Y,k)):(X(g,4+(N?1:0),3),(function(H,V,it,rt){var ft;for(X(H,V-257,5),X(H,it-1,5),X(H,rt-4,4),ft=0;ft<rt;ft++)X(H,H.bl_tree[2*U[ft]+1],3);D(H,H.dyn_ltree,V-1),D(H,H.dyn_dtree,it-1)})(g,g.l_desc.max_code+1,g.d_desc.max_code+1,G+1),ht(g,g.dyn_ltree,g.dyn_dtree)),et(g),N&&nt(g)},s._tr_tally=function(g,A,j){return g.pending_buf[g.d_buf+2*g.last_lit]=A>>>8&255,g.pending_buf[g.d_buf+2*g.last_lit+1]=255&A,g.pending_buf[g.l_buf+g.last_lit]=255&j,g.last_lit++,A===0?g.dyn_ltree[2*j]++:(g.matches++,A--,g.dyn_ltree[2*(o[j]+y+1)]++,g.dyn_dtree[2*T(A)]++),g.last_lit===g.lit_bufsize-1},s._tr_align=function(g){X(g,2,3),K(g,S,Y),(function(A){A.bi_valid===16?(J(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):8<=A.bi_valid&&(A.pending_buf[A.pending++]=255&A.bi_buf,A.bi_buf>>=8,A.bi_valid-=8)})(g)}},{"../utils/common":41}],53:[function(t,f,s){f.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,f,s){(function(r){(function(n,i){if(!n.setImmediate){var l,p,b,y,x=1,d={},_=!1,u=n.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(n);m=m&&m.setTimeout?m:n,l={}.toString.call(n.process)==="[object process]"?function(z){process.nextTick(function(){v(z)})}:(function(){if(n.postMessage&&!n.importScripts){var z=!0,E=n.onmessage;return n.onmessage=function(){z=!1},n.postMessage("","*"),n.onmessage=E,z}})()?(y="setImmediate$"+Math.random()+"$",n.addEventListener?n.addEventListener("message",S,!1):n.attachEvent("onmessage",S),function(z){n.postMessage(y+z,"*")}):n.MessageChannel?((b=new MessageChannel).port1.onmessage=function(z){v(z.data)},function(z){b.port2.postMessage(z)}):u&&"onreadystatechange"in u.createElement("script")?(p=u.documentElement,function(z){var E=u.createElement("script");E.onreadystatechange=function(){v(z),E.onreadystatechange=null,p.removeChild(E),E=null},p.appendChild(E)}):function(z){setTimeout(v,0,z)},m.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var E=new Array(arguments.length-1),P=0;P<E.length;P++)E[P]=arguments[P+1];var I={callback:z,args:E};return d[x]=I,l(x),x++},m.clearImmediate=h}function h(z){delete d[z]}function v(z){if(_)setTimeout(v,0,z);else{var E=d[z];if(E){_=!0;try{(function(P){var I=P.callback,L=P.args;switch(L.length){case 0:I();break;case 1:I(L[0]);break;case 2:I(L[0],L[1]);break;case 3:I(L[0],L[1],L[2]);break;default:I.apply(i,L)}})(E)}finally{h(z),_=!1}}}}function S(z){z.source===n&&typeof z.data=="string"&&z.data.indexOf(y)===0&&v(+z.data.slice(y.length))}})(typeof self>"u"?r===void 0?this:r:self)}).call(this,typeof Ct<"u"?Ct:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(jt)),jt.exports}var gr=mr();const _r=pr(gr),br=/<xi:include\b[^>]*\bhref\s*=\s*(?:"([^"]+)"|'([^']+)')[^>]*\/>/g;function yr(c){const a=c.lastIndexOf("/");return a>=0?c.slice(0,a):""}function vr(c){return c.replace(/\\/g,"/").replace(/^\.\//,"")}function wr(c,a,t){const f=yr(a),s=[c,`${c}.ptx`,`${c}.xml`,f?`${f}/${c}`:null,f?`${f}/${c}.ptx`:`${c}.ptx`,f?`${f}/${c}.xml`:`${c}.xml`].filter(r=>r!==null);for(const r of s){const n=vr(r);if(n in t)return n}return null}function xr(c){return c.replace(/^\s*<\?xml[^?]*\?>\s*/,"")}function Se(c,a,t,f=5){let s=0;const r=[],n=[],i=(p,b)=>{let y=!1;return{output:p.replace(br,(d,_,u)=>{const m=_??u??"",h=wr(m,b,t);return h?n.includes(h)?d:(y=!0,s+=1,xr(t[h])):(r.includes(m)||r.push(m),d)}),changed:y}};let l=c;for(let p=0;p<f;p+=1){n.push(a);const{output:b,changed:y}=i(l,a);if(n.pop(),l=b,!y)break}return{expandedText:l,expandedCount:s,missingIncludes:r}}const kr=/<(pretext|book|article)\b/;function Sr(c){const a=Object.keys(c).filter(f=>/\.(ptx|xml)$/i.test(f)).sort();return a.length===0?null:a.find(f=>kr.test(c[f]))??a[0]}const le=/([a-zA-Z_:][\w:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;function Ot(c){const a={};let t;for(le.lastIndex=0;(t=le.exec(c))!==null;)a[t[1]]=t[2]??t[3]??"";return a}function Ee(c){const a=[];let t=0;const f=c.length;for(;t<f;){const s=c.indexOf("<",t);if(s<0)break;if(c.startsWith("<!--",s)){const u=c.indexOf("-->",s+4);t=u<0?f:u+3;continue}if(c.startsWith("<![CDATA[",s)){const u=c.indexOf("]]>",s+9);t=u<0?f:u+3;continue}if(c.startsWith("<?",s)){const u=c.indexOf("?>",s+2);t=u<0?f:u+2;continue}if(c.startsWith("<!",s)){const u=c.indexOf(">",s+2);t=u<0?f:u+1;continue}let r=s+1,n=!1;c[r]==="/"&&(n=!0,r+=1);const i=/^[a-zA-Z_:][\w:.-]*/.exec(c.slice(r));if(!i){t=s+1;continue}const l=i[0];r+=l.length;let p=r,b=null;for(;r<f;){const u=c[r];if(b){u===b&&(b=null),r+=1;continue}if(u==='"'||u==="'"){b=u,r+=1;continue}if(u===">")break;r+=1}if(r>=f)break;const y=r+1,x=c.slice(p,r),d=!n&&x.trimEnd().endsWith("/"),_=d?x.replace(/\/\s*$/,""):x;n?a.push({kind:"close",name:l,pos:s,end:y}):d?a.push({kind:"selfclose",name:l,attrs:_,pos:s,end:y}):a.push({kind:"open",name:l,attrs:_,pos:s,end:y}),t=y}return a}function Rt(c,a){const t=Ee(c),f=[];let s=0,r=null;for(const n of t){if(n.kind==="selfclose"){s===0&&n.name===a&&f.push({name:a,start:n.pos,startTagEnd:n.end,contentEnd:n.end,end:n.end,inner:"",outer:c.slice(n.pos,n.end),attributes:Ot(n.attrs)});continue}if(n.kind==="open"){s===0&&n.name===a&&!r&&(r=n),s+=1;continue}s-=1,s<0&&(s=0),r&&s===0&&n.name===a&&(f.push({name:a,start:r.pos,startTagEnd:r.end,contentEnd:n.pos,end:n.end,inner:c.slice(r.end,n.pos),outer:c.slice(r.pos,n.end),attributes:Ot(r.attrs)}),r=null)}return f}function xt(c,a){return Rt(c,a)[0]??null}function kt(c,a){const t=Ee(c);let f=0,s=null,r=-1;for(const n of t){if(n.kind==="selfclose"){if(!s&&n.name===a)return{name:a,start:n.pos,startTagEnd:n.end,contentEnd:n.end,end:n.end,inner:"",outer:c.slice(n.pos,n.end),attributes:Ot(n.attrs)};continue}if(n.kind==="open"){!s&&n.name===a&&(s=n,r=f),f+=1;continue}if(f-=1,f<0&&(f=0),s&&n.name===a&&f===r){const i=s.attrs;return{name:a,start:s.pos,startTagEnd:s.end,contentEnd:n.pos,end:n.end,inner:c.slice(s.end,n.pos),outer:c.slice(s.pos,n.end),attributes:Ot(i)}}}return null}function ze(c){return kt(c,"book")?"book":kt(c,"article")?"article":kt(c,"chapter")?"book":"article"}function Ae(c){const{mainSource:a,publication:t,outputBase:f="output"}=c;return`<?xml version="1.0" encoding="UTF-8"?>
32
+ <project ptx-version="2">
33
+ <targets>
34
+ <target name="web">
35
+ <format>html</format>
36
+ <source>${a}</source>
37
+ <publication>${t}</publication>
38
+ <output-dir>${f}/web</output-dir>
39
+ </target>
40
+ <target name="print">
41
+ <format>pdf</format>
42
+ <source>${a}</source>
43
+ <publication>${t}</publication>
44
+ <output-dir>${f}/print</output-dir>
45
+ </target>
46
+ </targets>
47
+ </project>
48
+ `}function Ce(){return`<?xml version="1.0" encoding="UTF-8"?>
49
+ <publication>
50
+ <source>
51
+ <directories external="external" generated="generated"/>
52
+ </source>
53
+ <common>
54
+ <chunking level="1"/>
55
+ </common>
56
+ </publication>
57
+ `}function Er(){return`<?xml version="1.0" encoding="UTF-8"?>
58
+ `}const zr="http://www.w3.org/2001/XInclude";function qt(c){return c.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)}function _t(c,a){const t=String(a).length;return String(c).padStart(Math.max(t,2),"0")}function Ht(c,a){const t=[...a].sort((r,n)=>r.start-n.start);let f="",s=0;for(const r of t)f+=c.slice(s,r.start),f+=r.replacement,s=r.end;return f+=c.slice(s),f}function Kt(c){return c.replace(/<(pretext|book|article|chapter)\b([^>]*)>/,(a,t,f)=>/\bxmlns:xi\s*=/.test(f)?a:`<${t}${f} xmlns:xi="${zr}">`)}function Xt(c){return c.startsWith("<?xml")?c:Er()+c}function Bt(c){return c.trim().replace(/[^a-zA-Z0-9\-_]+/g,"-").replace(/^[^a-zA-Z_]+/,"").replace(/-+$/,"")}class Qt{used=new Set;claim(a){let t=a,f=2;for(;this.used.has(t);)t=`${a}-${f}`,f+=1;return this.used.add(t),t}has(a){return this.used.has(a)}}function Gt(c,a,t){if(c){const f=Bt(c)||t,s=a.claim(f);return s!==c?{ref:s,renamedFrom:c,generated:!1}:{ref:s,generated:!1}}return{ref:a.claim(t),generated:!0}}function St(c,a,t,f){a.renamedFrom!==void 0?c.push({action:"anomaly",severity:"warning",kind:"structure",category:"renamed_xml_id",macro:t,occurrences:1,message:`${t} id \`${a.renamedFrom}\` is not a valid ref (or collides with another); renamed to \`${a.ref}\`. Cross-references to the old id will break.`}):a.generated&&c.push({action:"anomaly",severity:"info",kind:"structure",category:"missing_xml_id",macro:t,occurrences:1,message:`${t} at position ${f} has no id; assigned \`${a.ref}\`.`})}function Pt(c,a){return Object.entries(c).map(([t,f])=>{const s=t.split("/").pop()??t,r=s.replace(/\.[^.]+$/,"");return{ref:a.claim(Bt(r)||"asset"),fileName:s,data:f}})}function Lt(c,a,t){const f=c.slice(0,a),s=c.slice(a);return/\bxml:id\s*=\s*(?:"[^"]*"|'[^']*')/.test(f)?f.replace(/\bxml:id\s*=\s*(?:"[^"]*"|'[^']*')/,`xml:id="${t}"`)+s:f.replace(/^<([a-zA-Z_:][\w:.-]*)/,`<$1 xml:id="${t}"`)+s}function Nt(c){const a=xt(c,"title");return a?a.inner.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim():""}function Ut(c,a,t){return Gt(c.attributes["xml:id"],a,t)}function ue(c,a){const t=c.outer.slice(0,c.startTagEnd-c.start),f=c.outer.slice(c.contentEnd-c.start);return t+a+f}function Te(c,a={}){const t=[],f=a.documentKind??ze(c),s=a.splitChapters??f==="book",r=a.splitSections??!1,n=kt(c,"pretext"),i=n?n.inner:c,l=xt(i,"docinfo"),p=l?.outer.trim()??"";let b=xt(i,"book")??xt(i,"article");if(!b){const v=f==="book"?"book":"article",S=(l?i.slice(0,l.start)+i.slice(l.end):i).trim();b=xt(`<${v}>
59
+ ${S}
60
+ </${v}>`,v)}if(!b)throw new Error("Could not locate a root element for the division pool.");f==="book"&&b.name!=="book"&&t.push({action:"anomaly",severity:"warning",kind:"structure",category:"missing_root",macro:"book",occurrences:1,message:"Document was treated as a book but no <book> element found; importing with the existing root."});const y=new Qt,x=[],d=Ut(b,y,"document");d.renamedFrom!==void 0&&St(t,d,b.name,1);const _=Nt(b.inner);let u=b.inner;if(s&&f==="book"){const v=Rt(b.inner,"chapter"),S=v.map((z,E)=>{const P=Ut(z,y,`ch-${_t(E+1,v.length)}`);St(t,P,"chapter",E+1);let I=z.inner;if(r){const L=Rt(z.inner,"section"),F=L.map((U,Y)=>{const k=Ut(U,y,`${P.ref}-sec-${_t(Y+1,L.length)}`);return St(t,k,"section",Y+1),x.push({xmlId:k.ref,type:"section",title:Nt(U.inner),sourceFormat:"pretext",content:Lt(U.outer,U.startTagEnd-U.start,k.ref),isRoot:!1}),{start:U.start,end:U.end,replacement:`<plus:section ref="${k.ref}"/>`}});I=Ht(z.inner,F)}return x.push({xmlId:P.ref,type:"chapter",title:Nt(z.inner),sourceFormat:"pretext",content:Lt(ue(z,I),z.startTagEnd-z.start,P.ref),isRoot:!1}),{start:z.start,end:z.end,replacement:`<plus:chapter ref="${P.ref}"/>`}});u=Ht(b.inner,S)}const m={xmlId:d.ref,type:b.name==="book"?"book":"article",title:_,sourceFormat:"pretext",content:Lt(ue(b,u),b.startTagEnd-b.start,d.ref),isRoot:!0};x.unshift(m);const h=Pt(a.assets??{},y);return{project:{title:_,docinfo:p,documentKind:f,divisions:x,assets:h},warnings:t}}function Ie(c,a,t={}){return a==="latex"?Ir(c,t):Rr(c,t)}function fe(c){return Bt(qt(c))}function Dt(c,a,t,f,s,r,n){if(c){const p=Gt(c,t,fe(a)||f);return St(n,p,s,r),p.ref}const i=fe(a);if(i)return t.claim(i);const l=Gt(void 0,t,f);return St(n,l,s,r),l.ref}function Oe(c){return c.replace(/\\[a-zA-Z]+\{([^{}]*)\}/g,"$1").replace(/\\[a-zA-Z]+/g,"").replace(/[{}]/g,"").replace(/\s+/g," ").trim()}function Ar(c,a){let t=a;for(;t<c.length&&/\s/.test(c[t]);)t++;if(c[t]!=="{")return null;const f=t;let s=0;for(;t<c.length;t++){const r=c[t];if(r==="\\"){t++;continue}if(r==="{")s++;else if(r==="}"&&(s--,s===0))return{inner:c.slice(f+1,t),end:t+1}}return null}function Cr(c,a){let t=a;for(;t<c.length&&/\s/.test(c[t]);)t++;if(c[t]!=="[")return a;let f=0;for(;t<c.length;t++){const s=c[t];if(s==="\\"){t++;continue}if(s==="[")f++;else if(s==="]"&&(f--,f===0))return t+1}return a}function Tr(c,a){let t=0;for(let f=0;f<a;f++){const s=c[f];if(s==="\\"){f++;continue}s==="{"?t++:s==="}"&&t--}return t}function Re(c,a){const t=[],f=new RegExp(`\\\\${a}\\*?(?![a-zA-Z])`,"g");let s;for(;(s=f.exec(c))!==null;){const r=s.index;if(Tr(c,r)!==0)continue;const n=Ar(c,Cr(c,r+s[0].length));if(!n)continue;let i=n.end,l;const p=/^\s*\\label\s*\{([^{}]*)\}/.exec(c.slice(n.end));p&&(l=p[1].trim(),i=n.end+p[0].length),t.push({start:r,rawTitle:n.inner,contentStart:i,labelId:l})}return t}function Ir(c,a){const t=[],{body:f}=_e(c),s=(f||c).trim(),r=Re(s,"chapter"),n=a.documentKind??(r.length>0?"book":"article"),i=a.splitChapters??n==="book",l=a.splitSections??!1,p=new Qt,b=p.claim("document"),y=[];let x=s;if(i&&n==="book"&&r.length>0){const m=[s.slice(0,r[0].start)];r.forEach((h,v)=>{const S=r[v+1]?.start??s.length,z=Oe(h.rawTitle),E=Dt(h.labelId,z,p,`ch-${_t(v+1,r.length)}`,"chapter",v+1,t);let P=s.slice(h.contentStart,S);l&&(P=Or(P,E,p,y,t)),y.push({xmlId:E,type:"chapter",title:z,sourceFormat:"latex",content:`\\chapter{${h.rawTitle}}\\label{${E}}
61
+ ${P.trim()}`,isRoot:!1}),m.push(`\\plus{chapter}{${E}}`)}),x=m.join(`
62
+
63
+ `).trim()}const d=n==="book"?"book":"article",_=a.title??"",u=`\\${d}{${_}}\\label{${b}}`;return y.unshift({xmlId:b,type:d,title:_,sourceFormat:"latex",content:x?`${u}
64
+ ${x}`:u,isRoot:!0}),{project:{title:a.title??"",docinfo:a.docinfo??"",documentKind:n,divisions:y,assets:Pt(a.assets??{},p)},warnings:t}}function Or(c,a,t,f,s){const r=Re(c,"section");if(r.length===0)return c;const n=[c.slice(0,r[0].start)];return r.forEach((i,l)=>{const p=r[l+1]?.start??c.length,b=Oe(i.rawTitle),y=Dt(i.labelId,b,t,`${a}-sec-${_t(l+1,r.length)}`,"section",l+1,s),x=c.slice(i.contentStart,p).trim();f.push({xmlId:y,type:"section",title:b,sourceFormat:"latex",content:`\\section{${i.rawTitle}}\\label{${y}}
65
+ ${x}`,isRoot:!1}),n.push(`\\plus{section}{${y}}`)}),n.join(`
66
+
67
+ `).trim()}function Pe(c,a){const t=new RegExp(`^#{${a}}\\s+(.*)$`),f=[],s=[];let r=null,n=!1,i="";for(const l of c.split(`
68
+ `)){const p=/^\s*(```+|~~~+)/.exec(l);if(p){const y=p[1][0];n?y===i&&(n=!1):(n=!0,i=y),(r?r.bodyLines:s).push(l);continue}const b=n?null:t.exec(l);b?(r&&f.push(r),r={headingText:b[1].trim(),bodyLines:[]}):(r?r.bodyLines:s).push(l)}return r&&f.push(r),{preamble:s.join(`
69
+ `).trim(),sections:f.map(l=>({headingText:l.headingText,body:l.bodyLines.join(`
70
+ `).trim()}))}}function It(c){return`---
71
+ ${Object.entries(c).map(([t,f])=>`${t}: ${f}`).join(`
72
+ `)}
73
+ ---`}function Rr(c,a){const t=[],f=c.trim(),s=a.documentKind??"article",r=a.splitChapters??s==="book",n=a.splitSections??!1,i=new Qt,l=i.claim("document"),p=[];if(!(r&&s==="book"))return p.push({xmlId:l,type:s==="book"?"book":"article",title:a.title??"",sourceFormat:"markdown",content:`${It({division:s,id:l,title:a.title??""})}
74
+
75
+ ${f}`.trim(),isRoot:!0}),{project:{title:a.title??"",docinfo:a.docinfo??"",documentKind:s,divisions:p,assets:Pt(a.assets??{},i)},warnings:t};const{preamble:b,sections:y}=Pe(f,1),x=b?[b]:[];return y.forEach((d,_)=>{const u=Dt(void 0,d.headingText,i,`ch-${_t(_+1,y.length)}`,"chapter",_+1,t);let m=d.body;n&&(m=Pr(d.body,u,i,p,t)),p.push({xmlId:u,type:"chapter",title:d.headingText,sourceFormat:"markdown",content:`${It({division:"chapter",id:u,title:d.headingText})}
76
+
77
+ # ${d.headingText}
78
+
79
+ ${m}`.trim(),isRoot:!1}),x.push(`::chapter{ref="${u}"}`)}),p.unshift({xmlId:l,type:"book",title:a.title??"",sourceFormat:"markdown",content:`${It({division:"book",id:l,title:a.title??""})}
80
+
81
+ ${x.join(`
82
+
83
+ `)}`.trim(),isRoot:!0}),{project:{title:a.title??"",docinfo:a.docinfo??"",documentKind:s,divisions:p,assets:Pt(a.assets??{},i)},warnings:t}}function Pr(c,a,t,f,s){const{preamble:r,sections:n}=Pe(c,2);if(n.length===0)return c;const i=r?[r]:[];return n.forEach((l,p)=>{const b=Dt(void 0,l.headingText,t,`${a}-sec-${_t(p+1,n.length)}`,"section",p+1,s);f.push({xmlId:b,type:"section",title:l.headingText,sourceFormat:"markdown",content:`${It({division:"section",id:b,title:l.headingText})}
84
+
85
+ # ${l.headingText}
86
+
87
+ ${l.body}`.trim(),isRoot:!1}),i.push(`::section{ref="${b}"}`)}),i.join(`
88
+
89
+ `).trim()}const Mt={mainSourcePath:"source/main.ptx",publicationPath:"publication/publication.ptx",projectFilePath:"project.ptx"},Yt=/<plus:([a-zA-Z][a-zA-Z-]*)\s+ref="([^"]+)"\s*\/>/g;function Vt(c){const a=[];Yt.lastIndex=0;let t;for(;(t=Yt.exec(c))!==null;)a.push(t[2]);return a}function Wt(c,a){const t=qt(c)||"division";return t.startsWith(`${a}-`)?t:`${a}-${t}`}function Zt(c,a){let t=a,f=2;for(;c.has(t);)t=`${a}-${f}`,f+=1;return c.add(t),t}function Fr(c,a){const t=`${a}-`;return c.startsWith(t)?c.slice(t.length):c}function de(c,a){return c.replace(Yt,(t,f,s)=>{const r=a.get(s);return r?`<xi:include href="${r}"/>`:t})}function Fe(c,a={}){const t=a.mainSourcePath??Mt.mainSourcePath,f=a.publicationPath??Mt.publicationPath,s=a.projectFilePath??Mt.projectFilePath,r=a.includeScaffold??!0,n={},i=new Map(c.divisions.map(h=>[h.xmlId,h])),l=c.divisions.find(h=>h.isRoot);if(!l)throw new Error("Division pool has no root division.");const p=new Set,b=new Map,y=t.includes("/")?t.slice(0,t.lastIndexOf("/")+1):"",x=[];for(const h of Vt(l.content)){const v=i.get(h);if(!v)continue;const S=Zt(p,Wt(v.xmlId,"ch"));b.set(v.xmlId,`${S}.ptx`),x.push({division:v,filePath:`${y}${S}.ptx`});const z=new Set;for(const E of Vt(v.content)){const P=i.get(E);if(!P)continue;const I=Zt(z,Wt(Fr(P.xmlId,v.xmlId),"sec"));b.set(P.xmlId,`${S}/${I}.ptx`),x.push({division:P,filePath:`${y}${S}/${I}.ptx`})}}const d=new Set(x.map(h=>h.division.xmlId));for(const h of c.divisions){if(h.isRoot||d.has(h.xmlId))continue;const v=h.type==="section"?"sec":"ch",S=Zt(p,Wt(h.xmlId,v));b.set(h.xmlId,`${S}.ptx`),x.push({division:h,filePath:`${y}${S}.ptx`})}for(const{division:h,filePath:v}of x){const S=de(h.content,b),z=S===h.content?S:Kt(S);n[v]=Xt(z)}const _=de(l.content,b),m=`<pretext>
90
+ ${c.docinfo?`${c.docinfo}
91
+ `:""}${_}
92
+ </pretext>`;return n[t]=Xt(_===l.content?m:Kt(m)),r&&(n[s]=Ae({mainSource:t,publication:f}),n[f]=Ce()),{files:n}}const Br=/\.(tex|zip|md|markdown|ptx|xml|tar\.gz|tgz)$/i,Dr=["tex","md","markdown","ptx","xml","bib","sty","txt","pdf","eps","png","ps","bbl"],$r=new Set(["png","jpg","jpeg","gif","pdf","eps","ps","bmp","tiff","tif","webp","ico"]),jr=new Set(["png","jpg","jpeg","gif","svg","bmp","tiff","tif","webp","ico","pdf","eps","ps"]);function Be(c){return $r.has(c.toLowerCase())}function De(c){return c.split("/").pop()??c}function Lr(c){const a=De(c),t=gt(a);return jr.has(t)?`source/assets/${a}`:null}function Nr(c){const a=De(c);return gt(a)==="bib"?`source/${a}`:null}function Et(c){return c.replace(/\r\n?/g,`
93
+ `).replace(/(\n *){3,}/g,`
94
+
95
+ `)}function bt(c){return c.replace(/\\/g,"/").replace(/^\.\//,"")}function Ur(c){const a=c.toLowerCase();return a.endsWith(".tar.gz")||a.endsWith(".tgz")?"tar.gz":a.endsWith(".zip")?"zip":a.endsWith(".tex")?"tex":a.endsWith(".md")||a.endsWith(".markdown")?"markdown":a.endsWith(".ptx")||a.endsWith(".xml")?"pretext":null}function Mr(c){const a=(t,f)=>new TextDecoder().decode(c.slice(t,f)).split("\0")[0];return{name:a(0,100),size:parseInt(a(124,136),8)||0,type:a(156,157)}}async function Wr(c){if(typeof DecompressionStream>"u")throw new Error("This runtime does not support gzip decompression.");const f=new ReadableStream({start(l){l.enqueue(new Uint8Array(c)),l.close()}}).pipeThrough(new DecompressionStream("gzip")).getReader(),s=[];for(;;){const{done:l,value:p}=await f.read();if(l)break;s.push(p)}const r=s.reduce((l,p)=>l+p.length,0),n=new Uint8Array(r);let i=0;for(const l of s)n.set(l,i),i+=l.length;return n.buffer}function Zr(c){const a={},t={};let f=0;for(;f<c.length&&!(f+512>c.length);){const s=c.slice(f,f+512),r=Mr(s);if(!r.name)break;f+=512;const n=r.size,i=Math.ceil(n/512)*512;if(r.type==="0"||r.type===""){const l=c.slice(f,f+n),p=bt(r.name);if(Be(gt(p)))t[p]=l;else{const b=new TextDecoder().decode(l);a[p]=Et(b)}}f+=i}return{files:a,assets:t}}async function Hr(c){const a=Ur(c.name);if(!a)throw new Error("File format not supported: please upload .tex, .md, .ptx, .xml, .zip, or .tar.gz.");if(a==="tex"||a==="markdown"||a==="pretext"){const s=await c.text();return{files:{[bt(c.name)]:Et(s)},assets:{}}}if(a==="zip"){const r=await new _r().loadAsync(c),n={},i={};for(const[l,p]of Object.entries(r.files)){if(p.dir)continue;const b=bt(l);if(Be(gt(b)))i[b]=await p.async("uint8array");else{const y=await p.async("string");n[b]=Et(y)}}return{files:n,assets:i}}const t=await c.arrayBuffer(),f=await Wr(t);return Zr(new Uint8Array(f))}function gt(c){const a=c.toLowerCase().match(/\.([^.\/]+)$/);return a?a[1]:""}function Kr(c){const a=Object.keys(c).filter(f=>gt(f)==="tex").sort();return a.length===0?null:a.find(f=>/\\begin *\{document\}/.test(c[f]))??a[0]}function Xr(c){const a=c.lastIndexOf("/");return a>=0?c.slice(0,a):""}function Gr(c,a,t){const f=Xr(a);return[c,`${c}.tex`,f?`${f}/${c}`:c,f?`${f}/${c}.tex`:`${c}.tex`].map(bt).find(r=>r in t)??null}function Yr(c,a,t){let f=0;const s=[],r=i=>{let l=!1;return{output:i.replace(/(\\(input|include) *\{([^{}]+)\})/g,(b,y,x,d)=>{const _=Gr(d,a,t);return _?(l=!0,f+=1,t[_]):(s.includes(d)||s.push(d),b)}),changed:l}};let n=c;for(let i=0;i<3;i+=1){const{output:l,changed:p}=r(n);if(n=l,!p)break}return{expandedText:Et(n),expandedCount:f,missingInputs:s}}function Vr(c){const a=Kr(c);if(a)return{sourcePath:a,sourceType:"tex"};const t=Object.keys(c).sort(),f=t.find(i=>{const l=gt(i);return l==="md"||l==="markdown"});if(f)return{sourcePath:f,sourceType:"markdown"};const s=Sr(c);if(s)return{sourcePath:s,sourceType:"pretext"};if(t.length===0)throw new Error("No files were found in the uploaded source.");const r=t[0],n=Jt(c[r]);return{sourcePath:r,sourceType:n==="latex"?"tex":n}}function Jr(c){const a={other:0};for(const t of Dr)a[t]=0;for(const t of Object.keys(c)){const f=gt(t);f in a?a[f]+=1:a.other+=1}return a}function qr(c,a){const t=Jr(a);c.push({type:"success",message:"File types:"});for(const f of Object.keys(t).sort())t[f]&&c.push({type:"success",message:`${f}: ${t[f]}`})}function Qr(c){return c==="tex"?"latex":c==="markdown"?"markdown":"pretext"}function $e(c,a={}){const t=[];try{const f=Object.fromEntries(Object.entries(c).map(([E,P])=>[bt(E),Et(P)])),s=Object.keys(f).length;t.push({type:"success",message:`Found ${s} file${s===1?"":"s"}.`}),qr(t,f);const{sourcePath:r,sourceType:n}=Vr(f);let i=f[r]??"";if(n==="tex"){const E=Object.fromEntries(Object.entries(f).filter(([F])=>gt(F)==="tex")),{expandedText:P,expandedCount:I,missingInputs:L}=Yr(i,r,E);i=P,I>0&&t.push({type:"success",message:`Expanded ${I} input/include reference${I===1?"":"s"}.`}),L.length>0&&t.push({type:"error",message:`Missing input/include files: ${L.join(", ")}.`})}else if(n==="pretext"){const E=Object.fromEntries(Object.entries(f).filter(([F])=>{const U=gt(F);return U==="ptx"||U==="xml"})),{expandedText:P,expandedCount:I,missingIncludes:L}=Se(i,r,E);i=P,I>0&&t.push({type:"success",message:`Expanded ${I} xi:include reference${I===1?"":"s"}.`}),L.length>0&&t.push({type:"error",message:`Missing xi:include targets: ${L.join(", ")}.`})}t.push({type:"success",message:`Main source file: ${r}`});const l=Qr(n),p=ke(i,l);if("pretextError"in p)return{pretextError:p.pretextError,statusMessages:t,warnings:p.warnings};const{buildLayout:b=!0,assets:y={},...x}=a,d={},_={};for(const[E,P]of Object.entries(y)){const I=Lr(E);I&&(d[I]=P,_[E]=P)}const u=Te(p.pretextSource,{documentKind:x.documentKind,splitChapters:b?x.splitChapters:!1,splitSections:b?x.splitSections:!1,assets:_}),m=b?Fe(u.project,{mainSourcePath:x.mainSourcePath,publicationPath:x.publicationPath,projectFilePath:x.projectFilePath}).files:{"source/main.ptx":p.pretextSource};for(const[E,P]of Object.entries(f)){const I=Nr(E);I&&!(I in m)&&(m[I]=P)}const h=u.project.documentKind,v=[...p.warnings,...u.warnings];let S,z;return p.cleanedNativeSource!==void 0&&p.cleanedNativeSource.length>0&&(p.sourceFormat==="latex"||p.sourceFormat==="markdown")&&(S={[p.sourceFormat==="latex"?"source/main.tex":"source/main.md"]:p.cleanedNativeSource},z=Ie(p.cleanedNativeSource,p.sourceFormat,{documentKind:h,splitChapters:b?x.splitChapters:!1,splitSections:b?x.splitSections:!1,title:u.project.title,docinfo:u.project.docinfo,assets:_}).project),Object.keys(y).length>0&&t.push({type:"success",message:`Routed ${Object.keys(d).length} binary asset${Object.keys(d).length===1?"":"s"}.`}),{...p,warnings:v,sourcePath:r,sourceName:r.split("/").pop()??r,sourceType:n,project:u.project,nativeProject:z,files:f,assets:y,outputFiles:m,outputAssets:d,nativeOutputFiles:S,documentKind:h,statusMessages:t}}catch(f){const s=f instanceof Error?f.message:String(f);return t.push({type:"error",message:s}),{pretextError:s,statusMessages:t,warnings:[]}}}async function tn(c,a={}){const t=[],f=bt(c.name);if(!Br.test(f.toLowerCase()))return{pretextError:"File format not supported: please upload .tex, .md, .ptx, .xml, .zip, or .tar.gz.",statusMessages:[{type:"error",message:"File format not supported: please upload .tex, .md, .ptx, .xml, .zip, or .tar.gz."}],warnings:[]};t.push({type:"loading",message:`Processing ${f}...`});try{const{files:s,assets:r}=await Hr(c),n=$e(s,{...a,assets:r});return{...n,statusMessages:[...t,...n.statusMessages]}}catch(s){const r=s instanceof Error?s.message:String(s);return{pretextError:r,statusMessages:[...t,{type:"error",message:r}],warnings:[]}}}function en(c,a){return a==="native"?c.nativeProject??c.project:c.project}function rn(c,a){return a==="converted"?c.outputFiles:c.nativeOutputFiles??c.files}function nn(c,a){return a==="converted"?c.outputAssets:c.assets}function sn(c){const a=c.action==="replace"||c.action==="rewrite"?`replaced with \`${c.replacement}\``:c.message??c.action,t=c.occurrences>1?` (x${c.occurrences})`:"";return`[${c.severity}] ${c.macro}: ${a}${t}`}exports.LATEX_FORMAT_MARKERS=he;exports.MARKDOWN_FORMAT_MARKERS=pe;exports.assetsForImportMode=nn;exports.buildDivisionPool=Te;exports.buildNativeDivisionPool=Ie;exports.cleanLatex=ge;exports.convertLatexToPretext=ve;exports.convertMarkdownToPretext=we;exports.convertSourceToPretext=ke;exports.detectDocumentKind=ze;exports.detectSourceFormat=Jt;exports.divisionChildRefs=Vt;exports.ensureXIncludeNamespace=Kt;exports.expandPretextIncludes=Se;exports.filesForImportMode=rn;exports.findAnyElement=kt;exports.findTopLevelElements=Rt;exports.formatWarningLine=sn;exports.getConversionErrorMessage=xe;exports.handleImportUploadFile=tn;exports.importProjectFromFiles=$e;exports.normalizePretextSource=Ft;exports.padIndex=_t;exports.projectForImportMode=en;exports.renderProjectPtx=Ae;exports.renderPublicationPtx=Ce;exports.sanitizeRef=Bt;exports.serializeProjectToFiles=Fe;exports.slugify=qt;exports.spliceReplacements=Ht;exports.withProlog=Xt;
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./import-mode-CSZlmUxw.cjs");function x(){const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const a=Math.random()*16|0;return(n==="x"?a:a&3|8).toString(16)})}function R(t){return{title:t.title,docinfo:t.docinfo,documentType:t.documentKind,divisions:t.divisions.map(n=>({id:x(),ref:n.xmlId,source:n.content,sourceFormat:n.sourceFormat,isRoot:n.isRoot})),assets:t.assets.map(n=>({id:x(),ref:n.ref,kind:"file",fileName:n.fileName,data:n.data}))}}const P={mainSourcePath:"source/main.ptx",publicationPath:"publication/publication.ptx",projectFilePath:"project.ptx",docinfoPath:"source/docinfo.ptx"};function f(t){return e.findAnyElement(t,"pretext")?t:`<pretext>
2
- ${t}
3
- </pretext>`}function h(t,n,a){const o=new Map,i=[],s=`${n}-`;return t.forEach((l,c)=>{const d=l.attributes["xml:id"];let u;if(d){const m=e.slugify(d);u=m.startsWith(s)?m:`${s}${m}`}else u=`${s}${e.padIndex(c+1,t.length)}`,a.push({action:"anomaly",severity:"info",kind:"structure",category:"missing_xml_id",macro:l.name,occurrences:1,message:`<${l.name}> at position ${c+1} has no xml:id; using \`${u}\` as filename.`});const p=o.get(u)??0;o.set(u,p+1);const r=p===0?u:`${u}-${p+1}`;i.push({span:l,slug:r,filename:`${r}.ptx`})}),i}function M(t,n,a,o){const i=e.findTopLevelElements(t,"section");if(i.length===0)return t;const l=h(i,"sec",o).map(c=>{const d=`source/${n}/${c.filename}`;return a[d]=e.withProlog(c.span.outer),{start:c.span.start,end:c.span.end,replacement:`<xi:include href="${n}/${c.filename}"/>`}});return e.spliceReplacements(t,l)}function S(t,n,a){const o=e.findAnyElement(t,"book");if(!o)return a.push({action:"anomaly",severity:"warning",kind:"structure",category:"missing_root",macro:"book",occurrences:1,message:"Document was treated as a book but no <book> element found; emitting as a single file."}),g(t,n);const i={},s=e.findTopLevelElements(o.inner,"chapter");let l=o.inner;if(n.splitChapters&&s.length>0){const p=h(s,"ch",a).map(r=>{let m=r.span.outer;if(n.splitSections){const F=r.span.inner,T=M(F,r.slug,i,a);m=r.span.outer.slice(0,r.span.startTagEnd-r.span.start)+T+r.span.outer.slice(r.span.contentEnd-r.span.start)}const b=`source/${r.filename}`;return i[b]=e.withProlog(m),{start:r.span.start,end:r.span.end,replacement:`<xi:include href="${r.filename}"/>`}});l=e.spliceReplacements(o.inner,p)}const c=t.slice(o.start,o.startTagEnd)+l+t.slice(o.contentEnd,o.end),d=t.slice(0,o.start)+c+t.slice(o.end);return i[n.mainSourcePath]=e.withProlog(e.ensureXIncludeNamespace(f(d.trim()))),i}function g(t,n,a){const o={};return o[n.mainSourcePath]=e.withProlog(f(t.trim())),o}function v(t,n={}){const a=[],o=n.documentKind??e.detectDocumentKind(t),i={splitChapters:n.splitChapters??o==="book",splitSections:n.splitSections??!1,mainSourcePath:n.mainSourcePath??P.mainSourcePath,publicationPath:n.publicationPath??P.publicationPath,projectFilePath:n.projectFilePath??P.projectFilePath,docinfoPath:n.docinfoPath??P.docinfoPath},s=o==="book"?S(t,i,a):g(t,i);return s[i.projectFilePath]=e.renderProjectPtx({mainSource:i.mainSourcePath,publication:i.publicationPath}),s[i.publicationPath]=e.renderPublicationPtx(),{files:s,documentKind:o,warnings:a}}exports.LATEX_FORMAT_MARKERS=e.LATEX_FORMAT_MARKERS;exports.MARKDOWN_FORMAT_MARKERS=e.MARKDOWN_FORMAT_MARKERS;exports.assetsForImportMode=e.assetsForImportMode;exports.buildDivisionPool=e.buildDivisionPool;exports.cleanLatex=e.cleanLatex;exports.convertLatexToPretext=e.convertLatexToPretext;exports.convertMarkdownToPretext=e.convertMarkdownToPretext;exports.convertSourceToPretext=e.convertSourceToPretext;exports.detectDocumentKind=e.detectDocumentKind;exports.detectSourceFormat=e.detectSourceFormat;exports.divisionChildRefs=e.divisionChildRefs;exports.expandPretextIncludes=e.expandPretextIncludes;exports.filesForImportMode=e.filesForImportMode;exports.formatWarningLine=e.formatWarningLine;exports.getConversionErrorMessage=e.getConversionErrorMessage;exports.handleImportUploadFile=e.handleImportUploadFile;exports.importProjectFromFiles=e.importProjectFromFiles;exports.normalizePretextSource=e.normalizePretextSource;exports.renderProjectPtx=e.renderProjectPtx;exports.renderPublicationPtx=e.renderPublicationPtx;exports.sanitizeRef=e.sanitizeRef;exports.serializeProjectToFiles=e.serializeProjectToFiles;exports.buildPretextProjectFiles=v;exports.serializeProjectToPlusPayload=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./import-mode-vewAEq9k.cjs"),S={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",pdf:"application/pdf",eps:"application/postscript",ps:"application/postscript",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",ico:"image/vnd.microsoft.icon"};function j(e){const n=e.split(".").pop()?.toLowerCase()??"";return S[n]??"application/octet-stream"}const f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function E(e){const n=e.length,r=[];for(let o=0;o<n;o+=3){const i=e[o],s=o+1<n,l=o+2<n,c=s?e[o+1]:0,u=l?e[o+2]:0;r.push(f[i>>2]),r.push(f[(i&3)<<4|c>>4]),r.push(s?f[(c&15)<<2|u>>6]:"="),r.push(l?f[u&63]:"=")}return r.join("")}function M(e){return{ref:e.ref,kind:"file",title:e.fileName,short_description:e.fileName,file:{filename:e.fileName,content_type:j(e.fileName),data:E(e.data)}}}function R(e){return{title:e.title,docinfo:e.docinfo,document_type:e.documentKind,divisions_attributes:e.divisions.map(n=>({ref:n.xmlId,source:n.content,source_format:n.sourceFormat,is_root:n.isRoot})),assets_attributes:e.assets.map(M)}}const P={mainSourcePath:"source/main.ptx",publicationPath:"publication/publication.ptx",projectFilePath:"project.ptx",docinfoPath:"source/docinfo.ptx"};function g(e){return t.findAnyElement(e,"pretext")?e:`<pretext>
2
+ ${e}
3
+ </pretext>`}function h(e,n,r){const o=new Map,i=[],s=`${n}-`;return e.forEach((l,c)=>{const u=l.attributes["xml:id"];let p;if(u){const m=t.slugify(u);p=m.startsWith(s)?m:`${s}${m}`}else p=`${s}${t.padIndex(c+1,e.length)}`,r.push({action:"anomaly",severity:"info",kind:"structure",category:"missing_xml_id",macro:l.name,occurrences:1,message:`<${l.name}> at position ${c+1} has no xml:id; using \`${p}\` as filename.`});const d=o.get(p)??0;o.set(p,d+1);const a=d===0?p:`${p}-${d+1}`;i.push({span:l,slug:a,filename:`${a}.ptx`})}),i}function v(e,n,r,o){const i=t.findTopLevelElements(e,"section");if(i.length===0)return e;const l=h(i,"sec",o).map(c=>{const u=`source/${n}/${c.filename}`;return r[u]=t.withProlog(c.span.outer),{start:c.span.start,end:c.span.end,replacement:`<xi:include href="${n}/${c.filename}"/>`}});return t.spliceReplacements(e,l)}function _(e,n,r){const o=t.findAnyElement(e,"book");if(!o)return r.push({action:"anomaly",severity:"warning",kind:"structure",category:"missing_root",macro:"book",occurrences:1,message:"Document was treated as a book but no <book> element found; emitting as a single file."}),b(e,n);const i={},s=t.findTopLevelElements(o.inner,"chapter");let l=o.inner;if(n.splitChapters&&s.length>0){const d=h(s,"ch",r).map(a=>{let m=a.span.outer;if(n.splitSections){const F=a.span.inner,T=v(F,a.slug,i,r);m=a.span.outer.slice(0,a.span.startTagEnd-a.span.start)+T+a.span.outer.slice(a.span.contentEnd-a.span.start)}const x=`source/${a.filename}`;return i[x]=t.withProlog(m),{start:a.span.start,end:a.span.end,replacement:`<xi:include href="${a.filename}"/>`}});l=t.spliceReplacements(o.inner,d)}const c=e.slice(o.start,o.startTagEnd)+l+e.slice(o.contentEnd,o.end),u=e.slice(0,o.start)+c+e.slice(o.end);return i[n.mainSourcePath]=t.withProlog(t.ensureXIncludeNamespace(g(u.trim()))),i}function b(e,n,r){const o={};return o[n.mainSourcePath]=t.withProlog(g(e.trim())),o}function A(e,n={}){const r=[],o=n.documentKind??t.detectDocumentKind(e),i={splitChapters:n.splitChapters??o==="book",splitSections:n.splitSections??!1,mainSourcePath:n.mainSourcePath??P.mainSourcePath,publicationPath:n.publicationPath??P.publicationPath,projectFilePath:n.projectFilePath??P.projectFilePath,docinfoPath:n.docinfoPath??P.docinfoPath},s=o==="book"?_(e,i,r):b(e,i);return s[i.projectFilePath]=t.renderProjectPtx({mainSource:i.mainSourcePath,publication:i.publicationPath}),s[i.publicationPath]=t.renderPublicationPtx(),{files:s,documentKind:o,warnings:r}}exports.LATEX_FORMAT_MARKERS=t.LATEX_FORMAT_MARKERS;exports.MARKDOWN_FORMAT_MARKERS=t.MARKDOWN_FORMAT_MARKERS;exports.assetsForImportMode=t.assetsForImportMode;exports.buildDivisionPool=t.buildDivisionPool;exports.buildNativeDivisionPool=t.buildNativeDivisionPool;exports.cleanLatex=t.cleanLatex;exports.convertLatexToPretext=t.convertLatexToPretext;exports.convertMarkdownToPretext=t.convertMarkdownToPretext;exports.convertSourceToPretext=t.convertSourceToPretext;exports.detectDocumentKind=t.detectDocumentKind;exports.detectSourceFormat=t.detectSourceFormat;exports.divisionChildRefs=t.divisionChildRefs;exports.expandPretextIncludes=t.expandPretextIncludes;exports.filesForImportMode=t.filesForImportMode;exports.formatWarningLine=t.formatWarningLine;exports.getConversionErrorMessage=t.getConversionErrorMessage;exports.handleImportUploadFile=t.handleImportUploadFile;exports.importProjectFromFiles=t.importProjectFromFiles;exports.normalizePretextSource=t.normalizePretextSource;exports.projectForImportMode=t.projectForImportMode;exports.renderProjectPtx=t.renderProjectPtx;exports.renderPublicationPtx=t.renderPublicationPtx;exports.sanitizeRef=t.sanitizeRef;exports.serializeProjectToFiles=t.serializeProjectToFiles;exports.buildPretextProjectFiles=A;exports.serializeProjectToPlusPayload=R;
package/dist/index.d.ts CHANGED
@@ -2,13 +2,13 @@ export { detectSourceFormat, LATEX_FORMAT_MARKERS, MARKDOWN_FORMAT_MARKERS, } fr
2
2
  export { convertLatexToPretext, convertMarkdownToPretext, normalizePretextSource, convertSourceToPretext, getConversionErrorMessage, } from './lib/convert';
3
3
  export type { LatexConversionResult, MarkdownConversionResult, } from './lib/convert';
4
4
  export { importProjectFromFiles, handleImportUploadFile, type ImportProjectOptions, } from './lib/upload';
5
- export { filesForImportMode, assetsForImportMode, formatWarningLine, type ImportMode, } from './lib/import-mode';
5
+ export { filesForImportMode, assetsForImportMode, projectForImportMode, formatWarningLine, type ImportMode, } from './lib/import-mode';
6
6
  export { cleanLatex } from './lib/clean/clean-latex';
7
7
  export type { CleanLatexResult } from './lib/clean/clean-latex';
8
8
  export { expandPretextIncludes } from './lib/clean/pretext-includes';
9
9
  export type { CleaningWarning, CleaningSeverity, CleaningAction, } from './lib/clean/warnings';
10
10
  export { buildPretextProjectFiles, detectDocumentKind, renderProjectPtx, renderPublicationPtx, } from './lib/layout';
11
11
  export type { BuildProjectFilesOptions, BuildProjectFilesResult, DocumentKind, } from './lib/layout';
12
- export { buildDivisionPool, sanitizeRef, serializeProjectToFiles, serializeProjectToPlusPayload, divisionChildRefs, } from './lib/pool';
13
- export type { BuildDivisionPoolOptions, BuildDivisionPoolResult, SerializeProjectFilesOptions, SerializedProjectFiles, } from './lib/pool';
14
- export type { SourceFormat, ConversionContext, ConvertedPretextResult, UploadStatusType, UploadStatusMessage, UploadSourceType, ImportedProject, ImportedDivision, ImportedDivisionType, ImportedAsset, PlusProjectPayload, PlusDivisionRecord, PlusAssetRecord, ImportedProjectResult, ImportedProjectSuccess, ImportedProjectError, } from './lib/types';
12
+ export { buildDivisionPool, buildNativeDivisionPool, sanitizeRef, serializeProjectToFiles, serializeProjectToPlusPayload, divisionChildRefs, } from './lib/pool';
13
+ export type { BuildDivisionPoolOptions, BuildDivisionPoolResult, BuildNativeDivisionPoolOptions, SerializeProjectFilesOptions, SerializedProjectFiles, } from './lib/pool';
14
+ export type { SourceFormat, ConversionContext, ConvertedPretextResult, UploadStatusType, UploadStatusMessage, UploadSourceType, ImportedProject, ImportedDivision, ImportedDivisionType, ImportedAsset, PlusProjectPayload, PlusDivisionAttributes, PlusAssetAttributes, PlusAssetFile, ImportedProjectResult, ImportedProjectSuccess, ImportedProjectError, } from './lib/types';