architwin 1.0.13 → 1.0.14
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 +31 -7
- package/bundle/showcase.html +1 -1
- package/index.js +40 -0
- package/lib/architwin.d.ts +6 -0
- package/lib/architwin.min.js +2 -1
- package/lib/architwin.min.js.LICENSE.txt +11 -0
- package/lib/types.d.ts +16 -2
- package/package.json +10 -5
- package/tsconfig.json +4 -2
- package/webpack.config.js +28 -0
- package/lib/types.js +0 -9
package/README.md
CHANGED
|
@@ -1,19 +1,43 @@
|
|
|
1
1
|
# Architwin Library
|
|
2
2
|
ArchiTwin Library
|
|
3
3
|
|
|
4
|
+
## Table of Contents
|
|
5
|
+
---------------------
|
|
6
|
+
- [Architwin Library](#architwin-library)
|
|
7
|
+
- [Table of Contents](#table-of-contents)
|
|
8
|
+
- [Installation](#installation)
|
|
9
|
+
- [Install Using NPM](#install-using-npm)
|
|
10
|
+
- [Getting Started](#getting-started)
|
|
11
|
+
- [Define an iFrame as target for the Showcase](#define-an-iframe-as-target-for-the-showcase)
|
|
12
|
+
- [Import the library](#import-the-library)
|
|
13
|
+
- [Connect to a Space](#connect-to-a-space)
|
|
14
|
+
- [Connection Parameters](#connection-parameters)
|
|
15
|
+
- [Config Options](#config-options)
|
|
16
|
+
- [Space Navigation and Camera Control](#space-navigation-and-camera-control)
|
|
17
|
+
- [Moving Around](#moving-around)
|
|
18
|
+
- [Rotate, Pan and Tilt Camera](#rotate-pan-and-tilt-camera)
|
|
19
|
+
- [Space Overview](#space-overview)
|
|
20
|
+
- [Points of Interest](#points-of-interest)
|
|
21
|
+
- [Function Reference](#function-reference)
|
|
22
|
+
- [Tags](#tags)
|
|
23
|
+
- [Sweeps](#sweeps)
|
|
24
|
+
- [Video](#video)
|
|
25
|
+
- [Navigation](#navigation)
|
|
26
|
+
- [Camera](#camera)
|
|
27
|
+
- [Objects](#objects)
|
|
4
28
|
## Installation
|
|
5
29
|
---------------------
|
|
6
30
|
### Install Using NPM
|
|
7
31
|
To install the latest ArchiTwin package:
|
|
8
|
-
|
|
32
|
+
````bash
|
|
9
33
|
npm i architwin
|
|
10
|
-
|
|
34
|
+
````
|
|
11
35
|
## Getting Started
|
|
12
36
|
------------------------
|
|
13
|
-
### Integrating the Library to your Application
|
|
14
|
-
|
|
15
37
|
#### Define an iFrame as target for the Showcase
|
|
16
38
|
|
|
39
|
+
This example uses Vue's ref attribute to reference the target iFrame. Please consult the official documentation of your preferred framework of choice on how to do reference a target component.
|
|
40
|
+
|
|
17
41
|
````html
|
|
18
42
|
<template>
|
|
19
43
|
<div>
|
|
@@ -50,7 +74,7 @@ const authUser = {
|
|
|
50
74
|
</script>
|
|
51
75
|
````
|
|
52
76
|
|
|
53
|
-
####
|
|
77
|
+
#### Connect to a Space
|
|
54
78
|
|
|
55
79
|
````typescript
|
|
56
80
|
<script lang="ts">
|
|
@@ -156,8 +180,8 @@ export interface IMPConfig{
|
|
|
156
180
|
- 0 Hide the VR button.
|
|
157
181
|
- 1 Default Show the VR button.
|
|
158
182
|
|
|
159
|
-
|
|
160
|
-
|
|
183
|
+
## Space Navigation and Camera Control
|
|
184
|
+
-----------------------------
|
|
161
185
|
#### Moving Around
|
|
162
186
|
|
|
163
187
|
You can navigate around the space using keyboard arrow keys or using a mouse.
|
package/bundle/showcase.html
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
|
|
99
99
|
<script src='vendors/three/0.146.0/three.min.js'></script>
|
|
100
100
|
<script src='js/browser-check.js'></script>
|
|
101
|
-
<script src='js/showcase.js'></script>
|
|
101
|
+
<script src='https://cdn.jsdelivr.net/npm/architwin@1.0.13/bundle/js/showcase.js'></script>
|
|
102
102
|
<script>
|
|
103
103
|
var detailObject = {
|
|
104
104
|
config: {"apiHost":"https://my.matterport.com","pointerPreventDefault":false,"disableMobileRedirect":true}
|
package/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as atwin from './lib/architwin'
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
connectSpace,
|
|
5
|
+
gotoTag,
|
|
6
|
+
getCurrentSweep,
|
|
7
|
+
getCurrentSweepPosition,
|
|
8
|
+
moveToSweep,
|
|
9
|
+
getNearbySweeps,
|
|
10
|
+
pauseVideo,
|
|
11
|
+
playVideo,
|
|
12
|
+
getCurrentCameraPose,
|
|
13
|
+
getCameraPosition,
|
|
14
|
+
moveInDirection,
|
|
15
|
+
cameraLookAt,
|
|
16
|
+
cameraPan,
|
|
17
|
+
cameraRotate,
|
|
18
|
+
getViewMode,
|
|
19
|
+
setViewMode
|
|
20
|
+
} = atwin
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
atwin as default,
|
|
24
|
+
connectSpace,
|
|
25
|
+
gotoTag,
|
|
26
|
+
getCurrentSweep,
|
|
27
|
+
getCurrentSweepPosition,
|
|
28
|
+
moveToSweep,
|
|
29
|
+
getNearbySweeps,
|
|
30
|
+
pauseVideo,
|
|
31
|
+
playVideo,
|
|
32
|
+
getCurrentCameraPose,
|
|
33
|
+
getCameraPosition,
|
|
34
|
+
moveInDirection,
|
|
35
|
+
cameraLookAt,
|
|
36
|
+
cameraPan,
|
|
37
|
+
cameraRotate,
|
|
38
|
+
getViewMode,
|
|
39
|
+
setViewMode
|
|
40
|
+
}
|
package/lib/architwin.d.ts
CHANGED
|
@@ -18,6 +18,12 @@ declare function pauseVideo(videoId: number): void;
|
|
|
18
18
|
declare function cameraRotate(x: number, y: number, speed: number): Promise<void>;
|
|
19
19
|
declare function cameraPan(x: number, z: number): Promise<void>;
|
|
20
20
|
declare function cameraLookAt(x: number, y: number): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Moves the camera position in the direction of the argument provided.
|
|
23
|
+
* @constructor
|
|
24
|
+
* @param direction FORWARD,BACKWARD,LEFT,RIGHT,UP,DOWN
|
|
25
|
+
* @type {string}
|
|
26
|
+
*/
|
|
21
27
|
declare function moveInDirection(direction: string): Promise<void>;
|
|
22
28
|
declare function getViewMode(): MpSdk.Mode.Mode;
|
|
23
29
|
declare function setViewMode(mode: string): Promise<void>;
|
package/lib/architwin.min.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function s(c){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(u){c=[6,u],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.setViewMode=exports.getViewMode=exports.cameraRotate=exports.cameraPan=exports.cameraLookAt=exports.moveInDirection=exports.getCameraPosition=exports.getCurrentCameraPose=exports.playVideo=exports.pauseVideo=exports.getNearbySweeps=exports.moveToSweep=exports.getCurrentSweepPosition=exports.getCurrentSweep=exports.gotoTag=exports.connectSpace=exports.sweeps=exports.tags=void 0;var axios_1=require("axios"),mathjs_1=require("mathjs"),jszip_1=require("jszip"),jszip_utils_1=require("jszip-utils"),_config={aws:{region:"ap-northeast-1",accessKeyId:"AKIAVVUXZ66KW7GBSW7A",secretAccessKey:"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'"},mp:{sdkKey:"a3ae8341bd8f44899eba16df86307d7d",urlParams:["help","play","nt","play","qs","brand","dh","tour","gt","hr","mls","mt","tagNav","pin","portal","f","fp","lang","kb","lp","st","title","tourcta","wts","ts","hl","vr","nozoom","search","wh",]}},apiURL="http://localhost:5173/api/v1/",sdkKey=_config.mp.sdkKey,urlParams=_config.mp.urlParams;console.log("apiURL...",apiURL);var _api={},_space={},_atwin={},_tags=[],_objects=[],tags=[];exports.tags=tags;var sweeps=[];exports.sweeps=sweeps;var _allSlideShow=[],_slideShowImage=[],_currentSlideShowID=0,_currentSlideIndex=0,_currentSlideShow=null,_timer=null,_videos=[],_currentViewMode="",_3DXObject=[],_unrenderedObjects=[],activateRenderOnDemand=!0,previousTimestamp=0,_currentSweep={},_currentCameraPose={},_sweeps=[],_atwinSrc="/bundle/showcase.html?m=''&applicationKey=".concat(sdkKey,"&newtags=1");function connectSpace(e,t,n){var r;return __awaiter(this,void 0,void 0,function(){var i,o,a,s,c,u,d,l=this;return __generator(this,function(h){switch(h.label){case 0:if(console.log("connectSpace()"),console.log("__config",n),_api=i=axios_1.default.create({baseURL:apiURL,headers:{"Access-Control-Allow-Origin":"*","Content-Type":"application/json",Authorization:t.apiKey}}),o=document.getElementById(n.iframeId),!(a=getSpaceId(e)))return console.error("spaceId is undefined"),[2];return[4,loginUser(t.user)];case 1:return h.sent(),[4,getSpace(a)];case 2:if(!(s=h.sent()))return console.error("space is undefined"),[2];return setSpace(s),_atwinSrc=getIframeSrc(n),console.log("__atwinSrc",_atwinSrc),o.src=_atwinSrc,[4,getTags(s)];case 3:if(!(c=h.sent()))return console.log("tags is undefined"),[2];return setTags(c),[4,get3DObjects(a)];case 4:if(!(u=h.sent()))return console.log("objects is undefined"),[2];return setObjects(u),null===(r=o.contentWindow)||void 0===r||r.location.reload(),d=o.contentWindow,o.addEventListener("load",function(){return __awaiter(l,void 0,void 0,function(){var e;return __generator(this,function(t){switch(t.label){case 0:console.log('iframe.addEventListener("load")'),console.log("showcaseWindow",d),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,d.MP_SDK.connect(d)];case 2:return _atwin=t.sent(),console.log("Hello Bundle SDK",_atwin),onShowcaseConnect(),[3,4];case 3:return e=t.sent(),console.error(e),[3,4];case 4:return[2]}})})}),[2]}})})}function onShowcaseConnect(){return __awaiter(this,void 0,void 0,function(){var e,t,n=this;return __generator(this,function(r){switch(r.label){case 0:console.log("onShowcaseConnect()"),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,_atwin.Model.getData()];case 2:return e=r.sent(),console.log("Model sid:"+e.sid),_atwin.App.state.subscribe(function(e){return __awaiter(n,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:if(console.log("appState",e),e.phase!==_atwin.App.Phase.LOADING)return[3,2];return console.log("App is loading..."),[4,hideTags()];case 1:case 3:return t.sent(),[3,7];case 2:if(e.phase!==_atwin.App.Phase.STARTING)return[3,4];return console.log("App is starting..."),[4,showTags(_tags)];case 4:if(e.phase!==_atwin.App.Phase.PLAYING)return[3,7];return console.log("App is playing..."),[4,getSweeps()];case 5:return t.sent(),[4,setLighting()];case 6:t.sent(),_atwin.Sweep.current.subscribe(function(e){""===e.sid?console.log("Not currently stationed at a sweep position"):(moveToSweep((_currentSweep=e).id),console.log("Currently at sweep",_currentSweep),videoAutoPlay())}),_atwin.Camera.pose.subscribe(function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){switch(n.label){case 0:if(_currentCameraPose=e,console.log("Current Camera Pose",_currentCameraPose),!(t=hasTimeElapsed(300)))return[3,2];return console.log("_unrenderedObjects "+_unrenderedObjects.length),[4,renderOnDemand()];case 1:n.sent(),n.label=2;case 2:return hasTimeElapsed(1e3)&&getNearbyObjects({type:"ALL",distance:2}),[2]}})})}),_atwin.Mode.current.subscribe(function(e){_currentViewMode=e}),t.label=7;case 7:return[2]}})})}),[3,4];case 3:return t=r.sent(),console.error(t),[3,4];case 4:return[2]}})})}function hasTimeElapsed(e){var t=Date.now(),n=(t-previousTimestamp)%1e3;return(previousTimestamp=t,n>=e)?(console.log("Elapsed more than ".concat(e)),!0):(console.log("Elapsed less than ".concat(e)),!1)}function getNearbyUnrenderedObjects(e){var t=[],n={x:_currentCameraPose.position.x,y:_currentCameraPose.position.y};return t=_unrenderedObjects.filter(function(t){return calculateDistance(n,{x:t.object_position.x,y:t.object_position.y})<e.distance}),_unrenderedObjects=_unrenderedObjects.filter(function(e){return -1===t.indexOf(e)}),console.log("render toBeRendered "+t.length),t}function getNearbyObjects(e){(void 0===e.type||""===e.type)&&(e.type="ALL"),void 0===e.distance&&(e.distance=2);var t={x:_currentCameraPose.position.x,y:_currentCameraPose.position.y},n=[],r=[],i=[];return e.type,n=_3DXObject.filter(function(n){var r=calculateDistance(t,{x:n.position.x,y:n.position.y});return console.log("3DX Distance: "+r),r<e.distance}),e.type,r=_videos.filter(function(n){var r=calculateDistance(t,{x:n.node.position.x,y:n.node.position.y});return console.log("Video Distance: "+r),r<e.distance}),e.type,i=_allSlideShow.filter(function(n){var r=calculateDistance(t,{x:n.node.position.x,y:n.node.position.y});return console.log("Slideshow Distance: "+r),r<e.distance}),console.log("nearby3DXObjects "+n.length),console.log("nearbyVideos "+r.length),console.log("nearbySlideshows "+i.length),{x3d:n,videos:r,slideshows:i}}function show3DObjects(e){var t;return __awaiter(this,void 0,void 0,function(){var n,r,i,o;return __generator(this,function(a){switch(a.label){case 0:return[4,_atwin.Scene.createObjects(1)];case 1:if(n=a.sent()[0],r=Math.floor(20*Math.random()),!(o=(i=n.addNode(r.toString())).addComponent(getComponentLoader(e),{url:null===(t=e.object_data)||void 0===t?void 0:t.amazon_uri})).inputs)return console.error("component.inputs is undefined"),[2];return o.inputs.localScale={x:e.object_scale.x,y:e.object_scale.y,z:e.object_scale.z},i.obj3D.position.set(e.object_position.x,e.object_position.y,e.object_position.z),i.obj3D.rotation.set(e.object_rotation.x,e.object_rotation.y,e.object_rotation.z),_3DXObject.push(i),console.log("_3DXObject "+_3DXObject.length),i.start(),[2]}})})}function renderOnDemand(){return __awaiter(this,void 0,void 0,function(){var e,t=this;return __generator(this,function(n){return 0!==_unrenderedObjects.length&&(console.log("renderOnDemand()"),(e=getNearbyUnrenderedObjects({type:"",distance:2})).forEach(function(e){return __awaiter(t,void 0,void 0,function(){var t,n,r,i;return __generator(this,function(o){switch(o.label){case 0:if(!((null===(t=e.object_data)||void 0===t?void 0:t.object_type)==="FBX"||(null===(n=e.object_data)||void 0===n?void 0:n.object_type)==="GLB"))return[3,2];return[4,show3DObjects(e)];case 1:case 3:return o.sent(),[3,6];case 2:if((null===(r=e.object_data)||void 0===r?void 0:r.object_type)!=="MP4")return[3,4];return[4,showVideoObjects(e)];case 4:if((null===(i=e.object_data)||void 0===i?void 0:i.object_type)!=="ZIP")return[3,6];return[4,showSlideScreenModel(e)];case 5:o.sent(),o.label=6;case 6:return[2]}})})})),[2]})})}function getIframeSrc(e){console.log("getIframeSrc()",e);var t=_space.space_url.split("?m=")[1];if(!t)return console.error("modelId is undefined"),"";var n="";n+="/bundle/showcase.html?m=".concat(t,"&applicationKey=").concat(sdkKey,"&newtags=1");for(var r=0,i=urlParams;r<i.length;r++){var o=i[r];o in e&&(n+="&".concat(o,"=").concat(e[o]))}return n}function loginUser(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){switch(n.label){case 0:return console.log("loginUser(user)",e),[4,_api.post("/cas/tickets?email="+e.email+"&password="+e.password)];case 1:if(t=n.sent(),console.log("loginUser, response",t.status,t.data),200==t.status)return[2,t.data];return[2,t]}})})}function getSpace(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){switch(n.label){case 0:return console.log("getShowcase(spaceId: string)",e),[4,_api.get("showcases/id/".concat(e))];case 1:if(t=n.sent(),console.log("response",t),200===t.status)return 0===t.data.data.length&&console.error("No data"),[2,t.data.data[0]];return console.error("Error in fetchShowcase()"+t),[2,null]}})})}function getSpaceId(e){var t=e.split(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/),n=t[5],r=n.split("/")[3];if(console.log("urlArray",t),console.log("path",n),!r){console.error("spaceId is undefined");return}return r}function setSpace(e){console.log("setSpace(space: ISpace)",e),_space=e}function getTags(e){return __awaiter(this,void 0,void 0,function(){var t,n,r;return __generator(this,function(i){switch(i.label){case 0:console.log("getTags()"),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,_api.get("tags/showcase-id/".concat(e.id))];case 2:if(t=i.sent(),console.log("response",t),200===t.status)return(n=t.data.data)||console.error("tags is undefined"),[2,n];return console.error("Custom Error: Unable to fetch tags"),[3,4];case 3:return r=i.sent(),console.error(r),[3,4];case 4:return[2,null]}})})}function setTags(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return console.log("setTags()",e),mapTags(_tags=e.map(function(e){return e.json_data=JSON.parse(e.json_data),e.json_data.id=e.json_data.sid,e})),[2]})})}function get3DObjects(e){return __awaiter(this,void 0,void 0,function(){var t,n,r,i,o,a,s,c,u;return __generator(this,function(d){switch(d.label){case 0:if(!e)return[3,8];d.label=1;case 1:return d.trys.push([1,7,,8]),t=parseInt(e),console.log("showcase_id "+t),[4,_api.get("showcase-objects/showcase-id/".concat(t))];case 2:r=(n=d.sent()).data.data,console.log("showcase_objects "+JSON.stringify(r)),i=r.map(function(e){return _api.get("objects/id/".concat(e.object_id))}),d.label=3;case 3:return d.trys.push([3,5,,6]),[4,axios_1.default.all(i)];case 4:return a=(o=d.sent()).map(function(e){return e.data.data[0]}),console.log("object_data"+JSON.stringify(a)),s=r.map(function(e){var t=a.find(function(t){return t.id===e.object_id});return t&&(e.object_data=t),e.object_position&&(e.object_position="string"==typeof e.object_position?JSON.parse(e.object_position):e.object_position),e.object_rotation&&(e.object_rotation="string"==typeof e.object_rotation?JSON.parse(e.object_rotation):e.object_rotation),e.object_scale&&(e.object_scale="string"==typeof e.object_scale?JSON.parse(e.object_scale):e.object_scale),e}),console.log("get3DObjectsByShowcaseId "+JSON.stringify(s)),[2,s];case 5:return c=d.sent(),console.error("threed_objects "+c),[3,6];case 6:return[3,8];case 7:return u=d.sent(),console.error("get3DObjectsByShowcaseId "+u),[3,8];case 8:return[2,[]]}})})}function setObjects(e){console.log("setObjects()",e),_objects=e}function gotoTag(e){return __awaiter(this,void 0,void 0,function(){var t,n;return __generator(this,function(r){switch(r.label){case 0:if(console.log("gotoTag(tag: tag_id)",e),!e)return console.error("tag is undefined"),[2];r.label=1;case 1:if(r.trys.push([1,3,,4]),!(t=_tags.find(function(t){return t.id===e})))return console.error("tag is not found"),[2];return[4,_atwin.Mattertag.navigateToTag(t.json_data.id,_atwin.Mattertag.Transition.FLY)];case 2:return r.sent(),[3,4];case 3:return n=r.sent(),console.error(n),[3,4];case 4:return[2]}})})}function showTags(e){return __awaiter(this,void 0,void 0,function(){var t=this;return __generator(this,function(n){return e.forEach(function(e,n){return __awaiter(t,void 0,void 0,function(){var t,r,i,o;return __generator(this,function(a){switch(a.label){case 0:if(!(t=e.json_data))return console.error("tag.json_data/mpData is undefined"),[2];return[4,_atwin.Tag.add({anchorPosition:t.anchorPosition,color:t.color,description:t.description,id:t.sid,label:t.label,stemVector:t.stemVector,stemVisible:t.stemVisible})];case 1:if(!(r=a.sent())||(e.json_data.id=r[0],!(e.json_data.media&&""!==e.json_data.media.src.trim())))return[3,6];a.label=2;case 2:return a.trys.push([2,5,,6]),console.log("Attaching media..."),[4,_atwin.Tag.registerAttachment(e.json_data.media.src)];case 3:return i=a.sent()[0],e.json_data.attachments=[i],[4,_atwin.Tag.attach(e.json_data.sid,i)];case 4:return a.sent(),console.log("Media successfully attached"),[3,6];case 5:return o=a.sent(),console.warn("Custom warn: Media not attached: Invalid media src link: "+o),console.warn("mediaSrc: ".concat(e.json_data.media.src," | tag index: ").concat(n)),[3,6];case 6:return[2]}})})}),console.log("tags",_tags),[2]})})}function hideTags(){return __awaiter(this,void 0,void 0,function(){var e,t;return __generator(this,function(n){switch(n.label){case 0:return console.log("hideTags()"),[4,_atwin.Mattertag.getData()];case 1:if(!(e=n.sent()))return[3,3];return t=e.map(function(e){return e.sid}),[4,_atwin.Mattertag.remove(t)];case 2:n.sent(),console.log("Tags removed in space: ",t),n.label=3;case 3:return[2]}})})}function mapTags(e){console.log("mapTags()",e),exports.tags=tags=e.map(function(e){var t={};return t.id=e.id,t.name=e.json_data.label,t}),console.log("tags",tags)}function getCurrentSweep(){return _currentSweep}function getCurrentCameraPose(){return _currentCameraPose}function getCameraPosition(){return _currentCameraPose.position}function getCurrentSweepPosition(){return _currentSweep.position}function getSweeps(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){return console.log("Getting Sweeps in Space"),_atwin.Sweep.data.subscribe({onCollectionUpdated:function(e){console.log("Sweeps In Space",e),e||console.log("No Sweeps in loaded Space");var t=Object.values(_sweeps=e);exports.sweeps=sweeps=t.map(function(e){return{id:e.uuid,position:e.position,neighbors:e.neighbors}})}}),[2,null]})})}function moveToSweep(e){return __awaiter(this,void 0,void 0,function(){var t,n;return __generator(this,function(r){return t=_atwin.Sweep.Transition.FLY,n=2e3,console.log("Sweep Move",e),_atwin.Sweep.moveTo(e,{transition:t,transitionTime:n}).then(function(){console.log("Sweep Arrived at sweep "+e)}).catch(function(e){console.log("Sweep Error on Arriving",e)}),[2]})})}function getNearbySweeps(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){return t=sweeps.find(function(t){return t.id==e}).neighbors,console.log("These are neighbors",t),[2,t]})})}function getComponentLoader(e){if(e&&e.object_data){var t=e.object_data.object_type;return({FBX:_atwin.Scene.Component.FBX_LOADER,GLB:_atwin.Scene.Component.GLTF_LOADER,MP4:"liveVideo",ZIP:"slideScreenModel"})[t]||""}return""}function setLighting(){return __awaiter(this,void 0,void 0,function(){var e,t;return __generator(this,function(n){switch(n.label){case 0:return[4,_atwin.Scene.createObjects(1)];case 1:return(t=(e=n.sent()[0]).addNode()).addComponent("mp.directionalLight",{intensity:.6,color:{r:1,g:1,b:1}}),t.addComponent("mp.ambientLight",{intensity:.6,color:{r:1,g:1,b:1}}),t.start(),[2]}})})}function calculateDistance(e,t){var n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function loadObjectsToSpace(e){return __awaiter(this,void 0,void 0,function(){var t=this;return __generator(this,function(n){switch(n.label){case 0:if(!e)return console.error("threed_objects is undefined"),[2];return[4,setLighting()];case 1:return n.sent(),e.forEach(function(e){return __awaiter(t,void 0,void 0,function(){var t,n,r,i;return __generator(this,function(o){switch(o.label){case 0:if(!((null===(t=e.object_data)||void 0===t?void 0:t.object_type)==="FBX"||(null===(n=e.object_data)||void 0===n?void 0:n.object_type)==="GLB"))return[3,2];return[4,show3DObjects(e)];case 1:case 3:return o.sent(),[3,6];case 2:if((null===(r=e.object_data)||void 0===r?void 0:r.object_type)!=="MP4")return[3,4];return[4,showVideoObjects(e)];case 4:if((null===(i=e.object_data)||void 0===i?void 0:i.object_type)!=="ZIP")return[3,6];return[4,showSlideScreenModel(e)];case 5:o.sent(),o.label=6;case 6:return[2]}})})}),[2]}})})}function showVideoObjects(e){var t,n;return __awaiter(this,void 0,void 0,function(){var r,i,o;return __generator(this,function(a){switch(a.label){case 0:return[4,createVideoComponent()];case 1:return a.sent(),[4,_atwin.Scene.createObjects(1)];case 2:return[4,(i=(r=a.sent()[0]).addNode()).addComponent(getComponentLoader(e),{url:null===(t=e.object_data)||void 0===t?void 0:t.amazon_uri})];case 3:return o=a.sent(),i.position.set(e.object_position.x,e.object_position.y,e.object_position.z),i.obj3D.rotation.set(e.object_rotation.x,e.object_rotation.y,e.object_rotation.z),i.scale.set(e.object_scale.x,e.object_scale.y,e.object_scale.z),"Error"!=o.outputs.loadingState&&i.start(),o.inputs.src=null===(n=e.object_data)||void 0===n?void 0:n.amazon_uri,_videos.push({data:e,component:o,node:i,type:"VIDEO"}),[2]}})})}function playVideo(e){var t=_videos.find(function(t){return t.data.id==e});t?t.component.video.play():console.error("Unable to find video object using that id")}function pauseVideo(e){var t=_videos.find(function(t){return t.data.id==e});t?t.component.video.pause():console.error("Unable to find video object using that id")}function videoAutoPlay(){_videos.forEach(function(e){return function e(t){return __awaiter(this,void 0,void 0,function(){var e,n,r;return __generator(this,function(i){e=t.data.object_position,n=getCurrentSweepPosition(),r=(0,mathjs_1.distance)([n.x,n.y,n.z],[e.x,e.y,e.z]);try{t.data.autoplay&&t.data.autoplay_distance&&r<t.data.autoplay_distance?t.component.video.play():t.component.video.pause()}catch(o){console.error("Unable to play or stop video")}return[2]})})}(e)})}function createVideoComponent(){function e(){this.inputs={visible:!0,userNavigationEnabled:!0,eventsEnabled:!0,colliderEnabled:!0,src:null},this.outputs={texture:null,video:null,aspect:1.5},this.onInit=function(){this.video,this.texture},this.onEvent=function(e,t){},this.onInputsUpdated=function(e){this.releaseTexture();var t=this.context.three;if(!this.inputs.src){this.video.src="";return}this.inputs.src instanceof HTMLVideoElement?this.video=this.inputs.src:(this.video=this.createVideoElement(),"string"==typeof this.inputs.src?this.video.src=this.inputs.src:this.video.srcObject=this.inputs.src,this.video.load()),this.texture=new t.VideoTexture(this.video),this.texture.minFilter=t.LinearFilter,this.texture.magFilter=t.LinearFilter,this.texture.format=t.RGBFormat;var n=new t.PlaneGeometry(1,1);n.scale(1,480/720,1),n.translate(0,.33,0),this.material=new t.MeshBasicMaterial({map:this.texture,side:t.DoubleSide});var r=new t.Mesh(n,this.material);this.outputs.objectRoot=r,this.outputs.collider=r,r.visible=this.inputs.visible,this.outputs.texture=this.texture,this.outputs.video=this.video},this.releaseTexture=function(){this.texture&&(this.outputs.texture=null,this.texture.dispose())},this.createVideoElement=function(){var e=document.createElement("video");return e.setAttribute("id","htmlLivestreamVideo"),e.crossOrigin="anonymous",e.setAttribute("height","480"),e.setAttribute("width","720"),e.setAttribute("webkit-playsinline","webkit-playsinline"),e.setAttribute("controls","controls"),e.muted=!1,e.loop=!0,e.volume=1,e},this.onTick=function(e){},this.onDestroy=function(){this.material.dispose()},this.spyOnEvent=function(e){console.log("payload",e)}}_atwin.Scene.register("liveVideo",function t(){return new e})}function createSlideScreenModel(){function e(){this.inputs={src:null,userNavigationEnabled:!0,eventsEnabled:!0,colliderEnabled:!0,visible:!0},this.outputs={texture:null,t_image:null},this.onInit=function(){this.texture,this.t_image,this.material,this.mesh},this.events={"INTERACTION.CLICK":!0},this.onEvent=function(e,t){return __awaiter(this,void 0,void 0,function(){var n,r,i,o=this;return __generator(this,function(a){switch(a.label){case 0:if(console.log("onEventSlideShow",e,t),"INTERACTION.CLICK"!=e||!(_allSlideShow.length>0)||(n=_allSlideShow.filter(function(e){var n,r,i,o;return(null===(r=null===(n=e.collider)||void 0===n?void 0:n.collider)||void 0===r?void 0:r.uuid)==(null===(i=t.collider)||void 0===i?void 0:i.uuid)})[0],console.log("slideShow eventData",n),!(null!=n)))return[3,2];return console.log("slideShow eventData",n),[4,getMousePosition()];case 1:r=a.sent(),i=n.node.obj3D.position,console.log("MOUSE POSITION",r),console.log("PLANE POSITION",i),"ZIP"==n.object.object_type&&(n.id!=_currentSlideShowID&&(_currentSlideIndex=_slideShowImage.find(function(e){return e.id===n.id}).idx,console.log("CURRENT INDEX",_currentSlideIndex),_currentSlideShow=_slideShowImage.find(function(e){return e.id===n.id}).images,console.log("CURRENT SLIDE",_currentSlideShow)),n.id==_currentSlideShowID?(console.log("ChangeImage",n,_currentSlideShowID),i.x<r.x?(console.log("LEFT SIDE"),clearInterval(_timer),this.inputs.src=imageStream("prev")):i.y<r.y?(console.log("RIGHT SIDE"),clearInterval(_timer),this.inputs.src=imageStream("next")):i.y>r.y&&(console.log("AUTOPLAY"),_timer=setInterval(function(){_currentSlideIndex=(_currentSlideIndex+1)%_currentSlideShow.length,console.log("CURRENT INDEX",_currentSlideIndex),o.inputs.src=imageStream("next")},2e3))):_currentSlideShowID=n.id),a.label=2;case 2:return[2]}})})},this.onInputsUpdated=function(e){var t=this;this.releaseTexture();var n=this.context.three;this.t_image=document.createElement("IMG"),this.t_image.src=this.inputs.src,this.t_image.setAttribute("width","auto"),this.t_image.setAttribute("height","auto"),this.t_image.crossOrigin="anonymous";var r=new n.PlaneGeometry(1.5,1.5);r.translate(0,.33,0),e.src!=this.inputs.src&&(console.log("this.inputs.src",this.inputs.src),this.texture=new n.TextureLoader().load(this.t_image.src,function(e){void 0===e&&(e=t.texture),e.minFilter=n.LinearFilter,e.magFilter=n.LinearFilter,e.format=n.RGBAFormat,e.needsUpdate=!0,e.onUpdate=t.textureUpdated,t.material=new n.MeshBasicMaterial({map:t.texture,side:n.DoubleSide,transparent:!0,alphaTest:.5}),t.mesh=new n.Mesh(r,t.material),t.mesh.scale.set(1,t.texture.image.height/t.texture.image.width,1),t.outputs.objectRoot=t.mesh,t.outputs.collider=t.mesh,t.outputs.texture=t.texture,t.outputs.t_image=t.t_image})),null!=this.mesh&&(this.mesh.visible=this.inputs.visible)},this.textureUpdated=function(e){console.log("Update Callback",e)},this.releaseTexture=function(){this.texture&&(this.outputs.texture=null)},this.onTick=function(e){},this.onDestroy=function(){this.material.dispose(),this.texture.dispose()}}_atwin.Scene.register("slideScreenModel",function t(){return new e})}function showSlideScreenModel(e){return __awaiter(this,void 0,void 0,function(){var t,n,r,i;return __generator(this,function(o){switch(o.label){case 0:return createSlideScreenModel(),[4,_atwin.Scene.createObjects(1)];case 1:return r=(n=(t=o.sent()[0]).addNode()).addComponent("slideScreenModel"),console.log("COMPONENT",r),n.scale.set={x:e.object_scale.x,y:e.object_scale.y,z:e.object_scale.z},n.obj3D.position.set(e.object_position.x,e.object_position.y,e.object_position.z),n.obj3D.rotation.set(e.object_rotation.x,e.object_rotation.y,e.object_rotation.z),n.start(),[4,addImageToSlideShow(e.object_data,r,e.id)];case 2:return o.sent(),console.log("SLIDE OUTPUT",r.outputs),i={id:e.id,collider:r.outputs,object:e.object_data,node:n,component:r,type:"ZIP"},_allSlideShow.push(i),console.log("ALL SLIDESHOW",_allSlideShow),[2]}})})}function addImageToSlideShow(e,t,n){return __awaiter(this,void 0,void 0,function(){var r;return __generator(this,function(i){switch(i.label){case 0:return r=[],[4,new jszip_1.default.external.Promise(function(t,n){jszip_utils_1.default.getBinaryContent(e.amazon_uri,function(e,r){e?(console.log("getBI error",e),n(e)):(console.log("getBI success",r),t(r))})}).then(function(e){return console.log("data from getBI",e),jszip_1.default.loadAsync(e)}).then(function(e){console.log("data from loadAsync",e);var i=function(n){if(n.includes("__MACOSX")||n.includes(".DS_Store")||e.files[n].dir)return"continue";e.file(e.files[n].name).async("base64").then(function(i){r.push({name:e.files[n].name,path:"data:image/png;base64,".concat(i)}),1==r.length&&(t.inputs.src="data:image/png;base64,".concat(i))})};for(var o in e.files)i(o);_slideShowImage.push({id:n,images:r,idx:0,playID:null,play:!1,comp:t})})];case 1:return i.sent(),[2]}})})}function getMousePosition(){return __awaiter(this,void 0,void 0,function(){var e;return __generator(this,function(t){switch(t.label){case 0:return[4,_atwin.Pointer.intersection.subscribe(function(t){e=t.position})];case 1:return t.sent(),[2,e]}})})}function imageStream(e){var t=_currentSlideShow.length,n=_currentSlideIndex+("prev"===e?-1:1);return -1===n&&(n=t-1),n===t&&(n=0),_currentSlideIndex=n,_slideShowImage.find(function(e){return e.id===_currentSlideShowID}).idx=n,_currentSlideShow[_currentSlideIndex].path}function cameraRotate(e,t,n){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(r){switch(r.label){case 0:return[4,_atwin.Camera.rotate(e,t,{speed:n}).then(function(){console.log("camera rotate success.",e,t)}).catch(function(e){console.log("camera rotate error.",e)})];case 1:return r.sent(),[2]}})})}function cameraPan(e,t){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(r){switch(r.label){case 0:if(!((n=getViewMode())==_atwin.Mode.Mode.FLOORPLAN||n==_atwin.Mode.Mode.DOLLHOUSE))return[3,2];return[4,_atwin.Camera.pan({x:e,z:t}).then(function(){console.log("camera pan success.")}).catch(function(e){console.log("camera rotate error:",e)})];case 1:return r.sent(),[3,3];case 2:console.error("Incorrect view mode."),r.label=3;case 3:return[2]}})})}function cameraLookAt(e,t){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(n){switch(n.label){case 0:return[4,_atwin.Camera.lookAtScreenCoords(e,t).then(function(){console.log("camera looking at...",e,t)}).catch(function(e){console.log("camera looking at error:",e)})];case 1:return n.sent(),[2]}})})}function moveInDirection(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){switch(n.label){case 0:switch(t=_atwin.Camera.Direction.LEFT,e.toUpperCase()){case"LEFT":default:t=_atwin.Camera.Direction.LEFT;break;case"RIGHT":t=_atwin.Camera.Direction.RIGHT;break;case"UP":t=_atwin.Camera.Direction.UP;break;case"DOWN":t=_atwin.Camera.Direction.DOWN;break;case"BACK":t=_atwin.Camera.Direction.BACK;break;case"FORWARD":t=_atwin.Camera.Direction.FORWARD}return[4,_atwin.Camera.moveInDirection(t).then(function(){console.log("Move to...",t)}).catch(function(){console.warn("An error occured while moving in that direction.",t)})];case 1:return n.sent(),[2]}})})}function getViewMode(){return _currentViewMode}function setViewMode(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(n){switch(n.label){case 0:return console.log("=== get Mode Type ===",_getModeType(e)),t=_getModeType(e),[4,_atwin.Mode.moveTo(t).then(function(e){console.log("Arrived at new view mode "+e)}).catch(function(e){console.error("Error occur on:",e)})];case 1:return n.sent(),[2]}})})}function _getModeType(e){return({DOLLHOUSE:"mode.dollhouse",FLOORPLAN:"mode.floorplan",INSIDE:"mode.inside",OUTSIDE:"mode.outside",TRANSITIONING:"mode.transitioning"})[e.toUpperCase()]||""}exports.connectSpace=connectSpace,exports.gotoTag=gotoTag,exports.getCurrentSweep=getCurrentSweep,exports.getCurrentCameraPose=getCurrentCameraPose,exports.getCameraPosition=getCameraPosition,exports.getCurrentSweepPosition=getCurrentSweepPosition,exports.moveToSweep=moveToSweep,exports.getNearbySweeps=getNearbySweeps,exports.playVideo=playVideo,exports.pauseVideo=pauseVideo,exports.cameraRotate=cameraRotate,exports.cameraPan=cameraPan,exports.cameraLookAt=cameraLookAt,exports.moveInDirection=moveInDirection,exports.getViewMode=getViewMode,exports.setViewMode=setViewMode;
|
|
1
|
+
/*! For license information please see architwin.min.js.LICENSE.txt */
|
|
2
|
+
(()=>{var t={925:t=>{"use strict";var e={};function r(){try{return new window.XMLHttpRequest}catch(t){}}e._getBinaryFromXHR=function(t){return t.response||t.responseText};var n="undefined"!=typeof window&&window.ActiveXObject?function(){return r()||function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}()}:r;e.getBinaryContent=function(t,r){var i,a,s,o;r||(r={}),"function"==typeof r?(o=r,r={}):"function"==typeof r.callback&&(o=r.callback),o||"undefined"==typeof Promise?(a=function(t){o(null,t)},s=function(t){o(t,null)}):i=new Promise((function(t,e){a=t,s=e}));try{var u=n();u.open("GET",t,!0),"responseType"in u&&(u.responseType="arraybuffer"),u.overrideMimeType&&u.overrideMimeType("text/plain; charset=x-user-defined"),u.onreadystatechange=function(r){if(4===u.readyState)if(200===u.status||0===u.status)try{a(e._getBinaryFromXHR(u))}catch(t){s(new Error(t))}else s(new Error("Ajax error for "+t+" : "+this.status+" "+this.statusText))},r.progress&&(u.onprogress=function(e){r.progress({path:t,originalEvent:e,percent:e.loaded/e.total*100,loaded:e.loaded,total:e.total})}),u.send()}catch(t){s(new Error(t),null)}return i},t.exports=e},733:(t,e,r)=>{t.exports=function t(e,r,n){function i(s,o){if(!r[s]){if(!e[s]){if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};e[s][0].call(h.exports,(function(t){return i(e[s][1][t]||t)}),h,h.exports,t,e,r,n)}return r[s].exports}for(var a=void 0,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,r){"use strict";var n=t("./utils"),i=t("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(t){for(var e,r,i,s,o,u,h,l=[],c=0,f=t.length,d=f,p="string"!==n.getTypeOf(t);c<t.length;)d=f-c,i=p?(e=t[c++],r=c<f?t[c++]:0,c<f?t[c++]:0):(e=t.charCodeAt(c++),r=c<f?t.charCodeAt(c++):0,c<f?t.charCodeAt(c++):0),s=e>>2,o=(3&e)<<4|r>>4,u=1<d?(15&r)<<2|i>>6:64,h=2<d?63&i:64,l.push(a.charAt(s)+a.charAt(o)+a.charAt(u)+a.charAt(h));return l.join("")},r.decode=function(t){var e,r,n,s,o,u,h=0,l=0,c="data:";if(t.substr(0,c.length)===c)throw new Error("Invalid base64 input, it looks like a data url.");var f,d=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===a.charAt(64)&&d--,t.charAt(t.length-2)===a.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(f=i.uint8array?new Uint8Array(0|d):new Array(0|d);h<t.length;)e=a.indexOf(t.charAt(h++))<<2|(s=a.indexOf(t.charAt(h++)))>>4,r=(15&s)<<4|(o=a.indexOf(t.charAt(h++)))>>2,n=(3&o)<<6|(u=a.indexOf(t.charAt(h++))),f[l++]=e,64!==o&&(f[l++]=r),64!==u&&(f[l++]=n);return f}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var n=t("./external"),i=t("./stream/DataWorker"),a=t("./stream/Crc32Probe"),s=t("./stream/DataLengthProbe");function o(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}o.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(t,e,r){return t.pipe(new a).pipe(new s("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new s("compressedSize")).withStreamInfo("compression",e)},e.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){"use strict";var n=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){"use strict";var n=t("./utils"),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r,n){var a=i,s=n+r;t^=-1;for(var o=n;o<s;o++)t=t>>>8^a[255&(t^e[o])];return-1^t}(0|e,t,t.length,0):function(t,e,r,n){var a=i,s=n+r;t^=-1;for(var o=n;o<s;o++)t=t>>>8^a[255&(t^e.charCodeAt(o))];return-1^t}(0|e,t,t.length,0):0}},{"./utils":32}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";var n=null;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako"),a=t("./utils"),s=t("./stream/GenericWorker"),o=n?"uint8array":"array";function u(t,e){s.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",a.inherits(u,s),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(a.transformTo(o,t.data),!1)},u.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new u("Deflate",t)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function n(t,e){var r,n="";for(r=0;r<e;r++)n+=String.fromCharCode(255&t),t>>>=8;return n}function i(t,e,r,i,s,l){var c,f,d=t.file,p=t.compression,m=l!==o.utf8encode,_=a.transformTo("string",l(d.name)),g=a.transformTo("string",o.utf8encode(d.name)),b=d.comment,v=a.transformTo("string",l(b)),y=a.transformTo("string",o.utf8encode(b)),w=g.length!==d.name.length,k=y.length!==b.length,x="",S="",z="",C=d.dir,E=d.date,A={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(A.crc32=t.crc32,A.compressedSize=t.compressedSize,A.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),m||!w&&!k||(I|=2048);var O=0,B=0;C&&(O|=16),"UNIX"===s?(B=798,O|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(d.unixPermissions,C)):(B=20,O|=function(t){return 63&(t||0)}(d.dosPermissions)),c=E.getUTCHours(),c<<=6,c|=E.getUTCMinutes(),c<<=5,c|=E.getUTCSeconds()/2,f=E.getUTCFullYear()-1980,f<<=4,f|=E.getUTCMonth()+1,f<<=5,f|=E.getUTCDate(),w&&(S=n(1,1)+n(u(_),4)+g,x+="up"+n(S.length,2)+S),k&&(z=n(1,1)+n(u(v),4)+y,x+="uc"+n(z.length,2)+z);var T="";return T+="\n\0",T+=n(I,2),T+=p.magic,T+=n(c,2),T+=n(f,2),T+=n(A.crc32,4),T+=n(A.compressedSize,4),T+=n(A.uncompressedSize,4),T+=n(_.length,2),T+=n(x.length,2),{fileRecord:h.LOCAL_FILE_HEADER+T+_+x,dirRecord:h.CENTRAL_FILE_HEADER+n(B,2)+T+n(v.length,2)+"\0\0\0\0"+n(O,4)+n(i,4)+_+x+v}}var a=t("../utils"),s=t("../stream/GenericWorker"),o=t("../utf8"),u=t("../crc32"),h=t("../signature");function l(t,e,r,n){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(l,s),l.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,s.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},l.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=i(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=i(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:function(t){return h.DATA_DESCRIPTOR+n(t.crc32,4)+n(t.compressedSize,4)+n(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var r=this.bytesWritten-t,i=function(t,e,r,i,s){var o=a.transformTo("string",s(i));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(t,2)+n(t,2)+n(e,4)+n(r,4)+n(o.length,2)+o}(this.dirRecords.length,r,t,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},l.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(t){var e=this._sources;if(!s.prototype.error.call(this,t))return!1;for(var r=0;r<e.length;r++)try{e[r].error(t)}catch(t){}return!0},l.prototype.lock=function(){s.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,r){"use strict";var n=t("../compressions"),i=t("./ZipFileWorker");r.generateWorker=function(t,e,r){var a=new i(e.streamFiles,r,e.platform,e.encodeFileName),s=0;try{t.forEach((function(t,r){s++;var i=function(t,e){var r=t||e,i=n[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,e.compression),o=r.options.compressionOptions||e.compressionOptions||{},u=r.dir,h=r.date;r._compressWorker(i,o).withStreamInfo("file",{name:t,dir:u,date:h,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(a)})),a.entriesCount=s}catch(t){a.error(t)}return a}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,r){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(n.prototype=t("./object")).loadAsync=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.version="3.10.1",n.loadAsync=function(t,e){return(new n).loadAsync(t,e)},n.external=t("./external"),e.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,r){"use strict";var n=t("./utils"),i=t("./external"),a=t("./utf8"),s=t("./zipEntries"),o=t("./stream/Crc32Probe"),u=t("./nodejsUtils");function h(t){return new i.Promise((function(e,r){var n=t.decompressed.getContentWorker().pipe(new o);n.on("error",(function(t){r(t)})).on("end",(function(){n.streamInfo.crc32!==t.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}e.exports=function(t,e){var r=this;return e=n.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(t)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var r=new s(e);return r.load(t),r})).then((function(t){var r=[i.Promise.resolve(t)],n=t.files;if(e.checkCRC32)for(var a=0;a<n.length;a++)r.push(h(n[a]));return i.Promise.all(r)})).then((function(t){for(var i=t.shift(),a=i.files,s=0;s<a.length;s++){var o=a[s],u=o.fileNameStr,h=n.resolve(o.fileNameStr);r.file(h,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:e.createFolders}),o.dir||(r.file(h).unsafeOriginalName=u)}return i.zipComment.length&&(r.comment=i.zipComment),r}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../stream/GenericWorker");function a(t,e){i.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}n.inherits(a,i),a.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",(function(t){e.push({data:t,meta:{percent:0}})})).on("error",(function(t){e.isPaused?this.generatedError=t:e.error(t)})).on("end",(function(){e.isPaused?e._upstreamEnded=!0:e.end()}))},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,r){"use strict";var n=t("readable-stream").Readable;function i(t,e,r){n.call(this,e),this._helper=t;var i=this;t.on("data",(function(t,e){i.push(t)||i._helper.pause(),r&&r(e)})).on("error",(function(t){i.emit("error",t)})).on("end",(function(){i.push(null)}))}t("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},e.exports=i},{"../utils":32,"readable-stream":16}],14:[function(t,e,r){"use strict";e.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,r){"use strict";function n(t,e,r){var n,i=a.getTypeOf(e),o=a.extend(r||{},u);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(t=m(t)),o.createFolders&&(n=p(t))&&_.call(this,n,!0);var c="string"===i&&!1===o.binary&&!1===o.base64;r&&void 0!==r.binary||(o.binary=!c),(e instanceof h&&0===e.uncompressedSize||o.dir||!e||0===e.length)&&(o.base64=!1,o.binary=!0,e="",o.compression="STORE",i="string");var g=null;g=e instanceof h||e instanceof s?e:f.isNode&&f.isStream(e)?new d(t,e):a.prepareContent(t,e,o.binary,o.optimizedBinaryString,o.base64);var b=new l(t,g,o);this.files[t]=b}var i=t("./utf8"),a=t("./utils"),s=t("./stream/GenericWorker"),o=t("./stream/StreamHelper"),u=t("./defaults"),h=t("./compressedObject"),l=t("./zipObject"),c=t("./generate"),f=t("./nodejsUtils"),d=t("./nodejs/NodejsStreamInputAdapter"),p=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},_=function(t,e){return e=void 0!==e?e:u.createFolders,t=m(t),this.files[t]||n.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function g(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var b={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,r,n;for(e in this.files)n=this.files[e],(r=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(r,n)},filter:function(t){var e=[];return this.forEach((function(r,n){t(r,n)&&e.push(n)})),e},file:function(t,e,r){if(1!==arguments.length)return t=this.root+t,n.call(this,t,e,r),this;if(g(t)){var i=t;return this.filter((function(t,e){return!e.dir&&i.test(t)}))}var a=this.files[this.root+t];return a&&!a.dir?a:null},folder:function(t){if(!t)return this;if(g(t))return this.filter((function(e,r){return r.dir&&t.test(e)}));var e=this.root+t,r=_.call(this,e),n=this.clone();return n.root=r.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter((function(e,r){return r.name.slice(0,t.length)===t})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,r={};try{if((r=a.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");a.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";e=c.generateWorker(this,r,n)}catch(t){(e=new s("error")).error(t)}return new o(e,r.type||"string",r.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=b},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,r){"use strict";e.exports=t("stream")},{stream:void 0}],17:[function(t,e,r){"use strict";var n=t("./DataReader");function i(t){n.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(i,n),i.prototype.byteAt=function(t){return this.data[this.zero+t]},i.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),a=this.length-4;0<=a;--a)if(this.data[a]===e&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a-this.zero;return-1},i.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),a=this.readData(4);return e===a[0]&&r===a[1]&&n===a[2]&&i===a[3]},i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./DataReader":18}],18:[function(t,e,r){"use strict";var n=t("../utils");function i(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,r=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},{"../utils":32}],19:[function(t,e,r){"use strict";var n=t("./Uint8ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){"use strict";var n=t("./DataReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){"use strict";var n=t("./ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../support"),a=t("./ArrayReader"),s=t("./StringReader"),o=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||i.uint8array?"nodebuffer"===e?new o(t):i.uint8array?new u(n.transformTo("uint8array",t)):new a(n.transformTo("array",t)):new s(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../utils");function a(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(a,n),a.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../crc32");function a(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(a,n),a.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function a(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(a,i),a.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function a(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r<this._listeners[t].length;r++)this._listeners[t][r].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=n},{}],29:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./ConvertWorker"),a=t("./GenericWorker"),s=t("../base64"),o=t("../support"),u=t("../external"),h=null;if(o.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function l(t,e){return new u.Promise((function(r,i){var a=[],o=t._internalType,u=t._outputType,h=t._mimeType;t.on("data",(function(t,r){a.push(t),e&&e(r)})).on("error",(function(t){a=[],i(t)})).on("end",(function(){try{var t=function(t,e,r){switch(t){case"blob":return n.newBlob(n.transformTo("arraybuffer",e),r);case"base64":return s.encode(e);default:return n.transformTo(t,e)}}(u,function(t,e){var r,n=0,i=null,a=0;for(r=0;r<e.length;r++)a+=e[r].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(i=new Uint8Array(a),r=0;r<e.length;r++)i.set(e[r],n),n+=e[r].length;return i;case"nodebuffer":return Buffer.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(o,a),h);r(t)}catch(t){i(t)}a=[]})).resume()}))}function c(t,e,r){var s=e;switch(e){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=e,this._mimeType=r,n.checkSupport(s),this._worker=t.pipe(new i(s)),t.lock()}catch(t){this._worker=new a("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){return l(this,t)},on:function(t,e){var r=this;return"data"===t?this._worker.on(t,(function(t){e.call(r,t.data,t.meta)})):this._worker.on(t,(function(){n.delay(e,arguments,r)})),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(n.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=c},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,r){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer="undefined"!=typeof Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=0===new Blob([n],{type:"application/zip"}).size}catch(t){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),r.blob=0===i.getBlob("application/zip").size}catch(t){r.blob=!1}}}try{r.nodestream=!!t("readable-stream").Readable}catch(t){r.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,r){"use strict";for(var n=t("./utils"),i=t("./support"),a=t("./nodejsUtils"),s=t("./stream/GenericWorker"),o=new Array(256),u=0;u<256;u++)o[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function h(){s.call(this,"utf-8 decode"),this.leftOver=null}function l(){s.call(this,"utf-8 encode")}o[254]=o[254]=1,r.utf8encode=function(t){return i.nodebuffer?a.newBufferFrom(t,"utf-8"):function(t){var e,r,n,a,s,o=t.length,u=0;for(a=0;a<o;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(n=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),u+=r<128?1:r<2048?2:r<65536?3:4;for(e=i.uint8array?new Uint8Array(u):new Array(u),a=s=0;s<u;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(n=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),r<128?e[s++]=r:(r<2048?e[s++]=192|r>>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e}(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,i,a,s=t.length,u=new Array(2*s);for(e=r=0;e<s;)if((i=t[e++])<128)u[r++]=i;else if(4<(a=o[i]))u[r++]=65533,e+=a-1;else{for(i&=2===a?31:3===a?15:7;1<a&&e<s;)i=i<<6|63&t[e++],a--;1<a?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(h,s),h.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=e;(e=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),e.set(a,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var s=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}(e),u=e;s!==e.length&&(i.uint8array?(u=e.subarray(0,s),this.leftOver=e.subarray(s,e.length)):(u=e.slice(0,s),this.leftOver=e.slice(s,e.length))),this.push({data:r.utf8decode(u),meta:t.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=h,n.inherits(l,s),l.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){"use strict";var n=t("./support"),i=t("./base64"),a=t("./nodejsUtils"),s=t("./external");function o(t){return t}function u(t,e){for(var r=0;r<t.length;++r)e[r]=255&t.charCodeAt(r);return e}t("setimmediate"),r.newBlob=function(t,e){r.checkSupport("blob");try{return new Blob([t],{type:e})}catch(r){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(t,e,r){var n=[],i=0,a=t.length;if(a<=r)return String.fromCharCode.apply(null,t);for(;i<a;)"array"===e||"nodebuffer"===e?n.push(String.fromCharCode.apply(null,t.slice(i,Math.min(i+r,a)))):n.push(String.fromCharCode.apply(null,t.subarray(i,Math.min(i+r,a)))),i+=r;return n.join("")},stringifyByChar:function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,a.allocBuffer(1)).length}catch(t){return!1}}()}};function l(t){var e=65536,n=r.getTypeOf(t),i=!0;if("uint8array"===n?i=h.applyCanBeUsed.uint8array:"nodebuffer"===n&&(i=h.applyCanBeUsed.nodebuffer),i)for(;1<e;)try{return h.stringifyByChunk(t,n,e)}catch(t){e=Math.floor(e/2)}return h.stringifyByChar(t)}function c(t,e){for(var r=0;r<t.length;r++)e[r]=t[r];return e}r.applyFromCharCode=l;var f={};f.string={string:o,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return u(t,new Uint8Array(t.length))},nodebuffer:function(t){return u(t,a.allocBuffer(t.length))}},f.array={string:l,array:o,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return a.newBufferFrom(t)}},f.arraybuffer={string:function(t){return l(new Uint8Array(t))},array:function(t){return c(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:o,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return a.newBufferFrom(new Uint8Array(t))}},f.uint8array={string:l,array:function(t){return c(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:o,nodebuffer:function(t){return a.newBufferFrom(t)}},f.nodebuffer={string:l,array:function(t){return c(t,new Array(t.length))},arraybuffer:function(t){return f.nodebuffer.uint8array(t).buffer},uint8array:function(t){return c(t,new Uint8Array(t.length))},nodebuffer:o},r.transformTo=function(t,e){if(e=e||"",!t)return e;r.checkSupport(t);var n=r.getTypeOf(e);return f[n][t](e)},r.resolve=function(t){for(var e=t.split("/"),r=[],n=0;n<e.length;n++){var i=e[n];"."===i||""===i&&0!==n&&n!==e.length-1||(".."===i?r.pop():r.push(i))}return r.join("/")},r.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":n.nodebuffer&&a.isBuffer(t)?"nodebuffer":n.uint8array&&t instanceof Uint8Array?"uint8array":n.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(t){if(!n[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(t){var e,r,n="";for(r=0;r<(t||"").length;r++)n+="\\x"+((e=t.charCodeAt(r))<16?"0":"")+e.toString(16).toUpperCase();return n},r.delay=function(t,e,r){setImmediate((function(){t.apply(r||null,e||[])}))},r.inherits=function(t,e){function r(){}r.prototype=e.prototype,t.prototype=new r},r.extend=function(){var t,e,r={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===r[e]&&(r[e]=arguments[t][e]);return r},r.prepareContent=function(t,e,a,o,h){return s.Promise.resolve(e).then((function(t){return n.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new s.Promise((function(e,r){var n=new FileReader;n.onload=function(t){e(t.target.result)},n.onerror=function(t){r(t.target.error)},n.readAsArrayBuffer(t)})):t})).then((function(e){var l=r.getTypeOf(e);return l?("arraybuffer"===l?e=r.transformTo("uint8array",e):"string"===l&&(h?e=i.decode(e):a&&!0!==o&&(e=function(t){return u(t,n.uint8array?new Uint8Array(t.length):new Array(t.length))}(e))),e):s.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,r){"use strict";var n=t("./reader/readerFor"),i=t("./utils"),a=t("./signature"),s=t("./zipEntry"),o=t("./support");function u(t){this.files=[],this.loadOptions=t}u.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(e)+", expected "+i.pretty(t)+")")}},isSignature:function(t,e){var r=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4)===e;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=o.uint8array?"uint8array":"array",r=i.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,r,n=this.zip64EndOfCentralSize-44;0<n;)t=this.reader.readInt(2),e=this.reader.readInt(4),r=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(t=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=e-r;if(0<n)this.isSignature(e,a.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(t){this.reader=n(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,r){"use strict";var n=t("./reader/readerFor"),i=t("./utils"),a=t("./compressedObject"),s=t("./crc32"),o=t("./utf8"),u=t("./compressions"),h=t("./support");function l(t,e){this.options=t,this.loadOptions=e}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(t){var e,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in u)if(Object.prototype.hasOwnProperty.call(u,e)&&u[e].magic===t)return u[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<i;)e=t.readInt(2),r=t.readInt(2),n=t.readData(r),this.extraFields[e]={id:e,length:r,value:n};t.setIndex(i)},handleUTF8:function(){var t=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var r=i.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var a=i.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(a)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=n(t.value);return 1!==e.readInt(1)||s(this.fileName)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=n(t.value);return 1!==e.readInt(1)||s(this.fileComment)!==e.readInt(4)?null:o.utf8decode(e.readData(t.length-5))}return null}},e.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,r){"use strict";function n(t,e,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=e,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var i=t("./stream/StreamHelper"),a=t("./stream/DataWorker"),s=t("./utf8"),o=t("./compressedObject"),u=t("./stream/GenericWorker");n.prototype={internalStream:function(t){var e=null,r="string";try{if(!t)throw new Error("No output type specified.");var n="string"===(r=t.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),e=this._decompressWorker();var a=!this._dataBinary;a&&!n&&(e=e.pipe(new s.Utf8EncodeWorker)),!a&&n&&(e=e.pipe(new s.Utf8DecodeWorker))}catch(t){(e=new u("error")).error(t)}return new i(e,r,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof o&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new s.Utf8EncodeWorker)),o.createWorkerFrom(r,t,e)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<h.length;c++)n.prototype[h[c]]=l;e.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,n){(function(t){"use strict";var r,n,i=t.MutationObserver||t.WebKitMutationObserver;if(i){var a=0,s=new i(l),o=t.document.createTextNode("");s.observe(o,{characterData:!0}),r=function(){o.data=a=++a%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){l(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var u=new t.MessageChannel;u.port1.onmessage=l,r=function(){u.port2.postMessage(0)}}var h=[];function l(){var t,e;n=!0;for(var r=h.length;r;){for(e=h,h=[],t=-1;++t<r;)e[t]();r=h.length}n=!1}e.exports=function(t){1!==h.push(t)||n||r()}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,r){"use strict";var n=t("immediate");function i(){}var a={},s=["REJECTED"],o=["FULFILLED"],u=["PENDING"];function h(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==i&&d(this,t)}function l(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(t,e,r){n((function(){var n;try{n=e(r)}catch(n){return a.reject(t,n)}n===t?a.reject(t,new TypeError("Cannot resolve promise with itself")):a.resolve(t,n)}))}function f(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,a.reject(t,e))}function i(e){r||(r=!0,a.resolve(t,e))}var s=p((function(){e(i,n)}));"error"===s.status&&n(s.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}(e.exports=h).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){throw r}))}))},h.prototype.catch=function(t){return this.then(null,t)},h.prototype.then=function(t,e){if("function"!=typeof t&&this.state===o||"function"!=typeof e&&this.state===s)return this;var r=new this.constructor(i);return this.state!==u?c(r,this.state===o?t:e,this.outcome):this.queue.push(new l(r,t,e)),r},l.prototype.callFulfilled=function(t){a.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){c(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){a.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){c(this.promise,this.onRejected,t)},a.resolve=function(t,e){var r=p(f,e);if("error"===r.status)return a.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=o,t.outcome=e;for(var i=-1,s=t.queue.length;++i<s;)t.queue[i].callFulfilled(e)}return t},a.reject=function(t,e){t.state=s,t.outcome=e;for(var r=-1,n=t.queue.length;++r<n;)t.queue[r].callRejected(e);return t},h.resolve=function(t){return t instanceof this?t:a.resolve(new this(i),t)},h.reject=function(t){var e=new this(i);return a.reject(e,t)},h.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var s=new Array(r),o=0,u=-1,h=new this(i);++u<r;)l(t[u],u);return h;function l(t,i){e.resolve(t).then((function(t){s[i]=t,++o!==r||n||(n=!0,a.resolve(h,s))}),(function(t){n||(n=!0,a.reject(h,t))}))}},h.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var s,o=-1,u=new this(i);++o<r;)s=t[o],e.resolve(s).then((function(t){n||(n=!0,a.resolve(u,t))}),(function(t){n||(n=!0,a.reject(u,t))}));return u}},{immediate:36}],38:[function(t,e,r){"use strict";var n={};(0,t("./lib/utils/common").assign)(n,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,r){"use strict";var n=t("./zlib/deflate"),i=t("./utils/common"),a=t("./utils/strings"),s=t("./zlib/messages"),o=t("./zlib/zstream"),u=Object.prototype.toString,h=0,l=-1,c=0,f=8;function d(t){if(!(this instanceof d))return new d(t);this.options=i.assign({level:l,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==h)throw new Error(s[r]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var p;if(p="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(r=n.deflateSetDictionary(this.strm,p))!==h)throw new Error(s[r]);this._dict_set=!0}}function p(t,e){var r=new d(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}d.prototype.push=function(t,e){var r,s,o=this.strm,l=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=a.string2buf(t):"[object ArrayBuffer]"===u.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new i.Buf8(l),o.next_out=0,o.avail_out=l),1!==(r=n.deflate(o,s))&&r!==h)return this.onEnd(r),!(this.ended=!0);0!==o.avail_out&&(0!==o.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(o.output,o.next_out))):this.onData(i.shrinkBuf(o.output,o.next_out)))}while((0<o.avail_in||0===o.avail_out)&&1!==r);return 4===s?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===h):2!==s||(this.onEnd(h),!(o.avail_out=0))},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===h&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Deflate=d,r.deflate=p,r.deflateRaw=function(t,e){return(e=e||{}).raw=!0,p(t,e)},r.gzip=function(t,e){return(e=e||{}).gzip=!0,p(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,r){"use strict";var n=t("./zlib/inflate"),i=t("./utils/common"),a=t("./utils/strings"),s=t("./zlib/constants"),o=t("./zlib/messages"),u=t("./zlib/zstream"),h=t("./zlib/gzheader"),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==s.Z_OK)throw new Error(o[r]);this.header=new h,n.inflateGetHeader(this.strm,this.header)}function f(t,e){var r=new c(e);if(r.push(t,!0),r.err)throw r.msg||o[r.err];return r.result}c.prototype.push=function(t,e){var r,o,u,h,c,f,d=this.strm,p=this.options.chunkSize,m=this.options.dictionary,_=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?d.input=a.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?d.input=new Uint8Array(t):d.input=t,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(p),d.next_out=0,d.avail_out=p),(r=n.inflate(d,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&m&&(f="string"==typeof m?a.string2buf(m):"[object ArrayBuffer]"===l.call(m)?new Uint8Array(m):m,r=n.inflateSetDictionary(this.strm,f)),r===s.Z_BUF_ERROR&&!0===_&&(r=s.Z_OK,_=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),!(this.ended=!0);d.next_out&&(0!==d.avail_out&&r!==s.Z_STREAM_END&&(0!==d.avail_in||o!==s.Z_FINISH&&o!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(u=a.utf8border(d.output,d.next_out),h=d.next_out-u,c=a.buf2string(d.output,u),d.next_out=h,d.avail_out=p-h,h&&i.arraySet(d.output,d.output,u,h,0),this.onData(c)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(_=!0)}while((0<d.avail_in||0===d.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(o=s.Z_FINISH),o===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):o!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),!(d.avail_out=0))},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Inflate=c,r.inflate=f,r.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},r.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.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 n in r)r.hasOwnProperty(n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var a=0;a<n;a++)t[i+a]=e[r+a]},flattenChunks:function(t){var e,r,n,i,a,s;for(e=n=0,r=t.length;e<r;e++)n+=t[e].length;for(s=new Uint8Array(n),e=i=0,r=t.length;e<r;e++)a=t[e],s.set(a,i),i+=a.length;return s}},a={arraySet:function(t,e,r,n,i){for(var a=0;a<n;a++)t[i+a]=e[r+a]},flattenChunks:function(t){return[].concat.apply([],t)}};r.setTyped=function(t){t?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,a))},r.setTyped(n)},{}],42:[function(t,e,r){"use strict";var n=t("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){a=!1}for(var s=new n.Buf8(256),o=0;o<256;o++)s[o]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function u(t,e){if(e<65537&&(t.subarray&&a||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",s=0;s<e;s++)r+=String.fromCharCode(t[s]);return r}s[254]=s[254]=1,r.string2buf=function(t){var e,r,i,a,s,o=t.length,u=0;for(a=0;a<o;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),u+=r<128?1:r<2048?2:r<65536?3:4;for(e=new n.Buf8(u),a=s=0;s<u;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),r<128?e[s++]=r:(r<2048?e[s++]=192|r>>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e},r.buf2binstring=function(t){return u(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e},r.buf2string=function(t,e){var r,n,i,a,o=e||t.length,h=new Array(2*o);for(r=n=0;r<o;)if((i=t[r++])<128)h[n++]=i;else if(4<(a=s[i]))h[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;1<a&&r<o;)i=i<<6|63&t[r++],a--;1<a?h[n++]=65533:i<65536?h[n++]=i:(i-=65536,h[n++]=55296|i>>10&1023,h[n++]=56320|1023&i)}return u(h,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+s[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){for(var i=65535&t|0,a=t>>>16&65535|0,s=0;0!==r;){for(r-=s=2e3<r?2e3:r;a=a+(i=i+e[n++]|0)|0,--s;);i%=65521,a%=65521}return i|a<<16|0}},{}],44:[function(t,e,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,r){"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var a=n,s=i+r;t^=-1;for(var o=i;o<s;o++)t=t>>>8^a[255&(t^e[o])];return-1^t}},{}],46:[function(t,e,r){"use strict";var n,i=t("../utils/common"),a=t("./trees"),s=t("./adler32"),o=t("./crc32"),u=t("./messages"),h=0,l=4,c=0,f=-2,d=-1,p=4,m=2,_=8,g=9,b=286,v=30,y=19,w=2*b+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function T(t,e){return t.msg=u[e],e}function R(t){return(t<<1)-(4<t?9:0)}function D(t){for(var e=t.length;0<=--e;)t[e]=0}function F(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function N(t,e){a._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,F(t.strm)}function P(t,e){t.pending_buf[t.pending++]=e}function U(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function j(t,e){var r,n,i=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match,u=t.strstart>t.w_size-z?t.strstart-(t.w_size-z):0,h=t.window,l=t.w_mask,c=t.prev,f=t.strstart+S,d=h[a+s-1],p=h[a+s];t.prev_length>=t.good_match&&(i>>=2),o>t.lookahead&&(o=t.lookahead);do{if(h[(r=e)+s]===p&&h[r+s-1]===d&&h[r]===h[a]&&h[++r]===h[a+1]){a+=2,r++;do{}while(h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&a<f);if(n=S-(f-a),a=f-S,s<n){if(t.match_start=e,o<=(s=n))break;d=h[a+s-1],p=h[a+s]}}}while((e=c[e&l])>u&&0!=--i);return s<=t.lookahead?s:t.lookahead}function L(t){var e,r,n,a,u,h,l,c,f,d,p=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=p+(p-z)){for(i.arraySet(t.window,t.window,p,p,0),t.match_start-=p,t.strstart-=p,t.block_start-=p,e=r=t.hash_size;n=t.head[--e],t.head[e]=p<=n?n-p:0,--r;);for(e=r=p;n=t.prev[--e],t.prev[e]=p<=n?n-p:0,--r;);a+=p}if(0===t.strm.avail_in)break;if(h=t.strm,l=t.window,c=t.strstart+t.lookahead,d=void 0,(f=a)<(d=h.avail_in)&&(d=f),r=0===d?0:(h.avail_in-=d,i.arraySet(l,h.input,h.next_in,d,c),1===h.state.wrap?h.adler=s(h.adler,l,d,c):2===h.state.wrap&&(h.adler=o(h.adler,l,d,c)),h.next_in+=d,h.total_in+=d,d),t.lookahead+=r,t.lookahead+t.insert>=x)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<<t.hash_shift^t.window[u+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[u+x-1])&t.hash_mask,t.prev[u&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=u,u++,t.insert--,!(t.lookahead+t.insert<x)););}while(t.lookahead<z&&0!==t.strm.avail_in)}function Z(t,e){for(var r,n;;){if(t.lookahead<z){if(L(t),t.lookahead<z&&e===h)return A;if(0===t.lookahead)break}if(r=0,t.lookahead>=x&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-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-z&&(t.match_length=j(t,r)),t.match_length>=x)if(n=a._tr_tally(t,t.strstart-t.match_start,t.match_length-x),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=x){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-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!=--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 n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=t.strstart<x-1?t.strstart:x-1,e===l?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}function W(t,e){for(var r,n,i;;){if(t.lookahead<z){if(L(t),t.lookahead<z&&e===h)return A;if(0===t.lookahead)break}if(r=0,t.lookahead>=x&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-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=x-1,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-z&&(t.match_length=j(t,r),t.match_length<=5&&(1===t.strategy||t.match_length===x&&4096<t.strstart-t.match_start)&&(t.match_length=x-1)),t.prev_length>=x&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-x,n=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-x),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+x-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!=--t.prev_length;);if(t.match_available=0,t.match_length=x-1,t.strstart++,n&&(N(t,!1),0===t.strm.avail_out))return A}else if(t.match_available){if((n=a._tr_tally(t,0,t.window[t.strstart-1]))&&N(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return A}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=a._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<x-1?t.strstart:x-1,e===l?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}function M(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}function H(){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=_,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*w),this.dyn_dtree=new i.Buf16(2*(2*v+1)),this.bl_tree=new i.Buf16(2*(2*y+1)),D(this.dyn_ltree),D(this.dyn_dtree),D(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(k+1),this.heap=new i.Buf16(2*b+1),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*b+1),D(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 G(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=m,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?C:E,t.adler=2===e.wrap?0:1,e.last_flush=h,a._tr_init(e),c):T(t,f)}function K(t){var e=G(t);return e===c&&function(t){t.window_size=2*t.w_size,D(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=x-1,t.match_available=0,t.ins_h=0}(t.state),e}function X(t,e,r,n,a,s){if(!t)return f;var o=1;if(e===d&&(e=6),n<0?(o=0,n=-n):15<n&&(o=2,n-=16),a<1||g<a||r!==_||n<8||15<n||e<0||9<e||s<0||p<s)return T(t,f);8===n&&(n=9);var u=new H;return(t.state=u).strm=t,u.wrap=o,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=a+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+x-1)/x),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<a+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=s,u.method=r,K(t)}n=[new M(0,0,0,0,(function(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(L(t),0===t.lookahead&&e===h)return A;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,N(t,!1),0===t.strm.avail_out))return A;if(t.strstart-t.block_start>=t.w_size-z&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===l?(N(t,!0),0===t.strm.avail_out?O:B):(t.strstart>t.block_start&&(N(t,!1),t.strm.avail_out),A)})),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(t,e){return X(t,e,_,15,8,0)},r.deflateInit2=X,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?f:(t.state.gzhead=e,c):f},r.deflate=function(t,e){var r,i,s,u;if(!t||!t.state||5<e||e<0)return t?T(t,f):f;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&e!==l)return T(t,0===t.avail_out?-5:f);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===C)if(2===i.wrap)t.adler=0,P(i,31),P(i,139),P(i,8),i.gzhead?(P(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),P(i,255&i.gzhead.time),P(i,i.gzhead.time>>8&255),P(i,i.gzhead.time>>16&255),P(i,i.gzhead.time>>24&255),P(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),P(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(P(i,255&i.gzhead.extra.length),P(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=o(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(P(i,0),P(i,0),P(i,0),P(i,0),P(i,0),P(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),P(i,3),i.status=E);else{var d=_+(i.w_bits-8<<4)<<8;d|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(d|=32),d+=31-d%31,i.status=E,U(i,d),0!==i.strstart&&(U(i,t.adler>>>16),U(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),F(t),s=i.pending,i.pending!==i.pending_buf_size));)P(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),F(t),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,P(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),F(t),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,P(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>s&&(t.adler=o(t.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(t),i.pending+2<=i.pending_buf_size&&(P(i,255&t.adler),P(i,t.adler>>8&255),t.adler=0,i.status=E)):i.status=E),0!==i.pending){if(F(t),0===t.avail_out)return i.last_flush=-1,c}else if(0===t.avail_in&&R(e)<=R(r)&&e!==l)return T(t,-5);if(666===i.status&&0!==t.avail_in)return T(t,-5);if(0!==t.avail_in||0!==i.lookahead||e!==h&&666!==i.status){var p=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(L(t),0===t.lookahead)){if(e===h)return A;break}if(t.match_length=0,r=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===l?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}(i,e):3===i.strategy?function(t,e){for(var r,n,i,s,o=t.window;;){if(t.lookahead<=S){if(L(t),t.lookahead<=S&&e===h)return A;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=x&&0<t.strstart&&(n=o[i=t.strstart-1])===o[++i]&&n===o[++i]&&n===o[++i]){s=t.strstart+S;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);t.match_length=S-(s-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=x?(r=a._tr_tally(t,1,t.match_length-x),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(N(t,!1),0===t.strm.avail_out))return A}return t.insert=0,e===l?(N(t,!0),0===t.strm.avail_out?O:B):t.last_lit&&(N(t,!1),0===t.strm.avail_out)?A:I}(i,e):n[i.level].func(i,e);if(p!==O&&p!==B||(i.status=666),p===A||p===O)return 0===t.avail_out&&(i.last_flush=-1),c;if(p===I&&(1===e?a._tr_align(i):5!==e&&(a._tr_stored_block(i,0,0,!1),3===e&&(D(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),F(t),0===t.avail_out))return i.last_flush=-1,c}return e!==l?c:i.wrap<=0?1:(2===i.wrap?(P(i,255&t.adler),P(i,t.adler>>8&255),P(i,t.adler>>16&255),P(i,t.adler>>24&255),P(i,255&t.total_in),P(i,t.total_in>>8&255),P(i,t.total_in>>16&255),P(i,t.total_in>>24&255)):(U(i,t.adler>>>16),U(i,65535&t.adler)),F(t),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?c:1)},r.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==C&&69!==e&&73!==e&&91!==e&&103!==e&&e!==E&&666!==e?T(t,f):(t.state=null,e===E?T(t,-3):c):f},r.deflateSetDictionary=function(t,e){var r,n,a,o,u,h,l,d,p=e.length;if(!t||!t.state)return f;if(2===(o=(r=t.state).wrap)||1===o&&r.status!==C||r.lookahead)return f;for(1===o&&(t.adler=s(t.adler,e,p,0)),r.wrap=0,p>=r.w_size&&(0===o&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),d=new i.Buf8(r.w_size),i.arraySet(d,e,p-r.w_size,r.w_size,0),e=d,p=r.w_size),u=t.avail_in,h=t.next_in,l=t.input,t.avail_in=p,t.next_in=0,t.input=e,L(r);r.lookahead>=x;){for(n=r.strstart,a=r.lookahead-(x-1);r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+x-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--a;);r.strstart=n,r.lookahead=x-1,L(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=x-1,r.match_available=0,t.next_in=h,t.input=l,t.avail_in=u,r.wrap=o,c},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,r){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i,a,s,o,u,h,l,c,f,d,p,m,_,g,b,v,y,w,k,x,S,z,C;r=t.state,n=t.next_in,z=t.input,i=n+(t.avail_in-5),a=t.next_out,C=t.output,s=a-(e-t.avail_out),o=a+(t.avail_out-257),u=r.dmax,h=r.wsize,l=r.whave,c=r.wnext,f=r.window,d=r.hold,p=r.bits,m=r.lencode,_=r.distcode,g=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;t:do{p<15&&(d+=z[n++]<<p,p+=8,d+=z[n++]<<p,p+=8),v=m[d&g];e:for(;;){if(d>>>=y=v>>>24,p-=y,0==(y=v>>>16&255))C[a++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(d&(1<<y)-1)];continue e}if(32&y){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}w=65535&v,(y&=15)&&(p<y&&(d+=z[n++]<<p,p+=8),w+=d&(1<<y)-1,d>>>=y,p-=y),p<15&&(d+=z[n++]<<p,p+=8,d+=z[n++]<<p,p+=8),v=_[d&b];r:for(;;){if(d>>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(d&(1<<y)-1)];continue r}t.msg="invalid distance code",r.mode=30;break t}if(k=65535&v,p<(y&=15)&&(d+=z[n++]<<p,(p+=8)<y&&(d+=z[n++]<<p,p+=8)),u<(k+=d&(1<<y)-1)){t.msg="invalid distance too far back",r.mode=30;break t}if(d>>>=y,p-=y,(y=a-s)<k){if(l<(y=k-y)&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(S=f,(x=0)===c){if(x+=h-y,y<w){for(w-=y;C[a++]=f[x++],--y;);x=a-k,S=C}}else if(c<y){if(x+=h+c-y,(y-=c)<w){for(w-=y;C[a++]=f[x++],--y;);if(x=0,c<w){for(w-=y=c;C[a++]=f[x++],--y;);x=a-k,S=C}}}else if(x+=c-y,y<w){for(w-=y;C[a++]=f[x++],--y;);x=a-k,S=C}for(;2<w;)C[a++]=S[x++],C[a++]=S[x++],C[a++]=S[x++],w-=3;w&&(C[a++]=S[x++],1<w&&(C[a++]=S[x++]))}else{for(x=a-k;C[a++]=C[x++],C[a++]=C[x++],C[a++]=C[x++],2<(w-=3););w&&(C[a++]=C[x++],1<w&&(C[a++]=C[x++]))}break}}break}}while(n<i&&a<o);n-=w=p>>3,d&=(1<<(p-=w<<3))-1,t.next_in=n,t.next_out=a,t.avail_in=n<i?i-n+5:5-(n-i),t.avail_out=a<o?o-a+257:257-(a-o),r.hold=d,r.bits=p}},{}],49:[function(t,e,r){"use strict";var n=t("../utils/common"),i=t("./adler32"),a=t("./crc32"),s=t("./inffast"),o=t("./inftrees"),u=1,h=2,l=0,c=-2,f=1,d=852,p=592;function m(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function _(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function g(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=f,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(d),e.distcode=e.distdyn=new n.Buf32(p),e.sane=1,e.back=-1,l):c}function b(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,g(t)):c}function v(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?c:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,b(t))):c}function y(t,e){var r,n;return t?(n=new _,(t.state=n).window=null,(r=v(t,e))!==l&&(t.state=null),r):c}var w,k,x=!0;function S(t){if(x){var e;for(w=new n.Buf32(512),k=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(o(u,t.lens,0,288,w,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(h,t.lens,0,32,k,0,t.work,{bits:5}),x=!1}t.lencode=w,t.lenbits=9,t.distcode=k,t.distbits=5}function z(t,e,r,i){var a,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(a=s.wsize-s.wnext)&&(a=i),n.arraySet(s.window,e,r-i,a,s.wnext),(i-=a)?(n.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0}r.inflateReset=b,r.inflateReset2=v,r.inflateResetKeep=g,r.inflateInit=function(t){return y(t,15)},r.inflateInit2=y,r.inflate=function(t,e){var r,d,p,_,g,b,v,y,w,k,x,C,E,A,I,O,B,T,R,D,F,N,P,U,j=0,L=new n.Buf8(4),Z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return c;12===(r=t.state).mode&&(r.mode=13),g=t.next_out,p=t.output,v=t.avail_out,_=t.next_in,d=t.input,b=t.avail_in,y=r.hold,w=r.bits,k=b,x=v,N=l;t:for(;;)switch(r.mode){case f:if(0===r.wrap){r.mode=13;break}for(;w<16;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}if(2&r.wrap&&35615===y){L[r.check=0]=255&y,L[1]=y>>>8&255,r.check=a(r.check,L,2,0),w=y=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&y)){t.msg="unknown compression method",r.mode=30;break}if(w-=4,F=8+(15&(y>>>=4)),0===r.wbits)r.wbits=F;else if(F>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<<F,t.adler=r.check=1,r.mode=512&y?10:12,w=y=0;break;case 2:for(;w<16;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}if(r.flags=y,8!=(255&r.flags)){t.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=y>>8&1),512&r.flags&&(L[0]=255&y,L[1]=y>>>8&255,r.check=a(r.check,L,2,0)),w=y=0,r.mode=3;case 3:for(;w<32;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}r.head&&(r.head.time=y),512&r.flags&&(L[0]=255&y,L[1]=y>>>8&255,L[2]=y>>>16&255,L[3]=y>>>24&255,r.check=a(r.check,L,4,0)),w=y=0,r.mode=4;case 4:for(;w<16;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}r.head&&(r.head.xflags=255&y,r.head.os=y>>8),512&r.flags&&(L[0]=255&y,L[1]=y>>>8&255,r.check=a(r.check,L,2,0)),w=y=0,r.mode=5;case 5:if(1024&r.flags){for(;w<16;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}r.length=y,r.head&&(r.head.extra_len=y),512&r.flags&&(L[0]=255&y,L[1]=y>>>8&255,r.check=a(r.check,L,2,0)),w=y=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(b<(C=r.length)&&(C=b),C&&(r.head&&(F=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,d,_,C,F)),512&r.flags&&(r.check=a(r.check,d,C,_)),b-=C,_+=C,r.length-=C),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===b)break t;for(C=0;F=d[_+C++],r.head&&F&&r.length<65536&&(r.head.name+=String.fromCharCode(F)),F&&C<b;);if(512&r.flags&&(r.check=a(r.check,d,C,_)),b-=C,_+=C,F)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===b)break t;for(C=0;F=d[_+C++],r.head&&F&&r.length<65536&&(r.head.comment+=String.fromCharCode(F)),F&&C<b;);if(512&r.flags&&(r.check=a(r.check,d,C,_)),b-=C,_+=C,F)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;w<16;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}if(y!==(65535&r.check)){t.msg="header crc mismatch",r.mode=30;break}w=y=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;w<32;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}t.adler=r.check=m(y),w=y=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=g,t.avail_out=v,t.next_in=_,t.avail_in=b,r.hold=y,r.bits=w,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break t;case 13:if(r.last){y>>>=7&w,w-=7&w,r.mode=27;break}for(;w<3;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}switch(r.last=1&y,w-=1,3&(y>>>=1)){case 0:r.mode=14;break;case 1:if(S(r),r.mode=20,6!==e)break;y>>>=2,w-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}y>>>=2,w-=2;break;case 14:for(y>>>=7&w,w-=7&w;w<32;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}if((65535&y)!=(y>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&y,w=y=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(C=r.length){if(b<C&&(C=b),v<C&&(C=v),0===C)break t;n.arraySet(p,d,_,C,g),b-=C,_+=C,v-=C,g+=C,r.length-=C;break}r.mode=12;break;case 17:for(;w<14;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}if(r.nlen=257+(31&y),y>>>=5,w-=5,r.ndist=1+(31&y),y>>>=5,w-=5,r.ncode=4+(15&y),y>>>=4,w-=4,286<r.nlen||30<r.ndist){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;w<3;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}r.lens[Z[r.have++]]=7&y,y>>>=3,w-=3}for(;r.have<19;)r.lens[Z[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},N=o(0,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,N){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;O=(j=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,B=65535&j,!((I=j>>>24)<=w);){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}if(B<16)y>>>=I,w-=I,r.lens[r.have++]=B;else{if(16===B){for(U=I+2;w<U;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}if(y>>>=I,w-=I,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}F=r.lens[r.have-1],C=3+(3&y),y>>>=2,w-=2}else if(17===B){for(U=I+3;w<U;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}w-=I,F=0,C=3+(7&(y>>>=I)),y>>>=3,w-=3}else{for(U=I+7;w<U;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}w-=I,F=0,C=11+(127&(y>>>=I)),y>>>=7,w-=7}if(r.have+C>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;C--;)r.lens[r.have++]=F}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,P={bits:r.lenbits},N=o(u,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,N){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},N=o(h,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,N){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=b&&258<=v){t.next_out=g,t.avail_out=v,t.next_in=_,t.avail_in=b,r.hold=y,r.bits=w,s(t,x),g=t.next_out,p=t.output,v=t.avail_out,_=t.next_in,d=t.input,b=t.avail_in,y=r.hold,w=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;O=(j=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,B=65535&j,!((I=j>>>24)<=w);){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}if(O&&0==(240&O)){for(T=I,R=O,D=B;O=(j=r.lencode[D+((y&(1<<T+R)-1)>>T)])>>>16&255,B=65535&j,!(T+(I=j>>>24)<=w);){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}y>>>=T,w-=T,r.back+=T}if(y>>>=I,w-=I,r.back+=I,r.length=B,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=12;break}if(64&O){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(U=r.extra;w<U;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}r.length+=y&(1<<r.extra)-1,y>>>=r.extra,w-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;O=(j=r.distcode[y&(1<<r.distbits)-1])>>>16&255,B=65535&j,!((I=j>>>24)<=w);){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}if(0==(240&O)){for(T=I,R=O,D=B;O=(j=r.distcode[D+((y&(1<<T+R)-1)>>T)])>>>16&255,B=65535&j,!(T+(I=j>>>24)<=w);){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}y>>>=T,w-=T,r.back+=T}if(y>>>=I,w-=I,r.back+=I,64&O){t.msg="invalid distance code",r.mode=30;break}r.offset=B,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(U=r.extra;w<U;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}r.offset+=y&(1<<r.extra)-1,y>>>=r.extra,w-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===v)break t;if(C=x-v,r.offset>C){if((C=r.offset-C)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}E=C>r.wnext?(C-=r.wnext,r.wsize-C):r.wnext-C,C>r.length&&(C=r.length),A=r.window}else A=p,E=g-r.offset,C=r.length;for(v<C&&(C=v),v-=C,r.length-=C;p[g++]=A[E++],--C;);0===r.length&&(r.mode=21);break;case 26:if(0===v)break t;p[g++]=r.length,v--,r.mode=21;break;case 27:if(r.wrap){for(;w<32;){if(0===b)break t;b--,y|=d[_++]<<w,w+=8}if(x-=v,t.total_out+=x,r.total+=x,x&&(t.adler=r.check=r.flags?a(r.check,p,x,g-x):i(r.check,p,x,g-x)),x=v,(r.flags?y:m(y))!==r.check){t.msg="incorrect data check",r.mode=30;break}w=y=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;w<32;){if(0===b)break t;b--,y+=d[_++]<<w,w+=8}if(y!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=30;break}w=y=0}r.mode=29;case 29:N=1;break t;case 30:N=-3;break t;case 31:return-4;default:return c}return t.next_out=g,t.avail_out=v,t.next_in=_,t.avail_in=b,r.hold=y,r.bits=w,(r.wsize||x!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&z(t,t.output,t.next_out,x-t.avail_out)?(r.mode=31,-4):(k-=t.avail_in,x-=t.avail_out,t.total_in+=k,t.total_out+=x,r.total+=x,r.wrap&&x&&(t.adler=r.check=r.flags?a(r.check,p,x,t.next_out-x):i(r.check,p,x,t.next_out-x)),t.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==k&&0===x||4===e)&&N===l&&(N=-5),N)},r.inflateEnd=function(t){if(!t||!t.state)return c;var e=t.state;return e.window&&(e.window=null),t.state=null,l},r.inflateGetHeader=function(t,e){var r;return t&&t.state?0==(2&(r=t.state).wrap)?c:((r.head=e).done=!1,l):c},r.inflateSetDictionary=function(t,e){var r,n=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?c:11===r.mode&&i(1,e,n,0)!==r.check?-3:z(t,e,n,n)?(r.mode=31,-4):(r.havedict=1,l):c},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,r){"use strict";var n=t("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[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],s=[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],o=[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];e.exports=function(t,e,r,u,h,l,c,f){var d,p,m,_,g,b,v,y,w,k=f.bits,x=0,S=0,z=0,C=0,E=0,A=0,I=0,O=0,B=0,T=0,R=null,D=0,F=new n.Buf16(16),N=new n.Buf16(16),P=null,U=0;for(x=0;x<=15;x++)F[x]=0;for(S=0;S<u;S++)F[e[r+S]]++;for(E=k,C=15;1<=C&&0===F[C];C--);if(C<E&&(E=C),0===C)return h[l++]=20971520,h[l++]=20971520,f.bits=1,0;for(z=1;z<C&&0===F[z];z++);for(E<z&&(E=z),x=O=1;x<=15;x++)if(O<<=1,(O-=F[x])<0)return-1;if(0<O&&(0===t||1!==C))return-1;for(N[1]=0,x=1;x<15;x++)N[x+1]=N[x]+F[x];for(S=0;S<u;S++)0!==e[r+S]&&(c[N[e[r+S]]++]=S);if(b=0===t?(R=P=c,19):1===t?(R=i,D-=257,P=a,U-=257,256):(R=s,P=o,-1),x=z,g=l,I=S=T=0,m=-1,_=(B=1<<(A=E))-1,1===t&&852<B||2===t&&592<B)return 1;for(;;){for(v=x-I,w=c[S]<b?(y=0,c[S]):c[S]>b?(y=P[U+c[S]],R[D+c[S]]):(y=96,0),d=1<<x-I,z=p=1<<A;h[g+(T>>I)+(p-=d)]=v<<24|y<<16|w|0,0!==p;);for(d=1<<x-1;T&d;)d>>=1;if(0!==d?(T&=d-1,T+=d):T=0,S++,0==--F[x]){if(x===C)break;x=e[r+c[S]]}if(E<x&&(T&_)!==m){for(0===I&&(I=E),g+=z,O=1<<(A=x-I);A+I<C&&!((O-=F[A+I])<=0);)A++,O<<=1;if(B+=1<<A,1===t&&852<B||2===t&&592<B)return 1;h[m=T&_]=E<<24|A<<16|g-l|0}}return 0!==T&&(h[g+T]=x-I<<24|64<<16|0),f.bits=E,0}},{"../utils/common":41}],51:[function(t,e,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,r){"use strict";var n=t("../utils/common"),i=0,a=1;function s(t){for(var e=t.length;0<=--e;)t[e]=0}var o=0,u=29,h=256,l=h+1+u,c=30,f=19,d=2*l+1,p=15,m=16,_=7,g=256,b=16,v=17,y=18,w=[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],k=[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],x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],S=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],z=new Array(2*(l+2));s(z);var C=new Array(2*c);s(C);var E=new Array(512);s(E);var A=new Array(256);s(A);var I=new Array(u);s(I);var O,B,T,R=new Array(c);function D(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function F(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function N(t){return t<256?E[t]:E[256+(t>>>7)]}function P(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function U(t,e,r){t.bi_valid>m-r?(t.bi_buf|=e<<t.bi_valid&65535,P(t,t.bi_buf),t.bi_buf=e>>m-t.bi_valid,t.bi_valid+=r-m):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function j(t,e,r){U(t,r[2*e],r[2*e+1])}function L(t,e){for(var r=0;r|=1&t,t>>>=1,r<<=1,0<--e;);return r>>>1}function Z(t,e,r){var n,i,a=new Array(p+1),s=0;for(n=1;n<=p;n++)a[n]=s=s+r[n-1]<<1;for(i=0;i<=e;i++){var o=t[2*i+1];0!==o&&(t[2*i]=L(a[o]++,o))}}function W(t){var e;for(e=0;e<l;e++)t.dyn_ltree[2*e]=0;for(e=0;e<c;e++)t.dyn_dtree[2*e]=0;for(e=0;e<f;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*g]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function M(t){8<t.bi_valid?P(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function H(t,e,r,n){var i=2*e,a=2*r;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]}function G(t,e,r){for(var n=t.heap[r],i=r<<1;i<=t.heap_len&&(i<t.heap_len&&H(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!H(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n}function K(t,e,r){var n,i,a,s,o=0;if(0!==t.last_lit)for(;n=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===n?j(t,i,e):(j(t,(a=A[i])+h+1,e),0!==(s=w[a])&&U(t,i-=I[a],s),j(t,a=N(--n),r),0!==(s=k[a])&&U(t,n-=R[a],s)),o<t.last_lit;);j(t,g,e)}function X(t,e){var r,n,i,a=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,u=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=d,r=0;r<u;r++)0!==a[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)a[2*(i=t.heap[++t.heap_len]=h<2?++h:0)]=1,t.depth[i]=0,t.opt_len--,o&&(t.static_len-=s[2*i+1]);for(e.max_code=h,r=t.heap_len>>1;1<=r;r--)G(t,a,r);for(i=u;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],G(t,a,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,a[2*i]=a[2*r]+a[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,a[2*r+1]=a[2*n+1]=i,t.heap[1]=i++,G(t,a,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,a,s,o,u=e.dyn_tree,h=e.max_code,l=e.stat_desc.static_tree,c=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,m=e.stat_desc.extra_base,_=e.stat_desc.max_length,g=0;for(a=0;a<=p;a++)t.bl_count[a]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<d;r++)_<(a=u[2*u[2*(n=t.heap[r])+1]+1]+1)&&(a=_,g++),u[2*n+1]=a,h<n||(t.bl_count[a]++,s=0,m<=n&&(s=f[n-m]),o=u[2*n],t.opt_len+=o*(a+s),c&&(t.static_len+=o*(l[2*n+1]+s)));if(0!==g){do{for(a=_-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[_]--,g-=2}while(0<g);for(a=_;0!==a;a--)for(n=t.bl_count[a];0!==n;)h<(i=t.heap[--r])||(u[2*i+1]!==a&&(t.opt_len+=(a-u[2*i+1])*u[2*i],u[2*i+1]=a),n--)}}(t,e),Z(a,h,t.bl_count)}function Y(t,e,r){var n,i,a=-1,s=e[1],o=0,u=7,h=4;for(0===s&&(u=138,h=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=e[2*(n+1)+1],++o<u&&i===s||(o<h?t.bl_tree[2*i]+=o:0!==i?(i!==a&&t.bl_tree[2*i]++,t.bl_tree[2*b]++):o<=10?t.bl_tree[2*v]++:t.bl_tree[2*y]++,a=i,h=(o=0)===s?(u=138,3):i===s?(u=6,3):(u=7,4))}function V(t,e,r){var n,i,a=-1,s=e[1],o=0,u=7,h=4;for(0===s&&(u=138,h=3),n=0;n<=r;n++)if(i=s,s=e[2*(n+1)+1],!(++o<u&&i===s)){if(o<h)for(;j(t,i,t.bl_tree),0!=--o;);else 0!==i?(i!==a&&(j(t,i,t.bl_tree),o--),j(t,b,t.bl_tree),U(t,o-3,2)):o<=10?(j(t,v,t.bl_tree),U(t,o-3,3)):(j(t,y,t.bl_tree),U(t,o-11,7));a=i,h=(o=0)===s?(u=138,3):i===s?(u=6,3):(u=7,4)}}s(R);var q=!1;function J(t,e,r,i){U(t,(o<<1)+(i?1:0),3),function(t,e,r,i){M(t),i&&(P(t,r),P(t,~r)),n.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}(t,e,r,!0)}r._tr_init=function(t){q||(function(){var t,e,r,n,i,a=new Array(p+1);for(n=r=0;n<u-1;n++)for(I[n]=r,t=0;t<1<<w[n];t++)A[r++]=n;for(A[r-1]=n,n=i=0;n<16;n++)for(R[n]=i,t=0;t<1<<k[n];t++)E[i++]=n;for(i>>=7;n<c;n++)for(R[n]=i<<7,t=0;t<1<<k[n]-7;t++)E[256+i++]=n;for(e=0;e<=p;e++)a[e]=0;for(t=0;t<=143;)z[2*t+1]=8,t++,a[8]++;for(;t<=255;)z[2*t+1]=9,t++,a[9]++;for(;t<=279;)z[2*t+1]=7,t++,a[7]++;for(;t<=287;)z[2*t+1]=8,t++,a[8]++;for(Z(z,l+1,a),t=0;t<c;t++)C[2*t+1]=5,C[2*t]=L(t,5);O=new D(z,w,h+1,l,p),B=new D(C,k,0,c,p),T=new D(new Array(0),x,0,f,_)}(),q=!0),t.l_desc=new F(t.dyn_ltree,O),t.d_desc=new F(t.dyn_dtree,B),t.bl_desc=new F(t.bl_tree,T),t.bi_buf=0,t.bi_valid=0,W(t)},r._tr_stored_block=J,r._tr_flush_block=function(t,e,r,n){var s,o,u=0;0<t.level?(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 i;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return a;for(e=32;e<h;e++)if(0!==t.dyn_ltree[2*e])return a;return i}(t)),X(t,t.l_desc),X(t,t.d_desc),u=function(t){var e;for(Y(t,t.dyn_ltree,t.l_desc.max_code),Y(t,t.dyn_dtree,t.d_desc.max_code),X(t,t.bl_desc),e=f-1;3<=e&&0===t.bl_tree[2*S[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),s=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=s&&(s=o)):s=o=r+5,r+4<=s&&-1!==e?J(t,e,r,n):4===t.strategy||o===s?(U(t,2+(n?1:0),3),K(t,z,C)):(U(t,4+(n?1:0),3),function(t,e,r,n){var i;for(U(t,e-257,5),U(t,r-1,5),U(t,n-4,4),i=0;i<n;i++)U(t,t.bl_tree[2*S[i]+1],3);V(t,t.dyn_ltree,e-1),V(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,u+1),K(t,t.dyn_ltree,t.dyn_dtree)),W(t),n&&M(t)},r._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*(A[r]+h+1)]++,t.dyn_dtree[2*N(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){U(t,2,3),j(t,g,z),function(t){16===t.bi_valid?(P(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,n){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var r,n,i,a,s=1,o={},u=!1,h=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,r="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){f(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(a="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",d,!1):t.attachEvent("onmessage",d),function(e){t.postMessage(a+e,"*")}):t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){f(t.data)},function(t){i.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(n=h.documentElement,function(t){var e=h.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):function(t){setTimeout(f,0,t)},l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return o[s]=i,r(s),s++},l.clearImmediate=c}function c(t){delete o[t]}function f(t){if(u)setTimeout(f,0,t);else{var r=o[t];if(r){u=!0;try{!function(t){var r=t.callback,n=t.args;switch(n.length){case 0:r();break;case 1:r(n[0]);break;case 2:r(n[0],n[1]);break;case 3:r(n[0],n[1],n[2]);break;default:r.apply(e,n)}}(r)}finally{c(t),u=!1}}}}function d(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&f(+e.data.slice(a.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";r(733),r(925);var t=function(t,e,r,n){return new(r||(r=Promise))((function(i,a){function s(t){try{u(n.next(t))}catch(t){a(t)}}function o(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,o)}u((n=n.apply(t,e||[])).next())}))},e=function(t,e){var r,n,i,a,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},n={sdkKey:"a3ae8341bd8f44899eba16df86307d7d",urlParams:["help","play","nt","play","qs","brand","dh","tour","gt","hr","mls","mt","tagNav","pin","portal","f","fp","lang","kb","lp","st","title","tourcta","wts","ts","hl","vr","nozoom","search","wh"]},i="http://localhost:5173/api/v1/",a=n.sdkKey;n.urlParams;console.log("apiURL...",i);var s,o={},u=null;"/bundle/showcase.html?m=''&applicationKey=".concat(a,"&newtags=1");function h(r,n){return void 0===n&&(n="translate"),t(this,void 0,void 0,(function(){var t,i,a,h;return e(this,(function(e){switch(e.label){case 0:return console.log("Object to be transformed "+r.object.object_data.name),s?null!=u&&u?(s.stop(),console.log("clearTransformControls()")):console.error("_inputControlComponent is undefined"):console.error("_transformControlNode is undefined"),[4,o.Scene.createObjects(1)];case 1:return t=e.sent()[0],i=t.addNode(),a=i.addComponent("mp.transformControls"),s=i,h=i.addComponent("mp.input",{eventsEnabled:!0,userNavigationEnabled:!0}),u=h.spyOnEvent(new l(r.object,r.node,r.component)),i.start(),a.inputs.selection=r.node,a.inputs.mode=n,[2]}}))}))}var l=function(){function r(t,e,r){this.eventType="INTERACTION.CLICK",this.object_data=t,this.node=e,this.component=r}return r.prototype.onEvent=function(r){return t(this,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return console.log("INTERACTION.CLICK",r),t={object:this.object_data,node:this.node,component:this.component},n=this.object_data,i=this.node,a=this.component,{object:n,component:a,node:i},console.log("setSelectedObject()"),[4,h(t)];case 1:return e.sent(),[2]}var n,i,a}))}))},r}()})()})();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
|
|
3
|
+
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
4
|
+
<http://stuartk.com/jszip>
|
|
5
|
+
|
|
6
|
+
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
|
7
|
+
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
|
8
|
+
|
|
9
|
+
JSZip uses the library pako released under the MIT license :
|
|
10
|
+
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
11
|
+
*/
|
package/lib/types.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export interface IMPConfig {
|
|
|
48
48
|
nozoom?: 0 | 1;
|
|
49
49
|
search?: 0 | 1;
|
|
50
50
|
wh?: 0 | 1;
|
|
51
|
+
prod?: boolean;
|
|
51
52
|
}
|
|
52
53
|
export declare const enum MP_LANG {
|
|
53
54
|
EN = "en",
|
|
@@ -128,7 +129,15 @@ export interface ISlideshowObject {
|
|
|
128
129
|
object: any;
|
|
129
130
|
node: Scene.INode;
|
|
130
131
|
component: Scene.IComponent;
|
|
131
|
-
type
|
|
132
|
+
type?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface IObjectData {
|
|
135
|
+
id?: number;
|
|
136
|
+
collider?: any;
|
|
137
|
+
object: IShowcaseObject;
|
|
138
|
+
component: Scene.IComponent;
|
|
139
|
+
node: Scene.INode;
|
|
140
|
+
type?: string;
|
|
132
141
|
}
|
|
133
142
|
export interface NearbyPayload {
|
|
134
143
|
type: string | OBJECT_TYPE;
|
|
@@ -139,8 +148,13 @@ export interface NearbyObjects {
|
|
|
139
148
|
videos: Array<IVideoObject>;
|
|
140
149
|
slideshows: Array<ISlideshowObject>;
|
|
141
150
|
}
|
|
142
|
-
export declare enum OBJECT_TYPE {
|
|
151
|
+
export declare const enum OBJECT_TYPE {
|
|
143
152
|
X3D = "X3D",
|
|
144
153
|
VIDEO = "VIDEO",
|
|
145
154
|
SLIDESHOW = "SLIDESHOW"
|
|
146
155
|
}
|
|
156
|
+
export declare const enum TRANSFORM_TYPE {
|
|
157
|
+
TRANSLATE = "translate",
|
|
158
|
+
ROTATE = "rotate",
|
|
159
|
+
SCALE = "scale"
|
|
160
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "architwin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "ArchiTwin Library for Matterport",
|
|
5
5
|
"main": "lib/architwin.min.js",
|
|
6
|
-
"types": "lib/types.ts",
|
|
6
|
+
"types": "lib/types.d.ts",
|
|
7
|
+
|
|
7
8
|
"scripts": {
|
|
8
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
-
"build": "
|
|
10
|
+
"build": "webpack"
|
|
10
11
|
},
|
|
11
12
|
"author": "",
|
|
12
13
|
"license": "ISC",
|
|
@@ -16,12 +17,16 @@
|
|
|
16
17
|
"jszip": "^3.10.1",
|
|
17
18
|
"jszip-utils": "^0.1.0",
|
|
18
19
|
"mathjs": "^11.8.0",
|
|
19
|
-
"three": "^0.152.2"
|
|
20
|
+
"three": "^0.152.2",
|
|
21
|
+
"ts-loader": "^9.4.3",
|
|
22
|
+
"webpack": "^5.85.1"
|
|
20
23
|
},
|
|
21
24
|
"devDependencies": {
|
|
22
25
|
"@tsconfig/node18": "^2.0.1",
|
|
23
26
|
"@types/node": "^18.16.15",
|
|
24
27
|
"javascript-obfuscator": "^4.0.2",
|
|
25
|
-
"
|
|
28
|
+
"terser-webpack-plugin": "^5.3.9",
|
|
29
|
+
"typescript": "5.0.4",
|
|
30
|
+
"webpack-cli": "^5.1.3"
|
|
26
31
|
}
|
|
27
32
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "es5",
|
|
4
|
-
"module": "
|
|
4
|
+
"module": "ES6",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"esModuleInterop": true,
|
|
5
7
|
"declaration": true,
|
|
6
8
|
"outDir": "./lib",
|
|
7
9
|
"strict": false
|
|
8
10
|
},
|
|
9
11
|
"include": ["src"],
|
|
10
|
-
"exclude": ["node_modules",
|
|
12
|
+
"exclude": ["node_modules", "**/__tests__/*"]
|
|
11
13
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const TerserPlugin = require("terser-webpack-plugin");
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
mode: 'production',
|
|
7
|
+
entry: './src/architwin.ts',
|
|
8
|
+
module: {
|
|
9
|
+
rules: [
|
|
10
|
+
{
|
|
11
|
+
test: /\.tsx?$/,
|
|
12
|
+
use: 'ts-loader',
|
|
13
|
+
exclude: /node_modules/,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
resolve: {
|
|
18
|
+
extensions: ['.tsx', '.ts', '.js'],
|
|
19
|
+
},
|
|
20
|
+
output: {
|
|
21
|
+
filename: 'architwin.min.js',
|
|
22
|
+
path: path.resolve(__dirname, 'lib'),
|
|
23
|
+
},
|
|
24
|
+
optimization: {
|
|
25
|
+
minimize: true,
|
|
26
|
+
minimizer: [new TerserPlugin()],
|
|
27
|
+
},
|
|
28
|
+
};
|
package/lib/types.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OBJECT_TYPE = void 0;
|
|
4
|
-
var OBJECT_TYPE;
|
|
5
|
-
(function (OBJECT_TYPE) {
|
|
6
|
-
OBJECT_TYPE["X3D"] = "X3D";
|
|
7
|
-
OBJECT_TYPE["VIDEO"] = "VIDEO";
|
|
8
|
-
OBJECT_TYPE["SLIDESHOW"] = "SLIDESHOW";
|
|
9
|
-
})(OBJECT_TYPE = exports.OBJECT_TYPE || (exports.OBJECT_TYPE = {}));
|