vbapm 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/addins/build/vbapm.xlam +0 -0
- package/lib/actions/export-project.d.ts +2 -0
- package/lib/actions/update-project.d.ts +7 -0
- package/lib/{add-source-_Z4tr2ea.js → add-source-BOumGmx7.js} +1 -1
- package/lib/addin.d.ts +1 -0
- package/lib/bin/vbapm-update.d.ts +2 -0
- package/lib/build-project-De7NPBpt.js +3 -0
- package/lib/build-target-ooHNsSLD.js +9 -0
- package/lib/{create-project-CTAlegO8.js → create-project-BYc3XMZw.js} +1 -1
- package/lib/errors.d.ts +2 -0
- package/lib/export-project-CgFMyE-g.js +4 -0
- package/lib/export-target-C0RYJqUX.js +4 -0
- package/lib/{get-target-Ba_ZoGUl.js → get-target-LUoY1UWJ.js} +1 -1
- package/lib/index-C61lSPb5.js +1 -0
- package/lib/{index-CB6KQLC7.js → index-CBGUBgfk.js} +3 -3
- package/lib/{index-_8uEunjn.js → index-ClUEyMCY.js} +1 -1
- package/lib/{index-mBZsirl0.js → index-Cp8MNK26.js} +1 -1
- package/lib/{index-Cwtynogk.js → index-Dv6JxqGo.js} +1 -1
- package/lib/index.js +1 -1
- package/lib/{init-project-BY-a8CIk.js → init-project-9RKSVG_H.js} +3 -3
- package/lib/installer-DPj-zT7L.js +9 -0
- package/lib/{load-from-project-wNJg8fme.js → load-from-project-ClF4qaC0.js} +1 -1
- package/lib/messages.d.ts +2 -0
- package/lib/{project-DFh-2QTw.js → project-BPmPCkUS.js} +4 -4
- package/lib/run-macro-C1-aJWu5.js +1 -0
- package/lib/{sat-solver-CqS8Vf6C.js → sat-solver-B6RXdyQs.js} +1 -1
- package/lib/targets/build-target.d.ts +1 -0
- package/lib/targets/export-target.d.ts +3 -1
- package/lib/targets/transforms/format-xml.d.ts +2 -0
- package/lib/test-project-DXBFZH3o.js +1 -0
- package/lib/transform-build-graph-DgRrocSn.js +1 -0
- package/lib/transform-target-CYhuozxP.js +2 -0
- package/lib/utils/encoding.d.ts +30 -0
- package/lib/utils/run.d.ts +4 -1
- package/lib/utils/xml.d.ts +14 -0
- package/lib/{vbapm-add-QPN5uEGK.js → vbapm-add-CASFjXAL.js} +1 -1
- package/lib/vbapm-build-Bhm_pqQW.js +9 -0
- package/lib/vbapm-export-8KDCdFOz.js +9 -0
- package/lib/{vbapm-init-BMY4x_xq.js → vbapm-init-Ba2xCez2.js} +1 -1
- package/lib/{vbapm-new-DLW9SdvJ.js → vbapm-new-YQRNQ4Iq.js} +1 -1
- package/lib/{vbapm-run-DzRxAhlD.js → vbapm-run-J-R--noZ.js} +2 -2
- package/lib/{vbapm-test-DInh0MDC.js → vbapm-test-C4KWMPLz.js} +1 -1
- package/lib/vbapm-update-DnbmW8tc.js +13 -0
- package/lib/{vbapm-version-3Xv7JjGv.js → vbapm-version-CRicT8YA.js} +1 -1
- package/lib/vbapm.js +2 -1
- package/package.json +6 -3
- package/run-scripts/run.applescript +18 -7
- package/run-scripts/run.ps1 +42 -10
- package/lib/build-project-CIZanDh1.js +0 -3
- package/lib/build-target-B03OPzeI.js +0 -9
- package/lib/export-project-DdTYRyAw.js +0 -4
- package/lib/export-target-CEupP86g.js +0 -4
- package/lib/installer-C0iBwEpK.js +0 -9
- package/lib/run-macro-Ck_8Iku3.js +0 -1
- package/lib/test-project-CM-XUOdH.js +0 -1
- package/lib/transform-target-DJmqMjY0.js +0 -2
- package/lib/vbapm-build-BKtQ6OeP.js +0 -9
- package/lib/vbapm-export-4H_qDinP.js +0 -7
package/README.md
CHANGED
|
@@ -200,6 +200,46 @@ Export a previously-built package:
|
|
|
200
200
|
vba export --target xlsm
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
+
Only extract the XML files (skip VBA source export):
|
|
204
|
+
|
|
205
|
+
```txt
|
|
206
|
+
vba export --xml-only
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Only export the VBA source (skip XML extraction):
|
|
210
|
+
|
|
211
|
+
```txt
|
|
212
|
+
vba export --vba-only
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### `update`
|
|
216
|
+
|
|
217
|
+
`vba update` writes the current VBA source directly into an existing built target file (including one currently open in Excel), without going through a full build cycle.
|
|
218
|
+
|
|
219
|
+
Update VBA source in the built target:
|
|
220
|
+
|
|
221
|
+
```txt
|
|
222
|
+
vba update
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Update VBA in a specific target type:
|
|
226
|
+
|
|
227
|
+
```txt
|
|
228
|
+
vba update --target xlsm
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Update excluding dev-src, dev-dependencies, and dev-references:
|
|
232
|
+
|
|
233
|
+
```txt
|
|
234
|
+
vba update --release
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Update and leave the target open in Excel after updating:
|
|
238
|
+
|
|
239
|
+
```txt
|
|
240
|
+
vba update --open
|
|
241
|
+
```
|
|
242
|
+
|
|
203
243
|
### `run`
|
|
204
244
|
|
|
205
245
|
`vba run` is a useful utility function for running a public macro in the given workbook, passing up to 10 arguments, and if it returns a string value, outputing it to the console.
|
package/addins/build/vbapm.xlam
CHANGED
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("./installer-
|
|
1
|
+
"use strict";var e=require("./installer-DPj-zT7L.js"),r=require("./index-CBGUBgfk.js"),t=require("path");const n={".bas":"module",".cls":"class"},a={module:".bas",class:".cls"},o=/^[\p{L}_][\p{L}\p{N}\p{M}_]*$/u;exports.addSource=async function(s){const{name:d,type:i,dir:c,dev:u}=s,l=c||e.env.cwd;if(!d)throw new e.CliError(e.ErrorCode.AddNameRequired,e.dedent`
|
|
2
2
|
"name" is required with vbapm add (e.g. vbapm add Module1).
|
|
3
3
|
|
|
4
4
|
Try "vbapm help add" for more information.
|
package/lib/addin.d.ts
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";var e=require("./installer-DPj-zT7L.js"),r=require("./project-BPmPCkUS.js"),t=require("./index-CBGUBgfk.js"),i=require("./build-target-ooHNsSLD.js");require("assert"),require("./transform-build-graph-DgRrocSn.js"),require("fs"),require("./transform-target-CYhuozxP.js");var n=require("./get-target-LUoY1UWJ.js");exports.buildProject=async function(a={}){e.env.reporter.log(e.Message.BuildProjectLoading,"[1/3] Loading project...");const s=await r.loadProject(),{target:o,blankTarget:g}=n.getTarget(s,a.target),c=await r.fetchDependencies(s),d=s.packages.map(e=>{const i=r.toDependency(e);return t.isRegistryDependency(i)?`${e.id} registry+${i.registry}`:`${e.id} ${e.source}`});e.env.reporter.log(e.Message.BuildTargetBuilding,e.dedent`
|
|
2
|
+
\n[2/3] Building target "${o.type}" for "${s.manifest.name}"...
|
|
3
|
+
${d.length?`\nDependencies:\n${d.join("\n")}`:""}`),await i.buildTarget(o,{project:s,dependencies:c,blankTarget:g},a);const l=!s.hasDirtyLockfile;return e.env.reporter.log(e.Message.BuildLockfileWriting,"\n[3/3] Writing lockfile..."+(l?" (skipped, no changes)":"")),l||await r.writeLockfile(s.paths.root,s),e.join(s.paths.dir,"build",o.filename)};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";var t=require("./installer-DPj-zT7L.js"),r=require("./transform-build-graph-DgRrocSn.js");require("assert");var a=require("./load-from-project-ClF4qaC0.js"),e=require("path"),i=require("./project-BPmPCkUS.js");const o=t=>/1004/.test(t),n=(r,a)=>t.dedent`
|
|
2
|
+
Failed to build target "${r.name}", it is currently open.
|
|
3
|
+
|
|
4
|
+
Please close "${a}" and try again.
|
|
5
|
+
`;async function s(r,a){if(!await t.pathExistsExports.pathExists(a.path))throw new t.CliError(t.ErrorCode.TargetNotFound,`Target "${a.name}" not found at "${a.path}".`);const e=t.join(r.paths.staging,a.filename);try{await t.mkdirsExports.ensureDir(r.paths.staging),await i.zip(a.path,e)}catch(r){throw new t.CliError(t.ErrorCode.TargetCreateFailed,`Failed to create project for target "${a.name}".`,r)}return e}async function p(i,o,n,s={}){const{project:p,dependencies:c}=o,l=t.join(p.paths.staging,"import");await t.mkdirsExports.ensureDir(l),await t.emptyExports.emptyDir(l);const m=await a.loadFromProject(p,c,s),w=await async function(r,a){const i=await t.parallel(r.components,async r=>{const i=t.join(a,r.filename);if(await t.writeFile(i,r.code),r.binaryPath){const i=t.join(a,e.basename(r.binaryPath));if(!r.details.binary)throw new Error(`Binary data missing for component "${r.name}"`);await t.writeFile(i,r.details.binary)}return{name:r.name,path:i}});return{name:r.name,components:i,references:r.references}}(m,l);try{await r.importGraph(p,i,w,n,s)}catch(r){throw new t.CliError(t.ErrorCode.TargetImportFailed,`Failed to import project for target "${i.name}".`,r)}finally{await t.removeExports.remove(l)}}exports.buildTarget=async function(a,e,i={}){const{project:c}=e;let l;try{l=e.blankTarget?await r.createDocument(c,a,{staging:!0}):await s(c,a)}catch(r){if(!t.isRunError(r)||!r.result.errors.some(o))throw r;const e=t.join(c.paths.build,a.filename);throw new t.CliError(t.ErrorCode.TargetIsOpen,n(a,e))}await p(a,e,l,i);try{await async function(r,a){const e=t.join(r.paths.backup,a.filename),i=t.join(r.paths.build,a.filename);await t.pathExistsExports.pathExists(e)&&await t.removeExports.remove(e);if(await t.pathExistsExports.pathExists(i)){await t.mkdirsExports.ensureDir(r.paths.backup);try{await t.moveExports.move(i,e)}catch(r){throw new t.CliError(t.ErrorCode.TargetIsOpen,n(a,i))}}}(c,a);const r=t.join(c.paths.build,a.filename);await t.moveExports.move(l,r)}catch(r){throw await async function(r,a){const e=t.join(r.paths.backup,a.filename),i=t.join(r.paths.build,a.filename);if(!await t.pathExistsExports.pathExists(e))return;try{await t.copyExports.copy(e,i)}catch(r){throw new t.CliError(t.ErrorCode.TargetRestoreFailed,t.dedent`
|
|
6
|
+
Failed to automatically restore backup from "${e}" to "${i}".
|
|
7
|
+
|
|
8
|
+
The previous version can be moved back manually, if desired.
|
|
9
|
+
`,r)}}(c,a),r}finally{await t.removeExports.remove(l)}},exports.importTarget=p;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var r=require("./installer-
|
|
1
|
+
"use strict";var r=require("./installer-DPj-zT7L.js"),e=require("./init-project-9RKSVG_H.js");exports.createProject=async function(t){if(!t||!t.name)throw new r.CliError(r.ErrorCode.NewNameRequired,r.dedent`
|
|
2
2
|
"name" is required with vbapm new (e.g. vbapm new project-name).
|
|
3
3
|
|
|
4
4
|
Try "vbapm help new" for more information.
|
package/lib/errors.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ export declare enum ErrorCode {
|
|
|
47
47
|
ExportNoTarget = "export-no-target",
|
|
48
48
|
ExportNoMatching = "export-no-matching",
|
|
49
49
|
ExportTargetNotFound = "export-target-not-found",
|
|
50
|
+
ExportOptionsConflict = "export-options-conflict",
|
|
51
|
+
UpdateTargetNotBuilt = "update-target-not-built",
|
|
50
52
|
AddinUnsupportedType = "addin-unsupported-type",
|
|
51
53
|
RunMissingFile = "run-missing-file",
|
|
52
54
|
RunMissingMacro = "run-missing-macro",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var e=require("./installer-DPj-zT7L.js"),t=require("./transform-build-graph-DgRrocSn.js"),r=require("./project-BPmPCkUS.js");require("assert"),require("fs");var o=require("./export-target-C0RYJqUX.js");exports.exportProject=async function(a={}){if(a.xmlOnly&&a.vbaOnly)throw new e.CliError(e.ErrorCode.ExportOptionsConflict,"--xml-only and --vba-only are mutually exclusive.");const n=!!a.completed||!!a.xmlOnly?2:3;e.env.reporter.log(e.Message.ExportProjectLoading,`[1/${n}] Loading project...`);const i=await r.loadProject();if(!a.target&&!i.manifest.target)throw new e.CliError(e.ErrorCode.ExportNoTarget,e.dedent`
|
|
2
|
+
No default target found for project,
|
|
3
|
+
use --target TYPE to export from a specific target.
|
|
4
|
+
`);let s,l=!1;if(i.manifest.target)a.target&&a.target!==i.manifest.target.type||(s=i.manifest.target);else{const t=a.target,r=i.manifest.name;s={type:t,name:r,path:`targets/${t}`,filename:`${e.sanitize(r)}.${t}`},l=!0}if(!s)throw new e.CliError(e.ErrorCode.ExportNoMatching,`No matching target found for type "${a.target}" in project.`);const p=await r.fetchDependencies(i);let g;try{a.completed?g=a.completed:(g=e.join(i.paths.staging,"export"),await e.mkdirsExports.ensureDir(g),await e.emptyExports.emptyDir(g),a.xmlOnly||(e.env.reporter.log(e.Message.ExportToStaging,`\n[2/3] Exporting src from "${s.filename}"`),await t.exportTo(i,s,g,a))),e.env.reporter.log(e.Message.ExportToProject,`\n[${n}/${n}] Updating project`),await o.exportTarget(s,{project:i,dependencies:p,blankTarget:l},g,{xmlOnly:a.xmlOnly,vbaOnly:a.vbaOnly})}catch(e){throw e}finally{g&&await e.removeExports.remove(g)}};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var e=require("./installer-DPj-zT7L.js"),n=require("./index-CBGUBgfk.js"),t=require("path"),r=require("./load-from-project-ClF4qaC0.js"),o=require("./transform-build-graph-DgRrocSn.js");require("assert");var a=require("./project-BPmPCkUS.js"),s=require("./transform-target-CYhuozxP.js");async function i(t,r){const o=e.env.reporter.progress("Updating src files"),a=o.start,s=o.done;o.start=()=>{},o.done=()=>{},a(),await e.parallel(r.components.changed,e=>c(e.details.path,e),{progress:o}),await e.parallel(r.components.added,async n=>{const r=e.join(t.paths.dir,"src",n.filename);n.details.path=r,await c(r,n)},{progress:o}),await e.parallel(r.components.removed,async n=>{await e.removeExports.remove(n.details.path)},{progress:o}),await async function(t,r){for(const n of r.components.added){const r={name:n.name,path:e.join(t.paths.dir,`src/${n.filename}`)};t.manifest.src.push(r)}for(const e of r.components.removed){const n=t.manifest.src.findIndex(n=>n.name===e.name);t.manifest.src.splice(n,1)}for(let e of r.references.added)t.manifest.references.push(e);for(const e of r.references.removed){const n=t.manifest.references.findIndex(n=>n.name===e.name);t.manifest.references.splice(n,1)}await n.writeManifest(t.manifest,t.paths.dir)}(t,r),s()}async function c(n,r){const o=t.dirname(n);if(await e.mkdirsExports.ensureDir(o),await e.writeFile(n,r.code),r.binaryPath){if(!r.details.binary)throw new Error(`Binary data missing for component "${r.name}"`);await e.writeFile(e.join(o,r.binaryPath),r.details.binary)}}const p=[".frx"];async function m(n){const a=o.walk(n,{directories:!1}).filter(e=>"project.json"!==e&&!e.startsWith("target")&&!e.startsWith("staged")&&!(e=>!(""!==t.extname(e)))(e)).map(t=>e.join(n,t)),{name:s,references:i}=await async function(n){const t=e.join(n,"project.json");if(!await e.pathExistsExports.pathExists(t))return{name:"VBAProject",references:[]};return await e.jsonfileExports.readJson(t)}(n),c={},m=a.filter(e=>{if(!function(e){return p.includes(t.extname(e))}(e))return!0;const n=d(e);return c[n]=e,!1}),f=await e.parallel(m,async n=>{const o=d(n),a=r.extensionToType[t.extname(n)],s=await e.readFile(n),i=c[o]&&await e.readFile(c[o]);if(!a)throw new e.CliError(e.ErrorCode.ComponentUnrecognized,`Unrecognized component extension "${t.extname(n)}" (at "${n}").`);return new r.Component(a,s,{binary:i})},{progress:e.env.reporter.progress("Loading exported components")});return f.sort(r.byComponentName),{name:s,components:f,references:i,fromDependencies:{components:new Map,references:new Map}}}function d(e){return t.basename(e,t.extname(e))}async function f(n,r,o){let i=e.join(n.paths.build,r.filename);const c=e.join(o,"target");if(!await e.pathExistsExports.pathExists(i))throw new e.CliError(e.ErrorCode.ExportTargetNotFound,e.dedent`
|
|
2
|
+
Could not find built target for type "${r.type}"
|
|
3
|
+
(checked "${i}").
|
|
4
|
+
`);if(!e.env.isWindows){const n=e.join(o,"staged",r.filename);await e.pathExistsExports.pathExists(n)||(await e.mkdirsExports.ensureDir(t.dirname(n)),await e.copyExports.copy(i,n)),i=n}return await e.mkdirsExports.ensureDir(c),await a.unzip(i,c,{filter:s.filterTarget,map:s.mapTarget}),c}exports.exportTarget=async function(n,t,a,s={}){const{project:c,dependencies:p,blankTarget:d}=t,{xmlOnly:l=!1,vbaOnly:u=!1}=s;let w;if(d||u||(w=await f(c,n,a)),!l){const e=await r.loadFromProject(c,p),n=await m(a),t=function(e,n){const t={components:{added:[],changed:[],removed:[]},references:{added:[],changed:[],removed:[]}},o={components:new Map,references:new Map};for(const n of e.components)o.components.set(n.name,n);for(const n of e.references)o.references.set(n.name,n);for(const r of n.components){const n=r.name,a=o.components.get(n);o.components.delete(n),a&&e.fromDependencies.components.has(a)||(a?r.code!==a.code&&(r.details.path=a.details.path,t.components.changed.push(r)):t.components.added.push(r))}for(const e of o.components.values())t.components.removed.push(e);t.components.added.sort(r.byComponentName),t.components.changed.sort(r.byComponentName),t.components.removed.sort(r.byComponentName);for(const r of n.references){const n=r.name,a=o.references.get(n);o.references.delete(n),a&&e.fromDependencies.references.has(a)||(a?r.guid===a.guid&&r.major===a.major&&r.minor===a.minor||t.references.changed.push(r):t.references.added.push(r))}for(const e of o.references.values())t.references.removed.push(e);return t}(e,await o.toSrc(n));await i(c,t)}d||u||(await e.removeExports.remove(n.path),await e.copyExports.copy(w,n.path)),await e.removeExports.remove(a)},exports.extractTarget=f;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var t=require("./installer-
|
|
1
|
+
"use strict";var t=require("./installer-DPj-zT7L.js");exports.getTarget=function(e,r){let a,o=!1;if(r){if(e.manifest.target)e.manifest.target.type===r&&(a=e.manifest.target);else{const n=r,i=e.manifest.name;a={type:n,name:i,path:"target",filename:`${t.sanitize(i)}.${n}`},o=!0}if(!a)throw new t.CliError(t.ErrorCode.TargetNoMatching,`No matching target found for type "${r}" in project.`)}else e.manifest.target&&(a=e.manifest.target);if(!a)throw new t.CliError(t.ErrorCode.TargetNoDefault,t.dedent`
|
|
2
2
|
No default target found for project.
|
|
3
3
|
|
|
4
4
|
Use --target TYPE for a blank target
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,r,n=require("./_commonjsHelpers-Bjf42z7h.js");var t=function(){if(r)return e;r=1;var n=["h","min","s","ms","μs","ns"],t=["hour","minute","second","millisecond","microsecond","nanosecond"],o=[3600,60,1,1e6,1e3,1];return e=function(e,r){var s,i,u,a,c,f,m,l,p;if(s=!1,i=!1,r&&(s=r.verbose||!1,i=r.precise||!1),!Array.isArray(e)||2!==e.length)return"";if("number"!=typeof e[0]||"number"!=typeof e[1])return"";for(e[1]<0&&(p=e[0]+e[1]/1e9,e[0]=parseInt(p),e[1]=1e9*parseFloat((p%1).toPrecision(9))),l="",u=0;u<6&&(a=e[u<3?0:1],3!==u&&0!==u&&(a%=o[u-1]),2===u&&(a+=e[1]/1e9),!((c=a/o[u])>=1)||(s&&(c=Math.floor(c)),i?m=c.toString():(f=c>=10?0:2,m=c.toFixed(f)),m.indexOf(".")>-1&&"0"===m[m.length-1]&&(m=m.replace(/\.?0+$/,"")),l&&(l+=" "),l+=m,s?(l+=" "+t[u],"1"!==m&&(l+="s")):l+=" "+n[u],s));u++);return l}}(),o=n.getDefaultExportFromCjs(t);exports.time=o;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var e=require("./installer-
|
|
1
|
+
"use strict";var e=require("./installer-DPj-zT7L.js"),t=require("path");async function n(e){const{parse:t}=await Promise.resolve().then(function(){return require("./toml-patch-r8oqFm0h.js")});return t(e)}const r='Example vbaproject.toml:\n\n [dependencies]\n a = "^1.0.0"\n b = { version = "^0.1.0" }\n c = { path = "packages/c" }\n d = { git = "https://github.com/author/d" }\n e = { git = "https://github.com/author/e", branch = "next" }\n f = { git = "https://github.com/author/f", tag = "v1.0.0" }\n g = { git = "https://github.com/author/g", rev = "a1b2c3d4" }\n\n [dependencies.h]\n version = "^2.0.0"';function a(n,a){return Object.entries(n).map(([n,i])=>function(n,a,i){e.isString(a)&&(a={version:a});let{registry:s="vba-blocks",version:o,path:c,git:p,tag:l,branch:u="master",rev:m}=a;return e.manifestOk(o||c||p,`Invalid dependency <${n}>, no version, path, or git specified. \n\n${r}`),o?{name:n,registry:s,version:o}:c?{name:n,path:e.trailing(e.join(i,c))}:(p=function(e){return".git"===t.extname(e)?e:`${e}.git`}(p),m?{name:n,git:p,rev:m}:l?{name:n,git:p,tag:l}:{name:n,git:p,branch:u})}(n,i,a))}function i(t){return e.has(t,"registry")}function s(t){return e.has(t,"path")}function o(t,n){const r={};return t.forEach(t=>{if(i(t)){const{name:e,registry:n,version:a}=t;r[e]="vba-blocks"!==n?{version:a,registry:n}:a}else if(s(t)){let{name:a,path:i}=t;i=e.relative(n,i),r[a]={path:i}}else{const{name:e,git:n,tag:a,branch:i,rev:s}=t;r[e]={name:e,git:n},a&&(r[e].tag=a),i&&(r[e].branch=i),s&&(r[e].rev=s)}}),r}const c=/^(\d+)\.(\d+)$/,p=/\{.{8}-.{4}-.{4}-.{4}-.{12}\}/,l=e=>parseInt(e,10),u='Example vbaproject.toml:\n\n [references.Scripting]\n version = "1.0"\n guid = "{420B2830-E718-11CF-893D-00A0C9054228}"';function m(t){return Object.entries(t).map(([t,n])=>function(t,n){const{version:r,guid:a}=n;e.manifestOk((e=>c.test(e))(r),`Reference <${t}> has an invalid version <${r}>. \n\n${u}.`),e.manifestOk((e=>p.test(e))(a),`Reference <${t}> has an invalid guid <${a}>. \n\n${u}.`);const{major:i,minor:s}=(e=>{const[t,n]=e.split(".",2).map(l);return{major:t,minor:n}})(r);return{name:t,guid:a,major:i,minor:s}}(t,n))}function d(e){const t={};return e.forEach(e=>{const{name:n,guid:r,major:a,minor:i}=e,s=`${a}.${i}`;t[n]={version:s,guid:r}}),t}const f='Example vbaproject.toml:\n\n [src]\n A = "src/a.bas"\n B = { path = "src/b.cls" }',g=/^(bas|cls|frm|doccls)$/i;function h(t,n){return Object.entries(t).map(([t,r])=>function(t,n,r){e.isString(n)&&(n={path:n});const{path:a,binary:i}=n;if(!a){const r=Object.keys(n).find(e=>g.test(e));r&&e.manifestOk(!1,e.dedent`
|
|
2
2
|
src key <${t}.${r}> should not include the file extension.
|
|
3
3
|
You want to use a <${t}> instead.
|
|
4
|
-
`)}e.manifestOk(a,`src <${t}> is missing path. \n\n${f}`);const s=e.join(r,a),o={name:t,path:s};i&&(o.binary=e.join(r,i));return o}(t,r,n))}function v(t,n){const r={};return t.forEach(t=>{let{name:a,path:i}=t;i=e.relative(n,i),r[a]=i}),r}const
|
|
4
|
+
`)}e.manifestOk(a,`src <${t}> is missing path. \n\n${f}`);const s=e.join(r,a),o={name:t,path:s};i&&(o.binary=e.join(r,i));return o}(t,r,n))}function v(t,n){const r={};return t.forEach(t=>{let{name:a,path:i}=t;i=e.relative(n,i),r[a]=i}),r}const b=["xlsx","xlsm","xlam"];function j(t,n,r){e.isString(t)&&(t={type:t}),e.has(t,"name")||(t={name:n,...t});const{type:a,name:i,path:s="target"}=t;e.manifestOk(e.isString(a),'Target is missing <type>. \n\nExample vbaproject.toml:\n\n [project]\n target = "xlsm"\n\nExample vbaproject.toml with alternative path:\n\n [project]\n target = { type = "xlsm", path = "target/xlsm" }.'),e.manifestOk(function(t){return e.isString(t)&&b.includes(t)}(a),`Unsupported target type <${a}>. Only <xlsx>, <xlsm>, and <xlam> are supported currently.`);return{name:i,type:a,path:e.join(r,s),filename:`${e.sanitize(i)}.${a}`}}const y="UNVERSIONED",$='Example vbaproject.toml for a package (e.g. library to be shared):\n\n [package]\n name = "my-package"\n version = "0.0.0"\n authors = ["..."]\n\nExample vbaproject.toml for a project (e.g. workbook, document, etc.):\n\n [project]\n name = "my-project"\n target = "xlsm"';function x(t,n){let r,i,s,o,c,p;e.manifestOk(t&&(t.package||t.project),`A [package] or [project] section is required. \n\n${$}`);let l={};if(t.project){const{name:a,version:u,authors:m,publish:d,target:f,...g}=t.project;r="project",i=a,s=u||y,o=m,c=d,l=g,e.manifestOk(i,`[project] name is a required field. \n\n${$}`),e.manifestOk(t.project.target,`[project] target is a required field. \n\n${$}`),p=j(f,i,n)}else{const{name:a,version:u,authors:m,publish:d,target:f,...g}=t.package;r="package",i=a,s=u,o=m,c=d,l=g,e.manifestOk(i,`[package] name is a required field. \n\n${$}`),e.manifestOk(s,`[package] version is a required field. \n\n${$}`),e.manifestOk(o,`[package] authors is a required field. \n\n${$}`),p=f&&j(f,i,n)}const u=h(t.src||{},n),d=a(t.dependencies||{},n),f=m(t.references||{}),g=h(t["dev-src"]||{},n),v=a(t["dev-dependencies"]||{},n),b=m(t["dev-references"]||{});return{type:r,name:i,version:s,metadata:{authors:o,publish:c,...l},src:u,dependencies:d,references:f,devSrc:g,devDependencies:v,devReferences:b,target:p}}exports.isGitDependency=function(t){return e.has(t,"git")},exports.isPathDependency=s,exports.isRegistryDependency=i,exports.loadManifest=async function(t){let r=e.join(t,"vbaproject.toml");if(!await e.pathExistsExports.pathExists(r)){const n=e.join(t,"vba-block.toml");if(!await e.pathExistsExports.pathExists(n))throw new e.CliError(e.ErrorCode.ManifestNotFound,e.dedent`
|
|
5
5
|
vbaproject.toml not found in "${t}".
|
|
6
6
|
|
|
7
7
|
Try "vbapm init" to start a new project in this directory
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
vbaproject.toml is invalid:
|
|
11
11
|
|
|
12
12
|
Syntax Error: ${r} (${null==t?void 0:t.line}:${null==t?void 0:t.column})\n\n${(null==t?void 0:t.message)||t}
|
|
13
|
-
`)}return x(i,e.normalize(t))},exports.parse=n,exports.parseManifest=x,exports.toLockfile=function t(n,r=0){if(e.isString(n))return`"${n}"`;if(e.isNumber(n))return`${n}`;if(e.isBoolean(n))return n?"true":"false";if(e.isDate(n))return n.toISOString();if(e.isObject(n)){let e="";if(0===r)for(const[a,i]of Object.entries(n))Array.isArray(i)?i.forEach(n=>{e+=`[[${a}]]\n${t(n,r+1)}\n`}):e+=`[${a}]\n${t(i,r+1)}\n`;else if(1===r)for(const[a,i]of Object.entries(n))if(Array.isArray(i)){const n=0===i.length;e+=`${a} = [\n`,e+=i.map(e=>` ${t(e,r+1)}`).join(",\n"),e+=n?"]\n":",\n]\n"}else e+=`${a} = ${t(i,r+1)}\n`;return e}throw new Error("Unsupported type passed to toLockfile. Only String, Number, Boolean, Date, Array, and Object are supported")},exports.writeManifest=async function(t,n){const r=function(t,n){const{type:r,name:a,version:i,metadata:{authors:s,publish:c,...p}}=t,
|
|
13
|
+
`)}return x(i,e.normalize(t))},exports.parse=n,exports.parseManifest=x,exports.toLockfile=function t(n,r=0){if(e.isString(n))return`"${n}"`;if(e.isNumber(n))return`${n}`;if(e.isBoolean(n))return n?"true":"false";if(e.isDate(n))return n.toISOString();if(e.isObject(n)){let e="";if(0===r)for(const[a,i]of Object.entries(n))Array.isArray(i)?i.forEach(n=>{e+=`[[${a}]]\n${t(n,r+1)}\n`}):e+=`[${a}]\n${t(i,r+1)}\n`;else if(1===r)for(const[a,i]of Object.entries(n))if(Array.isArray(i)){const n=0===i.length;e+=`${a} = [\n`,e+=i.map(e=>` ${t(e,r+1)}`).join(",\n"),e+=n?"]\n":",\n]\n"}else e+=`${a} = ${t(i,r+1)}\n`;return e}throw new Error("Unsupported type passed to toLockfile. Only String, Number, Boolean, Date, Array, and Object are supported")},exports.writeManifest=async function(t,n){const r=function(t,n){const{type:r,name:a,version:i,metadata:{authors:s,publish:c,...p}}=t,l={name:a};i!==y&&(l.version=i);null!=s&&(l.authors=s);null!=c&&(l.publish=c);Object.assign(l,p);const u={[r]:l};t.target&&(u[r].target=function(t,n,r){let a,{name:i,type:s,path:o}=t;return o=e.relative(r,o),i!==n||"target"!==o?(a={type:s},i!==n&&(a.name=i),"target"!==o&&(a.path=o)):a=s,a}(t.target,t.name,n));u.src=v(t.src,n),t.dependencies.length&&(u.dependencies=o(t.dependencies,n));t.references.length&&(u.references=d(t.references));t.devSrc.length&&(u["dev-src"]=v(t.devSrc,n));t.devDependencies.length&&(u["dev-dependencies"]=o(t.devDependencies,n));t.devReferences.length&&(u["dev-references"]=d(t.devReferences));return u}(t,n),a=e.join(n,"vbaproject.toml");let i;if(await e.pathExistsExports.pathExists(a)){const t=await e.readFile(a,"utf8");i=await async function(e,t){const{patch:n}=await Promise.resolve().then(function(){return require("./toml-patch-r8oqFm0h.js")});return n(e,t)}(t,r)}else i=await async function(e){const{stringify:t}=await Promise.resolve().then(function(){return require("./toml-patch-r8oqFm0h.js")});return t(e)}(r);await e.writeFile(a,i)};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var t=require("./_commonjsHelpers-Bjf42z7h.js"),e=require("./index-CEojr58e.js"),i=require("./index-BlteXxjY.js"),r=require("./crc32-Cc3OMFYk.js"),a=require("./installer-C0iBwEpK.js");function n(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(i){if("default"!==i&&!(i in t)){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}})}),Object.freeze(t)}var s,o,c,f,d,h,l,u,g={};function w(){if(o)return s;o=1;var t=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if("undefined"==typeof process||void 0===process.domain)throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||t.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||t.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||t.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=t.DEFAULT_MAX_PENDING};return t.DEFAULT_TIMEOUT=0,t.DEFAULT_MAX_OCCUPATION_TIME=0,t.DEFAULT_MAX_EXECUTION_TIME=0,t.DEFAULT_MAX_PENDING=1e3,t.prototype.acquire=function(t,e,i,r){if(Array.isArray(t))return this._acquireBatch(t,e,i,r);if("function"!=typeof e)throw new Error("You must pass a function to execute");var a=null,n=null,s=null;"function"!=typeof i&&(r=i,i=null,s=new this.Promise(function(t,e){a=t,n=e})),r=r||{};var o=!1,c=null,f=null,d=null,h=this,l=function(e,r,c){f&&(clearTimeout(f),f=null),d&&(clearTimeout(d),d=null),e&&(h.queues[t]&&0===h.queues[t].length&&delete h.queues[t],h.domainReentrant&&delete h.domains[t]),o||(s?r?n(r):a(c):"function"==typeof i&&i(r,c),o=!0),e&&h.queues[t]&&h.queues[t].length>0&&h.queues[t].shift()()},u=function(i){if(o)return l(i);c&&(clearTimeout(c),c=null),h.domainReentrant&&i&&(h.domains[t]=process.domain);var a=r.maxExecutionTime||h.maxExecutionTime;if(a&&(d=setTimeout(function(){h.queues[t]&&l(i,new Error("Maximum execution time is exceeded "+t))},a)),1===e.length){var n=!1;try{e(function(t,e){n||(n=!0,l(i,t,e))})}catch(t){n||(n=!0,l(i,t))}}else h._promiseTry(function(){return e()}).then(function(t){l(i,void 0,t)},function(t){l(i,t)})};h.domainReentrant&&process.domain&&(u=process.domain.bind(u));var g=r.maxPending||h.maxPending;if(h.queues[t])if(h.domainReentrant&&process.domain&&process.domain===h.domains[t])u(!1);else if(h.queues[t].length>=g)l(!1,new Error("Too many pending tasks in queue "+t));else{var w=function(){u(!0)};r.skipQueue?h.queues[t].unshift(w):h.queues[t].push(w);var p=r.timeout||h.timeout;p&&(c=setTimeout(function(){c=null,l(!1,new Error("async-lock timed out in queue "+t))},p))}else h.queues[t]=[],u(!0);var m=r.maxOccupationTime||h.maxOccupationTime;return m&&(f=setTimeout(function(){h.queues[t]&&l(!1,new Error("Maximum occupation time is exceeded in queue "+t))},m)),s||void 0},t.prototype._acquireBatch=function(t,e,i,r){"function"!=typeof i&&(r=i,i=null);var a=this,n=t.reduceRight(function(t,e){return function(t,e){return function(i){a.acquire(t,e,i,r)}}(e,t)},e);if("function"!=typeof i)return new this.Promise(function(t,e){1===n.length?n(function(i,r){i?e(i):t(r)}):t(n())});n(i)},t.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0},t.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(t){return this.Promise.reject(t)}},s=t}function p(){if(u)return l;u=1;var t=e.requireInherits(),r=function(){if(h)return d;h=1;var t=e.requireSafeBuffer().Buffer,r=i.requireToBuffer();function a(e,i){this._block=t.alloc(e),this._finalSize=i,this._blockSize=e,this._len=0}return a.prototype.update=function(t,e){t=r(t,e||"utf8");for(var i=this._block,a=this._blockSize,n=t.length,s=this._len,o=0;o<n;){for(var c=s%a,f=Math.min(n-o,a-c),d=0;d<f;d++)i[c+d]=t[o+d];o+=f,(s+=f)%a===0&&this._update(i)}return this._len+=n,this},a.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var r=(4294967295&i)>>>0,a=(i-r)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var n=this._hash();return t?n.toString(t):n},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},d=a}(),a=e.requireSafeBuffer().Buffer,n=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function o(){this.init(),this._w=s,r.call(this,64,56)}function c(t){return t<<1|t>>>31}function f(t){return t<<5|t>>>27}function g(t){return t<<30|t>>>2}function w(t,e,i,r){return 0===t?e&i|~e&r:2===t?e&i|e&r|i&r:e^i^r}return t(o,r),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(t){for(var e=this._w,i=0|this._a,r=0|this._b,a=0|this._c,s=0|this._d,o=0|this._e,d=0;d<16;++d)e[d]=t.readInt32BE(4*d);for(;d<80;++d)e[d]=c(e[d-3]^e[d-8]^e[d-14]^e[d-16]);for(var h=0;h<80;++h){var l=~~(h/20),u=f(i)+w(l,r,a,s)+o+e[h]+n[l]|0;o=s,s=a,a=g(r),r=i,i=u}this._a=i+this._a|0,this._b=r+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0},o.prototype._hash=function(){var t=a.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},l=o}var m,y={};function b(){return m||(m=1,function(t){var e="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var a in r)i(r,a)&&(t[a]=r[a])}}return t},t.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,i,r,a){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+r),a);else for(var n=0;n<r;n++)t[a+n]=e[i+n]},flattenChunks:function(t){var e,i,r,a,n,s;for(r=0,e=0,i=t.length;e<i;e++)r+=t[e].length;for(s=new Uint8Array(r),a=0,e=0,i=t.length;e<i;e++)n=t[e],s.set(n,a),a+=n.length;return s}},a={arraySet:function(t,e,i,r,a){for(var n=0;n<r;n++)t[a+n]=e[i+n]},flattenChunks:function(t){return[].concat.apply([],t)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,r)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,a))},t.setTyped(e)}(y)),y}var _,v,x,k,E,$,S,B,A={},R={},P={};function j(){if(_)return P;_=1;var t=b();function e(t){for(var e=t.length;--e>=0;)t[e]=0}var i=256,r=286,a=30,n=15,s=[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],o=[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],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=new Array(576);e(d);var h=new Array(60);e(h);var l=new Array(512);e(l);var u=new Array(256);e(u);var g=new Array(29);e(g);var w,p,m,y=new Array(a);function v(t,e,i,r,a){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=r,this.max_length=a,this.has_stree=t&&t.length}function x(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function k(t){return t<256?l[t]:l[256+(t>>>7)]}function E(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function $(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,E(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function S(t,e,i){$(t,i[2*e],i[2*e+1])}function B(t,e){var i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1}function A(t,e,i){var r,a,s=new Array(16),o=0;for(r=1;r<=n;r++)s[r]=o=o+i[r-1]<<1;for(a=0;a<=e;a++){var c=t[2*a+1];0!==c&&(t[2*a]=B(s[c]++,c))}}function R(t){var e;for(e=0;e<r;e++)t.dyn_ltree[2*e]=0;for(e=0;e<a;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function j(t){t.bi_valid>8?E(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function O(t,e,i,r){var a=2*e,n=2*i;return t[a]<t[n]||t[a]===t[n]&&r[e]<=r[i]}function I(t,e,i){for(var r=t.heap[i],a=i<<1;a<=t.heap_len&&(a<t.heap_len&&O(e,t.heap[a+1],t.heap[a],t.depth)&&a++,!O(e,r,t.heap[a],t.depth));)t.heap[i]=t.heap[a],i=a,a<<=1;t.heap[i]=r}function C(t,e,r){var a,n,c,f,d=0;if(0!==t.last_lit)do{a=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],n=t.pending_buf[t.l_buf+d],d++,0===a?S(t,n,e):(S(t,(c=u[n])+i+1,e),0!==(f=s[c])&&$(t,n-=g[c],f),S(t,c=k(--a),r),0!==(f=o[c])&&$(t,a-=y[c],f))}while(d<t.last_lit);S(t,256,e)}function z(t,e){var i,r,a,s=e.dyn_tree,o=e.stat_desc.static_tree,c=e.stat_desc.has_stree,f=e.stat_desc.elems,d=-1;for(t.heap_len=0,t.heap_max=573,i=0;i<f;i++)0!==s[2*i]?(t.heap[++t.heap_len]=d=i,t.depth[i]=0):s[2*i+1]=0;for(;t.heap_len<2;)s[2*(a=t.heap[++t.heap_len]=d<2?++d:0)]=1,t.depth[a]=0,t.opt_len--,c&&(t.static_len-=o[2*a+1]);for(e.max_code=d,i=t.heap_len>>1;i>=1;i--)I(t,s,i);a=f;do{i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],I(t,s,1),r=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=r,s[2*a]=s[2*i]+s[2*r],t.depth[a]=(t.depth[i]>=t.depth[r]?t.depth[i]:t.depth[r])+1,s[2*i+1]=s[2*r+1]=a,t.heap[1]=a++,I(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,r,a,s,o,c,f=e.dyn_tree,d=e.max_code,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,g=e.stat_desc.extra_base,w=e.stat_desc.max_length,p=0;for(s=0;s<=n;s++)t.bl_count[s]=0;for(f[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)(s=f[2*f[2*(r=t.heap[i])+1]+1]+1)>w&&(s=w,p++),f[2*r+1]=s,r>d||(t.bl_count[s]++,o=0,r>=g&&(o=u[r-g]),c=f[2*r],t.opt_len+=c*(s+o),l&&(t.static_len+=c*(h[2*r+1]+o)));if(0!==p){do{for(s=w-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[w]--,p-=2}while(p>0);for(s=w;0!==s;s--)for(r=t.bl_count[s];0!==r;)(a=t.heap[--i])>d||(f[2*a+1]!==s&&(t.opt_len+=(s-f[2*a+1])*f[2*a],f[2*a+1]=s),r--)}}(t,e),A(s,d,t.bl_count)}function D(t,e,i){var r,a,n=-1,s=e[1],o=0,c=7,f=4;for(0===s&&(c=138,f=3),e[2*(i+1)+1]=65535,r=0;r<=i;r++)a=s,s=e[2*(r+1)+1],++o<c&&a===s||(o<f?t.bl_tree[2*a]+=o:0!==a?(a!==n&&t.bl_tree[2*a]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,n=a,0===s?(c=138,f=3):a===s?(c=6,f=3):(c=7,f=4))}function T(t,e,i){var r,a,n=-1,s=e[1],o=0,c=7,f=4;for(0===s&&(c=138,f=3),r=0;r<=i;r++)if(a=s,s=e[2*(r+1)+1],!(++o<c&&a===s)){if(o<f)do{S(t,a,t.bl_tree)}while(0!==--o);else 0!==a?(a!==n&&(S(t,a,t.bl_tree),o--),S(t,16,t.bl_tree),$(t,o-3,2)):o<=10?(S(t,17,t.bl_tree),$(t,o-3,3)):(S(t,18,t.bl_tree),$(t,o-11,7));o=0,n=a,0===s?(c=138,f=3):a===s?(c=6,f=3):(c=7,f=4)}}e(y);var U=!1;function N(e,i,r,a){$(e,0+(a?1:0),3),function(e,i,r){j(e),E(e,r),E(e,~r),t.arraySet(e.pending_buf,e.window,i,r,e.pending),e.pending+=r}(e,i,r)}return P._tr_init=function(t){U||(!function(){var t,e,i,f,b,_=new Array(16);for(i=0,f=0;f<28;f++)for(g[f]=i,t=0;t<1<<s[f];t++)u[i++]=f;for(u[i-1]=f,b=0,f=0;f<16;f++)for(y[f]=b,t=0;t<1<<o[f];t++)l[b++]=f;for(b>>=7;f<a;f++)for(y[f]=b<<7,t=0;t<1<<o[f]-7;t++)l[256+b++]=f;for(e=0;e<=n;e++)_[e]=0;for(t=0;t<=143;)d[2*t+1]=8,t++,_[8]++;for(;t<=255;)d[2*t+1]=9,t++,_[9]++;for(;t<=279;)d[2*t+1]=7,t++,_[7]++;for(;t<=287;)d[2*t+1]=8,t++,_[8]++;for(A(d,287,_),t=0;t<a;t++)h[2*t+1]=5,h[2*t]=B(t,5);w=new v(d,s,257,r,n),p=new v(h,o,0,a,n),m=new v(new Array(0),c,0,19,7)}(),U=!0),t.l_desc=new x(t.dyn_ltree,w),t.d_desc=new x(t.dyn_dtree,p),t.bl_desc=new x(t.bl_tree,m),t.bi_buf=0,t.bi_valid=0,R(t)},P._tr_stored_block=N,P._tr_flush_block=function(t,e,r,a){var n,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<i;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),z(t,t.l_desc),z(t,t.d_desc),o=function(t){var e;for(D(t,t.dyn_ltree,t.l_desc.max_code),D(t,t.dyn_dtree,t.d_desc.max_code),z(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*f[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=n&&(n=s)):n=s=r+5,r+4<=n&&-1!==e?N(t,e,r,a):4===t.strategy||s===n?($(t,2+(a?1:0),3),C(t,d,h)):($(t,4+(a?1:0),3),function(t,e,i,r){var a;for($(t,e-257,5),$(t,i-1,5),$(t,r-4,4),a=0;a<r;a++)$(t,t.bl_tree[2*f[a]+1],3);T(t,t.dyn_ltree,e-1),T(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),C(t,t.dyn_ltree,t.dyn_dtree)),R(t),a&&j(t)},P._tr_tally=function(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(u[r]+i+1)]++,t.dyn_dtree[2*k(e)]++),t.last_lit===t.lit_bufsize-1},P._tr_align=function(t){$(t,2,3),S(t,256,d),function(t){16===t.bi_valid?(E(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)},P}function O(){if(x)return v;return x=1,v=function(t,e,i,r){for(var a=65535&t,n=t>>>16&65535,s=0;0!==i;){i-=s=i>2e3?2e3:i;do{n=n+(a=a+e[r++]|0)|0}while(--s);a%=65521,n%=65521}return a|n<<16}}function I(){if(E)return k;E=1;var t=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();return k=function(e,i,r,a){var n=t,s=a+r;e^=-1;for(var o=a;o<s;o++)e=e>>>8^n[255&(e^i[o])];return-1^e}}function C(){return S?$:(S=1,$={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"})}function z(){if(B)return R;B=1;var t,e=b(),i=j(),r=O(),a=I(),n=C(),s=-2,o=258,c=262,f=103,d=113,h=666;function l(t,e){return t.msg=n[e],e}function u(t){return(t<<1)-(t>4?9:0)}function g(t){for(var e=t.length;--e>=0;)t[e]=0}function w(t){var i=t.state,r=i.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(e.arraySet(t.output,i.pending_buf,i.pending_out,r,t.next_out),t.next_out+=r,i.pending_out+=r,t.total_out+=r,t.avail_out-=r,i.pending-=r,0===i.pending&&(i.pending_out=0))}function p(t,e){i._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,w(t.strm)}function m(t,e){t.pending_buf[t.pending++]=e}function y(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function _(t,i,n,s){var o=t.avail_in;return o>s&&(o=s),0===o?0:(t.avail_in-=o,e.arraySet(i,t.input,t.next_in,o,n),1===t.state.wrap?t.adler=r(t.adler,i,o,n):2===t.state.wrap&&(t.adler=a(t.adler,i,o,n)),t.next_in+=o,t.total_in+=o,o)}function v(t,e){var i,r,a=t.max_chain_length,n=t.strstart,s=t.prev_length,f=t.nice_match,d=t.strstart>t.w_size-c?t.strstart-(t.w_size-c):0,h=t.window,l=t.w_mask,u=t.prev,g=t.strstart+o,w=h[n+s-1],p=h[n+s];t.prev_length>=t.good_match&&(a>>=2),f>t.lookahead&&(f=t.lookahead);do{if(h[(i=e)+s]===p&&h[i+s-1]===w&&h[i]===h[n]&&h[++i]===h[n+1]){n+=2,i++;do{}while(h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&n<g);if(r=o-(g-n),n=g-o,r>s){if(t.match_start=e,s=r,r>=f)break;w=h[n+s-1],p=h[n+s]}}}while((e=u[e&l])>d&&0!==--a);return s<=t.lookahead?s:t.lookahead}function x(t){var i,r,a,n,s,o=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=o+(o-c)){e.arraySet(t.window,t.window,o,o,0),t.match_start-=o,t.strstart-=o,t.block_start-=o,i=r=t.hash_size;do{a=t.head[--i],t.head[i]=a>=o?a-o:0}while(--r);i=r=o;do{a=t.prev[--i],t.prev[i]=a>=o?a-o:0}while(--r);n+=o}if(0===t.strm.avail_in)break;if(r=_(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+3-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<c&&0!==t.strm.avail_in)}function k(t,e){for(var r,a;;){if(t.lookahead<c){if(x(t),t.lookahead<c&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-c&&(t.match_length=v(t,r)),t.match_length>=3)if(a=i._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else a=i._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(a&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}function E(t,e){for(var r,a,n;;){if(t.lookahead<c){if(x(t),t.lookahead<c&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-c&&(t.match_length=v(t,r),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,a=i._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,a&&(p(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((a=i._tr_tally(t,0,t.window[t.strstart-1]))&&p(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(a=i._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}function $(t,e,i,r,a){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=r,this.func=a}function S(){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=8,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 e.Buf16(1146),this.dyn_dtree=new e.Buf16(122),this.bl_tree=new e.Buf16(78),g(this.dyn_ltree),g(this.dyn_dtree),g(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(16),this.heap=new e.Buf16(573),g(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(573),g(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 A(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:d,t.adler=2===e.wrap?0:1,e.last_flush=0,i._tr_init(e),0):l(t,s)}function P(e){var i,r=A(e);return 0===r&&((i=e.state).window_size=2*i.w_size,g(i.head),i.max_lazy_match=t[i.level].max_lazy,i.good_match=t[i.level].good_length,i.nice_match=t[i.level].nice_length,i.max_chain_length=t[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=2,i.match_available=0,i.ins_h=0),r}function z(t,i,r,a,n,o){if(!t)return s;var c=1;if(-1===i&&(i=6),a<0?(c=0,a=-a):a>15&&(c=2,a-=16),n<1||n>9||8!==r||a<8||a>15||i<0||i>9||o<0||o>4)return l(t,s);8===a&&(a=9);var f=new S;return t.state=f,f.strm=t,f.wrap=c,f.gzhead=null,f.w_bits=a,f.w_size=1<<f.w_bits,f.w_mask=f.w_size-1,f.hash_bits=n+7,f.hash_size=1<<f.hash_bits,f.hash_mask=f.hash_size-1,f.hash_shift=~~((f.hash_bits+3-1)/3),f.window=new e.Buf8(2*f.w_size),f.head=new e.Buf16(f.hash_size),f.prev=new e.Buf16(f.w_size),f.lit_bufsize=1<<n+6,f.pending_buf_size=4*f.lit_bufsize,f.pending_buf=new e.Buf8(f.pending_buf_size),f.d_buf=1*f.lit_bufsize,f.l_buf=3*f.lit_bufsize,f.level=i,f.strategy=o,f.method=r,P(t)}return t=[new $(0,0,0,0,function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(x(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+i;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,p(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-c&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(p(t,!1),t.strm.avail_out),1)}),new $(4,4,8,4,k),new $(4,5,16,8,k),new $(4,6,32,32,k),new $(4,4,16,16,E),new $(8,16,32,32,E),new $(8,16,128,128,E),new $(8,32,128,256,E),new $(32,128,258,1024,E),new $(32,258,258,4096,E)],R.deflateInit=function(t,e){return z(t,e,8,15,8,0)},R.deflateInit2=z,R.deflateReset=P,R.deflateResetKeep=A,R.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?s:(t.state.gzhead=e,0):s},R.deflate=function(e,r){var n,c,b,_;if(!e||!e.state||r>5||r<0)return e?l(e,s):s;if(c=e.state,!e.output||!e.input&&0!==e.avail_in||c.status===h&&4!==r)return l(e,0===e.avail_out?-5:s);if(c.strm=e,n=c.last_flush,c.last_flush=r,42===c.status)if(2===c.wrap)e.adler=0,m(c,31),m(c,139),m(c,8),c.gzhead?(m(c,(c.gzhead.text?1:0)+(c.gzhead.hcrc?2:0)+(c.gzhead.extra?4:0)+(c.gzhead.name?8:0)+(c.gzhead.comment?16:0)),m(c,255&c.gzhead.time),m(c,c.gzhead.time>>8&255),m(c,c.gzhead.time>>16&255),m(c,c.gzhead.time>>24&255),m(c,9===c.level?2:c.strategy>=2||c.level<2?4:0),m(c,255&c.gzhead.os),c.gzhead.extra&&c.gzhead.extra.length&&(m(c,255&c.gzhead.extra.length),m(c,c.gzhead.extra.length>>8&255)),c.gzhead.hcrc&&(e.adler=a(e.adler,c.pending_buf,c.pending,0)),c.gzindex=0,c.status=69):(m(c,0),m(c,0),m(c,0),m(c,0),m(c,0),m(c,9===c.level?2:c.strategy>=2||c.level<2?4:0),m(c,3),c.status=d);else{var v=8+(c.w_bits-8<<4)<<8;v|=(c.strategy>=2||c.level<2?0:c.level<6?1:6===c.level?2:3)<<6,0!==c.strstart&&(v|=32),v+=31-v%31,c.status=d,y(c,v),0!==c.strstart&&(y(c,e.adler>>>16),y(c,65535&e.adler)),e.adler=1}if(69===c.status)if(c.gzhead.extra){for(b=c.pending;c.gzindex<(65535&c.gzhead.extra.length)&&(c.pending!==c.pending_buf_size||(c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),w(e),b=c.pending,c.pending!==c.pending_buf_size));)m(c,255&c.gzhead.extra[c.gzindex]),c.gzindex++;c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),c.gzindex===c.gzhead.extra.length&&(c.gzindex=0,c.status=73)}else c.status=73;if(73===c.status)if(c.gzhead.name){b=c.pending;do{if(c.pending===c.pending_buf_size&&(c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),w(e),b=c.pending,c.pending===c.pending_buf_size)){_=1;break}_=c.gzindex<c.gzhead.name.length?255&c.gzhead.name.charCodeAt(c.gzindex++):0,m(c,_)}while(0!==_);c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),0===_&&(c.gzindex=0,c.status=91)}else c.status=91;if(91===c.status)if(c.gzhead.comment){b=c.pending;do{if(c.pending===c.pending_buf_size&&(c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),w(e),b=c.pending,c.pending===c.pending_buf_size)){_=1;break}_=c.gzindex<c.gzhead.comment.length?255&c.gzhead.comment.charCodeAt(c.gzindex++):0,m(c,_)}while(0!==_);c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),0===_&&(c.status=f)}else c.status=f;if(c.status===f&&(c.gzhead.hcrc?(c.pending+2>c.pending_buf_size&&w(e),c.pending+2<=c.pending_buf_size&&(m(c,255&e.adler),m(c,e.adler>>8&255),e.adler=0,c.status=d)):c.status=d),0!==c.pending){if(w(e),0===e.avail_out)return c.last_flush=-1,0}else if(0===e.avail_in&&u(r)<=u(n)&&4!==r)return l(e,-5);if(c.status===h&&0!==e.avail_in)return l(e,-5);if(0!==e.avail_in||0!==c.lookahead||0!==r&&c.status!==h){var k=2===c.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(x(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=i._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(c,r):3===c.strategy?function(t,e){for(var r,a,n,s,c=t.window;;){if(t.lookahead<=o){if(x(t),t.lookahead<=o&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(a=c[n=t.strstart-1])===c[++n]&&a===c[++n]&&a===c[++n]){s=t.strstart+o;do{}while(a===c[++n]&&a===c[++n]&&a===c[++n]&&a===c[++n]&&a===c[++n]&&a===c[++n]&&a===c[++n]&&a===c[++n]&&n<s);t.match_length=o-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=i._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=i._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(c,r):t[c.level].func(c,r);if(3!==k&&4!==k||(c.status=h),1===k||3===k)return 0===e.avail_out&&(c.last_flush=-1),0;if(2===k&&(1===r?i._tr_align(c):5!==r&&(i._tr_stored_block(c,0,0,!1),3===r&&(g(c.head),0===c.lookahead&&(c.strstart=0,c.block_start=0,c.insert=0))),w(e),0===e.avail_out))return c.last_flush=-1,0}return 4!==r?0:c.wrap<=0?1:(2===c.wrap?(m(c,255&e.adler),m(c,e.adler>>8&255),m(c,e.adler>>16&255),m(c,e.adler>>24&255),m(c,255&e.total_in),m(c,e.total_in>>8&255),m(c,e.total_in>>16&255),m(c,e.total_in>>24&255)):(y(c,e.adler>>>16),y(c,65535&e.adler)),w(e),c.wrap>0&&(c.wrap=-c.wrap),0!==c.pending?0:1)},R.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==f&&e!==d&&e!==h?l(t,s):(t.state=null,e===d?l(t,-3):0):s},R.deflateSetDictionary=function(t,i){var a,n,o,c,f,d,h,l,u=i.length;if(!t||!t.state)return s;if(2===(c=(a=t.state).wrap)||1===c&&42!==a.status||a.lookahead)return s;for(1===c&&(t.adler=r(t.adler,i,u,0)),a.wrap=0,u>=a.w_size&&(0===c&&(g(a.head),a.strstart=0,a.block_start=0,a.insert=0),l=new e.Buf8(a.w_size),e.arraySet(l,i,u-a.w_size,a.w_size,0),i=l,u=a.w_size),f=t.avail_in,d=t.next_in,h=t.input,t.avail_in=u,t.next_in=0,t.input=i,x(a);a.lookahead>=3;){n=a.strstart,o=a.lookahead-2;do{a.ins_h=(a.ins_h<<a.hash_shift^a.window[n+3-1])&a.hash_mask,a.prev[n&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=n,n++}while(--o);a.strstart=n,a.lookahead=2,x(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=2,a.match_available=0,t.next_in=d,t.input=h,t.avail_in=f,a.wrap=c,0},R.deflateInfo="pako deflate (from Nodeca project)",R}var D,T,U,N,M={};function F(){if(D)return M;D=1;var t=b(),e=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(t){e=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){i=!1}for(var r=new t.Buf8(256),a=0;a<256;a++)r[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function n(r,a){if(a<65534&&(r.subarray&&i||!r.subarray&&e))return String.fromCharCode.apply(null,t.shrinkBuf(r,a));for(var n="",s=0;s<a;s++)n+=String.fromCharCode(r[s]);return n}return r[254]=r[254]=1,M.string2buf=function(e){var i,r,a,n,s,o=e.length,c=0;for(n=0;n<o;n++)55296==(64512&(r=e.charCodeAt(n)))&&n+1<o&&56320==(64512&(a=e.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(a-56320),n++),c+=r<128?1:r<2048?2:r<65536?3:4;for(i=new t.Buf8(c),s=0,n=0;s<c;n++)55296==(64512&(r=e.charCodeAt(n)))&&n+1<o&&56320==(64512&(a=e.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(a-56320),n++),r<128?i[s++]=r:r<2048?(i[s++]=192|r>>>6,i[s++]=128|63&r):r<65536?(i[s++]=224|r>>>12,i[s++]=128|r>>>6&63,i[s++]=128|63&r):(i[s++]=240|r>>>18,i[s++]=128|r>>>12&63,i[s++]=128|r>>>6&63,i[s++]=128|63&r);return i},M.buf2binstring=function(t){return n(t,t.length)},M.binstring2buf=function(e){for(var i=new t.Buf8(e.length),r=0,a=i.length;r<a;r++)i[r]=e.charCodeAt(r);return i},M.buf2string=function(t,e){var i,a,s,o,c=e||t.length,f=new Array(2*c);for(a=0,i=0;i<c;)if((s=t[i++])<128)f[a++]=s;else if((o=r[s])>4)f[a++]=65533,i+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&i<c;)s=s<<6|63&t[i++],o--;o>1?f[a++]=65533:s<65536?f[a++]=s:(s-=65536,f[a++]=55296|s>>10&1023,f[a++]=56320|1023&s)}return n(f,a)},M.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+r[t[i]]>e?i:e},M}function H(){if(U)return T;return U=1,T=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}}var q,L,W,Z,G,K,V,X,Y,J,Q,tt,et,it,rt,at,nt,st,ot,ct,ft,dt={},ht={};function lt(){if(G)return ht;G=1;var t=b(),e=O(),i=I(),r=L?q:(L=1,q=function(t,e){var i,r,a,n,s,o,c,f,d,h,l,u,g,w,p,m,y,b,_,v,x,k,E,$,S;i=t.state,r=t.next_in,$=t.input,a=r+(t.avail_in-5),n=t.next_out,S=t.output,s=n-(e-t.avail_out),o=n+(t.avail_out-257),c=i.dmax,f=i.wsize,d=i.whave,h=i.wnext,l=i.window,u=i.hold,g=i.bits,w=i.lencode,p=i.distcode,m=(1<<i.lenbits)-1,y=(1<<i.distbits)-1;t:do{g<15&&(u+=$[r++]<<g,g+=8,u+=$[r++]<<g,g+=8),b=w[u&m];e:for(;;){if(u>>>=_=b>>>24,g-=_,0==(_=b>>>16&255))S[n++]=65535&b;else{if(!(16&_)){if(64&_){if(32&_){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}b=w[(65535&b)+(u&(1<<_)-1)];continue e}for(v=65535&b,(_&=15)&&(g<_&&(u+=$[r++]<<g,g+=8),v+=u&(1<<_)-1,u>>>=_,g-=_),g<15&&(u+=$[r++]<<g,g+=8,u+=$[r++]<<g,g+=8),b=p[u&y];;){if(u>>>=_=b>>>24,g-=_,16&(_=b>>>16&255)){if(x=65535&b,g<(_&=15)&&(u+=$[r++]<<g,(g+=8)<_&&(u+=$[r++]<<g,g+=8)),(x+=u&(1<<_)-1)>c){t.msg="invalid distance too far back",i.mode=30;break t}if(u>>>=_,g-=_,x>(_=n-s)){if((_=x-_)>d&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(k=0,E=l,0===h){if(k+=f-_,_<v){v-=_;do{S[n++]=l[k++]}while(--_);k=n-x,E=S}}else if(h<_){if(k+=f+h-_,(_-=h)<v){v-=_;do{S[n++]=l[k++]}while(--_);if(k=0,h<v){v-=_=h;do{S[n++]=l[k++]}while(--_);k=n-x,E=S}}}else if(k+=h-_,_<v){v-=_;do{S[n++]=l[k++]}while(--_);k=n-x,E=S}for(;v>2;)S[n++]=E[k++],S[n++]=E[k++],S[n++]=E[k++],v-=3;v&&(S[n++]=E[k++],v>1&&(S[n++]=E[k++]))}else{k=n-x;do{S[n++]=S[k++],S[n++]=S[k++],S[n++]=S[k++],v-=3}while(v>2);v&&(S[n++]=S[k++],v>1&&(S[n++]=S[k++]))}break}if(64&_){t.msg="invalid distance code",i.mode=30;break t}b=p[(65535&b)+(u&(1<<_)-1)]}}break}}while(r<a&&n<o);r-=v=g>>3,u&=(1<<(g-=v<<3))-1,t.next_in=r,t.next_out=n,t.avail_in=r<a?a-r+5:5-(r-a),t.avail_out=n<o?o-n+257:257-(n-o),i.hold=u,i.bits=g}),a=function(){if(Z)return W;Z=1;var t=b(),e=15,i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[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],a=[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],n=[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];return W=function(s,o,c,f,d,h,l,u){var g,w,p,m,y,b,_,v,x,k=u.bits,E=0,$=0,S=0,B=0,A=0,R=0,P=0,j=0,O=0,I=0,C=null,z=0,D=new t.Buf16(16),T=new t.Buf16(16),U=null,N=0;for(E=0;E<=e;E++)D[E]=0;for($=0;$<f;$++)D[o[c+$]]++;for(A=k,B=e;B>=1&&0===D[B];B--);if(A>B&&(A=B),0===B)return d[h++]=20971520,d[h++]=20971520,u.bits=1,0;for(S=1;S<B&&0===D[S];S++);for(A<S&&(A=S),j=1,E=1;E<=e;E++)if(j<<=1,(j-=D[E])<0)return-1;if(j>0&&(0===s||1!==B))return-1;for(T[1]=0,E=1;E<e;E++)T[E+1]=T[E]+D[E];for($=0;$<f;$++)0!==o[c+$]&&(l[T[o[c+$]]++]=$);if(0===s?(C=U=l,b=19):1===s?(C=i,z-=257,U=r,N-=257,b=256):(C=a,U=n,b=-1),I=0,$=0,E=S,y=h,R=A,P=0,p=-1,m=(O=1<<A)-1,1===s&&O>852||2===s&&O>592)return 1;for(;;){_=E-P,l[$]<b?(v=0,x=l[$]):l[$]>b?(v=U[N+l[$]],x=C[z+l[$]]):(v=96,x=0),g=1<<E-P,S=w=1<<R;do{d[y+(I>>P)+(w-=g)]=_<<24|v<<16|x}while(0!==w);for(g=1<<E-1;I&g;)g>>=1;if(0!==g?(I&=g-1,I+=g):I=0,$++,0===--D[E]){if(E===B)break;E=o[c+l[$]]}if(E>A&&(I&m)!==p){for(0===P&&(P=A),y+=S,j=1<<(R=E-P);R+P<B&&!((j-=D[R+P])<=0);)R++,j<<=1;if(O+=1<<R,1===s&&O>852||2===s&&O>592)return 1;d[p=I&m]=A<<24|R<<16|y-h}}return 0!==I&&(d[y+I]=E-P<<24|64<<16),u.bits=A,0}}(),n=-2,s=12,o=30;function c(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function f(){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 t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(e){var i;return e&&e.state?(i=e.state,e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=1&i.wrap),i.mode=1,i.last=0,i.havedict=0,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new t.Buf32(852),i.distcode=i.distdyn=new t.Buf32(592),i.sane=1,i.back=-1,0):n}function h(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,d(t)):n}function l(t,e){var i,r;return t&&t.state?(r=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?n:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,h(t))):n}function u(t,e){var i,r;return t?(r=new f,t.state=r,r.window=null,0!==(i=l(t,e))&&(t.state=null),i):n}var g,w,p=!0;function m(e){if(p){var i;for(g=new t.Buf32(512),w=new t.Buf32(32),i=0;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for(a(1,e.lens,0,288,g,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;a(2,e.lens,0,32,w,0,e.work,{bits:5}),p=!1}e.lencode=g,e.lenbits=9,e.distcode=w,e.distbits=5}function y(e,i,r,a){var n,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new t.Buf8(s.wsize)),a>=s.wsize?(t.arraySet(s.window,i,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((n=s.wsize-s.wnext)>a&&(n=a),t.arraySet(s.window,i,r-a,n,s.wnext),(a-=n)?(t.arraySet(s.window,i,r-a,a,0),s.wnext=a,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0}return ht.inflateReset=h,ht.inflateReset2=l,ht.inflateResetKeep=d,ht.inflateInit=function(t){return u(t,15)},ht.inflateInit2=u,ht.inflate=function(f,d){var h,l,u,g,w,p,b,_,v,x,k,E,$,S,B,A,R,P,j,O,I,C,z,D,T=0,U=new t.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!f||!f.state||!f.output||!f.input&&0!==f.avail_in)return n;(h=f.state).mode===s&&(h.mode=13),w=f.next_out,u=f.output,b=f.avail_out,g=f.next_in,l=f.input,p=f.avail_in,_=h.hold,v=h.bits,x=p,k=b,C=0;t:for(;;)switch(h.mode){case 1:if(0===h.wrap){h.mode=13;break}for(;v<16;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(2&h.wrap&&35615===_){h.check=0,U[0]=255&_,U[1]=_>>>8&255,h.check=i(h.check,U,2,0),_=0,v=0,h.mode=2;break}if(h.flags=0,h.head&&(h.head.done=!1),!(1&h.wrap)||(((255&_)<<8)+(_>>8))%31){f.msg="incorrect header check",h.mode=o;break}if(8!=(15&_)){f.msg="unknown compression method",h.mode=o;break}if(v-=4,I=8+(15&(_>>>=4)),0===h.wbits)h.wbits=I;else if(I>h.wbits){f.msg="invalid window size",h.mode=o;break}h.dmax=1<<I,f.adler=h.check=1,h.mode=512&_?10:s,_=0,v=0;break;case 2:for(;v<16;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(h.flags=_,8!=(255&h.flags)){f.msg="unknown compression method",h.mode=o;break}if(57344&h.flags){f.msg="unknown header flags set",h.mode=o;break}h.head&&(h.head.text=_>>8&1),512&h.flags&&(U[0]=255&_,U[1]=_>>>8&255,h.check=i(h.check,U,2,0)),_=0,v=0,h.mode=3;case 3:for(;v<32;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.head&&(h.head.time=_),512&h.flags&&(U[0]=255&_,U[1]=_>>>8&255,U[2]=_>>>16&255,U[3]=_>>>24&255,h.check=i(h.check,U,4,0)),_=0,v=0,h.mode=4;case 4:for(;v<16;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.head&&(h.head.xflags=255&_,h.head.os=_>>8),512&h.flags&&(U[0]=255&_,U[1]=_>>>8&255,h.check=i(h.check,U,2,0)),_=0,v=0,h.mode=5;case 5:if(1024&h.flags){for(;v<16;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.length=_,h.head&&(h.head.extra_len=_),512&h.flags&&(U[0]=255&_,U[1]=_>>>8&255,h.check=i(h.check,U,2,0)),_=0,v=0}else h.head&&(h.head.extra=null);h.mode=6;case 6:if(1024&h.flags&&((E=h.length)>p&&(E=p),E&&(h.head&&(I=h.head.extra_len-h.length,h.head.extra||(h.head.extra=new Array(h.head.extra_len)),t.arraySet(h.head.extra,l,g,E,I)),512&h.flags&&(h.check=i(h.check,l,E,g)),p-=E,g+=E,h.length-=E),h.length))break t;h.length=0,h.mode=7;case 7:if(2048&h.flags){if(0===p)break t;E=0;do{I=l[g+E++],h.head&&I&&h.length<65536&&(h.head.name+=String.fromCharCode(I))}while(I&&E<p);if(512&h.flags&&(h.check=i(h.check,l,E,g)),p-=E,g+=E,I)break t}else h.head&&(h.head.name=null);h.length=0,h.mode=8;case 8:if(4096&h.flags){if(0===p)break t;E=0;do{I=l[g+E++],h.head&&I&&h.length<65536&&(h.head.comment+=String.fromCharCode(I))}while(I&&E<p);if(512&h.flags&&(h.check=i(h.check,l,E,g)),p-=E,g+=E,I)break t}else h.head&&(h.head.comment=null);h.mode=9;case 9:if(512&h.flags){for(;v<16;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(_!==(65535&h.check)){f.msg="header crc mismatch",h.mode=o;break}_=0,v=0}h.head&&(h.head.hcrc=h.flags>>9&1,h.head.done=!0),f.adler=h.check=0,h.mode=s;break;case 10:for(;v<32;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}f.adler=h.check=c(_),_=0,v=0,h.mode=11;case 11:if(0===h.havedict)return f.next_out=w,f.avail_out=b,f.next_in=g,f.avail_in=p,h.hold=_,h.bits=v,2;f.adler=h.check=1,h.mode=s;case s:if(5===d||6===d)break t;case 13:if(h.last){_>>>=7&v,v-=7&v,h.mode=27;break}for(;v<3;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}switch(h.last=1&_,v-=1,3&(_>>>=1)){case 0:h.mode=14;break;case 1:if(m(h),h.mode=20,6===d){_>>>=2,v-=2;break t}break;case 2:h.mode=17;break;case 3:f.msg="invalid block type",h.mode=o}_>>>=2,v-=2;break;case 14:for(_>>>=7&v,v-=7&v;v<32;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if((65535&_)!=(_>>>16^65535)){f.msg="invalid stored block lengths",h.mode=o;break}if(h.length=65535&_,_=0,v=0,h.mode=15,6===d)break t;case 15:h.mode=16;case 16:if(E=h.length){if(E>p&&(E=p),E>b&&(E=b),0===E)break t;t.arraySet(u,l,g,E,w),p-=E,g+=E,b-=E,w+=E,h.length-=E;break}h.mode=s;break;case 17:for(;v<14;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(h.nlen=257+(31&_),_>>>=5,v-=5,h.ndist=1+(31&_),_>>>=5,v-=5,h.ncode=4+(15&_),_>>>=4,v-=4,h.nlen>286||h.ndist>30){f.msg="too many length or distance symbols",h.mode=o;break}h.have=0,h.mode=18;case 18:for(;h.have<h.ncode;){for(;v<3;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.lens[N[h.have++]]=7&_,_>>>=3,v-=3}for(;h.have<19;)h.lens[N[h.have++]]=0;if(h.lencode=h.lendyn,h.lenbits=7,z={bits:h.lenbits},C=a(0,h.lens,0,19,h.lencode,0,h.work,z),h.lenbits=z.bits,C){f.msg="invalid code lengths set",h.mode=o;break}h.have=0,h.mode=19;case 19:for(;h.have<h.nlen+h.ndist;){for(;A=(T=h.lencode[_&(1<<h.lenbits)-1])>>>16&255,R=65535&T,!((B=T>>>24)<=v);){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(R<16)_>>>=B,v-=B,h.lens[h.have++]=R;else{if(16===R){for(D=B+2;v<D;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(_>>>=B,v-=B,0===h.have){f.msg="invalid bit length repeat",h.mode=o;break}I=h.lens[h.have-1],E=3+(3&_),_>>>=2,v-=2}else if(17===R){for(D=B+3;v<D;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}v-=B,I=0,E=3+(7&(_>>>=B)),_>>>=3,v-=3}else{for(D=B+7;v<D;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}v-=B,I=0,E=11+(127&(_>>>=B)),_>>>=7,v-=7}if(h.have+E>h.nlen+h.ndist){f.msg="invalid bit length repeat",h.mode=o;break}for(;E--;)h.lens[h.have++]=I}}if(h.mode===o)break;if(0===h.lens[256]){f.msg="invalid code -- missing end-of-block",h.mode=o;break}if(h.lenbits=9,z={bits:h.lenbits},C=a(1,h.lens,0,h.nlen,h.lencode,0,h.work,z),h.lenbits=z.bits,C){f.msg="invalid literal/lengths set",h.mode=o;break}if(h.distbits=6,h.distcode=h.distdyn,z={bits:h.distbits},C=a(2,h.lens,h.nlen,h.ndist,h.distcode,0,h.work,z),h.distbits=z.bits,C){f.msg="invalid distances set",h.mode=o;break}if(h.mode=20,6===d)break t;case 20:h.mode=21;case 21:if(p>=6&&b>=258){f.next_out=w,f.avail_out=b,f.next_in=g,f.avail_in=p,h.hold=_,h.bits=v,r(f,k),w=f.next_out,u=f.output,b=f.avail_out,g=f.next_in,l=f.input,p=f.avail_in,_=h.hold,v=h.bits,h.mode===s&&(h.back=-1);break}for(h.back=0;A=(T=h.lencode[_&(1<<h.lenbits)-1])>>>16&255,R=65535&T,!((B=T>>>24)<=v);){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(A&&!(240&A)){for(P=B,j=A,O=R;A=(T=h.lencode[O+((_&(1<<P+j)-1)>>P)])>>>16&255,R=65535&T,!(P+(B=T>>>24)<=v);){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}_>>>=P,v-=P,h.back+=P}if(_>>>=B,v-=B,h.back+=B,h.length=R,0===A){h.mode=26;break}if(32&A){h.back=-1,h.mode=s;break}if(64&A){f.msg="invalid literal/length code",h.mode=o;break}h.extra=15&A,h.mode=22;case 22:if(h.extra){for(D=h.extra;v<D;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.length+=_&(1<<h.extra)-1,_>>>=h.extra,v-=h.extra,h.back+=h.extra}h.was=h.length,h.mode=23;case 23:for(;A=(T=h.distcode[_&(1<<h.distbits)-1])>>>16&255,R=65535&T,!((B=T>>>24)<=v);){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(!(240&A)){for(P=B,j=A,O=R;A=(T=h.distcode[O+((_&(1<<P+j)-1)>>P)])>>>16&255,R=65535&T,!(P+(B=T>>>24)<=v);){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}_>>>=P,v-=P,h.back+=P}if(_>>>=B,v-=B,h.back+=B,64&A){f.msg="invalid distance code",h.mode=o;break}h.offset=R,h.extra=15&A,h.mode=24;case 24:if(h.extra){for(D=h.extra;v<D;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.offset+=_&(1<<h.extra)-1,_>>>=h.extra,v-=h.extra,h.back+=h.extra}if(h.offset>h.dmax){f.msg="invalid distance too far back",h.mode=o;break}h.mode=25;case 25:if(0===b)break t;if(E=k-b,h.offset>E){if((E=h.offset-E)>h.whave&&h.sane){f.msg="invalid distance too far back",h.mode=o;break}E>h.wnext?(E-=h.wnext,$=h.wsize-E):$=h.wnext-E,E>h.length&&(E=h.length),S=h.window}else S=u,$=w-h.offset,E=h.length;E>b&&(E=b),b-=E,h.length-=E;do{u[w++]=S[$++]}while(--E);0===h.length&&(h.mode=21);break;case 26:if(0===b)break t;u[w++]=h.length,b--,h.mode=21;break;case 27:if(h.wrap){for(;v<32;){if(0===p)break t;p--,_|=l[g++]<<v,v+=8}if(k-=b,f.total_out+=k,h.total+=k,k&&(f.adler=h.check=h.flags?i(h.check,u,k,w-k):e(h.check,u,k,w-k)),k=b,(h.flags?_:c(_))!==h.check){f.msg="incorrect data check",h.mode=o;break}_=0,v=0}h.mode=28;case 28:if(h.wrap&&h.flags){for(;v<32;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(_!==(4294967295&h.total)){f.msg="incorrect length check",h.mode=o;break}_=0,v=0}h.mode=29;case 29:C=1;break t;case o:C=-3;break t;case 31:return-4;default:return n}return f.next_out=w,f.avail_out=b,f.next_in=g,f.avail_in=p,h.hold=_,h.bits=v,(h.wsize||k!==f.avail_out&&h.mode<o&&(h.mode<27||4!==d))&&y(f,f.output,f.next_out,k-f.avail_out),x-=f.avail_in,k-=f.avail_out,f.total_in+=x,f.total_out+=k,h.total+=k,h.wrap&&k&&(f.adler=h.check=h.flags?i(h.check,u,k,f.next_out-k):e(h.check,u,k,f.next_out-k)),f.data_type=h.bits+(h.last?64:0)+(h.mode===s?128:0)+(20===h.mode||15===h.mode?256:0),(0===x&&0===k||4===d)&&0===C&&(C=-5),C},ht.inflateEnd=function(t){if(!t||!t.state)return n;var e=t.state;return e.window&&(e.window=null),t.state=null,0},ht.inflateGetHeader=function(t,e){var i;return t&&t.state&&2&(i=t.state).wrap?(i.head=e,e.done=!1,0):n},ht.inflateSetDictionary=function(t,i){var r,a=i.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?n:11===r.mode&&e(1,i,a,0)!==r.check?-3:y(t,i,a,a)?(r.mode=31,-4):(r.havedict=1,0):n},ht.inflateInfo="pako inflate (from Nodeca project)",ht}function ut(){return V?K:(V=1,K={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})}function gt(){if(J)return dt;J=1;var t=lt(),e=b(),i=F(),r=ut(),a=C(),n=H(),s=Y?X:(Y=1,X=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}),o=Object.prototype.toString;function c(f){if(!(this instanceof c))return new c(f);this.options=e.assign({chunkSize:16384,windowBits:0,to:""},f||{});var d=this.options;d.raw&&d.windowBits>=0&&d.windowBits<16&&(d.windowBits=-d.windowBits,0===d.windowBits&&(d.windowBits=-15)),!(d.windowBits>=0&&d.windowBits<16)||f&&f.windowBits||(d.windowBits+=32),d.windowBits>15&&d.windowBits<48&&(15&d.windowBits||(d.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new n,this.strm.avail_out=0;var h=t.inflateInit2(this.strm,d.windowBits);if(h!==r.Z_OK)throw new Error(a[h]);if(this.header=new s,t.inflateGetHeader(this.strm,this.header),d.dictionary&&("string"==typeof d.dictionary?d.dictionary=i.string2buf(d.dictionary):"[object ArrayBuffer]"===o.call(d.dictionary)&&(d.dictionary=new Uint8Array(d.dictionary)),d.raw&&(h=t.inflateSetDictionary(this.strm,d.dictionary))!==r.Z_OK))throw new Error(a[h])}function f(t,e){var i=new c(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}return c.prototype.push=function(a,n){var s,c,f,d,h,l=this.strm,u=this.options.chunkSize,g=this.options.dictionary,w=!1;if(this.ended)return!1;c=n===~~n?n:!0===n?r.Z_FINISH:r.Z_NO_FLUSH,"string"==typeof a?l.input=i.binstring2buf(a):"[object ArrayBuffer]"===o.call(a)?l.input=new Uint8Array(a):l.input=a,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new e.Buf8(u),l.next_out=0,l.avail_out=u),(s=t.inflate(l,r.Z_NO_FLUSH))===r.Z_NEED_DICT&&g&&(s=t.inflateSetDictionary(this.strm,g)),s===r.Z_BUF_ERROR&&!0===w&&(s=r.Z_OK,w=!1),s!==r.Z_STREAM_END&&s!==r.Z_OK)return this.onEnd(s),this.ended=!0,!1;l.next_out&&(0!==l.avail_out&&s!==r.Z_STREAM_END&&(0!==l.avail_in||c!==r.Z_FINISH&&c!==r.Z_SYNC_FLUSH)||("string"===this.options.to?(f=i.utf8border(l.output,l.next_out),d=l.next_out-f,h=i.buf2string(l.output,f),l.next_out=d,l.avail_out=u-d,d&&e.arraySet(l.output,l.output,f,d,0),this.onData(h)):this.onData(e.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(w=!0)}while((l.avail_in>0||0===l.avail_out)&&s!==r.Z_STREAM_END);return s===r.Z_STREAM_END&&(c=r.Z_FINISH),c===r.Z_FINISH?(s=t.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===r.Z_OK):c!==r.Z_SYNC_FLUSH||(this.onEnd(r.Z_OK),l.avail_out=0,!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===r.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=e.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},dt.Inflate=c,dt.inflate=f,dt.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},dt.ungzip=f,dt}function wt(){if(tt)return Q;tt=1;var t=b().assign,e=function(){if(N)return A;N=1;var t=z(),e=b(),i=F(),r=C(),a=H(),n=Object.prototype.toString;function s(o){if(!(this instanceof s))return new s(o);this.options=e.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},o||{});var c=this.options;c.raw&&c.windowBits>0?c.windowBits=-c.windowBits:c.gzip&&c.windowBits>0&&c.windowBits<16&&(c.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var f=t.deflateInit2(this.strm,c.level,c.method,c.windowBits,c.memLevel,c.strategy);if(0!==f)throw new Error(r[f]);if(c.header&&t.deflateSetHeader(this.strm,c.header),c.dictionary){var d;if(d="string"==typeof c.dictionary?i.string2buf(c.dictionary):"[object ArrayBuffer]"===n.call(c.dictionary)?new Uint8Array(c.dictionary):c.dictionary,0!==(f=t.deflateSetDictionary(this.strm,d)))throw new Error(r[f]);this._dict_set=!0}}function o(t,e){var i=new s(e);if(i.push(t,!0),i.err)throw i.msg||r[i.err];return i.result}return s.prototype.push=function(r,a){var s,o,c=this.strm,f=this.options.chunkSize;if(this.ended)return!1;o=a===~~a?a:!0===a?4:0,"string"==typeof r?c.input=i.string2buf(r):"[object ArrayBuffer]"===n.call(r)?c.input=new Uint8Array(r):c.input=r,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new e.Buf8(f),c.next_out=0,c.avail_out=f),1!==(s=t.deflate(c,o))&&0!==s)return this.onEnd(s),this.ended=!0,!1;0!==c.avail_out&&(0!==c.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(e.shrinkBuf(c.output,c.next_out))):this.onData(e.shrinkBuf(c.output,c.next_out)))}while((c.avail_in>0||0===c.avail_out)&&1!==s);return 4===o?(s=t.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,0===s):2!==o||(this.onEnd(0),c.avail_out=0,!0)},s.prototype.onData=function(t){this.chunks.push(t)},s.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=e.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},A.Deflate=s,A.deflate=o,A.deflateRaw=function(t,e){return(e=e||{}).raw=!0,o(t,e)},A.gzip=function(t,e){return(e=e||{}).gzip=!0,o(t,e)},A}(),i={};return t(i,e,gt(),ut()),Q=i}function pt(){if(it)return et;function t(t){return Array.isArray(t)?t:[t]}it=1;const e=/^\s+$/,i=/^\\!/,r=/^\\#/,a=/\r?\n/g,n=/^\.*\/|^\.+$/,s="undefined"!=typeof Symbol?Symbol.for("node-ignore"):"node-ignore",o=/([0-z])-([0-z])/g,c=[[/\\?\s+$/,t=>0===t.indexOf("\\")?" ":""],[/\\\s/g,()=>" "],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,i)=>e+6<i.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(t,e)=>`${e}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,i,r,a)=>"\\"===e?`\\[${i}${(t=>{const{length:e}=t;return t.slice(0,e-e%2)})(r)}${a}`:"]"===a&&r.length%2==0?`[${(t=>t.replace(o,(t,e,i)=>e.charCodeAt(0)<=i.charCodeAt(0)?t:""))(i)}${r}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],f=Object.create(null),d=t=>"string"==typeof t;class h{constructor(t,e,i,r){this.origin=t,this.pattern=e,this.negative=i,this.regex=r}}const l=(t,e)=>{const a=t;let n=!1;0===t.indexOf("!")&&(n=!0,t=t.substr(1));const s=((t,e,i)=>{const r=f[t];if(r)return r;const a=c.reduce((e,i)=>e.replace(i[0],i[1].bind(t)),t);return f[t]=i?new RegExp(a,"i"):new RegExp(a)})(t=t.replace(i,"!").replace(r,"#"),0,e);return new h(a,t,n,s)},u=(t,e)=>{throw new e(t)},g=(t,e,i)=>{if(!d(t))return i(`path must be a string, but got \`${e}\``,TypeError);if(!t)return i("path must not be empty",TypeError);if(g.isNotRelative(t)){return i(`path should be a ${"`path.relative()`d"} string, but got "${e}"`,RangeError)}return!0},w=t=>n.test(t);g.isNotRelative=w,g.convert=t=>t;class p{constructor({ignorecase:t=!0}={}){var e,i,r;this._rules=[],this._ignorecase=t,e=this,i=s,r=!0,Object.defineProperty(e,i,{value:r}),this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[s])return this._rules=this._rules.concat(t._rules),void(this._added=!0);if((t=>t&&d(t)&&!e.test(t)&&0!==t.indexOf("#"))(t)){const e=l(t,this._ignorecase);this._added=!0,this._rules.push(e)}}add(e){return this._added=!1,t(d(e)?(t=>t.split(a))(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,e){let i=!1,r=!1;return this._rules.forEach(a=>{const{negative:n}=a;if(r===n&&i!==r||n&&!i&&!r&&!e)return;a.regex.test(t)&&(i=!n,r=n)}),{ignored:i,unignored:r}}_test(t,e,i,r){const a=t&&g.convert(t);return g(a,t,u),this._t(a,e,i,r)}_t(t,e,i,r){if(t in e)return e[t];if(r||(r=t.split("/")),r.pop(),!r.length)return e[t]=this._testOne(t,i);const a=this._t(r.join("/")+"/",e,i,r);return e[t]=a.ignored?a:this._testOne(t,i)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(e){return t(e).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}const m=t=>new p(t),y=()=>!1;if(m.isPathValid=t=>g(t&&g.convert(t),t,y),m.default=m,et=m,"undefined"!=typeof process&&(process.env&&process.env.IGNORE_TEST_WIN32||"win32"===process.platform)){const t=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");g.convert=t;const e=/^[a-z]:\//i;g.isNotRelative=t=>e.test(t)||w(t)}return et}function mt(){return st?nt:(st=1,nt=function(t,e){var i,r,a=t,n=e,s=a.length,o=n.length,c=!1,f=null,d=s+1,h=[],l=[],u=[],g="",w=function(t,e,i){return{x:t,y:e,k:i}},p=function(t,e){return{elem:t,t:e}},m=function(t,e,i){var r,c,f;for(r=e>i?h[t-1+d]:h[t+1+d],c=(f=Math.max(e,i))-t;c<s&&f<o&&a[c]===n[f];)++c,++f;return h[t+d]=l.length,l[l.length]=new w(c,f,r),f};return s>=o&&(i=a,r=s,a=n,n=i,s=o,o=r,c=!0,d=s+1),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return f},getlcs:function(){return g},getses:function(){return u},compose:function(){var t,e,i,r,y,b,_,v;for(t=o-s,e=s+o+3,i={},_=0;_<e;++_)i[_]=-1,h[_]=-1;r=-1;do{for(v=-++r;v<=t-1;++v)i[v+d]=m(v,i[v-1+d]+1,i[v+1+d]);for(v=t+r;v>=t+1;--v)i[v+d]=m(v,i[v-1+d]+1,i[v+1+d]);i[t+d]=m(t,i[t-1+d]+1,i[t+1+d])}while(i[t+d]!==o);for(f=t+2*r,y=h[t+d],b=[];-1!==y;)b[b.length]=new w(l[y].x,l[y].y,null),y=l[y].k;!function(t){var e,i,r;for(e=i=0,r=t.length-1;r>=0;--r)for(;e<t[r].x||i<t[r].y;)t[r].y-t[r].x>i-e?(u[u.length]=new p(n[i],c?-1:1),++i):t[r].y-t[r].x<i-e?(u[u.length]=new p(a[e],c?1:-1),++e):(u[u.length]=new p(a[e],0),g+=a[e],++e,++i)}(b)}}})}function yt(){if(ct)return ot;ct=1;var t=mt();function e(e,i){for(var r=[],a=e.length,n=i.length,s=function(e,i){var r=new t(e,i);r.compose();for(var a,n,s=r.getses(),o=e.length-1,c=i.length-1,f=s.length-1;f>=0;--f)s[f].t===r.SES_COMMON?(n?(n.chain={file1index:o,file2index:c,chain:null},n=n.chain):n=a={file1index:o,file2index:c,chain:null},o--,c--):s[f].t===r.SES_DELETE?o--:s[f].t===r.SES_ADD&&c--;var d={file1index:-1,file2index:-1,chain:null};return n?(n.chain=d,a):d}(e,i);null!==s;s=s.chain){var o=a-s.file1index-1,c=n-s.file2index-1;a=s.file1index,n=s.file2index,(o||c)&&r.push({file1:[a+1,o],file2:[n+1,c]})}return r.reverse(),r}return ot=function(t,i,r){var a=[],n=[t,i,r],s=function(t,i,r){var a,n=e(i,t),s=e(i,r),o=[];function c(t,e){o.push([t.file1[0],e,t.file1[1],t.file2[0],t.file2[1]])}for(a=0;a<n.length;a++)c(n[a],0);for(a=0;a<s.length;a++)c(s[a],2);o.sort(function(t,e){return t[0]-e[0]});var f=[],d=0;function h(t){t>d&&(f.push([1,d,t-d]),d=t)}for(var l=0;l<o.length;l++){for(var u=l,g=o[l],w=g[0],p=w+g[2];l<o.length-1;){var m=o[l+1],y=m[0];if(y>p)break;p=Math.max(p,y+m[2]),l++}if(h(w),u==l)g[4]>0&&f.push([g[1],g[3],g[4]]);else{var b={0:[t.length,-1,i.length,-1],2:[r.length,-1,i.length,-1]};for(a=u;a<=l;a++){var _=b[(g=o[a])[1]],v=g[0],x=v+g[2],k=g[3],E=k+g[4];_[0]=Math.min(k,_[0]),_[1]=Math.max(E,_[1]),_[2]=Math.min(v,_[2]),_[3]=Math.max(x,_[3])}var $=b[0][0]+(w-b[0][2]),S=b[0][1]+(p-b[0][3]),B=b[2][0]+(w-b[2][2]),A=b[2][1]+(p-b[2][3]);f.push([-1,$,S-$,w,p-w,B,A-B])}d=p}return h(i.length),f}(t,i,r),o=[];function c(){o.length&&a.push({ok:o}),o=[]}function f(t){for(var e=0;e<t.length;e++)o.push(t[e])}function d(e){if(e[2]!=e[6])return!0;for(var i=e[1],a=e[5],n=0;n<e[2];n++)if(t[n+i]!=r[n+a])return!0;return!1}for(var h=0;h<s.length;h++){var l=s[h],u=l[0];-1==u?d(l)?(c(),a.push({conflict:{a:t.slice(l[1],l[1]+l[2]),aIndex:l[1],o:i.slice(l[3],l[3]+l[4]),oIndex:l[3],b:r.slice(l[5],l[5]+l[6]),bIndex:l[5]}})):f(n[0].slice(l[1],l[1]+l[2])):f(n[u].slice(l[1],l[1]+l[2]))}return c(),a}}function bt(){if(ft)return g;function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}ft=1,Object.defineProperty(g,"__esModule",{value:!0});var e=t(f?c:(f=1,c=w())),i=t(p()),n=t(r.requireCrc32()),s=t(wt()),o=t(a.requirePify()),d=t(pt()),h=t(function(){if(at)return rt;function t(t,e,i){return e=e instanceof RegExp?e:new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),t.replace(e,i)}return at=1,rt={clean:function(e){if("string"!=typeof e)throw new Error("Expected a string, received: "+e);return e=t(e,"./","/"),e=t(e,"..","."),e=t(e," ","-"),e=t(e,/^[~^:?*\\\-]/g,""),e=t(e,/[~^:?*\\]/g,"-"),e=t(e,/[~^:?*\\\-]$/g,""),e=t(e,"@{","-"),e=t(e,/\.$/g,""),e=t(e,/\/$/g,""),t(e,/\.lock$/g,"")}}}()),l=t(yt());class u extends Error{constructor(t){super(t),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){const e=new u(t.message);return e.code=t.code,e.data=t.data,e.caller=t.caller,e.stack=t.stack,e}get isIsomorphicGitError(){return!0}}class m extends u{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=m.code,this.data={filepaths:t}}}m.code="UnmergedPathsError";class y extends u{constructor(t){super(`An internal error caused this command to fail.\n\nIf you're not a developer, report the bug to the developers of the application you're using. If this is a bug in isomorphic-git then you should create a proper bug yourselves. The bug should include a minimal reproduction and details about the version and environment.\n\nPlease file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${t}`),this.code=this.name=y.code,this.data={message:t}}}y.code="InternalError";class b extends u{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=b.code,this.data={filepath:t}}}b.code="UnsafeFilepathError";class _{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){const e=this.buffer.slice(this._start,this._start+t);return this._start+=t,e}toString(t,e){const i=this.buffer.toString(t,this._start,this._start+e);return this._start+=e,i}write(t,e,i){const r=this.buffer.write(t,this._start,e,i);return this._start+=e,r}copy(t,e,i){const r=t.copy(this.buffer,this._start,e,i);return this._start+=r,r}readUInt8(){const t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){const e=this.buffer.writeUInt8(t,this._start);return this._start+=1,e}readUInt16BE(){const t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){const e=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,e}readUInt32BE(){const t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){const e=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,e}}function v(t,e){return-(t<e)||+(t>e)}function x(t,e){return v(t.path,e.path)}function k(t){let e=t>0?t>>12:0;4!==e&&8!==e&&10!==e&&14!==e&&(e=8);let i=511&t;return i=73&i?493:420,8!==e&&(i=0),(e<<12)+i}const E=2**32;function $(t,e,i,r){if(void 0!==t&&void 0!==e)return[t,e];void 0===i&&(i=r.valueOf());const a=Math.floor(i/1e3);return[a,1e6*(i-1e3*a)]}function S(t){const[e,i]=$(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[r,a]=$(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%E,ctimeNanoseconds:i%E,mtimeSeconds:r%E,mtimeNanoseconds:a%E,dev:t.dev%E,ino:t.ino%E,mode:k(t.mode%E),uid:t.uid%E,gid:t.gid%E,size:t.size>-1?t.size%E:0}}let B=null;async function A(t){return null===B&&(B=await async function(){try{return"da39a3ee5e6b4b0d3255bfef95601890afd80709"===await R(new Uint8Array([]))}catch(t){}return!1}()),B?R(t):function(t){return(new i).update(t).digest("hex")}(t)}async function R(t){return function(t){let e="";for(const i of new Uint8Array(t))i<16&&(e+="0"),e+=i.toString(16);return e}(await crypto.subtle.digest("SHA-1",t))}function P(t){return{assumeValid:Boolean(32768&t),extended:Boolean(16384&t),stage:(12288&t)>>12,nameLength:4095&t}}class j{constructor(t,e){this._dirty=!1,this._unmergedPaths=e||new Set,this._entries=t||new Map}_addEntry(t){if(0===t.flags.stage)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let e=this._entries.get(t.path);e||(this._entries.set(t.path,t),e=t),e.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(Buffer.isBuffer(t))return j.fromBuffer(t);if(null===t)return new j(null);throw new y("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(0===t.length)throw new y("Index file is empty (.git/index)");const e=new j,i=new _(t),r=i.toString("utf8",4);if("DIRC"!==r)throw new y(`Invalid dircache magic file number: ${r}`);const a=await A(t.slice(0,-20)),n=t.slice(-20).toString("hex");if(n!==a)throw new y(`Invalid checksum in GitIndex buffer: expected ${n} but saw ${a}`);const s=i.readUInt32BE();if(2!==s)throw new y(`Unsupported dircache version: ${s}`);const o=i.readUInt32BE();let c=0;for(;!i.eof()&&c<o;){const r={};r.ctimeSeconds=i.readUInt32BE(),r.ctimeNanoseconds=i.readUInt32BE(),r.mtimeSeconds=i.readUInt32BE(),r.mtimeNanoseconds=i.readUInt32BE(),r.dev=i.readUInt32BE(),r.ino=i.readUInt32BE(),r.mode=i.readUInt32BE(),r.uid=i.readUInt32BE(),r.gid=i.readUInt32BE(),r.size=i.readUInt32BE(),r.oid=i.slice(20).toString("hex");const a=i.readUInt16BE();r.flags=P(a);const n=t.indexOf(0,i.tell()+1)-i.tell();if(n<1)throw new y(`Got a path length of: ${n}`);if(r.path=i.toString("utf8",n),r.path.includes("..\\")||r.path.includes("../"))throw new b(r.path);let s=8-(i.tell()-12)%8;for(0===s&&(s=8);s--;){const t=i.readUInt8();if(0!==t)throw new y(`Expected 1-8 null characters but got '${t}' after ${r.path}`);if(i.eof())throw new y("Unexpected end of file")}r.stages=[],e._addEntry(r),c++}return e}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(x)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(t=>t):t)}*[Symbol.iterator](){for(const t of this.entries)yield t}insert({filepath:t,stats:e,oid:i,stage:r=0}){e||(e={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),e=S(e);const a=Buffer.from(t),n={ctimeSeconds:e.ctimeSeconds,ctimeNanoseconds:e.ctimeNanoseconds,mtimeSeconds:e.mtimeSeconds,mtimeNanoseconds:e.mtimeNanoseconds,dev:e.dev,ino:e.ino,mode:e.mode||33188,uid:e.uid,gid:e.gid,size:e.size,path:t,oid:i,flags:{assumeValid:!1,extended:!1,stage:r,nameLength:a.length<4095?a.length:4095},stages:[]};this._addEntry(n),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(const e of this._entries.keys())e.startsWith(t+"/")&&this._entries.delete(e);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join("\n")}static async _entryToBuffer(t){const e=Buffer.from(t.path),i=8*Math.ceil((62+e.length+1)/8),r=Buffer.alloc(i),a=new _(r),n=S(t);return a.writeUInt32BE(n.ctimeSeconds),a.writeUInt32BE(n.ctimeNanoseconds),a.writeUInt32BE(n.mtimeSeconds),a.writeUInt32BE(n.mtimeNanoseconds),a.writeUInt32BE(n.dev),a.writeUInt32BE(n.ino),a.writeUInt32BE(n.mode),a.writeUInt32BE(n.uid),a.writeUInt32BE(n.gid),a.writeUInt32BE(n.size),a.write(t.oid,20,"hex"),a.writeUInt16BE(function(t){const e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((3&e.stage)<<12)+(4095&e.nameLength)}(t)),a.write(t.path,e.length,"utf8"),r}async toObject(){const t=Buffer.alloc(12),e=new _(t);e.write("DIRC",4,"utf8"),e.writeUInt32BE(2),e.writeUInt32BE(this.entriesFlat.length);let i=[];for(const t of this.entries)if(i.push(j._entryToBuffer(t)),t.stages.length>1)for(const e of t.stages)e&&e!==t&&i.push(j._entryToBuffer(e));i=await Promise.all(i);const r=Buffer.concat(i),a=Buffer.concat([t,r]),n=await A(a);return Buffer.concat([a,Buffer.from(n,"hex")])}}function O(t,e,i=!0,r=!0){const a=S(t),n=S(e);return i&&a.mode!==n.mode||a.mtimeSeconds!==n.mtimeSeconds||a.ctimeSeconds!==n.ctimeSeconds||a.uid!==n.uid||a.gid!==n.gid||r&&a.ino!==n.ino||a.size!==n.size}let I=null;const C=Symbol("IndexCache");class z{static async acquire({fs:t,gitdir:i,cache:r,allowUnmerged:a=!0},n){r[C]||(r[C]={map:new Map,stats:new Map});const s=`${i}/index`;let o;null===I&&(I=new e({maxPending:1/0}));let c=[];return await I.acquire(s,async()=>{const e=r[C];await async function(t,e,i){const r=i.stats.get(e);if(void 0===r)return!0;if(null===r)return!1;const a=await t.lstat(e);return null!==a&&O(r,a)}(t,s,e)&&await async function(t,e,i){const[r,a]=await Promise.all([t.lstat(e),t.read(e)]),n=await j.from(a);i.map.set(e,n),i.stats.set(e,r)}(t,s,e);const i=e.map.get(s);if(c=i.unmergedPaths,c.length&&!a)throw new m(c);if(o=await n(i),i._dirty){const r=await i.toObject();await t.write(s,r),e.stats.set(s,await t.lstat(s)),i._dirty=!1}}),o}}function D(t){const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function T(t){const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return-1===e?".":0===e?"/":t.slice(0,e)}function U(t){const e=new Map,i=function(t){if(!e.has(t)){const r={type:"tree",fullpath:t,basename:D(t),metadata:{},children:[]};e.set(t,r),r.parent=i(T(t)),r.parent&&r.parent!==r&&r.parent.children.push(r)}return e.get(t)},r=function(t,r){if(!e.has(t)){const a={type:"blob",fullpath:t,basename:D(t),metadata:r,parent:i(T(t)),children:[]};a.parent&&a.parent.children.push(a),e.set(t,a)}return e.get(t)};i(".");for(const e of t)r(e.path,e);return e}class N{constructor({fs:t,gitdir:e,cache:i}){this.treePromise=z.acquire({fs:t,gitdir:e,cache:i},async function(t){return U(t.entries)});const r=this;this.ConstructEntry=class{constructor(t){this._fullpath=t,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return r.type(this)}async mode(){return r.mode(this)}async stat(){return r.stat(this)}async content(){return r.content(this)}async oid(){return r.oid(this)}}}async readdir(t){const e=t._fullpath,i=(await this.treePromise).get(e);if(!i)return null;if("blob"===i.type)return null;if("tree"!==i.type)throw new Error(`ENOTDIR: not a directory, scandir '${e}'`);const r=i.children.map(t=>t.fullpath);return r.sort(v),r}async type(t){return!1===t._type&&await t.stat(),t._type}async mode(t){return!1===t._mode&&await t.stat(),t._mode}async stat(t){if(!1===t._stat){const e=(await this.treePromise).get(t._fullpath);if(!e)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);const i="tree"===e.type?{}:S(e.metadata);t._type="tree"===e.type?"tree":function(t){switch(t){case 16384:return"tree";case 33188:case 33261:case 40960:return"blob";case 57344:return"commit"}throw new y(`Unexpected GitTree entry mode: ${t.toString(8)}`)}(i.mode),t._mode=i.mode,"tree"===e.type?t._stat=void 0:t._stat=i}return t._stat}async content(t){}async oid(t){if(!1===t._oid){const e=(await this.treePromise).get(t._fullpath);t._oid=e.metadata.oid}return t._oid}}const M=Symbol("GitWalkSymbol");function F(){const t=Object.create(null);return Object.defineProperty(t,M,{value:function({fs:t,gitdir:e,cache:i}){return new N({fs:t,gitdir:e,cache:i})}}),Object.freeze(t),t}class H extends u{constructor(t){super(`Could not find ${t}.`),this.code=this.name=H.code,this.data={what:t}}}H.code="NotFoundError";class q extends u{constructor(t,e,i,r){super(`Object ${t} ${r?`at ${r}`:""}was anticipated to be a ${i} but it is a ${e}.`),this.code=this.name=q.code,this.data={oid:t,actual:e,expected:i,filepath:r}}}q.code="ObjectTypeError";class L extends u{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=L.code,this.data={value:t}}}L.code="InvalidOidError";class W extends u{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:\n[remote "${t}"]\n\tfetch = +refs/heads/*:refs/remotes/origin/*\n`),this.code=this.name=W.code,this.data={remote:t}}}W.code="NoRefspecError";class Z{constructor(t){if(this.refs=new Map,this.parsedConfig=[],t){let e=null;this.parsedConfig=t.trim().split("\n").map(t=>{if(/^\s*#/.test(t))return{line:t,comment:!0};const i=t.indexOf(" ");if(t.startsWith("^")){const i=t.slice(1);return this.refs.set(e+"^{}",i),{line:t,ref:e,peeled:i}}{const r=t.slice(0,i);return e=t.slice(i+1),this.refs.set(e,r),{line:t,ref:e,oid:r}}})}return this}static from(t){return new Z(t)}delete(t){this.parsedConfig=this.parsedConfig.filter(e=>e.ref!==t),this.refs.delete(t)}toString(){return this.parsedConfig.map(({line:t})=>t).join("\n")+"\n"}}class G{constructor({remotePath:t,localPath:e,force:i,matchPrefix:r}){Object.assign(this,{remotePath:t,localPath:e,force:i,matchPrefix:r})}static from(t){const[e,i,r,a,n]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),s="+"===e,o="*"===r;if(o!==("*"===n))throw new y("Invalid refspec");return new G({remotePath:i,localPath:a,force:s,matchPrefix:o})}translate(t){if(this.matchPrefix){if(t.startsWith(this.remotePath))return this.localPath+t.replace(this.remotePath,"")}else if(t===this.remotePath)return this.localPath;return null}reverseTranslate(t){if(this.matchPrefix){if(t.startsWith(this.localPath))return this.remotePath+t.replace(this.localPath,"")}else if(t===this.localPath)return this.remotePath;return null}}class K{constructor(t=[]){this.rules=t}static from(t){const e=[];for(const i of t)e.push(G.from(i));return new K(e)}add(t){const e=G.from(t);this.rules.push(e)}translate(t){const e=[];for(const i of this.rules)for(const r of t){const t=i.translate(r);t&&e.push([r,t])}return e}translateOne(t){let e=null;for(const i of this.rules){const r=i.translate(t);r&&(e=r)}return e}localNamespaces(){return this.rules.filter(t=>t.matchPrefix).map(t=>t.localPath.replace(/\/$/,""))}}function V(t,e){const i=t.replace(/\^\{\}$/,""),r=e.replace(/\^\{\}$/,""),a=-(i<r)||+(i>r);return 0===a?t.endsWith("^{}")?1:-1:a}
|
|
1
|
+
"use strict";var t=require("./_commonjsHelpers-Bjf42z7h.js"),e=require("./index-CEojr58e.js"),i=require("./index-BlteXxjY.js"),r=require("./crc32-Cc3OMFYk.js"),a=require("./installer-DPj-zT7L.js");function n(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(i){if("default"!==i&&!(i in t)){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}})}),Object.freeze(t)}var s,o,c,f,d,h,l,u,g={};function w(){if(o)return s;o=1;var t=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if("undefined"==typeof process||void 0===process.domain)throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||t.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||t.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||t.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=t.DEFAULT_MAX_PENDING};return t.DEFAULT_TIMEOUT=0,t.DEFAULT_MAX_OCCUPATION_TIME=0,t.DEFAULT_MAX_EXECUTION_TIME=0,t.DEFAULT_MAX_PENDING=1e3,t.prototype.acquire=function(t,e,i,r){if(Array.isArray(t))return this._acquireBatch(t,e,i,r);if("function"!=typeof e)throw new Error("You must pass a function to execute");var a=null,n=null,s=null;"function"!=typeof i&&(r=i,i=null,s=new this.Promise(function(t,e){a=t,n=e})),r=r||{};var o=!1,c=null,f=null,d=null,h=this,l=function(e,r,c){f&&(clearTimeout(f),f=null),d&&(clearTimeout(d),d=null),e&&(h.queues[t]&&0===h.queues[t].length&&delete h.queues[t],h.domainReentrant&&delete h.domains[t]),o||(s?r?n(r):a(c):"function"==typeof i&&i(r,c),o=!0),e&&h.queues[t]&&h.queues[t].length>0&&h.queues[t].shift()()},u=function(i){if(o)return l(i);c&&(clearTimeout(c),c=null),h.domainReentrant&&i&&(h.domains[t]=process.domain);var a=r.maxExecutionTime||h.maxExecutionTime;if(a&&(d=setTimeout(function(){h.queues[t]&&l(i,new Error("Maximum execution time is exceeded "+t))},a)),1===e.length){var n=!1;try{e(function(t,e){n||(n=!0,l(i,t,e))})}catch(t){n||(n=!0,l(i,t))}}else h._promiseTry(function(){return e()}).then(function(t){l(i,void 0,t)},function(t){l(i,t)})};h.domainReentrant&&process.domain&&(u=process.domain.bind(u));var g=r.maxPending||h.maxPending;if(h.queues[t])if(h.domainReentrant&&process.domain&&process.domain===h.domains[t])u(!1);else if(h.queues[t].length>=g)l(!1,new Error("Too many pending tasks in queue "+t));else{var w=function(){u(!0)};r.skipQueue?h.queues[t].unshift(w):h.queues[t].push(w);var p=r.timeout||h.timeout;p&&(c=setTimeout(function(){c=null,l(!1,new Error("async-lock timed out in queue "+t))},p))}else h.queues[t]=[],u(!0);var m=r.maxOccupationTime||h.maxOccupationTime;return m&&(f=setTimeout(function(){h.queues[t]&&l(!1,new Error("Maximum occupation time is exceeded in queue "+t))},m)),s||void 0},t.prototype._acquireBatch=function(t,e,i,r){"function"!=typeof i&&(r=i,i=null);var a=this,n=t.reduceRight(function(t,e){return function(t,e){return function(i){a.acquire(t,e,i,r)}}(e,t)},e);if("function"!=typeof i)return new this.Promise(function(t,e){1===n.length?n(function(i,r){i?e(i):t(r)}):t(n())});n(i)},t.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0},t.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(t){return this.Promise.reject(t)}},s=t}function p(){if(u)return l;u=1;var t=e.requireInherits(),r=function(){if(h)return d;h=1;var t=e.requireSafeBuffer().Buffer,r=i.requireToBuffer();function a(e,i){this._block=t.alloc(e),this._finalSize=i,this._blockSize=e,this._len=0}return a.prototype.update=function(t,e){t=r(t,e||"utf8");for(var i=this._block,a=this._blockSize,n=t.length,s=this._len,o=0;o<n;){for(var c=s%a,f=Math.min(n-o,a-c),d=0;d<f;d++)i[c+d]=t[o+d];o+=f,(s+=f)%a===0&&this._update(i)}return this._len+=n,this},a.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var r=(4294967295&i)>>>0,a=(i-r)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var n=this._hash();return t?n.toString(t):n},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},d=a}(),a=e.requireSafeBuffer().Buffer,n=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function o(){this.init(),this._w=s,r.call(this,64,56)}function c(t){return t<<1|t>>>31}function f(t){return t<<5|t>>>27}function g(t){return t<<30|t>>>2}function w(t,e,i,r){return 0===t?e&i|~e&r:2===t?e&i|e&r|i&r:e^i^r}return t(o,r),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(t){for(var e=this._w,i=0|this._a,r=0|this._b,a=0|this._c,s=0|this._d,o=0|this._e,d=0;d<16;++d)e[d]=t.readInt32BE(4*d);for(;d<80;++d)e[d]=c(e[d-3]^e[d-8]^e[d-14]^e[d-16]);for(var h=0;h<80;++h){var l=~~(h/20),u=f(i)+w(l,r,a,s)+o+e[h]+n[l]|0;o=s,s=a,a=g(r),r=i,i=u}this._a=i+this._a|0,this._b=r+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0},o.prototype._hash=function(){var t=a.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},l=o}var m,y={};function b(){return m||(m=1,function(t){var e="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var a in r)i(r,a)&&(t[a]=r[a])}}return t},t.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,i,r,a){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+r),a);else for(var n=0;n<r;n++)t[a+n]=e[i+n]},flattenChunks:function(t){var e,i,r,a,n,s;for(r=0,e=0,i=t.length;e<i;e++)r+=t[e].length;for(s=new Uint8Array(r),a=0,e=0,i=t.length;e<i;e++)n=t[e],s.set(n,a),a+=n.length;return s}},a={arraySet:function(t,e,i,r,a){for(var n=0;n<r;n++)t[a+n]=e[i+n]},flattenChunks:function(t){return[].concat.apply([],t)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,r)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,a))},t.setTyped(e)}(y)),y}var _,v,x,k,E,$,S,B,A={},R={},P={};function j(){if(_)return P;_=1;var t=b();function e(t){for(var e=t.length;--e>=0;)t[e]=0}var i=256,r=286,a=30,n=15,s=[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],o=[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],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=new Array(576);e(d);var h=new Array(60);e(h);var l=new Array(512);e(l);var u=new Array(256);e(u);var g=new Array(29);e(g);var w,p,m,y=new Array(a);function v(t,e,i,r,a){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=r,this.max_length=a,this.has_stree=t&&t.length}function x(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function k(t){return t<256?l[t]:l[256+(t>>>7)]}function E(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function $(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,E(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function S(t,e,i){$(t,i[2*e],i[2*e+1])}function B(t,e){var i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1}function A(t,e,i){var r,a,s=new Array(16),o=0;for(r=1;r<=n;r++)s[r]=o=o+i[r-1]<<1;for(a=0;a<=e;a++){var c=t[2*a+1];0!==c&&(t[2*a]=B(s[c]++,c))}}function R(t){var e;for(e=0;e<r;e++)t.dyn_ltree[2*e]=0;for(e=0;e<a;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function j(t){t.bi_valid>8?E(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function O(t,e,i,r){var a=2*e,n=2*i;return t[a]<t[n]||t[a]===t[n]&&r[e]<=r[i]}function I(t,e,i){for(var r=t.heap[i],a=i<<1;a<=t.heap_len&&(a<t.heap_len&&O(e,t.heap[a+1],t.heap[a],t.depth)&&a++,!O(e,r,t.heap[a],t.depth));)t.heap[i]=t.heap[a],i=a,a<<=1;t.heap[i]=r}function C(t,e,r){var a,n,c,f,d=0;if(0!==t.last_lit)do{a=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],n=t.pending_buf[t.l_buf+d],d++,0===a?S(t,n,e):(S(t,(c=u[n])+i+1,e),0!==(f=s[c])&&$(t,n-=g[c],f),S(t,c=k(--a),r),0!==(f=o[c])&&$(t,a-=y[c],f))}while(d<t.last_lit);S(t,256,e)}function z(t,e){var i,r,a,s=e.dyn_tree,o=e.stat_desc.static_tree,c=e.stat_desc.has_stree,f=e.stat_desc.elems,d=-1;for(t.heap_len=0,t.heap_max=573,i=0;i<f;i++)0!==s[2*i]?(t.heap[++t.heap_len]=d=i,t.depth[i]=0):s[2*i+1]=0;for(;t.heap_len<2;)s[2*(a=t.heap[++t.heap_len]=d<2?++d:0)]=1,t.depth[a]=0,t.opt_len--,c&&(t.static_len-=o[2*a+1]);for(e.max_code=d,i=t.heap_len>>1;i>=1;i--)I(t,s,i);a=f;do{i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],I(t,s,1),r=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=r,s[2*a]=s[2*i]+s[2*r],t.depth[a]=(t.depth[i]>=t.depth[r]?t.depth[i]:t.depth[r])+1,s[2*i+1]=s[2*r+1]=a,t.heap[1]=a++,I(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,r,a,s,o,c,f=e.dyn_tree,d=e.max_code,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,g=e.stat_desc.extra_base,w=e.stat_desc.max_length,p=0;for(s=0;s<=n;s++)t.bl_count[s]=0;for(f[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)(s=f[2*f[2*(r=t.heap[i])+1]+1]+1)>w&&(s=w,p++),f[2*r+1]=s,r>d||(t.bl_count[s]++,o=0,r>=g&&(o=u[r-g]),c=f[2*r],t.opt_len+=c*(s+o),l&&(t.static_len+=c*(h[2*r+1]+o)));if(0!==p){do{for(s=w-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[w]--,p-=2}while(p>0);for(s=w;0!==s;s--)for(r=t.bl_count[s];0!==r;)(a=t.heap[--i])>d||(f[2*a+1]!==s&&(t.opt_len+=(s-f[2*a+1])*f[2*a],f[2*a+1]=s),r--)}}(t,e),A(s,d,t.bl_count)}function D(t,e,i){var r,a,n=-1,s=e[1],o=0,c=7,f=4;for(0===s&&(c=138,f=3),e[2*(i+1)+1]=65535,r=0;r<=i;r++)a=s,s=e[2*(r+1)+1],++o<c&&a===s||(o<f?t.bl_tree[2*a]+=o:0!==a?(a!==n&&t.bl_tree[2*a]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,n=a,0===s?(c=138,f=3):a===s?(c=6,f=3):(c=7,f=4))}function T(t,e,i){var r,a,n=-1,s=e[1],o=0,c=7,f=4;for(0===s&&(c=138,f=3),r=0;r<=i;r++)if(a=s,s=e[2*(r+1)+1],!(++o<c&&a===s)){if(o<f)do{S(t,a,t.bl_tree)}while(0!==--o);else 0!==a?(a!==n&&(S(t,a,t.bl_tree),o--),S(t,16,t.bl_tree),$(t,o-3,2)):o<=10?(S(t,17,t.bl_tree),$(t,o-3,3)):(S(t,18,t.bl_tree),$(t,o-11,7));o=0,n=a,0===s?(c=138,f=3):a===s?(c=6,f=3):(c=7,f=4)}}e(y);var U=!1;function N(e,i,r,a){$(e,0+(a?1:0),3),function(e,i,r){j(e),E(e,r),E(e,~r),t.arraySet(e.pending_buf,e.window,i,r,e.pending),e.pending+=r}(e,i,r)}return P._tr_init=function(t){U||(!function(){var t,e,i,f,b,_=new Array(16);for(i=0,f=0;f<28;f++)for(g[f]=i,t=0;t<1<<s[f];t++)u[i++]=f;for(u[i-1]=f,b=0,f=0;f<16;f++)for(y[f]=b,t=0;t<1<<o[f];t++)l[b++]=f;for(b>>=7;f<a;f++)for(y[f]=b<<7,t=0;t<1<<o[f]-7;t++)l[256+b++]=f;for(e=0;e<=n;e++)_[e]=0;for(t=0;t<=143;)d[2*t+1]=8,t++,_[8]++;for(;t<=255;)d[2*t+1]=9,t++,_[9]++;for(;t<=279;)d[2*t+1]=7,t++,_[7]++;for(;t<=287;)d[2*t+1]=8,t++,_[8]++;for(A(d,287,_),t=0;t<a;t++)h[2*t+1]=5,h[2*t]=B(t,5);w=new v(d,s,257,r,n),p=new v(h,o,0,a,n),m=new v(new Array(0),c,0,19,7)}(),U=!0),t.l_desc=new x(t.dyn_ltree,w),t.d_desc=new x(t.dyn_dtree,p),t.bl_desc=new x(t.bl_tree,m),t.bi_buf=0,t.bi_valid=0,R(t)},P._tr_stored_block=N,P._tr_flush_block=function(t,e,r,a){var n,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<i;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),z(t,t.l_desc),z(t,t.d_desc),o=function(t){var e;for(D(t,t.dyn_ltree,t.l_desc.max_code),D(t,t.dyn_dtree,t.d_desc.max_code),z(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*f[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=n&&(n=s)):n=s=r+5,r+4<=n&&-1!==e?N(t,e,r,a):4===t.strategy||s===n?($(t,2+(a?1:0),3),C(t,d,h)):($(t,4+(a?1:0),3),function(t,e,i,r){var a;for($(t,e-257,5),$(t,i-1,5),$(t,r-4,4),a=0;a<r;a++)$(t,t.bl_tree[2*f[a]+1],3);T(t,t.dyn_ltree,e-1),T(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),C(t,t.dyn_ltree,t.dyn_dtree)),R(t),a&&j(t)},P._tr_tally=function(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(u[r]+i+1)]++,t.dyn_dtree[2*k(e)]++),t.last_lit===t.lit_bufsize-1},P._tr_align=function(t){$(t,2,3),S(t,256,d),function(t){16===t.bi_valid?(E(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)},P}function O(){if(x)return v;return x=1,v=function(t,e,i,r){for(var a=65535&t,n=t>>>16&65535,s=0;0!==i;){i-=s=i>2e3?2e3:i;do{n=n+(a=a+e[r++]|0)|0}while(--s);a%=65521,n%=65521}return a|n<<16}}function I(){if(E)return k;E=1;var t=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();return k=function(e,i,r,a){var n=t,s=a+r;e^=-1;for(var o=a;o<s;o++)e=e>>>8^n[255&(e^i[o])];return-1^e}}function C(){return S?$:(S=1,$={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"})}function z(){if(B)return R;B=1;var t,e=b(),i=j(),r=O(),a=I(),n=C(),s=-2,o=258,c=262,f=103,d=113,h=666;function l(t,e){return t.msg=n[e],e}function u(t){return(t<<1)-(t>4?9:0)}function g(t){for(var e=t.length;--e>=0;)t[e]=0}function w(t){var i=t.state,r=i.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(e.arraySet(t.output,i.pending_buf,i.pending_out,r,t.next_out),t.next_out+=r,i.pending_out+=r,t.total_out+=r,t.avail_out-=r,i.pending-=r,0===i.pending&&(i.pending_out=0))}function p(t,e){i._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,w(t.strm)}function m(t,e){t.pending_buf[t.pending++]=e}function y(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function _(t,i,n,s){var o=t.avail_in;return o>s&&(o=s),0===o?0:(t.avail_in-=o,e.arraySet(i,t.input,t.next_in,o,n),1===t.state.wrap?t.adler=r(t.adler,i,o,n):2===t.state.wrap&&(t.adler=a(t.adler,i,o,n)),t.next_in+=o,t.total_in+=o,o)}function v(t,e){var i,r,a=t.max_chain_length,n=t.strstart,s=t.prev_length,f=t.nice_match,d=t.strstart>t.w_size-c?t.strstart-(t.w_size-c):0,h=t.window,l=t.w_mask,u=t.prev,g=t.strstart+o,w=h[n+s-1],p=h[n+s];t.prev_length>=t.good_match&&(a>>=2),f>t.lookahead&&(f=t.lookahead);do{if(h[(i=e)+s]===p&&h[i+s-1]===w&&h[i]===h[n]&&h[++i]===h[n+1]){n+=2,i++;do{}while(h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&h[++n]===h[++i]&&n<g);if(r=o-(g-n),n=g-o,r>s){if(t.match_start=e,s=r,r>=f)break;w=h[n+s-1],p=h[n+s]}}}while((e=u[e&l])>d&&0!==--a);return s<=t.lookahead?s:t.lookahead}function x(t){var i,r,a,n,s,o=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=o+(o-c)){e.arraySet(t.window,t.window,o,o,0),t.match_start-=o,t.strstart-=o,t.block_start-=o,i=r=t.hash_size;do{a=t.head[--i],t.head[i]=a>=o?a-o:0}while(--r);i=r=o;do{a=t.prev[--i],t.prev[i]=a>=o?a-o:0}while(--r);n+=o}if(0===t.strm.avail_in)break;if(r=_(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+3-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<c&&0!==t.strm.avail_in)}function k(t,e){for(var r,a;;){if(t.lookahead<c){if(x(t),t.lookahead<c&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-c&&(t.match_length=v(t,r)),t.match_length>=3)if(a=i._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else a=i._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(a&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}function E(t,e){for(var r,a,n;;){if(t.lookahead<c){if(x(t),t.lookahead<c&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-c&&(t.match_length=v(t,r),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,a=i._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,a&&(p(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((a=i._tr_tally(t,0,t.window[t.strstart-1]))&&p(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(a=i._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}function $(t,e,i,r,a){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=r,this.func=a}function S(){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=8,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 e.Buf16(1146),this.dyn_dtree=new e.Buf16(122),this.bl_tree=new e.Buf16(78),g(this.dyn_ltree),g(this.dyn_dtree),g(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(16),this.heap=new e.Buf16(573),g(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(573),g(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 A(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:d,t.adler=2===e.wrap?0:1,e.last_flush=0,i._tr_init(e),0):l(t,s)}function P(e){var i,r=A(e);return 0===r&&((i=e.state).window_size=2*i.w_size,g(i.head),i.max_lazy_match=t[i.level].max_lazy,i.good_match=t[i.level].good_length,i.nice_match=t[i.level].nice_length,i.max_chain_length=t[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=2,i.match_available=0,i.ins_h=0),r}function z(t,i,r,a,n,o){if(!t)return s;var c=1;if(-1===i&&(i=6),a<0?(c=0,a=-a):a>15&&(c=2,a-=16),n<1||n>9||8!==r||a<8||a>15||i<0||i>9||o<0||o>4)return l(t,s);8===a&&(a=9);var f=new S;return t.state=f,f.strm=t,f.wrap=c,f.gzhead=null,f.w_bits=a,f.w_size=1<<f.w_bits,f.w_mask=f.w_size-1,f.hash_bits=n+7,f.hash_size=1<<f.hash_bits,f.hash_mask=f.hash_size-1,f.hash_shift=~~((f.hash_bits+3-1)/3),f.window=new e.Buf8(2*f.w_size),f.head=new e.Buf16(f.hash_size),f.prev=new e.Buf16(f.w_size),f.lit_bufsize=1<<n+6,f.pending_buf_size=4*f.lit_bufsize,f.pending_buf=new e.Buf8(f.pending_buf_size),f.d_buf=1*f.lit_bufsize,f.l_buf=3*f.lit_bufsize,f.level=i,f.strategy=o,f.method=r,P(t)}return t=[new $(0,0,0,0,function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(x(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+i;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,p(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-c&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(p(t,!1),t.strm.avail_out),1)}),new $(4,4,8,4,k),new $(4,5,16,8,k),new $(4,6,32,32,k),new $(4,4,16,16,E),new $(8,16,32,32,E),new $(8,16,128,128,E),new $(8,32,128,256,E),new $(32,128,258,1024,E),new $(32,258,258,4096,E)],R.deflateInit=function(t,e){return z(t,e,8,15,8,0)},R.deflateInit2=z,R.deflateReset=P,R.deflateResetKeep=A,R.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?s:(t.state.gzhead=e,0):s},R.deflate=function(e,r){var n,c,b,_;if(!e||!e.state||r>5||r<0)return e?l(e,s):s;if(c=e.state,!e.output||!e.input&&0!==e.avail_in||c.status===h&&4!==r)return l(e,0===e.avail_out?-5:s);if(c.strm=e,n=c.last_flush,c.last_flush=r,42===c.status)if(2===c.wrap)e.adler=0,m(c,31),m(c,139),m(c,8),c.gzhead?(m(c,(c.gzhead.text?1:0)+(c.gzhead.hcrc?2:0)+(c.gzhead.extra?4:0)+(c.gzhead.name?8:0)+(c.gzhead.comment?16:0)),m(c,255&c.gzhead.time),m(c,c.gzhead.time>>8&255),m(c,c.gzhead.time>>16&255),m(c,c.gzhead.time>>24&255),m(c,9===c.level?2:c.strategy>=2||c.level<2?4:0),m(c,255&c.gzhead.os),c.gzhead.extra&&c.gzhead.extra.length&&(m(c,255&c.gzhead.extra.length),m(c,c.gzhead.extra.length>>8&255)),c.gzhead.hcrc&&(e.adler=a(e.adler,c.pending_buf,c.pending,0)),c.gzindex=0,c.status=69):(m(c,0),m(c,0),m(c,0),m(c,0),m(c,0),m(c,9===c.level?2:c.strategy>=2||c.level<2?4:0),m(c,3),c.status=d);else{var v=8+(c.w_bits-8<<4)<<8;v|=(c.strategy>=2||c.level<2?0:c.level<6?1:6===c.level?2:3)<<6,0!==c.strstart&&(v|=32),v+=31-v%31,c.status=d,y(c,v),0!==c.strstart&&(y(c,e.adler>>>16),y(c,65535&e.adler)),e.adler=1}if(69===c.status)if(c.gzhead.extra){for(b=c.pending;c.gzindex<(65535&c.gzhead.extra.length)&&(c.pending!==c.pending_buf_size||(c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),w(e),b=c.pending,c.pending!==c.pending_buf_size));)m(c,255&c.gzhead.extra[c.gzindex]),c.gzindex++;c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),c.gzindex===c.gzhead.extra.length&&(c.gzindex=0,c.status=73)}else c.status=73;if(73===c.status)if(c.gzhead.name){b=c.pending;do{if(c.pending===c.pending_buf_size&&(c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),w(e),b=c.pending,c.pending===c.pending_buf_size)){_=1;break}_=c.gzindex<c.gzhead.name.length?255&c.gzhead.name.charCodeAt(c.gzindex++):0,m(c,_)}while(0!==_);c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),0===_&&(c.gzindex=0,c.status=91)}else c.status=91;if(91===c.status)if(c.gzhead.comment){b=c.pending;do{if(c.pending===c.pending_buf_size&&(c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),w(e),b=c.pending,c.pending===c.pending_buf_size)){_=1;break}_=c.gzindex<c.gzhead.comment.length?255&c.gzhead.comment.charCodeAt(c.gzindex++):0,m(c,_)}while(0!==_);c.gzhead.hcrc&&c.pending>b&&(e.adler=a(e.adler,c.pending_buf,c.pending-b,b)),0===_&&(c.status=f)}else c.status=f;if(c.status===f&&(c.gzhead.hcrc?(c.pending+2>c.pending_buf_size&&w(e),c.pending+2<=c.pending_buf_size&&(m(c,255&e.adler),m(c,e.adler>>8&255),e.adler=0,c.status=d)):c.status=d),0!==c.pending){if(w(e),0===e.avail_out)return c.last_flush=-1,0}else if(0===e.avail_in&&u(r)<=u(n)&&4!==r)return l(e,-5);if(c.status===h&&0!==e.avail_in)return l(e,-5);if(0!==e.avail_in||0!==c.lookahead||0!==r&&c.status!==h){var k=2===c.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(x(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=i._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(c,r):3===c.strategy?function(t,e){for(var r,a,n,s,c=t.window;;){if(t.lookahead<=o){if(x(t),t.lookahead<=o&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(a=c[n=t.strstart-1])===c[++n]&&a===c[++n]&&a===c[++n]){s=t.strstart+o;do{}while(a===c[++n]&&a===c[++n]&&a===c[++n]&&a===c[++n]&&a===c[++n]&&a===c[++n]&&a===c[++n]&&a===c[++n]&&n<s);t.match_length=o-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=i._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=i._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(c,r):t[c.level].func(c,r);if(3!==k&&4!==k||(c.status=h),1===k||3===k)return 0===e.avail_out&&(c.last_flush=-1),0;if(2===k&&(1===r?i._tr_align(c):5!==r&&(i._tr_stored_block(c,0,0,!1),3===r&&(g(c.head),0===c.lookahead&&(c.strstart=0,c.block_start=0,c.insert=0))),w(e),0===e.avail_out))return c.last_flush=-1,0}return 4!==r?0:c.wrap<=0?1:(2===c.wrap?(m(c,255&e.adler),m(c,e.adler>>8&255),m(c,e.adler>>16&255),m(c,e.adler>>24&255),m(c,255&e.total_in),m(c,e.total_in>>8&255),m(c,e.total_in>>16&255),m(c,e.total_in>>24&255)):(y(c,e.adler>>>16),y(c,65535&e.adler)),w(e),c.wrap>0&&(c.wrap=-c.wrap),0!==c.pending?0:1)},R.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==f&&e!==d&&e!==h?l(t,s):(t.state=null,e===d?l(t,-3):0):s},R.deflateSetDictionary=function(t,i){var a,n,o,c,f,d,h,l,u=i.length;if(!t||!t.state)return s;if(2===(c=(a=t.state).wrap)||1===c&&42!==a.status||a.lookahead)return s;for(1===c&&(t.adler=r(t.adler,i,u,0)),a.wrap=0,u>=a.w_size&&(0===c&&(g(a.head),a.strstart=0,a.block_start=0,a.insert=0),l=new e.Buf8(a.w_size),e.arraySet(l,i,u-a.w_size,a.w_size,0),i=l,u=a.w_size),f=t.avail_in,d=t.next_in,h=t.input,t.avail_in=u,t.next_in=0,t.input=i,x(a);a.lookahead>=3;){n=a.strstart,o=a.lookahead-2;do{a.ins_h=(a.ins_h<<a.hash_shift^a.window[n+3-1])&a.hash_mask,a.prev[n&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=n,n++}while(--o);a.strstart=n,a.lookahead=2,x(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=2,a.match_available=0,t.next_in=d,t.input=h,t.avail_in=f,a.wrap=c,0},R.deflateInfo="pako deflate (from Nodeca project)",R}var D,T,U,N,M={};function F(){if(D)return M;D=1;var t=b(),e=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(t){e=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){i=!1}for(var r=new t.Buf8(256),a=0;a<256;a++)r[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function n(r,a){if(a<65534&&(r.subarray&&i||!r.subarray&&e))return String.fromCharCode.apply(null,t.shrinkBuf(r,a));for(var n="",s=0;s<a;s++)n+=String.fromCharCode(r[s]);return n}return r[254]=r[254]=1,M.string2buf=function(e){var i,r,a,n,s,o=e.length,c=0;for(n=0;n<o;n++)55296==(64512&(r=e.charCodeAt(n)))&&n+1<o&&56320==(64512&(a=e.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(a-56320),n++),c+=r<128?1:r<2048?2:r<65536?3:4;for(i=new t.Buf8(c),s=0,n=0;s<c;n++)55296==(64512&(r=e.charCodeAt(n)))&&n+1<o&&56320==(64512&(a=e.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(a-56320),n++),r<128?i[s++]=r:r<2048?(i[s++]=192|r>>>6,i[s++]=128|63&r):r<65536?(i[s++]=224|r>>>12,i[s++]=128|r>>>6&63,i[s++]=128|63&r):(i[s++]=240|r>>>18,i[s++]=128|r>>>12&63,i[s++]=128|r>>>6&63,i[s++]=128|63&r);return i},M.buf2binstring=function(t){return n(t,t.length)},M.binstring2buf=function(e){for(var i=new t.Buf8(e.length),r=0,a=i.length;r<a;r++)i[r]=e.charCodeAt(r);return i},M.buf2string=function(t,e){var i,a,s,o,c=e||t.length,f=new Array(2*c);for(a=0,i=0;i<c;)if((s=t[i++])<128)f[a++]=s;else if((o=r[s])>4)f[a++]=65533,i+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&i<c;)s=s<<6|63&t[i++],o--;o>1?f[a++]=65533:s<65536?f[a++]=s:(s-=65536,f[a++]=55296|s>>10&1023,f[a++]=56320|1023&s)}return n(f,a)},M.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+r[t[i]]>e?i:e},M}function H(){if(U)return T;return U=1,T=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}}var q,L,W,Z,G,K,V,X,Y,J,Q,tt,et,it,rt,at,nt,st,ot,ct,ft,dt={},ht={};function lt(){if(G)return ht;G=1;var t=b(),e=O(),i=I(),r=L?q:(L=1,q=function(t,e){var i,r,a,n,s,o,c,f,d,h,l,u,g,w,p,m,y,b,_,v,x,k,E,$,S;i=t.state,r=t.next_in,$=t.input,a=r+(t.avail_in-5),n=t.next_out,S=t.output,s=n-(e-t.avail_out),o=n+(t.avail_out-257),c=i.dmax,f=i.wsize,d=i.whave,h=i.wnext,l=i.window,u=i.hold,g=i.bits,w=i.lencode,p=i.distcode,m=(1<<i.lenbits)-1,y=(1<<i.distbits)-1;t:do{g<15&&(u+=$[r++]<<g,g+=8,u+=$[r++]<<g,g+=8),b=w[u&m];e:for(;;){if(u>>>=_=b>>>24,g-=_,0==(_=b>>>16&255))S[n++]=65535&b;else{if(!(16&_)){if(64&_){if(32&_){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}b=w[(65535&b)+(u&(1<<_)-1)];continue e}for(v=65535&b,(_&=15)&&(g<_&&(u+=$[r++]<<g,g+=8),v+=u&(1<<_)-1,u>>>=_,g-=_),g<15&&(u+=$[r++]<<g,g+=8,u+=$[r++]<<g,g+=8),b=p[u&y];;){if(u>>>=_=b>>>24,g-=_,16&(_=b>>>16&255)){if(x=65535&b,g<(_&=15)&&(u+=$[r++]<<g,(g+=8)<_&&(u+=$[r++]<<g,g+=8)),(x+=u&(1<<_)-1)>c){t.msg="invalid distance too far back",i.mode=30;break t}if(u>>>=_,g-=_,x>(_=n-s)){if((_=x-_)>d&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(k=0,E=l,0===h){if(k+=f-_,_<v){v-=_;do{S[n++]=l[k++]}while(--_);k=n-x,E=S}}else if(h<_){if(k+=f+h-_,(_-=h)<v){v-=_;do{S[n++]=l[k++]}while(--_);if(k=0,h<v){v-=_=h;do{S[n++]=l[k++]}while(--_);k=n-x,E=S}}}else if(k+=h-_,_<v){v-=_;do{S[n++]=l[k++]}while(--_);k=n-x,E=S}for(;v>2;)S[n++]=E[k++],S[n++]=E[k++],S[n++]=E[k++],v-=3;v&&(S[n++]=E[k++],v>1&&(S[n++]=E[k++]))}else{k=n-x;do{S[n++]=S[k++],S[n++]=S[k++],S[n++]=S[k++],v-=3}while(v>2);v&&(S[n++]=S[k++],v>1&&(S[n++]=S[k++]))}break}if(64&_){t.msg="invalid distance code",i.mode=30;break t}b=p[(65535&b)+(u&(1<<_)-1)]}}break}}while(r<a&&n<o);r-=v=g>>3,u&=(1<<(g-=v<<3))-1,t.next_in=r,t.next_out=n,t.avail_in=r<a?a-r+5:5-(r-a),t.avail_out=n<o?o-n+257:257-(n-o),i.hold=u,i.bits=g}),a=function(){if(Z)return W;Z=1;var t=b(),e=15,i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[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],a=[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],n=[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];return W=function(s,o,c,f,d,h,l,u){var g,w,p,m,y,b,_,v,x,k=u.bits,E=0,$=0,S=0,B=0,A=0,R=0,P=0,j=0,O=0,I=0,C=null,z=0,D=new t.Buf16(16),T=new t.Buf16(16),U=null,N=0;for(E=0;E<=e;E++)D[E]=0;for($=0;$<f;$++)D[o[c+$]]++;for(A=k,B=e;B>=1&&0===D[B];B--);if(A>B&&(A=B),0===B)return d[h++]=20971520,d[h++]=20971520,u.bits=1,0;for(S=1;S<B&&0===D[S];S++);for(A<S&&(A=S),j=1,E=1;E<=e;E++)if(j<<=1,(j-=D[E])<0)return-1;if(j>0&&(0===s||1!==B))return-1;for(T[1]=0,E=1;E<e;E++)T[E+1]=T[E]+D[E];for($=0;$<f;$++)0!==o[c+$]&&(l[T[o[c+$]]++]=$);if(0===s?(C=U=l,b=19):1===s?(C=i,z-=257,U=r,N-=257,b=256):(C=a,U=n,b=-1),I=0,$=0,E=S,y=h,R=A,P=0,p=-1,m=(O=1<<A)-1,1===s&&O>852||2===s&&O>592)return 1;for(;;){_=E-P,l[$]<b?(v=0,x=l[$]):l[$]>b?(v=U[N+l[$]],x=C[z+l[$]]):(v=96,x=0),g=1<<E-P,S=w=1<<R;do{d[y+(I>>P)+(w-=g)]=_<<24|v<<16|x}while(0!==w);for(g=1<<E-1;I&g;)g>>=1;if(0!==g?(I&=g-1,I+=g):I=0,$++,0===--D[E]){if(E===B)break;E=o[c+l[$]]}if(E>A&&(I&m)!==p){for(0===P&&(P=A),y+=S,j=1<<(R=E-P);R+P<B&&!((j-=D[R+P])<=0);)R++,j<<=1;if(O+=1<<R,1===s&&O>852||2===s&&O>592)return 1;d[p=I&m]=A<<24|R<<16|y-h}}return 0!==I&&(d[y+I]=E-P<<24|64<<16),u.bits=A,0}}(),n=-2,s=12,o=30;function c(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function f(){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 t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(e){var i;return e&&e.state?(i=e.state,e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=1&i.wrap),i.mode=1,i.last=0,i.havedict=0,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new t.Buf32(852),i.distcode=i.distdyn=new t.Buf32(592),i.sane=1,i.back=-1,0):n}function h(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,d(t)):n}function l(t,e){var i,r;return t&&t.state?(r=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?n:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,h(t))):n}function u(t,e){var i,r;return t?(r=new f,t.state=r,r.window=null,0!==(i=l(t,e))&&(t.state=null),i):n}var g,w,p=!0;function m(e){if(p){var i;for(g=new t.Buf32(512),w=new t.Buf32(32),i=0;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for(a(1,e.lens,0,288,g,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;a(2,e.lens,0,32,w,0,e.work,{bits:5}),p=!1}e.lencode=g,e.lenbits=9,e.distcode=w,e.distbits=5}function y(e,i,r,a){var n,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new t.Buf8(s.wsize)),a>=s.wsize?(t.arraySet(s.window,i,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((n=s.wsize-s.wnext)>a&&(n=a),t.arraySet(s.window,i,r-a,n,s.wnext),(a-=n)?(t.arraySet(s.window,i,r-a,a,0),s.wnext=a,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0}return ht.inflateReset=h,ht.inflateReset2=l,ht.inflateResetKeep=d,ht.inflateInit=function(t){return u(t,15)},ht.inflateInit2=u,ht.inflate=function(f,d){var h,l,u,g,w,p,b,_,v,x,k,E,$,S,B,A,R,P,j,O,I,C,z,D,T=0,U=new t.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!f||!f.state||!f.output||!f.input&&0!==f.avail_in)return n;(h=f.state).mode===s&&(h.mode=13),w=f.next_out,u=f.output,b=f.avail_out,g=f.next_in,l=f.input,p=f.avail_in,_=h.hold,v=h.bits,x=p,k=b,C=0;t:for(;;)switch(h.mode){case 1:if(0===h.wrap){h.mode=13;break}for(;v<16;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(2&h.wrap&&35615===_){h.check=0,U[0]=255&_,U[1]=_>>>8&255,h.check=i(h.check,U,2,0),_=0,v=0,h.mode=2;break}if(h.flags=0,h.head&&(h.head.done=!1),!(1&h.wrap)||(((255&_)<<8)+(_>>8))%31){f.msg="incorrect header check",h.mode=o;break}if(8!=(15&_)){f.msg="unknown compression method",h.mode=o;break}if(v-=4,I=8+(15&(_>>>=4)),0===h.wbits)h.wbits=I;else if(I>h.wbits){f.msg="invalid window size",h.mode=o;break}h.dmax=1<<I,f.adler=h.check=1,h.mode=512&_?10:s,_=0,v=0;break;case 2:for(;v<16;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(h.flags=_,8!=(255&h.flags)){f.msg="unknown compression method",h.mode=o;break}if(57344&h.flags){f.msg="unknown header flags set",h.mode=o;break}h.head&&(h.head.text=_>>8&1),512&h.flags&&(U[0]=255&_,U[1]=_>>>8&255,h.check=i(h.check,U,2,0)),_=0,v=0,h.mode=3;case 3:for(;v<32;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.head&&(h.head.time=_),512&h.flags&&(U[0]=255&_,U[1]=_>>>8&255,U[2]=_>>>16&255,U[3]=_>>>24&255,h.check=i(h.check,U,4,0)),_=0,v=0,h.mode=4;case 4:for(;v<16;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.head&&(h.head.xflags=255&_,h.head.os=_>>8),512&h.flags&&(U[0]=255&_,U[1]=_>>>8&255,h.check=i(h.check,U,2,0)),_=0,v=0,h.mode=5;case 5:if(1024&h.flags){for(;v<16;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.length=_,h.head&&(h.head.extra_len=_),512&h.flags&&(U[0]=255&_,U[1]=_>>>8&255,h.check=i(h.check,U,2,0)),_=0,v=0}else h.head&&(h.head.extra=null);h.mode=6;case 6:if(1024&h.flags&&((E=h.length)>p&&(E=p),E&&(h.head&&(I=h.head.extra_len-h.length,h.head.extra||(h.head.extra=new Array(h.head.extra_len)),t.arraySet(h.head.extra,l,g,E,I)),512&h.flags&&(h.check=i(h.check,l,E,g)),p-=E,g+=E,h.length-=E),h.length))break t;h.length=0,h.mode=7;case 7:if(2048&h.flags){if(0===p)break t;E=0;do{I=l[g+E++],h.head&&I&&h.length<65536&&(h.head.name+=String.fromCharCode(I))}while(I&&E<p);if(512&h.flags&&(h.check=i(h.check,l,E,g)),p-=E,g+=E,I)break t}else h.head&&(h.head.name=null);h.length=0,h.mode=8;case 8:if(4096&h.flags){if(0===p)break t;E=0;do{I=l[g+E++],h.head&&I&&h.length<65536&&(h.head.comment+=String.fromCharCode(I))}while(I&&E<p);if(512&h.flags&&(h.check=i(h.check,l,E,g)),p-=E,g+=E,I)break t}else h.head&&(h.head.comment=null);h.mode=9;case 9:if(512&h.flags){for(;v<16;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(_!==(65535&h.check)){f.msg="header crc mismatch",h.mode=o;break}_=0,v=0}h.head&&(h.head.hcrc=h.flags>>9&1,h.head.done=!0),f.adler=h.check=0,h.mode=s;break;case 10:for(;v<32;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}f.adler=h.check=c(_),_=0,v=0,h.mode=11;case 11:if(0===h.havedict)return f.next_out=w,f.avail_out=b,f.next_in=g,f.avail_in=p,h.hold=_,h.bits=v,2;f.adler=h.check=1,h.mode=s;case s:if(5===d||6===d)break t;case 13:if(h.last){_>>>=7&v,v-=7&v,h.mode=27;break}for(;v<3;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}switch(h.last=1&_,v-=1,3&(_>>>=1)){case 0:h.mode=14;break;case 1:if(m(h),h.mode=20,6===d){_>>>=2,v-=2;break t}break;case 2:h.mode=17;break;case 3:f.msg="invalid block type",h.mode=o}_>>>=2,v-=2;break;case 14:for(_>>>=7&v,v-=7&v;v<32;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if((65535&_)!=(_>>>16^65535)){f.msg="invalid stored block lengths",h.mode=o;break}if(h.length=65535&_,_=0,v=0,h.mode=15,6===d)break t;case 15:h.mode=16;case 16:if(E=h.length){if(E>p&&(E=p),E>b&&(E=b),0===E)break t;t.arraySet(u,l,g,E,w),p-=E,g+=E,b-=E,w+=E,h.length-=E;break}h.mode=s;break;case 17:for(;v<14;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(h.nlen=257+(31&_),_>>>=5,v-=5,h.ndist=1+(31&_),_>>>=5,v-=5,h.ncode=4+(15&_),_>>>=4,v-=4,h.nlen>286||h.ndist>30){f.msg="too many length or distance symbols",h.mode=o;break}h.have=0,h.mode=18;case 18:for(;h.have<h.ncode;){for(;v<3;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.lens[N[h.have++]]=7&_,_>>>=3,v-=3}for(;h.have<19;)h.lens[N[h.have++]]=0;if(h.lencode=h.lendyn,h.lenbits=7,z={bits:h.lenbits},C=a(0,h.lens,0,19,h.lencode,0,h.work,z),h.lenbits=z.bits,C){f.msg="invalid code lengths set",h.mode=o;break}h.have=0,h.mode=19;case 19:for(;h.have<h.nlen+h.ndist;){for(;A=(T=h.lencode[_&(1<<h.lenbits)-1])>>>16&255,R=65535&T,!((B=T>>>24)<=v);){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(R<16)_>>>=B,v-=B,h.lens[h.have++]=R;else{if(16===R){for(D=B+2;v<D;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(_>>>=B,v-=B,0===h.have){f.msg="invalid bit length repeat",h.mode=o;break}I=h.lens[h.have-1],E=3+(3&_),_>>>=2,v-=2}else if(17===R){for(D=B+3;v<D;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}v-=B,I=0,E=3+(7&(_>>>=B)),_>>>=3,v-=3}else{for(D=B+7;v<D;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}v-=B,I=0,E=11+(127&(_>>>=B)),_>>>=7,v-=7}if(h.have+E>h.nlen+h.ndist){f.msg="invalid bit length repeat",h.mode=o;break}for(;E--;)h.lens[h.have++]=I}}if(h.mode===o)break;if(0===h.lens[256]){f.msg="invalid code -- missing end-of-block",h.mode=o;break}if(h.lenbits=9,z={bits:h.lenbits},C=a(1,h.lens,0,h.nlen,h.lencode,0,h.work,z),h.lenbits=z.bits,C){f.msg="invalid literal/lengths set",h.mode=o;break}if(h.distbits=6,h.distcode=h.distdyn,z={bits:h.distbits},C=a(2,h.lens,h.nlen,h.ndist,h.distcode,0,h.work,z),h.distbits=z.bits,C){f.msg="invalid distances set",h.mode=o;break}if(h.mode=20,6===d)break t;case 20:h.mode=21;case 21:if(p>=6&&b>=258){f.next_out=w,f.avail_out=b,f.next_in=g,f.avail_in=p,h.hold=_,h.bits=v,r(f,k),w=f.next_out,u=f.output,b=f.avail_out,g=f.next_in,l=f.input,p=f.avail_in,_=h.hold,v=h.bits,h.mode===s&&(h.back=-1);break}for(h.back=0;A=(T=h.lencode[_&(1<<h.lenbits)-1])>>>16&255,R=65535&T,!((B=T>>>24)<=v);){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(A&&!(240&A)){for(P=B,j=A,O=R;A=(T=h.lencode[O+((_&(1<<P+j)-1)>>P)])>>>16&255,R=65535&T,!(P+(B=T>>>24)<=v);){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}_>>>=P,v-=P,h.back+=P}if(_>>>=B,v-=B,h.back+=B,h.length=R,0===A){h.mode=26;break}if(32&A){h.back=-1,h.mode=s;break}if(64&A){f.msg="invalid literal/length code",h.mode=o;break}h.extra=15&A,h.mode=22;case 22:if(h.extra){for(D=h.extra;v<D;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.length+=_&(1<<h.extra)-1,_>>>=h.extra,v-=h.extra,h.back+=h.extra}h.was=h.length,h.mode=23;case 23:for(;A=(T=h.distcode[_&(1<<h.distbits)-1])>>>16&255,R=65535&T,!((B=T>>>24)<=v);){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(!(240&A)){for(P=B,j=A,O=R;A=(T=h.distcode[O+((_&(1<<P+j)-1)>>P)])>>>16&255,R=65535&T,!(P+(B=T>>>24)<=v);){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}_>>>=P,v-=P,h.back+=P}if(_>>>=B,v-=B,h.back+=B,64&A){f.msg="invalid distance code",h.mode=o;break}h.offset=R,h.extra=15&A,h.mode=24;case 24:if(h.extra){for(D=h.extra;v<D;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}h.offset+=_&(1<<h.extra)-1,_>>>=h.extra,v-=h.extra,h.back+=h.extra}if(h.offset>h.dmax){f.msg="invalid distance too far back",h.mode=o;break}h.mode=25;case 25:if(0===b)break t;if(E=k-b,h.offset>E){if((E=h.offset-E)>h.whave&&h.sane){f.msg="invalid distance too far back",h.mode=o;break}E>h.wnext?(E-=h.wnext,$=h.wsize-E):$=h.wnext-E,E>h.length&&(E=h.length),S=h.window}else S=u,$=w-h.offset,E=h.length;E>b&&(E=b),b-=E,h.length-=E;do{u[w++]=S[$++]}while(--E);0===h.length&&(h.mode=21);break;case 26:if(0===b)break t;u[w++]=h.length,b--,h.mode=21;break;case 27:if(h.wrap){for(;v<32;){if(0===p)break t;p--,_|=l[g++]<<v,v+=8}if(k-=b,f.total_out+=k,h.total+=k,k&&(f.adler=h.check=h.flags?i(h.check,u,k,w-k):e(h.check,u,k,w-k)),k=b,(h.flags?_:c(_))!==h.check){f.msg="incorrect data check",h.mode=o;break}_=0,v=0}h.mode=28;case 28:if(h.wrap&&h.flags){for(;v<32;){if(0===p)break t;p--,_+=l[g++]<<v,v+=8}if(_!==(4294967295&h.total)){f.msg="incorrect length check",h.mode=o;break}_=0,v=0}h.mode=29;case 29:C=1;break t;case o:C=-3;break t;case 31:return-4;default:return n}return f.next_out=w,f.avail_out=b,f.next_in=g,f.avail_in=p,h.hold=_,h.bits=v,(h.wsize||k!==f.avail_out&&h.mode<o&&(h.mode<27||4!==d))&&y(f,f.output,f.next_out,k-f.avail_out),x-=f.avail_in,k-=f.avail_out,f.total_in+=x,f.total_out+=k,h.total+=k,h.wrap&&k&&(f.adler=h.check=h.flags?i(h.check,u,k,f.next_out-k):e(h.check,u,k,f.next_out-k)),f.data_type=h.bits+(h.last?64:0)+(h.mode===s?128:0)+(20===h.mode||15===h.mode?256:0),(0===x&&0===k||4===d)&&0===C&&(C=-5),C},ht.inflateEnd=function(t){if(!t||!t.state)return n;var e=t.state;return e.window&&(e.window=null),t.state=null,0},ht.inflateGetHeader=function(t,e){var i;return t&&t.state&&2&(i=t.state).wrap?(i.head=e,e.done=!1,0):n},ht.inflateSetDictionary=function(t,i){var r,a=i.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?n:11===r.mode&&e(1,i,a,0)!==r.check?-3:y(t,i,a,a)?(r.mode=31,-4):(r.havedict=1,0):n},ht.inflateInfo="pako inflate (from Nodeca project)",ht}function ut(){return V?K:(V=1,K={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})}function gt(){if(J)return dt;J=1;var t=lt(),e=b(),i=F(),r=ut(),a=C(),n=H(),s=Y?X:(Y=1,X=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}),o=Object.prototype.toString;function c(f){if(!(this instanceof c))return new c(f);this.options=e.assign({chunkSize:16384,windowBits:0,to:""},f||{});var d=this.options;d.raw&&d.windowBits>=0&&d.windowBits<16&&(d.windowBits=-d.windowBits,0===d.windowBits&&(d.windowBits=-15)),!(d.windowBits>=0&&d.windowBits<16)||f&&f.windowBits||(d.windowBits+=32),d.windowBits>15&&d.windowBits<48&&(15&d.windowBits||(d.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new n,this.strm.avail_out=0;var h=t.inflateInit2(this.strm,d.windowBits);if(h!==r.Z_OK)throw new Error(a[h]);if(this.header=new s,t.inflateGetHeader(this.strm,this.header),d.dictionary&&("string"==typeof d.dictionary?d.dictionary=i.string2buf(d.dictionary):"[object ArrayBuffer]"===o.call(d.dictionary)&&(d.dictionary=new Uint8Array(d.dictionary)),d.raw&&(h=t.inflateSetDictionary(this.strm,d.dictionary))!==r.Z_OK))throw new Error(a[h])}function f(t,e){var i=new c(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}return c.prototype.push=function(a,n){var s,c,f,d,h,l=this.strm,u=this.options.chunkSize,g=this.options.dictionary,w=!1;if(this.ended)return!1;c=n===~~n?n:!0===n?r.Z_FINISH:r.Z_NO_FLUSH,"string"==typeof a?l.input=i.binstring2buf(a):"[object ArrayBuffer]"===o.call(a)?l.input=new Uint8Array(a):l.input=a,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new e.Buf8(u),l.next_out=0,l.avail_out=u),(s=t.inflate(l,r.Z_NO_FLUSH))===r.Z_NEED_DICT&&g&&(s=t.inflateSetDictionary(this.strm,g)),s===r.Z_BUF_ERROR&&!0===w&&(s=r.Z_OK,w=!1),s!==r.Z_STREAM_END&&s!==r.Z_OK)return this.onEnd(s),this.ended=!0,!1;l.next_out&&(0!==l.avail_out&&s!==r.Z_STREAM_END&&(0!==l.avail_in||c!==r.Z_FINISH&&c!==r.Z_SYNC_FLUSH)||("string"===this.options.to?(f=i.utf8border(l.output,l.next_out),d=l.next_out-f,h=i.buf2string(l.output,f),l.next_out=d,l.avail_out=u-d,d&&e.arraySet(l.output,l.output,f,d,0),this.onData(h)):this.onData(e.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(w=!0)}while((l.avail_in>0||0===l.avail_out)&&s!==r.Z_STREAM_END);return s===r.Z_STREAM_END&&(c=r.Z_FINISH),c===r.Z_FINISH?(s=t.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===r.Z_OK):c!==r.Z_SYNC_FLUSH||(this.onEnd(r.Z_OK),l.avail_out=0,!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===r.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=e.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},dt.Inflate=c,dt.inflate=f,dt.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},dt.ungzip=f,dt}function wt(){if(tt)return Q;tt=1;var t=b().assign,e=function(){if(N)return A;N=1;var t=z(),e=b(),i=F(),r=C(),a=H(),n=Object.prototype.toString;function s(o){if(!(this instanceof s))return new s(o);this.options=e.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},o||{});var c=this.options;c.raw&&c.windowBits>0?c.windowBits=-c.windowBits:c.gzip&&c.windowBits>0&&c.windowBits<16&&(c.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var f=t.deflateInit2(this.strm,c.level,c.method,c.windowBits,c.memLevel,c.strategy);if(0!==f)throw new Error(r[f]);if(c.header&&t.deflateSetHeader(this.strm,c.header),c.dictionary){var d;if(d="string"==typeof c.dictionary?i.string2buf(c.dictionary):"[object ArrayBuffer]"===n.call(c.dictionary)?new Uint8Array(c.dictionary):c.dictionary,0!==(f=t.deflateSetDictionary(this.strm,d)))throw new Error(r[f]);this._dict_set=!0}}function o(t,e){var i=new s(e);if(i.push(t,!0),i.err)throw i.msg||r[i.err];return i.result}return s.prototype.push=function(r,a){var s,o,c=this.strm,f=this.options.chunkSize;if(this.ended)return!1;o=a===~~a?a:!0===a?4:0,"string"==typeof r?c.input=i.string2buf(r):"[object ArrayBuffer]"===n.call(r)?c.input=new Uint8Array(r):c.input=r,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new e.Buf8(f),c.next_out=0,c.avail_out=f),1!==(s=t.deflate(c,o))&&0!==s)return this.onEnd(s),this.ended=!0,!1;0!==c.avail_out&&(0!==c.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(e.shrinkBuf(c.output,c.next_out))):this.onData(e.shrinkBuf(c.output,c.next_out)))}while((c.avail_in>0||0===c.avail_out)&&1!==s);return 4===o?(s=t.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,0===s):2!==o||(this.onEnd(0),c.avail_out=0,!0)},s.prototype.onData=function(t){this.chunks.push(t)},s.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=e.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},A.Deflate=s,A.deflate=o,A.deflateRaw=function(t,e){return(e=e||{}).raw=!0,o(t,e)},A.gzip=function(t,e){return(e=e||{}).gzip=!0,o(t,e)},A}(),i={};return t(i,e,gt(),ut()),Q=i}function pt(){if(it)return et;function t(t){return Array.isArray(t)?t:[t]}it=1;const e=/^\s+$/,i=/^\\!/,r=/^\\#/,a=/\r?\n/g,n=/^\.*\/|^\.+$/,s="undefined"!=typeof Symbol?Symbol.for("node-ignore"):"node-ignore",o=/([0-z])-([0-z])/g,c=[[/\\?\s+$/,t=>0===t.indexOf("\\")?" ":""],[/\\\s/g,()=>" "],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,i)=>e+6<i.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(t,e)=>`${e}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,i,r,a)=>"\\"===e?`\\[${i}${(t=>{const{length:e}=t;return t.slice(0,e-e%2)})(r)}${a}`:"]"===a&&r.length%2==0?`[${(t=>t.replace(o,(t,e,i)=>e.charCodeAt(0)<=i.charCodeAt(0)?t:""))(i)}${r}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],f=Object.create(null),d=t=>"string"==typeof t;class h{constructor(t,e,i,r){this.origin=t,this.pattern=e,this.negative=i,this.regex=r}}const l=(t,e)=>{const a=t;let n=!1;0===t.indexOf("!")&&(n=!0,t=t.substr(1));const s=((t,e,i)=>{const r=f[t];if(r)return r;const a=c.reduce((e,i)=>e.replace(i[0],i[1].bind(t)),t);return f[t]=i?new RegExp(a,"i"):new RegExp(a)})(t=t.replace(i,"!").replace(r,"#"),0,e);return new h(a,t,n,s)},u=(t,e)=>{throw new e(t)},g=(t,e,i)=>{if(!d(t))return i(`path must be a string, but got \`${e}\``,TypeError);if(!t)return i("path must not be empty",TypeError);if(g.isNotRelative(t)){return i(`path should be a ${"`path.relative()`d"} string, but got "${e}"`,RangeError)}return!0},w=t=>n.test(t);g.isNotRelative=w,g.convert=t=>t;class p{constructor({ignorecase:t=!0}={}){var e,i,r;this._rules=[],this._ignorecase=t,e=this,i=s,r=!0,Object.defineProperty(e,i,{value:r}),this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[s])return this._rules=this._rules.concat(t._rules),void(this._added=!0);if((t=>t&&d(t)&&!e.test(t)&&0!==t.indexOf("#"))(t)){const e=l(t,this._ignorecase);this._added=!0,this._rules.push(e)}}add(e){return this._added=!1,t(d(e)?(t=>t.split(a))(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,e){let i=!1,r=!1;return this._rules.forEach(a=>{const{negative:n}=a;if(r===n&&i!==r||n&&!i&&!r&&!e)return;a.regex.test(t)&&(i=!n,r=n)}),{ignored:i,unignored:r}}_test(t,e,i,r){const a=t&&g.convert(t);return g(a,t,u),this._t(a,e,i,r)}_t(t,e,i,r){if(t in e)return e[t];if(r||(r=t.split("/")),r.pop(),!r.length)return e[t]=this._testOne(t,i);const a=this._t(r.join("/")+"/",e,i,r);return e[t]=a.ignored?a:this._testOne(t,i)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(e){return t(e).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}}const m=t=>new p(t),y=()=>!1;if(m.isPathValid=t=>g(t&&g.convert(t),t,y),m.default=m,et=m,"undefined"!=typeof process&&(process.env&&process.env.IGNORE_TEST_WIN32||"win32"===process.platform)){const t=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");g.convert=t;const e=/^[a-z]:\//i;g.isNotRelative=t=>e.test(t)||w(t)}return et}function mt(){return st?nt:(st=1,nt=function(t,e){var i,r,a=t,n=e,s=a.length,o=n.length,c=!1,f=null,d=s+1,h=[],l=[],u=[],g="",w=function(t,e,i){return{x:t,y:e,k:i}},p=function(t,e){return{elem:t,t:e}},m=function(t,e,i){var r,c,f;for(r=e>i?h[t-1+d]:h[t+1+d],c=(f=Math.max(e,i))-t;c<s&&f<o&&a[c]===n[f];)++c,++f;return h[t+d]=l.length,l[l.length]=new w(c,f,r),f};return s>=o&&(i=a,r=s,a=n,n=i,s=o,o=r,c=!0,d=s+1),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return f},getlcs:function(){return g},getses:function(){return u},compose:function(){var t,e,i,r,y,b,_,v;for(t=o-s,e=s+o+3,i={},_=0;_<e;++_)i[_]=-1,h[_]=-1;r=-1;do{for(v=-++r;v<=t-1;++v)i[v+d]=m(v,i[v-1+d]+1,i[v+1+d]);for(v=t+r;v>=t+1;--v)i[v+d]=m(v,i[v-1+d]+1,i[v+1+d]);i[t+d]=m(t,i[t-1+d]+1,i[t+1+d])}while(i[t+d]!==o);for(f=t+2*r,y=h[t+d],b=[];-1!==y;)b[b.length]=new w(l[y].x,l[y].y,null),y=l[y].k;!function(t){var e,i,r;for(e=i=0,r=t.length-1;r>=0;--r)for(;e<t[r].x||i<t[r].y;)t[r].y-t[r].x>i-e?(u[u.length]=new p(n[i],c?-1:1),++i):t[r].y-t[r].x<i-e?(u[u.length]=new p(a[e],c?1:-1),++e):(u[u.length]=new p(a[e],0),g+=a[e],++e,++i)}(b)}}})}function yt(){if(ct)return ot;ct=1;var t=mt();function e(e,i){for(var r=[],a=e.length,n=i.length,s=function(e,i){var r=new t(e,i);r.compose();for(var a,n,s=r.getses(),o=e.length-1,c=i.length-1,f=s.length-1;f>=0;--f)s[f].t===r.SES_COMMON?(n?(n.chain={file1index:o,file2index:c,chain:null},n=n.chain):n=a={file1index:o,file2index:c,chain:null},o--,c--):s[f].t===r.SES_DELETE?o--:s[f].t===r.SES_ADD&&c--;var d={file1index:-1,file2index:-1,chain:null};return n?(n.chain=d,a):d}(e,i);null!==s;s=s.chain){var o=a-s.file1index-1,c=n-s.file2index-1;a=s.file1index,n=s.file2index,(o||c)&&r.push({file1:[a+1,o],file2:[n+1,c]})}return r.reverse(),r}return ot=function(t,i,r){var a=[],n=[t,i,r],s=function(t,i,r){var a,n=e(i,t),s=e(i,r),o=[];function c(t,e){o.push([t.file1[0],e,t.file1[1],t.file2[0],t.file2[1]])}for(a=0;a<n.length;a++)c(n[a],0);for(a=0;a<s.length;a++)c(s[a],2);o.sort(function(t,e){return t[0]-e[0]});var f=[],d=0;function h(t){t>d&&(f.push([1,d,t-d]),d=t)}for(var l=0;l<o.length;l++){for(var u=l,g=o[l],w=g[0],p=w+g[2];l<o.length-1;){var m=o[l+1],y=m[0];if(y>p)break;p=Math.max(p,y+m[2]),l++}if(h(w),u==l)g[4]>0&&f.push([g[1],g[3],g[4]]);else{var b={0:[t.length,-1,i.length,-1],2:[r.length,-1,i.length,-1]};for(a=u;a<=l;a++){var _=b[(g=o[a])[1]],v=g[0],x=v+g[2],k=g[3],E=k+g[4];_[0]=Math.min(k,_[0]),_[1]=Math.max(E,_[1]),_[2]=Math.min(v,_[2]),_[3]=Math.max(x,_[3])}var $=b[0][0]+(w-b[0][2]),S=b[0][1]+(p-b[0][3]),B=b[2][0]+(w-b[2][2]),A=b[2][1]+(p-b[2][3]);f.push([-1,$,S-$,w,p-w,B,A-B])}d=p}return h(i.length),f}(t,i,r),o=[];function c(){o.length&&a.push({ok:o}),o=[]}function f(t){for(var e=0;e<t.length;e++)o.push(t[e])}function d(e){if(e[2]!=e[6])return!0;for(var i=e[1],a=e[5],n=0;n<e[2];n++)if(t[n+i]!=r[n+a])return!0;return!1}for(var h=0;h<s.length;h++){var l=s[h],u=l[0];-1==u?d(l)?(c(),a.push({conflict:{a:t.slice(l[1],l[1]+l[2]),aIndex:l[1],o:i.slice(l[3],l[3]+l[4]),oIndex:l[3],b:r.slice(l[5],l[5]+l[6]),bIndex:l[5]}})):f(n[0].slice(l[1],l[1]+l[2])):f(n[u].slice(l[1],l[1]+l[2]))}return c(),a}}function bt(){if(ft)return g;function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}ft=1,Object.defineProperty(g,"__esModule",{value:!0});var e=t(f?c:(f=1,c=w())),i=t(p()),n=t(r.requireCrc32()),s=t(wt()),o=t(a.requirePify()),d=t(pt()),h=t(function(){if(at)return rt;function t(t,e,i){return e=e instanceof RegExp?e:new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),t.replace(e,i)}return at=1,rt={clean:function(e){if("string"!=typeof e)throw new Error("Expected a string, received: "+e);return e=t(e,"./","/"),e=t(e,"..","."),e=t(e," ","-"),e=t(e,/^[~^:?*\\\-]/g,""),e=t(e,/[~^:?*\\]/g,"-"),e=t(e,/[~^:?*\\\-]$/g,""),e=t(e,"@{","-"),e=t(e,/\.$/g,""),e=t(e,/\/$/g,""),t(e,/\.lock$/g,"")}}}()),l=t(yt());class u extends Error{constructor(t){super(t),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){const e=new u(t.message);return e.code=t.code,e.data=t.data,e.caller=t.caller,e.stack=t.stack,e}get isIsomorphicGitError(){return!0}}class m extends u{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=m.code,this.data={filepaths:t}}}m.code="UnmergedPathsError";class y extends u{constructor(t){super(`An internal error caused this command to fail.\n\nIf you're not a developer, report the bug to the developers of the application you're using. If this is a bug in isomorphic-git then you should create a proper bug yourselves. The bug should include a minimal reproduction and details about the version and environment.\n\nPlease file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${t}`),this.code=this.name=y.code,this.data={message:t}}}y.code="InternalError";class b extends u{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=b.code,this.data={filepath:t}}}b.code="UnsafeFilepathError";class _{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){const e=this.buffer.slice(this._start,this._start+t);return this._start+=t,e}toString(t,e){const i=this.buffer.toString(t,this._start,this._start+e);return this._start+=e,i}write(t,e,i){const r=this.buffer.write(t,this._start,e,i);return this._start+=e,r}copy(t,e,i){const r=t.copy(this.buffer,this._start,e,i);return this._start+=r,r}readUInt8(){const t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){const e=this.buffer.writeUInt8(t,this._start);return this._start+=1,e}readUInt16BE(){const t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){const e=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,e}readUInt32BE(){const t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){const e=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,e}}function v(t,e){return-(t<e)||+(t>e)}function x(t,e){return v(t.path,e.path)}function k(t){let e=t>0?t>>12:0;4!==e&&8!==e&&10!==e&&14!==e&&(e=8);let i=511&t;return i=73&i?493:420,8!==e&&(i=0),(e<<12)+i}const E=2**32;function $(t,e,i,r){if(void 0!==t&&void 0!==e)return[t,e];void 0===i&&(i=r.valueOf());const a=Math.floor(i/1e3);return[a,1e6*(i-1e3*a)]}function S(t){const[e,i]=$(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[r,a]=$(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%E,ctimeNanoseconds:i%E,mtimeSeconds:r%E,mtimeNanoseconds:a%E,dev:t.dev%E,ino:t.ino%E,mode:k(t.mode%E),uid:t.uid%E,gid:t.gid%E,size:t.size>-1?t.size%E:0}}let B=null;async function A(t){return null===B&&(B=await async function(){try{return"da39a3ee5e6b4b0d3255bfef95601890afd80709"===await R(new Uint8Array([]))}catch(t){}return!1}()),B?R(t):function(t){return(new i).update(t).digest("hex")}(t)}async function R(t){return function(t){let e="";for(const i of new Uint8Array(t))i<16&&(e+="0"),e+=i.toString(16);return e}(await crypto.subtle.digest("SHA-1",t))}function P(t){return{assumeValid:Boolean(32768&t),extended:Boolean(16384&t),stage:(12288&t)>>12,nameLength:4095&t}}class j{constructor(t,e){this._dirty=!1,this._unmergedPaths=e||new Set,this._entries=t||new Map}_addEntry(t){if(0===t.flags.stage)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let e=this._entries.get(t.path);e||(this._entries.set(t.path,t),e=t),e.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(Buffer.isBuffer(t))return j.fromBuffer(t);if(null===t)return new j(null);throw new y("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(0===t.length)throw new y("Index file is empty (.git/index)");const e=new j,i=new _(t),r=i.toString("utf8",4);if("DIRC"!==r)throw new y(`Invalid dircache magic file number: ${r}`);const a=await A(t.slice(0,-20)),n=t.slice(-20).toString("hex");if(n!==a)throw new y(`Invalid checksum in GitIndex buffer: expected ${n} but saw ${a}`);const s=i.readUInt32BE();if(2!==s)throw new y(`Unsupported dircache version: ${s}`);const o=i.readUInt32BE();let c=0;for(;!i.eof()&&c<o;){const r={};r.ctimeSeconds=i.readUInt32BE(),r.ctimeNanoseconds=i.readUInt32BE(),r.mtimeSeconds=i.readUInt32BE(),r.mtimeNanoseconds=i.readUInt32BE(),r.dev=i.readUInt32BE(),r.ino=i.readUInt32BE(),r.mode=i.readUInt32BE(),r.uid=i.readUInt32BE(),r.gid=i.readUInt32BE(),r.size=i.readUInt32BE(),r.oid=i.slice(20).toString("hex");const a=i.readUInt16BE();r.flags=P(a);const n=t.indexOf(0,i.tell()+1)-i.tell();if(n<1)throw new y(`Got a path length of: ${n}`);if(r.path=i.toString("utf8",n),r.path.includes("..\\")||r.path.includes("../"))throw new b(r.path);let s=8-(i.tell()-12)%8;for(0===s&&(s=8);s--;){const t=i.readUInt8();if(0!==t)throw new y(`Expected 1-8 null characters but got '${t}' after ${r.path}`);if(i.eof())throw new y("Unexpected end of file")}r.stages=[],e._addEntry(r),c++}return e}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(x)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(t=>t.stages.length>1?t.stages.filter(t=>t):t)}*[Symbol.iterator](){for(const t of this.entries)yield t}insert({filepath:t,stats:e,oid:i,stage:r=0}){e||(e={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),e=S(e);const a=Buffer.from(t),n={ctimeSeconds:e.ctimeSeconds,ctimeNanoseconds:e.ctimeNanoseconds,mtimeSeconds:e.mtimeSeconds,mtimeNanoseconds:e.mtimeNanoseconds,dev:e.dev,ino:e.ino,mode:e.mode||33188,uid:e.uid,gid:e.gid,size:e.size,path:t,oid:i,flags:{assumeValid:!1,extended:!1,stage:r,nameLength:a.length<4095?a.length:4095},stages:[]};this._addEntry(n),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(const e of this._entries.keys())e.startsWith(t+"/")&&this._entries.delete(e);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join("\n")}static async _entryToBuffer(t){const e=Buffer.from(t.path),i=8*Math.ceil((62+e.length+1)/8),r=Buffer.alloc(i),a=new _(r),n=S(t);return a.writeUInt32BE(n.ctimeSeconds),a.writeUInt32BE(n.ctimeNanoseconds),a.writeUInt32BE(n.mtimeSeconds),a.writeUInt32BE(n.mtimeNanoseconds),a.writeUInt32BE(n.dev),a.writeUInt32BE(n.ino),a.writeUInt32BE(n.mode),a.writeUInt32BE(n.uid),a.writeUInt32BE(n.gid),a.writeUInt32BE(n.size),a.write(t.oid,20,"hex"),a.writeUInt16BE(function(t){const e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((3&e.stage)<<12)+(4095&e.nameLength)}(t)),a.write(t.path,e.length,"utf8"),r}async toObject(){const t=Buffer.alloc(12),e=new _(t);e.write("DIRC",4,"utf8"),e.writeUInt32BE(2),e.writeUInt32BE(this.entriesFlat.length);let i=[];for(const t of this.entries)if(i.push(j._entryToBuffer(t)),t.stages.length>1)for(const e of t.stages)e&&e!==t&&i.push(j._entryToBuffer(e));i=await Promise.all(i);const r=Buffer.concat(i),a=Buffer.concat([t,r]),n=await A(a);return Buffer.concat([a,Buffer.from(n,"hex")])}}function O(t,e,i=!0,r=!0){const a=S(t),n=S(e);return i&&a.mode!==n.mode||a.mtimeSeconds!==n.mtimeSeconds||a.ctimeSeconds!==n.ctimeSeconds||a.uid!==n.uid||a.gid!==n.gid||r&&a.ino!==n.ino||a.size!==n.size}let I=null;const C=Symbol("IndexCache");class z{static async acquire({fs:t,gitdir:i,cache:r,allowUnmerged:a=!0},n){r[C]||(r[C]={map:new Map,stats:new Map});const s=`${i}/index`;let o;null===I&&(I=new e({maxPending:1/0}));let c=[];return await I.acquire(s,async()=>{const e=r[C];await async function(t,e,i){const r=i.stats.get(e);if(void 0===r)return!0;if(null===r)return!1;const a=await t.lstat(e);return null!==a&&O(r,a)}(t,s,e)&&await async function(t,e,i){const[r,a]=await Promise.all([t.lstat(e),t.read(e)]),n=await j.from(a);i.map.set(e,n),i.stats.set(e,r)}(t,s,e);const i=e.map.get(s);if(c=i.unmergedPaths,c.length&&!a)throw new m(c);if(o=await n(i),i._dirty){const r=await i.toObject();await t.write(s,r),e.stats.set(s,await t.lstat(s)),i._dirty=!1}}),o}}function D(t){const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function T(t){const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return-1===e?".":0===e?"/":t.slice(0,e)}function U(t){const e=new Map,i=function(t){if(!e.has(t)){const r={type:"tree",fullpath:t,basename:D(t),metadata:{},children:[]};e.set(t,r),r.parent=i(T(t)),r.parent&&r.parent!==r&&r.parent.children.push(r)}return e.get(t)},r=function(t,r){if(!e.has(t)){const a={type:"blob",fullpath:t,basename:D(t),metadata:r,parent:i(T(t)),children:[]};a.parent&&a.parent.children.push(a),e.set(t,a)}return e.get(t)};i(".");for(const e of t)r(e.path,e);return e}class N{constructor({fs:t,gitdir:e,cache:i}){this.treePromise=z.acquire({fs:t,gitdir:e,cache:i},async function(t){return U(t.entries)});const r=this;this.ConstructEntry=class{constructor(t){this._fullpath=t,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return r.type(this)}async mode(){return r.mode(this)}async stat(){return r.stat(this)}async content(){return r.content(this)}async oid(){return r.oid(this)}}}async readdir(t){const e=t._fullpath,i=(await this.treePromise).get(e);if(!i)return null;if("blob"===i.type)return null;if("tree"!==i.type)throw new Error(`ENOTDIR: not a directory, scandir '${e}'`);const r=i.children.map(t=>t.fullpath);return r.sort(v),r}async type(t){return!1===t._type&&await t.stat(),t._type}async mode(t){return!1===t._mode&&await t.stat(),t._mode}async stat(t){if(!1===t._stat){const e=(await this.treePromise).get(t._fullpath);if(!e)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);const i="tree"===e.type?{}:S(e.metadata);t._type="tree"===e.type?"tree":function(t){switch(t){case 16384:return"tree";case 33188:case 33261:case 40960:return"blob";case 57344:return"commit"}throw new y(`Unexpected GitTree entry mode: ${t.toString(8)}`)}(i.mode),t._mode=i.mode,"tree"===e.type?t._stat=void 0:t._stat=i}return t._stat}async content(t){}async oid(t){if(!1===t._oid){const e=(await this.treePromise).get(t._fullpath);t._oid=e.metadata.oid}return t._oid}}const M=Symbol("GitWalkSymbol");function F(){const t=Object.create(null);return Object.defineProperty(t,M,{value:function({fs:t,gitdir:e,cache:i}){return new N({fs:t,gitdir:e,cache:i})}}),Object.freeze(t),t}class H extends u{constructor(t){super(`Could not find ${t}.`),this.code=this.name=H.code,this.data={what:t}}}H.code="NotFoundError";class q extends u{constructor(t,e,i,r){super(`Object ${t} ${r?`at ${r}`:""}was anticipated to be a ${i} but it is a ${e}.`),this.code=this.name=q.code,this.data={oid:t,actual:e,expected:i,filepath:r}}}q.code="ObjectTypeError";class L extends u{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=L.code,this.data={value:t}}}L.code="InvalidOidError";class W extends u{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:\n[remote "${t}"]\n\tfetch = +refs/heads/*:refs/remotes/origin/*\n`),this.code=this.name=W.code,this.data={remote:t}}}W.code="NoRefspecError";class Z{constructor(t){if(this.refs=new Map,this.parsedConfig=[],t){let e=null;this.parsedConfig=t.trim().split("\n").map(t=>{if(/^\s*#/.test(t))return{line:t,comment:!0};const i=t.indexOf(" ");if(t.startsWith("^")){const i=t.slice(1);return this.refs.set(e+"^{}",i),{line:t,ref:e,peeled:i}}{const r=t.slice(0,i);return e=t.slice(i+1),this.refs.set(e,r),{line:t,ref:e,oid:r}}})}return this}static from(t){return new Z(t)}delete(t){this.parsedConfig=this.parsedConfig.filter(e=>e.ref!==t),this.refs.delete(t)}toString(){return this.parsedConfig.map(({line:t})=>t).join("\n")+"\n"}}class G{constructor({remotePath:t,localPath:e,force:i,matchPrefix:r}){Object.assign(this,{remotePath:t,localPath:e,force:i,matchPrefix:r})}static from(t){const[e,i,r,a,n]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),s="+"===e,o="*"===r;if(o!==("*"===n))throw new y("Invalid refspec");return new G({remotePath:i,localPath:a,force:s,matchPrefix:o})}translate(t){if(this.matchPrefix){if(t.startsWith(this.remotePath))return this.localPath+t.replace(this.remotePath,"")}else if(t===this.remotePath)return this.localPath;return null}reverseTranslate(t){if(this.matchPrefix){if(t.startsWith(this.localPath))return this.remotePath+t.replace(this.localPath,"")}else if(t===this.localPath)return this.remotePath;return null}}class K{constructor(t=[]){this.rules=t}static from(t){const e=[];for(const i of t)e.push(G.from(i));return new K(e)}add(t){const e=G.from(t);this.rules.push(e)}translate(t){const e=[];for(const i of this.rules)for(const r of t){const t=i.translate(r);t&&e.push([r,t])}return e}translateOne(t){let e=null;for(const i of this.rules){const r=i.translate(t);r&&(e=r)}return e}localNamespaces(){return this.rules.filter(t=>t.matchPrefix).map(t=>t.localPath.replace(/\/$/,""))}}function V(t,e){const i=t.replace(/\^\{\}$/,""),r=e.replace(/\^\{\}$/,""),a=-(i<r)||+(i>r);return 0===a?t.endsWith("^{}")?1:-1:a}
|
|
2
2
|
/*!
|
|
3
3
|
* This code for `path.join` is directly copied from @zenfs/core/path for bundle size improvements.
|
|
4
4
|
* SPDX-License-Identifier: LGPL-3.0-or-later
|