text: !function(a){var t={};function r(n){if(t[n])return t[n].exports;var e=t[n]={i:n,l:!1,exports:{}};return a[n].call(e.exports,e,e.exports,r),e.l=!0,e.exports}r.m=a,r.c=t,r.d=function(a,t,n){r.o(a,t)||Object.defineProperty(a,t,{enumerable:!0,get:n})},r.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},r.t=function(a,t){if(1&t&&(a=r(a)),8&t)return a;if(4&t&&"object"==typeof a&&a&&a.__esModule)return a;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:a}),2&t&&"string"!=typeof a)for(var e in a)r.d(n,e,function(t){return a[t]}.bind(null,e));return n},r.n=function(a){var t=a&&a.__esModule?function(){return a.default}:function(){return a};return r.d(t,"a",t),t},r.o=function(a,t){return Object.prototype.hasOwnProperty.call(a,t)},r.p="",r(r.s="./src/index.ts")}({"./src/index.ts":function(module,exports,__webpack_require__){"use strict";eval('\nObject.defineProperty(exports, "__esModule", { value: true });\nvar loader_wwa_data = __webpack_require__("./src/wwa_data.ts");\nvar loader_core_1 = __webpack_require__("./src/loader_core.ts");\nvar loader_config_1 = __webpack_require__("./src/loader_config.ts");\nfunction sendToMain(m) {\n    if (loader_config_1.conf.is_worker) {\n        postMessage(m);\n    }\n    else {\n        postMessage_noWorker({\n            data: m\n        });\n    }\n}\nexports.sendToMain = sendToMain;\nfunction loader_start(e) {\n    if (e.data.fileName !== void 0) {\n        var loader = new loader_core_1.WWALoader(e.data.fileName);\n        loader.requestMapData();\n    }\n    else {\n        var resp = new loader_wwa_data.LoaderResponse();\n        resp.wwaData = null;\n        resp.progress = null;\n        resp.error = new loader_wwa_data.LoaderError();\n        resp.error.name = "";\n        resp.error.message = "マップデータのファイル名が指定されていません。";\n        sendToMain(resp);\n    }\n}\nif (loader_config_1.conf.is_worker) {\n    addEventListener("message", loader_start);\n}\n\n\n//# sourceURL=webpack:///./src/index.ts?')},"./src/loader_config.ts":function(module,exports,__webpack_require__){"use strict";eval('\nObject.defineProperty(exports, "__esModule", { value: true });\n;\nexports.conf = {\n    is_worker: true\n};\n\n\n//# sourceURL=webpack:///./src/loader_config.ts?')},"./src/loader_core.ts":function(module,exports,__webpack_require__){"use strict";eval('\nObject.defineProperty(exports, "__esModule", { value: true });\nvar loader_wwa_data = __webpack_require__("./src/wwa_data.ts");\nvar loader_extractor_1 = __webpack_require__("./src/loader_extractor.ts");\nvar wwa_data_1 = __webpack_require__("./src/wwa_data.ts");\nvar _1 = __webpack_require__("./src/index.ts");\nvar loader_util_1 = __webpack_require__("./src/loader_util.ts");\nvar DecodeResult = (function () {\n    function DecodeResult(mapData, extractEndPos) {\n        this.mapData = mapData;\n        this.extractEndPos = extractEndPos;\n    }\n    return DecodeResult;\n}());\nexports.DecodeResult = DecodeResult;\nvar WWALoader = (function () {\n    function WWALoader(fileName) {\n        this._fileName = fileName;\n    }\n    WWALoader.prototype.requestMapData = function () {\n        var _this = this;\n        var xhr = new XMLHttpRequest();\n        try {\n            xhr.open("GET", this._fileName, true);\n            xhr.responseType = "arraybuffer";\n            xhr.onreadystatechange = function () {\n                try {\n                    if (xhr.readyState === XMLHttpRequest.DONE) {\n                        if (xhr.status === 200 || xhr.status === 304) {\n                            _this.loadMapData(xhr.response);\n                            _this.sendDataToMainProgram();\n                        }\n                        else if (xhr.status === 404) {\n                            throw new Error("マップデータ「" +\n                                _this._fileName +\n                                "」が見つかりませんでした。\\n" +\n                                "HTTPステータスコードは " +\n                                xhr.status +\n                                "です。");\n                        }\n                        else if (xhr.status === 403) {\n                            throw new Error("マップデータ「" +\n                                _this._fileName +\n                                "」を読み取る権限がないようです。\\n" +\n                                "管理者の方へ: マップデータのパーミッションを確認してください。\\n" +\n                                "HTTPステータスコードは " +\n                                xhr.status +\n                                "です。");\n                        }\n                        else {\n                            throw new Error("マップデータ「" +\n                                _this._fileName +\n                                "」の読み込みに失敗しました。\\n" +\n                                "HTTPステータスコードは " +\n                                xhr.status +\n                                "です。");\n                        }\n                    }\n                }\n                catch (e) {\n                    _this.sendErrorToMainProgram(e);\n                }\n            };\n            xhr.send(null);\n        }\n        catch (e) {\n            var error = new Error("ロードエラー: ローカルテストの場合は、ブラウザが対応していない可能性があります。\\n" +\n                e.message);\n            this.sendErrorToMainProgram(error);\n        }\n    };\n    WWALoader.prototype.loadMapData = function (data) {\n        try {\n            this._srcData = new Uint8Array(data);\n            var extResult = this.decodeMapData();\n            this._dataExtractor = new loader_extractor_1.WWADataExtractor(extResult.mapData);\n            this._dataExtractor.extractAllData();\n            this._dataJSObj = this._dataExtractor.getJSObject();\n            this._currentPos = extResult.extractEndPos;\n        }\n        catch (e) {\n            throw e;\n        }\n        this._loadAllTextData();\n    };\n    WWALoader.prototype._loadAllTextData = function () {\n        var i;\n        if (this._dataJSObj.version >= 30) {\n            this._dataJSObj.worldPassword = this._getMessageFromData();\n        }\n        if (this._dataJSObj.version <= 29) {\n            this._dataJSObj.messageNum = WWALoader.OLDVER_MESSAGE_MAX;\n        }\n        this._dataJSObj.message = new Array(this._dataJSObj.messageNum);\n        for (i = 0; i < this._dataJSObj.message.length; i++) {\n            this._dataJSObj.message[i] = this._getMessageFromData();\n            if (i % 200 === 0) {\n                sendProgressToMainProgram(i, this._dataJSObj.message.length, loader_wwa_data.LoadStage.MESSAGE);\n            }\n        }\n        while (this._dataJSObj.messageNum < 10) {\n            this._dataJSObj.message.push("");\n            this._dataJSObj.messageNum++;\n        }\n        sendProgressToMainProgram(this._dataJSObj.message.length, this._dataJSObj.message.length, loader_wwa_data.LoadStage.MESSAGE);\n        this._dataJSObj.worldName = this._getMessageFromData();\n        if (this._dataJSObj.version <= 29) {\n            this._dataJSObj.worldPassword = this._getMessageFromData();\n        }\n        else {\n            this._getMessageFromData();\n        }\n        if (this._dataJSObj.worldPassword === "") {\n            this._dataJSObj.worldPassNumber = 0;\n        }\n        else {\n            if (this._dataJSObj.version >= 29) {\n                this._dataJSObj.worldPassNumber =\n                    (parseInt(this._dataJSObj.worldPassword) / 10 - 1197) / 17 - 2357;\n            }\n            else {\n                this._dataJSObj.worldPassNumber = parseInt(this._dataJSObj.worldPassword);\n            }\n        }\n        this._dataJSObj.charCGName = this._getMessageFromData();\n        this._dataJSObj.mapCGName = this._getMessageFromData();\n        this._dataJSObj.systemMessage = new Array(wwa_data_1.WWAConsts.SYSTEM_MESSAGE_NUM);\n        for (i = 0; i < wwa_data_1.WWAConsts.SYSTEM_MESSAGE_NUM; i++) {\n            if (this._dataJSObj.version >= 30) {\n                this._dataJSObj.systemMessage[i] = this._getMessageFromData();\n            }\n            else {\n                this._dataJSObj.systemMessage[i] = "";\n            }\n        }\n        this._dataJSObj.yesnoImgPosX =\n            loader_wwa_data.WWAConsts.IMGPOS_DEFAULT_YESNO_X;\n        this._dataJSObj.yesnoImgPosY =\n            loader_wwa_data.WWAConsts.IMGPOS_DEFAULT_YESNO_Y;\n        this._dataJSObj.playerImgPosX =\n            loader_wwa_data.WWAConsts.IMGPOS_DEFAULT_PLAYER_X;\n        this._dataJSObj.playerImgPosY =\n            loader_wwa_data.WWAConsts.IMGPOS_DEFAULT_PLAYER_Y;\n        this._dataJSObj.clickableItemSignImgPosX =\n            loader_wwa_data.WWAConsts.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X;\n        this._dataJSObj.clickableItemSignImgPosY =\n            loader_wwa_data.WWAConsts.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y;\n        this._dataJSObj.disableSaveFlag =\n            loader_wwa_data.WWAConsts.DEFAULT_DISABLE_SAVE;\n        this._dataJSObj.isOldMap = loader_wwa_data.WWAConsts.DEFAULT_OLDMAP;\n        this._dataJSObj.objectNoCollapseDefaultFlag =\n            loader_wwa_data.WWAConsts.DEFAULT_OBJECT_NO_COLLAPSE;\n        this._dataJSObj.delPlayerFlag = false;\n        this._dataJSObj.bgm = 0;\n        this._dataJSObj.effectCoords = [];\n        this._dataJSObj.effectWaits = 0;\n        this._dataJSObj.imgClickX = 0;\n        this._dataJSObj.imgClickY = 0;\n        this._dataJSObj.frameColorR = wwa_data_1.WWAConsts.DEFAULT_FRAME_COLOR_R;\n        this._dataJSObj.frameColorG = wwa_data_1.WWAConsts.DEFAULT_FRAME_COLOR_G;\n        this._dataJSObj.frameColorB = wwa_data_1.WWAConsts.DEFAULT_FRAME_COLOR_B;\n        this._dataJSObj.frameOutColorR = wwa_data_1.WWAConsts.DEFAULT_FRAMEOUT_COLOR_R;\n        this._dataJSObj.frameOutColorG = wwa_data_1.WWAConsts.DEFAULT_FRAMEOUT_COLOR_G;\n        this._dataJSObj.frameOutColorB = wwa_data_1.WWAConsts.DEFAULT_FRAMEOUT_COLOR_B;\n        this._dataJSObj.fontColorR = wwa_data_1.WWAConsts.DEFAULT_STR_COLOR_R;\n        this._dataJSObj.fontColorG = wwa_data_1.WWAConsts.DEFAULT_STR_COLOR_G;\n        this._dataJSObj.fontColorB = wwa_data_1.WWAConsts.DEFAULT_STR_COLOR_B;\n        this._dataJSObj.statusColorR = wwa_data_1.WWAConsts.DEFAULT_STATUS_COLOR_R;\n        this._dataJSObj.statusColorG = wwa_data_1.WWAConsts.DEFAULT_STATUS_COLOR_G;\n        this._dataJSObj.statusColorB = wwa_data_1.WWAConsts.DEFAULT_STATUS_COLOR_B;\n    };\n    WWALoader.prototype.sendDataToMainProgram = function () {\n        var resp = new loader_wwa_data.LoaderResponse();\n        resp.progress = null;\n        resp.error = null;\n        resp.wwaData = this._dataJSObj;\n        _1.sendToMain(resp);\n    };\n    WWALoader.prototype.sendErrorToMainProgram = function (error) {\n        var resp = new loader_wwa_data.LoaderResponse();\n        resp.wwaData = null;\n        resp.progress = null;\n        resp.error = new loader_wwa_data.LoaderError();\n        resp.error.name = error.name;\n        resp.error.message = error.message;\n        _1.sendToMain(resp);\n    };\n    WWALoader.prototype.decodeMapData = function () {\n        var destData = new Uint8Array(this._srcData.length);\n        var srcCounter, destCounter;\n        var maxim;\n        var i;\n        for (srcCounter = 0, destCounter = 0; srcCounter < this._srcData.length; srcCounter++) {\n            if (this._srcData[srcCounter] === 0 &&\n                this._srcData[srcCounter + 1] === 0 &&\n                this._srcData[srcCounter + 2] === 0) {\n                break;\n            }\n            destData[destCounter++] = this._srcData[srcCounter];\n            if (this._srcData[srcCounter] === this._srcData[srcCounter + 1]) {\n                maxim = this._srcData[srcCounter + 2];\n                for (i = 0; i < maxim; i++) {\n                    destData[destCounter++] = this._srcData[srcCounter];\n                }\n                srcCounter += 2;\n            }\n            if (destCounter + 255 >= destData.length) {\n                var newDestData = new Uint8Array(destData.length + WWALoader.MEM_BLOCK);\n                newDestData.set(destData);\n                destData = newDestData;\n            }\n        }\n        try {\n            console.log("EXTRACT DATA = " + destCounter + " " + srcCounter);\n        }\n        catch (e) { }\n        try {\n            this.checkCompletelyDecoded(destData, destCounter);\n        }\n        catch (e) {\n            throw e;\n        }\n        return new DecodeResult(destData, srcCounter + WWALoader.EXT_LAST_PADDING);\n    };\n    WWALoader.prototype._getMessageFromData = function () {\n        var str = "";\n        for (var i = 0; i < 1500; i++) {\n            if (this._srcData[this._currentPos + i * 2] == 0 &&\n                this._srcData[this._currentPos + i * 2 + 1] == 0) {\n                break;\n            }\n            str += String.fromCharCode((this._srcData[this._currentPos + i * 2 + 1] << 8) +\n                this._srcData[this._currentPos + i * 2]);\n        }\n        this._currentPos += i * 2 + 2;\n        return str;\n    };\n    WWALoader.prototype.checkCompletelyDecoded = function (mapData, dataLength) {\n        var i;\n        var checkSum = mapData[loader_extractor_1.WWADataExtractor.POS_CHECK] +\n            mapData[loader_extractor_1.WWADataExtractor.POS_CHECK + 1] * 0x100;\n        var sum = 0;\n        if (mapData[loader_extractor_1.WWADataExtractor.POS_VERSION] >= 29) {\n            for (i = 2; i < dataLength; i++) {\n                sum += loader_util_1.util.signedByte(mapData[i]) * (i % 8 + 1);\n            }\n            sum = (sum % 0x10000) & 0xffff;\n            if (checkSum !== sum) {\n                throw new Error("マップデータが壊れているようです。\\n チェックサムの値は" +\n                    checkSum +\n                    "ですが、" +\n                    "実際の和は" +\n                    sum +\n                    "でした。");\n            }\n        }\n    };\n    WWALoader.MEM_BLOCK = 65000;\n    WWALoader.EXT_LAST_PADDING = 3;\n    WWALoader.OLDVER_MESSAGE_MAX = 400;\n    return WWALoader;\n}());\nexports.WWALoader = WWALoader;\nfunction sendProgressToMainProgram(current, total, stage) {\n    var data = new loader_wwa_data.LoaderResponse();\n    data.error = null;\n    data.wwaData = null;\n    data.progress = new loader_wwa_data.LoaderProgress();\n    data.progress.current = current;\n    data.progress.total = total;\n    data.progress.stage = stage;\n    _1.sendToMain(data);\n}\nexports.sendProgressToMainProgram = sendProgressToMainProgram;\n\n\n//# sourceURL=webpack:///./src/loader_core.ts?')},"./src/loader_extractor.ts":function(module,exports,__webpack_require__){"use strict";eval('\nObject.defineProperty(exports, "__esModule", { value: true });\nvar loader_wwa_data = __webpack_require__("./src/wwa_data.ts");\nvar loader_util_1 = __webpack_require__("./src/loader_util.ts");\nvar loader_core = __webpack_require__("./src/loader_core.ts");\nvar wwa_data_1 = __webpack_require__("./src/wwa_data.ts");\nvar WWADataExtractor = (function () {\n    function WWADataExtractor(data) {\n        this._bitData = data;\n        this._wwaData = new wwa_data_1.WWAData();\n    }\n    WWADataExtractor.prototype.extractAllData = function () {\n        var mapAttrMax, objAttrMax;\n        this._wwaData.version = this._bitData[WWADataExtractor.POS_VERSION];\n        this._extractInitialParameters();\n        if (this._wwaData.version >= 29) {\n            this._currentPosition = WWADataExtractor.POS_MAPDATA_TOP;\n        }\n        else {\n            this._currentPosition = WWADataExtractor.POS_OLD_MAPDATA_TOP;\n        }\n        this._wwaData.map = this._getFieldDataFromBits(loader_wwa_data.PartsType.MAP, this._wwaData.mapPartsMax).concat();\n        this._wwaData.mapObject = this._getFieldDataFromBits(loader_wwa_data.PartsType.OBJECT, this._wwaData.objPartsMax).concat();\n        mapAttrMax = this._wwaData.version > 29 ? wwa_data_1.WWAConsts.MAP_ATR_MAX : wwa_data_1.WWAConsts.OLD_MAP_ATR_MAX;\n        objAttrMax = this._wwaData.version > 29 ? wwa_data_1.WWAConsts.OBJ_ATR_MAX : wwa_data_1.WWAConsts.OLD_OBJ_ATR_MAX;\n        this._wwaData.mapAttribute = this._getPartsDataFromBits(loader_wwa_data.PartsType.MAP, this._wwaData.mapPartsMax, mapAttrMax).concat();\n        this._wwaData.objectAttribute = this._getPartsDataFromBits(loader_wwa_data.PartsType.OBJECT, this._wwaData.objPartsMax, objAttrMax).concat();\n        if (this._wwaData.version <= 29) {\n            this._convertAttributeV2toV3(wwa_data_1.PartsType.MAP);\n            this._convertAttributeV2toV3(wwa_data_1.PartsType.OBJECT);\n        }\n        this._replaceAllRandomObjects();\n    };\n    WWADataExtractor.prototype._convertAttributeV2toV3 = function (partsType) {\n        var partsMax;\n        var attributeArray;\n        var localGateIndex;\n        if (partsType == wwa_data_1.PartsType.MAP) {\n            partsMax = this._wwaData.mapPartsMax;\n            attributeArray = this._wwaData.mapAttribute;\n            localGateIndex = wwa_data_1.WWAConsts.MAP_LOCALGATE;\n        }\n        else if (partsType == wwa_data_1.PartsType.OBJECT) {\n            partsMax = this._wwaData.objPartsMax;\n            attributeArray = this._wwaData.objectAttribute;\n            localGateIndex = wwa_data_1.WWAConsts.OBJECT_LOCALGATE;\n        }\n        else {\n            throw new Error("謎のパーツ種別が指定されました");\n        }\n        for (var j = 0; j < partsMax; j++) {\n            for (var i = 9; i >= 0; i--) {\n                var dataChara = attributeArray[j][20 + i * 2] & 0xff;\n                var dataMode = attributeArray[j][20 + i * 2] >> 8;\n                var x = attributeArray[j][20 + i * 2 + 1] & 0xff;\n                var y = attributeArray[j][20 + i * 2 + 1] >> 8;\n                if (x === 250) {\n                    x = 9000;\n                }\n                else if (x > 100) {\n                    x += 10000 - 160;\n                }\n                if (y === 250) {\n                    y = 9000;\n                }\n                else if (y > 100) {\n                    y += 10000 - 160;\n                }\n                attributeArray[j][20 + i * 4] = dataChara;\n                attributeArray[j][20 + i * 4 + 3] = dataMode;\n                attributeArray[j][20 + i * 4 + 1] = x;\n                attributeArray[j][20 + i * 4 + 2] = y;\n            }\n            if (attributeArray[j][wwa_data_1.WWAConsts.ATR_TYPE] === localGateIndex) {\n                if (attributeArray[j][wwa_data_1.WWAConsts.ATR_JUMP_X] > 100) {\n                    attributeArray[j][wwa_data_1.WWAConsts.ATR_JUMP_X] += 10000 - 160;\n                }\n                if (attributeArray[j][wwa_data_1.WWAConsts.ATR_JUMP_Y] > 100) {\n                    attributeArray[j][wwa_data_1.WWAConsts.ATR_JUMP_Y] += 10000 - 160;\n                }\n            }\n        }\n    };\n    WWADataExtractor.prototype.getJSObject = function () {\n        return this._wwaData;\n    };\n    WWADataExtractor.prototype._get1ByteNumber = function (index) {\n        return this._bitData[index];\n    };\n    WWADataExtractor.prototype._get2BytesNumber = function (index) {\n        return this._bitData[index] + this._bitData[index + 1] * 0x100;\n    };\n    WWADataExtractor.prototype._extractInitialParameters = function () {\n        if (this._wwaData.version > 29) {\n            this._wwaData.gameoverX = this._get2BytesNumber(WWADataExtractor.POS_GAMEOVER_X);\n            this._wwaData.gameoverY = this._get2BytesNumber(WWADataExtractor.POS_GAMEOVER_Y);\n            this._wwaData.playerX = this._get2BytesNumber(WWADataExtractor.POS_PLAYER_X);\n            this._wwaData.playerY = this._get2BytesNumber(WWADataExtractor.POS_PLAYER_Y);\n            this._wwaData.mapPartsMax = this._get2BytesNumber(WWADataExtractor.POS_MAP_COUNT);\n            this._wwaData.objPartsMax = this._get2BytesNumber(WWADataExtractor.POS_OBJ_COUNT);\n            this._wwaData.isOldMap = false;\n        }\n        else {\n            this._wwaData.gameoverX = this._get1ByteNumber(WWADataExtractor.POS_OLD_GAMEOVER_X);\n            this._wwaData.gameoverY = this._get1ByteNumber(WWADataExtractor.POS_OLD_GAMEOVER_Y);\n            this._wwaData.playerX = this._get1ByteNumber(WWADataExtractor.POS_OLD_PLAYER_X);\n            this._wwaData.playerY = this._get1ByteNumber(WWADataExtractor.POS_OLD_PLAYER_Y);\n            this._wwaData.mapPartsMax = this._get1ByteNumber(WWADataExtractor.POS_OLD_MAP_COUNT);\n            this._wwaData.objPartsMax = this._get1ByteNumber(WWADataExtractor.POS_OLD_OBJ_COUNT);\n            this._wwaData.isOldMap = true;\n        }\n        this._wwaData.statusEnergyMax = this._get2BytesNumber(WWADataExtractor.POS_STATUS_ENERGY_MAX);\n        this._wwaData.statusEnergy = this._get2BytesNumber(WWADataExtractor.POS_STATUS_ENERGY);\n        this._wwaData.statusStrength = this._get2BytesNumber(WWADataExtractor.POS_STATUS_STRENGTH);\n        this._wwaData.statusDefence = this._get2BytesNumber(WWADataExtractor.POS_STATUS_DEFENCE);\n        this._wwaData.statusGold = this._get2BytesNumber(WWADataExtractor.POS_STATUS_GOLD);\n        this._extractInitialItemData();\n        this._wwaData.mapWidth = this._get2BytesNumber(WWADataExtractor.POS_MAP_SIZE);\n        this._wwaData.messageNum = this._get2BytesNumber(WWADataExtractor.POS_MESSAGE_NUM);\n        if (this._wwaData.version < 28)\n            this._wwaData.mapWidth = 71;\n        else if (this._wwaData.version <= 29)\n            this._wwaData.mapWidth = 101;\n    };\n    WWADataExtractor.prototype._extractInitialItemData = function () {\n        var i;\n        var topIdx = this._wwaData.version > 29 ? WWADataExtractor.POS_ITEMBOX_TOP : WWADataExtractor.POS_OLD_ITEMBOX_TOP;\n        this._wwaData.itemBox = new Array(wwa_data_1.WWAConsts.ITEMBOX_SIZE);\n        for (i = 0; i < wwa_data_1.WWAConsts.ITEMBOX_SIZE; i++) {\n            this._wwaData.itemBox[i] = this._get1ByteNumber(topIdx + i);\n        }\n    };\n    WWADataExtractor.prototype._getFieldDataFromBits = function (partsType, partsMax) {\n        var x, y;\n        var fieldArray;\n        fieldArray = loader_util_1.util.new2DArray(this._wwaData.mapWidth, this._wwaData.mapWidth);\n        for (x = 0; x < this._wwaData.mapWidth; x++) {\n            for (y = 0; y < this._wwaData.mapWidth; y++) {\n                if (this._wwaData.version > 29) {\n                    fieldArray[x][y] = this._get2BytesNumber(this._currentPosition);\n                    this._currentPosition += 2;\n                }\n                else {\n                    fieldArray[x][y] = this._get1ByteNumber(this._currentPosition);\n                    this._currentPosition += 1;\n                }\n                if ((x * this._wwaData.mapWidth + y) % 200 === 0) {\n                    loader_core.sendProgressToMainProgram(x * this._wwaData.mapWidth + y, this._wwaData.mapWidth * this._wwaData.mapWidth, partsType === loader_wwa_data.PartsType.MAP ? loader_wwa_data.LoadStage.MAP_LOAD : loader_wwa_data.LoadStage.OBJ_LOAD);\n                }\n                if (fieldArray[x][y] >= partsMax) {\n                    fieldArray[x][y] = 0;\n                }\n            }\n        }\n        loader_core.sendProgressToMainProgram(this._wwaData.mapWidth * this._wwaData.mapWidth, this._wwaData.mapWidth * this._wwaData.mapWidth, partsType === loader_wwa_data.PartsType.MAP ? loader_wwa_data.LoadStage.MAP_LOAD : loader_wwa_data.LoadStage.OBJ_LOAD);\n        return fieldArray;\n    };\n    WWADataExtractor.prototype._getPartsDataFromBits = function (partsType, partsMax, attrMax) {\n        var i, j;\n        var partsData;\n        partsData = loader_util_1.util.new2DArray(partsMax, attrMax);\n        for (i = 0; i < partsMax; i++) {\n            for (j = 0; j < attrMax; j++) {\n                if ((i * this._wwaData.mapWidth + j) % 200 === 0) {\n                    loader_core.sendProgressToMainProgram(i * attrMax + j, partsMax * attrMax, partsType === loader_wwa_data.PartsType.MAP ? loader_wwa_data.LoadStage.MAP_ATTR : loader_wwa_data.LoadStage.OBJ_ATTR);\n                }\n                if (j === wwa_data_1.WWAConsts.ATR_CROP1 || j === wwa_data_1.WWAConsts.ATR_CROP2) {\n                    partsData[i][j] = 0;\n                    this._currentPosition += 2;\n                    continue;\n                }\n                partsData[i][j] = this._get2BytesNumber(this._currentPosition);\n                this._currentPosition += 2;\n            }\n        }\n        loader_core.sendProgressToMainProgram(partsMax * attrMax, partsMax * attrMax, partsType === loader_wwa_data.PartsType.MAP ? loader_wwa_data.LoadStage.MAP_ATTR : loader_wwa_data.LoadStage.OBJ_ATTR);\n        return partsData;\n    };\n    WWADataExtractor.prototype._replaceAllRandomObjects = function () {\n        loader_core.sendProgressToMainProgram(this._wwaData.mapWidth * this._wwaData.mapWidth, this._wwaData.mapWidth * this._wwaData.mapWidth, loader_wwa_data.LoadStage.RAND_PARTS);\n    };\n    WWADataExtractor.prototype._replaceRandomObject = function (partsID, x, y) {\n        var randomNum = Math.floor(Math.random() * 10);\n        var afterPartsID = this._wwaData.objectAttribute[partsID][10 + randomNum];\n        if (afterPartsID >= this._wwaData.objPartsMax) {\n            afterPartsID = 0;\n        }\n        this._wwaData.mapObject[x][y] = afterPartsID;\n    };\n    WWADataExtractor.POS_CHECK = 0x00;\n    WWADataExtractor.POS_VERSION = 0x02;\n    WWADataExtractor.POS_OLD_MAP_COUNT = 0x03;\n    WWADataExtractor.POS_OLD_OBJ_COUNT = 0x04;\n    WWADataExtractor.POS_OLD_PLAYER_X = 0x05;\n    WWADataExtractor.POS_OLD_PLAYER_Y = 0x06;\n    WWADataExtractor.POS_STATUS_ENERGY = 0x0a;\n    WWADataExtractor.POS_STATUS_STRENGTH = 0x0c;\n    WWADataExtractor.POS_STATUS_DEFENCE = 0x0e;\n    WWADataExtractor.POS_STATUS_GOLD = 0x10;\n    WWADataExtractor.POS_OLD_GAMEOVER_X = 0x12;\n    WWADataExtractor.POS_OLD_GAMEOVER_Y = 0x13;\n    WWADataExtractor.POS_OLD_ITEMBOX_TOP = 0x14;\n    WWADataExtractor.POS_STATUS_ENERGY_MAX = 0x20;\n    WWADataExtractor.POS_MAP_COUNT = 0x22;\n    WWADataExtractor.POS_OBJ_COUNT = 0x24;\n    WWADataExtractor.POS_PLAYER_X = 0x26;\n    WWADataExtractor.POS_PLAYER_Y = 0x28;\n    WWADataExtractor.POS_GAMEOVER_X = 0x2a;\n    WWADataExtractor.POS_GAMEOVER_Y = 0x2c;\n    WWADataExtractor.POS_MAP_SIZE = 0x2e;\n    WWADataExtractor.POS_MESSAGE_NUM = 0x30;\n    WWADataExtractor.POS_ITEMBOX_TOP = 0x3c;\n    WWADataExtractor.POS_MAPDATA_TOP = 0x5a;\n    WWADataExtractor.POS_OLD_MAPDATA_TOP = 0x64;\n    return WWADataExtractor;\n}());\nexports.WWADataExtractor = WWADataExtractor;\n\n\n//# sourceURL=webpack:///./src/loader_extractor.ts?')},"./src/loader_util.ts":function(module,exports,__webpack_require__){"use strict";eval('\nObject.defineProperty(exports, "__esModule", { value: true });\nvar util;\n(function (util) {\n    util.new2DArray = function (size1, size2) {\n        var i;\n        var arr = new Array(size1);\n        for (i = 0; i < arr.length; i++) {\n            arr[i] = new Array(size2);\n        }\n        return arr;\n    };\n    util.signedByte = function (b) {\n        b = b % 0x100;\n        return b >= 0x80 ? b - 0x100 : b;\n    };\n})(util = exports.util || (exports.util = {}));\n\n\n//# sourceURL=webpack:///./src/loader_util.ts?')},"./src/wwa_data.ts":function(module,exports,__webpack_require__){"use strict";eval('\nObject.defineProperty(exports, "__esModule", { value: true });\nvar WWAConsts = (function () {\n    function WWAConsts() {\n    }\n    WWAConsts.ITEMBOX_SIZE = 12;\n    WWAConsts.MAP_ATR_MAX = 60;\n    WWAConsts.OBJ_ATR_MAX = 60;\n    WWAConsts.OLD_MAP_ATR_MAX = 40;\n    WWAConsts.OLD_OBJ_ATR_MAX = 40;\n    WWAConsts.ATR_CROP1 = 1;\n    WWAConsts.ATR_CROP2 = 2;\n    WWAConsts.ATR_TYPE = 3;\n    WWAConsts.ATR_JUMP_X = 16;\n    WWAConsts.ATR_JUMP_Y = 17;\n    WWAConsts.MAP_LOCALGATE = 2;\n    WWAConsts.OBJECT_RANDOM = 16;\n    WWAConsts.OBJECT_LOCALGATE = 18;\n    WWAConsts.SYSTEM_MESSAGE_NUM = 20;\n    WWAConsts.IMGPOS_DEFAULT_YESNO_X = 3;\n    WWAConsts.IMGPOS_DEFAULT_YESNO_Y = 1;\n    WWAConsts.IMGRELPOS_YESNO_YES_X = 0;\n    WWAConsts.IMGRELPOS_YESNO_NO_X = 1;\n    WWAConsts.IMGRELPOS_YESNO_YESP_X = 2;\n    WWAConsts.IMGRELPOS_YESNO_NOP_X = 3;\n    WWAConsts.IMGPOS_DEFAULT_PLAYER_X = 2;\n    WWAConsts.IMGPOS_DEFAULT_PLAYER_Y = 0;\n    WWAConsts.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X = 0;\n    WWAConsts.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y = 0;\n    WWAConsts.DEFAULT_DISABLE_SAVE = false;\n    WWAConsts.DEFAULT_OLDMAP = false;\n    WWAConsts.DEFAULT_OBJECT_NO_COLLAPSE = false;\n    WWAConsts.DEFAULT_FRAME_COLOR_R = 0xff;\n    WWAConsts.DEFAULT_FRAME_COLOR_G = 0xff;\n    WWAConsts.DEFAULT_FRAME_COLOR_B = 0xff;\n    WWAConsts.DEFAULT_FRAMEOUT_COLOR_R = 0x60;\n    WWAConsts.DEFAULT_FRAMEOUT_COLOR_G = 0x60;\n    WWAConsts.DEFAULT_FRAMEOUT_COLOR_B = 0x60;\n    WWAConsts.DEFAULT_STR_COLOR_R = 0x0;\n    WWAConsts.DEFAULT_STR_COLOR_G = 0x0;\n    WWAConsts.DEFAULT_STR_COLOR_B = 0x0;\n    WWAConsts.DEFAULT_STATUS_COLOR_R = 0x0;\n    WWAConsts.DEFAULT_STATUS_COLOR_G = 0x0;\n    WWAConsts.DEFAULT_STATUS_COLOR_B = 0x0;\n    return WWAConsts;\n}());\nexports.WWAConsts = WWAConsts;\nvar LoaderResponse = (function () {\n    function LoaderResponse() {\n    }\n    return LoaderResponse;\n}());\nexports.LoaderResponse = LoaderResponse;\nvar LoaderError = (function () {\n    function LoaderError() {\n    }\n    return LoaderError;\n}());\nexports.LoaderError = LoaderError;\nvar LoaderProgress = (function () {\n    function LoaderProgress() {\n    }\n    return LoaderProgress;\n}());\nexports.LoaderProgress = LoaderProgress;\nvar PartsType;\n(function (PartsType) {\n    PartsType[PartsType["MAP"] = 1] = "MAP";\n    PartsType[PartsType["OBJECT"] = 0] = "OBJECT";\n})(PartsType = exports.PartsType || (exports.PartsType = {}));\nvar LoadStage;\n(function (LoadStage) {\n    LoadStage[LoadStage["INIT"] = 0] = "INIT";\n    LoadStage[LoadStage["MAP_LOAD"] = 1] = "MAP_LOAD";\n    LoadStage[LoadStage["OBJ_LOAD"] = 2] = "OBJ_LOAD";\n    LoadStage[LoadStage["MAP_ATTR"] = 3] = "MAP_ATTR";\n    LoadStage[LoadStage["OBJ_ATTR"] = 4] = "OBJ_ATTR";\n    LoadStage[LoadStage["RAND_PARTS"] = 5] = "RAND_PARTS";\n    LoadStage[LoadStage["MESSAGE"] = 6] = "MESSAGE";\n})(LoadStage = exports.LoadStage || (exports.LoadStage = {}));\nvar Coord = (function () {\n    function Coord(x, y) {\n        if (x === void 0) { x = 0; }\n        if (y === void 0) { y = 0; }\n        this.x = x;\n        this.y = y;\n    }\n    Coord.prototype.equals = function (coord) {\n        return this.x === coord.x && this.y === coord.y;\n    };\n    Coord.prototype.substract = function (c) {\n        return new Coord(this.x - c.x, this.y - c.y);\n    };\n    Coord.prototype.clone = function () {\n        return new Coord(this.x, this.y);\n    };\n    return Coord;\n}());\nexports.Coord = Coord;\nvar WWAData = (function () {\n    function WWAData() {\n        this.version = void 0;\n        this.gameoverX = void 0;\n        this.gameoverY = void 0;\n        this.playerX = void 0;\n        this.playerY = void 0;\n        this.mapPartsMax = void 0;\n        this.objPartsMax = void 0;\n        this.isOldMap = void 0;\n        this.statusEnergyMax = void 0;\n        this.statusEnergy = void 0;\n        this.statusStrength = void 0;\n        this.statusDefence = void 0;\n        this.statusGold = void 0;\n        this.itemBox = void 0;\n        this.mapWidth = void 0;\n        this.messageNum = void 0;\n        this.map = void 0;\n        this.mapObject = void 0;\n        this.mapAttribute = void 0;\n        this.objectAttribute = void 0;\n        this.worldPassword = void 0;\n        this.message = void 0;\n        this.worldName = void 0;\n        this.worldPassNumber = void 0;\n        this.charCGName = void 0;\n        this.mapCGName = void 0;\n        this.systemMessage = void 0;\n        this.moves = 0;\n        this.yesnoImgPosX = void 0;\n        this.yesnoImgPosY = void 0;\n        this.playerImgPosX = void 0;\n        this.playerImgPosY = void 0;\n        this.clickableItemSignImgPosX = void 0;\n        this.clickableItemSignImgPosY = void 0;\n        this.disableSaveFlag = void 0;\n        this.compatibleForOldMapFlag = void 0;\n        this.objectNoCollapseDefaultFlag = void 0;\n        this.delPlayerFlag = void 0;\n        this.bgm = void 0;\n        this.imgClickX = void 0;\n        this.imgClickY = void 0;\n        this.frameColorR = void 0;\n        this.frameColorG = void 0;\n        this.frameColorB = void 0;\n        this.frameOutColorR = void 0;\n        this.frameOutColorG = void 0;\n        this.frameOutColorB = void 0;\n        this.fontColorR = void 0;\n        this.fontColorG = void 0;\n        this.fontColorB = void 0;\n        this.statusColorR = void 0;\n        this.statusColorG = void 0;\n        this.statusColorB = void 0;\n    }\n    return WWAData;\n}());\nexports.WWAData = WWAData;\n\n\n//# sourceURL=webpack:///./src/wwa_data.ts?')}});