From 40b8d020ec853ebcac5abc5293bd44651772bc51 Mon Sep 17 00:00:00 2001 From: jeff-zucker Date: Sat, 12 Dec 2020 22:02:30 -0800 Subject: [PATCH] first refactor --- .gitignore | 2 + bundles/Dropbox-sdk.js.map | 1 - bundles/Dropbox-sdk.min.js | 1 - bundles/browserfs.min.js | 15 - bundles/browserfs.min.js.map | 1 - bundles/utils.js | 26 - how-to-test.md | 46 -- jest.config.js | 185 ------ package-lock.json | 616 ++++++++++++------ package.json | 7 +- {src => plugins/solid-rest-bfs}/browserFS.js | 0 plugins/solid-rest-file/package.json | 12 + .../solid-rest-file/src/index.js | 23 +- plugins/solid-rest-mem/package.json | 12 + .../solid-rest-mem/src/index.js | 17 +- src/actions.js | 29 + src/container.js | 40 ++ src/error.js | 30 + src/item.js | 30 + src/request.js | 44 ++ src/response.js | 83 +++ src/rest.js | 513 +++------------ src/utils.js | 130 ++++ tests/all.js | 34 +- 24 files changed, 960 insertions(+), 937 deletions(-) delete mode 100644 bundles/Dropbox-sdk.js.map delete mode 100644 bundles/Dropbox-sdk.min.js delete mode 100644 bundles/browserfs.min.js delete mode 100644 bundles/browserfs.min.js.map delete mode 100644 bundles/utils.js delete mode 100644 how-to-test.md delete mode 100644 jest.config.js rename {src => plugins/solid-rest-bfs}/browserFS.js (100%) create mode 100644 plugins/solid-rest-file/package.json rename src/file.js => plugins/solid-rest-file/src/index.js (91%) create mode 100644 plugins/solid-rest-mem/package.json rename src/localStorage.js => plugins/solid-rest-mem/src/index.js (94%) create mode 100644 src/actions.js create mode 100644 src/container.js create mode 100644 src/error.js create mode 100644 src/item.js create mode 100644 src/request.js create mode 100644 src/response.js create mode 100644 src/utils.js diff --git a/.gitignore b/.gitignore index cad124b..419f783 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ *~ #* +*# +.#* drafts node_modules dist diff --git a/bundles/Dropbox-sdk.js.map b/bundles/Dropbox-sdk.js.map deleted file mode 100644 index 8db0a55..0000000 --- a/bundles/Dropbox-sdk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Dropbox-sdk.js","sources":["../src/routes.js","../src/constants.js","../src/utils.js","../src/download-request.js","../src/upload-request.js","../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../src/rpc-request.js","../src/dropbox-base.js","../src/dropbox.js","../src/routes-team.js","../src/team/dropbox-team.js","../src/index.js"],"sourcesContent":["// Auto-generated by Stone, do not modify.\nvar routes = {};\n\n/**\n * Creates an OAuth 2.0 access token from the supplied OAuth 1.0 access token.\n * @function Dropbox#authTokenFromOauth1\n * @arg {AuthTokenFromOAuth1Arg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.authTokenFromOauth1 = function (arg) {\n return this.request('auth/token/from_oauth1', arg, 'app', 'api', 'rpc');\n};\n\n/**\n * Disables the access token used to authenticate the call.\n * @function Dropbox#authTokenRevoke\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.authTokenRevoke = function (arg) {\n return this.request('auth/token/revoke', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Removes all manually added contacts. You'll still keep contacts who are on\n * your team or who you imported. New contacts will be added when you share.\n * @function Dropbox#contactsDeleteManualContacts\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.contactsDeleteManualContacts = function (arg) {\n return this.request('contacts/delete_manual_contacts', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Removes manually added contacts from the given list.\n * @function Dropbox#contactsDeleteManualContactsBatch\n * @arg {ContactsDeleteManualContactsArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.contactsDeleteManualContactsBatch = function (arg) {\n return this.request('contacts/delete_manual_contacts_batch', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Add property groups to a Dropbox file. See templates/add_for_user or\n * templates/add_for_team to create new templates.\n * @function Dropbox#filePropertiesPropertiesAdd\n * @arg {FilePropertiesAddPropertiesArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesPropertiesAdd = function (arg) {\n return this.request('file_properties/properties/add', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Overwrite property groups associated with a file. This endpoint should be\n * used instead of properties/update when property groups are being updated via\n * a \"snapshot\" instead of via a \"delta\". In other words, this endpoint will\n * delete all omitted fields from a property group, whereas properties/update\n * will only delete fields that are explicitly marked for deletion.\n * @function Dropbox#filePropertiesPropertiesOverwrite\n * @arg {FilePropertiesOverwritePropertyGroupArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesPropertiesOverwrite = function (arg) {\n return this.request('file_properties/properties/overwrite', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Permanently removes the specified property group from the file. To remove\n * specific property field key value pairs, see properties/update. To update a\n * template, see templates/update_for_user or templates/update_for_team. To\n * remove a template, see templates/remove_for_user or\n * templates/remove_for_team.\n * @function Dropbox#filePropertiesPropertiesRemove\n * @arg {FilePropertiesRemovePropertiesArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesPropertiesRemove = function (arg) {\n return this.request('file_properties/properties/remove', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Search across property templates for particular property field values.\n * @function Dropbox#filePropertiesPropertiesSearch\n * @arg {FilePropertiesPropertiesSearchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesPropertiesSearch = function (arg) {\n return this.request('file_properties/properties/search', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from properties/search, use this to paginate\n * through all search results.\n * @function Dropbox#filePropertiesPropertiesSearchContinue\n * @arg {FilePropertiesPropertiesSearchContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesPropertiesSearchContinue = function (arg) {\n return this.request('file_properties/properties/search/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Add, update or remove properties associated with the supplied file and\n * templates. This endpoint should be used instead of properties/overwrite when\n * property groups are being updated via a \"delta\" instead of via a \"snapshot\" .\n * In other words, this endpoint will not delete any omitted fields from a\n * property group, whereas properties/overwrite will delete any fields that are\n * omitted from a property group.\n * @function Dropbox#filePropertiesPropertiesUpdate\n * @arg {FilePropertiesUpdatePropertiesArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesPropertiesUpdate = function (arg) {\n return this.request('file_properties/properties/update', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Add a template associated with a team. See properties/add to add properties\n * to a file or folder. Note: this endpoint will create team-owned templates.\n * @function Dropbox#filePropertiesTemplatesAddForTeam\n * @arg {FilePropertiesAddTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesTemplatesAddForTeam = function (arg) {\n return this.request('file_properties/templates/add_for_team', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Add a template associated with a user. See properties/add to add properties\n * to a file. This endpoint can't be called on a team member or admin's behalf.\n * @function Dropbox#filePropertiesTemplatesAddForUser\n * @arg {FilePropertiesAddTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesTemplatesAddForUser = function (arg) {\n return this.request('file_properties/templates/add_for_user', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get the schema for a specified template.\n * @function Dropbox#filePropertiesTemplatesGetForTeam\n * @arg {FilePropertiesGetTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesTemplatesGetForTeam = function (arg) {\n return this.request('file_properties/templates/get_for_team', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Get the schema for a specified template. This endpoint can't be called on a\n * team member or admin's behalf.\n * @function Dropbox#filePropertiesTemplatesGetForUser\n * @arg {FilePropertiesGetTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesTemplatesGetForUser = function (arg) {\n return this.request('file_properties/templates/get_for_user', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get the template identifiers for a team. To get the schema of each template\n * use templates/get_for_team.\n * @function Dropbox#filePropertiesTemplatesListForTeam\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesTemplatesListForTeam = function (arg) {\n return this.request('file_properties/templates/list_for_team', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Get the template identifiers for a team. To get the schema of each template\n * use templates/get_for_user. This endpoint can't be called on a team member or\n * admin's behalf.\n * @function Dropbox#filePropertiesTemplatesListForUser\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesTemplatesListForUser = function (arg) {\n return this.request('file_properties/templates/list_for_user', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Permanently removes the specified template created from\n * templates/add_for_user. All properties associated with the template will also\n * be removed. This action cannot be undone.\n * @function Dropbox#filePropertiesTemplatesRemoveForTeam\n * @arg {FilePropertiesRemoveTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesTemplatesRemoveForTeam = function (arg) {\n return this.request('file_properties/templates/remove_for_team', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Permanently removes the specified template created from\n * templates/add_for_user. All properties associated with the template will also\n * be removed. This action cannot be undone.\n * @function Dropbox#filePropertiesTemplatesRemoveForUser\n * @arg {FilePropertiesRemoveTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesTemplatesRemoveForUser = function (arg) {\n return this.request('file_properties/templates/remove_for_user', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Update a template associated with a team. This route can update the template\n * name, the template description and add optional properties to templates.\n * @function Dropbox#filePropertiesTemplatesUpdateForTeam\n * @arg {FilePropertiesUpdateTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesTemplatesUpdateForTeam = function (arg) {\n return this.request('file_properties/templates/update_for_team', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Update a template associated with a user. This route can update the template\n * name, the template description and add optional properties to templates. This\n * endpoint can't be called on a team member or admin's behalf.\n * @function Dropbox#filePropertiesTemplatesUpdateForUser\n * @arg {FilePropertiesUpdateTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filePropertiesTemplatesUpdateForUser = function (arg) {\n return this.request('file_properties/templates/update_for_user', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the total number of file requests owned by this user. Includes both\n * open and closed file requests.\n * @function Dropbox#fileRequestsCount\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.fileRequestsCount = function (arg) {\n return this.request('file_requests/count', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Creates a file request for this user.\n * @function Dropbox#fileRequestsCreate\n * @arg {FileRequestsCreateFileRequestArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.fileRequestsCreate = function (arg) {\n return this.request('file_requests/create', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Delete a batch of closed file requests.\n * @function Dropbox#fileRequestsDelete\n * @arg {FileRequestsDeleteFileRequestArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.fileRequestsDelete = function (arg) {\n return this.request('file_requests/delete', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Delete all closed file requests owned by this user.\n * @function Dropbox#fileRequestsDeleteAllClosed\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.fileRequestsDeleteAllClosed = function (arg) {\n return this.request('file_requests/delete_all_closed', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the specified file request.\n * @function Dropbox#fileRequestsGet\n * @arg {FileRequestsGetFileRequestArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.fileRequestsGet = function (arg) {\n return this.request('file_requests/get', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns a list of file requests owned by this user. For apps with the app\n * folder permission, this will only return file requests with destinations in\n * the app folder.\n * @function Dropbox#fileRequestsListV2\n * @arg {FileRequestsListFileRequestsArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.fileRequestsListV2 = function (arg) {\n return this.request('file_requests/list_v2', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns a list of file requests owned by this user. For apps with the app\n * folder permission, this will only return file requests with destinations in\n * the app folder.\n * @function Dropbox#fileRequestsList\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.fileRequestsList = function (arg) {\n return this.request('file_requests/list', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from list_v2, use this to paginate through\n * all file requests. The cursor must come from a previous call to list_v2 or\n * list/continue.\n * @function Dropbox#fileRequestsListContinue\n * @arg {FileRequestsListFileRequestsContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.fileRequestsListContinue = function (arg) {\n return this.request('file_requests/list/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Update a file request.\n * @function Dropbox#fileRequestsUpdate\n * @arg {FileRequestsUpdateFileRequestArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.fileRequestsUpdate = function (arg) {\n return this.request('file_requests/update', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the metadata for a file or folder. This is an alpha endpoint\n * compatible with the properties API. Note: Metadata for the root folder is\n * unsupported.\n * @function Dropbox#filesAlphaGetMetadata\n * @deprecated\n * @arg {FilesAlphaGetMetadataArg} arg - The request parameters.\n * @returns {Promise.<(FilesFileMetadata|FilesFolderMetadata|FilesDeletedMetadata), Error.>}\n */\nroutes.filesAlphaGetMetadata = function (arg) {\n return this.request('files/alpha/get_metadata', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Create a new file with the contents provided in the request. Note that this\n * endpoint is part of the properties API alpha and is slightly different from\n * upload. Do not use this to upload a file larger than 150 MB. Instead, create\n * an upload session with upload_session/start.\n * @function Dropbox#filesAlphaUpload\n * @deprecated\n * @arg {FilesCommitInfoWithProperties} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesAlphaUpload = function (arg) {\n return this.request('files/alpha/upload', arg, 'user', 'content', 'upload');\n};\n\n/**\n * Copy a file or folder to a different location in the user's Dropbox. If the\n * source path is a folder all its contents will be copied.\n * @function Dropbox#filesCopyV2\n * @arg {FilesRelocationArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCopyV2 = function (arg) {\n return this.request('files/copy_v2', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Copy a file or folder to a different location in the user's Dropbox. If the\n * source path is a folder all its contents will be copied.\n * @function Dropbox#filesCopy\n * @deprecated\n * @arg {FilesRelocationArg} arg - The request parameters.\n * @returns {Promise.<(FilesFileMetadata|FilesFolderMetadata|FilesDeletedMetadata), Error.>}\n */\nroutes.filesCopy = function (arg) {\n return this.request('files/copy', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Copy multiple files or folders to different locations at once in the user's\n * Dropbox. This route will replace copy_batch. The main difference is this\n * route will return status for each entry, while copy_batch raises failure if\n * any entry fails. This route will either finish synchronously, or return a job\n * ID and do the async copy job in background. Please use copy_batch/check_v2 to\n * check the job status.\n * @function Dropbox#filesCopyBatchV2\n * @arg {Object} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCopyBatchV2 = function (arg) {\n return this.request('files/copy_batch_v2', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Copy multiple files or folders to different locations at once in the user's\n * Dropbox. If RelocationBatchArg.allow_shared_folder is false, this route is\n * atomic. If one entry fails, the whole transaction will abort. If\n * RelocationBatchArg.allow_shared_folder is true, atomicity is not guaranteed,\n * but it allows you to copy the contents of shared folders to new locations.\n * This route will return job ID immediately and do the async copy job in\n * background. Please use copy_batch/check to check the job status.\n * @function Dropbox#filesCopyBatch\n * @deprecated\n * @arg {FilesRelocationBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCopyBatch = function (arg) {\n return this.request('files/copy_batch', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job for copy_batch_v2. It returns list\n * of results for each entry.\n * @function Dropbox#filesCopyBatchCheckV2\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCopyBatchCheckV2 = function (arg) {\n return this.request('files/copy_batch/check_v2', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job for copy_batch. If success, it\n * returns list of results for each entry.\n * @function Dropbox#filesCopyBatchCheck\n * @deprecated\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCopyBatchCheck = function (arg) {\n return this.request('files/copy_batch/check', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get a copy reference to a file or folder. This reference string can be used\n * to save that file or folder to another user's Dropbox by passing it to\n * copy_reference/save.\n * @function Dropbox#filesCopyReferenceGet\n * @arg {FilesGetCopyReferenceArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCopyReferenceGet = function (arg) {\n return this.request('files/copy_reference/get', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Save a copy reference returned by copy_reference/get to the user's Dropbox.\n * @function Dropbox#filesCopyReferenceSave\n * @arg {FilesSaveCopyReferenceArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCopyReferenceSave = function (arg) {\n return this.request('files/copy_reference/save', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Create a folder at a given path.\n * @function Dropbox#filesCreateFolderV2\n * @arg {FilesCreateFolderArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCreateFolderV2 = function (arg) {\n return this.request('files/create_folder_v2', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Create a folder at a given path.\n * @function Dropbox#filesCreateFolder\n * @deprecated\n * @arg {FilesCreateFolderArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCreateFolder = function (arg) {\n return this.request('files/create_folder', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Create multiple folders at once. This route is asynchronous for large\n * batches, which returns a job ID immediately and runs the create folder batch\n * asynchronously. Otherwise, creates the folders and returns the result\n * synchronously for smaller inputs. You can force asynchronous behaviour by\n * using the CreateFolderBatchArg.force_async flag. Use\n * create_folder_batch/check to check the job status.\n * @function Dropbox#filesCreateFolderBatch\n * @arg {FilesCreateFolderBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCreateFolderBatch = function (arg) {\n return this.request('files/create_folder_batch', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job for create_folder_batch. If\n * success, it returns list of result for each entry.\n * @function Dropbox#filesCreateFolderBatchCheck\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesCreateFolderBatchCheck = function (arg) {\n return this.request('files/create_folder_batch/check', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Delete the file or folder at a given path. If the path is a folder, all its\n * contents will be deleted too. A successful response indicates that the file\n * or folder was deleted. The returned metadata will be the corresponding\n * FileMetadata or FolderMetadata for the item at time of deletion, and not a\n * DeletedMetadata object.\n * @function Dropbox#filesDeleteV2\n * @arg {FilesDeleteArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesDeleteV2 = function (arg) {\n return this.request('files/delete_v2', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Delete the file or folder at a given path. If the path is a folder, all its\n * contents will be deleted too. A successful response indicates that the file\n * or folder was deleted. The returned metadata will be the corresponding\n * FileMetadata or FolderMetadata for the item at time of deletion, and not a\n * DeletedMetadata object.\n * @function Dropbox#filesDelete\n * @deprecated\n * @arg {FilesDeleteArg} arg - The request parameters.\n * @returns {Promise.<(FilesFileMetadata|FilesFolderMetadata|FilesDeletedMetadata), Error.>}\n */\nroutes.filesDelete = function (arg) {\n return this.request('files/delete', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Delete multiple files/folders at once. This route is asynchronous, which\n * returns a job ID immediately and runs the delete batch asynchronously. Use\n * delete_batch/check to check the job status.\n * @function Dropbox#filesDeleteBatch\n * @arg {FilesDeleteBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesDeleteBatch = function (arg) {\n return this.request('files/delete_batch', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job for delete_batch. If success, it\n * returns list of result for each entry.\n * @function Dropbox#filesDeleteBatchCheck\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesDeleteBatchCheck = function (arg) {\n return this.request('files/delete_batch/check', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Download a file from a user's Dropbox.\n * @function Dropbox#filesDownload\n * @arg {FilesDownloadArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesDownload = function (arg) {\n return this.request('files/download', arg, 'user', 'content', 'download');\n};\n\n/**\n * Download a folder from the user's Dropbox, as a zip file. The folder must be\n * less than 20 GB in size and have fewer than 10,000 total files. The input\n * cannot be a single file. Any single file must be less than 4GB in size.\n * @function Dropbox#filesDownloadZip\n * @arg {FilesDownloadZipArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesDownloadZip = function (arg) {\n return this.request('files/download_zip', arg, 'user', 'content', 'download');\n};\n\n/**\n * Export a file from a user's Dropbox. This route only supports exporting files\n * that cannot be downloaded directly and whose ExportResult.file_metadata has\n * ExportInfo.export_as populated.\n * @function Dropbox#filesExport\n * @arg {FilesExportArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesExport = function (arg) {\n return this.request('files/export', arg, 'user', 'content', 'download');\n};\n\n/**\n * Returns the metadata for a file or folder. Note: Metadata for the root folder\n * is unsupported.\n * @function Dropbox#filesGetMetadata\n * @arg {FilesGetMetadataArg} arg - The request parameters.\n * @returns {Promise.<(FilesFileMetadata|FilesFolderMetadata|FilesDeletedMetadata), Error.>}\n */\nroutes.filesGetMetadata = function (arg) {\n return this.request('files/get_metadata', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get a preview for a file. Currently, PDF previews are generated for files\n * with the following extensions: .ai, .doc, .docm, .docx, .eps, .gdoc,\n * .gslides, .odp, .odt, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML\n * previews are generated for files with the following extensions: .csv, .ods,\n * .xls, .xlsm, .gsheet, .xlsx. Other formats will return an unsupported\n * extension error.\n * @function Dropbox#filesGetPreview\n * @arg {FilesPreviewArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesGetPreview = function (arg) {\n return this.request('files/get_preview', arg, 'user', 'content', 'download');\n};\n\n/**\n * Get a temporary link to stream content of a file. This link will expire in\n * four hours and afterwards you will get 410 Gone. This URL should not be used\n * to display content directly in the browser. The Content-Type of the link is\n * determined automatically by the file's mime type.\n * @function Dropbox#filesGetTemporaryLink\n * @arg {FilesGetTemporaryLinkArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesGetTemporaryLink = function (arg) {\n return this.request('files/get_temporary_link', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get a one-time use temporary upload link to upload a file to a Dropbox\n * location. This endpoint acts as a delayed upload. The returned temporary\n * upload link may be used to make a POST request with the data to be uploaded.\n * The upload will then be perfomed with the CommitInfo previously provided to\n * get_temporary_upload_link but evaluated only upon consumption. Hence, errors\n * stemming from invalid CommitInfo with respect to the state of the user's\n * Dropbox will only be communicated at consumption time. Additionally, these\n * errors are surfaced as generic HTTP 409 Conflict responses, potentially\n * hiding issue details. The maximum temporary upload link duration is 4 hours.\n * Upon consumption or expiration, a new link will have to be generated.\n * Multiple links may exist for a specific upload path at any given time. The\n * POST request on the temporary upload link must have its Content-Type set to\n * \"application/octet-stream\". Example temporary upload link consumption\n * request: curl -X POST\n * https://dl.dropboxusercontent.com/apitul/1/bNi2uIYF51cVBND --header\n * \"Content-Type: application/octet-stream\" --data-binary @local_file.txt A\n * successful temporary upload link consumption request returns the content hash\n * of the uploaded data in JSON format. Example succesful temporary upload link\n * consumption response: {\"content-hash\":\n * \"599d71033d700ac892a0e48fa61b125d2f5994\"} An unsuccessful temporary upload\n * link consumption request returns any of the following status codes: HTTP 400\n * Bad Request: Content-Type is not one of application/octet-stream and\n * text/plain or request is invalid. HTTP 409 Conflict: The temporary upload\n * link does not exist or is currently unavailable, the upload failed, or\n * another error happened. HTTP 410 Gone: The temporary upload link is expired\n * or consumed. Example unsuccessful temporary upload link consumption\n * response: Temporary upload link has been recently consumed.\n * @function Dropbox#filesGetTemporaryUploadLink\n * @arg {FilesGetTemporaryUploadLinkArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesGetTemporaryUploadLink = function (arg) {\n return this.request('files/get_temporary_upload_link', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get a thumbnail for an image. This method currently supports files with the\n * following file extensions: jpg, jpeg, png, tiff, tif, gif and bmp. Photos\n * that are larger than 20MB in size won't be converted to a thumbnail.\n * @function Dropbox#filesGetThumbnail\n * @arg {FilesThumbnailArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesGetThumbnail = function (arg) {\n return this.request('files/get_thumbnail', arg, 'user', 'content', 'download');\n};\n\n/**\n * Get thumbnails for a list of images. We allow up to 25 thumbnails in a single\n * batch. This method currently supports files with the following file\n * extensions: jpg, jpeg, png, tiff, tif, gif and bmp. Photos that are larger\n * than 20MB in size won't be converted to a thumbnail.\n * @function Dropbox#filesGetThumbnailBatch\n * @arg {FilesGetThumbnailBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesGetThumbnailBatch = function (arg) {\n return this.request('files/get_thumbnail_batch', arg, 'user', 'content', 'rpc');\n};\n\n/**\n * Starts returning the contents of a folder. If the result's\n * ListFolderResult.has_more field is true, call list_folder/continue with the\n * returned ListFolderResult.cursor to retrieve more entries. If you're using\n * ListFolderArg.recursive set to true to keep a local cache of the contents of\n * a Dropbox account, iterate through each entry in order and process them as\n * follows to keep your local state in sync: For each FileMetadata, store the\n * new entry at the given path in your local state. If the required parent\n * folders don't exist yet, create them. If there's already something else at\n * the given path, replace it and remove all its children. For each\n * FolderMetadata, store the new entry at the given path in your local state. If\n * the required parent folders don't exist yet, create them. If there's already\n * something else at the given path, replace it but leave the children as they\n * are. Check the new entry's FolderSharingInfo.read_only and set all its\n * children's read-only statuses to match. For each DeletedMetadata, if your\n * local state has something at the given path, remove it and all its children.\n * If there's nothing at the given path, ignore this entry. Note:\n * auth.RateLimitError may be returned if multiple list_folder or\n * list_folder/continue calls with same parameters are made simultaneously by\n * same API app for same user. If your app implements retry logic, please hold\n * off the retry until the previous request finishes.\n * @function Dropbox#filesListFolder\n * @arg {FilesListFolderArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesListFolder = function (arg) {\n return this.request('files/list_folder', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from list_folder, use this to paginate\n * through all files and retrieve updates to the folder, following the same\n * rules as documented for list_folder.\n * @function Dropbox#filesListFolderContinue\n * @arg {FilesListFolderContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesListFolderContinue = function (arg) {\n return this.request('files/list_folder/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * A way to quickly get a cursor for the folder's state. Unlike list_folder,\n * list_folder/get_latest_cursor doesn't return any entries. This endpoint is\n * for app which only needs to know about new files and modifications and\n * doesn't need to know about files that already exist in Dropbox.\n * @function Dropbox#filesListFolderGetLatestCursor\n * @arg {FilesListFolderArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesListFolderGetLatestCursor = function (arg) {\n return this.request('files/list_folder/get_latest_cursor', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * A longpoll endpoint to wait for changes on an account. In conjunction with\n * list_folder/continue, this call gives you a low-latency way to monitor an\n * account for file changes. The connection will block until there are changes\n * available or a timeout occurs. This endpoint is useful mostly for client-side\n * apps. If you're looking for server-side notifications, check out our webhooks\n * documentation https://www.dropbox.com/developers/reference/webhooks.\n * @function Dropbox#filesListFolderLongpoll\n * @arg {FilesListFolderLongpollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesListFolderLongpoll = function (arg) {\n return this.request('files/list_folder/longpoll', arg, 'noauth', 'notify', 'rpc');\n};\n\n/**\n * Returns revisions for files based on a file path or a file id. The file path\n * or file id is identified from the latest file entry at the given file path or\n * id. This end point allows your app to query either by file path or file id by\n * setting the mode parameter appropriately. In the ListRevisionsMode.path\n * (default) mode, all revisions at the same file path as the latest file entry\n * are returned. If revisions with the same file id are desired, then mode must\n * be set to ListRevisionsMode.id. The ListRevisionsMode.id mode is useful to\n * retrieve revisions for a given file across moves or renames.\n * @function Dropbox#filesListRevisions\n * @arg {FilesListRevisionsArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesListRevisions = function (arg) {\n return this.request('files/list_revisions', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Move a file or folder to a different location in the user's Dropbox. If the\n * source path is a folder all its contents will be moved.\n * @function Dropbox#filesMoveV2\n * @arg {FilesRelocationArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesMoveV2 = function (arg) {\n return this.request('files/move_v2', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Move a file or folder to a different location in the user's Dropbox. If the\n * source path is a folder all its contents will be moved.\n * @function Dropbox#filesMove\n * @deprecated\n * @arg {FilesRelocationArg} arg - The request parameters.\n * @returns {Promise.<(FilesFileMetadata|FilesFolderMetadata|FilesDeletedMetadata), Error.>}\n */\nroutes.filesMove = function (arg) {\n return this.request('files/move', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Move multiple files or folders to different locations at once in the user's\n * Dropbox. This route will replace move_batch. The main difference is this\n * route will return status for each entry, while move_batch raises failure if\n * any entry fails. This route will either finish synchronously, or return a job\n * ID and do the async move job in background. Please use move_batch/check_v2 to\n * check the job status.\n * @function Dropbox#filesMoveBatchV2\n * @arg {FilesMoveBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesMoveBatchV2 = function (arg) {\n return this.request('files/move_batch_v2', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Move multiple files or folders to different locations at once in the user's\n * Dropbox. This route is 'all or nothing', which means if one entry fails, the\n * whole transaction will abort. This route will return job ID immediately and\n * do the async moving job in background. Please use move_batch/check to check\n * the job status.\n * @function Dropbox#filesMoveBatch\n * @arg {FilesRelocationBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesMoveBatch = function (arg) {\n return this.request('files/move_batch', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job for move_batch_v2. It returns list\n * of results for each entry.\n * @function Dropbox#filesMoveBatchCheckV2\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesMoveBatchCheckV2 = function (arg) {\n return this.request('files/move_batch/check_v2', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job for move_batch. If success, it\n * returns list of results for each entry.\n * @function Dropbox#filesMoveBatchCheck\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesMoveBatchCheck = function (arg) {\n return this.request('files/move_batch/check', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Permanently delete the file or folder at a given path (see\n * https://www.dropbox.com/en/help/40). Note: This endpoint is only available\n * for Dropbox Business apps.\n * @function Dropbox#filesPermanentlyDelete\n * @arg {FilesDeleteArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesPermanentlyDelete = function (arg) {\n return this.request('files/permanently_delete', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * @function Dropbox#filesPropertiesAdd\n * @deprecated\n * @arg {FilePropertiesAddPropertiesArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesPropertiesAdd = function (arg) {\n return this.request('files/properties/add', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * @function Dropbox#filesPropertiesOverwrite\n * @deprecated\n * @arg {FilePropertiesOverwritePropertyGroupArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesPropertiesOverwrite = function (arg) {\n return this.request('files/properties/overwrite', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * @function Dropbox#filesPropertiesRemove\n * @deprecated\n * @arg {FilePropertiesRemovePropertiesArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesPropertiesRemove = function (arg) {\n return this.request('files/properties/remove', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * @function Dropbox#filesPropertiesTemplateGet\n * @deprecated\n * @arg {FilePropertiesGetTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesPropertiesTemplateGet = function (arg) {\n return this.request('files/properties/template/get', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * @function Dropbox#filesPropertiesTemplateList\n * @deprecated\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesPropertiesTemplateList = function (arg) {\n return this.request('files/properties/template/list', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * @function Dropbox#filesPropertiesUpdate\n * @deprecated\n * @arg {FilePropertiesUpdatePropertiesArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesPropertiesUpdate = function (arg) {\n return this.request('files/properties/update', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Restore a specific revision of a file to the given path.\n * @function Dropbox#filesRestore\n * @arg {FilesRestoreArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesRestore = function (arg) {\n return this.request('files/restore', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Save the data from a specified URL into a file in user's Dropbox. Note that\n * the transfer from the URL must complete within 5 minutes, or the operation\n * will time out and the job will fail. If the given path already exists, the\n * file will be renamed to avoid the conflict (e.g. myfile (1).txt).\n * @function Dropbox#filesSaveUrl\n * @arg {FilesSaveUrlArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesSaveUrl = function (arg) {\n return this.request('files/save_url', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Check the status of a save_url job.\n * @function Dropbox#filesSaveUrlCheckJobStatus\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesSaveUrlCheckJobStatus = function (arg) {\n return this.request('files/save_url/check_job_status', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Searches for files and folders. Note: Recent changes may not immediately be\n * reflected in search results due to a short delay in indexing.\n * @function Dropbox#filesSearch\n * @arg {FilesSearchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesSearch = function (arg) {\n return this.request('files/search', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Create a new file with the contents provided in the request. Do not use this\n * to upload a file larger than 150 MB. Instead, create an upload session with\n * upload_session/start. Calls to this endpoint will count as data transport\n * calls for any Dropbox Business teams with a limit on the number of data\n * transport calls allowed per month. For more information, see the Data\n * transport limit page\n * https://www.dropbox.com/developers/reference/data-transport-limit.\n * @function Dropbox#filesUpload\n * @arg {FilesCommitInfo} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesUpload = function (arg) {\n return this.request('files/upload', arg, 'user', 'content', 'upload');\n};\n\n/**\n * Append more data to an upload session. When the parameter close is set, this\n * call will close the session. A single request should not upload more than 150\n * MB. The maximum size of a file one can upload to an upload session is 350 GB.\n * Calls to this endpoint will count as data transport calls for any Dropbox\n * Business teams with a limit on the number of data transport calls allowed per\n * month. For more information, see the Data transport limit page\n * https://www.dropbox.com/developers/reference/data-transport-limit.\n * @function Dropbox#filesUploadSessionAppendV2\n * @arg {FilesUploadSessionAppendArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesUploadSessionAppendV2 = function (arg) {\n return this.request('files/upload_session/append_v2', arg, 'user', 'content', 'upload');\n};\n\n/**\n * Append more data to an upload session. A single request should not upload\n * more than 150 MB. The maximum size of a file one can upload to an upload\n * session is 350 GB. Calls to this endpoint will count as data transport calls\n * for any Dropbox Business teams with a limit on the number of data transport\n * calls allowed per month. For more information, see the Data transport limit\n * page https://www.dropbox.com/developers/reference/data-transport-limit.\n * @function Dropbox#filesUploadSessionAppend\n * @deprecated\n * @arg {FilesUploadSessionCursor} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesUploadSessionAppend = function (arg) {\n return this.request('files/upload_session/append', arg, 'user', 'content', 'upload');\n};\n\n/**\n * Finish an upload session and save the uploaded data to the given file path. A\n * single request should not upload more than 150 MB. The maximum size of a file\n * one can upload to an upload session is 350 GB. Calls to this endpoint will\n * count as data transport calls for any Dropbox Business teams with a limit on\n * the number of data transport calls allowed per month. For more information,\n * see the Data transport limit page\n * https://www.dropbox.com/developers/reference/data-transport-limit.\n * @function Dropbox#filesUploadSessionFinish\n * @arg {FilesUploadSessionFinishArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesUploadSessionFinish = function (arg) {\n return this.request('files/upload_session/finish', arg, 'user', 'content', 'upload');\n};\n\n/**\n * This route helps you commit many files at once into a user's Dropbox. Use\n * upload_session/start and upload_session/append_v2 to upload file contents. We\n * recommend uploading many files in parallel to increase throughput. Once the\n * file contents have been uploaded, rather than calling upload_session/finish,\n * use this route to finish all your upload sessions in a single request.\n * UploadSessionStartArg.close or UploadSessionAppendArg.close needs to be true\n * for the last upload_session/start or upload_session/append_v2 call. The\n * maximum size of a file one can upload to an upload session is 350 GB. This\n * route will return a job_id immediately and do the async commit job in\n * background. Use upload_session/finish_batch/check to check the job status.\n * For the same account, this route should be executed serially. That means you\n * should not start the next job before current job finishes. We allow up to\n * 1000 entries in a single request. Calls to this endpoint will count as data\n * transport calls for any Dropbox Business teams with a limit on the number of\n * data transport calls allowed per month. For more information, see the Data\n * transport limit page\n * https://www.dropbox.com/developers/reference/data-transport-limit.\n * @function Dropbox#filesUploadSessionFinishBatch\n * @arg {FilesUploadSessionFinishBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesUploadSessionFinishBatch = function (arg) {\n return this.request('files/upload_session/finish_batch', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job for upload_session/finish_batch. If\n * success, it returns list of result for each entry.\n * @function Dropbox#filesUploadSessionFinishBatchCheck\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesUploadSessionFinishBatchCheck = function (arg) {\n return this.request('files/upload_session/finish_batch/check', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Upload sessions allow you to upload a single file in one or more requests,\n * for example where the size of the file is greater than 150 MB. This call\n * starts a new upload session with the given data. You can then use\n * upload_session/append_v2 to add more data and upload_session/finish to save\n * all the data to a file in Dropbox. A single request should not upload more\n * than 150 MB. The maximum size of a file one can upload to an upload session\n * is 350 GB. An upload session can be used for a maximum of 48 hours.\n * Attempting to use an UploadSessionStartResult.session_id with\n * upload_session/append_v2 or upload_session/finish more than 48 hours after\n * its creation will return a UploadSessionLookupError.not_found. Calls to this\n * endpoint will count as data transport calls for any Dropbox Business teams\n * with a limit on the number of data transport calls allowed per month. For\n * more information, see the Data transport limit page\n * https://www.dropbox.com/developers/reference/data-transport-limit.\n * @function Dropbox#filesUploadSessionStart\n * @arg {FilesUploadSessionStartArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.filesUploadSessionStart = function (arg) {\n return this.request('files/upload_session/start', arg, 'user', 'content', 'upload');\n};\n\n/**\n * Marks the given Paper doc as archived. Note: This action can be performed or\n * undone by anyone with edit permissions to the doc.\n * @function Dropbox#paperDocsArchive\n * @arg {PaperRefPaperDoc} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsArchive = function (arg) {\n return this.request('paper/docs/archive', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Creates a new Paper doc with the provided content.\n * @function Dropbox#paperDocsCreate\n * @arg {PaperPaperDocCreateArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsCreate = function (arg) {\n return this.request('paper/docs/create', arg, 'user', 'api', 'upload');\n};\n\n/**\n * Exports and downloads Paper doc either as HTML or markdown.\n * @function Dropbox#paperDocsDownload\n * @arg {PaperPaperDocExport} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsDownload = function (arg) {\n return this.request('paper/docs/download', arg, 'user', 'api', 'download');\n};\n\n/**\n * Lists the users who are explicitly invited to the Paper folder in which the\n * Paper doc is contained. For private folders all users (including owner)\n * shared on the folder are listed and for team folders all non-team users\n * shared on the folder are returned.\n * @function Dropbox#paperDocsFolderUsersList\n * @arg {PaperListUsersOnFolderArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsFolderUsersList = function (arg) {\n return this.request('paper/docs/folder_users/list', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from docs/folder_users/list, use this to\n * paginate through all users on the Paper folder.\n * @function Dropbox#paperDocsFolderUsersListContinue\n * @arg {PaperListUsersOnFolderContinueArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsFolderUsersListContinue = function (arg) {\n return this.request('paper/docs/folder_users/list/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Retrieves folder information for the given Paper doc. This includes: -\n * folder sharing policy; permissions for subfolders are set by the top-level\n * folder. - full 'filepath', i.e. the list of folders (both folderId and\n * folderName) from the root folder to the folder directly containing the\n * Paper doc. Note: If the Paper doc is not in any folder (aka unfiled) the\n * response will be empty.\n * @function Dropbox#paperDocsGetFolderInfo\n * @arg {PaperRefPaperDoc} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsGetFolderInfo = function (arg) {\n return this.request('paper/docs/get_folder_info', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Return the list of all Paper docs according to the argument specifications.\n * To iterate over through the full pagination, pass the cursor to\n * docs/list/continue.\n * @function Dropbox#paperDocsList\n * @arg {PaperListPaperDocsArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsList = function (arg) {\n return this.request('paper/docs/list', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from docs/list, use this to paginate through\n * all Paper doc.\n * @function Dropbox#paperDocsListContinue\n * @arg {PaperListPaperDocsContinueArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsListContinue = function (arg) {\n return this.request('paper/docs/list/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Permanently deletes the given Paper doc. This operation is final as the doc\n * cannot be recovered. Note: This action can be performed only by the doc\n * owner.\n * @function Dropbox#paperDocsPermanentlyDelete\n * @arg {PaperRefPaperDoc} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsPermanentlyDelete = function (arg) {\n return this.request('paper/docs/permanently_delete', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Gets the default sharing policy for the given Paper doc.\n * @function Dropbox#paperDocsSharingPolicyGet\n * @arg {PaperRefPaperDoc} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsSharingPolicyGet = function (arg) {\n return this.request('paper/docs/sharing_policy/get', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Sets the default sharing policy for the given Paper doc. The default\n * 'team_sharing_policy' can be changed only by teams, omit this field for\n * personal accounts. Note: 'public_sharing_policy' cannot be set to the value\n * 'disabled' because this setting can be changed only via the team admin\n * console.\n * @function Dropbox#paperDocsSharingPolicySet\n * @arg {PaperPaperDocSharingPolicy} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsSharingPolicySet = function (arg) {\n return this.request('paper/docs/sharing_policy/set', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Updates an existing Paper doc with the provided content.\n * @function Dropbox#paperDocsUpdate\n * @arg {PaperPaperDocUpdateArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsUpdate = function (arg) {\n return this.request('paper/docs/update', arg, 'user', 'api', 'upload');\n};\n\n/**\n * Allows an owner or editor to add users to a Paper doc or change their\n * permissions using their email address or Dropbox account ID. Note: The Doc\n * owner's permissions cannot be changed.\n * @function Dropbox#paperDocsUsersAdd\n * @arg {PaperAddPaperDocUser} arg - The request parameters.\n * @returns {Promise., Error.>}\n */\nroutes.paperDocsUsersAdd = function (arg) {\n return this.request('paper/docs/users/add', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Lists all users who visited the Paper doc or users with explicit access. This\n * call excludes users who have been removed. The list is sorted by the date of\n * the visit or the share date. The list will include both users, the explicitly\n * shared ones as well as those who came in using the Paper url link.\n * @function Dropbox#paperDocsUsersList\n * @arg {PaperListUsersOnPaperDocArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsUsersList = function (arg) {\n return this.request('paper/docs/users/list', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from docs/users/list, use this to paginate\n * through all users on the Paper doc.\n * @function Dropbox#paperDocsUsersListContinue\n * @arg {PaperListUsersOnPaperDocContinueArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsUsersListContinue = function (arg) {\n return this.request('paper/docs/users/list/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Allows an owner or editor to remove users from a Paper doc using their email\n * address or Dropbox account ID. Note: Doc owner cannot be removed.\n * @function Dropbox#paperDocsUsersRemove\n * @arg {PaperRemovePaperDocUser} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.paperDocsUsersRemove = function (arg) {\n return this.request('paper/docs/users/remove', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Adds specified members to a file.\n * @function Dropbox#sharingAddFileMember\n * @arg {SharingAddFileMemberArgs} arg - The request parameters.\n * @returns {Promise., Error.>}\n */\nroutes.sharingAddFileMember = function (arg) {\n return this.request('sharing/add_file_member', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Allows an owner or editor (if the ACL update policy allows) of a shared\n * folder to add another member. For the new member to get access to all the\n * functionality for this folder, you will need to call mount_folder on their\n * behalf.\n * @function Dropbox#sharingAddFolderMember\n * @arg {SharingAddFolderMemberArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingAddFolderMember = function (arg) {\n return this.request('sharing/add_folder_member', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Identical to update_file_member but with less information returned.\n * @function Dropbox#sharingChangeFileMemberAccess\n * @deprecated\n * @arg {SharingChangeFileMemberAccessArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingChangeFileMemberAccess = function (arg) {\n return this.request('sharing/change_file_member_access', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job.\n * @function Dropbox#sharingCheckJobStatus\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingCheckJobStatus = function (arg) {\n return this.request('sharing/check_job_status', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job for sharing a folder.\n * @function Dropbox#sharingCheckRemoveMemberJobStatus\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingCheckRemoveMemberJobStatus = function (arg) {\n return this.request('sharing/check_remove_member_job_status', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job for sharing a folder.\n * @function Dropbox#sharingCheckShareJobStatus\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingCheckShareJobStatus = function (arg) {\n return this.request('sharing/check_share_job_status', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Create a shared link. If a shared link already exists for the given path,\n * that link is returned. Note that in the returned PathLinkMetadata, the\n * PathLinkMetadata.url field is the shortened URL if\n * CreateSharedLinkArg.short_url argument is set to true. Previously, it was\n * technically possible to break a shared link by moving or renaming the\n * corresponding file or folder. In the future, this will no longer be the case,\n * so your app shouldn't rely on this behavior. Instead, if your app needs to\n * revoke a shared link, use revoke_shared_link.\n * @function Dropbox#sharingCreateSharedLink\n * @deprecated\n * @arg {SharingCreateSharedLinkArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingCreateSharedLink = function (arg) {\n return this.request('sharing/create_shared_link', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Create a shared link with custom settings. If no settings are given then the\n * default visibility is RequestedVisibility.public (The resolved visibility,\n * though, may depend on other aspects such as team and shared folder settings).\n * @function Dropbox#sharingCreateSharedLinkWithSettings\n * @arg {SharingCreateSharedLinkWithSettingsArg} arg - The request parameters.\n * @returns {Promise.<(SharingFileLinkMetadata|SharingFolderLinkMetadata|SharingSharedLinkMetadata), Error.>}\n */\nroutes.sharingCreateSharedLinkWithSettings = function (arg) {\n return this.request('sharing/create_shared_link_with_settings', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns shared file metadata.\n * @function Dropbox#sharingGetFileMetadata\n * @arg {SharingGetFileMetadataArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingGetFileMetadata = function (arg) {\n return this.request('sharing/get_file_metadata', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns shared file metadata.\n * @function Dropbox#sharingGetFileMetadataBatch\n * @arg {SharingGetFileMetadataBatchArg} arg - The request parameters.\n * @returns {Promise., Error.>}\n */\nroutes.sharingGetFileMetadataBatch = function (arg) {\n return this.request('sharing/get_file_metadata/batch', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns shared folder metadata by its folder ID.\n * @function Dropbox#sharingGetFolderMetadata\n * @arg {SharingGetMetadataArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingGetFolderMetadata = function (arg) {\n return this.request('sharing/get_folder_metadata', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Download the shared link's file from a user's Dropbox.\n * @function Dropbox#sharingGetSharedLinkFile\n * @arg {Object} arg - The request parameters.\n * @returns {Promise.<(SharingFileLinkMetadata|SharingFolderLinkMetadata|SharingSharedLinkMetadata), Error.>}\n */\nroutes.sharingGetSharedLinkFile = function (arg) {\n return this.request('sharing/get_shared_link_file', arg, 'user', 'content', 'download');\n};\n\n/**\n * Get the shared link's metadata.\n * @function Dropbox#sharingGetSharedLinkMetadata\n * @arg {SharingGetSharedLinkMetadataArg} arg - The request parameters.\n * @returns {Promise.<(SharingFileLinkMetadata|SharingFolderLinkMetadata|SharingSharedLinkMetadata), Error.>}\n */\nroutes.sharingGetSharedLinkMetadata = function (arg) {\n return this.request('sharing/get_shared_link_metadata', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns a list of LinkMetadata objects for this user, including collection\n * links. If no path is given, returns a list of all shared links for the\n * current user, including collection links, up to a maximum of 1000 links. If a\n * non-empty path is given, returns a list of all shared links that allow access\n * to the given path. Collection links are never returned in this case. Note\n * that the url field in the response is never the shortened URL.\n * @function Dropbox#sharingGetSharedLinks\n * @deprecated\n * @arg {SharingGetSharedLinksArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingGetSharedLinks = function (arg) {\n return this.request('sharing/get_shared_links', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Use to obtain the members who have been invited to a file, both inherited and\n * uninherited members.\n * @function Dropbox#sharingListFileMembers\n * @arg {SharingListFileMembersArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListFileMembers = function (arg) {\n return this.request('sharing/list_file_members', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get members of multiple files at once. The arguments to this route are more\n * limited, and the limit on query result size per file is more strict. To\n * customize the results more, use the individual file endpoint. Inherited users\n * and groups are not included in the result, and permissions are not returned\n * for this endpoint.\n * @function Dropbox#sharingListFileMembersBatch\n * @arg {SharingListFileMembersBatchArg} arg - The request parameters.\n * @returns {Promise., Error.>}\n */\nroutes.sharingListFileMembersBatch = function (arg) {\n return this.request('sharing/list_file_members/batch', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from list_file_members or\n * list_file_members/batch, use this to paginate through all shared file\n * members.\n * @function Dropbox#sharingListFileMembersContinue\n * @arg {SharingListFileMembersContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListFileMembersContinue = function (arg) {\n return this.request('sharing/list_file_members/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns shared folder membership by its folder ID.\n * @function Dropbox#sharingListFolderMembers\n * @arg {SharingListFolderMembersArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListFolderMembers = function (arg) {\n return this.request('sharing/list_folder_members', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from list_folder_members, use this to\n * paginate through all shared folder members.\n * @function Dropbox#sharingListFolderMembersContinue\n * @arg {SharingListFolderMembersContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListFolderMembersContinue = function (arg) {\n return this.request('sharing/list_folder_members/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Return the list of all shared folders the current user has access to.\n * @function Dropbox#sharingListFolders\n * @arg {SharingListFoldersArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListFolders = function (arg) {\n return this.request('sharing/list_folders', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from list_folders, use this to paginate\n * through all shared folders. The cursor must come from a previous call to\n * list_folders or list_folders/continue.\n * @function Dropbox#sharingListFoldersContinue\n * @arg {SharingListFoldersContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListFoldersContinue = function (arg) {\n return this.request('sharing/list_folders/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Return the list of all shared folders the current user can mount or unmount.\n * @function Dropbox#sharingListMountableFolders\n * @arg {SharingListFoldersArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListMountableFolders = function (arg) {\n return this.request('sharing/list_mountable_folders', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from list_mountable_folders, use this to\n * paginate through all mountable shared folders. The cursor must come from a\n * previous call to list_mountable_folders or list_mountable_folders/continue.\n * @function Dropbox#sharingListMountableFoldersContinue\n * @arg {SharingListFoldersContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListMountableFoldersContinue = function (arg) {\n return this.request('sharing/list_mountable_folders/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Returns a list of all files shared with current user. Does not include files\n * the user has received via shared folders, and does not include unclaimed\n * invitations.\n * @function Dropbox#sharingListReceivedFiles\n * @arg {SharingListFilesArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListReceivedFiles = function (arg) {\n return this.request('sharing/list_received_files', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get more results with a cursor from list_received_files.\n * @function Dropbox#sharingListReceivedFilesContinue\n * @arg {SharingListFilesContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListReceivedFilesContinue = function (arg) {\n return this.request('sharing/list_received_files/continue', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * List shared links of this user. If no path is given, returns a list of all\n * shared links for the current user. If a non-empty path is given, returns a\n * list of all shared links that allow access to the given path - direct links\n * to the given path and links to parent folders of the given path. Links to\n * parent folders can be suppressed by setting direct_only to true.\n * @function Dropbox#sharingListSharedLinks\n * @arg {SharingListSharedLinksArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingListSharedLinks = function (arg) {\n return this.request('sharing/list_shared_links', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Modify the shared link's settings. If the requested visibility conflict with\n * the shared links policy of the team or the shared folder (in case the linked\n * file is part of a shared folder) then the LinkPermissions.resolved_visibility\n * of the returned SharedLinkMetadata will reflect the actual visibility of the\n * shared link and the LinkPermissions.requested_visibility will reflect the\n * requested visibility.\n * @function Dropbox#sharingModifySharedLinkSettings\n * @arg {SharingModifySharedLinkSettingsArgs} arg - The request parameters.\n * @returns {Promise.<(SharingFileLinkMetadata|SharingFolderLinkMetadata|SharingSharedLinkMetadata), Error.>}\n */\nroutes.sharingModifySharedLinkSettings = function (arg) {\n return this.request('sharing/modify_shared_link_settings', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * The current user mounts the designated folder. Mount a shared folder for a\n * user after they have been added as a member. Once mounted, the shared folder\n * will appear in their Dropbox.\n * @function Dropbox#sharingMountFolder\n * @arg {SharingMountFolderArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingMountFolder = function (arg) {\n return this.request('sharing/mount_folder', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * The current user relinquishes their membership in the designated file. Note\n * that the current user may still have inherited access to this file through\n * the parent folder.\n * @function Dropbox#sharingRelinquishFileMembership\n * @arg {SharingRelinquishFileMembershipArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingRelinquishFileMembership = function (arg) {\n return this.request('sharing/relinquish_file_membership', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * The current user relinquishes their membership in the designated shared\n * folder and will no longer have access to the folder. A folder owner cannot\n * relinquish membership in their own folder. This will run synchronously if\n * leave_a_copy is false, and asynchronously if leave_a_copy is true.\n * @function Dropbox#sharingRelinquishFolderMembership\n * @arg {SharingRelinquishFolderMembershipArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingRelinquishFolderMembership = function (arg) {\n return this.request('sharing/relinquish_folder_membership', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Identical to remove_file_member_2 but with less information returned.\n * @function Dropbox#sharingRemoveFileMember\n * @deprecated\n * @arg {SharingRemoveFileMemberArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingRemoveFileMember = function (arg) {\n return this.request('sharing/remove_file_member', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Removes a specified member from the file.\n * @function Dropbox#sharingRemoveFileMember2\n * @arg {SharingRemoveFileMemberArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingRemoveFileMember2 = function (arg) {\n return this.request('sharing/remove_file_member_2', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Allows an owner or editor (if the ACL update policy allows) of a shared\n * folder to remove another member.\n * @function Dropbox#sharingRemoveFolderMember\n * @arg {SharingRemoveFolderMemberArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingRemoveFolderMember = function (arg) {\n return this.request('sharing/remove_folder_member', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Revoke a shared link. Note that even after revoking a shared link to a file,\n * the file may be accessible if there are shared links leading to any of the\n * file parent folders. To list all shared links that enable access to a\n * specific file, you can use the list_shared_links with the file as the\n * ListSharedLinksArg.path argument.\n * @function Dropbox#sharingRevokeSharedLink\n * @arg {SharingRevokeSharedLinkArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingRevokeSharedLink = function (arg) {\n return this.request('sharing/revoke_shared_link', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Change the inheritance policy of an existing Shared Folder. Only permitted\n * for shared folders in a shared team root. If a ShareFolderLaunch.async_job_id\n * is returned, you'll need to call check_share_job_status until the action\n * completes to get the metadata for the folder.\n * @function Dropbox#sharingSetAccessInheritance\n * @arg {SharingSetAccessInheritanceArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingSetAccessInheritance = function (arg) {\n return this.request('sharing/set_access_inheritance', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Share a folder with collaborators. Most sharing will be completed\n * synchronously. Large folders will be completed asynchronously. To make\n * testing the async case repeatable, set `ShareFolderArg.force_async`. If a\n * ShareFolderLaunch.async_job_id is returned, you'll need to call\n * check_share_job_status until the action completes to get the metadata for the\n * folder.\n * @function Dropbox#sharingShareFolder\n * @arg {SharingShareFolderArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingShareFolder = function (arg) {\n return this.request('sharing/share_folder', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Transfer ownership of a shared folder to a member of the shared folder. User\n * must have AccessLevel.owner access to the shared folder to perform a\n * transfer.\n * @function Dropbox#sharingTransferFolder\n * @arg {SharingTransferFolderArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingTransferFolder = function (arg) {\n return this.request('sharing/transfer_folder', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * The current user unmounts the designated folder. They can re-mount the folder\n * at a later time using mount_folder.\n * @function Dropbox#sharingUnmountFolder\n * @arg {SharingUnmountFolderArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingUnmountFolder = function (arg) {\n return this.request('sharing/unmount_folder', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Remove all members from this file. Does not remove inherited members.\n * @function Dropbox#sharingUnshareFile\n * @arg {SharingUnshareFileArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingUnshareFile = function (arg) {\n return this.request('sharing/unshare_file', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Allows a shared folder owner to unshare the folder. You'll need to call\n * check_job_status to determine if the action has completed successfully.\n * @function Dropbox#sharingUnshareFolder\n * @arg {SharingUnshareFolderArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingUnshareFolder = function (arg) {\n return this.request('sharing/unshare_folder', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Changes a member's access on a shared file.\n * @function Dropbox#sharingUpdateFileMember\n * @arg {SharingUpdateFileMemberArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingUpdateFileMember = function (arg) {\n return this.request('sharing/update_file_member', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Allows an owner or editor of a shared folder to update another member's\n * permissions.\n * @function Dropbox#sharingUpdateFolderMember\n * @arg {SharingUpdateFolderMemberArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingUpdateFolderMember = function (arg) {\n return this.request('sharing/update_folder_member', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Update the sharing policies for a shared folder. User must have\n * AccessLevel.owner access to the shared folder to update its policies.\n * @function Dropbox#sharingUpdateFolderPolicy\n * @arg {SharingUpdateFolderPolicyArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.sharingUpdateFolderPolicy = function (arg) {\n return this.request('sharing/update_folder_policy', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Retrieves team events. Events have a lifespan of two years. Events older than\n * two years will not be returned. Many attributes note 'may be missing due to\n * historical data gap'. Note that the file_operations category and & analogous\n * paper events are not available on all Dropbox Business plans\n * /business/plans-comparison. Use features/get_values\n * /developers/documentation/http/teams#team-features-get_values to check for\n * this feature. Permission : Team Auditing.\n * @function Dropbox#teamLogGetEvents\n * @arg {TeamLogGetTeamEventsArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamLogGetEvents = function (arg) {\n return this.request('team_log/get_events', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from get_events, use this to paginate\n * through all events. Permission : Team Auditing.\n * @function Dropbox#teamLogGetEventsContinue\n * @arg {TeamLogGetTeamEventsContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamLogGetEventsContinue = function (arg) {\n return this.request('team_log/get_events/continue', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Get information about a user's account.\n * @function Dropbox#usersGetAccount\n * @arg {UsersGetAccountArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.usersGetAccount = function (arg) {\n return this.request('users/get_account', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get information about multiple user accounts. At most 300 accounts may be\n * queried per request.\n * @function Dropbox#usersGetAccountBatch\n * @arg {UsersGetAccountBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.usersGetAccountBatch = function (arg) {\n return this.request('users/get_account_batch', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get information about the current user's account.\n * @function Dropbox#usersGetCurrentAccount\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.usersGetCurrentAccount = function (arg) {\n return this.request('users/get_current_account', arg, 'user', 'api', 'rpc');\n};\n\n/**\n * Get the space usage information for the current user's account.\n * @function Dropbox#usersGetSpaceUsage\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.usersGetSpaceUsage = function (arg) {\n return this.request('users/get_space_usage', arg, 'user', 'api', 'rpc');\n};\n\nexport { routes };\n","export const RPC = 'rpc';\nexport const UPLOAD = 'upload';\nexport const DOWNLOAD = 'download';\n","function getSafeUnicode(c) {\n const unicode = `000${c.charCodeAt(0).toString(16)}`.slice(-4);\n return `\\\\u${unicode}`;\n}\n\n\n/* global WorkerGlobalScope */\nexport function isWindowOrWorker() {\n return (\n (\n typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope\n )\n ||\n (\n typeof module === 'undefined' ||\n typeof window !== 'undefined'\n )\n );\n}\n\nexport function getBaseURL(host) {\n return `https://${host}.dropboxapi.com/2/`;\n}\n\n// source https://www.dropboxforum.com/t5/API-support/HTTP-header-quot-Dropbox-API-Arg-quot-could-not-decode-input-as/m-p/173823/highlight/true#M6786\nexport function httpHeaderSafeJson(args) {\n return JSON.stringify(args).replace(/[\\u007f-\\uffff]/g, getSafeUnicode);\n}\n","import { getBaseURL, httpHeaderSafeJson, isWindowOrWorker } from './utils';\n\nfunction getDataFromConsumer(res) {\n if (!res.ok) {\n return res.text();\n }\n\n return (isWindowOrWorker()) ? res.blob() : res.buffer();\n}\n\nfunction responseHandler(res, data) {\n if (!res.ok) {\n // eslint-disable-next-line no-throw-literal\n throw {\n error: data,\n response: res,\n status: res.status,\n };\n }\n\n const result = JSON.parse(res.headers.get('dropbox-api-result'));\n\n if (isWindowOrWorker()) {\n result.fileBlob = data;\n } else {\n result.fileBinary = data;\n }\n\n return result;\n}\n\nexport function downloadRequest(fetch) {\n return function downloadRequestWithFetch(path, args, auth, host, accessToken, options) {\n if (auth !== 'user') {\n throw new Error(`Unexpected auth type: ${auth}`);\n }\n\n const fetchOptions = {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${accessToken}`,\n 'Dropbox-API-Arg': httpHeaderSafeJson(args),\n },\n };\n\n if (options) {\n if (options.selectUser) {\n fetchOptions.headers['Dropbox-API-Select-User'] = options.selectUser;\n }\n if (options.selectAdmin) {\n fetchOptions.headers['Dropbox-API-Select-Admin'] = options.selectAdmin;\n }\n if (options.pathRoot) {\n fetchOptions.headers['Dropbox-API-Path-Root'] = options.pathRoot;\n }\n }\n\n\n return fetch(getBaseURL(host) + path, fetchOptions)\n .then(res => getDataFromConsumer(res).then(data => [res, data]))\n .then(([res, data]) => responseHandler(res, data));\n };\n}\n","import { getBaseURL, httpHeaderSafeJson } from './utils';\n\nfunction parseBodyToType(res) {\n const clone = res.clone();\n return new Promise((resolve) => {\n res.json()\n .then(data => resolve(data))\n .catch(() => clone.text().then(data => resolve(data)));\n }).then(data => [res, data]);\n}\n\nexport function uploadRequest(fetch) {\n return function uploadRequestWithFetch(path, args, auth, host, accessToken, options) {\n if (auth !== 'user') {\n throw new Error(`Unexpected auth type: ${auth}`);\n }\n\n const { contents } = args;\n delete args.contents;\n\n const fetchOptions = {\n body: contents,\n method: 'POST',\n headers: {\n Authorization: `Bearer ${accessToken}`,\n 'Content-Type': 'application/octet-stream',\n 'Dropbox-API-Arg': httpHeaderSafeJson(args),\n },\n };\n\n if (options) {\n if (options.selectUser) {\n fetchOptions.headers['Dropbox-API-Select-User'] = options.selectUser;\n }\n if (options.selectAdmin) {\n fetchOptions.headers['Dropbox-API-Select-Admin'] = options.selectAdmin;\n }\n if (options.pathRoot) {\n fetchOptions.headers['Dropbox-API-Path-Root'] = options.pathRoot;\n }\n }\n\n return fetch(getBaseURL(host) + path, fetchOptions)\n .then(res => parseBodyToType(res))\n .then(([res, data]) => {\n // maintaining existing API for error codes not equal to 200 range\n if (!res.ok) {\n // eslint-disable-next-line no-throw-literal\n throw {\n error: data,\n response: res,\n status: res.status,\n };\n }\n\n return data;\n });\n };\n}\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('Invalid typed array length')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n buf.__proto__ = Buffer.prototype\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\n// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\nif (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true,\n enumerable: false,\n writable: false\n })\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (isArrayBuffer(value)) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n return fromObject(value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nBuffer.prototype.__proto__ = Uint8Array.prototype\nBuffer.__proto__ = Uint8Array\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n buf.__proto__ = Buffer.prototype\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj) {\n if (isArrayBufferView(obj) || 'length' in obj) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (isArrayBufferView(string) || isArrayBuffer(string)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n newBuf.__proto__ = Buffer.prototype\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : new Buffer(val, encoding)\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffers from another context (i.e. an iframe) do not pass the `instanceof` check\n// but they should be treated as valid. See: https://github.com/feross/buffer/issues/166\nfunction isArrayBuffer (obj) {\n return obj instanceof ArrayBuffer ||\n (obj != null && obj.constructor != null && obj.constructor.name === 'ArrayBuffer' &&\n typeof obj.byteLength === 'number')\n}\n\n// Node 0.10 supports `ArrayBuffer` but lacks `ArrayBuffer.isView`\nfunction isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}\n\nfunction numberIsNaN (obj) {\n return obj !== obj // eslint-disable-line no-self-compare\n}\n","import { Buffer } from 'buffer/';\nimport { getBaseURL } from './utils';\n\nfunction parseBodyToType(res) {\n if (res.headers.get('Content-Type') === 'application/json') {\n return res.json().then(data => [res, data]);\n }\n return res.text().then(data => [res, data]);\n}\n\nexport function rpcRequest(fetch) {\n return function rpcRequestWithFetch(path, body, auth, host, accessToken, options) {\n const fetchOptions = {\n method: 'POST',\n body: (body) ? JSON.stringify(body) : null,\n };\n const headers = {};\n if (body) {\n headers['Content-Type'] = 'application/json';\n }\n let authHeader = '';\n\n switch (auth) {\n case 'app':\n if (!options.clientId || !options.clientSecret) {\n throw new Error('A client id and secret is required for this function');\n }\n authHeader = new Buffer(`${options.clientId}:${options.clientSecret}`).toString('base64');\n headers.Authorization = `Basic ${authHeader}`;\n break;\n case 'team':\n case 'user':\n headers.Authorization = `Bearer ${accessToken}`;\n break;\n case 'noauth':\n break;\n default:\n throw new Error(`Unhandled auth type: ${auth}`);\n }\n\n if (options) {\n if (options.selectUser) {\n headers['Dropbox-API-Select-User'] = options.selectUser;\n }\n if (options.selectAdmin) {\n headers['Dropbox-API-Select-Admin'] = options.selectAdmin;\n }\n if (options.pathRoot) {\n headers['Dropbox-API-Path-Root'] = options.pathRoot;\n }\n }\n\n fetchOptions.headers = headers;\n return fetch(getBaseURL(host) + path, fetchOptions)\n .then(res => parseBodyToType(res))\n .then(([res, data]) => {\n // maintaining existing API for error codes not equal to 200 range\n if (!res.ok) {\n // eslint-disable-next-line no-throw-literal\n throw {\n error: data,\n response: res,\n status: res.status,\n };\n }\n\n return data;\n });\n };\n}\n","import { UPLOAD, DOWNLOAD, RPC } from './constants';\nimport { downloadRequest } from './download-request';\nimport { uploadRequest } from './upload-request';\nimport { rpcRequest } from './rpc-request';\n\n/* eslint-disable */\n// Polyfill object.assign for legacy browsers\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\nif (typeof Object.assign !== 'function') {\n (function () {\n Object.assign = function (target) {\n 'use strict';\n var output;\n var index;\n var source;\n var nextKey;\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n output = Object(target);\n for (index = 1; index < arguments.length; index++) {\n source = arguments[index];\n if (source !== undefined && source !== null) {\n for (nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n return output;\n };\n }());\n}\n\n// Polyfill Array.includes for legacy browsers\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes\n// https://tc39.github.io/ecma262/#sec-array.prototype.includes\nif (!Array.prototype.includes) {\n Object.defineProperty(Array.prototype, 'includes', {\n value: function(searchElement, fromIndex) {\n\n if (this == null) {\n throw new TypeError('\"this\" is null or not defined');\n }\n\n // 1. Let O be ? ToObject(this value).\n var o = Object(this);\n\n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n var len = o.length >>> 0;\n\n // 3. If len is 0, return false.\n if (len === 0) {\n return false;\n }\n\n // 4. Let n be ? ToInteger(fromIndex).\n // (If fromIndex is undefined, this step produces the value 0.)\n var n = fromIndex | 0;\n\n // 5. If n ≥ 0, then\n // a. Let k be n.\n // 6. Else n < 0,\n // a. Let k be len + n.\n // b. If k < 0, let k be 0.\n var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\n\n function sameValueZero(x, y) {\n return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));\n }\n\n // 7. Repeat, while k < len\n while (k < len) {\n // a. Let elementK be the result of ? Get(O, ! ToString(k)).\n // b. If SameValueZero(searchElement, elementK) is true, return true.\n if (sameValueZero(o[k], searchElement)) {\n return true;\n }\n // c. Increase k by 1.\n k++;\n }\n\n // 8. Return false\n return false;\n }\n });\n}\n/* eslint-enable */\n\n/**\n * @private\n * @class DropboxBase\n * @classdesc The main Dropbox SDK class. This contains the methods that are\n * shared between Dropbox and DropboxTeam classes. It is marked as private so\n * that it doesn't show up in the docs because it is never used directly.\n * @arg {Object} options\n * @arg {Function} [options.fetch] - fetch library for making requests.\n * @arg {String} [options.accessToken] - An access token for making authenticated\n * requests.\n * @arg {String} [options.clientId] - The client id for your app. Used to create\n * authentication URL.\n * @arg {String} [options.clientSecret] - The client secret for your app.\n * @arg {Number} [options.selectUser] - User that the team access token would like\n * to act as.\n * @arg {String} [options.selectAdmin] - Team admin that the team access token would like\n * to act as.\n * @arg {String} [options.pathRoot] - root pass to access other namespaces\n * Use to access team folders for example\n */\n\nfunction parseBodyToType(res) {\n const clone = res.clone();\n return new Promise((resolve) => {\n res.json()\n .then(data => resolve(data))\n .catch(() => clone.text().then(data => resolve(data)));\n }).then(data => [res, data]);\n}\n\nexport class DropboxBase {\n constructor(options) {\n options = options || {};\n this.accessToken = options.accessToken;\n this.clientId = options.clientId;\n this.clientSecret = options.clientSecret;\n this.selectUser = options.selectUser;\n this.selectAdmin = options.selectAdmin;\n this.fetch = options.fetch || fetch;\n this.pathRoot = options.pathRoot;\n if (!options.fetch) { console.warn('Global fetch is deprecated and will be unsupported in a future version. Please pass fetch function as option when instantiating dropbox instance: new Dropbox({fetch})'); } // eslint-disable-line no-console\n }\n\n /**\n * Set the access token used to authenticate requests to the API.\n * @arg {String} accessToken - An access token\n * @returns {undefined}\n */\n setAccessToken(accessToken) {\n this.accessToken = accessToken;\n }\n\n /**\n * Get the access token\n * @returns {String} Access token\n */\n getAccessToken() {\n return this.accessToken;\n }\n\n /**\n * Set the client id, which is used to help gain an access token.\n * @arg {String} clientId - Your apps client id\n * @returns {undefined}\n */\n setClientId(clientId) {\n this.clientId = clientId;\n }\n\n /**\n * Get the client id\n * @returns {String} Client id\n */\n getClientId() {\n return this.clientId;\n }\n\n /**\n * Set the client secret\n * @arg {String} clientSecret - Your app's client secret\n * @returns {undefined}\n */\n setClientSecret(clientSecret) {\n this.clientSecret = clientSecret;\n }\n\n /**\n * Get the client secret\n * @returns {String} Client secret\n */\n getClientSecret() {\n return this.clientSecret;\n }\n\n /**\n * Get a URL that can be used to authenticate users for the Dropbox API.\n * @arg {String} redirectUri - A URL to redirect the user to after\n * authenticating. This must be added to your app through the admin interface.\n * @arg {String} [state] - State that will be returned in the redirect URL to help\n * prevent cross site scripting attacks.\n * @arg {String} [authType] - auth type, defaults to 'token', other option is 'code'\n * @returns {String} Url to send user to for Dropbox API authentication\n */\n getAuthenticationUrl(redirectUri, state, authType = 'token') {\n const clientId = this.getClientId();\n const baseUrl = 'https://www.dropbox.com/oauth2/authorize';\n\n if (!clientId) {\n throw new Error('A client id is required. You can set the client id using .setClientId().');\n }\n if (authType !== 'code' && !redirectUri) {\n throw new Error('A redirect uri is required.');\n }\n if (!['code', 'token'].includes(authType)) {\n throw new Error('Authorization type must be code or token');\n }\n\n let authUrl;\n if (authType === 'code') {\n authUrl = `${baseUrl}?response_type=code&client_id=${clientId}`;\n } else {\n authUrl = `${baseUrl}?response_type=token&client_id=${clientId}`;\n }\n\n if (redirectUri) {\n authUrl += `&redirect_uri=${redirectUri}`;\n }\n if (state) {\n authUrl += `&state=${state}`;\n }\n return authUrl;\n }\n\n /**\n * Get an OAuth2 access token from an OAuth2 Code.\n * @arg {String} redirectUri - A URL to redirect the user to after\n * authenticating. This must be added to your app through the admin interface.\n * @arg {String} code - An OAuth2 code.\n */\n getAccessTokenFromCode(redirectUri, code) {\n const clientId = this.getClientId();\n const clientSecret = this.getClientSecret();\n\n if (!clientId) {\n throw new Error('A client id is required. You can set the client id using .setClientId().');\n }\n if (!clientSecret) {\n throw new Error('A client secret is required. You can set the client id using .setClientSecret().');\n }\n const path = `https://api.dropboxapi.com/oauth2/token?code=${code}&\\\ngrant_type=authorization_code&redirect_uri=${redirectUri}&\\\nclient_id=${clientId}&client_secret=${clientSecret}`;\n\n const fetchOptions = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n };\n\n return this.fetch(path, fetchOptions)\n .then(res => parseBodyToType(res))\n .then(([res, data]) => {\n // maintaining existing API for error codes not equal to 200 range\n if (!res.ok) {\n // eslint-disable-next-line no-throw-literal\n throw {\n error: data,\n response: res,\n status: res.status,\n };\n }\n return data.access_token;\n });\n }\n\n /**\n * Called when the authentication succeed\n * @callback successCallback\n * @param {string} access_token The application's access token\n */\n\n /**\n * Called when the authentication failed.\n * @callback errorCallback\n */\n\n\n /**\n * An authentication process that works with cordova applications.\n * @param {successCallback} successCallback\n * @param {errorCallback} errorCallback\n */\n authenticateWithCordova(successCallback, errorCallback) {\n const redirectUrl = 'https://www.dropbox.com/1/oauth2/redirect_receiver';\n const url = this.getAuthenticationUrl(redirectUrl);\n\n let removed = false;\n const browser = window.open(url, '_blank');\n\n function onLoadError(event) {\n if (event.code !== -999) { // Workaround to fix wrong behavior on cordova-plugin-inappbrowser\n // Try to avoid a browser crash on browser.close().\n window.setTimeout(() => { browser.close(); }, 10);\n errorCallback();\n }\n }\n\n function onLoadStop(event) {\n const errorLabel = '&error=';\n const errorIndex = event.url.indexOf(errorLabel);\n\n if (errorIndex > -1) {\n // Try to avoid a browser crash on browser.close().\n window.setTimeout(() => { browser.close(); }, 10);\n errorCallback();\n } else {\n const tokenLabel = '#access_token=';\n let tokenIndex = event.url.indexOf(tokenLabel);\n const tokenTypeIndex = event.url.indexOf('&token_type=');\n if (tokenIndex > -1) {\n tokenIndex += tokenLabel.length;\n // Try to avoid a browser crash on browser.close().\n window.setTimeout(() => { browser.close(); }, 10);\n\n const accessToken = event.url.substring(tokenIndex, tokenTypeIndex);\n successCallback(accessToken);\n }\n }\n }\n\n function onExit() {\n if (removed) {\n return;\n }\n browser.removeEventListener('loaderror', onLoadError);\n browser.removeEventListener('loadstop', onLoadStop);\n browser.removeEventListener('exit', onExit);\n removed = true;\n }\n\n browser.addEventListener('loaderror', onLoadError);\n browser.addEventListener('loadstop', onLoadStop);\n browser.addEventListener('exit', onExit);\n }\n\n request(path, args, auth, host, style) {\n let request = null;\n switch (style) {\n case RPC:\n request = this.getRpcRequest();\n break;\n case DOWNLOAD:\n request = this.getDownloadRequest();\n break;\n case UPLOAD:\n request = this.getUploadRequest();\n break;\n default:\n throw new Error(`Invalid request style: ${style}`);\n }\n const options = {\n selectUser: this.selectUser,\n selectAdmin: this.selectAdmin,\n clientId: this.getClientId(),\n clientSecret: this.getClientSecret(),\n pathRoot: this.pathRoot,\n };\n return request(path, args, auth, host, this.getAccessToken(), options);\n }\n\n setRpcRequest(newRpcRequest) {\n this.rpcRequest = newRpcRequest;\n }\n\n getRpcRequest() {\n if (this.rpcRequest === undefined) {\n this.rpcRequest = rpcRequest(this.fetch);\n }\n return this.rpcRequest;\n }\n\n setDownloadRequest(newDownloadRequest) {\n this.downloadRequest = newDownloadRequest;\n }\n\n getDownloadRequest() {\n if (this.downloadRequest === undefined) {\n this.downloadRequest = downloadRequest(this.fetch);\n }\n return this.downloadRequest;\n }\n\n setUploadRequest(newUploadRequest) {\n this.uploadRequest = newUploadRequest;\n }\n\n getUploadRequest() {\n if (this.uploadRequest === undefined) {\n this.uploadRequest = uploadRequest(this.fetch);\n }\n return this.uploadRequest;\n }\n\n}\n","import { routes } from './routes';\nimport { DropboxBase } from './dropbox-base';\n\n/**\n * @class Dropbox\n * @extends DropboxBase\n * @classdesc The Dropbox SDK class that provides methods to read, write and\n * create files or folders in a user's Dropbox.\n * @arg {Object} options\n * @arg {Function} [options.fetch] - fetch library for making requests.\n * @arg {String} [options.accessToken] - An access token for making authenticated\n * requests.\n * @arg {String} [options.clientId] - The client id for your app. Used to create\n * authentication URL.\n * @arg {String} [options.selectUser] - Select user is only used by DropboxTeam.\n * It specifies which user the team access token should be acting as.\n * @arg {String} [options.pathRoot] - root pass to access other namespaces\n * Use to access team folders for example\n */\nexport class Dropbox extends DropboxBase {\n\n constructor(options) {\n super(options);\n Object.assign(this, routes);\n }\n\n filesGetSharedLinkFile(arg) {\n return this.request('sharing/get_shared_link_file', arg, 'api', 'download');\n }\n}\n","// Auto-generated by Stone, do not modify.\nvar routes = {};\n\n/**\n * List all device sessions of a team's member.\n * @function DropboxTeam#teamDevicesListMemberDevices\n * @arg {TeamListMemberDevicesArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamDevicesListMemberDevices = function (arg) {\n return this.request('team/devices/list_member_devices', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * List all device sessions of a team. Permission : Team member file access.\n * @function DropboxTeam#teamDevicesListMembersDevices\n * @arg {TeamListMembersDevicesArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamDevicesListMembersDevices = function (arg) {\n return this.request('team/devices/list_members_devices', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * List all device sessions of a team. Permission : Team member file access.\n * @function DropboxTeam#teamDevicesListTeamDevices\n * @deprecated\n * @arg {TeamListTeamDevicesArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamDevicesListTeamDevices = function (arg) {\n return this.request('team/devices/list_team_devices', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Revoke a device session of a team's member.\n * @function DropboxTeam#teamDevicesRevokeDeviceSession\n * @arg {TeamRevokeDeviceSessionArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamDevicesRevokeDeviceSession = function (arg) {\n return this.request('team/devices/revoke_device_session', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Revoke a list of device sessions of team members.\n * @function DropboxTeam#teamDevicesRevokeDeviceSessionBatch\n * @arg {TeamRevokeDeviceSessionBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamDevicesRevokeDeviceSessionBatch = function (arg) {\n return this.request('team/devices/revoke_device_session_batch', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Get the values for one or more featues. This route allows you to check your\n * account's capability for what feature you can access or what value you have\n * for certain features. Permission : Team information.\n * @function DropboxTeam#teamFeaturesGetValues\n * @arg {TeamFeaturesGetValuesBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamFeaturesGetValues = function (arg) {\n return this.request('team/features/get_values', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Retrieves information about a team.\n * @function DropboxTeam#teamGetInfo\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGetInfo = function (arg) {\n return this.request('team/get_info', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Creates a new, empty group, with a requested name. Permission : Team member\n * management.\n * @function DropboxTeam#teamGroupsCreate\n * @arg {TeamGroupCreateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsCreate = function (arg) {\n return this.request('team/groups/create', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Deletes a group. The group is deleted immediately. However the revoking of\n * group-owned resources may take additional time. Use the groups/job_status/get\n * to determine whether this process has completed. Permission : Team member\n * management.\n * @function DropboxTeam#teamGroupsDelete\n * @arg {TeamGroupSelector} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsDelete = function (arg) {\n return this.request('team/groups/delete', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Retrieves information about one or more groups. Note that the optional field\n * GroupFullInfo.members is not returned for system-managed groups. Permission :\n * Team Information.\n * @function DropboxTeam#teamGroupsGetInfo\n * @arg {TeamGroupsSelector} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsGetInfo = function (arg) {\n return this.request('team/groups/get_info', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Once an async_job_id is returned from groups/delete, groups/members/add , or\n * groups/members/remove use this method to poll the status of granting/revoking\n * group members' access to group-owned resources. Permission : Team member\n * management.\n * @function DropboxTeam#teamGroupsJobStatusGet\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsJobStatusGet = function (arg) {\n return this.request('team/groups/job_status/get', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Lists groups on a team. Permission : Team Information.\n * @function DropboxTeam#teamGroupsList\n * @arg {TeamGroupsListArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsList = function (arg) {\n return this.request('team/groups/list', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from groups/list, use this to paginate\n * through all groups. Permission : Team Information.\n * @function DropboxTeam#teamGroupsListContinue\n * @arg {TeamGroupsListContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsListContinue = function (arg) {\n return this.request('team/groups/list/continue', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Adds members to a group. The members are added immediately. However the\n * granting of group-owned resources may take additional time. Use the\n * groups/job_status/get to determine whether this process has completed.\n * Permission : Team member management.\n * @function DropboxTeam#teamGroupsMembersAdd\n * @arg {TeamGroupMembersAddArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsMembersAdd = function (arg) {\n return this.request('team/groups/members/add', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Lists members of a group. Permission : Team Information.\n * @function DropboxTeam#teamGroupsMembersList\n * @arg {TeamGroupsMembersListArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsMembersList = function (arg) {\n return this.request('team/groups/members/list', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from groups/members/list, use this to\n * paginate through all members of the group. Permission : Team information.\n * @function DropboxTeam#teamGroupsMembersListContinue\n * @arg {TeamGroupsMembersListContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsMembersListContinue = function (arg) {\n return this.request('team/groups/members/list/continue', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Removes members from a group. The members are removed immediately. However\n * the revoking of group-owned resources may take additional time. Use the\n * groups/job_status/get to determine whether this process has completed. This\n * method permits removing the only owner of a group, even in cases where this\n * is not possible via the web client. Permission : Team member management.\n * @function DropboxTeam#teamGroupsMembersRemove\n * @arg {TeamGroupMembersRemoveArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsMembersRemove = function (arg) {\n return this.request('team/groups/members/remove', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Sets a member's access type in a group. Permission : Team member management.\n * @function DropboxTeam#teamGroupsMembersSetAccessType\n * @arg {TeamGroupMembersSetAccessTypeArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsMembersSetAccessType = function (arg) {\n return this.request('team/groups/members/set_access_type', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Updates a group's name and/or external ID. Permission : Team member\n * management.\n * @function DropboxTeam#teamGroupsUpdate\n * @arg {TeamGroupUpdateArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamGroupsUpdate = function (arg) {\n return this.request('team/groups/update', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * List all linked applications of the team member. Note, this endpoint does not\n * list any team-linked applications.\n * @function DropboxTeam#teamLinkedAppsListMemberLinkedApps\n * @arg {TeamListMemberAppsArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamLinkedAppsListMemberLinkedApps = function (arg) {\n return this.request('team/linked_apps/list_member_linked_apps', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * List all applications linked to the team members' accounts. Note, this\n * endpoint does not list any team-linked applications.\n * @function DropboxTeam#teamLinkedAppsListMembersLinkedApps\n * @arg {TeamListMembersAppsArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamLinkedAppsListMembersLinkedApps = function (arg) {\n return this.request('team/linked_apps/list_members_linked_apps', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * List all applications linked to the team members' accounts. Note, this\n * endpoint doesn't list any team-linked applications.\n * @function DropboxTeam#teamLinkedAppsListTeamLinkedApps\n * @deprecated\n * @arg {TeamListTeamAppsArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamLinkedAppsListTeamLinkedApps = function (arg) {\n return this.request('team/linked_apps/list_team_linked_apps', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Revoke a linked application of the team member.\n * @function DropboxTeam#teamLinkedAppsRevokeLinkedApp\n * @arg {TeamRevokeLinkedApiAppArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamLinkedAppsRevokeLinkedApp = function (arg) {\n return this.request('team/linked_apps/revoke_linked_app', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Revoke a list of linked applications of the team members.\n * @function DropboxTeam#teamLinkedAppsRevokeLinkedAppBatch\n * @arg {TeamRevokeLinkedApiAppBatchArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamLinkedAppsRevokeLinkedAppBatch = function (arg) {\n return this.request('team/linked_apps/revoke_linked_app_batch', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Add users to member space limits excluded users list.\n * @function DropboxTeam#teamMemberSpaceLimitsExcludedUsersAdd\n * @arg {TeamExcludedUsersUpdateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMemberSpaceLimitsExcludedUsersAdd = function (arg) {\n return this.request('team/member_space_limits/excluded_users/add', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * List member space limits excluded users.\n * @function DropboxTeam#teamMemberSpaceLimitsExcludedUsersList\n * @arg {TeamExcludedUsersListArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMemberSpaceLimitsExcludedUsersList = function (arg) {\n return this.request('team/member_space_limits/excluded_users/list', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Continue listing member space limits excluded users.\n * @function DropboxTeam#teamMemberSpaceLimitsExcludedUsersListContinue\n * @arg {TeamExcludedUsersListContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMemberSpaceLimitsExcludedUsersListContinue = function (arg) {\n return this.request('team/member_space_limits/excluded_users/list/continue', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Remove users from member space limits excluded users list.\n * @function DropboxTeam#teamMemberSpaceLimitsExcludedUsersRemove\n * @arg {TeamExcludedUsersUpdateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMemberSpaceLimitsExcludedUsersRemove = function (arg) {\n return this.request('team/member_space_limits/excluded_users/remove', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Get users custom quota. Returns none as the custom quota if none was set. A\n * maximum of 1000 members can be specified in a single call.\n * @function DropboxTeam#teamMemberSpaceLimitsGetCustomQuota\n * @arg {TeamCustomQuotaUsersArg} arg - The request parameters.\n * @returns {Promise., Error.>}\n */\nroutes.teamMemberSpaceLimitsGetCustomQuota = function (arg) {\n return this.request('team/member_space_limits/get_custom_quota', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Remove users custom quota. A maximum of 1000 members can be specified in a\n * single call.\n * @function DropboxTeam#teamMemberSpaceLimitsRemoveCustomQuota\n * @arg {TeamCustomQuotaUsersArg} arg - The request parameters.\n * @returns {Promise., Error.>}\n */\nroutes.teamMemberSpaceLimitsRemoveCustomQuota = function (arg) {\n return this.request('team/member_space_limits/remove_custom_quota', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Set users custom quota. Custom quota has to be at least 15GB. A maximum of\n * 1000 members can be specified in a single call.\n * @function DropboxTeam#teamMemberSpaceLimitsSetCustomQuota\n * @arg {TeamSetCustomQuotaArg} arg - The request parameters.\n * @returns {Promise., Error.>}\n */\nroutes.teamMemberSpaceLimitsSetCustomQuota = function (arg) {\n return this.request('team/member_space_limits/set_custom_quota', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Adds members to a team. Permission : Team member management A maximum of 20\n * members can be specified in a single call. If no Dropbox account exists with\n * the email address specified, a new Dropbox account will be created with the\n * given email address, and that account will be invited to the team. If a\n * personal Dropbox account exists with the email address specified in the call,\n * this call will create a placeholder Dropbox account for the user on the team\n * and send an email inviting the user to migrate their existing personal\n * account onto the team. Team member management apps are required to set an\n * initial given_name and surname for a user to use in the team invitation and\n * for 'Perform as team member' actions taken on the user before they become\n * 'active'.\n * @function DropboxTeam#teamMembersAdd\n * @arg {TeamMembersAddArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersAdd = function (arg) {\n return this.request('team/members/add', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Once an async_job_id is returned from members/add , use this to poll the\n * status of the asynchronous request. Permission : Team member management.\n * @function DropboxTeam#teamMembersAddJobStatusGet\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersAddJobStatusGet = function (arg) {\n return this.request('team/members/add/job_status/get', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Returns information about multiple team members. Permission : Team\n * information This endpoint will return MembersGetInfoItem.id_not_found, for\n * IDs (or emails) that cannot be matched to a valid team member.\n * @function DropboxTeam#teamMembersGetInfo\n * @arg {TeamMembersGetInfoArgs} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersGetInfo = function (arg) {\n return this.request('team/members/get_info', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Lists members of a team. Permission : Team information.\n * @function DropboxTeam#teamMembersList\n * @arg {TeamMembersListArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersList = function (arg) {\n return this.request('team/members/list', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from members/list, use this to paginate\n * through all team members. Permission : Team information.\n * @function DropboxTeam#teamMembersListContinue\n * @arg {TeamMembersListContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersListContinue = function (arg) {\n return this.request('team/members/list/continue', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Moves removed member's files to a different member. This endpoint initiates\n * an asynchronous job. To obtain the final result of the job, the client should\n * periodically poll members/move_former_member_files/job_status/check.\n * Permission : Team member management.\n * @function DropboxTeam#teamMembersMoveFormerMemberFiles\n * @arg {TeamMembersDataTransferArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersMoveFormerMemberFiles = function (arg) {\n return this.request('team/members/move_former_member_files', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Once an async_job_id is returned from members/move_former_member_files , use\n * this to poll the status of the asynchronous request. Permission : Team member\n * management.\n * @function DropboxTeam#teamMembersMoveFormerMemberFilesJobStatusCheck\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersMoveFormerMemberFilesJobStatusCheck = function (arg) {\n return this.request('team/members/move_former_member_files/job_status/check', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Recover a deleted member. Permission : Team member management Exactly one of\n * team_member_id, email, or external_id must be provided to identify the user\n * account.\n * @function DropboxTeam#teamMembersRecover\n * @arg {TeamMembersRecoverArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersRecover = function (arg) {\n return this.request('team/members/recover', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Removes a member from a team. Permission : Team member management Exactly one\n * of team_member_id, email, or external_id must be provided to identify the\n * user account. Accounts can be recovered via members/recover for a 7 day\n * period or until the account has been permanently deleted or transferred to\n * another account (whichever comes first). Calling members/add while a user is\n * still recoverable on your team will return with\n * MemberAddResult.user_already_on_team. Accounts can have their files\n * transferred via the admin console for a limited time, based on the version\n * history length associated with the team (120 days for most teams). This\n * endpoint may initiate an asynchronous job. To obtain the final result of the\n * job, the client should periodically poll members/remove/job_status/get.\n * @function DropboxTeam#teamMembersRemove\n * @arg {TeamMembersRemoveArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersRemove = function (arg) {\n return this.request('team/members/remove', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Once an async_job_id is returned from members/remove , use this to poll the\n * status of the asynchronous request. Permission : Team member management.\n * @function DropboxTeam#teamMembersRemoveJobStatusGet\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersRemoveJobStatusGet = function (arg) {\n return this.request('team/members/remove/job_status/get', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Sends welcome email to pending team member. Permission : Team member\n * management Exactly one of team_member_id, email, or external_id must be\n * provided to identify the user account. No-op if team member is not pending.\n * @function DropboxTeam#teamMembersSendWelcomeEmail\n * @arg {TeamUserSelectorArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersSendWelcomeEmail = function (arg) {\n return this.request('team/members/send_welcome_email', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Updates a team member's permissions. Permission : Team member management.\n * @function DropboxTeam#teamMembersSetAdminPermissions\n * @arg {TeamMembersSetPermissionsArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersSetAdminPermissions = function (arg) {\n return this.request('team/members/set_admin_permissions', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Updates a team member's profile. Permission : Team member management.\n * @function DropboxTeam#teamMembersSetProfile\n * @arg {TeamMembersSetProfileArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersSetProfile = function (arg) {\n return this.request('team/members/set_profile', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Suspend a member from a team. Permission : Team member management Exactly one\n * of team_member_id, email, or external_id must be provided to identify the\n * user account.\n * @function DropboxTeam#teamMembersSuspend\n * @arg {TeamMembersDeactivateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersSuspend = function (arg) {\n return this.request('team/members/suspend', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Unsuspend a member from a team. Permission : Team member management Exactly\n * one of team_member_id, email, or external_id must be provided to identify the\n * user account.\n * @function DropboxTeam#teamMembersUnsuspend\n * @arg {TeamMembersUnsuspendArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamMembersUnsuspend = function (arg) {\n return this.request('team/members/unsuspend', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Returns a list of all team-accessible namespaces. This list includes team\n * folders, shared folders containing team members, team members' home\n * namespaces, and team members' app folders. Home namespaces and app folders\n * are always owned by this team or members of the team, but shared folders may\n * be owned by other users or other teams. Duplicates may occur in the list.\n * @function DropboxTeam#teamNamespacesList\n * @arg {TeamTeamNamespacesListArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamNamespacesList = function (arg) {\n return this.request('team/namespaces/list', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from namespaces/list, use this to paginate\n * through all team-accessible namespaces. Duplicates may occur in the list.\n * @function DropboxTeam#teamNamespacesListContinue\n * @arg {TeamTeamNamespacesListContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamNamespacesListContinue = function (arg) {\n return this.request('team/namespaces/list/continue', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Permission : Team member file access.\n * @function DropboxTeam#teamPropertiesTemplateAdd\n * @deprecated\n * @arg {FilePropertiesAddTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamPropertiesTemplateAdd = function (arg) {\n return this.request('team/properties/template/add', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Permission : Team member file access.\n * @function DropboxTeam#teamPropertiesTemplateGet\n * @deprecated\n * @arg {FilePropertiesGetTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamPropertiesTemplateGet = function (arg) {\n return this.request('team/properties/template/get', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Permission : Team member file access.\n * @function DropboxTeam#teamPropertiesTemplateList\n * @deprecated\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamPropertiesTemplateList = function (arg) {\n return this.request('team/properties/template/list', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Permission : Team member file access.\n * @function DropboxTeam#teamPropertiesTemplateUpdate\n * @deprecated\n * @arg {FilePropertiesUpdateTemplateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamPropertiesTemplateUpdate = function (arg) {\n return this.request('team/properties/template/update', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Retrieves reporting data about a team's user activity.\n * @function DropboxTeam#teamReportsGetActivity\n * @arg {TeamDateRange} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamReportsGetActivity = function (arg) {\n return this.request('team/reports/get_activity', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Retrieves reporting data about a team's linked devices.\n * @function DropboxTeam#teamReportsGetDevices\n * @arg {TeamDateRange} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamReportsGetDevices = function (arg) {\n return this.request('team/reports/get_devices', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Retrieves reporting data about a team's membership.\n * @function DropboxTeam#teamReportsGetMembership\n * @arg {TeamDateRange} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamReportsGetMembership = function (arg) {\n return this.request('team/reports/get_membership', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Retrieves reporting data about a team's storage usage.\n * @function DropboxTeam#teamReportsGetStorage\n * @arg {TeamDateRange} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamReportsGetStorage = function (arg) {\n return this.request('team/reports/get_storage', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Sets an archived team folder's status to active. Permission : Team member\n * file access.\n * @function DropboxTeam#teamTeamFolderActivate\n * @arg {TeamTeamFolderIdArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamTeamFolderActivate = function (arg) {\n return this.request('team/team_folder/activate', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Sets an active team folder's status to archived and removes all folder and\n * file members. Permission : Team member file access.\n * @function DropboxTeam#teamTeamFolderArchive\n * @arg {TeamTeamFolderArchiveArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamTeamFolderArchive = function (arg) {\n return this.request('team/team_folder/archive', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Returns the status of an asynchronous job for archiving a team folder.\n * Permission : Team member file access.\n * @function DropboxTeam#teamTeamFolderArchiveCheck\n * @arg {AsyncPollArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamTeamFolderArchiveCheck = function (arg) {\n return this.request('team/team_folder/archive/check', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Creates a new, active, team folder with no members. Permission : Team member\n * file access.\n * @function DropboxTeam#teamTeamFolderCreate\n * @arg {TeamTeamFolderCreateArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamTeamFolderCreate = function (arg) {\n return this.request('team/team_folder/create', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Retrieves metadata for team folders. Permission : Team member file access.\n * @function DropboxTeam#teamTeamFolderGetInfo\n * @arg {TeamTeamFolderIdListArg} arg - The request parameters.\n * @returns {Promise., Error.>}\n */\nroutes.teamTeamFolderGetInfo = function (arg) {\n return this.request('team/team_folder/get_info', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Lists all team folders. Permission : Team member file access.\n * @function DropboxTeam#teamTeamFolderList\n * @arg {TeamTeamFolderListArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamTeamFolderList = function (arg) {\n return this.request('team/team_folder/list', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Once a cursor has been retrieved from team_folder/list, use this to paginate\n * through all team folders. Permission : Team member file access.\n * @function DropboxTeam#teamTeamFolderListContinue\n * @arg {TeamTeamFolderListContinueArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamTeamFolderListContinue = function (arg) {\n return this.request('team/team_folder/list/continue', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Permanently deletes an archived team folder. Permission : Team member file\n * access.\n * @function DropboxTeam#teamTeamFolderPermanentlyDelete\n * @arg {TeamTeamFolderIdArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamTeamFolderPermanentlyDelete = function (arg) {\n return this.request('team/team_folder/permanently_delete', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Changes an active team folder's name. Permission : Team member file access.\n * @function DropboxTeam#teamTeamFolderRename\n * @arg {TeamTeamFolderRenameArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamTeamFolderRename = function (arg) {\n return this.request('team/team_folder/rename', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Updates the sync settings on a team folder or its contents. Use of this\n * endpoint requires that the team has team selective sync enabled.\n * @function DropboxTeam#teamTeamFolderUpdateSyncSettings\n * @arg {TeamTeamFolderUpdateSyncSettingsArg} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamTeamFolderUpdateSyncSettings = function (arg) {\n return this.request('team/team_folder/update_sync_settings', arg, 'team', 'api', 'rpc');\n};\n\n/**\n * Returns the member profile of the admin who generated the team access token\n * used to make the call.\n * @function DropboxTeam#teamTokenGetAuthenticatedAdmin\n * @arg {void} arg - The request parameters.\n * @returns {Promise.>}\n */\nroutes.teamTokenGetAuthenticatedAdmin = function (arg) {\n return this.request('team/token/get_authenticated_admin', arg, 'team', 'api', 'rpc');\n};\n\nexport { routes };\n","import { Dropbox } from '../dropbox';\nimport { DropboxBase } from '../dropbox-base';\nimport { routes } from '../routes-team';\n\n/**\n * @class DropboxTeam\n * @extends DropboxBase\n * @classdesc The Dropbox SDK class that provides access to team endpoints.\n * @arg {Object} options\n * @arg {String} [options.accessToken] - An access token for making authenticated\n * requests.\n * @arg {String} [options.clientId] - The client id for your app. Used to create\n * authentication URL.\n */\nexport class DropboxTeam extends DropboxBase {\n\n constructor(options) {\n super(options);\n Object.assign(this, routes);\n }\n\n /**\n * Returns an instance of Dropbox that can make calls to user api endpoints on\n * behalf of the passed user id, using the team access token.\n * @arg {String} userId - The user id to use the Dropbox class as\n * @returns {Dropbox} An instance of Dropbox used to make calls to user api\n * endpoints\n */\n actAsUser(userId) {\n return new Dropbox({\n accessToken: this.accessToken,\n clientId: this.clientId,\n selectUser: userId,\n });\n }\n}\n","const dropbox = require('./dropbox');\nconst dropboxTeam = require('./team/dropbox-team.js');\n\nmodule.exports = {\n Dropbox: dropbox.Dropbox,\n DropboxTeam: dropboxTeam.DropboxTeam,\n};\n"],"names":["routes","authTokenFromOauth1","arg","request","authTokenRevoke","contactsDeleteManualContacts","contactsDeleteManualContactsBatch","filePropertiesPropertiesAdd","filePropertiesPropertiesOverwrite","filePropertiesPropertiesRemove","filePropertiesPropertiesSearch","filePropertiesPropertiesSearchContinue","filePropertiesPropertiesUpdate","filePropertiesTemplatesAddForTeam","filePropertiesTemplatesAddForUser","filePropertiesTemplatesGetForTeam","filePropertiesTemplatesGetForUser","filePropertiesTemplatesListForTeam","filePropertiesTemplatesListForUser","filePropertiesTemplatesRemoveForTeam","filePropertiesTemplatesRemoveForUser","filePropertiesTemplatesUpdateForTeam","filePropertiesTemplatesUpdateForUser","fileRequestsCount","fileRequestsCreate","fileRequestsDelete","fileRequestsDeleteAllClosed","fileRequestsGet","fileRequestsListV2","fileRequestsList","fileRequestsListContinue","fileRequestsUpdate","filesAlphaGetMetadata","filesAlphaUpload","filesCopyV2","filesCopy","filesCopyBatchV2","filesCopyBatch","filesCopyBatchCheckV2","filesCopyBatchCheck","filesCopyReferenceGet","filesCopyReferenceSave","filesCreateFolderV2","filesCreateFolder","filesCreateFolderBatch","filesCreateFolderBatchCheck","filesDeleteV2","filesDelete","filesDeleteBatch","filesDeleteBatchCheck","filesDownload","filesDownloadZip","filesExport","filesGetMetadata","filesGetPreview","filesGetTemporaryLink","filesGetTemporaryUploadLink","filesGetThumbnail","filesGetThumbnailBatch","filesListFolder","filesListFolderContinue","filesListFolderGetLatestCursor","filesListFolderLongpoll","filesListRevisions","filesMoveV2","filesMove","filesMoveBatchV2","filesMoveBatch","filesMoveBatchCheckV2","filesMoveBatchCheck","filesPermanentlyDelete","filesPropertiesAdd","filesPropertiesOverwrite","filesPropertiesRemove","filesPropertiesTemplateGet","filesPropertiesTemplateList","filesPropertiesUpdate","filesRestore","filesSaveUrl","filesSaveUrlCheckJobStatus","filesSearch","filesUpload","filesUploadSessionAppendV2","filesUploadSessionAppend","filesUploadSessionFinish","filesUploadSessionFinishBatch","filesUploadSessionFinishBatchCheck","filesUploadSessionStart","paperDocsArchive","paperDocsCreate","paperDocsDownload","paperDocsFolderUsersList","paperDocsFolderUsersListContinue","paperDocsGetFolderInfo","paperDocsList","paperDocsListContinue","paperDocsPermanentlyDelete","paperDocsSharingPolicyGet","paperDocsSharingPolicySet","paperDocsUpdate","paperDocsUsersAdd","paperDocsUsersList","paperDocsUsersListContinue","paperDocsUsersRemove","sharingAddFileMember","sharingAddFolderMember","sharingChangeFileMemberAccess","sharingCheckJobStatus","sharingCheckRemoveMemberJobStatus","sharingCheckShareJobStatus","sharingCreateSharedLink","sharingCreateSharedLinkWithSettings","sharingGetFileMetadata","sharingGetFileMetadataBatch","sharingGetFolderMetadata","sharingGetSharedLinkFile","sharingGetSharedLinkMetadata","sharingGetSharedLinks","sharingListFileMembers","sharingListFileMembersBatch","sharingListFileMembersContinue","sharingListFolderMembers","sharingListFolderMembersContinue","sharingListFolders","sharingListFoldersContinue","sharingListMountableFolders","sharingListMountableFoldersContinue","sharingListReceivedFiles","sharingListReceivedFilesContinue","sharingListSharedLinks","sharingModifySharedLinkSettings","sharingMountFolder","sharingRelinquishFileMembership","sharingRelinquishFolderMembership","sharingRemoveFileMember","sharingRemoveFileMember2","sharingRemoveFolderMember","sharingRevokeSharedLink","sharingSetAccessInheritance","sharingShareFolder","sharingTransferFolder","sharingUnmountFolder","sharingUnshareFile","sharingUnshareFolder","sharingUpdateFileMember","sharingUpdateFolderMember","sharingUpdateFolderPolicy","teamLogGetEvents","teamLogGetEventsContinue","usersGetAccount","usersGetAccountBatch","usersGetCurrentAccount","usersGetSpaceUsage","RPC","UPLOAD","DOWNLOAD","getSafeUnicode","c","unicode","charCodeAt","toString","slice","isWindowOrWorker","WorkerGlobalScope","self","module","window","getBaseURL","host","httpHeaderSafeJson","args","JSON","stringify","replace","getDataFromConsumer","res","ok","text","blob","buffer","responseHandler","data","status","result","parse","headers","get","fileBlob","fileBinary","downloadRequest","fetch","downloadRequestWithFetch","path","auth","accessToken","options","Error","fetchOptions","selectUser","selectAdmin","pathRoot","then","parseBodyToType","clone","Promise","resolve","json","catch","uploadRequest","uploadRequestWithFetch","contents","base64","rpcRequest","rpcRequestWithFetch","body","authHeader","clientId","clientSecret","Buffer","Authorization","Object","assign","target","output","index","source","nextKey","undefined","TypeError","arguments","length","hasOwnProperty","Array","prototype","includes","defineProperty","searchElement","fromIndex","o","len","n","k","Math","max","abs","sameValueZero","x","y","isNaN","DropboxBase","warn","redirectUri","state","authType","getClientId","baseUrl","authUrl","code","getClientSecret","access_token","successCallback","errorCallback","redirectUrl","url","getAuthenticationUrl","removed","browser","open","onLoadError","event","setTimeout","close","onLoadStop","errorLabel","errorIndex","indexOf","tokenLabel","tokenIndex","tokenTypeIndex","substring","onExit","removeEventListener","addEventListener","style","getRpcRequest","getDownloadRequest","getUploadRequest","getAccessToken","newRpcRequest","newDownloadRequest","newUploadRequest","Dropbox","teamDevicesListMemberDevices","teamDevicesListMembersDevices","teamDevicesListTeamDevices","teamDevicesRevokeDeviceSession","teamDevicesRevokeDeviceSessionBatch","teamFeaturesGetValues","teamGetInfo","teamGroupsCreate","teamGroupsDelete","teamGroupsGetInfo","teamGroupsJobStatusGet","teamGroupsList","teamGroupsListContinue","teamGroupsMembersAdd","teamGroupsMembersList","teamGroupsMembersListContinue","teamGroupsMembersRemove","teamGroupsMembersSetAccessType","teamGroupsUpdate","teamLinkedAppsListMemberLinkedApps","teamLinkedAppsListMembersLinkedApps","teamLinkedAppsListTeamLinkedApps","teamLinkedAppsRevokeLinkedApp","teamLinkedAppsRevokeLinkedAppBatch","teamMemberSpaceLimitsExcludedUsersAdd","teamMemberSpaceLimitsExcludedUsersList","teamMemberSpaceLimitsExcludedUsersListContinue","teamMemberSpaceLimitsExcludedUsersRemove","teamMemberSpaceLimitsGetCustomQuota","teamMemberSpaceLimitsRemoveCustomQuota","teamMemberSpaceLimitsSetCustomQuota","teamMembersAdd","teamMembersAddJobStatusGet","teamMembersGetInfo","teamMembersList","teamMembersListContinue","teamMembersMoveFormerMemberFiles","teamMembersMoveFormerMemberFilesJobStatusCheck","teamMembersRecover","teamMembersRemove","teamMembersRemoveJobStatusGet","teamMembersSendWelcomeEmail","teamMembersSetAdminPermissions","teamMembersSetProfile","teamMembersSuspend","teamMembersUnsuspend","teamNamespacesList","teamNamespacesListContinue","teamPropertiesTemplateAdd","teamPropertiesTemplateGet","teamPropertiesTemplateList","teamPropertiesTemplateUpdate","teamReportsGetActivity","teamReportsGetDevices","teamReportsGetMembership","teamReportsGetStorage","teamTeamFolderActivate","teamTeamFolderArchive","teamTeamFolderArchiveCheck","teamTeamFolderCreate","teamTeamFolderGetInfo","teamTeamFolderList","teamTeamFolderListContinue","teamTeamFolderPermanentlyDelete","teamTeamFolderRename","teamTeamFolderUpdateSyncSettings","teamTokenGetAuthenticatedAdmin","DropboxTeam","userId","dropbox","dropboxTeam"],"mappings":";;;;;;AAAA;AACA,IAAIA,SAAS,EAAb;;;;;;;;AAQAA,OAAOC,mBAAP,GAA6B,UAAUC,GAAV,EAAe;SACnC,KAAKC,OAAL,CAAa,wBAAb,EAAuCD,GAAvC,EAA4C,KAA5C,EAAmD,KAAnD,EAA0D,KAA1D,CAAP;CADF;;;;;;;;AAUAF,OAAOI,eAAP,GAAyB,UAAUF,GAAV,EAAe;SAC/B,KAAKC,OAAL,CAAa,mBAAb,EAAkCD,GAAlC,EAAuC,MAAvC,EAA+C,KAA/C,EAAsD,KAAtD,CAAP;CADF;;;;;;;;;AAWAF,OAAOK,4BAAP,GAAsC,UAAUH,GAAV,EAAe;SAC5C,KAAKC,OAAL,CAAa,iCAAb,EAAgDD,GAAhD,EAAqD,MAArD,EAA6D,KAA7D,EAAoE,KAApE,CAAP;CADF;;;;;;;;AAUAF,OAAOM,iCAAP,GAA2C,UAAUJ,GAAV,EAAe;SACjD,KAAKC,OAAL,CAAa,uCAAb,EAAsDD,GAAtD,EAA2D,MAA3D,EAAmE,KAAnE,EAA0E,KAA1E,CAAP;CADF;;;;;;;;;AAWAF,OAAOO,2BAAP,GAAqC,UAAUL,GAAV,EAAe;SAC3C,KAAKC,OAAL,CAAa,gCAAb,EAA+CD,GAA/C,EAAoD,MAApD,EAA4D,KAA5D,EAAmE,KAAnE,CAAP;CADF;;;;;;;;;;;;AAcAF,OAAOQ,iCAAP,GAA2C,UAAUN,GAAV,EAAe;SACjD,KAAKC,OAAL,CAAa,sCAAb,EAAqDD,GAArD,EAA0D,MAA1D,EA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A0C,UAAUnW,GAAV,EAAe;SAChD,KAAKC,OAAL,CAAa,uCAAb,EAAsDD,GAAtD,EAA2D,MAA3D,EAAmE,KAAnE,EAA0E,KAA1E,CAAP;CADF;;;;;;;;;AAWAF,SAAOsW,8BAAP,GAAwC,UAAUpW,GAAV,EAAe;SAC9C,KAAKC,OAAL,CAAa,oCAAb,EAAmDD,GAAnD,EAAwD,MAAxD,EAAgE,KAAhE,EAAuE,KAAvE,CAAP;CADF,CAIA;;ACjvBA;;;;;;;;;;AAUA,IAAaqW,WAAb;;;uBAEcpK,OAAZ,EAAqB;;;yHACbA,OADa;;WAEZ0B,MAAP,QAAoB7N,QAApB;;;;;;;;;;;;;;;8BAUQwW,MAdZ,EAcoB;aACT,IAAIrE,OAAJ,CAAY;qBACJ,KAAKjG,WADD;kBAEP,KAAKsB,QAFE;oBAGLgJ;OAHP,CAAP;;;;EAf6B/G,WAAjC;;;;;;;;ACXA,UAAiB;WACNgH,QAAQtE,OADF;eAEFuE,YAAYH;CAF3B;;;;"} \ No newline at end of file diff --git a/bundles/Dropbox-sdk.min.js b/bundles/Dropbox-sdk.min.js deleted file mode 100644 index 26f13f1..0000000 --- a/bundles/Dropbox-sdk.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Dropbox=t()}(this,function(){"use strict";function e(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope||"undefined"==typeof module||"undefined"!=typeof window}function t(e){return"https://"+e+".dropboxapi.com/2/"}function r(e){return JSON.stringify(e).replace(/[\u007f-\uffff]/g,function(e){return"\\u"+("000"+e.charCodeAt(0).toString(16)).slice(-4)})}function n(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}var i={};i.authTokenFromOauth1=function(e){return this.request("auth/token/from_oauth1",e,"app","api","rpc")},i.authTokenRevoke=function(e){return this.request("auth/token/revoke",e,"user","api","rpc")},i.contactsDeleteManualContacts=function(e){return this.request("contacts/delete_manual_contacts",e,"user","api","rpc")},i.contactsDeleteManualContactsBatch=function(e){return this.request("contacts/delete_manual_contacts_batch",e,"user","api","rpc")},i.filePropertiesPropertiesAdd=function(e){return this.request("file_properties/properties/add",e,"user","api","rpc")},i.filePropertiesPropertiesOverwrite=function(e){return this.request("file_properties/properties/overwrite",e,"user","api","rpc")},i.filePropertiesPropertiesRemove=function(e){return this.request("file_properties/properties/remove",e,"user","api","rpc")},i.filePropertiesPropertiesSearch=function(e){return this.request("file_properties/properties/search",e,"user","api","rpc")},i.filePropertiesPropertiesSearchContinue=function(e){return this.request("file_properties/properties/search/continue",e,"user","api","rpc")},i.filePropertiesPropertiesUpdate=function(e){return this.request("file_properties/properties/update",e,"user","api","rpc")},i.filePropertiesTemplatesAddForTeam=function(e){return this.request("file_properties/templates/add_for_team",e,"team","api","rpc")},i.filePropertiesTemplatesAddForUser=function(e){return this.request("file_properties/templates/add_for_user",e,"user","api","rpc")},i.filePropertiesTemplatesGetForTeam=function(e){return this.request("file_properties/templates/get_for_team",e,"team","api","rpc")},i.filePropertiesTemplatesGetForUser=function(e){return this.request("file_properties/templates/get_for_user",e,"user","api","rpc")},i.filePropertiesTemplatesListForTeam=function(e){return this.request("file_properties/templates/list_for_team",e,"team","api","rpc")},i.filePropertiesTemplatesListForUser=function(e){return this.request("file_properties/templates/list_for_user",e,"user","api","rpc")},i.filePropertiesTemplatesRemoveForTeam=function(e){return this.request("file_properties/templates/remove_for_team",e,"team","api","rpc")},i.filePropertiesTemplatesRemoveForUser=function(e){return this.request("file_properties/templates/remove_for_user",e,"user","api","rpc")},i.filePropertiesTemplatesUpdateForTeam=function(e){return this.request("file_properties/templates/update_for_team",e,"team","api","rpc")},i.filePropertiesTemplatesUpdateForUser=function(e){return this.request("file_properties/templates/update_for_user",e,"user","api","rpc")},i.fileRequestsCount=function(e){return this.request("file_requests/count",e,"user","api","rpc")},i.fileRequestsCreate=function(e){return this.request("file_requests/create",e,"user","api","rpc")},i.fileRequestsDelete=function(e){return this.request("file_requests/delete",e,"user","api","rpc")},i.fileRequestsDeleteAllClosed=function(e){return this.request("file_requests/delete_all_closed",e,"user","api","rpc")},i.fileRequestsGet=function(e){return this.request("file_requests/get",e,"user","api","rpc")},i.fileRequestsListV2=function(e){return this.request("file_requests/list_v2",e,"user","api","rpc")},i.fileRequestsList=function(e){return this.request("file_requests/list",e,"user","api","rpc")},i.fileRequestsListContinue=function(e){return this.request("file_requests/list/continue",e,"user","api","rpc")},i.fileRequestsUpdate=function(e){return this.request("file_requests/update",e,"user","api","rpc")},i.filesAlphaGetMetadata=function(e){return this.request("files/alpha/get_metadata",e,"user","api","rpc")},i.filesAlphaUpload=function(e){return this.request("files/alpha/upload",e,"user","content","upload")},i.filesCopyV2=function(e){return this.request("files/copy_v2",e,"user","api","rpc")},i.filesCopy=function(e){return this.request("files/copy",e,"user","api","rpc")},i.filesCopyBatchV2=function(e){return this.request("files/copy_batch_v2",e,"user","api","rpc")},i.filesCopyBatch=function(e){return this.request("files/copy_batch",e,"user","api","rpc")},i.filesCopyBatchCheckV2=function(e){return this.request("files/copy_batch/check_v2",e,"user","api","rpc")},i.filesCopyBatchCheck=function(e){return this.request("files/copy_batch/check",e,"user","api","rpc")},i.filesCopyReferenceGet=function(e){return this.request("files/copy_reference/get",e,"user","api","rpc")},i.filesCopyReferenceSave=function(e){return this.request("files/copy_reference/save",e,"user","api","rpc")},i.filesCreateFolderV2=function(e){return this.request("files/create_folder_v2",e,"user","api","rpc")},i.filesCreateFolder=function(e){return this.request("files/create_folder",e,"user","api","rpc")},i.filesCreateFolderBatch=function(e){return this.request("files/create_folder_batch",e,"user","api","rpc")},i.filesCreateFolderBatchCheck=function(e){return this.request("files/create_folder_batch/check",e,"user","api","rpc")},i.filesDeleteV2=function(e){return this.request("files/delete_v2",e,"user","api","rpc")},i.filesDelete=function(e){return this.request("files/delete",e,"user","api","rpc")},i.filesDeleteBatch=function(e){return this.request("files/delete_batch",e,"user","api","rpc")},i.filesDeleteBatchCheck=function(e){return this.request("files/delete_batch/check",e,"user","api","rpc")},i.filesDownload=function(e){return this.request("files/download",e,"user","content","download")},i.filesDownloadZip=function(e){return this.request("files/download_zip",e,"user","content","download")},i.filesExport=function(e){return this.request("files/export",e,"user","content","download")},i.filesGetMetadata=function(e){return this.request("files/get_metadata",e,"user","api","rpc")},i.filesGetPreview=function(e){return this.request("files/get_preview",e,"user","content","download")},i.filesGetTemporaryLink=function(e){return this.request("files/get_temporary_link",e,"user","api","rpc")},i.filesGetTemporaryUploadLink=function(e){return this.request("files/get_temporary_upload_link",e,"user","api","rpc")},i.filesGetThumbnail=function(e){return this.request("files/get_thumbnail",e,"user","content","download")},i.filesGetThumbnailBatch=function(e){return this.request("files/get_thumbnail_batch",e,"user","content","rpc")},i.filesListFolder=function(e){return this.request("files/list_folder",e,"user","api","rpc")},i.filesListFolderContinue=function(e){return this.request("files/list_folder/continue",e,"user","api","rpc")},i.filesListFolderGetLatestCursor=function(e){return this.request("files/list_folder/get_latest_cursor",e,"user","api","rpc")},i.filesListFolderLongpoll=function(e){return this.request("files/list_folder/longpoll",e,"noauth","notify","rpc")},i.filesListRevisions=function(e){return this.request("files/list_revisions",e,"user","api","rpc")},i.filesMoveV2=function(e){return this.request("files/move_v2",e,"user","api","rpc")},i.filesMove=function(e){return this.request("files/move",e,"user","api","rpc")},i.filesMoveBatchV2=function(e){return this.request("files/move_batch_v2",e,"user","api","rpc")},i.filesMoveBatch=function(e){return this.request("files/move_batch",e,"user","api","rpc")},i.filesMoveBatchCheckV2=function(e){return this.request("files/move_batch/check_v2",e,"user","api","rpc")},i.filesMoveBatchCheck=function(e){return this.request("files/move_batch/check",e,"user","api","rpc")},i.filesPermanentlyDelete=function(e){return this.request("files/permanently_delete",e,"user","api","rpc")},i.filesPropertiesAdd=function(e){return this.request("files/properties/add",e,"user","api","rpc")},i.filesPropertiesOverwrite=function(e){return this.request("files/properties/overwrite",e,"user","api","rpc")},i.filesPropertiesRemove=function(e){return this.request("files/properties/remove",e,"user","api","rpc")},i.filesPropertiesTemplateGet=function(e){return this.request("files/properties/template/get",e,"user","api","rpc")},i.filesPropertiesTemplateList=function(e){return this.request("files/properties/template/list",e,"user","api","rpc")},i.filesPropertiesUpdate=function(e){return this.request("files/properties/update",e,"user","api","rpc")},i.filesRestore=function(e){return this.request("files/restore",e,"user","api","rpc")},i.filesSaveUrl=function(e){return this.request("files/save_url",e,"user","api","rpc")},i.filesSaveUrlCheckJobStatus=function(e){return this.request("files/save_url/check_job_status",e,"user","api","rpc")},i.filesSearch=function(e){return this.request("files/search",e,"user","api","rpc")},i.filesUpload=function(e){return this.request("files/upload",e,"user","content","upload")},i.filesUploadSessionAppendV2=function(e){return this.request("files/upload_session/append_v2",e,"user","content","upload")},i.filesUploadSessionAppend=function(e){return this.request("files/upload_session/append",e,"user","content","upload")},i.filesUploadSessionFinish=function(e){return this.request("files/upload_session/finish",e,"user","content","upload")},i.filesUploadSessionFinishBatch=function(e){return this.request("files/upload_session/finish_batch",e,"user","api","rpc")},i.filesUploadSessionFinishBatchCheck=function(e){return this.request("files/upload_session/finish_batch/check",e,"user","api","rpc")},i.filesUploadSessionStart=function(e){return this.request("files/upload_session/start",e,"user","content","upload")},i.paperDocsArchive=function(e){return this.request("paper/docs/archive",e,"user","api","rpc")},i.paperDocsCreate=function(e){return this.request("paper/docs/create",e,"user","api","upload")},i.paperDocsDownload=function(e){return this.request("paper/docs/download",e,"user","api","download")},i.paperDocsFolderUsersList=function(e){return this.request("paper/docs/folder_users/list",e,"user","api","rpc")},i.paperDocsFolderUsersListContinue=function(e){return this.request("paper/docs/folder_users/list/continue",e,"user","api","rpc")},i.paperDocsGetFolderInfo=function(e){return this.request("paper/docs/get_folder_info",e,"user","api","rpc")},i.paperDocsList=function(e){return this.request("paper/docs/list",e,"user","api","rpc")},i.paperDocsListContinue=function(e){return this.request("paper/docs/list/continue",e,"user","api","rpc")},i.paperDocsPermanentlyDelete=function(e){return this.request("paper/docs/permanently_delete",e,"user","api","rpc")},i.paperDocsSharingPolicyGet=function(e){return this.request("paper/docs/sharing_policy/get",e,"user","api","rpc")},i.paperDocsSharingPolicySet=function(e){return this.request("paper/docs/sharing_policy/set",e,"user","api","rpc")},i.paperDocsUpdate=function(e){return this.request("paper/docs/update",e,"user","api","upload")},i.paperDocsUsersAdd=function(e){return this.request("paper/docs/users/add",e,"user","api","rpc")},i.paperDocsUsersList=function(e){return this.request("paper/docs/users/list",e,"user","api","rpc")},i.paperDocsUsersListContinue=function(e){return this.request("paper/docs/users/list/continue",e,"user","api","rpc")},i.paperDocsUsersRemove=function(e){return this.request("paper/docs/users/remove",e,"user","api","rpc")},i.sharingAddFileMember=function(e){return this.request("sharing/add_file_member",e,"user","api","rpc")},i.sharingAddFolderMember=function(e){return this.request("sharing/add_folder_member",e,"user","api","rpc")},i.sharingChangeFileMemberAccess=function(e){return this.request("sharing/change_file_member_access",e,"user","api","rpc")},i.sharingCheckJobStatus=function(e){return this.request("sharing/check_job_status",e,"user","api","rpc")},i.sharingCheckRemoveMemberJobStatus=function(e){return this.request("sharing/check_remove_member_job_status",e,"user","api","rpc")},i.sharingCheckShareJobStatus=function(e){return this.request("sharing/check_share_job_status",e,"user","api","rpc")},i.sharingCreateSharedLink=function(e){return this.request("sharing/create_shared_link",e,"user","api","rpc")},i.sharingCreateSharedLinkWithSettings=function(e){return this.request("sharing/create_shared_link_with_settings",e,"user","api","rpc")},i.sharingGetFileMetadata=function(e){return this.request("sharing/get_file_metadata",e,"user","api","rpc")},i.sharingGetFileMetadataBatch=function(e){return this.request("sharing/get_file_metadata/batch",e,"user","api","rpc")},i.sharingGetFolderMetadata=function(e){return this.request("sharing/get_folder_metadata",e,"user","api","rpc")},i.sharingGetSharedLinkFile=function(e){return this.request("sharing/get_shared_link_file",e,"user","content","download")},i.sharingGetSharedLinkMetadata=function(e){return this.request("sharing/get_shared_link_metadata",e,"user","api","rpc")},i.sharingGetSharedLinks=function(e){return this.request("sharing/get_shared_links",e,"user","api","rpc")},i.sharingListFileMembers=function(e){return this.request("sharing/list_file_members",e,"user","api","rpc")},i.sharingListFileMembersBatch=function(e){return this.request("sharing/list_file_members/batch",e,"user","api","rpc")},i.sharingListFileMembersContinue=function(e){return this.request("sharing/list_file_members/continue",e,"user","api","rpc")},i.sharingListFolderMembers=function(e){return this.request("sharing/list_folder_members",e,"user","api","rpc")},i.sharingListFolderMembersContinue=function(e){return this.request("sharing/list_folder_members/continue",e,"user","api","rpc")},i.sharingListFolders=function(e){return this.request("sharing/list_folders",e,"user","api","rpc")},i.sharingListFoldersContinue=function(e){return this.request("sharing/list_folders/continue",e,"user","api","rpc")},i.sharingListMountableFolders=function(e){return this.request("sharing/list_mountable_folders",e,"user","api","rpc")},i.sharingListMountableFoldersContinue=function(e){return this.request("sharing/list_mountable_folders/continue",e,"user","api","rpc")},i.sharingListReceivedFiles=function(e){return this.request("sharing/list_received_files",e,"user","api","rpc")},i.sharingListReceivedFilesContinue=function(e){return this.request("sharing/list_received_files/continue",e,"user","api","rpc")},i.sharingListSharedLinks=function(e){return this.request("sharing/list_shared_links",e,"user","api","rpc")},i.sharingModifySharedLinkSettings=function(e){return this.request("sharing/modify_shared_link_settings",e,"user","api","rpc")},i.sharingMountFolder=function(e){return this.request("sharing/mount_folder",e,"user","api","rpc")},i.sharingRelinquishFileMembership=function(e){return this.request("sharing/relinquish_file_membership",e,"user","api","rpc")},i.sharingRelinquishFolderMembership=function(e){return this.request("sharing/relinquish_folder_membership",e,"user","api","rpc")},i.sharingRemoveFileMember=function(e){return this.request("sharing/remove_file_member",e,"user","api","rpc")},i.sharingRemoveFileMember2=function(e){return this.request("sharing/remove_file_member_2",e,"user","api","rpc")},i.sharingRemoveFolderMember=function(e){return this.request("sharing/remove_folder_member",e,"user","api","rpc")},i.sharingRevokeSharedLink=function(e){return this.request("sharing/revoke_shared_link",e,"user","api","rpc")},i.sharingSetAccessInheritance=function(e){return this.request("sharing/set_access_inheritance",e,"user","api","rpc")},i.sharingShareFolder=function(e){return this.request("sharing/share_folder",e,"user","api","rpc")},i.sharingTransferFolder=function(e){return this.request("sharing/transfer_folder",e,"user","api","rpc")},i.sharingUnmountFolder=function(e){return this.request("sharing/unmount_folder",e,"user","api","rpc")},i.sharingUnshareFile=function(e){return this.request("sharing/unshare_file",e,"user","api","rpc")},i.sharingUnshareFolder=function(e){return this.request("sharing/unshare_folder",e,"user","api","rpc")},i.sharingUpdateFileMember=function(e){return this.request("sharing/update_file_member",e,"user","api","rpc")},i.sharingUpdateFolderMember=function(e){return this.request("sharing/update_folder_member",e,"user","api","rpc")},i.sharingUpdateFolderPolicy=function(e){return this.request("sharing/update_folder_policy",e,"user","api","rpc")},i.teamLogGetEvents=function(e){return this.request("team_log/get_events",e,"team","api","rpc")},i.teamLogGetEventsContinue=function(e){return this.request("team_log/get_events/continue",e,"team","api","rpc")},i.usersGetAccount=function(e){return this.request("users/get_account",e,"user","api","rpc")},i.usersGetAccountBatch=function(e){return this.request("users/get_account_batch",e,"user","api","rpc")},i.usersGetCurrentAccount=function(e){return this.request("users/get_current_account",e,"user","api","rpc")},i.usersGetSpaceUsage=function(e){return this.request("users/get_space_usage",e,"user","api","rpc")};for(var s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(){function e(e,t){for(var r=0;t.length>r;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},c=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,s=void 0;try{for(var o,u=e[Symbol.iterator]();!(n=(o=u.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,s=e}finally{try{!n&&u.return&&u.return()}finally{if(i)throw s}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(e){return 3*e.length/4-n(e)},f=function(e){var t,r,i,s,o,u=e.length;s=n(e),o=new d(3*u/4-s),r=s>0?u-4:u;var a=0;for(t=0;r>t;t+=4)i=m[e.charCodeAt(t)]<<18|m[e.charCodeAt(t+1)]<<12|m[e.charCodeAt(t+2)]<<6|m[e.charCodeAt(t+3)],o[a++]=i>>16&255,o[a++]=i>>8&255,o[a++]=255&i;return 2===s?(i=m[e.charCodeAt(t)]<<2|m[e.charCodeAt(t+1)]>>4,o[a++]=255&i):1===s&&(i=m[e.charCodeAt(t)]<<10|m[e.charCodeAt(t+1)]<<4|m[e.charCodeAt(t+2)]>>2,o[a++]=i>>8&255,o[a++]=255&i),o},h=function(e){for(var t,r=e.length,n=r%3,i="",s=[],o=0,u=r-n;u>o;o+=16383)s.push(function(e,t,r){for(var n=[],i=t;r>i;i+=3)n.push(function(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}((e[i]<<16)+(e[i+1]<<8)+e[i+2]));return n.join("")}(e,o,o+16383>u?u:o+16383));return 1===n?(i+=l[(t=e[r-1])>>2],i+=l[t<<4&63],i+="=="):2===n&&(i+=l[(t=(e[r-2]<<8)+e[r-1])>>10],i+=l[t>>4&63],i+=l[t<<2&63],i+="="),s.push(i),s.join("")},l=[],m=[],d="undefined"!=typeof Uint8Array?Uint8Array:Array,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=0;64>_;++_)l[_]=g[_],m[g.charCodeAt(_)]=_;m[45]=62,m[95]=63;var b={byteLength:p,toByteArray:f,fromByteArray:h},v={read:function(e,t,r,n,i){var s,o,u=8*i-n-1,a=(1<>1,p=-7,f=r?i-1:0,h=r?-1:1,l=e[t+f];for(f+=h,s=l&(1<<-p)-1,l>>=-p,p+=u;p>0;s=256*s+e[t+f],f+=h,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=256*o+e[t+f],f+=h,p-=8);if(0===s)s=1-c;else{if(s===a)return o?NaN:1/0*(l?-1:1);o+=Math.pow(2,n),s-=c}return(l?-1:1)*o*Math.pow(2,s-n)},write:function(e,t,r,n,i,s){var o,u,a,c=8*s-i-1,p=(1<>1,h=23===i?5.960464477539062e-8:0,l=n?0:s-1,m=n?1:-1,d=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,o=p):(o=Math.floor(Math.log(t)/Math.LN2),1>t*(a=Math.pow(2,-o))&&(o--,a*=2),2>(t+=1>o+f?h*Math.pow(2,1-f):h/a)*a||(o++,a/=2),p>o+f?1>o+f?(u=t*Math.pow(2,f-1)*Math.pow(2,i),o=0):(u=(t*a-1)*Math.pow(2,i),o+=f):(u=0,o=p));i>=8;e[r+l]=255&u,l+=m,u/=256,i-=8);for(o=o<0;e[r+l]=255&o,l+=m,o/=256,c-=8);e[r+l-m]|=128*d}},y=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e,t){function r(e){if(e>C)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=n.prototype,t}function n(e,t,r){if("number"==typeof e){if("string"==typeof t)throw Error("If encoding is specified then the first argument must be a string");return o(e)}return i(e,t,r)}function i(e,t,i){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return L(e)?function(e,t,r){if(0>t||t>e.byteLength)throw new RangeError("'offset' is out of bounds");if(t+(r||0)>e.byteLength)throw new RangeError("'length' is out of bounds");var i;i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);return i.__proto__=n.prototype,i}(e,t,i):"string"==typeof e?function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!n.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var i=0|c(e,t),s=r(i),o=s.write(e,t);o!==i&&(s=s.slice(0,o));return s}(e,t):function(e){if(n.isBuffer(e)){var t=0|a(e.length),i=r(t);return 0===i.length?i:(e.copy(i,0,0,t),i)}if(e){if(S(e)||"length"in e)return"number"!=typeof e.length||E(e.length)?r(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(0>e)throw new RangeError('"size" argument must not be negative')}function o(e){return s(e),r(0>e?0:0|a(e))}function u(e){for(var t=0>e.length?0:0|a(e.length),n=r(t),i=0;t>i;i+=1)n[i]=255&e[i];return n}function a(e){if(e>=C)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C.toString(16)+" bytes");return 0|e}function c(e,t){if(n.isBuffer(e))return e.length;if(S(e)||L(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return w(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(e).length;default:if(i)return w(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function f(e,t,r,i,s){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:-2147483648>r&&(r=-2147483648),r=+r,E(r)&&(r=s?0:e.length-1),0>r&&(r=e.length+r),e.length>r){if(0>r){if(!s)return-1;r=0}}else{if(s)return-1;r=e.length-1}if("string"==typeof t&&(t=n.from(t,i)),n.isBuffer(t))return 0===t.length?-1:h(e,t,r,i,s);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):h(e,[t],r,i,s);throw new TypeError("val must be string, number or Buffer")}function h(e,t,r,n,i){function s(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,u=e.length,a=t.length;if(void 0!==n&&("ucs2"===(n=(n+"").toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>e.length||2>t.length)return-1;o=2,u/=2,a/=2,r/=2}var c;if(i){var p=-1;for(c=r;u>c;c++)if(s(e,c)===s(t,-1===p?0:c-p)){if(-1===p&&(p=c),c-p+1===a)return p*o}else-1!==p&&(c-=c-p),p=-1}else for(r+a>u&&(r=u-a),c=r;c>=0;c--){for(var f=!0,h=0;a>h;h++)if(s(e,c+h)!==s(t,h)){f=!1;break}if(f)return c}return-1}function l(e,t,r,n){return A(function(e){for(var t=[],r=0;e.length>r;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function m(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;r>i;){var s=e[i],o=null,u=s>239?4:s>223?3:s>191?2:1;if(r>=i+u){var a,c,p,f;switch(u){case 1:128>s&&(o=s);break;case 2:128==(192&(a=e[i+1]))&&(f=(31&s)<<6|63&a)>127&&(o=f);break;case 3:c=e[i+2],128==(192&(a=e[i+1]))&&128==(192&c)&&(f=(15&s)<<12|(63&a)<<6|63&c)>2047&&(55296>f||f>57343)&&(o=f);break;case 4:c=e[i+2],p=e[i+3],128==(192&(a=e[i+1]))&&128==(192&c)&&128==(192&p)&&(f=(15&s)<<18|(63&a)<<12|(63&c)<<6|63&p)>65535&&1114112>f&&(o=f)}}null===o?(o=65533,u=1):o>65535&&(n.push((o-=65536)>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=u}return function(e){var t=e.length;if(R>=t)return String.fromCharCode.apply(String,e);var r="",n=0;for(;t>n;)r+=String.fromCharCode.apply(String,e.slice(n,n+=R));return r}(n)}function d(e,t,r){if(e%1!=0||0>e)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function g(e,t,r,i,s,o){if(!n.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||o>t)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function _(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function y(e,t,r,n,i){return t=+t,r>>>=0,i||_(e,0,r,4),v.write(e,t,r,n,23,4),r+4}function q(e,t,r,n,i){return t=+t,r>>>=0,i||_(e,0,r,8),v.write(e,t,r,n,52,8),r+8}function w(e,t){t=t||1/0;for(var r,n=e.length,i=null,s=[],o=0;n>o;++o){if((r=e.charCodeAt(o))>55295&&57344>r){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(56320>r){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,128>r){if(0>(t-=1))break;s.push(r)}else if(2048>r){if(0>(t-=2))break;s.push(r>>6|192,63&r|128)}else if(65536>r){if(0>(t-=3))break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(r>=1114112)throw Error("Invalid code point");if(0>(t-=4))break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function k(e){return b.toByteArray(function(e){if(2>(e=e.trim().replace(U,"")).length)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function A(e,t,r,n){for(var i=0;n>i&&(i+r0&&void 0!==t?"string"==typeof n?r(e).fill(t,n):r(e).fill(t):r(e)}(e,t,n)},n.allocUnsafe=function(e){return o(e)},n.allocUnsafeSlow=function(e){return o(e)},n.isBuffer=function(e){return null!=e&&!0===e._isBuffer},n.compare=function(e,t){if(!n.isBuffer(e)||!n.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,i=t.length,s=0,o=Math.min(r,i);o>s;++s)if(e[s]!==t[s]){r=e[s],i=t[s];break}return i>r?-1:r>i?1:0},n.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return n.alloc(0);var r;if(void 0===t)for(t=0,r=0;e.length>r;++r)t+=e[r].length;var i=n.allocUnsafe(t),s=0;for(r=0;e.length>r;++r){var o=e[r];if(!n.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,s),s+=o.length}return i},n.byteLength=c,n.prototype._isBuffer=!0,n.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;e>t;t+=2)p(this,t,t+1);return this},n.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;e>t;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},n.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;e>t;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},n.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?m(this,0,e):function(e,t,r){var n=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if(r>>>=0,(t>>>=0)>=r)return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;t&&t>=0||(t=0),(!r||0>r||r>n)&&(r=n);for(var i="",s=t;r>s;++s)i+=function(e){return 16>e?"0"+e.toString(16):e.toString(16)}(e[s]);return i}(this,t,r);case"utf8":case"utf-8":return m(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;r>i;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;r>i;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return function(e,t,r){return b.fromByteArray(0===t&&r===e.length?e:e.slice(t,r))}(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",s=0;n.length>s;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},n.prototype.equals=function(e){if(!n.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===n.compare(this,e)},n.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},n.prototype.compare=function(e,t,r,i,s){if(!n.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===s&&(s=this.length),0>t||r>e.length||0>i||s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=r)return 0;if(i>=s)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,s>>>=0,this===e)return 0;for(var o=s-i,u=r-t,a=Math.min(o,u),c=this.slice(i,s),p=e.slice(t,r),f=0;a>f;++f)if(c[f]!==p[f]){o=c[f],u=p[f];break}return u>o?-1:o>u?1:0},n.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},n.prototype.indexOf=function(e,t,r){return f(this,e,t,r,!0)},n.prototype.lastIndexOf=function(e,t,r){return f(this,e,t,r,!1)},n.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(0>r||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return function(e,t,r,n){var i=e.length-(r=+r||0);n?(n=+n)>i&&(n=i):n=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;n>o;++o){var u=parseInt(t.substr(2*o,2),16);if(E(u))return o;e[r+o]=u}return o}(this,e,t,r);case"utf8":case"utf-8":return function(e,t,r,n){return A(w(t,e.length-r),e,r,n)}(this,e,t,r);case"ascii":return l(this,e,t,r);case"latin1":case"binary":return function(e,t,r,n){return l(e,t,r,n)}(this,e,t,r);case"base64":return function(e,t,r,n){return A(k(t),e,r,n)}(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r,n){return A(function(e,t){for(var r,n,i=[],s=0;e.length>s&&(t-=2)>=0;++s)r=e.charCodeAt(s),n=r>>8,i.push(r%256),i.push(n);return i}(t,e.length-r),e,r,n)}(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;n.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,0>e?0>(e+=r)&&(e=0):e>r&&(e=r),0>t?0>(t+=r)&&(t=0):t>r&&(t=r),e>t&&(t=e);var i=this.subarray(e,t);return i.__proto__=n.prototype,i},n.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||d(e,t,this.length);for(var n=this[e],i=1,s=0;++s>>=0,t>>>=0,r||d(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},n.prototype.readUInt8=function(e,t){return e>>>=0,t||d(e,1,this.length),this[e]},n.prototype.readUInt16LE=function(e,t){return e>>>=0,t||d(e,2,this.length),this[e]|this[e+1]<<8},n.prototype.readUInt16BE=function(e,t){return e>>>=0,t||d(e,2,this.length),this[e]<<8|this[e+1]},n.prototype.readUInt32LE=function(e,t){return e>>>=0,t||d(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},n.prototype.readUInt32BE=function(e,t){return e>>>=0,t||d(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},n.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||d(e,t,this.length);for(var n=this[e],i=1,s=0;++sn||(n-=Math.pow(2,8*t)),n},n.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||d(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return(i*=128)>s||(s-=Math.pow(2,8*t)),s},n.prototype.readInt8=function(e,t){return e>>>=0,t||d(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},n.prototype.readInt16LE=function(e,t){e>>>=0,t||d(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt16BE=function(e,t){e>>>=0,t||d(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt32LE=function(e,t){return e>>>=0,t||d(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},n.prototype.readInt32BE=function(e,t){return e>>>=0,t||d(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},n.prototype.readFloatLE=function(e,t){return e>>>=0,t||d(e,4,this.length),v.read(this,e,!0,23,4)},n.prototype.readFloatBE=function(e,t){return e>>>=0,t||d(e,4,this.length),v.read(this,e,!1,23,4)},n.prototype.readDoubleLE=function(e,t){return e>>>=0,t||d(e,8,this.length),v.read(this,e,!0,52,8)},n.prototype.readDoubleBE=function(e,t){return e>>>=0,t||d(e,8,this.length),v.read(this,e,!1,52,8)},n.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){g(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,!n){g(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},n.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||g(this,e,t,1,255,0),this[t]=255&e,t+1},n.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||g(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||g(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||g(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},n.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||g(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},n.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);g(this,e,t,r,i-1,-i)}var s=0,o=1,u=0;for(this[t]=255&e;++se&&0===u&&0!==this[t+s-1]&&(u=1),this[t+s]=(e/o>>0)-u&255;return t+r},n.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);g(this,e,t,r,i-1,-i)}var s=r-1,o=1,u=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)0>e&&0===u&&0!==this[t+s+1]&&(u=1),this[t+s]=(e/o>>0)-u&255;return t+r},n.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||g(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},n.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||g(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||g(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||g(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},n.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||g(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},n.prototype.writeFloatLE=function(e,t,r){return y(this,e,t,!0,r)},n.prototype.writeFloatBE=function(e,t,r){return y(this,e,t,!1,r)},n.prototype.writeDoubleLE=function(e,t,r){return q(this,e,t,!0,r)},n.prototype.writeDoubleBE=function(e,t,r){return q(this,e,t,!1,r)},n.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),e.length>t||(t=e.length),t||(t=0),n>0&&r>n&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),n-r>e.length-t&&(n=e.length-t+r);var i,s=n-r;if(this===e&&t>r&&n>t)for(i=s-1;i>=0;--i)e[i+t]=this[i+r];else if(1e3>s)for(i=0;s>i;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),t);return s},n.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),1===e.length){var s=e.charCodeAt(0);256>s&&(e=s)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!n.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(0>t||t>this.length||r>this.length)throw new RangeError("Out of range index");if(t>=r)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;r>o;++o)this[o]=e;else{var u=n.isBuffer(e)?e:new n(e,i),a=u.length;for(o=0;r-t>o;++o)this[o+t]=u[o%a]}return this};var U=/[^+/0-9A-Za-z-_]/g}).Buffer;"function"!=typeof Object.assign&&(Object.assign=function(e){var t,r,n,i;if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(t=Object(e),r=1;arguments.length>r;r++)if(void 0!==(n=arguments[r])&&null!==n)for(i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t}),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),n=r.length>>>0;if(0===n)return!1;for(var i=0|t,s=Math.max(0>i?n-Math.abs(i):i,0);n>s;){if(function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(r[s],e))return!0;s++}return!1}});var q=function(){function n(e){s(this,n),this.accessToken=(e=e||{}).accessToken,this.clientId=e.clientId,this.clientSecret=e.clientSecret,this.selectUser=e.selectUser,this.selectAdmin=e.selectAdmin,this.fetch=e.fetch||fetch,this.pathRoot=e.pathRoot,e.fetch||console.warn("Global fetch is deprecated and will be unsupported in a future version. Please pass fetch function as option when instantiating dropbox instance: new Dropbox({fetch})")}return o(n,[{key:"setAccessToken",value:function(e){this.accessToken=e}},{key:"getAccessToken",value:function(){return this.accessToken}},{key:"setClientId",value:function(e){this.clientId=e}},{key:"getClientId",value:function(){return this.clientId}},{key:"setClientSecret",value:function(e){this.clientSecret=e}},{key:"getClientSecret",value:function(){return this.clientSecret}},{key:"getAuthenticationUrl",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"token",n=this.getClientId(),i="https://www.dropbox.com/oauth2/authorize";if(!n)throw Error("A client id is required. You can set the client id using .setClientId().");if("code"!==r&&!e)throw Error("A redirect uri is required.");if(!["code","token"].includes(r))throw Error("Authorization type must be code or token");var s=void 0;return s="code"===r?i+"?response_type=code&client_id="+n:i+"?response_type=token&client_id="+n,e&&(s+="&redirect_uri="+e),t&&(s+="&state="+t),s}},{key:"getAccessTokenFromCode",value:function(e,t){var r=this.getClientId(),n=this.getClientSecret();if(!r)throw Error("A client id is required. You can set the client id using .setClientId().");if(!n)throw Error("A client secret is required. You can set the client id using .setClientSecret().");return this.fetch("https://api.dropboxapi.com/oauth2/token?code="+t+"&grant_type=authorization_code&redirect_uri="+e+"&client_id="+r+"&client_secret="+n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(e){return function(e){var t=e.clone();return new Promise(function(r){e.json().then(function(e){return r(e)}).catch(function(){return t.text().then(function(e){return r(e)})})}).then(function(t){return[e,t]})}(e)}).then(function(e){var t=c(e,2),r=t[0],n=t[1];if(!r.ok)throw{error:n,response:r,status:r.status};return n.access_token})}},{key:"authenticateWithCordova",value:function(e,t){function r(e){-999!==e.code&&(window.setTimeout(function(){u.close()},10),t())}function n(r){if(r.url.indexOf("&error=")>-1)window.setTimeout(function(){u.close()},10),t();else{var n=r.url.indexOf("#access_token="),i=r.url.indexOf("&token_type=");if(n>-1){n+=14,window.setTimeout(function(){u.close()},10);var s=r.url.substring(n,i);e(s)}}}function i(){o||(u.removeEventListener("loaderror",r),u.removeEventListener("loadstop",n),u.removeEventListener("exit",i),o=!0)}var s=this.getAuthenticationUrl("https://www.dropbox.com/1/oauth2/redirect_receiver"),o=!1,u=window.open(s,"_blank");u.addEventListener("loaderror",r),u.addEventListener("loadstop",n),u.addEventListener("exit",i)}},{key:"request",value:function(e,t,r,n,i){var s=null;switch(i){case"rpc":s=this.getRpcRequest();break;case"download":s=this.getDownloadRequest();break;case"upload":s=this.getUploadRequest();break;default:throw Error("Invalid request style: "+i)}var o={selectUser:this.selectUser,selectAdmin:this.selectAdmin,clientId:this.getClientId(),clientSecret:this.getClientSecret(),pathRoot:this.pathRoot};return s(e,t,r,n,this.getAccessToken(),o)}},{key:"setRpcRequest",value:function(e){this.rpcRequest=e}},{key:"getRpcRequest",value:function(){return void 0===this.rpcRequest&&(this.rpcRequest=function(e){return function(r,n,i,s,o,u){var a={method:"POST",body:n?JSON.stringify(n):null},p={};n&&(p["Content-Type"]="application/json");var f="";switch(i){case"app":if(!u.clientId||!u.clientSecret)throw Error("A client id and secret is required for this function");f=new y(u.clientId+":"+u.clientSecret).toString("base64"),p.Authorization="Basic "+f;break;case"team":case"user":p.Authorization="Bearer "+o;break;case"noauth":break;default:throw Error("Unhandled auth type: "+i)}return u&&(u.selectUser&&(p["Dropbox-API-Select-User"]=u.selectUser),u.selectAdmin&&(p["Dropbox-API-Select-Admin"]=u.selectAdmin),u.pathRoot&&(p["Dropbox-API-Path-Root"]=u.pathRoot)),a.headers=p,e(t(s)+r,a).then(function(e){return function(e){return"application/json"===e.headers.get("Content-Type")?e.json().then(function(t){return[e,t]}):e.text().then(function(t){return[e,t]})}(e)}).then(function(e){var t=c(e,2),r=t[0],n=t[1];if(!r.ok)throw{error:n,response:r,status:r.status};return n})}}(this.fetch)),this.rpcRequest}},{key:"setDownloadRequest",value:function(e){this.downloadRequest=e}},{key:"getDownloadRequest",value:function(){return void 0===this.downloadRequest&&(this.downloadRequest=function(n){return function(i,s,o,u,a,p){if("user"!==o)throw Error("Unexpected auth type: "+o);var f={method:"POST",headers:{Authorization:"Bearer "+a,"Dropbox-API-Arg":r(s)}};return p&&(p.selectUser&&(f.headers["Dropbox-API-Select-User"]=p.selectUser),p.selectAdmin&&(f.headers["Dropbox-API-Select-Admin"]=p.selectAdmin),p.pathRoot&&(f.headers["Dropbox-API-Path-Root"]=p.pathRoot)),n(t(u)+i,f).then(function(t){return function(t){return t.ok?e()?t.blob():t.buffer():t.text()}(t).then(function(e){return[t,e]})}).then(function(t){var r=c(t,2);return function(t,r){if(!t.ok)throw{error:r,response:t,status:t.status};var n=JSON.parse(t.headers.get("dropbox-api-result"));return e()?n.fileBlob=r:n.fileBinary=r,n}(r[0],r[1])})}}(this.fetch)),this.downloadRequest}},{key:"setUploadRequest",value:function(e){this.uploadRequest=e}},{key:"getUploadRequest",value:function(){return void 0===this.uploadRequest&&(this.uploadRequest=function(e){return function(n,i,s,o,u,a){if("user"!==s)throw Error("Unexpected auth type: "+s);var p=i.contents;delete i.contents;var f={body:p,method:"POST",headers:{Authorization:"Bearer "+u,"Content-Type":"application/octet-stream","Dropbox-API-Arg":r(i)}};return a&&(a.selectUser&&(f.headers["Dropbox-API-Select-User"]=a.selectUser),a.selectAdmin&&(f.headers["Dropbox-API-Select-Admin"]=a.selectAdmin),a.pathRoot&&(f.headers["Dropbox-API-Path-Root"]=a.pathRoot)),e(t(o)+n,f).then(function(e){return function(e){var t=e.clone();return new Promise(function(r){e.json().then(function(e){return r(e)}).catch(function(){return t.text().then(function(e){return r(e)})})}).then(function(t){return[e,t]})}(e)}).then(function(e){var t=c(e,2),r=t[0],n=t[1];if(!r.ok)throw{error:n,response:r,status:r.status};return n})}}(this.fetch)),this.uploadRequest}}]),n}(),w=function(e){function t(e){s(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Object.assign(r,i),r}return u(t,q),o(t,[{key:"filesGetSharedLinkFile",value:function(e){return this.request("sharing/get_shared_link_file",e,"api","download")}}]),t}(),k=Object.freeze({Dropbox:w}),A={};A.teamDevicesListMemberDevices=function(e){return this.request("team/devices/list_member_devices",e,"team","api","rpc")},A.teamDevicesListMembersDevices=function(e){return this.request("team/devices/list_members_devices",e,"team","api","rpc")},A.teamDevicesListTeamDevices=function(e){return this.request("team/devices/list_team_devices",e,"team","api","rpc")},A.teamDevicesRevokeDeviceSession=function(e){return this.request("team/devices/revoke_device_session",e,"team","api","rpc")},A.teamDevicesRevokeDeviceSessionBatch=function(e){return this.request("team/devices/revoke_device_session_batch",e,"team","api","rpc")},A.teamFeaturesGetValues=function(e){return this.request("team/features/get_values",e,"team","api","rpc")},A.teamGetInfo=function(e){return this.request("team/get_info",e,"team","api","rpc")},A.teamGroupsCreate=function(e){return this.request("team/groups/create",e,"team","api","rpc")},A.teamGroupsDelete=function(e){return this.request("team/groups/delete",e,"team","api","rpc")},A.teamGroupsGetInfo=function(e){return this.request("team/groups/get_info",e,"team","api","rpc")},A.teamGroupsJobStatusGet=function(e){return this.request("team/groups/job_status/get",e,"team","api","rpc")},A.teamGroupsList=function(e){return this.request("team/groups/list",e,"team","api","rpc")},A.teamGroupsListContinue=function(e){return this.request("team/groups/list/continue",e,"team","api","rpc")},A.teamGroupsMembersAdd=function(e){return this.request("team/groups/members/add",e,"team","api","rpc")},A.teamGroupsMembersList=function(e){return this.request("team/groups/members/list",e,"team","api","rpc")},A.teamGroupsMembersListContinue=function(e){return this.request("team/groups/members/list/continue",e,"team","api","rpc")},A.teamGroupsMembersRemove=function(e){return this.request("team/groups/members/remove",e,"team","api","rpc")},A.teamGroupsMembersSetAccessType=function(e){return this.request("team/groups/members/set_access_type",e,"team","api","rpc")},A.teamGroupsUpdate=function(e){return this.request("team/groups/update",e,"team","api","rpc")},A.teamLinkedAppsListMemberLinkedApps=function(e){return this.request("team/linked_apps/list_member_linked_apps",e,"team","api","rpc")},A.teamLinkedAppsListMembersLinkedApps=function(e){return this.request("team/linked_apps/list_members_linked_apps",e,"team","api","rpc")},A.teamLinkedAppsListTeamLinkedApps=function(e){return this.request("team/linked_apps/list_team_linked_apps",e,"team","api","rpc")},A.teamLinkedAppsRevokeLinkedApp=function(e){return this.request("team/linked_apps/revoke_linked_app",e,"team","api","rpc")},A.teamLinkedAppsRevokeLinkedAppBatch=function(e){return this.request("team/linked_apps/revoke_linked_app_batch",e,"team","api","rpc")},A.teamMemberSpaceLimitsExcludedUsersAdd=function(e){return this.request("team/member_space_limits/excluded_users/add",e,"team","api","rpc")},A.teamMemberSpaceLimitsExcludedUsersList=function(e){return this.request("team/member_space_limits/excluded_users/list",e,"team","api","rpc")},A.teamMemberSpaceLimitsExcludedUsersListContinue=function(e){return this.request("team/member_space_limits/excluded_users/list/continue",e,"team","api","rpc")},A.teamMemberSpaceLimitsExcludedUsersRemove=function(e){return this.request("team/member_space_limits/excluded_users/remove",e,"team","api","rpc")},A.teamMemberSpaceLimitsGetCustomQuota=function(e){return this.request("team/member_space_limits/get_custom_quota",e,"team","api","rpc")},A.teamMemberSpaceLimitsRemoveCustomQuota=function(e){return this.request("team/member_space_limits/remove_custom_quota",e,"team","api","rpc")},A.teamMemberSpaceLimitsSetCustomQuota=function(e){return this.request("team/member_space_limits/set_custom_quota",e,"team","api","rpc")},A.teamMembersAdd=function(e){return this.request("team/members/add",e,"team","api","rpc")},A.teamMembersAddJobStatusGet=function(e){return this.request("team/members/add/job_status/get",e,"team","api","rpc")},A.teamMembersGetInfo=function(e){return this.request("team/members/get_info",e,"team","api","rpc")},A.teamMembersList=function(e){return this.request("team/members/list",e,"team","api","rpc")},A.teamMembersListContinue=function(e){return this.request("team/members/list/continue",e,"team","api","rpc")},A.teamMembersMoveFormerMemberFiles=function(e){return this.request("team/members/move_former_member_files",e,"team","api","rpc")},A.teamMembersMoveFormerMemberFilesJobStatusCheck=function(e){return this.request("team/members/move_former_member_files/job_status/check",e,"team","api","rpc")},A.teamMembersRecover=function(e){return this.request("team/members/recover",e,"team","api","rpc")},A.teamMembersRemove=function(e){return this.request("team/members/remove",e,"team","api","rpc")},A.teamMembersRemoveJobStatusGet=function(e){return this.request("team/members/remove/job_status/get",e,"team","api","rpc")},A.teamMembersSendWelcomeEmail=function(e){return this.request("team/members/send_welcome_email",e,"team","api","rpc")},A.teamMembersSetAdminPermissions=function(e){return this.request("team/members/set_admin_permissions",e,"team","api","rpc")},A.teamMembersSetProfile=function(e){return this.request("team/members/set_profile",e,"team","api","rpc")},A.teamMembersSuspend=function(e){return this.request("team/members/suspend",e,"team","api","rpc")},A.teamMembersUnsuspend=function(e){return this.request("team/members/unsuspend",e,"team","api","rpc")},A.teamNamespacesList=function(e){return this.request("team/namespaces/list",e,"team","api","rpc")},A.teamNamespacesListContinue=function(e){return this.request("team/namespaces/list/continue",e,"team","api","rpc")},A.teamPropertiesTemplateAdd=function(e){return this.request("team/properties/template/add",e,"team","api","rpc")},A.teamPropertiesTemplateGet=function(e){return this.request("team/properties/template/get",e,"team","api","rpc")},A.teamPropertiesTemplateList=function(e){return this.request("team/properties/template/list",e,"team","api","rpc")},A.teamPropertiesTemplateUpdate=function(e){return this.request("team/properties/template/update",e,"team","api","rpc")},A.teamReportsGetActivity=function(e){return this.request("team/reports/get_activity",e,"team","api","rpc")},A.teamReportsGetDevices=function(e){return this.request("team/reports/get_devices",e,"team","api","rpc")},A.teamReportsGetMembership=function(e){return this.request("team/reports/get_membership",e,"team","api","rpc")},A.teamReportsGetStorage=function(e){return this.request("team/reports/get_storage",e,"team","api","rpc")},A.teamTeamFolderActivate=function(e){return this.request("team/team_folder/activate",e,"team","api","rpc")},A.teamTeamFolderArchive=function(e){return this.request("team/team_folder/archive",e,"team","api","rpc")},A.teamTeamFolderArchiveCheck=function(e){return this.request("team/team_folder/archive/check",e,"team","api","rpc")},A.teamTeamFolderCreate=function(e){return this.request("team/team_folder/create",e,"team","api","rpc")},A.teamTeamFolderGetInfo=function(e){return this.request("team/team_folder/get_info",e,"team","api","rpc")},A.teamTeamFolderList=function(e){return this.request("team/team_folder/list",e,"team","api","rpc")},A.teamTeamFolderListContinue=function(e){return this.request("team/team_folder/list/continue",e,"team","api","rpc")},A.teamTeamFolderPermanentlyDelete=function(e){return this.request("team/team_folder/permanently_delete",e,"team","api","rpc")},A.teamTeamFolderRename=function(e){return this.request("team/team_folder/rename",e,"team","api","rpc")},A.teamTeamFolderUpdateSyncSettings=function(e){return this.request("team/team_folder/update_sync_settings",e,"team","api","rpc")},A.teamTokenGetAuthenticatedAdmin=function(e){return this.request("team/token/get_authenticated_admin",e,"team","api","rpc")};var L=function(e){function t(e){s(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Object.assign(r,A),r}return u(t,q),o(t,[{key:"actAsUser",value:function(e){return new w({accessToken:this.accessToken,clientId:this.clientId,selectUser:e})}}]),t}(),S=Object.freeze({DropboxTeam:L});return{Dropbox:k.Dropbox,DropboxTeam:S.DropboxTeam}}); diff --git a/bundles/browserfs.min.js b/bundles/browserfs.min.js deleted file mode 100644 index 673df5e..0000000 --- a/bundles/browserfs.min.js +++ /dev/null @@ -1,15 +0,0 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.BrowserFS=e():t.BrowserFS=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){(function(t,r,i,o){"use strict";function s(t){if(t)return t;throw new Fe(be.EIO,"Initialize BrowserFS with a file system using BrowserFS.initialize(filesystem)")}function a(t,e){switch(typeof t){case"number":return t;case"string":var n=parseInt(t,8);return isNaN(n)?e:n;default:return e}}function c(t){if(t instanceof Date)return t;if("number"==typeof t)return new Date(1e3*t);throw new Fe(be.EINVAL,"Invalid time.")}function u(t){if(t.indexOf("\0")>=0)throw new Fe(be.EINVAL,"Path must be a string without null bytes.");if(""===t)throw new Fe(be.EINVAL,"Path must not be empty.");return ke.resolve(t)}function f(t,e,n,r){switch(typeof t){case"object":return{encoding:"undefined"!=typeof t.encoding?t.encoding:e,flag:"undefined"!=typeof t.flag?t.flag:n,mode:a(t.mode,r)};case"string":return{encoding:t,flag:n,mode:r};default:return{encoding:e,flag:n,mode:r}}}function h(){}function p(t,e,n,r,i){return tn?n+1:t+1:r===i?e:e+1}function l(t,e){if(t===e)return 0;if(t.length>e.length){var n=t;t=e,e=n}for(var r=t.length,i=e.length;r>0&&t.charCodeAt(r-1)===e.charCodeAt(i-1);)r--,i--;for(var o=0;ob?b+1:I+1:S===s[r+k]?u:u+1,u=I}}return b}function d(t,e,n){t&&console.warn("["+e+"] Direct file system constructor usage is deprecated for this file system, and will be removed in the next major version. Please use the '"+e+".Create("+JSON.stringify(n)+", callback)' method instead. See https://github.com/jvilk/BrowserFS/issues/176 for more details.")}function y(){throw new Error("BFS has reached an impossible code path; please file a bug.")}function g(t,e,n){n.existsSync(t)||(g(ke.dirname(t),e,n),n.mkdirSync(t,e))}function v(t){var e=m(t),n=e.byteOffset,r=e.byteLength;return 0===n&&r===e.buffer.byteLength?e.buffer:e.buffer.slice(n,n+r)}function m(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function _(e){return e instanceof t?e:e instanceof Uint8Array?w(e):t.from(e)}function w(e){return e instanceof t?e:0===e.byteOffset&&e.byteLength===e.buffer.byteLength?E(e.buffer):t.from(e.buffer,e.byteOffset,e.byteLength)}function E(e){return t.from(e)}function b(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=t.length),e<0||n<0||n>t.length||e>n)throw new TypeError("Invalid slice bounds on buffer of length "+t.length+": ["+e+", "+n+"]");if(0===t.length)return S();var r=m(t),i=t[0],o=(i+1)%255;return t[0]=o,r[0]===o?(r[0]=i,w(r.slice(e,n))):(t[0]=i,w(r.subarray(e,n)))}function S(){return je?je:je=t.alloc(0)}function k(e,n){t.isBuffer(e)?n():n(new Fe(be.EINVAL,"option must be a Buffer."))}function I(t,e,n){function r(t){a||(t&&(a=!0,n(t)),s--,0===s&&c&&n())}var i=t.Options,o=t.Name,s=0,a=!1,c=!1,u=function(t){if(i.hasOwnProperty(t)){var c=i[t],u=e[t];if(void 0===u||null===u){if(!c.optional){var f=Object.keys(e).filter(function(t){return!(t in i)}).map(function(e){return{str:e,distance:l(t,e)}}).filter(function(t){return t.distance<5}).sort(function(t,e){return t.distance-e.distance});return a?{}:(a=!0,{v:n(new Fe(be.EINVAL,"["+o+"] Required option '"+t+"' not provided."+(f.length>0?" You provided unrecognized option '"+f[0].str+"'; perhaps you meant to type '"+t+"'.":"")+"\nOption description: "+c.description))})}}else{var h=!1;if(h=Array.isArray(c.type)?c.type.indexOf(typeof u)!==-1:typeof u===c.type,!h)return a?{}:(a=!0,{v:n(new Fe(be.EINVAL,"["+o+"] Value provided for option "+t+" is not the proper type. Expected "+(Array.isArray(c.type)?"one of {"+c.type.join(", ")+"}":c.type)+", but received "+typeof u+"\nOption description: "+c.description))});c.validator&&(s++,c.validator(u,r))}}};for(var f in i){var h=u(f);if(h)return h.v}c=!0,0!==s||a||n()}function O(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function F(t,e,n){return e=Ge(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Ge(r.length-e,0),s=Array(o);++i-1&&t%1==0&&t<=vn}function U(t){return null!=t&&C(t.length)&&!P(t)}function M(){}function j(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}}function B(t,e){for(var n=-1,r=Array(t);++n-1&&t%1==0&&t0?"/"+i.join("/"):e)}function St(t,e){if(null!==e&&"object"==typeof e){var n=e,r=n.path;r&&(r="/"+ke.relative(t,r),n.message=n.message.replace(n.path,r),n.path=r)}return e}function kt(t,e){return"function"==typeof e?function(n){arguments.length>0&&(arguments[0]=St(t,n)),e.apply(null,arguments)}:e}function It(t,e,n){return"Sync"!==t.slice(t.length-4)?function(){return arguments.length>0&&(e&&(arguments[0]=ke.join(this._folder,arguments[0])),n&&(arguments[1]=ke.join(this._folder,arguments[1])),arguments[arguments.length-1]=kt(this._folder,arguments[arguments.length-1])),this._wrapped[t].apply(this._wrapped,arguments)}:function(){try{return e&&(arguments[0]=ke.join(this._folder,arguments[0])),n&&(arguments[1]=ke.join(this._folder,arguments[1])),this._wrapped[t].apply(this._wrapped,arguments)}catch(t){throw St(this._folder,t)}}}function Ot(t){return t.isDirectory}function Ft(t,e,n,r){if("undefined"!=typeof navigator.webkitPersistentStorage)switch(t){case ti.PERSISTENT:navigator.webkitPersistentStorage.requestQuota(e,n,r);break;case ti.TEMPORARY:navigator.webkitTemporaryStorage.requestQuota(e,n,r);break;default:r(new TypeError("Invalid storage type: "+t))}else ti.webkitStorageInfo.requestQuota(t,e,n,r)}function Nt(t){return Array.prototype.slice.call(t||[],0)}function Rt(t,e,n){switch(t.name){case"PathExistsError":return Fe.EEXIST(e);case"QuotaExceededError":return Fe.FileError(be.ENOSPC,e);case"NotFoundError":return Fe.ENOENT(e);case"SecurityError":return Fe.FileError(be.EACCES,e);case"InvalidModificationError":return Fe.FileError(be.EPERM,e);case"TypeMismatchError":return Fe.FileError(n?be.ENOTDIR:be.EISDIR,e);case"EncodingError":case"InvalidStateError":case"NoModificationAllowedError":default:return Fe.FileError(be.EINVAL,e)}}function Lt(){return si?si:si=t.from("{}")}function Tt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,n="x"===t?e:3&e|8;return n.toString(16)})}function xt(t,e){return!t||(e(t),!1)}function At(t,e,n){return!t||(e.abort(function(){n(t)}),!1)}function Dt(t,e){switch(void 0===e&&(e=t.toString()),t.name){case"NotFoundError":return new Fe(be.ENOENT,e);case"QuotaExceededError":return new Fe(be.ENOSPC,e);default:return new Fe(be.EIO,e)}}function Pt(t,e,n){return void 0===e&&(e=be.EIO),void 0===n&&(n=null),function(r){r.preventDefault(),t(new Fe(e,null!==n?n:void 0))}}function Ct(t,e,n){return e?function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=e[0],i=this._getFs(r);e[0]=i.path;try{return i.fs[t].apply(i.fs,e)}catch(t){throw this.standardizeError(t,i.path,r),t}}:function(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];var i=n[0],o=this._getFs(i);if(n[0]=o.path,"function"==typeof n[n.length-1]){var s=n[n.length-1];n[n.length-1]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];t.length>0&&t[0]instanceof Fe&&e.standardizeError(t[0],o.path,i),s.apply(null,t)}}return o.fs[t].apply(o.fs,n)}}function Ut(t){return 146|t}function Mt(t){return Re.getFileFlag(t)}function jt(t){return{type:Wi.API_ERROR,errorData:Yt(t.writeToBuffer())}}function Bt(t){return Fe.fromBuffer(Xt(t.errorData))}function zt(t){return{type:Wi.ERROR,name:t.name,message:t.message,stack:t.stack}}function qt(t){var e=ti[t.name];"function"!=typeof e&&(e=Error);var n=new e(t.message);return n.stack=t.stack,n}function Vt(t){return{type:Wi.STATS,statsData:Yt(t.toBuffer())}}function Wt(t){return Te.fromBuffer(Xt(t.statsData))}function Ht(t){return{type:Wi.FILEFLAG,flagStr:t.getFlagString()}}function Zt(t){return Re.getFileFlag(t.flagStr)}function Yt(t){return v(t)}function Xt(t){return E(t)}function Kt(t){return{type:Wi.BUFFER,data:Yt(t)}}function Jt(t){return Xt(t.data)}function Gt(t){return t&&"object"==typeof t&&t.hasOwnProperty("browserfsMessage")&&t.browserfsMessage}function Qt(t){return t&&"object"==typeof t&&t.hasOwnProperty("browserfsMessage")&&t.browserfsMessage}function $t(e,n,r){var i=new XMLHttpRequest;i.open("GET",e,!0);var o=!0;switch(n){case"buffer":i.responseType="arraybuffer";break;case"json":try{i.responseType="json",o="json"===i.responseType}catch(t){o=!1}break;default:return r(new Fe(be.EINVAL,"Invalid download type: "+n))}i.onreadystatechange=function(e){if(4===i.readyState){if(200!==i.status)return r(new Fe(i.status,"XHR error."));switch(n){case"buffer":return r(null,i.response?t.from(i.response):S());case"json":return o?r(null,i.response):r(null,JSON.parse(i.responseText))}}},i.send()}function te(e,n){var r=new XMLHttpRequest;r.open("GET",e,!1);var i=null,o=null;if(r.overrideMimeType("text/plain; charset=x-user-defined"),r.onreadystatechange=function(e){if(4===r.readyState){if(200!==r.status)return void(o=new Fe(r.status,"XHR error."));switch(n){case"buffer":var s=r.responseText;i=t.alloc(s.length);for(var a=0;a>5&15)-1,i=(e>>9)+1980,o=31&t,s=t>>5&63,a=t>>11;return new Date(i,r,n,a,s,o)}function ue(t,e,n,r){return 0===r?"":e?t.toString("utf8",n,n+r):eo.byte2str(t.slice(n,n+r))}function fe(t,e,n){return t.toString("ascii",e,e+n).trim()}function he(t,e,n){if(1===n)return String.fromCharCode(t[e]);for(var r=Math.floor(n/2),i=new Array(r),o=0;othis._buffer.length){var n=t.alloc(e-this._buffer.length,0);return this.writeSync(n,0,n.length,this._buffer.length),void(this._flag.isSynchronous()&&Pe.getRootFS().supportsSynch()&&this.syncSync())}this._stat.size=e;var r=t.alloc(e);this._buffer.copy(r,0,0,e),this._buffer=r,this._flag.isSynchronous()&&Pe.getRootFS().supportsSynch()&&this.syncSync()},n.prototype.write=function(t,e,n,r,i){try{i(null,this.writeSync(t,e,n,r),t)}catch(t){i(t)}},n.prototype.writeSync=function(e,n,r,i){if(this._dirty=!0,void 0!==i&&null!==i||(i=this.getPos()),!this._flag.isWriteable())throw new Fe(be.EPERM,"File not opened with a writeable mode.");var o=i+r;if(o>this._stat.size&&(this._stat.size=o,o>this._buffer.length)){var s=t.alloc(o);this._buffer.copy(s),this._buffer=s}var a=e.copy(this._buffer,i,n,n+r);return this._stat.mtime=new Date,this._flag.isSynchronous()?(this.syncSync(),a):(this.setPos(i+a),a)},n.prototype.read=function(t,e,n,r,i){try{i(null,this.readSync(t,e,n,r),t)}catch(t){i(t)}},n.prototype.readSync=function(t,e,n,r){if(!this._flag.isReadable())throw new Fe(be.EPERM,"File not opened with a readable mode.");void 0!==r&&null!==r||(r=this.getPos());var i=r+n;i>this._stat.size&&(n=this._stat.size-r);var o=this._buffer.copy(t,e,r,r+n);return this._stat.atime=new Date,this._pos=r+n,o},n.prototype.chmod=function(t,e){try{this.chmodSync(t),e()}catch(t){e(t)}},n.prototype.chmodSync=function(t){if(!this._fs.supportsProps())throw new Fe(be.ENOTSUP);this._dirty=!0,this._stat.chmod(t),this.syncSync()},n.prototype.isDirty=function(){return this._dirty},n.prototype.resetDirty=function(){this._dirty=!1},n}(Ze),Xe=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){t()},e.prototype.syncSync=function(){},e.prototype.close=function(t){t()},e.prototype.closeSync=function(){},e}(Ye),Ke=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())},e.prototype.closeSync=function(){this.syncSync()},e}(Ye),Je=function(t){function e(n,r,i){if(void 0===i&&(i=!0),t.call(this),this._queue=[],this._queueRunning=!1,this._isInitialized=!1,this._initializeCallbacks=[],this._sync=n,this._async=r,!n.supportsSynch())throw new Error("The first argument to AsyncMirror needs to be a synchronous file system.");d(i,e.Name,{sync:"sync file system instance",async:"async file system instance"})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){try{var r=new e(t.sync,t.async,!1);r.initialize(function(t){t?n(t):n(null,r)},!1)}catch(t){n(t)}},e.isAvailable=function(){return!0},e.prototype.getName=function(){return e.Name},e.prototype._syncSync=function(t){this._sync.writeFileSync(t.getPath(),t.getBuffer(),null,Re.getFileFlag("w"),t.getStats().mode),this.enqueueOp({apiMethod:"writeFile",arguments:[t.getPath(),t.getBuffer(),null,t.getFlag(),t.getStats().mode]})},e.prototype.initialize=function(t,e){var n=this;void 0===e&&(e=!0),e&&console.warn("[AsyncMirror] AsyncMirror.initialize() is deprecated and will be removed in the next major version. Please use 'AsyncMirror.Create({ sync: (sync file system instance), async: (async file system instance)}, cb)' to create and initialize AsyncMirror instances.");var r=this._initializeCallbacks,i=function(t){n._isInitialized=!t,n._initializeCallbacks=[],r.forEach(function(e){return e(t)})};if(this._isInitialized)t();else if(1===r.push(t)){var o=function(t,e,r){"/"!==t&&n._sync.mkdirSync(t,e),n._async.readdir(t,function(e,n){function i(e){e?r(e):o0){var r=e._queue.shift(),i=r.arguments;i.push(n),e._async[r.apiMethod].apply(e._async,i)}else e._queueRunning=!1};n()}},e}(He);Je.Name="AsyncMirror",Je.Options={sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to."},async:{type:"object",description:"The asynchronous file system to mirror."}};var Ge=Math.max,Qe=function(t){return R(function(e){var n=e.pop();t.call(this,e,n)})},$e="object"==typeof r&&r&&r.Object===Object&&r,tn="object"==typeof self&&self&&self.Object===Object&&self,en=$e||tn||Function("return this")(),nn=en.Symbol,rn=Object.prototype,on=rn.hasOwnProperty,sn=rn.toString,an=nn?nn.toStringTag:void 0,cn=Object.prototype,un=cn.toString,fn="[object Null]",hn="[object Undefined]",pn=nn?nn.toStringTag:void 0,ln="[object AsyncFunction]",dn="[object Function]",yn="[object GeneratorFunction]",gn="[object Proxy]",vn=9007199254740991,mn={},_n="function"==typeof Symbol&&Symbol.iterator,wn=function(t){return _n&&t[_n]&&t[_n]()},En="[object Arguments]",bn=Object.prototype,Sn=bn.hasOwnProperty,kn=bn.propertyIsEnumerable,In=q(function(){return arguments}())?q:function(t){return z(t)&&Sn.call(t,"callee")&&!kn.call(t,"callee")},On=Array.isArray,Fn="object"==typeof e&&e&&!e.nodeType&&e,Nn=Fn&&"object"==typeof i&&i&&!i.nodeType&&i,Rn=Nn&&Nn.exports===Fn,Ln=Rn?en.Buffer:void 0,Tn=Ln?Ln.isBuffer:void 0,xn=Tn||V,An=9007199254740991,Dn=/^(?:0|[1-9]\d*)$/,Pn="[object Arguments]",Cn="[object Array]",Un="[object Boolean]",Mn="[object Date]",jn="[object Error]",Bn="[object Function]",zn="[object Map]",qn="[object Number]",Vn="[object Object]",Wn="[object RegExp]",Hn="[object Set]",Zn="[object String]",Yn="[object WeakMap]",Xn="[object ArrayBuffer]",Kn="[object DataView]",Jn="[object Float32Array]",Gn="[object Float64Array]",Qn="[object Int8Array]",$n="[object Int16Array]",tr="[object Int32Array]",er="[object Uint8Array]",nr="[object Uint8ClampedArray]",rr="[object Uint16Array]",ir="[object Uint32Array]",or={};or[Jn]=or[Gn]=or[Qn]=or[$n]=or[tr]=or[er]=or[nr]=or[rr]=or[ir]=!0,or[Pn]=or[Cn]=or[Xn]=or[Un]=or[Kn]=or[Mn]=or[jn]=or[Bn]=or[zn]=or[qn]=or[Vn]=or[Wn]=or[Hn]=or[Zn]=or[Yn]=!1;var sr="object"==typeof e&&e&&!e.nodeType&&e,ar=sr&&"object"==typeof i&&i&&!i.nodeType&&i,cr=ar&&ar.exports===sr,ur=cr&&$e.process,fr=function(){try{return ur&&ur.binding&&ur.binding("util")}catch(t){}}(),hr=fr&&fr.isTypedArray,pr=hr?Z(hr):H,lr=Object.prototype,dr=lr.hasOwnProperty,yr=Object.prototype,gr=K(Object.keys,Object),vr=Object.prototype,mr=vr.hasOwnProperty,_r=ot(it,1/0),wr=function(t,e,n){var r=U(t)?st:_r;r(t,e,n)},Er=at(ct);L(Er);var br=ut(ct),Sr=ot(br,1);L(Sr),R(function(t,e){return R(function(n){return t.apply(null,e.concat(n))})});var kr,Ir=(ht(),"\\ud800-\\udfff"),Or="\\u0300-\\u036f",Fr="\\ufe20-\\ufe2f",Nr="\\u20d0-\\u20ff",Rr=Or+Fr+Nr,Lr="\\ufe0e\\ufe0f",Tr="["+Ir+"]",xr="["+Rr+"]",Ar="\\ud83c[\\udffb-\\udfff]",Dr="(?:"+xr+"|"+Ar+")",Pr="[^"+Ir+"]",Cr="(?:\\ud83c[\\udde6-\\uddff]){2}",Ur="[\\ud800-\\udbff][\\udc00-\\udfff]",Mr="\\u200d",jr=Dr+"?",Br="["+Lr+"]?",zr=("(?:"+Mr+"(?:"+[Pr,Cr,Ur].join("|")+")"+Br+jr+")*","(?:"+[Pr+xr+"?",xr,Cr,Ur,Tr].join("|")+")","function"==typeof setImmediate&&setImmediate),qr="object"==typeof o&&"function"==typeof o.nextTick;kr=zr?setImmediate:qr?o.nextTick:pt,lt(kr);var Vr=ot(it,1),Wr=R(function(t){return R(function(e){var n=this,r=e[e.length-1];"function"==typeof r?e.pop():r=M,dt(t,e,function(t,e,r){e.apply(n,t.concat(R(function(t,e){r(t,e)})))},function(t,e){r.apply(n,[t].concat(e))})})});R(function(t){return Wr.apply(null,t.reverse())}),R(function(t){var e=[null].concat(t);return Qe(function(t,n){return n.apply(this,e)})}),yt("dir"),yt("log");var Hr;Hr=qr?o.nextTick:zr?setImmediate:pt,lt(Hr);var Zr,Yr=(Math.ceil,Math.max,function(t){this._cache={},this._client=t});Yr.prototype.readdir=function(t,e){var n=this,r=this.getCachedDirInfo(t);this._wrap(function(e){null!==r&&r.contents?n._client.readdir(t,{contentHash:r.stat.contentHash},e):n._client.readdir(t,e)},function(i,o,s,a){i?i.status===Dropbox.ApiError.NO_CONTENT&&null!==r?e(null,r.contents.slice(0)):e(i):(n.updateCachedDirInfo(t,s,o.slice(0)),a.forEach(function(e){n.updateCachedInfo(ke.join(t,e.name),e)}),e(null,o))})},Yr.prototype.remove=function(t,e){var n=this;this._wrap(function(e){n._client.remove(t,e)},function(r,i){r||n.updateCachedInfo(t,i),e(r)})},Yr.prototype.move=function(t,e,n){var r=this;this._wrap(function(n){r._client.move(t,e,n)},function(i,o){i||(r.deleteCachedInfo(t),r.updateCachedInfo(e,o)),n(i)})},Yr.prototype.stat=function(t,e){var n=this;this._wrap(function(e){n._client.stat(t,e)},function(r,i){r||n.updateCachedInfo(t,i),e(r,i)})},Yr.prototype.readFile=function(t,e){var n=this,r=this.getCachedFileInfo(t);null!==r&&null!==r.contents?this.stat(t,function(i,o){i?e(i):o.contentHash===r.stat.contentHash?e(i,r.contents.slice(0),r.stat):n.readFile(t,e)}):this._wrap(function(e){n._client.readFile(t,{arrayBuffer:!0},e)},function(r,i,o){r||n.updateCachedInfo(t,o,i.slice(0)),e(r,i,o)})},Yr.prototype.writeFile=function(t,e,n){var r=this;this._wrap(function(n){r._client.writeFile(t,e,n)},function(i,o){i||r.updateCachedInfo(t,o,e.slice(0)),n(i,o)})},Yr.prototype.mkdir=function(t,e){var n=this;this._wrap(function(e){n._client.mkdir(t,e)},function(r,i){r||n.updateCachedInfo(t,i,[]),e(r)})},Yr.prototype._wrap=function(t,e){var n=0,r=function(i){var o=2;if(i&&3>++n)switch(i.status){case Dropbox.ApiError.SERVER_ERROR:case Dropbox.ApiError.NETWORK_ERROR:case Dropbox.ApiError.RATE_LIMITED:setTimeout(function(){t(r)},1e3*o);break;default:e.apply(null,arguments)}else e.apply(null,arguments)};t(r)},Yr.prototype.getCachedInfo=function(t){return this._cache[t.toLowerCase()]},Yr.prototype.putCachedInfo=function(t,e){this._cache[t.toLowerCase()]=e},Yr.prototype.deleteCachedInfo=function(t){delete this._cache[t.toLowerCase()]},Yr.prototype.getCachedDirInfo=function(t){var e=this.getCachedInfo(t);return wt(e)?e:null},Yr.prototype.getCachedFileInfo=function(t){var e=this.getCachedInfo(t);return _t(e)?e:null},Yr.prototype.updateCachedDirInfo=function(t,e,n){void 0===n&&(n=null);var r=this.getCachedInfo(t);null===e.contentHash||void 0!==r&&r.stat.contentHash===e.contentHash||this.putCachedInfo(t,{stat:e,contents:n})},Yr.prototype.updateCachedFileInfo=function(t,e,n){void 0===n&&(n=null);var r=this.getCachedInfo(t);null===e.versionTag||void 0!==r&&r.stat.versionTag===e.versionTag||this.putCachedInfo(t,{stat:e,contents:n})},Yr.prototype.updateCachedInfo=function(t,e,n){void 0===n&&(n=null),e.isFile&&Et(n)?this.updateCachedFileInfo(t,e,n):e.isFolder&&Array.isArray(n)&&this.updateCachedDirInfo(t,e,n)};var Xr=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;if(this.isDirty()){var n=this.getBuffer(),r=v(n);this._fs._writeFileStrict(this.getPath(),r,function(n){n||e.resetDirty(),t(n)})}else t()},e.prototype.close=function(t){this.sync(t)},e}(Ye),Kr=function(t){function e(n,r){void 0===r&&(r=!0),t.call(this),this._client=new Yr(n),d(r,e.Name,{client:"authenticated dropbox client instance"}),mt()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){n(null,new e(t.client,!1))},e.isAvailable=function(){return"undefined"!=typeof Dropbox},e.prototype.getName=function(){return e.Name},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSymlinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!1},e.prototype.empty=function(t){var e=this;this._client.readdir("/",function(n,r){if(n)t(e.convert(n,"/"));else{var i=function(t,n){var r=ke.join("/",t);e._client.remove(r,function(t){n(t?e.convert(t,r):null)})},o=function(e){e?t(e):t()};vt(r,i,o)}})},e.prototype.rename=function(t,e,n){var r=this;this._client.move(t,e,function(i){i?r._client.stat(e,function(o,s){if(o||s.isFolder){var a=i.response.error.indexOf(t)>-1?t:e; -n(r.convert(i,a))}else r._client.remove(e,function(i){i?n(r.convert(i,e)):r.rename(t,e,n)})}):n()})},e.prototype.stat=function(t,e,n){var r=this;this._client.stat(t,function(e,i){if(e)n(r.convert(e,t));else{if(!i||!i.isRemoved){var o=new Te(r._statType(i),i.size);return n(null,o)}n(Fe.FileError(be.ENOENT,t))}})},e.prototype.open=function(t,e,n,r){var i=this;this._client.readFile(t,function(n,o,s){if(!n){var a;a=null===o?S():E(o);var c=i._makeFile(t,e,s,a);return r(null,c)}if(e.isReadable())r(i.convert(n,t));else switch(n.status){case Dropbox.ApiError.NOT_FOUND:var u=new ArrayBuffer(0);return i._writeFileStrict(t,u,function(n,o){if(n)r(n);else{var s=i._makeFile(t,e,o,E(u));r(null,s)}});default:return r(i.convert(n,t))}})},e.prototype._writeFileStrict=function(t,e,n){var r=this,i=ke.dirname(t);this.stat(i,!1,function(o,s){o?n(Fe.FileError(be.ENOENT,i)):r._client.writeFile(t,e,function(e,i){e?n(r.convert(e,t)):n(null,i)})})},e.prototype._statType=function(t){return t.isFile?Le.FILE:Le.DIRECTORY},e.prototype._makeFile=function(t,e,n,r){var i=this._statType(n),o=new Te(i,n.size);return new Xr(this,t,e,o,r)},e.prototype._remove=function(t,e,n){var r=this;this._client.stat(t,function(i,o){i?e(r.convert(i,t)):o.isFile&&!n?e(Fe.FileError(be.ENOTDIR,t)):!o.isFile&&n?e(Fe.FileError(be.EISDIR,t)):r._client.remove(t,function(n){e(n?r.convert(n,t):null)})})},e.prototype.unlink=function(t,e){this._remove(t,e,!0)},e.prototype.rmdir=function(t,e){this._remove(t,e,!1)},e.prototype.mkdir=function(t,e,n){var r=this,i=ke.dirname(t);this._client.stat(i,function(e,o){e?n(r.convert(e,i)):r._client.mkdir(t,function(e){n(e?Fe.FileError(be.EEXIST,t):null)})})},e.prototype.readdir=function(t,e){var n=this;this._client.readdir(t,function(t,r){return t?e(n.convert(t)):e(null,r)})},e.prototype.convert=function(t,e){void 0===e&&(e=null);var n=Zr[t.status];return void 0===n&&(n=be.EIO),e?Fe.FileError(n,e):new Fe(n)},e}(We);Kr.Name="Dropbox",Kr.Options={client:{type:"object",description:"An *authenticated* Dropbox client. Must be from the 0.10 JS SDK.",validator:function(t,e){t.isAuthenticated&&t.isAuthenticated()?e():e(new Fe(be.EINVAL,"'client' option must be an authenticated Dropbox client from the v0.10 JS SDK."))}}};var Jr=function(t){function e(e,n,r,i){t.call(this),this._fs=e,this._FS=n,this._path=r,this._stream=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPos=function(){},e.prototype.close=function(t){var e=null;try{this.closeSync()}catch(t){e=t}finally{t(e)}},e.prototype.closeSync=function(){try{this._FS.close(this._stream)}catch(t){throw bt(t,this._path)}},e.prototype.stat=function(t){try{t(null,this.statSync())}catch(e){t(e)}},e.prototype.statSync=function(){try{return this._fs.statSync(this._path,!1)}catch(t){throw bt(t,this._path)}},e.prototype.truncate=function(t,e){var n=null;try{this.truncateSync(t)}catch(t){n=t}finally{e(n)}},e.prototype.truncateSync=function(t){try{this._FS.ftruncate(this._stream.fd,t)}catch(t){throw bt(t,this._path)}},e.prototype.write=function(t,e,n,r,i){try{i(null,this.writeSync(t,e,n,r),t)}catch(t){i(t)}},e.prototype.writeSync=function(t,e,n,r){try{var i=m(t),o=null===r?void 0:r;return this._FS.write(this._stream,i,e,n,o)}catch(t){throw bt(t,this._path)}},e.prototype.read=function(t,e,n,r,i){try{i(null,this.readSync(t,e,n,r),t)}catch(t){i(t)}},e.prototype.readSync=function(t,e,n,r){try{var i=m(t),o=null===r?void 0:r;return this._FS.read(this._stream,i,e,n,o)}catch(t){throw bt(t,this._path)}},e.prototype.sync=function(t){t()},e.prototype.syncSync=function(){},e.prototype.chown=function(t,e,n){var r=null;try{this.chownSync(t,e)}catch(t){r=t}finally{n(r)}},e.prototype.chownSync=function(t,e){try{this._FS.fchown(this._stream.fd,t,e)}catch(t){throw bt(t,this._path)}},e.prototype.chmod=function(t,e){var n=null;try{this.chmodSync(t)}catch(t){n=t}finally{e(n)}},e.prototype.chmodSync=function(t){try{this._FS.fchmod(this._stream.fd,t)}catch(t){throw bt(t,this._path)}},e.prototype.utimes=function(t,e,n){var r=null;try{this.utimesSync(t,e)}catch(t){r=t}finally{n(r)}},e.prototype.utimesSync=function(t,e){this._fs.utimesSync(this._path,t,e)},e}(Ze),Gr=function(e){function n(t){e.call(this),this._FS=t}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.Create=function(t,e){e(null,new n(t.FS))},n.isAvailable=function(){return!0},n.prototype.getName=function(){return this._FS.DB_NAME()},n.prototype.isReadOnly=function(){return!1},n.prototype.supportsLinks=function(){return!0},n.prototype.supportsProps=function(){return!0},n.prototype.supportsSynch=function(){return!0},n.prototype.renameSync=function(t,e){try{this._FS.rename(t,e)}catch(n){throw n.errno===be.ENOENT?bt(n,this.existsSync(t)?e:t):bt(n)}},n.prototype.statSync=function(t,e){try{var n=e?this._FS.lstat(t):this._FS.stat(t),r=this.modeToFileType(n.mode);return new Te(r,n.size,n.mode,n.atime,n.mtime,n.ctime)}catch(e){throw bt(e,t)}},n.prototype.openSync=function(t,e,n){try{var r=this._FS.open(t,e.getFlagString(),n);if(this._FS.isDir(r.node.mode))throw this._FS.close(r),Fe.EISDIR(t);return new Jr(this,this._FS,t,r)}catch(e){throw bt(e,t)}},n.prototype.unlinkSync=function(t){try{this._FS.unlink(t)}catch(e){throw bt(e,t)}},n.prototype.rmdirSync=function(t){try{this._FS.rmdir(t)}catch(e){throw bt(e,t)}},n.prototype.mkdirSync=function(t,e){try{this._FS.mkdir(t,e)}catch(e){throw bt(e,t)}},n.prototype.readdirSync=function(t){try{return this._FS.readdir(t).filter(function(t){return"."!==t&&".."!==t})}catch(e){throw bt(e,t)}},n.prototype.truncateSync=function(t,e){try{this._FS.truncate(t,e)}catch(e){throw bt(e,t)}},n.prototype.readFileSync=function(t,e,n){try{var r=this._FS.readFile(t,{flags:n.getFlagString()}),i=w(r);return e?i.toString(e):i}catch(e){throw bt(e,t)}},n.prototype.writeFileSync=function(e,n,r,i,o){try{r&&(n=t.from(n,r));var s=m(n);this._FS.writeFile(e,s,{flags:i.getFlagString(),encoding:"binary"}),this._FS.chmod(e,o)}catch(t){throw bt(t,e)}},n.prototype.chmodSync=function(t,e,n){try{e?this._FS.lchmod(t,n):this._FS.chmod(t,n)}catch(e){throw bt(e,t)}},n.prototype.chownSync=function(t,e,n,r){try{e?this._FS.lchown(t,n,r):this._FS.chown(t,n,r)}catch(e){throw bt(e,t)}},n.prototype.symlinkSync=function(t,e,n){try{this._FS.symlink(t,e)}catch(t){throw bt(t)}},n.prototype.readlinkSync=function(t){try{return this._FS.readlink(t)}catch(e){throw bt(e,t)}},n.prototype.utimesSync=function(t,e,n){try{this._FS.utime(t,e.getTime(),n.getTime())}catch(e){throw bt(e,t)}},n.prototype.modeToFileType=function(t){if(this._FS.isDir(t))return Le.DIRECTORY;if(this._FS.isFile(t))return Le.FILE;if(this._FS.isLink(t))return Le.SYMLINK;throw Fe.EPERM("Invalid mode: "+t)},n}(He);Gr.Name="EmscriptenFileSystem",Gr.Options={FS:{type:"object",description:"The Emscripten file system to use (the `FS` variable)"}};var Qr=function(t){function e(e,n){t.call(this),this._folder=e,this._wrapped=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){n(null,new e(t.folder,t.wrapped))},e.isAvailable=function(){return!0},e.prototype.initialize=function(t){var e=this;this._wrapped.exists(this._folder,function(n){n?t():e._wrapped.isReadOnly()?t(Fe.ENOENT(e._folder)):e._wrapped.mkdir(e._folder,511,t)})},e.prototype.getName=function(){return this._wrapped.getName()},e.prototype.isReadOnly=function(){return this._wrapped.isReadOnly()},e.prototype.supportsProps=function(){return this._wrapped.supportsProps()},e.prototype.supportsSynch=function(){return this._wrapped.supportsSynch()},e.prototype.supportsLinks=function(){return!1},e}(We);Qr.Name="FolderAdapter",Qr.Options={folder:{type:"string",description:"The folder to use as the root directory"},wrapped:{type:"object",description:"The file system to wrap"}},["diskSpace","stat","statSync","open","openSync","unlink","unlinkSync","rmdir","rmdirSync","mkdir","mkdirSync","readdir","readdirSync","exists","existsSync","realpath","realpathSync","truncate","truncateSync","readFile","readFileSync","writeFile","writeFileSync","appendFile","appendFileSync","chmod","chmodSync","chown","chownSync","utimes","utimesSync","readlink","readlinkSync"].forEach(function(t){Qr.prototype[t]=It(t,!0,!1)}),["rename","renameSync","link","linkSync","symlink","symlinkSync"].forEach(function(t){Qr.prototype[t]=It(t,!0,!0)});var $r;$r="undefined"!=typeof window?window:"undefined"!=typeof self?self:r;var ti=$r,ei=ti.webkitRequestFileSystem||ti.requestFileSystem||null,ni=function(t){function e(e,n,r,i,o,s){t.call(this,e,r,i,o,s),this._entry=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;return this.isDirty()?void this._entry.createWriter(function(n){var r=e.getBuffer(),i=new Blob([v(r)]),o=i.size;n.onwriteend=function(r){n.onwriteend=null,n.onerror=null,n.truncate(o),e.resetDirty(),t()},n.onerror=function(n){t(Rt(n,e.getPath(),!1))},n.write(i)}):t()},e.prototype.close=function(t){this.sync(t)},e}(Ye),ri=function(t){function e(n,r,i){void 0===n&&(n=5),void 0===r&&(r=ti.PERSISTENT),void 0===i&&(i=!0),t.call(this),this.size=1048576*n,this.type=r,d(i,e.Name,{size:n,type:r})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){var r=new e(t.size,t.type,!1);r.allocate(function(t){return t?n(t):n(null,r)},!1)},e.isAvailable=function(){return!!ei},e.prototype.getName=function(){return e.Name},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSymlinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!1},e.prototype.allocate=function(t,e){var n=this;void 0===t&&(t=function(){}),void 0===e&&(e=!0),e&&console.warn("[HTML5FS] HTML5FS.allocate() is deprecated and will be removed in the next major release. Please use 'HTML5FS.Create({type: "+this.type+", size: "+this.size+"}, cb)' to create and allocate HTML5FS instances.");var r=function(e){n.fs=e,t()},i=function(e){t(Rt(e,"/",!0))};this.type===ti.PERSISTENT?Ft(this.type,this.size,function(t){ei(n.type,t,r,i)},i):ei(this.type,this.size,r,i)},e.prototype.empty=function(t){this._readdir("/",function(e,n){if(e)console.error("Failed to empty FS"),t(e);else{var r=function(n){e?(console.error("Failed to empty FS"),t(e)):t()},i=function(t,e){var n=function(){e()},r=function(n){e(Rt(n,t.fullPath,!t.isDirectory))};Ot(t)?t.removeRecursively(n,r):t.remove(n,r)};vt(n,i,r)}})},e.prototype.rename=function(t,e,n){var r=this,i=2,o=0,s=this.fs.root,a=t,c=function(t){--i<=0&&n(Rt(t,a,!1))},u=function(i){return 2===++o?n(new Fe(be.EINVAL,"Something was identified as both a file and a directory. This should never happen.")):t===e?n():(a=ke.dirname(e),void s.getDirectory(a,{},function(o){a=ke.basename(e),i.moveTo(o,a,function(t){n()},function(o){i.isDirectory?(a=e,r.unlink(e,function(i){i?c(o):r.rename(t,e,n)})):c(o)})},c))};s.getFile(t,{},u,c),s.getDirectory(t,{},u,c)},e.prototype.stat=function(t,e,n){var r=this,i={create:!1},o=function(t){var e=function(t){var e=new Te(Le.FILE,t.size);n(null,e)};t.file(e,a)},s=function(t){var e=4096,r=new Te(Le.DIRECTORY,e);n(null,r)},a=function(e){n(Rt(e,t,!1))},c=function(){r.fs.root.getDirectory(t,i,s,a)};this.fs.root.getFile(t,i,o,c)},e.prototype.open=function(t,e,n,r){var i=this,o=function(n){r("InvalidModificationError"===n.name&&e.isExclusive()?Fe.EEXIST(t):Rt(n,t,!1))};this.fs.root.getFile(t,{create:e.pathNotExistsAction()===Oe.CREATE_FILE,exclusive:e.isExclusive()},function(n){n.file(function(s){var a=new FileReader;a.onloadend=function(o){var c=i._makeFile(t,n,e,s,a.result);r(null,c)},a.onerror=function(t){o(a.error)},a.readAsArrayBuffer(s)},o)},o)},e.prototype.unlink=function(t,e){this._remove(t,e,!0)},e.prototype.rmdir=function(t,e){var n=this;this.readdir(t,function(r,i){r?e(r):i.length>0?e(Fe.ENOTEMPTY(t)):n._remove(t,e,!1)})},e.prototype.mkdir=function(t,e,n){var r={create:!0,exclusive:!0},i=function(t){n()},o=function(e){n(Rt(e,t,!0))};this.fs.root.getDirectory(t,r,i,o)},e.prototype.readdir=function(t,e){this._readdir(t,function(t,n){if(!n)return e(t);for(var r=[],i=0,o=n;i0)throw Fe.ENOTEMPTY(t);this.removeEntry(t,!0)},n.prototype.mkdirSync=function(e,n){var r=this.store.beginTransaction("readwrite"),i=t.from("{}");this.commitNewFile(r,e,Le.DIRECTORY,n,i)},n.prototype.readdirSync=function(t){var e=this.store.beginTransaction("readonly");return Object.keys(this.getDirListing(e,t,this.findINode(e,t)))},n.prototype._syncSync=function(t,e,n){var r=this.store.beginTransaction("readwrite"),i=this._findINode(r,ke.dirname(t),ke.basename(t)),o=this.getINode(r,t,i),s=o.update(n);try{r.put(o.id,e,!0),s&&r.put(i,o.toBuffer(),!0)}catch(t){throw r.abort(),t}r.commit()},n.prototype.makeRootDirectory=function(){var t=this.store.beginTransaction("readwrite");if(void 0===t.get(oi)){var e=(new Date).getTime(),n=new ii(Tt(),4096,511|Le.DIRECTORY,e,e,e);t.put(n.id,Lt(),!1),t.put(oi,n.toBuffer(),!1),t.commit()}},n.prototype._findINode=function(t,e,n){var r=this,i=function(i){var o=r.getDirListing(t,e,i);if(o[n])return o[n];throw Fe.ENOENT(ke.resolve(e,n))};return"/"===e?""===n?oi:i(this.getINode(t,e,oi)):i(this.getINode(t,e+ke.sep+n,this._findINode(t,ke.dirname(e),ke.basename(e))))},n.prototype.findINode=function(t,e){return this.getINode(t,e,this._findINode(t,ke.dirname(e),ke.basename(e)))},n.prototype.getINode=function(t,e,n){var r=t.get(n);if(void 0===r)throw Fe.ENOENT(e);return ii.fromBuffer(r)},n.prototype.getDirListing=function(t,e,n){if(!n.isDirectory())throw Fe.ENOTDIR(e);var r=t.get(n.id);if(void 0===r)throw Fe.ENOENT(e);return JSON.parse(r.toString())},n.prototype.addNewNode=function(t,e){for(var n,r=0;r<5;)try{return n=Tt(),t.put(n,e,!1),n}catch(t){}throw new Fe(be.EIO,"Unable to commit data to key-value store.")},n.prototype.commitNewFile=function(e,n,r,i,o){var s=ke.dirname(n),a=ke.basename(n),c=this.findINode(e,s),u=this.getDirListing(e,s,c),f=(new Date).getTime();if("/"===n)throw Fe.EEXIST(n);if(u[a])throw Fe.EEXIST(n);var h;try{var p=this.addNewNode(e,o);h=new ii(p,o.length,i|r,f,f,f);var l=this.addNewNode(e,h.toBuffer());u[a]=l,e.put(c.id,t.from(JSON.stringify(u)),!0)}catch(t){throw e.abort(),t}return e.commit(),h},n.prototype.removeEntry=function(e,n){var r=this.store.beginTransaction("readwrite"),i=ke.dirname(e),o=this.findINode(r,i),s=this.getDirListing(r,i,o),a=ke.basename(e);if(!s[a])throw Fe.ENOENT(e);var c=s[a];delete s[a];var u=this.getINode(r,e,c);if(!n&&u.isDirectory())throw Fe.EISDIR(e);if(n&&!u.isDirectory())throw Fe.ENOTDIR(e);try{r.del(u.id),r.del(c),r.put(o.id,t.from(JSON.stringify(s)),!0)}catch(t){throw r.abort(),t}r.commit()},n}(He),fi=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;this.isDirty()?this._fs._sync(this.getPath(),this.getBuffer(),this.getStats(),function(n){n||e.resetDirty(),t(n)}):t()},e.prototype.close=function(t){this.sync(t)},e}(Ye),hi=function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.isAvailable=function(){return!0},n.prototype.init=function(t,e){this.store=t,this.makeRootDirectory(e)},n.prototype.getName=function(){return this.store.name()},n.prototype.isReadOnly=function(){return!1},n.prototype.supportsSymlinks=function(){return!1},n.prototype.supportsProps=function(){return!1},n.prototype.supportsSynch=function(){return!1},n.prototype.empty=function(t){var e=this;this.store.clear(function(n){xt(n,t)&&e.makeRootDirectory(t)})},n.prototype.rename=function(e,n,r){var i=this,o=this.store.beginTransaction("readwrite"),s=ke.dirname(e),a=ke.basename(e),c=ke.dirname(n),u=ke.basename(n),f={},h={},p=!1;if(0===(c+"/").indexOf(e+"/"))return r(new Fe(be.EBUSY,s));var l=function(){if(!p&&h.hasOwnProperty(s)&&h.hasOwnProperty(c)){var l=h[s],d=f[s],y=h[c],g=f[c];if(l[a]){var v=l[a];delete l[a];var m=function(){y[u]=v,o.put(d.id,t.from(JSON.stringify(l)),!0,function(e){At(e,o,r)&&(s===c?o.commit(r):o.put(g.id,t.from(JSON.stringify(y)),!0,function(t){At(t,o,r)&&o.commit(r)}))})};y[u]?i.getINode(o,n,y[u],function(t,e){At(t,o,r)&&(e.isFile()?o.del(e.id,function(t){At(t,o,r)&&o.del(y[u],function(t){At(t,o,r)&&m()})}):o.abort(function(t){r(Fe.EPERM(n))}))}):m()}else r(Fe.ENOENT(e))}},d=function(t){i.findINodeAndDirListing(o,t,function(e,n,i){e?p||(p=!0,o.abort(function(){r(e)})):(f[t]=n,h[t]=i,l())})};d(s),s!==c&&d(c)},n.prototype.stat=function(t,e,n){var r=this.store.beginTransaction("readonly");this.findINode(r,t,function(t,e){xt(t,n)&&n(null,e.toStats())})},n.prototype.createFile=function(t,e,n,r){var i=this,o=this.store.beginTransaction("readwrite"),s=S();this.commitNewFile(o,t,Le.FILE,n,s,function(n,o){xt(n,r)&&r(null,new fi(i,t,e,o.toStats(),s))})},n.prototype.openFile=function(t,e,n){var r=this,i=this.store.beginTransaction("readonly");this.findINode(i,t,function(o,s){xt(o,n)&&i.get(s.id,function(i,o){xt(i,n)&&(void 0===o?n(Fe.ENOENT(t)):n(null,new fi(r,t,e,s.toStats(),o)))})})},n.prototype.unlink=function(t,e){this.removeEntry(t,!1,e)},n.prototype.rmdir=function(t,e){var n=this;this.readdir(t,function(r,i){r?e(r):i.length>0?e(Fe.ENOTEMPTY(t)):n.removeEntry(t,!0,e)})},n.prototype.mkdir=function(e,n,r){var i=this.store.beginTransaction("readwrite"),o=t.from("{}");this.commitNewFile(i,e,Le.DIRECTORY,n,o,r)},n.prototype.readdir=function(t,e){var n=this,r=this.store.beginTransaction("readonly");this.findINode(r,t,function(i,o){xt(i,e)&&n.getDirListing(r,t,o,function(t,n){xt(t,e)&&e(null,Object.keys(n))})})},n.prototype._sync=function(t,e,n,r){var i=this,o=this.store.beginTransaction("readwrite");this._findINode(o,ke.dirname(t),ke.basename(t),function(s,a){At(s,o,r)&&i.getINode(o,t,a,function(t,i){if(At(t,o,r)){var s=i.update(n);o.put(i.id,e,!0,function(t){At(t,o,r)&&(s?o.put(a,i.toBuffer(),!0,function(t){At(t,o,r)&&o.commit(r)}):o.commit(r))})}})})},n.prototype.makeRootDirectory=function(t){var e=this.store.beginTransaction("readwrite");e.get(oi,function(n,r){if(n||void 0===r){var i=(new Date).getTime(),o=new ii(Tt(),4096,511|Le.DIRECTORY,i,i,i);e.put(o.id,Lt(),!1,function(n){At(n,e,t)&&e.put(oi,o.toBuffer(),!1,function(n){n?e.abort(function(){t(n)}):e.commit(t)})})}else e.commit(t)})},n.prototype._findINode=function(t,e,n,r){var i=this,o=function(t,i,o){t?r(t):o[n]?r(null,o[n]):r(Fe.ENOENT(ke.resolve(e,n)))};"/"===e?""===n?r(null,oi):this.getINode(t,e,oi,function(n,s){xt(n,r)&&i.getDirListing(t,e,s,function(t,e){o(t,s,e)})}):this.findINodeAndDirListing(t,e,o)},n.prototype.findINode=function(t,e,n){var r=this;this._findINode(t,ke.dirname(e),ke.basename(e),function(i,o){xt(i,n)&&r.getINode(t,e,o,n)})},n.prototype.getINode=function(t,e,n,r){t.get(n,function(t,n){xt(t,r)&&(void 0===n?r(Fe.ENOENT(e)):r(null,ii.fromBuffer(n)))})},n.prototype.getDirListing=function(t,e,n,r){n.isDirectory()?t.get(n.id,function(t,n){if(xt(t,r))try{r(null,JSON.parse(n.toString()))}catch(t){r(Fe.ENOENT(e))}}):r(Fe.ENOTDIR(e))},n.prototype.findINodeAndDirListing=function(t,e,n){var r=this;this.findINode(t,e,function(i,o){xt(i,n)&&r.getDirListing(t,e,o,function(t,e){xt(t,n)&&n(null,o,e)})})},n.prototype.addNewNode=function(t,e,n){var r,i=0,o=function(){5===++i?n(new Fe(be.EIO,"Unable to commit data to key-value store.")):(r=Tt(),t.put(r,e,!1,function(t,e){t||!e?o():n(null,r)}))};o()},n.prototype.commitNewFile=function(e,n,r,i,o,s){var a=this,c=ke.dirname(n),u=ke.basename(n),f=(new Date).getTime();return"/"===n?s(Fe.EEXIST(n)):void this.findINodeAndDirListing(e,c,function(c,h,p){At(c,e,s)&&(p[u]?e.abort(function(){s(Fe.EEXIST(n))}):a.addNewNode(e,o,function(n,c){if(At(n,e,s)){var l=new ii(c,o.length,i|r,f,f,f);a.addNewNode(e,l.toBuffer(),function(n,r){At(n,e,s)&&(p[u]=r,e.put(h.id,t.from(JSON.stringify(p)),!0,function(t){At(t,e,s)&&e.commit(function(t){At(t,e,s)&&s(null,l)})}))})}}))})},n.prototype.removeEntry=function(e,n,r){var i=this,o=this.store.beginTransaction("readwrite"),s=ke.dirname(e),a=ke.basename(e);this.findINodeAndDirListing(o,s,function(s,c,u){if(At(s,o,r))if(u[a]){var f=u[a];delete u[a],i.getINode(o,e,f,function(i,s){At(i,o,r)&&(!n&&s.isDirectory()?o.abort(function(){r(Fe.EISDIR(e))}):n&&!s.isDirectory()?o.abort(function(){r(Fe.ENOTDIR(e))}):o.del(s.id,function(e){At(e,o,r)&&o.del(f,function(e){At(e,o,r)&&o.put(c.id,t.from(JSON.stringify(u)),!0,function(t){At(t,o,r)&&o.commit(r)})})}))})}else o.abort(function(){r(Fe.ENOENT(e))})})},n}(We),pi=function(){this.store={}};pi.prototype.name=function(){return li.Name},pi.prototype.clear=function(){this.store={}},pi.prototype.beginTransaction=function(t){return new ai(this)},pi.prototype.get=function(t){return this.store[t]},pi.prototype.put=function(t,e,n){return!(!n&&this.store.hasOwnProperty(t))&&(this.store[t]=e,!0)},pi.prototype.del=function(t){delete this.store[t]};var li=function(t){function e(){t.call(this,{store:new pi})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){n(null,new e)},e}(ui);li.Name="InMemory",li.Options={};var di=ti.indexedDB||ti.mozIndexedDB||ti.webkitIndexedDB||ti.msIndexedDB,yi=function(t,e){this.tx=t,this.store=e};yi.prototype.get=function(t,e){try{var n=this.store.get(t);n.onerror=Pt(e),n.onsuccess=function(t){var n=t.target.result;void 0===n?e(null,n):e(null,E(n))}}catch(t){e(Dt(t))}};var gi=function(t){function e(e,n){t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.put=function(t,e,n,r){try{var i,o=v(e);i=n?this.store.put(o,t):this.store.add(o,t),i.onerror=Pt(r),i.onsuccess=function(t){r(null,!0)}}catch(t){r(Dt(t))}},e.prototype.del=function(t,e){try{var n=this.store.delete(t);n.onerror=Pt(e),n.onsuccess=function(t){e()}}catch(t){e(Dt(t))}},e.prototype.commit=function(t){setTimeout(t,0)},e.prototype.abort=function(t){var e=null;try{this.tx.abort()}catch(t){e=Dt(t)}finally{t(e)}},e}(yi),vi=function(t,e){var n=this;void 0===e&&(e="browserfs"),this.storeName=e;var r=di.open(this.storeName,1);r.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(n.storeName)&&e.deleteObjectStore(n.storeName),e.createObjectStore(n.storeName)},r.onsuccess=function(e){n.db=e.target.result,t(null,n)},r.onerror=Pt(t,be.EACCES)};vi.prototype.name=function(){return mi.Name+" - "+this.storeName},vi.prototype.clear=function(t){try{var e=this.db.transaction(this.storeName,"readwrite"),n=e.objectStore(this.storeName),r=n.clear();r.onsuccess=function(e){setTimeout(t,0)},r.onerror=Pt(t)}catch(e){t(Dt(e))}},vi.prototype.beginTransaction=function(t){void 0===t&&(t="readonly");var e=this.db.transaction(this.storeName,t),n=e.objectStore(this.storeName);if("readwrite"===t)return new gi(e,n);if("readonly"===t)return new yi(e,n);throw new Fe(be.EINVAL,"Invalid transaction type.")};var mi=function(t){function e(n,r,i){var o=this;void 0===i&&(i=!0),t.call(this),this.store=new vi(function(t){t?n(t):o.init(o.store,function(t){n(t,o)})},r),d(i,e.Name,{storeName:r})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){new e(n,t.storeName,!1)},e.isAvailable=function(){try{return"undefined"!=typeof di&&null!==di.open("__browserfs_test__")}catch(t){return!1}},e}(hi);mi.Name="IndexedDB",mi.Options={storeName:{type:"string",optional:!0,description:"The name of this file system. You can have multiple IndexedDB file systems operating at once, but each must have a different name."}};var _i,wi=!1;try{ti.localStorage.setItem("__test__",String.fromCharCode(55296)),wi=ti.localStorage.getItem("__test__")===String.fromCharCode(55296)}catch(t){wi=!1}_i=wi?"binary_string":"binary_string_ie",t.isEncoding(_i)||(_i="base64");var Ei=function(){};Ei.prototype.name=function(){return bi.Name},Ei.prototype.clear=function(){ti.localStorage.clear()},Ei.prototype.beginTransaction=function(t){return new ai(this)},Ei.prototype.get=function(e){try{var n=ti.localStorage.getItem(e);if(null!==n)return t.from(n,_i)}catch(t){}},Ei.prototype.put=function(t,e,n){try{return!(!n&&null!==ti.localStorage.getItem(t))&&(ti.localStorage.setItem(t,e.toString(_i)),!0)}catch(t){throw new Fe(be.ENOSPC,"LocalStorage is full.")}},Ei.prototype.del=function(t){try{ti.localStorage.removeItem(t)}catch(e){throw new Fe(be.EIO,"Unable to delete key "+t+": "+e)}};var bi=function(t){function e(){t.call(this,{store:new Ei})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){n(null,new e)},e.isAvailable=function(){return"undefined"!=typeof ti.localStorage},e}(ui);bi.Name="LocalStorage",bi.Options={};var Si=function(t){function e(){t.call(this),this.mountList=[],this.mntMap={},this.rootFs=new li}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){var r=new e;Object.keys(t).forEach(function(e){r.mount(e,t[e])}),n(null,r)},e.isAvailable=function(){return!0},e.prototype.mount=function(t,e){if("/"!==t[0]&&(t="/"+t),t=ke.resolve(t),this.mntMap[t])throw new Fe(be.EINVAL,"Mount point "+t+" is already taken.");g(t,511,this.rootFs),this.mntMap[t]=e,this.mountList.push(t),this.mountList=this.mountList.sort(function(t,e){return e.length-t.length})},e.prototype.umount=function(t){var e=this;if("/"!==t[0]&&(t="/"+t),t=ke.resolve(t),!this.mntMap[t])throw new Fe(be.EINVAL,"Mount point "+t+" is already unmounted.");for(delete this.mntMap[t],this.mountList.splice(this.mountList.indexOf(t),1);"/"!==t&&0===e.rootFs.readdirSync(t).length;)e.rootFs.rmdirSync(t),t=ke.dirname(t)},e.prototype._getFs=function(t){for(var e=this,n=this.mountList,r=n.length,i=0;i1?o.length:0),""===t&&(t="/"),{fs:e.mntMap[o],path:t}}return{fs:this.rootFs,path:t}},e.prototype.getName=function(){return e.Name},e.prototype.diskSpace=function(t,e){e(0,0)},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.standardizeError=function(t,e,n){var r=t.message.indexOf(e);return r!==-1&&(t.message=t.message.substr(0,r)+n+t.message.substr(r+e.length),t.path=n),t},e.prototype.rename=function(t,e,n){var r=this,i=this._getFs(t),o=this._getFs(e);return i.fs===o.fs?i.fs.rename(i.path,o.path,function(s){s&&r.standardizeError(r.standardizeError(s,i.path,t),o.path,e),n(s)}):Pe.readFile(t,function(r,i){return r?n(r):void Pe.writeFile(e,i,function(e){return e?n(e):void Pe.unlink(t,n)})})},e.prototype.renameSync=function(t,e){var n=this._getFs(t),r=this._getFs(e);if(n.fs===r.fs)try{return n.fs.renameSync(n.path,r.path)}catch(i){ -throw this.standardizeError(this.standardizeError(i,n.path,t),r.path,e),i}var i=Pe.readFileSync(t);return Pe.writeFileSync(e,i),Pe.unlinkSync(t)},e.prototype.readdirSync=function(t){var e=this._getFs(t),n=null;if(e.fs!==this.rootFs)try{n=this.rootFs.readdirSync(t)}catch(t){}try{var r=e.fs.readdirSync(e.path);return null===n?r:r.concat(n.filter(function(t){return r.indexOf(t)===-1}))}catch(r){if(null===n)throw this.standardizeError(r,e.path,t);return n}},e.prototype.readdir=function(t,e){var n=this,r=this._getFs(t);r.fs.readdir(r.path,function(i,o){if(r.fs!==n.rootFs)try{var s=n.rootFs.readdirSync(t);o=o?o.concat(s.filter(function(t){return o.indexOf(t)===-1})):s}catch(o){if(i)return e(n.standardizeError(i,r.path,t))}else if(i)return e(n.standardizeError(i,r.path,t));e(null,o)})},e.prototype.rmdirSync=function(t){var e=this._getFs(t);if(this._containsMountPt(t))throw Fe.ENOTEMPTY(t);try{e.fs.rmdirSync(e.path)}catch(n){throw this.standardizeError(n,e.path,t)}},e.prototype.rmdir=function(t,e){var n=this,r=this._getFs(t);this._containsMountPt(t)?e(Fe.ENOTEMPTY(t)):r.fs.rmdir(r.path,function(i){e(i?n.standardizeError(i,r.path,t):null)})},e.prototype._containsMountPt=function(t){for(var e=this.mountList,n=e.length,r=0;r=t.length&&i.slice(0,t.length)===t)return!0}return!1},e}(We);Si.Name="MountableFileSystem",Si.Options={};for(var ki=[["exists","unlink","readlink"],["stat","mkdir","realpath","truncate"],["open","readFile","chmod","utimes"],["chown"],["writeFile","appendFile"]],Ii=0;Ii0)){var e=xi.shift();return e()}};Ti.addEventListener?Ti.addEventListener("message",Pi,!0):Ti.attachEvent("onmessage",Pi)}else if(Ti.MessageChannel){var Ci=new Ti.MessageChannel;Ci.port1.onmessage=function(t){if(xi.length>0)return xi.shift()()},Li=function(t){xi.push(t),Ci.port2.postMessage("")}}else Li=function(t){return setTimeout(t,0)}}var Ui=Li,Mi=function(){this._locked=!1,this._waiters=[]};Mi.prototype.lock=function(t){return this._locked?void this._waiters.push(t):(this._locked=!0,void t())},Mi.prototype.unlock=function(){if(!this._locked)throw new Error("unlock of a non-locked mutex");var t=this._waiters.shift();return t?void Ui(t):void(this._locked=!1)},Mi.prototype.tryLock=function(){return!this._locked&&(this._locked=!0,!0)},Mi.prototype.isLocked=function(){return this._locked};var ji=function(t){this._fs=t,this._mu=new Mi};ji.prototype.getName=function(){return"LockedFS<"+this._fs.getName()+">"},ji.prototype.getFSUnlocked=function(){return this._fs},ji.prototype.initialize=function(t){this._fs.initialize(t)},ji.prototype.diskSpace=function(t,e){this._fs.diskSpace(t,e)},ji.prototype.isReadOnly=function(){return this._fs.isReadOnly()},ji.prototype.supportsLinks=function(){return this._fs.supportsLinks()},ji.prototype.supportsProps=function(){return this._fs.supportsProps()},ji.prototype.supportsSynch=function(){return this._fs.supportsSynch()},ji.prototype.rename=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.rename(t,e,function(t){r._mu.unlock(),n(t)})})},ji.prototype.renameSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.renameSync(t,e)},ji.prototype.stat=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.stat(t,e,function(t,e){r._mu.unlock(),n(t,e)})})},ji.prototype.statSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.statSync(t,e)},ji.prototype.open=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.open(t,e,n,function(t,e){i._mu.unlock(),r(t,e)})})},ji.prototype.openSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.openSync(t,e,n)},ji.prototype.unlink=function(t,e){var n=this;this._mu.lock(function(){n._fs.unlink(t,function(t){n._mu.unlock(),e(t)})})},ji.prototype.unlinkSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.unlinkSync(t)},ji.prototype.rmdir=function(t,e){var n=this;this._mu.lock(function(){n._fs.rmdir(t,function(t){n._mu.unlock(),e(t)})})},ji.prototype.rmdirSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.rmdirSync(t)},ji.prototype.mkdir=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.mkdir(t,e,function(t){r._mu.unlock(),n(t)})})},ji.prototype.mkdirSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.mkdirSync(t,e)},ji.prototype.readdir=function(t,e){var n=this;this._mu.lock(function(){n._fs.readdir(t,function(t,r){n._mu.unlock(),e(t,r)})})},ji.prototype.readdirSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readdirSync(t)},ji.prototype.exists=function(t,e){var n=this;this._mu.lock(function(){n._fs.exists(t,function(t){n._mu.unlock(),e(t)})})},ji.prototype.existsSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.existsSync(t)},ji.prototype.realpath=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.realpath(t,e,function(t,e){r._mu.unlock(),n(t,e)})})},ji.prototype.realpathSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.realpathSync(t,e)},ji.prototype.truncate=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.truncate(t,e,function(t){r._mu.unlock(),n(t)})})},ji.prototype.truncateSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.truncateSync(t,e)},ji.prototype.readFile=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.readFile(t,e,n,function(t,e){i._mu.unlock(),r(t,e)})})},ji.prototype.readFileSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readFileSync(t,e,n)},ji.prototype.writeFile=function(t,e,n,r,i,o){var s=this;this._mu.lock(function(){s._fs.writeFile(t,e,n,r,i,function(t){s._mu.unlock(),o(t)})})},ji.prototype.writeFileSync=function(t,e,n,r,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.writeFileSync(t,e,n,r,i)},ji.prototype.appendFile=function(t,e,n,r,i,o){var s=this;this._mu.lock(function(){s._fs.appendFile(t,e,n,r,i,function(t){s._mu.unlock(),o(t)})})},ji.prototype.appendFileSync=function(t,e,n,r,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.appendFileSync(t,e,n,r,i)},ji.prototype.chmod=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.chmod(t,e,n,function(t){i._mu.unlock(),r(t)})})},ji.prototype.chmodSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.chmodSync(t,e,n)},ji.prototype.chown=function(t,e,n,r,i){var o=this;this._mu.lock(function(){o._fs.chown(t,e,n,r,function(t){o._mu.unlock(),i(t)})})},ji.prototype.chownSync=function(t,e,n,r){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.chownSync(t,e,n,r)},ji.prototype.utimes=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.utimes(t,e,n,function(t){i._mu.unlock(),r(t)})})},ji.prototype.utimesSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.utimesSync(t,e,n)},ji.prototype.link=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.link(t,e,function(t){r._mu.unlock(),n(t)})})},ji.prototype.linkSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.linkSync(t,e)},ji.prototype.symlink=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.symlink(t,e,n,function(t){i._mu.unlock(),r(t)})})},ji.prototype.symlinkSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.symlinkSync(t,e,n)},ji.prototype.readlink=function(t,e){var n=this;this._mu.lock(function(){n._fs.readlink(t,function(t,r){n._mu.unlock(),e(t,r)})})},ji.prototype.readlinkSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readlinkSync(t)};var Bi="/.deletedFiles.log",zi=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;return this.isDirty()?void this._fs._syncAsync(this,function(n){e.resetDirty(),t(n)}):void t(null)},e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())},e.prototype.close=function(t){this.sync(t)},e.prototype.closeSync=function(){this.syncSync()},e}(Ye),qi=function(t){function e(e,n){if(t.call(this),this._isInitialized=!1,this._initializeCallbacks=[],this._deletedFiles={},this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this._deleteLogError=null,this._writable=e,this._readable=n,this._writable.isReadOnly())throw new Fe(be.EINVAL,"Writable file system must be writable.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.isAvailable=function(){return!0},e.prototype.getOverlayedFileSystems=function(){return{readable:this._readable,writable:this._writable}},e.prototype._syncAsync=function(t,e){var n=this;this.createParentDirectoriesAsync(t.getPath(),function(r){return r?e(r):void n._writable.writeFile(t.getPath(),t.getBuffer(),null,Mt("w"),t.getStats().mode,e)})},e.prototype._syncSync=function(t){this.createParentDirectories(t.getPath()),this._writable.writeFileSync(t.getPath(),t.getBuffer(),null,Mt("w"),t.getStats().mode)},e.prototype.getName=function(){return Vi.Name},e.prototype.initialize=function(t){var e=this,n=this._initializeCallbacks,r=function(t){e._isInitialized=!t,e._initializeCallbacks=[],n.forEach(function(e){return e(t)})};return this._isInitialized?t():(n.push(t),void(1===n.length&&this._writable.readFile(Bi,"utf8",Mt("r"),function(t,n){if(t){if(t.errno!==be.ENOENT)return r(t)}else e._deleteLog=n;e._reparseDeletionLog(),r()})))},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSynch=function(){return this._readable.supportsSynch()&&this._writable.supportsSynch()},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return this._readable.supportsProps()&&this._writable.supportsProps()},e.prototype.getDeletionLog=function(){return this._deleteLog},e.prototype.restoreDeletionLog=function(t){this._deleteLog=t,this._reparseDeletionLog(),this.updateLog("")},e.prototype.rename=function(t,e,n){var r=this;if(this.checkInitAsync(n)&&!this.checkPathAsync(t,n)&&!this.checkPathAsync(e,n))return t===Bi||e===Bi?n(Fe.EPERM("Cannot rename deletion log.")):t===e?n():void this.stat(t,!1,function(i,o){return i?n(i):r.stat(e,!1,function(i,s){function a(r){var i=r.shift();if(!i)return n();var o=ke.resolve(t,i),s=ke.resolve(e,i);c.rename(o,s,function(t){return t?n(t):void a(r)})}var c=r,u=511;if(o.isDirectory()){if(i)return i.errno!==be.ENOENT?n(i):r._writable.exists(t,function(i){return i?r._writable.rename(t,e,n):void r._writable.mkdir(e,u,function(e){return e?n(e):void r._readable.readdir(t,function(t,e){return t?n():void a(e)})})});if(u=s.mode,!s.isDirectory())return n(Fe.ENOTDIR(e));r.readdir(e,function(i,o){return o&&o.length?n(Fe.ENOTEMPTY(e)):void r._readable.readdir(t,function(t,e){return t?n():void a(e)})})}return s&&s.isDirectory()?n(Fe.EISDIR(e)):void r.readFile(t,null,Mt("r"),function(i,s){return i?n(i):r.writeFile(e,s,null,Mt("w"),o.mode,function(e){return e?n(e):r.unlink(t,n)})})})})},e.prototype.renameSync=function(t,e){var n=this;if(this.checkInitialized(),this.checkPath(t),this.checkPath(e),t===Bi||e===Bi)throw Fe.EPERM("Cannot rename deletion log.");var r=this.statSync(t,!1);if(r.isDirectory()){if(t===e)return;var i=511;if(this.existsSync(e)){var o=this.statSync(e,!1);if(i=o.mode,!o.isDirectory())throw Fe.ENOTDIR(e);if(this.readdirSync(e).length>0)throw Fe.ENOTEMPTY(e)}this._writable.existsSync(t)?this._writable.renameSync(t,e):this._writable.existsSync(e)||this._writable.mkdirSync(e,i),this._readable.existsSync(t)&&this._readable.readdirSync(t).forEach(function(r){n.renameSync(ke.resolve(t,r),ke.resolve(e,r))})}else{if(this.existsSync(e)&&this.statSync(e,!1).isDirectory())throw Fe.EISDIR(e);this.writeFileSync(e,this.readFileSync(t,null,Mt("r")),null,Mt("w"),r.mode)}t!==e&&this.existsSync(t)&&this.unlinkSync(t)},e.prototype.stat=function(t,e,n){var r=this;this.checkInitAsync(n)&&this._writable.stat(t,e,function(i,o){i&&i.errno===be.ENOENT?(r._deletedFiles[t]&&n(Fe.ENOENT(t)),r._readable.stat(t,e,function(t,e){e&&(e=e.clone(),e.mode=Ut(e.mode)),n(t,e)})):n(i,o)})},e.prototype.statSync=function(t,e){this.checkInitialized();try{return this._writable.statSync(t,e)}catch(r){if(this._deletedFiles[t])throw Fe.ENOENT(t);var n=this._readable.statSync(t,e).clone();return n.mode=Ut(n.mode),n}},e.prototype.open=function(t,e,n,r){var i=this;this.checkInitAsync(r)&&!this.checkPathAsync(t,r)&&this.stat(t,!1,function(o,s){if(s)switch(e.pathExistsAction()){case Oe.TRUNCATE_FILE:return i.createParentDirectoriesAsync(t,function(o){return o?r(o):void i._writable.open(t,e,n,r)});case Oe.NOP:return i._writable.exists(t,function(o){o?i._writable.open(t,e,n,r):(s=s.clone(),s.mode=n,i._readable.readFile(t,null,Mt("r"),function(n,o){if(n)return r(n);s.size===-1&&(s.size=o.length);var a=new zi(i,t,e,s,o);r(null,a)}))});default:return r(Fe.EEXIST(t))}else switch(e.pathNotExistsAction()){case Oe.CREATE_FILE:return i.createParentDirectoriesAsync(t,function(o){return o?r(o):i._writable.open(t,e,n,r)});default:return r(Fe.ENOENT(t))}})},e.prototype.openSync=function(t,e,n){if(this.checkInitialized(),this.checkPath(t),t===Bi)throw Fe.EPERM("Cannot open deletion log.");if(this.existsSync(t))switch(e.pathExistsAction()){case Oe.TRUNCATE_FILE:return this.createParentDirectories(t),this._writable.openSync(t,e,n);case Oe.NOP:if(this._writable.existsSync(t))return this._writable.openSync(t,e,n);var r=this._readable.readFileSync(t,null,Mt("r")),i=this._readable.statSync(t,!1).clone();return i.mode=n,new zi(this,t,e,i,r);default:throw Fe.EEXIST(t)}else switch(e.pathNotExistsAction()){case Oe.CREATE_FILE:return this.createParentDirectories(t),this._writable.openSync(t,e,n);default:throw Fe.ENOENT(t)}},e.prototype.unlink=function(t,e){var n=this;this.checkInitAsync(e)&&!this.checkPathAsync(t,e)&&this.exists(t,function(r){return r?void n._writable.exists(t,function(r){return r?n._writable.unlink(t,function(r){return r?e(r):void n.exists(t,function(r){r&&n.deletePath(t),e(null)})}):(n.deletePath(t),void e(null))}):e(Fe.ENOENT(t))})},e.prototype.unlinkSync=function(t){if(this.checkInitialized(),this.checkPath(t),!this.existsSync(t))throw Fe.ENOENT(t);this._writable.existsSync(t)&&this._writable.unlinkSync(t),this.existsSync(t)&&this.deletePath(t)},e.prototype.rmdir=function(t,e){var n=this;if(this.checkInitAsync(e)){var r=function(){n.readdir(t,function(r,i){return r?e(r):i.length?e(Fe.ENOTEMPTY(t)):(n.deletePath(t),void e(null))})};this.exists(t,function(i){return i?void n._writable.exists(t,function(i){i?n._writable.rmdir(t,function(i){return i?e(i):void n._readable.exists(t,function(t){t?r():e()})}):r()}):e(Fe.ENOENT(t))})}},e.prototype.rmdirSync=function(t){if(this.checkInitialized(),!this.existsSync(t))throw Fe.ENOENT(t);if(this._writable.existsSync(t)&&this._writable.rmdirSync(t),this.existsSync(t)){if(this.readdirSync(t).length>0)throw Fe.ENOTEMPTY(t);this.deletePath(t)}},e.prototype.mkdir=function(t,e,n){var r=this;this.checkInitAsync(n)&&this.exists(t,function(i){return i?n(Fe.EEXIST(t)):void r.createParentDirectoriesAsync(t,function(i){return i?n(i):void r._writable.mkdir(t,e,n)})})},e.prototype.mkdirSync=function(t,e){if(this.checkInitialized(),this.existsSync(t))throw Fe.EEXIST(t);this.createParentDirectories(t),this._writable.mkdirSync(t,e)},e.prototype.readdir=function(t,e){var n=this;this.checkInitAsync(e)&&this.stat(t,!1,function(r,i){return r?e(r):i.isDirectory()?void n._writable.readdir(t,function(r,i){return r&&"ENOENT"!==r.code?e(r):(!r&&i||(i=[]),void n._readable.readdir(t,function(r,o){!r&&o||(o=[]);var s={},a=i.concat(o.filter(function(e){return!n._deletedFiles[t+"/"+e]})).filter(function(t){var e=!s[t];return s[t]=!0,e});e(null,a)}))}):e(Fe.ENOTDIR(t))})},e.prototype.readdirSync=function(t){var e=this;this.checkInitialized();var n=this.statSync(t,!1);if(!n.isDirectory())throw Fe.ENOTDIR(t);var r=[];try{r=r.concat(this._writable.readdirSync(t))}catch(t){}try{r=r.concat(this._readable.readdirSync(t).filter(function(n){return!e._deletedFiles[t+"/"+n]}))}catch(t){}var i={};return r.filter(function(t){var e=!i[t];return i[t]=!0,e})},e.prototype.exists=function(t,e){var n=this;this.checkInitialized(),this._writable.exists(t,function(r){return r?e(!0):void n._readable.exists(t,function(r){e(r&&n._deletedFiles[t]!==!0)})})},e.prototype.existsSync=function(t){return this.checkInitialized(),this._writable.existsSync(t)||this._readable.existsSync(t)&&this._deletedFiles[t]!==!0},e.prototype.chmod=function(t,e,n,r){var i=this;this.checkInitAsync(r)&&this.operateOnWritableAsync(t,function(o){return o?r(o):void i._writable.chmod(t,e,n,r)})},e.prototype.chmodSync=function(t,e,n){var r=this;this.checkInitialized(),this.operateOnWritable(t,function(){r._writable.chmodSync(t,e,n)})},e.prototype.chown=function(t,e,n,r,i){var o=this;this.checkInitAsync(i)&&this.operateOnWritableAsync(t,function(s){return s?i(s):void o._writable.chown(t,e,n,r,i)})},e.prototype.chownSync=function(t,e,n,r){var i=this;this.checkInitialized(),this.operateOnWritable(t,function(){i._writable.chownSync(t,e,n,r)})},e.prototype.utimes=function(t,e,n,r){var i=this;this.checkInitAsync(r)&&this.operateOnWritableAsync(t,function(o){return o?r(o):void i._writable.utimes(t,e,n,r)})},e.prototype.utimesSync=function(t,e,n){var r=this;this.checkInitialized(),this.operateOnWritable(t,function(){r._writable.utimesSync(t,e,n)})},e.prototype.deletePath=function(t){this._deletedFiles[t]=!0,this.updateLog("d"+t+"\n")},e.prototype.updateLog=function(t){var e=this;this._deleteLog+=t,this._deleteLogUpdatePending?this._deleteLogUpdateNeeded=!0:(this._deleteLogUpdatePending=!0,this._writable.writeFile(Bi,this._deleteLog,"utf8",Re.getFileFlag("w"),420,function(t){e._deleteLogUpdatePending=!1,t?e._deleteLogError=t:e._deleteLogUpdateNeeded&&(e._deleteLogUpdateNeeded=!1,e.updateLog(""))}))},e.prototype._reparseDeletionLog=function(){var t=this;this._deletedFiles={},this._deleteLog.split("\n").forEach(function(e){t._deletedFiles[e.slice(1)]="d"===e.slice(0,1)})},e.prototype.checkInitialized=function(){if(!this._isInitialized)throw new Fe(be.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(null!==this._deleteLogError){var t=this._deleteLogError;throw this._deleteLogError=null,t}},e.prototype.checkInitAsync=function(t){if(!this._isInitialized)return t(new Fe(be.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.")),!1;if(null!==this._deleteLogError){var e=this._deleteLogError;return this._deleteLogError=null,t(e),!1}return!0},e.prototype.checkPath=function(t){if(t===Bi)throw Fe.EPERM(t)},e.prototype.checkPathAsync=function(t,e){return t===Bi&&(e(Fe.EPERM(t)),!0)},e.prototype.createParentDirectoriesAsync=function(t,e){function n(t,e){t?(o.push(i),i=ke.dirname(i),s._writable.stat(i,!1,n)):r()}function r(){if(!o.length)return e();var t=o.pop();s._readable.stat(t,!1,function(n,i){return i?void s._writable.mkdir(t,i.mode,function(t){return t?e(t):void r()}):e()})}var i=ke.dirname(t),o=[],s=this;this._writable.stat(i,!1,n)},e.prototype.createParentDirectories=function(t){for(var e=this,n=ke.dirname(t),r=[];!this._writable.existsSync(n);)r.push(n),n=ke.dirname(n);r=r.reverse(),r.forEach(function(t){e._writable.mkdirSync(t,e.statSync(t,!1).mode)})},e.prototype.operateOnWritable=function(t,e){if(!this.existsSync(t))throw Fe.ENOENT(t);this._writable.existsSync(t)||this.copyToWritable(t),e()},e.prototype.operateOnWritableAsync=function(t,e){var n=this;this.exists(t,function(r){return r?void n._writable.exists(t,function(r){return r?void e():n.copyToWritableAsync(t,e)}):e(Fe.ENOENT(t))})},e.prototype.copyToWritable=function(t){var e=this.statSync(t,!1);e.isDirectory()?this._writable.mkdirSync(t,e.mode):this.writeFileSync(t,this._readable.readFileSync(t,null,Mt("r")),null,Mt("w"),this.statSync(t,!1).mode)},e.prototype.copyToWritableAsync=function(t,e){var n=this;this.stat(t,!1,function(r,i){return r?e(r):i.isDirectory()?n._writable.mkdir(t,i.mode,e):void n._readable.readFile(t,null,Mt("r"),function(r,o){return r?e(r):void n.writeFile(t,o,null,Mt("w"),i.mode,e)})})},e}(We),Vi=function(t){function e(n,r,i){void 0===i&&(i=!0),t.call(this,new qi(n,r)),d(i,e.Name,{readable:"readable file system",writable:"writable file system"})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){try{var r=new e(t.writable,t.readable,!1);r.initialize(function(t){n(t,r)},!1)}catch(t){n(t)}},e.isAvailable=function(){return qi.isAvailable()},e.prototype.initialize=function(e,n){void 0===n&&(n=!0),n&&console.warn("[OverlayFS] OverlayFS.initialize() is deprecated and will be removed in the next major release. Please use 'OverlayFS.Create({readable: readable file system instance, writable: writable file system instance}, cb)' to create and initialize OverlayFS instances."),t.prototype.initialize.call(this,e)},e.prototype.getOverlayedFileSystems=function(){return t.prototype.getFSUnlocked.call(this).getOverlayedFileSystems()},e.prototype.unwrap=function(){return t.prototype.getFSUnlocked.call(this)},e}(ji);Vi.Name="OverlayFS",Vi.Options={writable:{type:"object",description:"The file system to write modified files to."},readable:{type:"object",description:"The file system that initially populates this file system."}};var Wi;!function(t){t[t.CB=0]="CB",t[t.FD=1]="FD",t[t.API_ERROR=2]="API_ERROR",t[t.STATS=3]="STATS",t[t.PROBE=4]="PROBE",t[t.FILEFLAG=5]="FILEFLAG",t[t.BUFFER=6]="BUFFER",t[t.ERROR=7]="ERROR"}(Wi||(Wi={}));var Hi=function(){this._callbacks={},this._nextId=0};Hi.prototype.toRemoteArg=function(t){var e=this._nextId++;return this._callbacks[e]=t,{type:Wi.CB,id:e}},Hi.prototype.toLocalArg=function(t){var e=this._callbacks[t];return delete this._callbacks[t],e};var Zi=function(){this._fileDescriptors={},this._nextId=0};Zi.prototype.toRemoteArg=function(e,n,r,i){var o,s,a=this._nextId++;this._fileDescriptors[a]=e,e.stat(function(c,u){c?i(c):(s=Yt(u.toBuffer()),r.isReadable()?e.read(t.alloc(u.size),0,u.size,0,function(t,e,c){t?i(t):(o=Yt(c),i(null,{type:Wi.FD,id:a,data:o,stat:s,path:n,flag:r.getFlagString()}))}):i(null,{type:Wi.FD,id:a,data:new ArrayBuffer(0),stat:s,path:n,flag:r.getFlagString()}))})},Zi.prototype.applyFdAPIRequest=function(t,e){var n=this,r=t.args[0];this._applyFdChanges(r,function(i,o){i?e(i):o[t.method](function(i){"close"===t.method&&delete n._fileDescriptors[r.id],e(i)})})},Zi.prototype._applyFdChanges=function(t,e){var n=this._fileDescriptors[t.id],r=Xt(t.data),i=Te.fromBuffer(Xt(t.stat)),o=Re.getFileFlag(t.flag);o.isWriteable()?n.write(r,0,r.length,o.isAppendable()?n.getPos():0,function(t){function s(){n.stat(function(t,r){t?e(t):r.mode!==i.mode?n.chmod(i.mode,function(t){e(t,n)}):e(t,n)})}t?e(t):o.isAppendable()?s():n.truncate(r.length,function(){s()})}):e(null,n)};var Yi=function(t){function e(e,n,r,i,o,s){t.call(this,e,n,r,i,s),this._remoteFdId=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getRemoteFdId=function(){return this._remoteFdId},e.prototype.toRemoteArg=function(){return{type:Wi.FD,id:this._remoteFdId,data:Yt(this.getBuffer()),stat:Yt(this.getStats().toBuffer()),path:this.getPath(),flag:this.getFlag().getFlagString()}},e.prototype.sync=function(t){this._syncClose("sync",t)},e.prototype.close=function(t){this._syncClose("close",t)},e.prototype._syncClose=function(t,e){var n=this;this.isDirty()?this._fs.syncClose(t,this,function(t){t||n.resetDirty(),e(t)}):e()},e}(Ye),Xi=function(e){function n(t,r){var i=this;void 0===r&&(r=!0),e.call(this),this._callbackConverter=new Hi,this._isInitialized=!1,this._isReadOnly=!1,this._supportLinks=!1,this._supportProps=!1,this._worker=t,d(r,n.Name,{worker:"Web Worker instance"}),this._worker.addEventListener("message",function(t){var e=t.data;if(Qt(e)){var n,r=e.args,o=new Array(r.length);for(n=0;n0&&(u=-1,s={browserfsMessage:!0,cbId:o,args:[jt(t)]},e.postMessage(s))}var i,s,a=arguments,c=new Array(arguments.length),u=arguments.length;for(i=0;i0;){var i=void 0,o=r.pop(),s=o[0],a=o[1],c=o[2];for(var u in a)if(a.hasOwnProperty(u)){var f=a[u],h=s+"/"+u;f?(e._index[h]=i=new $i,r.push([h,f,i])):i=new Qi(new Te(Le.FILE,-1,365)),c&&(c._ls[u]=i)}}return e},Gi.prototype.fileIterator=function(t){var e=this;for(var n in e._index)if(e._index.hasOwnProperty(n))for(var r=e._index[n],i=r.getListing(),o=0,s=i;o0&&"/"!==r.charAt(r.length-1)&&(r+="/"),this.prefixUrl=r;var o=null;if("string"==typeof n){if(o=this._requestFileSync(n,"json"),!o)throw new Error("Unable to find listing at URL: ${listingUrlOrObj}")}else o=n;d(i,e.Name,{index:"string"==typeof n?n:"file index as an object",baseUrl:r}),this._index=Gi.fromListing(o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){void 0===t.index&&(t.index="index.json"),"string"==typeof t.index?e.FromURL(t.index,n,t.baseUrl,!1):n(null,new e(t.index,t.baseUrl,!1))},e.isAvailable=function(){return"undefined"!=typeof XMLHttpRequest&&null!==XMLHttpRequest},e.FromURL=function(t,n,r,i){void 0===r&&(r=t.slice(0,t.lastIndexOf("/")+1)),void 0===i&&(i=!0),i&&console.warn("[XmlHttpRequest] XmlHttpRequest.FromURL() is deprecated and will be removed in the next major release. Please use 'XmlHttpRequest.Create({ index: \""+t+'", baseUrl: "'+r+"\" }, cb)' instead."),Ki(t,"json",function(t,i){t?n(t):n(null,new e(i,r,!1))})},e.prototype.empty=function(){this._index.fileIterator(function(t){t.fileData=null})},e.prototype.getName=function(){return e.Name},e.prototype.diskSpace=function(t,e){e(0,0)},e.prototype.isReadOnly=function(){return!0},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.preloadFile=function(t,e){var n=this._index.getInode(t);if(!oe(n))throw Fe.EISDIR(t);if(null===n)throw Fe.ENOENT(t);var r=n.getData();r.size=e.length,r.fileData=e},e.prototype.stat=function(t,e,n){var r=this._index.getInode(t);if(null===r)return n(Fe.ENOENT(t));var i;oe(r)?(i=r.getData(),i.size<0?this._requestFileSizeAsync(t,function(t,e){return t?n(t):(i.size=e,void n(null,i.clone()))}):n(null,i.clone())):se(r)?(i=r.getStats(),n(null,i)):n(Fe.FileError(be.EINVAL,t))},e.prototype.statSync=function(t,e){var n=this._index.getInode(t);if(null===n)throw Fe.ENOENT(t);var r;if(oe(n))r=n.getData(),r.size<0&&(r.size=this._requestFileSizeSync(t));else{if(!se(n))throw Fe.FileError(be.EINVAL,t);r=n.getStats()}return r},e.prototype.open=function(t,e,n,r){if(e.isWriteable())return r(new Fe(be.EPERM,t));var i=this,o=this._index.getInode(t);if(null===o)return r(Fe.ENOENT(t));if(!oe(o))return r(Fe.EISDIR(t));var s=o.getData();switch(e.pathExistsAction()){case Oe.THROW_EXCEPTION:case Oe.TRUNCATE_FILE:return r(Fe.EEXIST(t));case Oe.NOP:if(s.fileData)return r(null,new Xe(i,t,e,s.clone(),s.fileData));this._requestFileAsync(t,"buffer",function(n,o){return n?r(n):(s.size=o.length,s.fileData=o,r(null,new Xe(i,t,e,s.clone(),o)))});break;default:return r(new Fe(be.EINVAL,"Invalid FileMode object."))}},e.prototype.openSync=function(t,e,n){if(e.isWriteable())throw new Fe(be.EPERM,t);var r=this._index.getInode(t);if(null===r)throw Fe.ENOENT(t);if(!oe(r))throw Fe.EISDIR(t);var i=r.getData();switch(e.pathExistsAction()){case Oe.THROW_EXCEPTION:case Oe.TRUNCATE_FILE:throw Fe.EEXIST(t);case Oe.NOP:if(i.fileData)return new Xe(this,t,e,i.clone(),i.fileData);var o=this._requestFileSync(t,"buffer");return i.size=o.length,i.fileData=o,new Xe(this,t,e,i.clone(),o);default:throw new Fe(be.EINVAL,"Invalid FileMode object.")}},e.prototype.readdir=function(t,e){try{e(null,this.readdirSync(t))}catch(t){e(t)}},e.prototype.readdirSync=function(t){var e=this._index.getInode(t);if(null===e)throw Fe.ENOENT(t);if(se(e))return e.getListing();throw Fe.ENOTDIR(t)},e.prototype.readFile=function(t,e,n,r){var i=r;this.open(t,n,420,function(t,n){if(t)return r(t);r=function(t,e){n.close(function(n){return t||(t=n),i(t,e)})};var o=n,s=o.getBuffer();null===e?r(t,b(s)):ae(s,e,r)})},e.prototype.readFileSync=function(t,e,n){var r=this.openSync(t,n,420);try{var i=r,o=i.getBuffer();return null===e?b(o):o.toString(e)}finally{r.closeSync()}},e.prototype.getXhrPath=function(t){return"/"===t.charAt(0)&&(t=t.slice(1)),this.prefixUrl+t},e.prototype._requestFileAsync=function(t,e,n){Ki(this.getXhrPath(t),e,n)},e.prototype._requestFileSync=function(t,e){return Ji(this.getXhrPath(t),e)},e.prototype._requestFileSizeAsync=function(t,e){ie(this.getXhrPath(t),e)},e.prototype._requestFileSizeSync=function(t){return re(this.getXhrPath(t))},e}(We);to.Name="XmlHttpRequest",to.Options={index:{type:["string","object"],optional:!0,description:"URL to a file index as a JSON file or the file index object itself, generated with the make_xhrfs_index script. Defaults to `index.json`."},baseUrl:{type:"string",optional:!0,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}};var eo=function(){};eo.str2byte=function(t,e){for(var n=t.length>e.length?e.length:t.length,r=0;r127){var o=eo.extendedChars.indexOf(t.charAt(r));o>-1&&(i=o+128)}e[i]=r}return n},eo.byte2str=function(t){for(var e=new Array(t.length),n=0;n127?e[n]=eo.extendedChars[r-128]:e[n]=String.fromCharCode(r)}return e.join("")},eo.byteLength=function(t){return t.length},eo.extendedChars=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];var no,ro=n(23).inflateRaw,io={};!function(t){t[t.MSDOS=0]="MSDOS",t[t.AMIGA=1]="AMIGA",t[t.OPENVMS=2]="OPENVMS",t[t.UNIX=3]="UNIX",t[t.VM_CMS=4]="VM_CMS",t[t.ATARI_ST=5]="ATARI_ST",t[t.OS2_HPFS=6]="OS2_HPFS",t[t.MAC=7]="MAC",t[t.Z_SYSTEM=8]="Z_SYSTEM",t[t.CP_M=9]="CP_M",t[t.NTFS=10]="NTFS",t[t.MVS=11]="MVS",t[t.VSE=12]="VSE",t[t.ACORN_RISC=13]="ACORN_RISC",t[t.VFAT=14]="VFAT",t[t.ALT_MVS=15]="ALT_MVS",t[t.BEOS=16]="BEOS",t[t.TANDEM=17]="TANDEM",t[t.OS_400=18]="OS_400",t[t.OSX=19]="OSX"}(no||(no={}));var oo;!function(t){t[t.STORED=0]="STORED",t[t.SHRUNK=1]="SHRUNK",t[t.REDUCED_1=2]="REDUCED_1",t[t.REDUCED_2=3]="REDUCED_2",t[t.REDUCED_3=4]="REDUCED_3",t[t.REDUCED_4=5]="REDUCED_4",t[t.IMPLODE=6]="IMPLODE",t[t.DEFLATE=8]="DEFLATE",t[t.DEFLATE64=9]="DEFLATE64",t[t.TERSE_OLD=10]="TERSE_OLD",t[t.BZIP2=12]="BZIP2",t[t.LZMA=14]="LZMA",t[t.TERSE_NEW=18]="TERSE_NEW",t[t.LZ77=19]="LZ77",t[t.WAVPACK=97]="WAVPACK",t[t.PPMD=98]="PPMD"}(oo||(oo={}));var so=function(t){if(this.data=t,67324752!==t.readUInt32LE(0))throw new Fe(be.EINVAL,"Invalid Zip file: Local file header has invalid signature: "+this.data.readUInt32LE(0))};so.prototype.versionNeeded=function(){return this.data.readUInt16LE(4)},so.prototype.flags=function(){return this.data.readUInt16LE(6)},so.prototype.compressionMethod=function(){return this.data.readUInt16LE(8)},so.prototype.lastModFileTime=function(){return ce(this.data.readUInt16LE(10),this.data.readUInt16LE(12))},so.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(10)},so.prototype.crc32=function(){return this.data.readUInt32LE(14)},so.prototype.fileNameLength=function(){return this.data.readUInt16LE(26)},so.prototype.extraFieldLength=function(){return this.data.readUInt16LE(28)},so.prototype.fileName=function(){return ue(this.data,this.useUTF8(),30,this.fileNameLength())},so.prototype.extraField=function(){var t=30+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},so.prototype.totalSize=function(){return 30+this.fileNameLength()+this.extraFieldLength()},so.prototype.useUTF8=function(){return 2048===(2048&this.flags())};var ao=function(t,e,n){this.header=t,this.record=e,this.data=n};ao.prototype.decompress=function(){var t=this.header.compressionMethod(),e=io[t];if(e)return e(this.data,this.record.compressedSize(),this.record.uncompressedSize(),this.record.flag());var n=oo[t];throw n||(n="Unknown: "+t),new Fe(be.EINVAL,"Invalid compression method on file '"+this.header.fileName()+"': "+n)},ao.prototype.getHeader=function(){return this.header},ao.prototype.getRecord=function(){return this.record},ao.prototype.getRawData=function(){return this.data};var co=function(t){this.data=t};co.prototype.crc32=function(){return this.data.readUInt32LE(0)},co.prototype.compressedSize=function(){return this.data.readUInt32LE(4)},co.prototype.uncompressedSize=function(){return this.data.readUInt32LE(8)};var uo=function(t){if(this.data=t,134630224!==this.data.readUInt32LE(0))throw new Fe(be.EINVAL,"Invalid archive extra data record signature: "+this.data.readUInt32LE(0))};uo.prototype.length=function(){return this.data.readUInt32LE(4)},uo.prototype.extraFieldData=function(){return this.data.slice(8,8+this.length())};var fo=function(t){if(this.data=t,84233040!==this.data.readUInt32LE(0))throw new Fe(be.EINVAL,"Invalid digital signature signature: "+this.data.readUInt32LE(0))};fo.prototype.size=function(){return this.data.readUInt16LE(4)},fo.prototype.signatureData=function(){return this.data.slice(6,6+this.size())};var ho=function(t,e){if(this.zipData=t,this.data=e,33639248!==this.data.readUInt32LE(0))throw new Fe(be.EINVAL,"Invalid Zip file: Central directory record has invalid signature: "+this.data.readUInt32LE(0));this._filename=this.produceFilename()};ho.prototype.versionMadeBy=function(){return this.data.readUInt16LE(4)},ho.prototype.versionNeeded=function(){return this.data.readUInt16LE(6)},ho.prototype.flag=function(){return this.data.readUInt16LE(8)},ho.prototype.compressionMethod=function(){return this.data.readUInt16LE(10)},ho.prototype.lastModFileTime=function(){return ce(this.data.readUInt16LE(12),this.data.readUInt16LE(14))},ho.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(12)},ho.prototype.crc32=function(){return this.data.readUInt32LE(16)},ho.prototype.compressedSize=function(){return this.data.readUInt32LE(20)},ho.prototype.uncompressedSize=function(){return this.data.readUInt32LE(24)},ho.prototype.fileNameLength=function(){return this.data.readUInt16LE(28)},ho.prototype.extraFieldLength=function(){return this.data.readUInt16LE(30)},ho.prototype.fileCommentLength=function(){return this.data.readUInt16LE(32)},ho.prototype.diskNumberStart=function(){return this.data.readUInt16LE(34)},ho.prototype.internalAttributes=function(){return this.data.readUInt16LE(36)},ho.prototype.externalAttributes=function(){return this.data.readUInt32LE(38)},ho.prototype.headerRelativeOffset=function(){return this.data.readUInt32LE(42)},ho.prototype.produceFilename=function(){var t=ue(this.data,this.useUTF8(),46,this.fileNameLength());return t.replace(/\\/g,"/")},ho.prototype.fileName=function(){return this._filename},ho.prototype.rawFileName=function(){return this.data.slice(46,46+this.fileNameLength())},ho.prototype.extraField=function(){var t=44+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},ho.prototype.fileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return ue(this.data,this.useUTF8(),t,this.fileCommentLength())},ho.prototype.rawFileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return this.data.slice(t,t+this.fileCommentLength())},ho.prototype.totalSize=function(){return 46+this.fileNameLength()+this.extraFieldLength()+this.fileCommentLength()},ho.prototype.isDirectory=function(){var t=this.fileName();return!!(16&this.externalAttributes())||"/"===t.charAt(t.length-1)},ho.prototype.isFile=function(){return!this.isDirectory()},ho.prototype.useUTF8=function(){return 2048===(2048&this.flag())},ho.prototype.isEncrypted=function(){return 1===(1&this.flag())},ho.prototype.getFileData=function(){var t=this.headerRelativeOffset(),e=new so(this.zipData.slice(t));return new ao(e,this,this.zipData.slice(t+e.totalSize()))},ho.prototype.getData=function(){return this.getFileData().decompress()},ho.prototype.getRawData=function(){return this.getFileData().getRawData()},ho.prototype.getStats=function(){return new Te(Le.FILE,this.uncompressedSize(),365,new Date,this.lastModFileTime())};var po=function(t){if(this.data=t,101010256!==this.data.readUInt32LE(0))throw new Fe(be.EINVAL,"Invalid Zip file: End of central directory record has invalid signature: "+this.data.readUInt32LE(0))};po.prototype.diskNumber=function(){return this.data.readUInt16LE(4)},po.prototype.cdDiskNumber=function(){return this.data.readUInt16LE(6)},po.prototype.cdDiskEntryCount=function(){return this.data.readUInt16LE(8)},po.prototype.cdTotalEntryCount=function(){return this.data.readUInt16LE(10)},po.prototype.cdSize=function(){return this.data.readUInt32LE(12)},po.prototype.cdOffset=function(){return this.data.readUInt32LE(16)},po.prototype.cdZipCommentLength=function(){return this.data.readUInt16LE(20)},po.prototype.cdZipComment=function(){return ue(this.data,!0,22,this.cdZipCommentLength())},po.prototype.rawCdZipComment=function(){return this.data.slice(22,22+this.cdZipCommentLength())};var lo=function(t,e,n,r){this.index=t,this.directoryEntries=e,this.eocd=n,this.data=r},yo=function(t){function e(n,r,i){void 0===r&&(r=""),void 0===i&&(i=!0),t.call(this),this.name=r,this._index=new Gi,this._directoryEntries=[],this._eocd=null,d(i,e.Name,{zipData:"zip data as a Buffer",name:r}),n instanceof lo?(this._index=n.index,this._directoryEntries=n.directoryEntries,this._eocd=n.eocd,this.data=n.data):(this.data=n,this.populateIndex())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){try{e.computeIndex(t.zipData,function(r){var i=new e(r,t.name,!1);n(null,i)},!1)}catch(t){n(t)}},e.isAvailable=function(){return!0},e.RegisterDecompressionMethod=function(t,e){io[t]=e},e.computeIndex=function(t,n,r){void 0===r&&(r=!0),r&&console.warn("[ZipFS] ZipFS.computeIndex is now deprecated, and will be removed in the next major release. Please update your code to use 'ZipFS.Create({ zipData: zip file as a Buffer}, cb)' instead.");var i=new Gi,o=e.getEOCD(t);if(o.diskNumber()!==o.cdDiskNumber())throw new Fe(be.EINVAL,"ZipFS does not support spanned zip files.");var s=o.cdOffset();if(4294967295===s)throw new Fe(be.EINVAL,"ZipFS does not support Zip64.");var a=s+o.cdSize();e.computeIndexResponsive(t,i,s,a,n,[],o)},e.getEOCD=function(t){for(var e=22,n=Math.min(e+65535,t.length-1),r=e;r-1},Eo.prototype.getRockRidgeOffset=function(){return this._rockRidgeOffset},Eo.prototype.rootCheckForRockRidge=function(t){var e=this.getDirectory(t);this._rockRidgeOffset=e.getDotEntry(t)._getRockRidgeOffset(t),this._rockRidgeOffset>-1&&(this._fileOrDir=null)},Eo.prototype.length=function(){return this._data[0]},Eo.prototype.extendedAttributeRecordLength=function(){return this._data[1]},Eo.prototype.lba=function(){return 2048*this._data.readUInt32LE(2)},Eo.prototype.dataLength=function(){return this._data.readUInt32LE(10)},Eo.prototype.recordingDate=function(){return le(this._data,18)},Eo.prototype.fileFlags=function(){return this._data[25]},Eo.prototype.fileUnitSize=function(){return this._data[26]},Eo.prototype.interleaveGapSize=function(){return this._data[27]},Eo.prototype.volumeSequenceNumber=function(){return this._data.readUInt16LE(28)},Eo.prototype.identifier=function(){return this._getString(33,this._data[32])},Eo.prototype.fileName=function(t){if(this.hasRockRidge()){var e=this._rockRidgeFilename(t);if(null!==e)return e}var n=this.identifier();if(this.isDirectory(t))return n;var r=n.indexOf(";");return r===-1?n:"."===n[r-1]?n.slice(0,r-1):n.slice(0,r)},Eo.prototype.isDirectory=function(t){var e=!!(2&this.fileFlags());return!e&&this.hasRockRidge()&&(e=this.getSUEntries(t).filter(function(t){return t instanceof Uo}).length>0),e},Eo.prototype.isSymlink=function(t){return this.hasRockRidge()&&this.getSUEntries(t).filter(function(t){return t instanceof Do}).length>0},Eo.prototype.getSymlinkPath=function(t){for(var e="",n=this.getSUEntries(t),r=this._getGetString(),i=0,o=n;i1&&"/"===e[e.length-1]?e.slice(0,e.length-1):e},Eo.prototype.getFile=function(t){if(this.isDirectory(t))throw new Error("Tried to get a File from a directory.");return null===this._fileOrDir&&(this._fileOrDir=t.slice(this.lba(),this.lba()+this.dataLength())),this._fileOrDir},Eo.prototype.getDirectory=function(t){if(!this.isDirectory(t))throw new Error("Tried to get a Directory from a file.");return null===this._fileOrDir&&(this._fileOrDir=this._constructDirectory(t)),this._fileOrDir},Eo.prototype.getSUEntries=function(t){return this._suEntries||this._constructSUEntries(t),this._suEntries},Eo.prototype._rockRidgeFilename=function(t){var e=this.getSUEntries(t).filter(function(t){return t instanceof Co});if(0===e.length||6&e[0].flags())return null;for(var n="",r=this._getGetString(),i=0,o=e;i0){var n=e[0];if(n instanceof Fo&&n.checkBytesPass())for(var r=1;r - * @license MIT - */ -"use strict";function r(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}function i(e){if(e>J)throw new RangeError("Invalid typed array length");var n=new Uint8Array(e);return n.__proto__=t.prototype,n}function t(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(t)}return o(t,e,n)}function o(t,e,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return H(t)?h(t,e,n):"string"==typeof t?u(t,e):p(t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,e,n){return s(t),t<=0?i(t):void 0!==e?"string"==typeof n?i(t).fill(e,n):i(t).fill(e):i(t)}function c(t){return s(t),i(t<0?0:0|l(t))}function u(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!t.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|y(e,n),o=i(r),s=o.write(e,n);return s!==r&&(o=o.slice(0,s)),o}function f(t){for(var e=t.length<0?0:0|l(t.length),n=i(e),r=0;r=J)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+J.toString(16)+" bytes");return 0|t}function d(e){return+e!=e&&(e=0),t.alloc(+e)}function y(e,n){if(t.isBuffer(e))return e.length;if(Z(e)||H(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(i)return B(e).length;n=(""+n).toLowerCase(),i=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return F(this,e,n);case"ascii":return R(this,e,n);case"latin1":case"binary":return L(this,e,n);case"base64":return O(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function v(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(e,n,r,i,o){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Y(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof n&&(n=t.from(n,i)),t.isBuffer(n))return 0===n.length?-1:_(e,n,r,i,o);if("number"==typeof n)return n&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,n,r):Uint8Array.prototype.lastIndexOf.call(e,n,r):_(e,[n],r,i,o);throw new TypeError("val must be string, number or Buffer")}function _(t,e,n,r,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,c=e.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,n/=2}var u;if(i){var f=-1;for(u=n;ua&&(n=a-c),u=n;u>=0;u--){for(var h=!0,p=0;pi&&(r=i)):r=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s239?4:o>223?3:o>191?2:1;if(i+a<=n){var c,u,f,h;switch(a){case 1:o<128&&(s=o);break;case 2:c=t[i+1],128===(192&c)&&(h=(31&o)<<6|63&c,h>127&&(s=h));break;case 3:c=t[i+1],u=t[i+2],128===(192&c)&&128===(192&u)&&(h=(15&o)<<12|(63&c)<<6|63&u,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:c=t[i+1],u=t[i+2],f=t[i+3],128===(192&c)&&128===(192&u)&&128===(192&f)&&(h=(15&o)<<18|(63&c)<<12|(63&u)<<6|63&f,h>65535&&h<1114112&&(s=h))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return N(r)}function N(t){var e=t.length;if(e<=G)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function D(e,n,r,i,o,s){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>o||ne.length)throw new RangeError("Index out of range")}function P(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function C(t,e,n,r,i){return e=+e,n>>>=0,i||P(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(t,e,n,r,23,4),n+4}function U(t,e,n,r,i){return e=+e,n>>>=0,i||P(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(t,e,n,r,52,8),n+8}function M(t){if(t=t.trim().replace(Q,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function j(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],s=0;s55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(t){for(var e=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function V(t){return X.toByteArray(M(t))}function W(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function H(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function Z(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function Y(t){return t!==t}var X=n(18),K=n(21);e.Buffer=t,e.SlowBuffer=d,e.INSPECT_MAX_BYTES=50;var J=2147483647;e.kMaxLength=J,t.TYPED_ARRAY_SUPPORT=r(),t.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(t,e,n){return o(t,e,n)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(t,e,n){return a(t,e,n)},t.allocUnsafe=function(t){return c(t)},t.allocUnsafeSlow=function(t){return c(t)},t.isBuffer=function(t){return null!=t&&t._isBuffer===!0},t.compare=function(e,n){if(!t.isBuffer(e)||!t.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(e===n)return 0;for(var r=e.length,i=n.length,o=0,s=Math.min(r,i);o0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},t.prototype.compare=function(e,n,r,i,o){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),n<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&n>=r)return 0;if(i>=o)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,a=r-n,c=Math.min(s,a),u=this.slice(i,o),f=e.slice(n,r),h=0;h>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return S(this,t,e,n);case"base64":return k(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var G=4096;t.prototype.slice=function(e,n){var r=this.length;e=~~e,n=void 0===n?r:~~n,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n>>=0,e>>>=0,n||A(t,e,this.length);for(var r=this[t],i=1,o=0;++o>>=0,e>>>=0,n||A(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},t.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var r=this[t],i=1,o=0;++o=i&&(r-=Math.pow(2,8*e)),r},t.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),K.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),K.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),K.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),K.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;D(this,t,e,n,i,0)}var o=1,s=0;for(this[e]=255&t;++s>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;D(this,t,e,n,i,0)}var o=n-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+n},t.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,1,255,0),this[e]=255&t,e+1},t.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},t.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},t.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},t.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},t.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);D(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},t.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);D(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},t.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},t.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},t.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},t.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},t.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},t.prototype.writeFloatLE=function(t,e,n){return C(this,t,e,!0,n)},t.prototype.writeFloatBE=function(t,e,n){return C(this,t,e,!1,n)},t.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},t.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},t.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var s;if("number"==typeof e)for(s=n;s0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){i=a;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){t.exports=n(1).Buffer},function(t,e){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)return void t.set(e.subarray(n,n+r),i);for(var o=0;os)throw new RangeError("size is too large");var r=n,o=e;void 0===o&&(r=void 0,o=0);var a=new i(t);if("string"==typeof o)for(var c=new i(o,r),u=c.length,f=-1;++fs)throw new RangeError("size is too large");return new i(t)},e.from=function(e,n,r){if("function"==typeof i.from&&(!t.Uint8Array||Uint8Array.from!==i.from))return i.from(e,n,r);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new i(e,n);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var o=n;if(1===arguments.length)return new i(e);"undefined"==typeof o&&(o=0);var s=r;if("undefined"==typeof s&&(s=e.byteLength-o),o>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(s>e.byteLength-o)throw new RangeError("'length' is out of bounds");return new i(e.slice(o,o+s))}if(i.isBuffer(e)){var a=new i(e.length);return e.copy(a,0,0,e.length),a}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new i(e);if("Buffer"===e.type&&Array.isArray(e.data))return new i(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},e.allocUnsafeSlow=function(t){if("function"==typeof i.allocUnsafeSlow)return i.allocUnsafeSlow(t);if("number"!=typeof t)throw new TypeError("size must be a number");if(t>=s)throw new RangeError("size is too large");return new o(t)}}).call(e,function(){return this}())},function(t,e,n){(function(e){"use strict";function n(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(o=new Array(a-1),s=0;s-1?setImmediate:k;s.WritableState=o;var O=n(5);O.inherits=n(4);var F,N={deprecate:n(40)};!function(){try{F=n(9)}catch(t){}finally{F||(F=n(6).EventEmitter)}}();var R=n(1).Buffer,L=n(10);O.inherits(s,F),o.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(o.prototype,"buffer",{get:N.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(t){}}();var T;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(s,Symbol.hasInstance,{value:function(t){return!!T.call(this,t)||t&&t._writableState instanceof o}})):T=function(t){return t instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(t,e,n){var i=this._writableState,o=!1,s=R.isBuffer(t);return"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof n&&(n=r),i.ended?a(this,n):(s||c(this,i,t,n))&&(i.pendingcb++,o=f(this,i,s,t,e,n)),o},s.prototype.cork=function(){var t=this._writableState;t.corked++},s.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||v(this,t))},s.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},s.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||E(this,r,n)}}).call(e,n(3))},function(t,e,n){(function(e){"use strict";function n(t){var e=r.exec(t);return e.shift(),e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(){function t(){}return t.normalize=function(e){""===e&&(e=".");var n=e.charAt(0)===t.sep;e=t._removeDuplicateSeps(e);for(var r=e.split(t.sep),i=[],o=0;o0&&".."!==i[0])?i.pop():i.push(s))}if(!n&&i.length<2)switch(i.length){case 1:""===i[0]&&i.unshift(".");break;default:i.push(".")}return e=i.join(t.sep),n&&e.charAt(0)!==t.sep&&(e=t.sep+e),e},t.join=function(){for(var e=[],n=0;n1&&a.charAt(a.length-1)===t.sep)return a.substr(0,a.length-1);if(a.charAt(0)!==t.sep){"."!==a.charAt(0)||1!==a.length&&a.charAt(1)!==t.sep||(a=1===a.length?"":a.substr(2));var c=e.cwd();a=""!==a?this.normalize(c+("/"!==c?t.sep:"")+a):c}return a},t.relative=function(e,n){var r;e=t.resolve(e),n=t.resolve(n);var i=e.split(t.sep),o=n.split(t.sep);o.shift(),i.shift();var s=0,a=[];for(r=0;ri.length&&(s=i.length);var u="";for(r=0;r1&&u.charAt(u.length-1)===t.sep&&(u=u.substr(0,u.length-1)),u},t.dirname=function(e){e=t._removeDuplicateSeps(e);var n=e.charAt(0)===t.sep,r=e.split(t.sep);return""===r.pop()&&r.length>0&&r.pop(),r.length>1||1===r.length&&!n?r.join(t.sep):n?t.sep:"."},t.basename=function(e,n){if(void 0===n&&(n=""),""===e)return e;e=t.normalize(e);var r=e.split(t.sep),i=r[r.length-1];if(""===i&&r.length>1)return r[r.length-2];if(n.length>0){var o=i.substr(i.length-n.length);if(o===n)return i.substr(0,i.length-n.length)}return i},t.extname=function(e){e=t.normalize(e);var n=e.split(t.sep);if(e=n.pop(),""===e&&n.length>0&&(e=n.pop()),".."===e)return"";var r=e.lastIndexOf(".");return r===-1||0===r?"":e.substr(r)},t.isAbsolute=function(e){return e.length>0&&e.charAt(0)===t.sep},t._makeLong=function(t){return t},t.parse=function(t){var e=n(t);return{root:e[0],dir:e[0]+e[1].slice(0,-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}},t.format=function(e){if(null===e||"object"!=typeof e)throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);var n=e.root||"";if("string"!=typeof n)throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);var r=e.dir?e.dir+t.sep:"",i=e.base||"";return r+i},t._removeDuplicateSeps=function(t){return t=t.replace(this._replaceRegex,this.sep)},t.sep="/",t._replaceRegex=new RegExp("//+","g"),t.delimiter=":",t.posix=t,t.win32=t,t}();t.exports=i}).call(e,n(3))},function(t,e,n){"use strict";function r(t){return this instanceof r?void i.call(this,t):new r(t)}t.exports=r;var i=n(12),o=n(5);o.inherits=n(4),o.inherits(r,i),r.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){(function(e){"use strict";function r(t,e,n){return"function"==typeof t.prependListener?t.prependListener(e,n):void(t._events&&t._events[e]?T(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n))}function i(t,e){R=R||n(2),t=t||{},this.objectMode=!!t.objectMode,e instanceof R&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=~~this.highWaterMark,this.buffer=new B,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(j||(j=n(17).StringDecoder),this.decoder=new j(t.encoding),this.encoding=t.encoding)}function o(t){return R=R||n(2),this instanceof o?(this._readableState=new i(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),void x.call(this)):new o(t)}function s(t,e,n,r,i){var o=f(e,n);if(o)t.emit("error",o);else if(null===n)e.reading=!1,h(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var c=new Error("stream.unshift() after end event");t.emit("error",c)}else{var u;!e.decoder||i||r||(n=e.decoder.write(n),u=!e.objectMode&&0===n.length),i||(e.reading=!1),u||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&p(t))),d(t,e)}else i||(e.reading=!1);return a(e)}function a(t){return!t.ended&&(t.needReadable||t.length=z?t=z:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function u(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=c(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function f(t,e){var n=null;return D.isBuffer(e)||"string"==typeof e||null===e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,p(t)}}function p(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(M("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?L(l,t):l(t))}function l(t){M("emit readable"),t.emit("readable"),w(t)}function d(t,e){e.readingMore||(e.readingMore=!0,L(y,t,e))}function y(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=b(t,e.buffer,e.decoder),n}function b(t,e,n){var r;return to.length?o.length:t;if(i+=s===o.length?o:o.slice(0,t),t-=s,0===t){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}function k(t,e){var n=P.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),t-=s,0===t){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,L(O,e,t))}function O(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function F(t,e){for(var n=0,r=t.length;n=e.highWaterMark||e.ended))return M("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):p(this),null;if(t=u(t,e),0===t&&e.ended)return 0===e.length&&I(this),null;var r=e.needReadable;M("need readable",r),(0===e.length||e.length-t0?E(t,e):null,null===i?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&I(this)),null!==i&&this.emit("data",i),i},o.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},o.prototype.pipe=function(t,n){function i(t){M("onunpipe"),t===p&&s()}function o(){M("onend"),t.end()}function s(){M("cleanup"),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("drain",v),t.removeListener("error",c),t.removeListener("unpipe",i),p.removeListener("end",o),p.removeListener("end",s),p.removeListener("data",a),m=!0,!l.awaitDrain||t._writableState&&!t._writableState.needDrain||v()}function a(e){M("ondata"),_=!1;var n=t.write(e);!1!==n||_||((1===l.pipesCount&&l.pipes===t||l.pipesCount>1&&N(l.pipes,t)!==-1)&&!m&&(M("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,_=!0),p.pause())}function c(e){M("onerror",e),h(),t.removeListener("error",c),0===A(t,"error")&&t.emit("error",e)}function u(){t.removeListener("finish",f),h()}function f(){M("onfinish"),t.removeListener("close",u),h()}function h(){M("unpipe"),p.unpipe(t)}var p=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=t;break;case 1:l.pipes=[l.pipes,t];break;default:l.pipes.push(t)}l.pipesCount+=1,M("pipe count=%d opts=%j",l.pipesCount,n);var d=(!n||n.end!==!1)&&t!==e.stdout&&t!==e.stderr,y=d?o:s;l.endEmitted?L(y):p.once("end",y),t.on("unpipe",i);var v=g(p);t.on("drain",v);var m=!1,_=!1;return p.on("data",a),r(t,"error",c),t.once("close",u),t.once("finish",f),t.emit("pipe",p),l.flowing||(M("pipe resume"),p.resume()),t},o.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var n=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,r=e.charCodeAt(i);if(r>=55296&&r<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},u.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(e<=2&&n>>4==14){this.charLength=3;break}if(e<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=e},u.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,n).toString(i)}return e}},function(t,e){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function r(t){return 3*t.length/4-n(t)}function i(t){var e,r,i,o,s,a,c=t.length;s=n(t),a=new f(3*c/4-s),i=s>0?c-4:c;var h=0;for(e=0,r=0;e>16&255,a[h++]=o>>8&255,a[h++]=255&o;return 2===s?(o=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,a[h++]=255&o):1===s&&(o=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,a[h++]=o>>8&255,a[h++]=255&o),a}function o(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function s(t,e,n){for(var r,i=[],s=e;sf?f:u+a));return 1===r?(e=t[n-1],i+=c[e>>2],i+=c[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=c[e>>10],i+=c[e>>4&63],i+=c[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=r,e.toByteArray=i,e.fromByteArray=a;for(var c=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,l=h.length;p0&&(this._waitingForWrites=this.push(this._bufferedWrites.shift()),this._waitingForWrites););},n}(i.Duplex);t.exports=o}).call(e,n(7))},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,c=(1<>1,f=-7,h=n?i-1:0,p=n?-1:1,l=t[e+h];for(h+=p,o=l&(1<<-f)-1,l>>=-f,f+=a;f>0;o=256*o+t[e+h],h+=p,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+t[e+h],h+=p,f-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:(l?-1:1)*(1/0);s+=Math.pow(2,r),o-=u}return(l?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,c,u=8*o-i-1,f=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=r?0:o-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),e+=s+h>=1?p/c:p*Math.pow(2,1-h),e*c>=2&&(s++,c/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[n+l]=255&a,l+=d,a/=256,i-=8);for(s=s<0;t[n+l]=255&s,l+=d,s/=256,u-=8);t[n+l-d]|=128*y}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";function r(t){if(!(this instanceof r))return new r(t);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var n=s.inflateInit2(this.strm,e.windowBits);if(n!==u.Z_OK)throw new Error(f[n]);this.header=new p,s.inflateGetHeader(this.strm,this.header)}function i(t,e){var n=new r(e);if(n.push(t,!0),n.err)throw n.msg||f[n.err];return n.result}function o(t,e){return e=e||{},e.raw=!0,i(t,e)}var s=n(30),a=n(8),c=n(24),u=n(26),f=n(32),h=n(33),p=n(28),l=Object.prototype.toString;r.prototype.push=function(t,e){var n,r,i,o,f,h,p=this.strm,d=this.options.chunkSize,y=this.options.dictionary,g=!1;if(this.ended)return!1;r=e===~~e?e:e===!0?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof t?p.input=c.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?p.input=new Uint8Array(t):p.input=t,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new a.Buf8(d),p.next_out=0,p.avail_out=d),n=s.inflate(p,u.Z_NO_FLUSH),n===u.Z_NEED_DICT&&y&&(h="string"==typeof y?c.string2buf(y):"[object ArrayBuffer]"===l.call(y)?new Uint8Array(y):y,n=s.inflateSetDictionary(this.strm,h)),n===u.Z_BUF_ERROR&&g===!0&&(n=u.Z_OK,g=!1),n!==u.Z_STREAM_END&&n!==u.Z_OK)return this.onEnd(n),this.ended=!0,!1;p.next_out&&(0!==p.avail_out&&n!==u.Z_STREAM_END&&(0!==p.avail_in||r!==u.Z_FINISH&&r!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(i=c.utf8border(p.output,p.next_out),o=p.next_out-i,f=c.buf2string(p.output,i),p.next_out=o,p.avail_out=d-o,o&&a.arraySet(p.output,p.output,i,o,0),this.onData(f)):this.onData(a.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(g=!0)}while((p.avail_in>0||0===p.avail_out)&&n!==u.Z_STREAM_END);return n===u.Z_STREAM_END&&(r=u.Z_FINISH),r===u.Z_FINISH?(n=s.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u.Z_OK):r!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),p.avail_out=0,!0)},r.prototype.onData=function(t){this.chunks.push(t)},r.prototype.onEnd=function(t){t===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=r,e.inflate=i,e.inflateRaw=o,e.ungzip=i},function(t,e,n){"use strict";function r(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&o))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",r=0;r=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;a[254]=a[254]=1,e.string2buf=function(t){var e,n,r,o,s,a=t.length,c=0;for(o=0;o>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},e.buf2binstring=function(t){return r(t,t.length)},e.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;n4)u[i++]=65533,n+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&n1?u[i++]=65533:o<65536?u[i++]=o:(o-=65536,u[i++]=55296|o>>10&1023,u[i++]=56320|1023&o)}return r(u,i)},e.utf8border=function(t,e){ -var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return n<0?e:0===n?e:n+a[t[n]]>e?n:e}},function(t,e){"use strict";function n(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,s=0;0!==n;){s=n>2e3?2e3:n,n-=s;do i=i+e[r++]|0,o=o+i|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}t.exports=n},function(t,e){"use strict";t.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}},function(t,e){"use strict";function n(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}function r(t,e,n,r){var o=i,s=r+n;t^=-1;for(var a=r;a>>8^o[255&(t^e[a])];return t^-1}var i=n();t.exports=r},function(t,e){"use strict";function n(){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}t.exports=n},function(t,e){"use strict";var n=30,r=12;t.exports=function(t,e){var i,o,s,a,c,u,f,h,p,l,d,y,g,v,m,_,w,E,b,S,k,I,O,F,N;i=t.state,o=t.next_in,F=t.input,s=o+(t.avail_in-5),a=t.next_out,N=t.output,c=a-(e-t.avail_out),u=a+(t.avail_out-257),f=i.dmax,h=i.wsize,p=i.whave,l=i.wnext,d=i.window,y=i.hold,g=i.bits,v=i.lencode,m=i.distcode,_=(1<>>24,y>>>=b,g-=b,b=E>>>16&255,0===b)N[a++]=65535&E;else{if(!(16&b)){if(0===(64&b)){E=v[(65535&E)+(y&(1<>>=b,g-=b),g<15&&(y+=F[o++]<>>24,y>>>=b,g-=b,b=E>>>16&255,!(16&b)){if(0===(64&b)){E=m[(65535&E)+(y&(1<f){t.msg="invalid distance too far back",i.mode=n;break t}if(y>>>=b,g-=b,b=a-c,k>b){if(b=k-b,b>p&&i.sane){t.msg="invalid distance too far back",i.mode=n;break t}if(I=0,O=d,0===l){if(I+=h-b,b2;)N[a++]=O[I++],N[a++]=O[I++],N[a++]=O[I++],S-=3;S&&(N[a++]=O[I++],S>1&&(N[a++]=O[I++]))}else{I=a-k;do N[a++]=N[I++],N[a++]=N[I++],N[a++]=N[I++],S-=3;while(S>2);S&&(N[a++]=N[I++],S>1&&(N[a++]=N[I++]))}break}}break}}while(o>3,o-=S,g-=S<<3,y&=(1<>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function i(){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 m.Buf16(320),this.work=new m.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(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=U,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new m.Buf32(yt),e.distcode=e.distdyn=new m.Buf32(gt),e.sane=1,e.back=-1,R):x}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,o(t)):x}function a(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?x:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,s(t))):x}function c(t,e){var n,r;return t?(r=new i,t.state=r,r.window=null,n=a(t,e),n!==R&&(t.state=null),n):x}function u(t){return c(t,mt)}function f(t){if(_t){var e;for(g=new m.Buf32(512),v=new m.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(b(k,t.lens,0,288,g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;b(I,t.lens,0,32,v,0,t.work,{bits:5}),_t=!1}t.lencode=g,t.lenbits=9,t.distcode=v,t.distbits=5}function h(t,e,n,r){var i,o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(m.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),m.arraySet(o.window,e,n-r,i,o.wnext),r-=i,r?(m.arraySet(o.window,e,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=w(n.check,Ft,2,0),p=0,l=0,n.mode=M;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&p)<<8)+(p>>8))%31){t.msg="incorrect header check",n.mode=pt;break}if((15&p)!==C){t.msg="unknown compression method",n.mode=pt;break}if(p>>>=4,l-=4,bt=(15&p)+8,0===n.wbits)n.wbits=bt;else if(bt>n.wbits){t.msg="invalid window size",n.mode=pt;break}n.dmax=1<>8&1),512&n.flags&&(Ft[0]=255&p,Ft[1]=p>>>8&255,n.check=w(n.check,Ft,2,0)),p=0,l=0,n.mode=j;case j:for(;l<32;){if(0===c)break t;c--,p+=i[s++]<>>8&255,Ft[2]=p>>>16&255,Ft[3]=p>>>24&255,n.check=w(n.check,Ft,4,0)),p=0,l=0,n.mode=B;case B:for(;l<16;){if(0===c)break t;c--,p+=i[s++]<>8),512&n.flags&&(Ft[0]=255&p,Ft[1]=p>>>8&255,n.check=w(n.check,Ft,2,0)),p=0,l=0,n.mode=z;case z:if(1024&n.flags){for(;l<16;){if(0===c)break t;c--,p+=i[s++]<>>8&255,n.check=w(n.check,Ft,2,0)),p=0,l=0}else n.head&&(n.head.extra=null);n.mode=q;case q:if(1024&n.flags&&(g=n.length,g>c&&(g=c),g&&(n.head&&(bt=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),m.arraySet(n.head.extra,i,s,g,bt)),512&n.flags&&(n.check=w(n.check,i,g,s)),c-=g,s+=g,n.length-=g),n.length))break t;n.length=0,n.mode=V;case V:if(2048&n.flags){if(0===c)break t;g=0;do bt=i[s+g++],n.head&&bt&&n.length<65536&&(n.head.name+=String.fromCharCode(bt));while(bt&&g>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=X;break;case Z:for(;l<32;){if(0===c)break t;c--,p+=i[s++]<>>=7&l,l-=7&l,n.mode=ut;break}for(;l<3;){if(0===c)break t;c--,p+=i[s++]<>>=1,l-=1,3&p){case 0:n.mode=J;break;case 1:if(f(n),n.mode=nt,e===N){p>>>=2,l-=2;break t}break;case 2:n.mode=$;break;case 3:t.msg="invalid block type",n.mode=pt}p>>>=2,l-=2;break;case J:for(p>>>=7&l,l-=7&l;l<32;){if(0===c)break t;c--,p+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=pt;break}if(n.length=65535&p,p=0,l=0,n.mode=G,e===N)break t;case G:n.mode=Q;case Q:if(g=n.length){if(g>c&&(g=c),g>u&&(g=u),0===g)break t;m.arraySet(o,i,s,g,a),c-=g,s+=g,u-=g,a+=g,n.length-=g;break}n.mode=X;break;case $:for(;l<14;){if(0===c)break t;c--,p+=i[s++]<>>=5,l-=5,n.ndist=(31&p)+1,p>>>=5,l-=5,n.ncode=(15&p)+4,p>>>=4,l-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=pt;break}n.have=0,n.mode=tt;case tt:for(;n.have>>=3,l-=3}for(;n.have<19;)n.lens[Nt[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,kt={bits:n.lenbits},St=b(S,n.lens,0,19,n.lencode,0,n.work,kt),n.lenbits=kt.bits,St){t.msg="invalid code lengths set",n.mode=pt;break}n.have=0,n.mode=et;case et:for(;n.have>>24,vt=Ot>>>16&255,mt=65535&Ot,!(gt<=l);){if(0===c)break t;c--,p+=i[s++]<>>=gt,l-=gt,n.lens[n.have++]=mt;else{if(16===mt){for(It=gt+2;l>>=gt,l-=gt,0===n.have){t.msg="invalid bit length repeat",n.mode=pt;break}bt=n.lens[n.have-1],g=3+(3&p),p>>>=2,l-=2}else if(17===mt){for(It=gt+3;l>>=gt,l-=gt,bt=0,g=3+(7&p),p>>>=3,l-=3}else{for(It=gt+7;l>>=gt,l-=gt,bt=0,g=11+(127&p),p>>>=7,l-=7}if(n.have+g>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=pt;break}for(;g--;)n.lens[n.have++]=bt}}if(n.mode===pt)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=pt;break}if(n.lenbits=9,kt={bits:n.lenbits},St=b(k,n.lens,0,n.nlen,n.lencode,0,n.work,kt),n.lenbits=kt.bits,St){t.msg="invalid literal/lengths set",n.mode=pt;break}if(n.distbits=6,n.distcode=n.distdyn,kt={bits:n.distbits},St=b(I,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,kt),n.distbits=kt.bits,St){t.msg="invalid distances set",n.mode=pt;break}if(n.mode=nt,e===N)break t;case nt:n.mode=rt;case rt:if(c>=6&&u>=258){t.next_out=a,t.avail_out=u,t.next_in=s,t.avail_in=c,n.hold=p,n.bits=l,E(t,y),a=t.next_out,o=t.output,u=t.avail_out,s=t.next_in,i=t.input,c=t.avail_in,p=n.hold,l=n.bits,n.mode===X&&(n.back=-1);break}for(n.back=0;Ot=n.lencode[p&(1<>>24,vt=Ot>>>16&255,mt=65535&Ot,!(gt<=l);){if(0===c)break t;c--,p+=i[s++]<>_t)],gt=Ot>>>24,vt=Ot>>>16&255,mt=65535&Ot,!(_t+gt<=l);){if(0===c)break t;c--,p+=i[s++]<>>=_t,l-=_t,n.back+=_t}if(p>>>=gt,l-=gt,n.back+=gt,n.length=mt,0===vt){n.mode=ct;break}if(32&vt){n.back=-1,n.mode=X;break}if(64&vt){t.msg="invalid literal/length code",n.mode=pt;break}n.extra=15&vt,n.mode=it;case it:if(n.extra){for(It=n.extra;l>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=ot;case ot:for(;Ot=n.distcode[p&(1<>>24,vt=Ot>>>16&255,mt=65535&Ot,!(gt<=l);){if(0===c)break t;c--,p+=i[s++]<>_t)],gt=Ot>>>24,vt=Ot>>>16&255,mt=65535&Ot,!(_t+gt<=l);){if(0===c)break t;c--,p+=i[s++]<>>=_t,l-=_t,n.back+=_t}if(p>>>=gt,l-=gt,n.back+=gt,64&vt){t.msg="invalid distance code",n.mode=pt;break}n.offset=mt,n.extra=15&vt,n.mode=st;case st:if(n.extra){for(It=n.extra;l>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=pt;break}n.mode=at;case at:if(0===u)break t;if(g=y-u,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=pt;break}g>n.wnext?(g-=n.wnext,v=n.wsize-g):v=n.wnext-g,g>n.length&&(g=n.length),yt=n.window}else yt=o,v=a-n.offset,g=n.length;g>u&&(g=u),u-=g,n.length-=g;do o[a++]=yt[v++];while(--g);0===n.length&&(n.mode=rt);break;case ct:if(0===u)break t;o[a++]=n.length,u--,n.mode=rt;break;case ut:if(n.wrap){for(;l<32;){if(0===c)break t;c--,p|=i[s++]<=1&&0===z[x];x--);if(A>x&&(A=x),0===x)return y[g++]=20971520,y[g++]=20971520,m.bits=1,0;for(T=1;T0&&(t===a||1!==x))return-1;for(q[1]=0,R=1;Ro||t===u&&U>s)return 1;for(;;){I=R-P,v[L]k?(O=V[W+v[L]],F=j[B+v[L]]):(O=96,F=0),_=1<>P)+w]=I<<24|O<<16|F|0;while(0!==w);for(_=1<>=1;if(0!==_?(M&=_-1,M+=_):M=0,L++,0===--z[R]){if(R===x)break;R=e[n+v[L]]}if(R>A&&(M&b)!==E){for(0===P&&(P=A),S+=T,D=R-P,C=1<o||t===u&&U>s)return 1;E=M&b,y[E]=A<<24|D<<16|S-g|0}}return 0!==M&&(y[S+M]=R-P<<24|64<<16|0),m.bits=A,0}},function(t,e){"use strict";t.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"}},function(t,e){"use strict";function n(){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}t.exports=n},function(t,e,n){t.exports=n(2)},function(t,e,n){"use strict";function r(){this.head=null,this.tail=null,this.length=0}var i=(n(1).Buffer,n(10));t.exports=r,r.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},r.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},r.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},r.prototype.clear=function(){this.head=this.tail=null,this.length=0},r.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},r.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e=i.allocUnsafe(t>>>0),n=this.head,r=0;n;)n.data.copy(e,r),r+=n.data.length,n=n.next;return e}},function(t,e,n){t.exports=n(15)},function(t,e,n){(function(r){var i=function(){try{return n(9)}catch(t){}}();e=t.exports=n(16),e.Stream=i||e,e.Readable=e,e.Writable=n(13),e.Duplex=n(2),e.Transform=n(12),e.PassThrough=n(15),!r.browser&&"disable"===r.env.READABLE_STREAM&&i&&(t.exports=i)}).call(e,n(3))},function(t,e,n){t.exports=n(12)},function(t,e,n){t.exports=n(13)},function(t,e){(function(e){function n(t,e){function n(){if(!i){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}if(r("noDeprecation"))return t;var i=!1;return n}function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(e,function(){return this}())},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){}])}); -//# sourceMappingURL=browserfs.min.js.map \ No newline at end of file diff --git a/bundles/browserfs.min.js.map b/bundles/browserfs.min.js.map deleted file mode 100644 index 53e1d4a..0000000 --- a/bundles/browserfs.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///../build/browserfs.min.js","webpack:///webpack/bootstrap ebd3bd27baeec43b998e","webpack:///../../../../src/core/FS.ts","webpack:///../../../../src/core/levenshtein.ts","webpack:///../../../../src/core/util.ts","webpack:///../../../../~/lodash-es/_apply.js","webpack:///../../../../~/lodash-es/_overRest.js","webpack:///../../../../~/lodash-es/identity.js","webpack:///../../../../~/async-es/internal/rest.js","webpack:///../../../../~/async-es/internal/applyEach.js","webpack:///../../../../~/lodash-es/_getRawTag.js","webpack:///../../../../~/lodash-es/_objectToString.js","webpack:///../../../../~/lodash-es/_baseGetTag.js","webpack:///../../../../~/lodash-es/isObject.js","webpack:///../../../../~/lodash-es/isFunction.js","webpack:///../../../../~/lodash-es/isLength.js","webpack:///../../../../~/lodash-es/isArrayLike.js","webpack:///../../../../~/lodash-es/noop.js","webpack:///../../../../~/async-es/internal/once.js","webpack:///../../../../~/lodash-es/_baseTimes.js","webpack:///../../../../~/lodash-es/isObjectLike.js","webpack:///../../../../~/lodash-es/_baseIsArguments.js","webpack:///../../../../~/lodash-es/stubFalse.js","webpack:///../../../../~/lodash-es/_isIndex.js","webpack:///../../../../~/lodash-es/_baseIsTypedArray.js","webpack:///../../../../~/lodash-es/_baseUnary.js","webpack:///../../../../~/lodash-es/_arrayLikeKeys.js","webpack:///../../../../~/lodash-es/_isPrototype.js","webpack:///../../../../~/lodash-es/_overArg.js","webpack:///../../../../~/lodash-es/_baseKeys.js","webpack:///../../../../~/lodash-es/keys.js","webpack:///../../../../~/async-es/internal/iterator.js","webpack:///../../../../~/async-es/internal/onlyOnce.js","webpack:///../../../../~/async-es/internal/eachOfLimit.js","webpack:///../../../../~/async-es/eachOfLimit.js","webpack:///../../../../~/async-es/internal/doLimit.js","webpack:///../../../../~/async-es/eachOf.js","webpack:///../../../../~/async-es/internal/doParallel.js","webpack:///../../../../~/async-es/internal/map.js","webpack:///../../../../~/async-es/internal/doParallelLimit.js","webpack:///../../../../~/lodash-es/_arrayEach.js","webpack:///../../../../~/lodash-es/_createBaseFor.js","webpack:///../../../../~/async-es/internal/setImmediate.js","webpack:///../../../../~/async-es/reduce.js","webpack:///../../../../~/async-es/internal/consoleFunc.js","webpack:///../../../../~/async-es/internal/withoutIndex.js","webpack:///../../../../~/async-es/each.js","webpack:///../../../../src/backend/Dropbox.ts","webpack:///../../../../src/backend/Emscripten.ts","webpack:///../../../../src/backend/FolderAdapter.ts","webpack:///../../../../src/backend/HTML5FS.ts","webpack:///../../../../src/generic/key_value_filesystem.ts","webpack:///../../../../src/backend/IndexedDB.ts","webpack:///../../../../src/backend/MountableFileSystem.ts","webpack:///../../../../src/backend/OverlayFS.ts","webpack:///../../../../src/backend/WorkerFS.ts","webpack:///../../../../src/generic/xhr.ts","webpack:///../../../../src/generic/file_index.ts","webpack:///../../../../src/backend/XmlHttpRequest.ts","webpack:///../../../../src/backend/ZipFS.ts","webpack:///../../../../src/backend/IsoFS.ts","webpack:///../../../../src/core/browserfs.ts","webpack:///../../../../src/core/api_error.ts","webpack:///../../../../src/core/file_flag.ts","webpack:///../../../../src/core/node_fs_stats.ts","webpack:///../../../../src/core/node_fs.ts","webpack:///../../../../src/generic/emscripten_fs.ts","webpack:///../../../../src/core/file_system.ts","webpack:///../../../../src/core/file.ts","webpack:///../../../../src/generic/preload_file.ts","webpack:///../../../../src/backend/AsyncMirror.ts","webpack:///../../../../~/async-es/internal/initialParams.js","webpack:///../../../../~/lodash-es/_freeGlobal.js","webpack:///../../../../~/lodash-es/_root.js","webpack:///../../../../~/lodash-es/_Symbol.js","webpack:///../../../../~/async-es/internal/breakLoop.js","webpack:///../../../../~/async-es/internal/getIterator.js","webpack:///../../../../~/lodash-es/isArguments.js","webpack:///../../../../~/lodash-es/isArray.js","webpack:///../../../../~/lodash-es/isBuffer.js","webpack:///../../../../~/lodash-es/_nodeUtil.js","webpack:///../../../../~/lodash-es/isTypedArray.js","webpack:///../../../../~/lodash-es/_nativeKeys.js","webpack:///../../../../~/async-es/map.js","webpack:///../../../../~/async-es/applyEach.js","webpack:///../../../../~/async-es/mapLimit.js","webpack:///../../../../~/async-es/mapSeries.js","webpack:///../../../../~/async-es/applyEachSeries.js","webpack:///../../../../~/async-es/apply.js","webpack:///../../../../~/lodash-es/_baseFor.js","webpack:///../../../../~/lodash-es/_unicodeToArray.js","webpack:///../../../../~/async-es/eachOfSeries.js","webpack:///../../../../~/async-es/seq.js","webpack:///../../../../~/async-es/compose.js","webpack:///../../../../~/async-es/constant.js","webpack:///../../../../~/async-es/dir.js","webpack:///../../../../~/async-es/log.js","webpack:///../../../../~/async-es/nextTick.js","webpack:///../../../../~/lodash-es/_baseRange.js","webpack:///../../../../src/core/global.ts","webpack:///../../../../src/generic/inode.ts","webpack:///../../../../src/backend/InMemory.ts","webpack:///../../../../src/backend/LocalStorage.ts","webpack:///../../../../src/generic/setImmediate.ts","webpack:///../../../../src/generic/mutex.ts","webpack:///../../../../src/generic/locked_fs.ts","webpack:///../../../../src/generic/extended_ascii.ts","webpack:///../../../../src/core/backends.ts","webpack:///../../../../src/index.ts","webpack:///./~/buffer/index.js","webpack:///./~/readable-stream/lib/_stream_duplex.js","webpack:///../ts/index.ts","webpack:///./~/inherits/inherits_browser.js","webpack:///./~/core-util-is/lib/util.js","webpack:///./~/events/events.js","webpack:///./build/temp/library/webpack/BFSBuffer.js","webpack:///./~/pako/lib/utils/common.js","webpack:///./~/stream-browserify/index.js","webpack:///./~/buffer-shims/index.js","webpack:///./~/process-nextick-args/index.js","webpack:///./~/readable-stream/lib/_stream_transform.js","webpack:///./~/readable-stream/lib/_stream_writable.js","webpack:///../ts/path.ts","webpack:///./~/readable-stream/lib/_stream_passthrough.js","webpack:///./~/readable-stream/lib/_stream_readable.js","webpack:///./~/string_decoder/index.js","webpack:///./~/base64-js/index.js","webpack:///../ts/process.ts","webpack:///../ts/tty.ts","webpack:///./~/ieee754/index.js","webpack:///./~/isarray/index.js","webpack:///./~/pako/lib/inflate.js","webpack:///./~/pako/lib/utils/strings.js","webpack:///./~/pako/lib/zlib/adler32.js","webpack:///./~/pako/lib/zlib/constants.js","webpack:///./~/pako/lib/zlib/crc32.js","webpack:///./~/pako/lib/zlib/gzheader.js","webpack:///./~/pako/lib/zlib/inffast.js","webpack:///./~/pako/lib/zlib/inflate.js","webpack:///./~/pako/lib/zlib/inftrees.js","webpack:///./~/pako/lib/zlib/messages.js","webpack:///./~/pako/lib/zlib/zstream.js","webpack:///./~/readable-stream/duplex.js","webpack:///./~/readable-stream/lib/internal/streams/BufferList.js","webpack:///./~/readable-stream/passthrough.js","webpack:///./~/readable-stream/readable.js","webpack:///./~/readable-stream/transform.js","webpack:///./~/readable-stream/writable.js","webpack:///./~/util-deprecate/browser.js","webpack:///(webpack)/buildin/module.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","Buffer","global","process","assertRoot","fs","ApiError","ErrorCode","EIO","normalizeMode","mode","def","const","trueMode","parseInt","isNaN","normalizeTime","time","Date","EINVAL","normalizePath","indexOf","path.resolve","normalizeOptions","options","defEnc","defFlag","defMode","encoding","flag","nopCb","_min","d0","d1","d2","bx","ay","levenshtein","a","b","length","tmp","let","la","lb","charCodeAt","offset","vector","Array","y","x","d3","bx0","bx1","bx2","bx3","dd","dy","deprecationMessage","print","fsName","opts","console","warn","JSON","stringify","fail","Error","mkdirpSync","existsSync","path.dirname","mkdirSync","buffer2ArrayBuffer","buff","u8","buffer2Uint8array","u8offset","byteOffset","u8Len","byteLength","buffer","slice","Uint8Array","arrayish2Buffer","arr","uint8Array2Buffer","from","arrayBuffer2Buffer","ab","copyingSlice","start","end","TypeError","emptyBuffer","s0","newS0","subarray","emptyBuff","alloc","bufferValidator","v","cb","isBuffer","checkOptions","fsType","validatorCallback","e","callbackCalled","pendingValidators","loopEnded","optsInfo","Options","Name","loop","optName","hasOwnProperty","opt","providedValue","undefined","optional","incorrectOptions","Object","keys","filter","o","map","str","distance","sort","typeMatches","isArray","type","join","validator","returned","apply","func","thisArg","args","overRest","transform","nativeMax","arguments","index","array","otherArgs","identity","value","rest","_overRest","applyEach","eachfn","fns","go","initialParams","callback","that","fn","concat","getRawTag","isOwn","symToStringTag","tag","unmasked","result","nativeObjectToString","objectToString","baseGetTag","undefinedTag","nullTag","isObject","isFunction","funcTag","genTag","asyncTag","proxyTag","isLength","MAX_SAFE_INTEGER","isArrayLike","noop","once","callFn","baseTimes","n","iteratee","isObjectLike","baseIsArguments","argsTag","stubFalse","isIndex","reIsUint","test","baseIsTypedArray","typedArrayTags","baseUnary","arrayLikeKeys","inherited","isArr","isArg","isArguments","isBuff","isType","isTypedArray","skipIndexes","String","key","push","isPrototype","Ctor","constructor","proto","prototype","objectProto","overArg","arg","baseKeys","object","nativeKeys","createArrayIterator","coll","i","len","createES2015Iterator","iterator","item","next","done","createObjectIterator","obj","okeys","getIterator","onlyOnce","_eachOfLimit","limit","iterateeCallback","err","running","breakLoop","replenish","elem","nextElem","eachOfLimit","doLimit","iterable","eachOfArrayLike","iteratorCallback","completed","doParallel","eachOf","_asyncMap","results","counter","_","doParallelLimit","arrayEach","createBaseFor","fromRight","keysFunc","props","fallback","setTimeout","wrap","defer","reduce","memo","eachOfSeries","consoleFunc","name","error","_withoutIndex","eachLimit","withoutIndex","constructErrorCodeLookup","errorCodeLookup","Dropbox","NETWORK_ERROR","INVALID_PARAM","INVALID_TOKEN","EPERM","OAUTH_ERROR","NOT_FOUND","ENOENT","INVALID_METHOD","NOT_ACCEPTABLE","CONFLICT","RATE_LIMITED","EBUSY","SERVER_ERROR","OVER_QUOTA","ENOSPC","isFileInfo","cache","stat","isFile","isDirInfo","isFolder","isArrayBuffer","convertError","path","path$$1","errno","parent","node","paths","unshift","ErrorStrings","translateError","folder","path.relative","message","replace","wrapCallback","wrapFunction","wrapFirst","wrapSecond","path.join","_folder","_wrapped","isDirectoryEntry","entry","isDirectory","_requestQuota","size","success","errorCallback","navigator","PERSISTENT","webkitPersistentStorage","requestQuota","TEMPORARY","webkitTemporaryStorage","webkitStorageInfo","_toArray","list","convertError$1","expectedDir","EEXIST","FileError","EACCES","ENOTDIR","EISDIR","getEmptyDirNode","emptyDirNode","GenerateRandomID","r","Math","random","toString","noError","noErrorTx","tx","abort","convertError$2","onErrorHandler","code","preventDefault","defineFcn","isSync","numArgs","rv","_getFs","standardizeError","this$1","makeModeWritable","0o222","getFlag","f","FileFlag","getFileFlag","apiErrorLocal2Remote","SpecialArgType","API_ERROR","errorData","bufferToTransferrableObject","writeToBuffer","apiErrorRemote2Local","fromBuffer","transferrableObjectToBuffer","errorLocal2Remote","ERROR","stack","errorRemote2Local","cnstr","statsLocal2Remote","stats","STATS","statsData","toBuffer","statsRemote2Local","Stats","fileFlagLocal2Remote","FILEFLAG","flagStr","getFlagString","fileFlagRemote2Local","remoteFlag","bufferLocal2Remote","BUFFER","data","bufferRemote2Local","buffArg","isAPIRequest","isAPIResponse","asyncDownloadFileModern","req","XMLHttpRequest","open","jsonSupported","responseType","onreadystatechange","readyState","status","response","parse","responseText","send","syncDownloadFileModern","overrideMimeType","text","syncDownloadFileIE10","getFileSize","async","getResponseHeader","getFileSizeSync","getFileSizeAsync","isFileInode","inode","isDirInode","isDir","tryToString","msdos2date","date","day","month","year","second","minute","hour","safeToString","useUTF8","ExtendedASCII","byte2str","getASCIIString","startIndex","trim","getJolietString","fromCharCode","pairs","floor","chars","pos","getDate","mon","min","sec","hundrethsSec","getShortFormDate","yearsSince1900","constructSystemUseEntry","bigData","sue","SystemUseEntry","signatureWord","CEEntry","PDEntry","SPEntry","STEntry","EREntry","ESEntry","PXEntry","PNEntry","SLEntry","NMEntry","CLEntry","PLEntry","REEntry","TFEntry","SFEntry","RREntry","constructSystemUseEntries","isoData","entries","getEntries","install","oldRequire","require","BFSRequire","registerFileSystem","Backends","BFSUtils","initialize","rootfs","configure","config","getFileSystem","finish","called","fsc","Create","Errors.ApiError","Errors.ErrorCode","waitCount","finishedIterating","k","forEach","d","defineProperty","EBADF","EFBIG","EROFS","ENOTEMPTY","ENOTSUP","ActionType","super","syscall","__proto__","create","fromJSON","json","readUInt32LE","toJSON","buffer$$1","bufferSize","bytesWritten","write","writeUInt32LE","api_error","freeze","validFlagStrs","flagCache","isReadable","isWriteable","isTruncating","isAppendable","isSynchronous","isExclusive","pathExistsAction","THROW_EXCEPTION","TRUNCATE_FILE","NOP","pathNotExistsAction","CREATE_FILE","FileType","itemType","atime","mtime","ctime","dev","ino","rdev","nlink","blksize","uid","gid","birthtime","fileData","FILE","DIRECTORY","blocks","ceil","readDoubleLE","writeDoubleLE","getTime","clone","isSymbolicLink","SYMLINK","chmod","isSocket","isBlockDevice","isCharacterDevice","isFIFO","wrapCb","FS","F_OK","R_OK","W_OK","X_OK","fdMap","nextFd","rootFS","isAvailable","_toUnixTimestamp","getRootFS","rename","oldPath","newPath","newCb","renameSync","exists","statSync","lstat","lstatSync","truncate","arg2","truncateSync","unlink","unlinkSync","file","getFdForFile","openSync","readFile","filename","readFileSync","writeFile","arg3","writeFileSync","appendFile","appendFileSync","fstat","fd","fd2file","fstatSync","close","closeFd","closeSync","ftruncate","ftruncateSync","fsync","sync","fsyncSync","syncSync","fdatasync","datasync","fdatasyncSync","datasyncSync","arg4","arg5","position","getPos","writeSync","read","bytesRead","buf","readSync","shenanigans","fchown","chown","fchownSync","chownSync","fchmod","numMode","fchmodSync","chmodSync","futimes","utimes","futimesSync","utimesSync","rmdir","rmdirSync","mkdir","readdir","readdirSync","link","srcpath","dstpath","linkSync","symlink","symlinkSync","readlink","readlinkSync","lchown","lchownSync","lchmod","lchmodSync","realpath","realpathSync","watchFile","listener","unwatchFile","watch","access","accessSync","createReadStream","createWriteStream","wrapCallbacks","cbWrapper","_fsMock","fsProto","newFs","isIE","exec","userAgent","toLowerCase","isWebWorker","window","BFSEmscriptenStreamOps","nodefs","getNodeFS","getFS","PATH","getPATH","ERRNO_CODES","getERRNO_CODES","stream","realPath","nfd","flagsToPermissionString","flags","ErrnoError","llseek","whence","BFSEmscriptenNodeOps","getattr","setattr","attr","timestamp","lookup","join2","getMode","createNode","mknod","oldNode","newDir","newName","contents","BFSEmscriptenFS","_FS","_PATH","_ERRNO_CODES","self","flagsToPermissionStringMap","0","1","2","64","65","66","129","193","514","577","578","705","706","1024","1025","1026","1089","1090","1153","1154","1217","1218","4096","4098","node_ops","stream_ops","mount","isLink","parts","reverse","parsedFlags","BaseFileSystem","supportsLinks","diskSpace","openFile","createFile","mustBeFile","parentStats","isLstat","openFileSync","createFileSync","splitPath","split","path.sep","addPaths","doesExist","er","er2","fname","oldCb","err2","isLchmod","isLchown","SynchronousFileSystem","supportsSynch","BaseFile","PreloadFile","BaseFile$$1","_fs","_path","_flag","_stat","_pos","_dirty","_buffer","getBuffer","getStats","getPath","advancePos","delta","setPos","newPos","newBuff","copy","endFp","endRead","supportsProps","isDirty","resetDirty","NoSyncFile","MirrorFile","PreloadFile$$1","_syncSync","AsyncMirror","SynchronousFileSystem$$1","deprecateMsg","_queue","_queueRunning","_isInitialized","_initializeCallbacks","_sync","_async","getName","enqueueOp","apiMethod","userCb","callbacks","copyDirectory","files","copyNextFile","copyItem","copyFile","isReadOnly","checkInitialized","op","doNextOp","shift","description","max","pop","freeGlobal","freeSelf","Function","Symbol","toStringTag","iteratorSymbol","propertyIsEnumerable","freeExports","nodeType","freeModule","moduleExports","nativeIsBuffer","arrayTag","boolTag","dateTag","errorTag","mapTag","numberTag","objectTag","regexpTag","setTag","stringTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","freeProcess","nodeUtil","binding","nodeIsTypedArray","eachOfGeneric","Infinity","eachOfImplementation","mapLimit","mapSeries","callArgs","_defer","rsAstralRange","rsComboMarksRange","reComboHalfMarksRange","rsComboSymbolsRange","rsComboRange","rsVarRange","rsAstral","rsCombo","rsFitz","rsModifier","rsNonAstral","rsRegional","rsSurrPair","rsZWJ","reOptMod","rsOptVar","hasSetImmediate","setImmediate","hasNextTick","nextTick","seq","functions","newargs","nextargs","values","ignoredArgs","CachedDropboxClient","client","_cache","_client","cacheInfo","getCachedDirInfo","_wrap","interceptCb","contentHash","filenames","folderEntries","NO_CONTENT","updateCachedDirInfo","updateCachedInfo","remove","move","src","dest","deleteCachedInfo","getCachedFileInfo","arrayBuffer","performOp","numRun","timeoutDuration","getCachedInfo","putCachedInfo","info","cachedInfo","updateCachedFileInfo","versionTag","DropboxFile","_writeFileStrict","DropboxFileSystem","BaseFileSystem$$1","supportsSymlinks","empty","mainCb","convert","deleteFile","finished","asyncEach","error2","missingPath","isRemoved","_statType","content","dbStat","_makeFile","ArrayBuffer","_remove","errorCode","isAuthenticated","EmscriptenFile","_stream","emPosition","EmscriptenFileSystem","DB_NAME","modeToFileType","utime","FolderAdapter","wrapped","toExport","global$1","_getFS","webkitRequestFileSystem","requestFileSystem","HTML5FSFile","_entry","createWriter","writer","blob","Blob","onwriteend","onerror","HTML5FS","allocate","granted","_readdir","deleteEntry","succ","fullPath","removeRecursively","semaphore","successCount","currentPath","getDirectory","parentDir","path.basename","moveTo","getFile","loadAsFile","fileFromEntry","failedToLoad","loadAsDir","dir","failedToLoadAsFile","exclusive","reader","FileReader","onloadend","event","bfsFile","ev","readAsArrayBuffer","dirEntry","createReader","readEntries","Inode","readUInt16LE","toStats","getSize","writeUInt16LE","update","hasChanged","atimeMs","mtimeMs","ctimeMs","ROOT_NODE_ID","SimpleSyncRWTransaction","store","originalData","modifiedKeys","get","val","stashOldValue","put","overwrite","markModified","del","commit","SyncKeyValueFile","SyncKeyValueFileSystem","makeRootDirectory","clear","beginTransaction","oldParent","oldName","newParent","oldDirNode","findINode","oldDirList","getDirListing","nodeId","newDirNode","newDirList","newNameNode","getINode","newFile","commitNewFile","removeEntry","fileInodeId","_findINode","fileInode","inodeChanged","currTime","dirInode","readDirectory","dirList","addNewNode","currId","retries","parentNode","dirListing","fileNode","dataId","fileNodeId","parentListing","fileName","AsyncKeyValueFile","AsyncKeyValueFileSystem","init","inodes","lists","errorOccurred","theOleSwitcharoo","oldParentList","oldParentINode","newParentList","newParentINode","fileId","completeRename","processInodeAndListings","findINodeAndDirListing","handleDirectoryListings","listing","reroll","committed","InMemoryStore","InMemoryFileSystem","SyncKeyValueFileSystem$$1","indexedDB","mozIndexedDB","webkitIndexedDB","msIndexedDB","IndexedDBROTransaction","onsuccess","target","IndexedDBRWTransaction","arraybuffer","add","_e","IndexedDBStore","storeName","openReq","onupgradeneeded","db","objectStoreNames","contains","deleteObjectStore","createObjectStore","IndexedDBFileSystem","transaction","objectStore","AsyncKeyValueFileSystem$$1","binaryEncoding","supportsBinaryString","localStorage","setItem","getItem","isEncoding","LocalStorageStore","LocalStorageFileSystem","removeItem","MountableFileSystem","mountList","mntMap","rootFs","mountPoint","umount","splice","substr","fs1rv","fs2rv","fsInfo","rv2","_containsMountPt","mountPoints","pt","fsCmdMap","cmds","i$1","fnName","bfsSetImmediate","gScope","timeouts","messageName","canUsePostMessage","importScripts","postMessage","postMessageIsAsync","oldOnMessage","onmessage","handleMessage","source","stopPropagation","cancelBubble","addEventListener","attachEvent","MessageChannel","channel","port1","port2","setImmediate$3","Mutex","_locked","_waiters","lock","unlock","tryLock","isLocked","LockedFS","_mu","getFSUnlocked","resolvedPath","linkString","deletionLogPath","OverlayFile","_syncAsync","UnlockedOverlayFS","writable","readable","_deletedFiles","_deleteLog","_deleteLogUpdatePending","_deleteLogUpdateNeeded","_deleteLogError","_writable","_readable","getOverlayedFileSystems","createParentDirectoriesAsync","createParentDirectories","OverlayFS","callbackArray","_reparseDeletionLog","getDeletionLog","restoreDeletionLog","log","updateLog","checkInitAsync","checkPathAsync","oldErr","oldStats","newErr","newStats","copyDirContents","oldFile","0o777","mkdirErr","readdirErr","checkPath","oldStat","readFileErr","writableExists","readableExists","deletePath","rmdirLower","dirStats","wFiles","rFiles","seenMap","filtered","fPath","fileP","existsWritable","existsReadable","operateOnWritableAsync","operateOnWritable","addition","0o644","statDone","toCreate","createParents","copyToWritable","copyToWritableAsync","pStats","LockedFS$$1","unwrap","CallbackArgumentConverter","_callbacks","_nextId","toRemoteArg","CB","toLocalArg","FileDescriptorArgumentConverter","_fileDescriptors","FD","applyFdAPIRequest","request","fdArg","_applyFdChanges","method","remoteFd","remoteStats","applyStatChanges","WorkerFile","remoteFdId","_remoteFdId","getRemoteFdId","_syncClose","syncClose","WorkerFS","worker","_callbackConverter","_isReadOnly","_supportLinks","_supportProps","_worker","resp","fixedArgs","_argRemote2Local","cbId","attachRemoteListener","argLocal2Remote","requestArgs","fdConverter","argRemote2Local","fixedRequestArgs","specialArg","abortAndSendError","countdown","browserfsMessage","arguments$1","fixedArg","remoteCb","probeResponse","PROBE","_argLocal2Remote","_rpc","methodName","asyncDownloadFile","syncDownloadFile","FileIndex","_index","addPath","DirInode","fromListing","idx","rootInode","queue","pwd","tree","children","FileInode","_ls","fileIterator","getListing","getData","_split_path","dirpath","itemname","addItem","addPathFast","itemNameMark","lastIndexOf","parentPath","substring","itemName","removePath","remItem","child","ls","getInode","setData","XmlHttpRequest","listingUrlOrObj","prefixUrl","charAt","_requestFileSync","baseUrl","FromURL","url","preloadFile","_requestFileSizeAsync","_requestFileSizeSync","_requestFileAsync","fdCast","fdBuff","getXhrPath","filePath","str2byte","charCode","charIdx","extendedChars","ExternalFileAttributeType","inflateRaw","decompressionMethods","CompressionMethod","FileHeader","versionNeeded","compressionMethod","lastModFileTime","rawLastModFileTime","crc32","fileNameLength","extraFieldLength","extraField","totalSize","FileData","header","record","decompress","fcn","compressedSize","uncompressedSize","getHeader","getRecord","getRawData","DataDescriptor","ArchiveExtraDataRecord","extraFieldData","DigitalSignature","signatureData","CentralDirectory","zipData","_filename","produceFilename","versionMadeBy","fileCommentLength","diskNumberStart","internalAttributes","externalAttributes","headerRelativeOffset","rawFileName","fileComment","rawFileComment","isEncrypted","getFileData","EndOfCentralDirectory","diskNumber","cdDiskNumber","cdDiskEntryCount","cdTotalEntryCount","cdSize","cdOffset","cdZipCommentLength","cdZipComment","rawCdZipComment","ZipTOC","directoryEntries","eocd","ZipFS","input","_directoryEntries","_eocd","populateIndex","computeIndex","zipTOC","RegisterDecompressionMethod","getEOCD","cdPtr","cdEnd","computeIndexResponsive","startOffset","endOffset","addToIndex","cd","cdEntries","count","getCentralDirectoryEntry","getCentralDirectoryEntryAt","RangeError","getNumberOfCentralDirectoryEntries","getEndOfCentralDirectory","cdRecord","DEFLATE","chunkSize","STORED","rockRidgeIdentifier","VolumeDescriptor","_data","standardIdentifier","version","PrimaryOrSupplementaryVolumeDescriptor","_root","systemIdentifier","_getString32","volumeIdentifier","volumeSpaceSize","volumeSetSize","volumeSequenceNumber","logicalBlockSize","pathTableSize","locationOfTypeLPathTable","locationOfOptionalTypeLPathTable","locationOfTypeMPathTable","readUInt32BE","locationOfOptionalTypeMPathTable","rootDirectoryEntry","_constructRootDirectoryRecord","rootCheckForRockRidge","volumeSetIdentifier","_getString","publisherIdentifier","dataPreparerIdentifier","applicationIdentifier","copyrightFileIdentifier","abstractFileIdentifier","bibliographicFileIdentifier","volumeCreationDate","volumeModificationDate","volumeExpirationDate","volumeEffectiveDate","fileStructureVersion","applicationUsed","reserved","PrimaryVolumeDescriptor","ISODirectoryRecord","SupplementaryVolumeDescriptor","escapeSequence","third","JolietDirectoryRecord","DirectoryRecord","rockRidgeOffset","_suEntries","_fileOrDir","_rockRidgeOffset","hasRockRidge","getRockRidgeOffset","getDotEntry","_getRockRidgeOffset","extendedAttributeRecordLength","lba","dataLength","recordingDate","fileFlags","fileUnitSize","interleaveGapSize","identifier","_rockRidgeFilename","ident","versionSeparator","getSUEntries","isSymlink","getSymlinkPath","getStr","_getGetString","components","componentRecords","list$1","component","continueFlag","_constructDirectory","_constructSUEntries","nmEntries","getString","suEntries","spEntry","checkBytesPass","extensionIdentifier","bytesSkipped","ISODirectory","JolietDirectory","readUInt16BE","signatureWordString","suVersion","_entries","continuationLba","continuationLbaOffset","continuationLength","identifierLength","descriptorLength","sourceLength","extensionVersion","extensionDescriptor","extensionSource","extensionSequence","fileLinks","devTHigh","devTLow","records","SLComponentRecord","componentLength","childDirectoryLba","parentDirectoryLba","creation","_longFormDates","modify","previousDates","backup","expiration","effective","virtualSizeHigh","virtualSizeLow","tableDepth","Directory","_fileList","_fileMap","_record","iLimit","cl","_constructDirectoryRecord","getFileList","IsoFS","vdTerminatorFound","candidateVDs","vd","_pvd","_name","_getDirectoryRecord","_getStats","newP","dirRec","Emscripten","InMemory","IndexedDB","LocalStorage","wrappedCb","normalizedCb","normalizedOpts","oneArg","EmscriptenFS","FileSystem","Errors","typedArraySupport","foo","createBuffer","K_MAX_LENGTH","encodingOrOffset","allocUnsafe","fromArrayBuffer","fromString","fromObject","assertSize","fill","checked","string","actual","fromArrayLike","isArrayBufferView","numberIsNaN","SlowBuffer","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","bidirectionalIndexOf","arrayIndexOf","indexSize","arrLength","valLength","foundIndex","found","j","hexWrite","Number","remaining","strLen","parsed","utf8Write","blitBuffer","asciiWrite","asciiToBytes","latin1Write","base64Write","ucs2Write","utf16leToBytes","base64","fromByteArray","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","codePoints","MAX_ARGUMENTS_LENGTH","ret","out","toHex","bytes","checkOffset","ext","checkInt","checkIEEE754","writeFloat","littleEndian","noAssert","ieee754","writeDouble","base64clean","INVALID_BASE64_RE","units","leadSurrogate","byteArray","hi","lo","toByteArray","dst","isView","INSPECT_MAX_BYTES","kMaxLength","TYPED_ARRAY_SUPPORT","species","configurable","enumerable","poolSize","allocUnsafeSlow","_isBuffer","compare","swap16","swap32","swap64","equals","inspect","match","thisStart","thisEnd","thisCopy","targetCopy","includes","isFinite","_arr","newBuf","readUIntLE","mul","readUIntBE","readUInt8","readIntLE","pow","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleBE","writeUIntLE","maxBytes","writeUIntBE","writeUInt8","writeUInt16BE","writeUInt32BE","writeIntLE","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleBE","targetStart","set","Duplex","Readable","Writable","allowHalfOpen","onend","_writableState","ended","processNextTick","onEndNT","objectKeys","util","inherits","defineKey","processProxy","Process","initializeTTYs","stdin","stdout","stderr","ctor","superCtor","super_","TempCtor","isBoolean","isNull","isNullOrUndefined","isNumber","isString","isSymbol","isUndefined","isRegExp","re","isDate","isError","isPrimitive","EventEmitter","_events","_maxListeners","defaultMaxListeners","setMaxListeners","emit","handler","listeners","context","addListener","newListener","warned","trace","on","g","removeListener","fired","removeAllListeners","listenerCount","evlistener","emitter","TYPED_OK","Uint16Array","Int32Array","assign","sources","shrinkBuf","fnTyped","arraySet","src_offs","dest_offs","flattenChunks","chunks","l","chunk","fnUntyped","setTyped","Buf8","Buf16","Buf32","Stream","EE","Transform","PassThrough","pipe","ondata","pause","ondrain","resume","didOnEnd","onclose","destroy","cleanup","_isStdio","MAX_LEN","enc","_fill","fillBuf","flen","arg1","TransformState","afterTransform","needTransform","transforming","writecb","writechunk","writeencoding","ts","_transformState","rs","_readableState","reading","needReadable","highWaterMark","_read","_transform","flush","_flush","ws","_write","nop","WriteReq","WritableState","objectMode","writableObjectMode","hwm","defaultHwm","needDrain","ending","noDecode","decodeStrings","defaultEncoding","writing","corked","bufferProcessing","onwrite","writelen","bufferedRequest","lastBufferedRequest","pendingcb","prefinished","errorEmitted","bufferedRequestCount","corkedRequestsFree","CorkedRequest","realHasInstance","writev","_writev","writeAfterEnd","validChunk","state","valid","decodeChunk","bufferShim","writeOrBuffer","isBuf","last","doWrite","onwriteError","onwriteStateUpdate","needFinish","clearBuffer","asyncWrite","afterWrite","onwriteDrain","finishMaybe","holder","prefinish","need","endWritable","_this","browser","internalUtil","deprecate","current","hasInstance","cork","uncork","setDefaultEncoding","posixSplitPath","splitPathRe","normalize","absolute","sep","_removeDuplicateSeps","goodComponents","_i","processed","segment","resolve","resolved","cwd","relative","to","fromSegs","toSegs","upCount","downSegs","seg","dirname","sections","basename","lastPart","lastPartExt","extname","isAbsolute","_makeLong","allParts","base","format","pathObject","_replaceRegex","RegExp","delimiter","posix","win32","prependListener","ReadableState","readableObjectMode","BufferList","pipes","pipesCount","flowing","endEmitted","emittedReadable","readableListening","resumeScheduled","ranOut","awaitDrain","readingMore","decoder","StringDecoder","readableAddChunk","addToFront","chunkInvalid","onEofChunk","skipAdd","emitReadable","maybeReadMore","needMoreData","computeNewHighWaterMark","MAX_HWM","howMuchToRead","head","debug","emitReadable_","flow","maybeReadMore_","pipeOnDrain","EElistenerCount","nReadingNextTick","resume_","fromList","fromListPartial","hasStrings","copyFromBufferString","copyFromBuffer","nb","tail","endReadable","endReadableNT","xs","debugUtil","debuglog","isPaused","setEncoding","nOrig","doRead","pipeOpts","onunpipe","onfinish","cleanedUp","increasedAwaitDrain","unpipe","doEnd","endFn","dests","paused","events","bind","_fromList","assertEncoding","isBufferEncoding","passThroughWrite","utf16DetectIncompleteChar","charReceived","charLength","base64DetectIncompleteChar","surrogateSize","detectIncompleteChar","charBuffer","charStr","available","cr","placeHoldersCount","b64","placeHolders","Arr","L","revLookup","tripletToBase64","num","encodeChunk","uint8","output","extraBytes","maxChunkLength","len2","__dirname","__extends","__","Item","fun","run","NextTickQueue","_draining","_currentQueue","_queueIndex","_drainQueue","_cleanUpNextTick","timeout","clearTimeout","_super","startTime","now","_cwd","platform","argv","execArgv","domain","execPath","env","exitCode","_gid","_uid","versions","http_parser","v8","uv","zlib","ares","icu","openssl","target_defaults","cflags","default_configuration","defines","include_dirs","libraries","variables","clang","host_arch","node_install_npm","node_install_waf","node_prefix","node_shared_cares","node_shared_http_parser","node_shared_libuv","node_shared_zlib","node_shared_v8","node_use_dtrace","node_use_etw","node_use_openssl","node_shared_openssl","strict_aliasing","target_arch","v8_use_snapshot","v8_no_strict_aliasing","visibility","pid","title","arch","_mask","connected","chdir","uptime","exit","getgid","setgid","getuid","setuid","kill","signal","memoryUsage","rss","heapTotal","heapUsed","umask","mask","oldMask","hrtime","timeinfo","performance","secs","TTY","disconnect","isRaw","columns","rows","isTTY","_bufferedWrites","_waitingForWrites","setRawMode","changeColumns","changeRows","isatty","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","s","NaN","rt","abs","LN2","Inflate","utils","windowBits","raw","msg","strm","ZStream","avail_out","zlib_inflate","inflateInit2","Z_OK","GZheader","inflateGetHeader","inflate","inflator","strings","_mode","next_out_utf8","utf8str","dict","dictionary","allowBufError","Z_FINISH","Z_NO_FLUSH","binstring2buf","next_in","avail_in","next_out","Z_NEED_DICT","string2buf","inflateSetDictionary","Z_BUF_ERROR","Z_STREAM_END","onEnd","Z_SYNC_FLUSH","utf8border","buf2string","onData","inflateEnd","ungzip","buf2binstring","STR_APPLY_UIA_OK","STR_APPLY_OK","_utf8len","q","c2","m_pos","str_len","buf_len","c_len","utf16buf","adler32","adler","s1","s2","Z_PARTIAL_FLUSH","Z_FULL_FLUSH","Z_BLOCK","Z_TREES","Z_ERRNO","Z_STREAM_ERROR","Z_DATA_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_DEFAULT_STRATEGY","Z_BINARY","Z_TEXT","Z_UNKNOWN","Z_DEFLATED","makeTable","table","crc","t","crcTable","xflags","os","extra","extra_len","comment","hcrc","BAD","TYPE","_in","_out","beg","dmax","wsize","whave","wnext","s_window","hold","bits","lcode","dcode","lmask","dmask","here","dist","from_source","lencode","distcode","lenbits","distbits","top","dolen","dodist","sane","zswap32","InflateState","havedict","check","total","wbits","ncode","nlen","ndist","have","lens","work","lendyn","distdyn","back","was","inflateResetKeep","total_in","total_out","HEAD","ENOUGH_LENS","ENOUGH_DISTS","inflateReset","inflateReset2","inflateInit","DEF_WBITS","fixedtables","virgin","sym","lenfix","distfix","inflate_table","LENS","DISTS","updatewindow","left","here_bits","here_op","here_val","last_bits","last_op","last_val","hbuf","order","TYPEDO","inf_leave","FLAGS","DICTID","TIME","OS","EXLEN","EXTRA","NAME","COMMENT","HCRC","DICT","CHECK","LEN_","TABLE","COPY_","COPY","LENLENS","CODES","CODELENS","LEN","inflate_fast","LIT","LENEXT","DIST","DISTEXT","MATCH","LENGTH","DONE","MEM","Z_MEM_ERROR","SYNC","data_type","dictid","dictLength","MAX_WBITS","inflateInfo","MAXBITS","lbase","lext","dbase","dext","lens_index","codes","table_index","incr","low","curr","drop","used","huff","base_index","offs","extra_index","-1","-2","-3","-4","-5","-6","READABLE_STREAM","deprecated","webpackPolyfill"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,UAAAD,IAEAD,EAAA,UAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAASL,EAAQD,EAASM,IAEH,SAASS,EAAQC,EAAQf,EAAQgB,GAAU,YEnCxE,SAAAC,GAAoBC,G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AAQD,EAASM,GkJnkwBhCL,EAAAD,QAAAM,EAAA,KlJ0kwBM,SAASL,EAAQD,EAASM,GmJ1kwBhCL,EAAAD,QAAAM,EAAA,KnJilwBM,SAASL,EAAQD,IAEM,SAASgB,GoJ1jwBtC,QAAA61D,GAAAlsD,EAAA27D,GAMA,QAAAsN,KACA,IAAAzkB,EAAA,CACA,GAAAxvC,EAAA,oBACA,SAAA1a,OAAAqhE,EACO3mD,GAAA,oBACP/a,QAAAwqD,MAAAkX,GAEA1hE,QAAAC,KAAAyhE,GAEAnX,GAAA,EAEA,MAAAxkD,GAAAtB,MAAAjJ,KAAAwJ,WAhBA,GAAA+V,EAAA,iBACA,MAAAhV,EAGA,IAAAwkD,IAAA,CAeA,OAAAykB,GAWA,QAAAj0D,GAAAlO,GAEA,IACA,IAAAzQ,EAAA4lC,aAAA,SACG,MAAAl2B,GACH,SAEA,GAAAqwB,GAAA//B,EAAA4lC,aAAAn1B,EACA,cAAAsvB,GACA,SAAArzB,OAAAqzB,GAAAvV,cA5DAvrB,EAAAD,QAAA62D,IpJkpwB8Bl2D,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAASH,EAAQD,GqJ3pwBvBC,EAAAD,QAAA,SAAAC,GAQA,MAPAA,GAAA4zE,kBACA5zE,EAAA42D,UAAA,aACA52D,EAAA4T,SAEA5T,EAAAoyC,YACApyC,EAAA4zE,gBAAA,GAEA5zE,IrJmqwBM,SAASA,EAAQD","file":"../build/browserfs.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"BrowserFS\"] = factory();\n\telse\n\t\troot[\"BrowserFS\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"BrowserFS\"] = factory();\n\telse\n\t\troot[\"BrowserFS\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(Buffer, global, module, process) {'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', { value: true });\n\t\n\tvar buffer = __webpack_require__(1);\n\tvar path = __webpack_require__(14);\n\t\n\t/**\n\t * Standard libc error codes. Add more to this enum and ErrorStrings as they are\n\t * needed.\n\t * @url http://www.gnu.org/software/libc/manual/html_node/Error-Codes.html\n\t */\n\t/**\n\t * Standard libc error codes. Add more to this enum and ErrorStrings as they are\n\t * needed.\n\t * @url http://www.gnu.org/software/libc/manual/html_node/Error-Codes.html\n\t */ var ErrorCode;\n\t(function (ErrorCode) {\n\t ErrorCode[ErrorCode[\"EPERM\"] = 1] = \"EPERM\";\n\t ErrorCode[ErrorCode[\"ENOENT\"] = 2] = \"ENOENT\";\n\t ErrorCode[ErrorCode[\"EIO\"] = 5] = \"EIO\";\n\t ErrorCode[ErrorCode[\"EBADF\"] = 9] = \"EBADF\";\n\t ErrorCode[ErrorCode[\"EACCES\"] = 13] = \"EACCES\";\n\t ErrorCode[ErrorCode[\"EBUSY\"] = 16] = \"EBUSY\";\n\t ErrorCode[ErrorCode[\"EEXIST\"] = 17] = \"EEXIST\";\n\t ErrorCode[ErrorCode[\"ENOTDIR\"] = 20] = \"ENOTDIR\";\n\t ErrorCode[ErrorCode[\"EISDIR\"] = 21] = \"EISDIR\";\n\t ErrorCode[ErrorCode[\"EINVAL\"] = 22] = \"EINVAL\";\n\t ErrorCode[ErrorCode[\"EFBIG\"] = 27] = \"EFBIG\";\n\t ErrorCode[ErrorCode[\"ENOSPC\"] = 28] = \"ENOSPC\";\n\t ErrorCode[ErrorCode[\"EROFS\"] = 30] = \"EROFS\";\n\t ErrorCode[ErrorCode[\"ENOTEMPTY\"] = 39] = \"ENOTEMPTY\";\n\t ErrorCode[ErrorCode[\"ENOTSUP\"] = 95] = \"ENOTSUP\";\n\t})(ErrorCode || (ErrorCode = {}));\n\t/* tslint:disable:variable-name */\n\t/**\n\t * Strings associated with each error code.\n\t * @hidden\n\t */\n\tvar ErrorStrings = {};\n\tErrorStrings[ErrorCode.EPERM] = 'Operation not permitted.';\n\tErrorStrings[ErrorCode.ENOENT] = 'No such file or directory.';\n\tErrorStrings[ErrorCode.EIO] = 'Input/output error.';\n\tErrorStrings[ErrorCode.EBADF] = 'Bad file descriptor.';\n\tErrorStrings[ErrorCode.EACCES] = 'Permission denied.';\n\tErrorStrings[ErrorCode.EBUSY] = 'Resource busy or locked.';\n\tErrorStrings[ErrorCode.EEXIST] = 'File exists.';\n\tErrorStrings[ErrorCode.ENOTDIR] = 'File is not a directory.';\n\tErrorStrings[ErrorCode.EISDIR] = 'File is a directory.';\n\tErrorStrings[ErrorCode.EINVAL] = 'Invalid argument.';\n\tErrorStrings[ErrorCode.EFBIG] = 'File is too big.';\n\tErrorStrings[ErrorCode.ENOSPC] = 'No space left on disk.';\n\tErrorStrings[ErrorCode.EROFS] = 'Cannot modify a read-only file system.';\n\tErrorStrings[ErrorCode.ENOTEMPTY] = 'Directory is not empty.';\n\tErrorStrings[ErrorCode.ENOTSUP] = 'Operation is not supported.';\n\t/* tslint:enable:variable-name */\n\t/**\n\t * Represents a BrowserFS error. Passed back to applications after a failed\n\t * call to the BrowserFS API.\n\t */\n\tvar ApiError = (function (Error) {\n\t function ApiError(type, message, path$$1) {\n\t if ( message === void 0 ) message = ErrorStrings[type];\n\t\n\t Error.call(this, message);\n\t // Unsupported.\n\t this.syscall = \"\";\n\t this.errno = type;\n\t this.code = ErrorCode[type];\n\t this.path = path$$1;\n\t this.stack = new Error().stack;\n\t this.message = \"Error: \" + (this.code) + \": \" + message + (this.path ? (\", '\" + (this.path) + \"'\") : '');\n\t }\n\t\n\t if ( Error ) ApiError.__proto__ = Error;\n\t ApiError.prototype = Object.create( Error && Error.prototype );\n\t ApiError.prototype.constructor = ApiError;\n\t ApiError.fromJSON = function fromJSON (json) {\n\t var err = new ApiError(0);\n\t err.errno = json.errno;\n\t err.code = json.code;\n\t err.path = json.path;\n\t err.stack = json.stack;\n\t err.message = json.message;\n\t return err;\n\t };\n\t /**\n\t * Creates an ApiError object from a buffer.\n\t */\n\t ApiError.fromBuffer = function fromBuffer (buffer$$1, i) {\n\t if ( i === void 0 ) i = 0;\n\t\n\t return ApiError.fromJSON(JSON.parse(buffer$$1.toString('utf8', i + 4, i + 4 + buffer$$1.readUInt32LE(i))));\n\t };\n\t ApiError.FileError = function FileError (code, p) {\n\t return new ApiError(code, ErrorStrings[code], p);\n\t };\n\t ApiError.ENOENT = function ENOENT (path$$1) {\n\t return this.FileError(ErrorCode.ENOENT, path$$1);\n\t };\n\t ApiError.EEXIST = function EEXIST (path$$1) {\n\t return this.FileError(ErrorCode.EEXIST, path$$1);\n\t };\n\t ApiError.EISDIR = function EISDIR (path$$1) {\n\t return this.FileError(ErrorCode.EISDIR, path$$1);\n\t };\n\t ApiError.ENOTDIR = function ENOTDIR (path$$1) {\n\t return this.FileError(ErrorCode.ENOTDIR, path$$1);\n\t };\n\t ApiError.EPERM = function EPERM (path$$1) {\n\t return this.FileError(ErrorCode.EPERM, path$$1);\n\t };\n\t ApiError.ENOTEMPTY = function ENOTEMPTY (path$$1) {\n\t return this.FileError(ErrorCode.ENOTEMPTY, path$$1);\n\t };\n\t /**\n\t * @return A friendly error message.\n\t */\n\t ApiError.prototype.toString = function toString () {\n\t return this.message;\n\t };\n\t ApiError.prototype.toJSON = function toJSON () {\n\t return {\n\t errno: this.errno,\n\t code: this.code,\n\t path: this.path,\n\t stack: this.stack,\n\t message: this.message\n\t };\n\t };\n\t /**\n\t * Writes the API error into a buffer.\n\t */\n\t ApiError.prototype.writeToBuffer = function writeToBuffer (buffer$$1, i) {\n\t if ( buffer$$1 === void 0 ) buffer$$1 = Buffer.alloc(this.bufferSize());\n\t if ( i === void 0 ) i = 0;\n\t\n\t var bytesWritten = buffer$$1.write(JSON.stringify(this.toJSON()), i + 4);\n\t buffer$$1.writeUInt32LE(bytesWritten, i);\n\t return buffer$$1;\n\t };\n\t /**\n\t * The size of the API error in buffer-form in bytes.\n\t */\n\t ApiError.prototype.bufferSize = function bufferSize () {\n\t // 4 bytes for string length.\n\t return 4 + Buffer.byteLength(JSON.stringify(this.toJSON()));\n\t };\n\t\n\t return ApiError;\n\t }(Error));\n\t\n\t\n\tvar api_error = Object.freeze({\n\t\tget ErrorCode () { return ErrorCode; },\n\t\tErrorStrings: ErrorStrings,\n\t\tApiError: ApiError\n\t});\n\t\n\tvar ActionType;\n\t(function (ActionType) {\n\t // Indicates that the code should not do anything.\n\t ActionType[ActionType[\"NOP\"] = 0] = \"NOP\";\n\t // Indicates that the code should throw an exception.\n\t ActionType[ActionType[\"THROW_EXCEPTION\"] = 1] = \"THROW_EXCEPTION\";\n\t // Indicates that the code should truncate the file, but only if it is a file.\n\t ActionType[ActionType[\"TRUNCATE_FILE\"] = 2] = \"TRUNCATE_FILE\";\n\t // Indicates that the code should create the file.\n\t ActionType[ActionType[\"CREATE_FILE\"] = 3] = \"CREATE_FILE\";\n\t})(ActionType || (ActionType = {}));\n\t/**\n\t * Represents one of the following file flags. A convenience object.\n\t *\n\t * * `'r'` - Open file for reading. An exception occurs if the file does not exist.\n\t * * `'r+'` - Open file for reading and writing. An exception occurs if the file does not exist.\n\t * * `'rs'` - Open file for reading in synchronous mode. Instructs the filesystem to not cache writes.\n\t * * `'rs+'` - Open file for reading and writing, and opens the file in synchronous mode.\n\t * * `'w'` - Open file for writing. The file is created (if it does not exist) or truncated (if it exists).\n\t * * `'wx'` - Like 'w' but opens the file in exclusive mode.\n\t * * `'w+'` - Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).\n\t * * `'wx+'` - Like 'w+' but opens the file in exclusive mode.\n\t * * `'a'` - Open file for appending. The file is created if it does not exist.\n\t * * `'ax'` - Like 'a' but opens the file in exclusive mode.\n\t * * `'a+'` - Open file for reading and appending. The file is created if it does not exist.\n\t * * `'ax+'` - Like 'a+' but opens the file in exclusive mode.\n\t *\n\t * Exclusive mode ensures that the file path is newly created.\n\t */\n\tvar FileFlag = function FileFlag(flagStr) {\n\t this.flagStr = flagStr;\n\t if (FileFlag.validFlagStrs.indexOf(flagStr) < 0) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid flag: \" + flagStr);\n\t }\n\t};\n\t/**\n\t * Get an object representing the given file flag.\n\t * @param modeStr The string representing the flag\n\t * @return The FileFlag object representing the flag\n\t * @throw when the flag string is invalid\n\t */\n\tFileFlag.getFileFlag = function getFileFlag (flagStr) {\n\t // Check cache first.\n\t if (FileFlag.flagCache.hasOwnProperty(flagStr)) {\n\t return FileFlag.flagCache[flagStr];\n\t }\n\t return FileFlag.flagCache[flagStr] = new FileFlag(flagStr);\n\t};\n\t/**\n\t * Get the underlying flag string for this flag.\n\t */\n\tFileFlag.prototype.getFlagString = function getFlagString () {\n\t return this.flagStr;\n\t};\n\t/**\n\t * Returns true if the file is readable.\n\t */\n\tFileFlag.prototype.isReadable = function isReadable () {\n\t return this.flagStr.indexOf('r') !== -1 || this.flagStr.indexOf('+') !== -1;\n\t};\n\t/**\n\t * Returns true if the file is writeable.\n\t */\n\tFileFlag.prototype.isWriteable = function isWriteable () {\n\t return this.flagStr.indexOf('w') !== -1 || this.flagStr.indexOf('a') !== -1 || this.flagStr.indexOf('+') !== -1;\n\t};\n\t/**\n\t * Returns true if the file mode should truncate.\n\t */\n\tFileFlag.prototype.isTruncating = function isTruncating () {\n\t return this.flagStr.indexOf('w') !== -1;\n\t};\n\t/**\n\t * Returns true if the file is appendable.\n\t */\n\tFileFlag.prototype.isAppendable = function isAppendable () {\n\t return this.flagStr.indexOf('a') !== -1;\n\t};\n\t/**\n\t * Returns true if the file is open in synchronous mode.\n\t */\n\tFileFlag.prototype.isSynchronous = function isSynchronous () {\n\t return this.flagStr.indexOf('s') !== -1;\n\t};\n\t/**\n\t * Returns true if the file is open in exclusive mode.\n\t */\n\tFileFlag.prototype.isExclusive = function isExclusive () {\n\t return this.flagStr.indexOf('x') !== -1;\n\t};\n\t/**\n\t * Returns one of the static fields on this object that indicates the\n\t * appropriate response to the path existing.\n\t */\n\tFileFlag.prototype.pathExistsAction = function pathExistsAction () {\n\t if (this.isExclusive()) {\n\t return ActionType.THROW_EXCEPTION;\n\t }\n\t else if (this.isTruncating()) {\n\t return ActionType.TRUNCATE_FILE;\n\t }\n\t else {\n\t return ActionType.NOP;\n\t }\n\t};\n\t/**\n\t * Returns one of the static fields on this object that indicates the\n\t * appropriate response to the path not existing.\n\t */\n\tFileFlag.prototype.pathNotExistsAction = function pathNotExistsAction () {\n\t if ((this.isWriteable() || this.isAppendable()) && this.flagStr !== 'r+') {\n\t return ActionType.CREATE_FILE;\n\t }\n\t else {\n\t return ActionType.THROW_EXCEPTION;\n\t }\n\t};\n\t// Contains cached FileMode instances.\n\tFileFlag.flagCache = {};\n\t// Array of valid mode strings.\n\tFileFlag.validFlagStrs = ['r', 'r+', 'rs', 'rs+', 'w', 'wx', 'w+', 'wx+', 'a', 'ax', 'a+', 'ax+'];\n\t\n\t/**\n\t * Indicates the type of the given file. Applied to 'mode'.\n\t */\n\tvar FileType;\n\t(function (FileType) {\n\t FileType[FileType[\"FILE\"] = 32768] = \"FILE\";\n\t FileType[FileType[\"DIRECTORY\"] = 16384] = \"DIRECTORY\";\n\t FileType[FileType[\"SYMLINK\"] = 40960] = \"SYMLINK\";\n\t})(FileType || (FileType = {}));\n\t/**\n\t * Emulation of Node's `fs.Stats` object.\n\t *\n\t * Attribute descriptions are from `man 2 stat'\n\t * @see http://nodejs.org/api/fs.html#fs_class_fs_stats\n\t * @see http://man7.org/linux/man-pages/man2/stat.2.html\n\t */\n\tvar Stats = function Stats(itemType, size, mode, atime, mtime, ctime) {\n\t if ( atime === void 0 ) atime = new Date();\n\t if ( mtime === void 0 ) mtime = new Date();\n\t if ( ctime === void 0 ) ctime = new Date();\n\t\n\t this.size = size;\n\t this.atime = atime;\n\t this.mtime = mtime;\n\t this.ctime = ctime;\n\t /**\n\t * UNSUPPORTED ATTRIBUTES\n\t * I assume no one is going to need these details, although we could fake\n\t * appropriate values if need be.\n\t */\n\t // ID of device containing file\n\t this.dev = 0;\n\t // inode number\n\t this.ino = 0;\n\t // device ID (if special file)\n\t this.rdev = 0;\n\t // number of hard links\n\t this.nlink = 1;\n\t // blocksize for file system I/O\n\t this.blksize = 4096;\n\t // @todo Maybe support these? atm, it's a one-user filesystem.\n\t // user ID of owner\n\t this.uid = 0;\n\t // group ID of owner\n\t this.gid = 0;\n\t // time file was created (currently unsupported)\n\t this.birthtime = new Date(0);\n\t // XXX: Some file systems stash data on stats objects.\n\t this.fileData = null;\n\t if (!mode) {\n\t switch (itemType) {\n\t case FileType.FILE:\n\t this.mode = 0x1a4;\n\t break;\n\t case FileType.DIRECTORY:\n\t default:\n\t this.mode = 0x1ff;\n\t }\n\t }\n\t else {\n\t this.mode = mode;\n\t }\n\t // number of 512B blocks allocated\n\t this.blocks = Math.ceil(size / 512);\n\t // Check if mode also includes top-most bits, which indicate the file's\n\t // type.\n\t if (this.mode < 0x1000) {\n\t this.mode |= itemType;\n\t }\n\t};\n\tStats.fromBuffer = function fromBuffer (buffer$$1) {\n\t var size = buffer$$1.readUInt32LE(0), mode = buffer$$1.readUInt32LE(4), atime = buffer$$1.readDoubleLE(8), mtime = buffer$$1.readDoubleLE(16), ctime = buffer$$1.readDoubleLE(24);\n\t return new Stats(mode & 0xF000, size, mode & 0xFFF, new Date(atime), new Date(mtime), new Date(ctime));\n\t};\n\tStats.prototype.toBuffer = function toBuffer () {\n\t var buffer$$1 = Buffer.alloc(32);\n\t buffer$$1.writeUInt32LE(this.size, 0);\n\t buffer$$1.writeUInt32LE(this.mode, 4);\n\t buffer$$1.writeDoubleLE(this.atime.getTime(), 8);\n\t buffer$$1.writeDoubleLE(this.mtime.getTime(), 16);\n\t buffer$$1.writeDoubleLE(this.ctime.getTime(), 24);\n\t return buffer$$1;\n\t};\n\t/**\n\t * **Nonstandard**: Clone the stats object.\n\t * @return [BrowserFS.node.fs.Stats]\n\t */\n\tStats.prototype.clone = function clone () {\n\t return new Stats(this.mode & 0xF000, this.size, this.mode & 0xFFF, this.atime, this.mtime, this.ctime);\n\t};\n\t/**\n\t * @return [Boolean] True if this item is a file.\n\t */\n\tStats.prototype.isFile = function isFile () {\n\t return (this.mode & 0xF000) === FileType.FILE;\n\t};\n\t/**\n\t * @return [Boolean] True if this item is a directory.\n\t */\n\tStats.prototype.isDirectory = function isDirectory () {\n\t return (this.mode & 0xF000) === FileType.DIRECTORY;\n\t};\n\t/**\n\t * @return [Boolean] True if this item is a symbolic link (only valid through lstat)\n\t */\n\tStats.prototype.isSymbolicLink = function isSymbolicLink () {\n\t return (this.mode & 0xF000) === FileType.SYMLINK;\n\t};\n\t/**\n\t * Change the mode of the file. We use this helper function to prevent messing\n\t * up the type of the file, which is encoded in mode.\n\t */\n\tStats.prototype.chmod = function chmod (mode) {\n\t this.mode = (this.mode & 0xF000) | mode;\n\t};\n\t// We don't support the following types of files.\n\tStats.prototype.isSocket = function isSocket () {\n\t return false;\n\t};\n\tStats.prototype.isBlockDevice = function isBlockDevice () {\n\t return false;\n\t};\n\tStats.prototype.isCharacterDevice = function isCharacterDevice () {\n\t return false;\n\t};\n\tStats.prototype.isFIFO = function isFIFO () {\n\t return false;\n\t};\n\t\n\t/**\n\t * Wraps a callback function. Used for unit testing. Defaults to a NOP.\n\t * @hidden\n\t */\n\tvar wrapCb = function (cb, numArgs) {\n\t return cb;\n\t};\n\t/**\n\t * @hidden\n\t */\n\tfunction assertRoot(fs) {\n\t if (fs) {\n\t return fs;\n\t }\n\t throw new ApiError(ErrorCode.EIO, \"Initialize BrowserFS with a file system using BrowserFS.initialize(filesystem)\");\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction normalizeMode(mode, def) {\n\t switch (typeof mode) {\n\t case 'number':\n\t // (path, flag, mode, cb?)\n\t return mode;\n\t case 'string':\n\t // (path, flag, modeString, cb?)\n\t var trueMode = parseInt(mode, 8);\n\t if (!isNaN(trueMode)) {\n\t return trueMode;\n\t }\n\t // Invalid string.\n\t return def;\n\t default:\n\t return def;\n\t }\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction normalizeTime(time) {\n\t if (time instanceof Date) {\n\t return time;\n\t }\n\t else if (typeof time === 'number') {\n\t return new Date(time * 1000);\n\t }\n\t else {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid time.\");\n\t }\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction normalizePath(p) {\n\t // Node doesn't allow null characters in paths.\n\t if (p.indexOf('\\u0000') >= 0) {\n\t throw new ApiError(ErrorCode.EINVAL, 'Path must be a string without null bytes.');\n\t }\n\t else if (p === '') {\n\t throw new ApiError(ErrorCode.EINVAL, 'Path must not be empty.');\n\t }\n\t return path.resolve(p);\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction normalizeOptions(options, defEnc, defFlag, defMode) {\n\t switch (typeof options) {\n\t case 'object':\n\t return {\n\t encoding: typeof options['encoding'] !== 'undefined' ? options['encoding'] : defEnc,\n\t flag: typeof options['flag'] !== 'undefined' ? options['flag'] : defFlag,\n\t mode: normalizeMode(options['mode'], defMode)\n\t };\n\t case 'string':\n\t return {\n\t encoding: options,\n\t flag: defFlag,\n\t mode: defMode\n\t };\n\t default:\n\t return {\n\t encoding: defEnc,\n\t flag: defFlag,\n\t mode: defMode\n\t };\n\t }\n\t}\n\t/**\n\t * The default callback is a NOP.\n\t * @hidden\n\t * @private\n\t */\n\tfunction nopCb() {\n\t // NOP.\n\t}\n\t/**\n\t * The node frontend to all filesystems.\n\t * This layer handles:\n\t *\n\t * * Sanity checking inputs.\n\t * * Normalizing paths.\n\t * * Resetting stack depth for asynchronous operations which may not go through\n\t * the browser by wrapping all input callbacks using `setImmediate`.\n\t * * Performing the requested operation through the filesystem or the file\n\t * descriptor, as appropriate.\n\t * * Handling optional arguments and setting default arguments.\n\t * @see http://nodejs.org/api/fs.html\n\t */\n\tvar FS = function FS() {\n\t /* tslint:enable:variable-name */\n\t this.F_OK = 0;\n\t this.R_OK = 4;\n\t this.W_OK = 2;\n\t this.X_OK = 1;\n\t this.root = null;\n\t this.fdMap = {};\n\t this.nextFd = 100;\n\t};\n\tFS.prototype.initialize = function initialize (rootFS) {\n\t if (!rootFS.constructor.isAvailable()) {\n\t throw new ApiError(ErrorCode.EINVAL, 'Tried to instantiate BrowserFS with an unavailable file system.');\n\t }\n\t return this.root = rootFS;\n\t};\n\t/**\n\t * converts Date or number to a fractional UNIX timestamp\n\t * Grabbed from NodeJS sources (lib/fs.js)\n\t */\n\tFS.prototype._toUnixTimestamp = function _toUnixTimestamp (time) {\n\t if (typeof time === 'number') {\n\t return time;\n\t }\n\t else if (time instanceof Date) {\n\t return time.getTime() / 1000;\n\t }\n\t throw new Error(\"Cannot parse time: \" + time);\n\t};\n\t/**\n\t * **NONSTANDARD**: Grab the FileSystem instance that backs this API.\n\t * @return [BrowserFS.FileSystem | null] Returns null if the file system has\n\t * not been initialized.\n\t */\n\tFS.prototype.getRootFS = function getRootFS () {\n\t if (this.root) {\n\t return this.root;\n\t }\n\t else {\n\t return null;\n\t }\n\t};\n\t// FILE OR DIRECTORY METHODS\n\t/**\n\t * Asynchronous rename. No arguments other than a possible exception are given\n\t * to the completion callback.\n\t * @param oldPath\n\t * @param newPath\n\t * @param callback\n\t */\n\tFS.prototype.rename = function rename (oldPath, newPath, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t assertRoot(this.root).rename(normalizePath(oldPath), normalizePath(newPath), newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous rename.\n\t * @param oldPath\n\t * @param newPath\n\t */\n\tFS.prototype.renameSync = function renameSync (oldPath, newPath) {\n\t assertRoot(this.root).renameSync(normalizePath(oldPath), normalizePath(newPath));\n\t};\n\t/**\n\t * Test whether or not the given path exists by checking with the file system.\n\t * Then call the callback argument with either true or false.\n\t * @example Sample invocation\n\t * fs.exists('/etc/passwd', function (exists) {\n\t * util.debug(exists ? \"it's there\" : \"no passwd!\");\n\t * });\n\t * @param path\n\t * @param callback\n\t */\n\tFS.prototype.exists = function exists (path$$1, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t return assertRoot(this.root).exists(normalizePath(path$$1), newCb);\n\t }\n\t catch (e) {\n\t // Doesn't return an error. If something bad happens, we assume it just\n\t // doesn't exist.\n\t return newCb(false);\n\t }\n\t};\n\t/**\n\t * Test whether or not the given path exists by checking with the file system.\n\t * @param path\n\t * @return [boolean]\n\t */\n\tFS.prototype.existsSync = function existsSync (path$$1) {\n\t try {\n\t return assertRoot(this.root).existsSync(normalizePath(path$$1));\n\t }\n\t catch (e) {\n\t // Doesn't return an error. If something bad happens, we assume it just\n\t // doesn't exist.\n\t return false;\n\t }\n\t};\n\t/**\n\t * Asynchronous `stat`.\n\t * @param path\n\t * @param callback\n\t */\n\tFS.prototype.stat = function stat (path$$1, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 2);\n\t try {\n\t return assertRoot(this.root).stat(normalizePath(path$$1), false, newCb);\n\t }\n\t catch (e) {\n\t return newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `stat`.\n\t * @param path\n\t * @return [BrowserFS.node.fs.Stats]\n\t */\n\tFS.prototype.statSync = function statSync (path$$1) {\n\t return assertRoot(this.root).statSync(normalizePath(path$$1), false);\n\t};\n\t/**\n\t * Asynchronous `lstat`.\n\t * `lstat()` is identical to `stat()`, except that if path is a symbolic link,\n\t * then the link itself is stat-ed, not the file that it refers to.\n\t * @param path\n\t * @param callback\n\t */\n\tFS.prototype.lstat = function lstat (path$$1, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 2);\n\t try {\n\t return assertRoot(this.root).stat(normalizePath(path$$1), true, newCb);\n\t }\n\t catch (e) {\n\t return newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `lstat`.\n\t * `lstat()` is identical to `stat()`, except that if path is a symbolic link,\n\t * then the link itself is stat-ed, not the file that it refers to.\n\t * @param path\n\t * @return [BrowserFS.node.fs.Stats]\n\t */\n\tFS.prototype.lstatSync = function lstatSync (path$$1) {\n\t return assertRoot(this.root).statSync(normalizePath(path$$1), true);\n\t};\n\tFS.prototype.truncate = function truncate (path$$1, arg2, cb) {\n\t if ( arg2 === void 0 ) arg2 = 0;\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var len = 0;\n\t if (typeof arg2 === 'function') {\n\t cb = arg2;\n\t }\n\t else if (typeof arg2 === 'number') {\n\t len = arg2;\n\t }\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t if (len < 0) {\n\t throw new ApiError(ErrorCode.EINVAL);\n\t }\n\t return assertRoot(this.root).truncate(normalizePath(path$$1), len, newCb);\n\t }\n\t catch (e) {\n\t return newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `truncate`.\n\t * @param path\n\t * @param len\n\t */\n\tFS.prototype.truncateSync = function truncateSync (path$$1, len) {\n\t if ( len === void 0 ) len = 0;\n\t\n\t if (len < 0) {\n\t throw new ApiError(ErrorCode.EINVAL);\n\t }\n\t return assertRoot(this.root).truncateSync(normalizePath(path$$1), len);\n\t};\n\t/**\n\t * Asynchronous `unlink`.\n\t * @param path\n\t * @param callback\n\t */\n\tFS.prototype.unlink = function unlink (path$$1, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t return assertRoot(this.root).unlink(normalizePath(path$$1), newCb);\n\t }\n\t catch (e) {\n\t return newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `unlink`.\n\t * @param path\n\t */\n\tFS.prototype.unlinkSync = function unlinkSync (path$$1) {\n\t return assertRoot(this.root).unlinkSync(normalizePath(path$$1));\n\t};\n\tFS.prototype.open = function open (path$$1, flag, arg2, cb) {\n\t var this$1 = this;\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var mode = normalizeMode(arg2, 0x1a4);\n\t cb = typeof arg2 === 'function' ? arg2 : cb;\n\t var newCb = wrapCb(cb, 2);\n\t try {\n\t assertRoot(this.root).open(normalizePath(path$$1), FileFlag.getFileFlag(flag), mode, function (e, file) {\n\t if (file) {\n\t newCb(e, this$1.getFdForFile(file));\n\t }\n\t else {\n\t newCb(e);\n\t }\n\t });\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous file open.\n\t * @see http://www.manpagez.com/man/2/open/\n\t * @param path\n\t * @param flags\n\t * @param mode defaults to `0644`\n\t * @return [BrowserFS.File]\n\t */\n\tFS.prototype.openSync = function openSync (path$$1, flag, mode) {\n\t if ( mode === void 0 ) mode = 0x1a4;\n\t\n\t return this.getFdForFile(assertRoot(this.root).openSync(normalizePath(path$$1), FileFlag.getFileFlag(flag), normalizeMode(mode, 0x1a4)));\n\t};\n\tFS.prototype.readFile = function readFile (filename, arg2, cb) {\n\t if ( arg2 === void 0 ) arg2 = {};\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var options = normalizeOptions(arg2, null, 'r', null);\n\t cb = typeof arg2 === 'function' ? arg2 : cb;\n\t var newCb = wrapCb(cb, 2);\n\t try {\n\t var flag = FileFlag.getFileFlag(options['flag']);\n\t if (!flag.isReadable()) {\n\t return newCb(new ApiError(ErrorCode.EINVAL, 'Flag passed to readFile must allow for reading.'));\n\t }\n\t return assertRoot(this.root).readFile(normalizePath(filename), options.encoding, flag, newCb);\n\t }\n\t catch (e) {\n\t return newCb(e);\n\t }\n\t};\n\tFS.prototype.readFileSync = function readFileSync (filename, arg2) {\n\t if ( arg2 === void 0 ) arg2 = {};\n\t\n\t var options = normalizeOptions(arg2, null, 'r', null);\n\t var flag = FileFlag.getFileFlag(options.flag);\n\t if (!flag.isReadable()) {\n\t throw new ApiError(ErrorCode.EINVAL, 'Flag passed to readFile must allow for reading.');\n\t }\n\t return assertRoot(this.root).readFileSync(normalizePath(filename), options.encoding, flag);\n\t};\n\tFS.prototype.writeFile = function writeFile (filename, data, arg3, cb) {\n\t if ( arg3 === void 0 ) arg3 = {};\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var options = normalizeOptions(arg3, 'utf8', 'w', 0x1a4);\n\t cb = typeof arg3 === 'function' ? arg3 : cb;\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t var flag = FileFlag.getFileFlag(options.flag);\n\t if (!flag.isWriteable()) {\n\t return newCb(new ApiError(ErrorCode.EINVAL, 'Flag passed to writeFile must allow for writing.'));\n\t }\n\t return assertRoot(this.root).writeFile(normalizePath(filename), data, options.encoding, flag, options.mode, newCb);\n\t }\n\t catch (e) {\n\t return newCb(e);\n\t }\n\t};\n\tFS.prototype.writeFileSync = function writeFileSync (filename, data, arg3) {\n\t var options = normalizeOptions(arg3, 'utf8', 'w', 0x1a4);\n\t var flag = FileFlag.getFileFlag(options.flag);\n\t if (!flag.isWriteable()) {\n\t throw new ApiError(ErrorCode.EINVAL, 'Flag passed to writeFile must allow for writing.');\n\t }\n\t return assertRoot(this.root).writeFileSync(normalizePath(filename), data, options.encoding, flag, options.mode);\n\t};\n\tFS.prototype.appendFile = function appendFile (filename, data, arg3, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var options = normalizeOptions(arg3, 'utf8', 'a', 0x1a4);\n\t cb = typeof arg3 === 'function' ? arg3 : cb;\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t var flag = FileFlag.getFileFlag(options.flag);\n\t if (!flag.isAppendable()) {\n\t return newCb(new ApiError(ErrorCode.EINVAL, 'Flag passed to appendFile must allow for appending.'));\n\t }\n\t assertRoot(this.root).appendFile(normalizePath(filename), data, options.encoding, flag, options.mode, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\tFS.prototype.appendFileSync = function appendFileSync (filename, data, arg3) {\n\t var options = normalizeOptions(arg3, 'utf8', 'a', 0x1a4);\n\t var flag = FileFlag.getFileFlag(options.flag);\n\t if (!flag.isAppendable()) {\n\t throw new ApiError(ErrorCode.EINVAL, 'Flag passed to appendFile must allow for appending.');\n\t }\n\t return assertRoot(this.root).appendFileSync(normalizePath(filename), data, options.encoding, flag, options.mode);\n\t};\n\t// FILE DESCRIPTOR METHODS\n\t/**\n\t * Asynchronous `fstat`.\n\t * `fstat()` is identical to `stat()`, except that the file to be stat-ed is\n\t * specified by the file descriptor `fd`.\n\t * @param fd\n\t * @param callback\n\t */\n\tFS.prototype.fstat = function fstat (fd, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 2);\n\t try {\n\t var file = this.fd2file(fd);\n\t file.stat(newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `fstat`.\n\t * `fstat()` is identical to `stat()`, except that the file to be stat-ed is\n\t * specified by the file descriptor `fd`.\n\t * @param fd\n\t * @return [BrowserFS.node.fs.Stats]\n\t */\n\tFS.prototype.fstatSync = function fstatSync (fd) {\n\t return this.fd2file(fd).statSync();\n\t};\n\t/**\n\t * Asynchronous close.\n\t * @param fd\n\t * @param callback\n\t */\n\tFS.prototype.close = function close (fd, cb) {\n\t var this$1 = this;\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t this.fd2file(fd).close(function (e) {\n\t if (!e) {\n\t this$1.closeFd(fd);\n\t }\n\t newCb(e);\n\t });\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous close.\n\t * @param fd\n\t */\n\tFS.prototype.closeSync = function closeSync (fd) {\n\t this.fd2file(fd).closeSync();\n\t this.closeFd(fd);\n\t};\n\tFS.prototype.ftruncate = function ftruncate (fd, arg2, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var length = typeof arg2 === 'number' ? arg2 : 0;\n\t cb = typeof arg2 === 'function' ? arg2 : cb;\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t var file = this.fd2file(fd);\n\t if (length < 0) {\n\t throw new ApiError(ErrorCode.EINVAL);\n\t }\n\t file.truncate(length, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous ftruncate.\n\t * @param fd\n\t * @param len\n\t */\n\tFS.prototype.ftruncateSync = function ftruncateSync (fd, len) {\n\t if ( len === void 0 ) len = 0;\n\t\n\t var file = this.fd2file(fd);\n\t if (len < 0) {\n\t throw new ApiError(ErrorCode.EINVAL);\n\t }\n\t file.truncateSync(len);\n\t};\n\t/**\n\t * Asynchronous fsync.\n\t * @param fd\n\t * @param callback\n\t */\n\tFS.prototype.fsync = function fsync (fd, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t this.fd2file(fd).sync(newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous fsync.\n\t * @param fd\n\t */\n\tFS.prototype.fsyncSync = function fsyncSync (fd) {\n\t this.fd2file(fd).syncSync();\n\t};\n\t/**\n\t * Asynchronous fdatasync.\n\t * @param fd\n\t * @param callback\n\t */\n\tFS.prototype.fdatasync = function fdatasync (fd, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t this.fd2file(fd).datasync(newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous fdatasync.\n\t * @param fd\n\t */\n\tFS.prototype.fdatasyncSync = function fdatasyncSync (fd) {\n\t this.fd2file(fd).datasyncSync();\n\t};\n\tFS.prototype.write = function write (fd, arg2, arg3, arg4, arg5, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var buffer$$1, offset, length, position = null;\n\t if (typeof arg2 === 'string') {\n\t // Signature 1: (fd, string, [position?, [encoding?]], cb?)\n\t var encoding = 'utf8';\n\t switch (typeof arg3) {\n\t case 'function':\n\t // (fd, string, cb)\n\t cb = arg3;\n\t break;\n\t case 'number':\n\t // (fd, string, position, encoding?, cb?)\n\t position = arg3;\n\t encoding = typeof arg4 === 'string' ? arg4 : 'utf8';\n\t cb = typeof arg5 === 'function' ? arg5 : cb;\n\t break;\n\t default:\n\t // ...try to find the callback and get out of here!\n\t cb = typeof arg4 === 'function' ? arg4 : typeof arg5 === 'function' ? arg5 : cb;\n\t return cb(new ApiError(ErrorCode.EINVAL, 'Invalid arguments.'));\n\t }\n\t buffer$$1 = Buffer.from(arg2, encoding);\n\t offset = 0;\n\t length = buffer$$1.length;\n\t }\n\t else {\n\t // Signature 2: (fd, buffer, offset, length, position?, cb?)\n\t buffer$$1 = arg2;\n\t offset = arg3;\n\t length = arg4;\n\t position = typeof arg5 === 'number' ? arg5 : null;\n\t cb = typeof arg5 === 'function' ? arg5 : cb;\n\t }\n\t var newCb = wrapCb(cb, 3);\n\t try {\n\t var file = this.fd2file(fd);\n\t if (position === undefined || position === null) {\n\t position = file.getPos();\n\t }\n\t file.write(buffer$$1, offset, length, position, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\tFS.prototype.writeSync = function writeSync (fd, arg2, arg3, arg4, arg5) {\n\t var buffer$$1, offset = 0, length, position;\n\t if (typeof arg2 === 'string') {\n\t // Signature 1: (fd, string, [position?, [encoding?]])\n\t position = typeof arg3 === 'number' ? arg3 : null;\n\t var encoding = typeof arg4 === 'string' ? arg4 : 'utf8';\n\t offset = 0;\n\t buffer$$1 = Buffer.from(arg2, encoding);\n\t length = buffer$$1.length;\n\t }\n\t else {\n\t // Signature 2: (fd, buffer, offset, length, position?)\n\t buffer$$1 = arg2;\n\t offset = arg3;\n\t length = arg4;\n\t position = typeof arg5 === 'number' ? arg5 : null;\n\t }\n\t var file = this.fd2file(fd);\n\t if (position === undefined || position === null) {\n\t position = file.getPos();\n\t }\n\t return file.writeSync(buffer$$1, offset, length, position);\n\t};\n\tFS.prototype.read = function read (fd, arg2, arg3, arg4, arg5, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var position, offset, length, buffer$$1, newCb;\n\t if (typeof arg2 === 'number') {\n\t // legacy interface\n\t // (fd, length, position, encoding, callback)\n\t length = arg2;\n\t position = arg3;\n\t var encoding = arg4;\n\t cb = typeof arg5 === 'function' ? arg5 : cb;\n\t offset = 0;\n\t buffer$$1 = Buffer.alloc(length);\n\t // XXX: Inefficient.\n\t // Wrap the cb so we shelter upper layers of the API from these\n\t // shenanigans.\n\t newCb = wrapCb(function (err, bytesRead, buf) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t cb(err, buf.toString(encoding), bytesRead);\n\t }, 3);\n\t }\n\t else {\n\t buffer$$1 = arg2;\n\t offset = arg3;\n\t length = arg4;\n\t position = arg5;\n\t newCb = wrapCb(cb, 3);\n\t }\n\t try {\n\t var file = this.fd2file(fd);\n\t if (position === undefined || position === null) {\n\t position = file.getPos();\n\t }\n\t file.read(buffer$$1, offset, length, position, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\tFS.prototype.readSync = function readSync (fd, arg2, arg3, arg4, arg5) {\n\t var shenanigans = false;\n\t var buffer$$1, offset, length, position, encoding = 'utf8';\n\t if (typeof arg2 === 'number') {\n\t length = arg2;\n\t position = arg3;\n\t encoding = arg4;\n\t offset = 0;\n\t buffer$$1 = Buffer.alloc(length);\n\t shenanigans = true;\n\t }\n\t else {\n\t buffer$$1 = arg2;\n\t offset = arg3;\n\t length = arg4;\n\t position = arg5;\n\t }\n\t var file = this.fd2file(fd);\n\t if (position === undefined || position === null) {\n\t position = file.getPos();\n\t }\n\t var rv = file.readSync(buffer$$1, offset, length, position);\n\t if (!shenanigans) {\n\t return rv;\n\t }\n\t else {\n\t return [buffer$$1.toString(encoding), rv];\n\t }\n\t};\n\t/**\n\t * Asynchronous `fchown`.\n\t * @param fd\n\t * @param uid\n\t * @param gid\n\t * @param callback\n\t */\n\tFS.prototype.fchown = function fchown (fd, uid, gid, callback) {\n\t if ( callback === void 0 ) callback = nopCb;\n\t\n\t var newCb = wrapCb(callback, 1);\n\t try {\n\t this.fd2file(fd).chown(uid, gid, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `fchown`.\n\t * @param fd\n\t * @param uid\n\t * @param gid\n\t */\n\tFS.prototype.fchownSync = function fchownSync (fd, uid, gid) {\n\t this.fd2file(fd).chownSync(uid, gid);\n\t};\n\t/**\n\t * Asynchronous `fchmod`.\n\t * @param fd\n\t * @param mode\n\t * @param callback\n\t */\n\tFS.prototype.fchmod = function fchmod (fd, mode, cb) {\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t var numMode = typeof mode === 'string' ? parseInt(mode, 8) : mode;\n\t this.fd2file(fd).chmod(numMode, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `fchmod`.\n\t * @param fd\n\t * @param mode\n\t */\n\tFS.prototype.fchmodSync = function fchmodSync (fd, mode) {\n\t var numMode = typeof mode === 'string' ? parseInt(mode, 8) : mode;\n\t this.fd2file(fd).chmodSync(numMode);\n\t};\n\t/**\n\t * Change the file timestamps of a file referenced by the supplied file\n\t * descriptor.\n\t * @param fd\n\t * @param atime\n\t * @param mtime\n\t * @param callback\n\t */\n\tFS.prototype.futimes = function futimes (fd, atime, mtime, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t var file = this.fd2file(fd);\n\t if (typeof atime === 'number') {\n\t atime = new Date(atime * 1000);\n\t }\n\t if (typeof mtime === 'number') {\n\t mtime = new Date(mtime * 1000);\n\t }\n\t file.utimes(atime, mtime, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Change the file timestamps of a file referenced by the supplied file\n\t * descriptor.\n\t * @param fd\n\t * @param atime\n\t * @param mtime\n\t */\n\tFS.prototype.futimesSync = function futimesSync (fd, atime, mtime) {\n\t this.fd2file(fd).utimesSync(normalizeTime(atime), normalizeTime(mtime));\n\t};\n\t// DIRECTORY-ONLY METHODS\n\t/**\n\t * Asynchronous `rmdir`.\n\t * @param path\n\t * @param callback\n\t */\n\tFS.prototype.rmdir = function rmdir (path$$1, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t path$$1 = normalizePath(path$$1);\n\t assertRoot(this.root).rmdir(path$$1, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `rmdir`.\n\t * @param path\n\t */\n\tFS.prototype.rmdirSync = function rmdirSync (path$$1) {\n\t path$$1 = normalizePath(path$$1);\n\t return assertRoot(this.root).rmdirSync(path$$1);\n\t};\n\t/**\n\t * Asynchronous `mkdir`.\n\t * @param path\n\t * @param mode defaults to `0777`\n\t * @param callback\n\t */\n\tFS.prototype.mkdir = function mkdir (path$$1, mode, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t if (typeof mode === 'function') {\n\t cb = mode;\n\t mode = 0x1ff;\n\t }\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t path$$1 = normalizePath(path$$1);\n\t assertRoot(this.root).mkdir(path$$1, mode, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `mkdir`.\n\t * @param path\n\t * @param mode defaults to `0777`\n\t */\n\tFS.prototype.mkdirSync = function mkdirSync (path$$1, mode) {\n\t assertRoot(this.root).mkdirSync(normalizePath(path$$1), normalizeMode(mode, 0x1ff));\n\t};\n\t/**\n\t * Asynchronous `readdir`. Reads the contents of a directory.\n\t * The callback gets two arguments `(err, files)` where `files` is an array of\n\t * the names of the files in the directory excluding `'.'` and `'..'`.\n\t * @param path\n\t * @param callback\n\t */\n\tFS.prototype.readdir = function readdir (path$$1, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 2);\n\t try {\n\t path$$1 = normalizePath(path$$1);\n\t assertRoot(this.root).readdir(path$$1, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `readdir`. Reads the contents of a directory.\n\t * @param path\n\t * @return [String[]]\n\t */\n\tFS.prototype.readdirSync = function readdirSync (path$$1) {\n\t path$$1 = normalizePath(path$$1);\n\t return assertRoot(this.root).readdirSync(path$$1);\n\t};\n\t// SYMLINK METHODS\n\t/**\n\t * Asynchronous `link`.\n\t * @param srcpath\n\t * @param dstpath\n\t * @param callback\n\t */\n\tFS.prototype.link = function link (srcpath, dstpath, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t srcpath = normalizePath(srcpath);\n\t dstpath = normalizePath(dstpath);\n\t assertRoot(this.root).link(srcpath, dstpath, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `link`.\n\t * @param srcpath\n\t * @param dstpath\n\t */\n\tFS.prototype.linkSync = function linkSync (srcpath, dstpath) {\n\t srcpath = normalizePath(srcpath);\n\t dstpath = normalizePath(dstpath);\n\t return assertRoot(this.root).linkSync(srcpath, dstpath);\n\t};\n\tFS.prototype.symlink = function symlink (srcpath, dstpath, arg3, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var type = typeof arg3 === 'string' ? arg3 : 'file';\n\t cb = typeof arg3 === 'function' ? arg3 : cb;\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t if (type !== 'file' && type !== 'dir') {\n\t return newCb(new ApiError(ErrorCode.EINVAL, \"Invalid type: \" + type));\n\t }\n\t srcpath = normalizePath(srcpath);\n\t dstpath = normalizePath(dstpath);\n\t assertRoot(this.root).symlink(srcpath, dstpath, type, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `symlink`.\n\t * @param srcpath\n\t * @param dstpath\n\t * @param type can be either `'dir'` or `'file'` (default is `'file'`)\n\t */\n\tFS.prototype.symlinkSync = function symlinkSync (srcpath, dstpath, type) {\n\t if (!type) {\n\t type = 'file';\n\t }\n\t else if (type !== 'file' && type !== 'dir') {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid type: \" + type);\n\t }\n\t srcpath = normalizePath(srcpath);\n\t dstpath = normalizePath(dstpath);\n\t return assertRoot(this.root).symlinkSync(srcpath, dstpath, type);\n\t};\n\t/**\n\t * Asynchronous readlink.\n\t * @param path\n\t * @param callback\n\t */\n\tFS.prototype.readlink = function readlink (path$$1, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 2);\n\t try {\n\t path$$1 = normalizePath(path$$1);\n\t assertRoot(this.root).readlink(path$$1, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous readlink.\n\t * @param path\n\t * @return [String]\n\t */\n\tFS.prototype.readlinkSync = function readlinkSync (path$$1) {\n\t path$$1 = normalizePath(path$$1);\n\t return assertRoot(this.root).readlinkSync(path$$1);\n\t};\n\t// PROPERTY OPERATIONS\n\t/**\n\t * Asynchronous `chown`.\n\t * @param path\n\t * @param uid\n\t * @param gid\n\t * @param callback\n\t */\n\tFS.prototype.chown = function chown (path$$1, uid, gid, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t path$$1 = normalizePath(path$$1);\n\t assertRoot(this.root).chown(path$$1, false, uid, gid, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `chown`.\n\t * @param path\n\t * @param uid\n\t * @param gid\n\t */\n\tFS.prototype.chownSync = function chownSync (path$$1, uid, gid) {\n\t path$$1 = normalizePath(path$$1);\n\t assertRoot(this.root).chownSync(path$$1, false, uid, gid);\n\t};\n\t/**\n\t * Asynchronous `lchown`.\n\t * @param path\n\t * @param uid\n\t * @param gid\n\t * @param callback\n\t */\n\tFS.prototype.lchown = function lchown (path$$1, uid, gid, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t path$$1 = normalizePath(path$$1);\n\t assertRoot(this.root).chown(path$$1, true, uid, gid, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `lchown`.\n\t * @param path\n\t * @param uid\n\t * @param gid\n\t */\n\tFS.prototype.lchownSync = function lchownSync (path$$1, uid, gid) {\n\t path$$1 = normalizePath(path$$1);\n\t assertRoot(this.root).chownSync(path$$1, true, uid, gid);\n\t};\n\t/**\n\t * Asynchronous `chmod`.\n\t * @param path\n\t * @param mode\n\t * @param callback\n\t */\n\tFS.prototype.chmod = function chmod (path$$1, mode, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t var numMode = normalizeMode(mode, -1);\n\t if (numMode < 0) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid mode.\");\n\t }\n\t assertRoot(this.root).chmod(normalizePath(path$$1), false, numMode, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `chmod`.\n\t * @param path\n\t * @param mode\n\t */\n\tFS.prototype.chmodSync = function chmodSync (path$$1, mode) {\n\t var numMode = normalizeMode(mode, -1);\n\t if (numMode < 0) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid mode.\");\n\t }\n\t path$$1 = normalizePath(path$$1);\n\t assertRoot(this.root).chmodSync(path$$1, false, numMode);\n\t};\n\t/**\n\t * Asynchronous `lchmod`.\n\t * @param path\n\t * @param mode\n\t * @param callback\n\t */\n\tFS.prototype.lchmod = function lchmod (path$$1, mode, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t var numMode = normalizeMode(mode, -1);\n\t if (numMode < 0) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid mode.\");\n\t }\n\t assertRoot(this.root).chmod(normalizePath(path$$1), true, numMode, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `lchmod`.\n\t * @param path\n\t * @param mode\n\t */\n\tFS.prototype.lchmodSync = function lchmodSync (path$$1, mode) {\n\t var numMode = normalizeMode(mode, -1);\n\t if (numMode < 1) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid mode.\");\n\t }\n\t assertRoot(this.root).chmodSync(normalizePath(path$$1), true, numMode);\n\t};\n\t/**\n\t * Change file timestamps of the file referenced by the supplied path.\n\t * @param path\n\t * @param atime\n\t * @param mtime\n\t * @param callback\n\t */\n\tFS.prototype.utimes = function utimes (path$$1, atime, mtime, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var newCb = wrapCb(cb, 1);\n\t try {\n\t assertRoot(this.root).utimes(normalizePath(path$$1), normalizeTime(atime), normalizeTime(mtime), newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Change file timestamps of the file referenced by the supplied path.\n\t * @param path\n\t * @param atime\n\t * @param mtime\n\t */\n\tFS.prototype.utimesSync = function utimesSync (path$$1, atime, mtime) {\n\t assertRoot(this.root).utimesSync(normalizePath(path$$1), normalizeTime(atime), normalizeTime(mtime));\n\t};\n\tFS.prototype.realpath = function realpath (path$$1, arg2, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t var cache = typeof (arg2) === 'object' ? arg2 : {};\n\t cb = typeof (arg2) === 'function' ? arg2 : nopCb;\n\t var newCb = wrapCb(cb, 2);\n\t try {\n\t path$$1 = normalizePath(path$$1);\n\t assertRoot(this.root).realpath(path$$1, cache, newCb);\n\t }\n\t catch (e) {\n\t newCb(e);\n\t }\n\t};\n\t/**\n\t * Synchronous `realpath`.\n\t * @param path\n\t * @param cache An object literal of mapped paths that can be used to\n\t * force a specific path resolution or avoid additional `fs.stat` calls for\n\t * known real paths.\n\t * @return [String]\n\t */\n\tFS.prototype.realpathSync = function realpathSync (path$$1, cache) {\n\t if ( cache === void 0 ) cache = {};\n\t\n\t path$$1 = normalizePath(path$$1);\n\t return assertRoot(this.root).realpathSync(path$$1, cache);\n\t};\n\tFS.prototype.watchFile = function watchFile (filename, arg2, listener) {\n\t if ( listener === void 0 ) listener = nopCb;\n\t\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tFS.prototype.unwatchFile = function unwatchFile (filename, listener) {\n\t if ( listener === void 0 ) listener = nopCb;\n\t\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tFS.prototype.watch = function watch (filename, arg2, listener) {\n\t if ( listener === void 0 ) listener = nopCb;\n\t\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tFS.prototype.access = function access (path$$1, arg2, cb) {\n\t if ( cb === void 0 ) cb = nopCb;\n\t\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tFS.prototype.accessSync = function accessSync (path$$1, mode) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tFS.prototype.createReadStream = function createReadStream (path$$1, options) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tFS.prototype.createWriteStream = function createWriteStream (path$$1, options) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\t/**\n\t * For unit testing. Passes all incoming callbacks to cbWrapper for wrapping.\n\t */\n\tFS.prototype.wrapCallbacks = function wrapCallbacks (cbWrapper) {\n\t wrapCb = cbWrapper;\n\t};\n\tFS.prototype.getFdForFile = function getFdForFile (file) {\n\t var fd = this.nextFd++;\n\t this.fdMap[fd] = file;\n\t return fd;\n\t};\n\tFS.prototype.fd2file = function fd2file (fd) {\n\t var rv = this.fdMap[fd];\n\t if (rv) {\n\t return rv;\n\t }\n\t else {\n\t throw new ApiError(ErrorCode.EBADF, 'Invalid file descriptor.');\n\t }\n\t};\n\tFS.prototype.closeFd = function closeFd (fd) {\n\t delete this.fdMap[fd];\n\t};\n\t\n\t/* tslint:disable:variable-name */\n\t// Exported fs.Stats.\n\tFS.Stats = Stats;\n\t\n\t// Manually export the individual public functions of fs.\n\t// Required because some code will invoke functions off of the module.\n\t// e.g.:\n\t// let writeFile = fs.writeFile;\n\t// writeFile(...)\n\t/**\n\t * @hidden\n\t */\n\tvar fs = new FS();\n\t/**\n\t * @hidden\n\t */\n\tvar _fsMock = {};\n\t/**\n\t * @hidden\n\t */\n\tvar fsProto = FS.prototype;\n\tObject.keys(fsProto).forEach(function (key) {\n\t if (typeof fs[key] === 'function') {\n\t _fsMock[key] = function () {\n\t return fs[key].apply(fs, arguments);\n\t };\n\t }\n\t else {\n\t _fsMock[key] = fs[key];\n\t }\n\t});\n\t_fsMock['changeFSModule'] = function (newFs) {\n\t fs = newFs;\n\t};\n\t_fsMock['getFSModule'] = function () {\n\t return fs;\n\t};\n\t_fsMock['FS'] = FS;\n\t\n\t/*\n\t * Levenshtein distance, from the `js-levenshtein` NPM module.\n\t * Copied here to avoid complexity of adding another CommonJS module dependency.\n\t */\n\tfunction _min(d0, d1, d2, bx, ay) {\n\t return d0 < d1 || d2 < d1\n\t ? d0 > d2\n\t ? d2 + 1\n\t : d0 + 1\n\t : bx === ay\n\t ? d1\n\t : d1 + 1;\n\t}\n\t/**\n\t * Calculates levenshtein distance.\n\t * @param a\n\t * @param b\n\t */\n\tfunction levenshtein(a, b) {\n\t if (a === b) {\n\t return 0;\n\t }\n\t if (a.length > b.length) {\n\t var tmp = a;\n\t a = b;\n\t b = tmp;\n\t }\n\t var la = a.length;\n\t var lb = b.length;\n\t while (la > 0 && (a.charCodeAt(la - 1) === b.charCodeAt(lb - 1))) {\n\t la--;\n\t lb--;\n\t }\n\t var offset = 0;\n\t while (offset < la && (a.charCodeAt(offset) === b.charCodeAt(offset))) {\n\t offset++;\n\t }\n\t la -= offset;\n\t lb -= offset;\n\t if (la === 0 || lb === 1) {\n\t return lb;\n\t }\n\t var vector = new Array(la << 1);\n\t for (var y = 0; y < la;) {\n\t vector[la + y] = a.charCodeAt(offset + y);\n\t vector[y] = ++y;\n\t }\n\t var x;\n\t var d0;\n\t var d1;\n\t var d2;\n\t var d3;\n\t for (x = 0; (x + 3) < lb;) {\n\t var bx0 = b.charCodeAt(offset + (d0 = x));\n\t var bx1 = b.charCodeAt(offset + (d1 = x + 1));\n\t var bx2 = b.charCodeAt(offset + (d2 = x + 2));\n\t var bx3 = b.charCodeAt(offset + (d3 = x + 3));\n\t var dd$1 = (x += 4);\n\t for (var y$1 = 0; y$1 < la;) {\n\t var ay = vector[la + y$1];\n\t var dy = vector[y$1];\n\t d0 = _min(dy, d0, d1, bx0, ay);\n\t d1 = _min(d0, d1, d2, bx1, ay);\n\t d2 = _min(d1, d2, d3, bx2, ay);\n\t dd$1 = _min(d2, d3, dd$1, bx3, ay);\n\t vector[y$1++] = dd$1;\n\t d3 = d2;\n\t d2 = d1;\n\t d1 = d0;\n\t d0 = dy;\n\t }\n\t }\n\t var dd = 0;\n\t for (; x < lb;) {\n\t var bx0$1 = b.charCodeAt(offset + (d0 = x));\n\t dd = ++x;\n\t for (var y$2 = 0; y$2 < la; y$2++) {\n\t var dy$1 = vector[y$2];\n\t vector[y$2] = dd = dy$1 < d0 || dd < d0\n\t ? dy$1 > dd ? dd + 1 : dy$1 + 1\n\t : bx0$1 === vector[la + y$2]\n\t ? d0\n\t : d0 + 1;\n\t d0 = dy$1;\n\t }\n\t }\n\t return dd;\n\t}\n\t\n\tfunction deprecationMessage(print, fsName, opts) {\n\t if (print) {\n\t console.warn((\"[\" + fsName + \"] Direct file system constructor usage is deprecated for this file system, and will be removed in the next major version. Please use the '\" + fsName + \".Create(\" + (JSON.stringify(opts)) + \", callback)' method instead. See https://github.com/jvilk/BrowserFS/issues/176 for more details.\"));\n\t }\n\t}\n\t/**\n\t * Checks for any IE version, including IE11 which removed MSIE from the\n\t * userAgent string.\n\t * @hidden\n\t */\n\tvar isIE = typeof navigator !== \"undefined\" && !!(/(msie) ([\\w.]+)/.exec(navigator.userAgent.toLowerCase()) || navigator.userAgent.indexOf('Trident') !== -1);\n\t/**\n\t * Check if we're in a web worker.\n\t * @hidden\n\t */\n\tvar isWebWorker = typeof window === \"undefined\";\n\t/**\n\t * Throws an exception. Called on code paths that should be impossible.\n\t * @hidden\n\t */\n\tfunction fail() {\n\t throw new Error(\"BFS has reached an impossible code path; please file a bug.\");\n\t}\n\t/**\n\t * Synchronous recursive makedir.\n\t * @hidden\n\t */\n\tfunction mkdirpSync(p, mode, fs) {\n\t if (!fs.existsSync(p)) {\n\t mkdirpSync(path.dirname(p), mode, fs);\n\t fs.mkdirSync(p, mode);\n\t }\n\t}\n\t/**\n\t * Converts a buffer into an array buffer. Attempts to do so in a\n\t * zero-copy manner, e.g. the array references the same memory.\n\t * @hidden\n\t */\n\tfunction buffer2ArrayBuffer(buff) {\n\t var u8 = buffer2Uint8array(buff), u8offset = u8.byteOffset, u8Len = u8.byteLength;\n\t if (u8offset === 0 && u8Len === u8.buffer.byteLength) {\n\t return u8.buffer;\n\t }\n\t else {\n\t return u8.buffer.slice(u8offset, u8offset + u8Len);\n\t }\n\t}\n\t/**\n\t * Converts a buffer into a Uint8Array. Attempts to do so in a\n\t * zero-copy manner, e.g. the array references the same memory.\n\t * @hidden\n\t */\n\tfunction buffer2Uint8array(buff) {\n\t if (buff instanceof Uint8Array) {\n\t // BFS & Node v4.0 buffers *are* Uint8Arrays.\n\t return buff;\n\t }\n\t else {\n\t // Uint8Arrays can be constructed from arrayish numbers.\n\t // At this point, we assume this isn't a BFS array.\n\t return new Uint8Array(buff);\n\t }\n\t}\n\t/**\n\t * Converts the given arrayish object into a Buffer. Attempts to\n\t * be zero-copy.\n\t * @hidden\n\t */\n\tfunction arrayish2Buffer(arr) {\n\t if (arr instanceof Buffer) {\n\t return arr;\n\t }\n\t else if (arr instanceof Uint8Array) {\n\t return uint8Array2Buffer(arr);\n\t }\n\t else {\n\t return Buffer.from(arr);\n\t }\n\t}\n\t/**\n\t * Converts the given Uint8Array into a Buffer. Attempts to be zero-copy.\n\t * @hidden\n\t */\n\tfunction uint8Array2Buffer(u8) {\n\t if (u8 instanceof Buffer) {\n\t return u8;\n\t }\n\t else if (u8.byteOffset === 0 && u8.byteLength === u8.buffer.byteLength) {\n\t return arrayBuffer2Buffer(u8.buffer);\n\t }\n\t else {\n\t return Buffer.from(u8.buffer, u8.byteOffset, u8.byteLength);\n\t }\n\t}\n\t/**\n\t * Converts the given array buffer into a Buffer. Attempts to be\n\t * zero-copy.\n\t * @hidden\n\t */\n\tfunction arrayBuffer2Buffer(ab) {\n\t return Buffer.from(ab);\n\t}\n\t/**\n\t * Copies a slice of the given buffer\n\t * @hidden\n\t */\n\tfunction copyingSlice(buff, start, end) {\n\t if ( start === void 0 ) start = 0;\n\t if ( end === void 0 ) end = buff.length;\n\t\n\t if (start < 0 || end < 0 || end > buff.length || start > end) {\n\t throw new TypeError((\"Invalid slice bounds on buffer of length \" + (buff.length) + \": [\" + start + \", \" + end + \"]\"));\n\t }\n\t if (buff.length === 0) {\n\t // Avoid s0 corner case in ArrayBuffer case.\n\t return emptyBuffer();\n\t }\n\t else {\n\t var u8 = buffer2Uint8array(buff), s0 = buff[0], newS0 = (s0 + 1) % 0xFF;\n\t buff[0] = newS0;\n\t if (u8[0] === newS0) {\n\t // Same memory. Revert & copy.\n\t u8[0] = s0;\n\t return uint8Array2Buffer(u8.slice(start, end));\n\t }\n\t else {\n\t // Revert.\n\t buff[0] = s0;\n\t return uint8Array2Buffer(u8.subarray(start, end));\n\t }\n\t }\n\t}\n\t/**\n\t * @hidden\n\t */\n\tvar emptyBuff = null;\n\t/**\n\t * Returns an empty buffer.\n\t * @hidden\n\t */\n\tfunction emptyBuffer() {\n\t if (emptyBuff) {\n\t return emptyBuff;\n\t }\n\t return emptyBuff = Buffer.alloc(0);\n\t}\n\t/**\n\t * Option validator for a Buffer file system option.\n\t * @hidden\n\t */\n\tfunction bufferValidator(v, cb) {\n\t if (Buffer.isBuffer(v)) {\n\t cb();\n\t }\n\t else {\n\t cb(new ApiError(ErrorCode.EINVAL, \"option must be a Buffer.\"));\n\t }\n\t}\n\t/**\n\t * Checks that the given options object is valid for the file system options.\n\t * @hidden\n\t */\n\tfunction checkOptions(fsType, opts, cb) {\n\t var optsInfo = fsType.Options;\n\t var fsName = fsType.Name;\n\t var pendingValidators = 0;\n\t var callbackCalled = false;\n\t var loopEnded = false;\n\t function validatorCallback(e) {\n\t if (!callbackCalled) {\n\t if (e) {\n\t callbackCalled = true;\n\t cb(e);\n\t }\n\t pendingValidators--;\n\t if (pendingValidators === 0 && loopEnded) {\n\t cb();\n\t }\n\t }\n\t }\n\t // Check for required options.\n\t var loop = function ( optName ) {\n\t if (optsInfo.hasOwnProperty(optName)) {\n\t var opt = optsInfo[optName];\n\t var providedValue = opts[optName];\n\t if (providedValue === undefined || providedValue === null) {\n\t if (!opt.optional) {\n\t // Required option, not provided.\n\t // Any incorrect options provided? Which ones are close to the provided one?\n\t // (edit distance 5 === close)\n\t var incorrectOptions = Object.keys(opts).filter(function (o) { return !(o in optsInfo); }).map(function (a) {\n\t return { str: a, distance: levenshtein(optName, a) };\n\t }).filter(function (o) { return o.distance < 5; }).sort(function (a, b) { return a.distance - b.distance; });\n\t // Validators may be synchronous.\n\t if (callbackCalled) {\n\t return {};\n\t }\n\t callbackCalled = true;\n\t return { v: cb(new ApiError(ErrorCode.EINVAL, (\"[\" + fsName + \"] Required option '\" + optName + \"' not provided.\" + (incorrectOptions.length > 0 ? (\" You provided unrecognized option '\" + (incorrectOptions[0].str) + \"'; perhaps you meant to type '\" + optName + \"'.\") : '') + \"\\nOption description: \" + (opt.description)))) };\n\t }\n\t // Else: Optional option, not provided. That is OK.\n\t }\n\t else {\n\t // Option provided! Check type.\n\t var typeMatches = false;\n\t if (Array.isArray(opt.type)) {\n\t typeMatches = opt.type.indexOf(typeof (providedValue)) !== -1;\n\t }\n\t else {\n\t typeMatches = typeof (providedValue) === opt.type;\n\t }\n\t if (!typeMatches) {\n\t // Validators may be synchronous.\n\t if (callbackCalled) {\n\t return {};\n\t }\n\t callbackCalled = true;\n\t return { v: cb(new ApiError(ErrorCode.EINVAL, (\"[\" + fsName + \"] Value provided for option \" + optName + \" is not the proper type. Expected \" + (Array.isArray(opt.type) ? (\"one of {\" + (opt.type.join(\", \")) + \"}\") : opt.type) + \", but received \" + (typeof (providedValue)) + \"\\nOption description: \" + (opt.description)))) };\n\t }\n\t else if (opt.validator) {\n\t pendingValidators++;\n\t opt.validator(providedValue, validatorCallback);\n\t }\n\t // Otherwise: All good!\n\t }\n\t }\n\t };\n\t\n\t for (var optName in optsInfo) {\n\t var returned = loop( optName );\n\t\n\t if ( returned ) return returned.v;\n\t }\n\t loopEnded = true;\n\t if (pendingValidators === 0 && !callbackCalled) {\n\t cb();\n\t }\n\t}\n\t\n\t\n\tvar BFSUtils = Object.freeze({\n\t\tdeprecationMessage: deprecationMessage,\n\t\tisIE: isIE,\n\t\tisWebWorker: isWebWorker,\n\t\tfail: fail,\n\t\tmkdirpSync: mkdirpSync,\n\t\tbuffer2ArrayBuffer: buffer2ArrayBuffer,\n\t\tbuffer2Uint8array: buffer2Uint8array,\n\t\tarrayish2Buffer: arrayish2Buffer,\n\t\tuint8Array2Buffer: uint8Array2Buffer,\n\t\tarrayBuffer2Buffer: arrayBuffer2Buffer,\n\t\tcopyingSlice: copyingSlice,\n\t\temptyBuffer: emptyBuffer,\n\t\tbufferValidator: bufferValidator,\n\t\tcheckOptions: checkOptions\n\t});\n\t\n\tvar BFSEmscriptenStreamOps = function BFSEmscriptenStreamOps(fs) {\n\t this.fs = fs;\n\t this.nodefs = fs.getNodeFS();\n\t this.FS = fs.getFS();\n\t this.PATH = fs.getPATH();\n\t this.ERRNO_CODES = fs.getERRNO_CODES();\n\t};\n\tBFSEmscriptenStreamOps.prototype.open = function open (stream) {\n\t var path$$1 = this.fs.realPath(stream.node);\n\t var FS = this.FS;\n\t try {\n\t if (FS.isFile(stream.node.mode)) {\n\t stream.nfd = this.nodefs.openSync(path$$1, this.fs.flagsToPermissionString(stream.flags));\n\t }\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t};\n\tBFSEmscriptenStreamOps.prototype.close = function close (stream) {\n\t var FS = this.FS;\n\t try {\n\t if (FS.isFile(stream.node.mode) && stream.nfd) {\n\t this.nodefs.closeSync(stream.nfd);\n\t }\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t};\n\tBFSEmscriptenStreamOps.prototype.read = function read (stream, buffer$$1, offset, length, position) {\n\t // Avoid copying overhead by reading directly into buffer.\n\t try {\n\t return this.nodefs.readSync(stream.nfd, uint8Array2Buffer(buffer$$1), offset, length, position);\n\t }\n\t catch (e) {\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t};\n\tBFSEmscriptenStreamOps.prototype.write = function write (stream, buffer$$1, offset, length, position) {\n\t // Avoid copying overhead.\n\t try {\n\t return this.nodefs.writeSync(stream.nfd, uint8Array2Buffer(buffer$$1), offset, length, position);\n\t }\n\t catch (e) {\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t};\n\tBFSEmscriptenStreamOps.prototype.llseek = function llseek (stream, offset, whence) {\n\t var position = offset;\n\t if (whence === 1) {\n\t position += stream.position;\n\t }\n\t else if (whence === 2) {\n\t if (this.FS.isFile(stream.node.mode)) {\n\t try {\n\t var stat = this.nodefs.fstatSync(stream.nfd);\n\t position += stat.size;\n\t }\n\t catch (e) {\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t }\n\t }\n\t if (position < 0) {\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);\n\t }\n\t stream.position = position;\n\t return position;\n\t};\n\tvar BFSEmscriptenNodeOps = function BFSEmscriptenNodeOps(fs) {\n\t this.fs = fs;\n\t this.nodefs = fs.getNodeFS();\n\t this.FS = fs.getFS();\n\t this.PATH = fs.getPATH();\n\t this.ERRNO_CODES = fs.getERRNO_CODES();\n\t};\n\tBFSEmscriptenNodeOps.prototype.getattr = function getattr (node) {\n\t var path$$1 = this.fs.realPath(node);\n\t var stat;\n\t try {\n\t stat = this.nodefs.lstatSync(path$$1);\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t return {\n\t dev: stat.dev,\n\t ino: stat.ino,\n\t mode: stat.mode,\n\t nlink: stat.nlink,\n\t uid: stat.uid,\n\t gid: stat.gid,\n\t rdev: stat.rdev,\n\t size: stat.size,\n\t atime: stat.atime,\n\t mtime: stat.mtime,\n\t ctime: stat.ctime,\n\t blksize: stat.blksize,\n\t blocks: stat.blocks\n\t };\n\t};\n\tBFSEmscriptenNodeOps.prototype.setattr = function setattr (node, attr) {\n\t var path$$1 = this.fs.realPath(node);\n\t try {\n\t if (attr.mode !== undefined) {\n\t this.nodefs.chmodSync(path$$1, attr.mode);\n\t // update the common node structure mode as well\n\t node.mode = attr.mode;\n\t }\n\t if (attr.timestamp !== undefined) {\n\t var date = new Date(attr.timestamp);\n\t this.nodefs.utimesSync(path$$1, date, date);\n\t }\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t // Ignore not supported errors. Emscripten does utimesSync when it\n\t // writes files, but never really requires the value to be set.\n\t if (e.code !== \"ENOTSUP\") {\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t }\n\t if (attr.size !== undefined) {\n\t try {\n\t this.nodefs.truncateSync(path$$1, attr.size);\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t }\n\t};\n\tBFSEmscriptenNodeOps.prototype.lookup = function lookup (parent, name) {\n\t var path$$1 = this.PATH.join2(this.fs.realPath(parent), name);\n\t var mode = this.fs.getMode(path$$1);\n\t return this.fs.createNode(parent, name, mode);\n\t};\n\tBFSEmscriptenNodeOps.prototype.mknod = function mknod (parent, name, mode, dev) {\n\t var node = this.fs.createNode(parent, name, mode, dev);\n\t // create the backing node for this in the fs root as well\n\t var path$$1 = this.fs.realPath(node);\n\t try {\n\t if (this.FS.isDir(node.mode)) {\n\t this.nodefs.mkdirSync(path$$1, node.mode);\n\t }\n\t else {\n\t this.nodefs.writeFileSync(path$$1, '', { mode: node.mode });\n\t }\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t return node;\n\t};\n\tBFSEmscriptenNodeOps.prototype.rename = function rename (oldNode, newDir, newName) {\n\t var oldPath = this.fs.realPath(oldNode);\n\t var newPath = this.PATH.join2(this.fs.realPath(newDir), newName);\n\t try {\n\t this.nodefs.renameSync(oldPath, newPath);\n\t // This logic is missing from the original NodeFS,\n\t // causing Emscripten's filesystem to think that the old file still exists.\n\t oldNode.name = newName;\n\t oldNode.parent = newDir;\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t};\n\tBFSEmscriptenNodeOps.prototype.unlink = function unlink (parent, name) {\n\t var path$$1 = this.PATH.join2(this.fs.realPath(parent), name);\n\t try {\n\t this.nodefs.unlinkSync(path$$1);\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t};\n\tBFSEmscriptenNodeOps.prototype.rmdir = function rmdir (parent, name) {\n\t var path$$1 = this.PATH.join2(this.fs.realPath(parent), name);\n\t try {\n\t this.nodefs.rmdirSync(path$$1);\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t};\n\tBFSEmscriptenNodeOps.prototype.readdir = function readdir (node) {\n\t var path$$1 = this.fs.realPath(node);\n\t try {\n\t // Node does not list . and .. in directory listings,\n\t // but Emscripten expects it.\n\t var contents = this.nodefs.readdirSync(path$$1);\n\t contents.push('.', '..');\n\t return contents;\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t};\n\tBFSEmscriptenNodeOps.prototype.symlink = function symlink (parent, newName, oldPath) {\n\t var newPath = this.PATH.join2(this.fs.realPath(parent), newName);\n\t try {\n\t this.nodefs.symlinkSync(oldPath, newPath);\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t};\n\tBFSEmscriptenNodeOps.prototype.readlink = function readlink (node) {\n\t var path$$1 = this.fs.realPath(node);\n\t try {\n\t return this.nodefs.readlinkSync(path$$1);\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t};\n\tvar BFSEmscriptenFS = function BFSEmscriptenFS(_FS, _PATH, _ERRNO_CODES, nodefs) {\n\t if ( _FS === void 0 ) _FS = self['FS'];\n\t if ( _PATH === void 0 ) _PATH = self['PATH'];\n\t if ( _ERRNO_CODES === void 0 ) _ERRNO_CODES = self['ERRNO_CODES'];\n\t if ( nodefs === void 0 ) nodefs = _fsMock;\n\t\n\t // This maps the integer permission modes from http://linux.die.net/man/3/open\n\t // to node.js-specific file open permission strings at http://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback\n\t this.flagsToPermissionStringMap = {\n\t 0 /*O_RDONLY*/: 'r',\n\t 1 /*O_WRONLY*/: 'r+',\n\t 2 /*O_RDWR*/: 'r+',\n\t 64 /*O_CREAT*/: 'r',\n\t 65 /*O_WRONLY|O_CREAT*/: 'r+',\n\t 66 /*O_RDWR|O_CREAT*/: 'r+',\n\t 129 /*O_WRONLY|O_EXCL*/: 'rx+',\n\t 193 /*O_WRONLY|O_CREAT|O_EXCL*/: 'rx+',\n\t 514 /*O_RDWR|O_TRUNC*/: 'w+',\n\t 577 /*O_WRONLY|O_CREAT|O_TRUNC*/: 'w',\n\t 578 /*O_CREAT|O_RDWR|O_TRUNC*/: 'w+',\n\t 705 /*O_WRONLY|O_CREAT|O_EXCL|O_TRUNC*/: 'wx',\n\t 706 /*O_RDWR|O_CREAT|O_EXCL|O_TRUNC*/: 'wx+',\n\t 1024 /*O_APPEND*/: 'a',\n\t 1025 /*O_WRONLY|O_APPEND*/: 'a',\n\t 1026 /*O_RDWR|O_APPEND*/: 'a+',\n\t 1089 /*O_WRONLY|O_CREAT|O_APPEND*/: 'a',\n\t 1090 /*O_RDWR|O_CREAT|O_APPEND*/: 'a+',\n\t 1153 /*O_WRONLY|O_EXCL|O_APPEND*/: 'ax',\n\t 1154 /*O_RDWR|O_EXCL|O_APPEND*/: 'ax+',\n\t 1217 /*O_WRONLY|O_CREAT|O_EXCL|O_APPEND*/: 'ax',\n\t 1218 /*O_RDWR|O_CREAT|O_EXCL|O_APPEND*/: 'ax+',\n\t 4096 /*O_RDONLY|O_DSYNC*/: 'rs',\n\t 4098 /*O_RDWR|O_DSYNC*/: 'rs+'\n\t };\n\t this.nodefs = nodefs;\n\t this.FS = _FS;\n\t this.PATH = _PATH;\n\t this.ERRNO_CODES = _ERRNO_CODES;\n\t this.node_ops = new BFSEmscriptenNodeOps(this);\n\t this.stream_ops = new BFSEmscriptenStreamOps(this);\n\t};\n\tBFSEmscriptenFS.prototype.mount = function mount (m) {\n\t return this.createNode(null, '/', this.getMode(m.opts.root), 0);\n\t};\n\tBFSEmscriptenFS.prototype.createNode = function createNode (parent, name, mode, dev) {\n\t var FS = this.FS;\n\t if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\n\t throw new FS.ErrnoError(this.ERRNO_CODES.EINVAL);\n\t }\n\t var node = FS.createNode(parent, name, mode);\n\t node.node_ops = this.node_ops;\n\t node.stream_ops = this.stream_ops;\n\t return node;\n\t};\n\tBFSEmscriptenFS.prototype.getMode = function getMode (path$$1) {\n\t var stat;\n\t try {\n\t stat = this.nodefs.lstatSync(path$$1);\n\t }\n\t catch (e) {\n\t if (!e.code) {\n\t throw e;\n\t }\n\t throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n\t }\n\t return stat.mode;\n\t};\n\tBFSEmscriptenFS.prototype.realPath = function realPath (node) {\n\t var parts = [];\n\t while (node.parent !== node) {\n\t parts.push(node.name);\n\t node = node.parent;\n\t }\n\t parts.push(node.mount.opts.root);\n\t parts.reverse();\n\t return this.PATH.join.apply(null, parts);\n\t};\n\tBFSEmscriptenFS.prototype.flagsToPermissionString = function flagsToPermissionString (flags) {\n\t var parsedFlags = (typeof flags === \"string\") ? parseInt(flags, 10) : flags;\n\t parsedFlags &= 0x1FFF;\n\t if (parsedFlags in this.flagsToPermissionStringMap) {\n\t return this.flagsToPermissionStringMap[parsedFlags];\n\t }\n\t else {\n\t return flags;\n\t }\n\t};\n\tBFSEmscriptenFS.prototype.getNodeFS = function getNodeFS () {\n\t return this.nodefs;\n\t};\n\tBFSEmscriptenFS.prototype.getFS = function getFS () {\n\t return this.FS;\n\t};\n\tBFSEmscriptenFS.prototype.getPATH = function getPATH () {\n\t return this.PATH;\n\t};\n\tBFSEmscriptenFS.prototype.getERRNO_CODES = function getERRNO_CODES () {\n\t return this.ERRNO_CODES;\n\t};\n\t\n\t/**\n\t * Basic filesystem class. Most filesystems should extend this class, as it\n\t * provides default implementations for a handful of methods.\n\t */\n\tvar BaseFileSystem = function BaseFileSystem () {};\n\t\n\tBaseFileSystem.prototype.supportsLinks = function supportsLinks () {\n\t return false;\n\t};\n\tBaseFileSystem.prototype.diskSpace = function diskSpace (p, cb) {\n\t cb(0, 0);\n\t};\n\t/**\n\t * Opens the file at path p with the given flag. The file must exist.\n\t * @param p The path to open.\n\t * @param flag The flag to use when opening the file.\n\t */\n\tBaseFileSystem.prototype.openFile = function openFile (p, flag, cb) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\t/**\n\t * Create the file at path p with the given mode. Then, open it with the given\n\t * flag.\n\t */\n\tBaseFileSystem.prototype.createFile = function createFile (p, flag, mode, cb) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.open = function open (p, flag, mode, cb) {\n\t var this$1 = this;\n\t\n\t var mustBeFile = function (e, stats) {\n\t if (e) {\n\t // File does not exist.\n\t switch (flag.pathNotExistsAction()) {\n\t case ActionType.CREATE_FILE:\n\t // Ensure parent exists.\n\t return this$1.stat(path.dirname(p), false, function (e, parentStats) {\n\t if (e) {\n\t cb(e);\n\t }\n\t else if (parentStats && !parentStats.isDirectory()) {\n\t cb(ApiError.ENOTDIR(path.dirname(p)));\n\t }\n\t else {\n\t this$1.createFile(p, flag, mode, cb);\n\t }\n\t });\n\t case ActionType.THROW_EXCEPTION:\n\t return cb(ApiError.ENOENT(p));\n\t default:\n\t return cb(new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.'));\n\t }\n\t }\n\t else {\n\t // File exists.\n\t if (stats && stats.isDirectory()) {\n\t return cb(ApiError.EISDIR(p));\n\t }\n\t switch (flag.pathExistsAction()) {\n\t case ActionType.THROW_EXCEPTION:\n\t return cb(ApiError.EEXIST(p));\n\t case ActionType.TRUNCATE_FILE:\n\t // NOTE: In a previous implementation, we deleted the file and\n\t // re-created it. However, this created a race condition if another\n\t // asynchronous request was trying to read the file, as the file\n\t // would not exist for a small period of time.\n\t return this$1.openFile(p, flag, function (e, fd) {\n\t if (e) {\n\t cb(e);\n\t }\n\t else if (fd) {\n\t fd.truncate(0, function () {\n\t fd.sync(function () {\n\t cb(null, fd);\n\t });\n\t });\n\t }\n\t else {\n\t fail();\n\t }\n\t });\n\t case ActionType.NOP:\n\t return this$1.openFile(p, flag, cb);\n\t default:\n\t return cb(new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.'));\n\t }\n\t }\n\t };\n\t this.stat(p, false, mustBeFile);\n\t};\n\tBaseFileSystem.prototype.rename = function rename (oldPath, newPath, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.renameSync = function renameSync (oldPath, newPath) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.stat = function stat (p, isLstat, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.statSync = function statSync (p, isLstat) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\t/**\n\t * Opens the file at path p with the given flag. The file must exist.\n\t * @param p The path to open.\n\t * @param flag The flag to use when opening the file.\n\t * @return A File object corresponding to the opened file.\n\t */\n\tBaseFileSystem.prototype.openFileSync = function openFileSync (p, flag, mode) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\t/**\n\t * Create the file at path p with the given mode. Then, open it with the given\n\t * flag.\n\t */\n\tBaseFileSystem.prototype.createFileSync = function createFileSync (p, flag, mode) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.openSync = function openSync (p, flag, mode) {\n\t // Check if the path exists, and is a file.\n\t var stats;\n\t try {\n\t stats = this.statSync(p, false);\n\t }\n\t catch (e) {\n\t // File does not exist.\n\t switch (flag.pathNotExistsAction()) {\n\t case ActionType.CREATE_FILE:\n\t // Ensure parent exists.\n\t var parentStats = this.statSync(path.dirname(p), false);\n\t if (!parentStats.isDirectory()) {\n\t throw ApiError.ENOTDIR(path.dirname(p));\n\t }\n\t return this.createFileSync(p, flag, mode);\n\t case ActionType.THROW_EXCEPTION:\n\t throw ApiError.ENOENT(p);\n\t default:\n\t throw new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.');\n\t }\n\t }\n\t // File exists.\n\t if (stats.isDirectory()) {\n\t throw ApiError.EISDIR(p);\n\t }\n\t switch (flag.pathExistsAction()) {\n\t case ActionType.THROW_EXCEPTION:\n\t throw ApiError.EEXIST(p);\n\t case ActionType.TRUNCATE_FILE:\n\t // Delete file.\n\t this.unlinkSync(p);\n\t // Create file. Use the same mode as the old file.\n\t // Node itself modifies the ctime when this occurs, so this action\n\t // will preserve that behavior if the underlying file system\n\t // supports those properties.\n\t return this.createFileSync(p, flag, stats.mode);\n\t case ActionType.NOP:\n\t return this.openFileSync(p, flag, mode);\n\t default:\n\t throw new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.');\n\t }\n\t};\n\tBaseFileSystem.prototype.unlink = function unlink (p, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.unlinkSync = function unlinkSync (p) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.rmdir = function rmdir (p, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.rmdirSync = function rmdirSync (p) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.mkdir = function mkdir (p, mode, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.mkdirSync = function mkdirSync (p, mode) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.readdir = function readdir (p, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.readdirSync = function readdirSync (p) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.exists = function exists (p, cb) {\n\t this.stat(p, null, function (err) {\n\t cb(!err);\n\t });\n\t};\n\tBaseFileSystem.prototype.existsSync = function existsSync (p) {\n\t try {\n\t this.statSync(p, true);\n\t return true;\n\t }\n\t catch (e) {\n\t return false;\n\t }\n\t};\n\tBaseFileSystem.prototype.realpath = function realpath (p, cache, cb) {\n\t if (this.supportsLinks()) {\n\t // The path could contain symlinks. Split up the path,\n\t // resolve any symlinks, return the resolved string.\n\t var splitPath = p.split(path.sep);\n\t // TODO: Simpler to just pass through file, find sep and such.\n\t for (var i = 0; i < splitPath.length; i++) {\n\t var addPaths = splitPath.slice(0, i + 1);\n\t splitPath[i] = path.join.apply(null, addPaths);\n\t }\n\t }\n\t else {\n\t // No symlinks. We just need to verify that it exists.\n\t this.exists(p, function (doesExist) {\n\t if (doesExist) {\n\t cb(null, p);\n\t }\n\t else {\n\t cb(ApiError.ENOENT(p));\n\t }\n\t });\n\t }\n\t};\n\tBaseFileSystem.prototype.realpathSync = function realpathSync (p, cache) {\n\t if (this.supportsLinks()) {\n\t // The path could contain symlinks. Split up the path,\n\t // resolve any symlinks, return the resolved string.\n\t var splitPath = p.split(path.sep);\n\t // TODO: Simpler to just pass through file, find sep and such.\n\t for (var i = 0; i < splitPath.length; i++) {\n\t var addPaths = splitPath.slice(0, i + 1);\n\t splitPath[i] = path.join.apply(path, addPaths);\n\t }\n\t return splitPath.join(path.sep);\n\t }\n\t else {\n\t // No symlinks. We just need to verify that it exists.\n\t if (this.existsSync(p)) {\n\t return p;\n\t }\n\t else {\n\t throw ApiError.ENOENT(p);\n\t }\n\t }\n\t};\n\tBaseFileSystem.prototype.truncate = function truncate (p, len, cb) {\n\t this.open(p, FileFlag.getFileFlag('r+'), 0x1a4, (function (er, fd) {\n\t if (er) {\n\t return cb(er);\n\t }\n\t fd.truncate(len, (function (er) {\n\t fd.close((function (er2) {\n\t cb(er || er2);\n\t }));\n\t }));\n\t }));\n\t};\n\tBaseFileSystem.prototype.truncateSync = function truncateSync (p, len) {\n\t var fd = this.openSync(p, FileFlag.getFileFlag('r+'), 0x1a4);\n\t // Need to safely close FD, regardless of whether or not truncate succeeds.\n\t try {\n\t fd.truncateSync(len);\n\t }\n\t catch (e) {\n\t throw e;\n\t }\n\t finally {\n\t fd.closeSync();\n\t }\n\t};\n\tBaseFileSystem.prototype.readFile = function readFile (fname, encoding, flag, cb) {\n\t // Wrap cb in file closing code.\n\t var oldCb = cb;\n\t // Get file.\n\t this.open(fname, flag, 0x1a4, function (err, fd) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t cb = function (err, arg) {\n\t fd.close(function (err2) {\n\t if (!err) {\n\t err = err2;\n\t }\n\t return oldCb(err, arg);\n\t });\n\t };\n\t fd.stat(function (err, stat) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t // Allocate buffer.\n\t var buf = Buffer.alloc(stat.size);\n\t fd.read(buf, 0, stat.size, 0, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t else if (encoding === null) {\n\t return cb(err, buf);\n\t }\n\t try {\n\t cb(null, buf.toString(encoding));\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t });\n\t });\n\t });\n\t};\n\tBaseFileSystem.prototype.readFileSync = function readFileSync (fname, encoding, flag) {\n\t // Get file.\n\t var fd = this.openSync(fname, flag, 0x1a4);\n\t try {\n\t var stat = fd.statSync();\n\t // Allocate buffer.\n\t var buf = Buffer.alloc(stat.size);\n\t fd.readSync(buf, 0, stat.size, 0);\n\t fd.closeSync();\n\t if (encoding === null) {\n\t return buf;\n\t }\n\t return buf.toString(encoding);\n\t }\n\t finally {\n\t fd.closeSync();\n\t }\n\t};\n\tBaseFileSystem.prototype.writeFile = function writeFile (fname, data, encoding, flag, mode, cb) {\n\t // Wrap cb in file closing code.\n\t var oldCb = cb;\n\t // Get file.\n\t this.open(fname, flag, 0x1a4, function (err, fd) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t cb = function (err) {\n\t fd.close(function (err2) {\n\t oldCb(err ? err : err2);\n\t });\n\t };\n\t try {\n\t if (typeof data === 'string') {\n\t data = Buffer.from(data, encoding);\n\t }\n\t }\n\t catch (e) {\n\t return cb(e);\n\t }\n\t // Write into file.\n\t fd.write(data, 0, data.length, 0, cb);\n\t });\n\t};\n\tBaseFileSystem.prototype.writeFileSync = function writeFileSync (fname, data, encoding, flag, mode) {\n\t // Get file.\n\t var fd = this.openSync(fname, flag, mode);\n\t try {\n\t if (typeof data === 'string') {\n\t data = Buffer.from(data, encoding);\n\t }\n\t // Write into file.\n\t fd.writeSync(data, 0, data.length, 0);\n\t }\n\t finally {\n\t fd.closeSync();\n\t }\n\t};\n\tBaseFileSystem.prototype.appendFile = function appendFile (fname, data, encoding, flag, mode, cb) {\n\t // Wrap cb in file closing code.\n\t var oldCb = cb;\n\t this.open(fname, flag, mode, function (err, fd) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t cb = function (err) {\n\t fd.close(function (err2) {\n\t oldCb(err ? err : err2);\n\t });\n\t };\n\t if (typeof data === 'string') {\n\t data = Buffer.from(data, encoding);\n\t }\n\t fd.write(data, 0, data.length, null, cb);\n\t });\n\t};\n\tBaseFileSystem.prototype.appendFileSync = function appendFileSync (fname, data, encoding, flag, mode) {\n\t var fd = this.openSync(fname, flag, mode);\n\t try {\n\t if (typeof data === 'string') {\n\t data = Buffer.from(data, encoding);\n\t }\n\t fd.writeSync(data, 0, data.length, null);\n\t }\n\t finally {\n\t fd.closeSync();\n\t }\n\t};\n\tBaseFileSystem.prototype.chmod = function chmod (p, isLchmod, mode, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.chmodSync = function chmodSync (p, isLchmod, mode) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.chown = function chown (p, isLchown, uid, gid, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.chownSync = function chownSync (p, isLchown, uid, gid) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.utimes = function utimes (p, atime, mtime, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.utimesSync = function utimesSync (p, atime, mtime) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.link = function link (srcpath, dstpath, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.linkSync = function linkSync (srcpath, dstpath) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.symlink = function symlink (srcpath, dstpath, type, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.symlinkSync = function symlinkSync (srcpath, dstpath, type) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFileSystem.prototype.readlink = function readlink (p, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFileSystem.prototype.readlinkSync = function readlinkSync (p) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\t/**\n\t * Implements the asynchronous API in terms of the synchronous API.\n\t * @class SynchronousFileSystem\n\t */\n\tvar SynchronousFileSystem = (function (BaseFileSystem) {\n\t function SynchronousFileSystem () {\n\t BaseFileSystem.apply(this, arguments);\n\t }\n\t\n\t if ( BaseFileSystem ) SynchronousFileSystem.__proto__ = BaseFileSystem;\n\t SynchronousFileSystem.prototype = Object.create( BaseFileSystem && BaseFileSystem.prototype );\n\t SynchronousFileSystem.prototype.constructor = SynchronousFileSystem;\n\t\n\t SynchronousFileSystem.prototype.supportsSynch = function supportsSynch () {\n\t return true;\n\t };\n\t SynchronousFileSystem.prototype.rename = function rename (oldPath, newPath, cb) {\n\t try {\n\t this.renameSync(oldPath, newPath);\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.stat = function stat (p, isLstat, cb) {\n\t try {\n\t cb(null, this.statSync(p, isLstat));\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.open = function open (p, flags, mode, cb) {\n\t try {\n\t cb(null, this.openSync(p, flags, mode));\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.unlink = function unlink (p, cb) {\n\t try {\n\t this.unlinkSync(p);\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.rmdir = function rmdir (p, cb) {\n\t try {\n\t this.rmdirSync(p);\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.mkdir = function mkdir (p, mode, cb) {\n\t try {\n\t this.mkdirSync(p, mode);\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.readdir = function readdir (p, cb) {\n\t try {\n\t cb(null, this.readdirSync(p));\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.chmod = function chmod (p, isLchmod, mode, cb) {\n\t try {\n\t this.chmodSync(p, isLchmod, mode);\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.chown = function chown (p, isLchown, uid, gid, cb) {\n\t try {\n\t this.chownSync(p, isLchown, uid, gid);\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.utimes = function utimes (p, atime, mtime, cb) {\n\t try {\n\t this.utimesSync(p, atime, mtime);\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.link = function link (srcpath, dstpath, cb) {\n\t try {\n\t this.linkSync(srcpath, dstpath);\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.symlink = function symlink (srcpath, dstpath, type, cb) {\n\t try {\n\t this.symlinkSync(srcpath, dstpath, type);\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t SynchronousFileSystem.prototype.readlink = function readlink (p, cb) {\n\t try {\n\t cb(null, this.readlinkSync(p));\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t\n\t return SynchronousFileSystem;\n\t}(BaseFileSystem));\n\t\n\t/**\n\t * Base class that contains shared implementations of functions for the file\n\t * object.\n\t */\n\tvar BaseFile = function BaseFile () {};\n\t\n\tBaseFile.prototype.sync = function sync (cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFile.prototype.syncSync = function syncSync () {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFile.prototype.datasync = function datasync (cb) {\n\t this.sync(cb);\n\t};\n\tBaseFile.prototype.datasyncSync = function datasyncSync () {\n\t return this.syncSync();\n\t};\n\tBaseFile.prototype.chown = function chown (uid, gid, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFile.prototype.chownSync = function chownSync (uid, gid) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFile.prototype.chmod = function chmod (mode, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFile.prototype.chmodSync = function chmodSync (mode) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\tBaseFile.prototype.utimes = function utimes (atime, mtime, cb) {\n\t cb(new ApiError(ErrorCode.ENOTSUP));\n\t};\n\tBaseFile.prototype.utimesSync = function utimesSync (atime, mtime) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t};\n\t\n\t/**\n\t * An implementation of the File interface that operates on a file that is\n\t * completely in-memory. PreloadFiles are backed by a Buffer.\n\t *\n\t * This is also an abstract class, as it lacks an implementation of 'sync' and\n\t * 'close'. Each filesystem that wishes to use this file representation must\n\t * extend this class and implement those two methods.\n\t * @todo 'close' lever that disables functionality once closed.\n\t */\n\tvar PreloadFile = (function (BaseFile$$1) {\n\t function PreloadFile(_fs, _path, _flag, _stat, contents) {\n\t BaseFile$$1.call(this);\n\t this._pos = 0;\n\t this._dirty = false;\n\t this._fs = _fs;\n\t this._path = _path;\n\t this._flag = _flag;\n\t this._stat = _stat;\n\t if (contents) {\n\t this._buffer = contents;\n\t }\n\t else {\n\t // Empty buffer. It'll expand once we write stuff to it.\n\t this._buffer = emptyBuffer();\n\t }\n\t // Note: This invariant is *not* maintained once the file starts getting\n\t // modified.\n\t // Note: Only actually matters if file is readable, as writeable modes may\n\t // truncate/append to file.\n\t if (this._stat.size !== this._buffer.length && this._flag.isReadable()) {\n\t throw new Error((\"Invalid buffer: Buffer is \" + (this._buffer.length) + \" long, yet Stats object specifies that file is \" + (this._stat.size) + \" long.\"));\n\t }\n\t }\n\t\n\t if ( BaseFile$$1 ) PreloadFile.__proto__ = BaseFile$$1;\n\t PreloadFile.prototype = Object.create( BaseFile$$1 && BaseFile$$1.prototype );\n\t PreloadFile.prototype.constructor = PreloadFile;\n\t /**\n\t * NONSTANDARD: Get the underlying buffer for this file. !!DO NOT MUTATE!! Will mess up dirty tracking.\n\t */\n\t PreloadFile.prototype.getBuffer = function getBuffer () {\n\t return this._buffer;\n\t };\n\t /**\n\t * NONSTANDARD: Get underlying stats for this file. !!DO NOT MUTATE!!\n\t */\n\t PreloadFile.prototype.getStats = function getStats () {\n\t return this._stat;\n\t };\n\t PreloadFile.prototype.getFlag = function getFlag () {\n\t return this._flag;\n\t };\n\t /**\n\t * Get the path to this file.\n\t * @return [String] The path to the file.\n\t */\n\t PreloadFile.prototype.getPath = function getPath () {\n\t return this._path;\n\t };\n\t /**\n\t * Get the current file position.\n\t *\n\t * We emulate the following bug mentioned in the Node documentation:\n\t * > On Linux, positional writes don't work when the file is opened in append\n\t * mode. The kernel ignores the position argument and always appends the data\n\t * to the end of the file.\n\t * @return [Number] The current file position.\n\t */\n\t PreloadFile.prototype.getPos = function getPos () {\n\t if (this._flag.isAppendable()) {\n\t return this._stat.size;\n\t }\n\t return this._pos;\n\t };\n\t /**\n\t * Advance the current file position by the indicated number of positions.\n\t * @param [Number] delta\n\t */\n\t PreloadFile.prototype.advancePos = function advancePos (delta) {\n\t return this._pos += delta;\n\t };\n\t /**\n\t * Set the file position.\n\t * @param [Number] newPos\n\t */\n\t PreloadFile.prototype.setPos = function setPos (newPos) {\n\t return this._pos = newPos;\n\t };\n\t /**\n\t * **Core**: Asynchronous sync. Must be implemented by subclasses of this\n\t * class.\n\t * @param [Function(BrowserFS.ApiError)] cb\n\t */\n\t PreloadFile.prototype.sync = function sync (cb) {\n\t try {\n\t this.syncSync();\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t /**\n\t * **Core**: Synchronous sync.\n\t */\n\t PreloadFile.prototype.syncSync = function syncSync () {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t };\n\t /**\n\t * **Core**: Asynchronous close. Must be implemented by subclasses of this\n\t * class.\n\t * @param [Function(BrowserFS.ApiError)] cb\n\t */\n\t PreloadFile.prototype.close = function close (cb) {\n\t try {\n\t this.closeSync();\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t /**\n\t * **Core**: Synchronous close.\n\t */\n\t PreloadFile.prototype.closeSync = function closeSync () {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t };\n\t /**\n\t * Asynchronous `stat`.\n\t * @param [Function(BrowserFS.ApiError, BrowserFS.node.fs.Stats)] cb\n\t */\n\t PreloadFile.prototype.stat = function stat (cb) {\n\t try {\n\t cb(null, this._stat.clone());\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t /**\n\t * Synchronous `stat`.\n\t */\n\t PreloadFile.prototype.statSync = function statSync () {\n\t return this._stat.clone();\n\t };\n\t /**\n\t * Asynchronous truncate.\n\t * @param [Number] len\n\t * @param [Function(BrowserFS.ApiError)] cb\n\t */\n\t PreloadFile.prototype.truncate = function truncate (len, cb) {\n\t try {\n\t this.truncateSync(len);\n\t if (this._flag.isSynchronous() && !_fsMock.getRootFS().supportsSynch()) {\n\t this.sync(cb);\n\t }\n\t cb();\n\t }\n\t catch (e) {\n\t return cb(e);\n\t }\n\t };\n\t /**\n\t * Synchronous truncate.\n\t * @param [Number] len\n\t */\n\t PreloadFile.prototype.truncateSync = function truncateSync (len) {\n\t this._dirty = true;\n\t if (!this._flag.isWriteable()) {\n\t throw new ApiError(ErrorCode.EPERM, 'File not opened with a writeable mode.');\n\t }\n\t this._stat.mtime = new Date();\n\t if (len > this._buffer.length) {\n\t var buf = Buffer.alloc(len - this._buffer.length, 0);\n\t // Write will set @_stat.size for us.\n\t this.writeSync(buf, 0, buf.length, this._buffer.length);\n\t if (this._flag.isSynchronous() && _fsMock.getRootFS().supportsSynch()) {\n\t this.syncSync();\n\t }\n\t return;\n\t }\n\t this._stat.size = len;\n\t // Truncate buffer to 'len'.\n\t var newBuff = Buffer.alloc(len);\n\t this._buffer.copy(newBuff, 0, 0, len);\n\t this._buffer = newBuff;\n\t if (this._flag.isSynchronous() && _fsMock.getRootFS().supportsSynch()) {\n\t this.syncSync();\n\t }\n\t };\n\t /**\n\t * Write buffer to the file.\n\t * Note that it is unsafe to use fs.write multiple times on the same file\n\t * without waiting for the callback.\n\t * @param [BrowserFS.node.Buffer] buffer Buffer containing the data to write to\n\t * the file.\n\t * @param [Number] offset Offset in the buffer to start reading data from.\n\t * @param [Number] length The amount of bytes to write to the file.\n\t * @param [Number] position Offset from the beginning of the file where this\n\t * data should be written. If position is null, the data will be written at\n\t * the current position.\n\t * @param [Function(BrowserFS.ApiError, Number, BrowserFS.node.Buffer)]\n\t * cb The number specifies the number of bytes written into the file.\n\t */\n\t PreloadFile.prototype.write = function write (buffer$$1, offset, length, position, cb) {\n\t try {\n\t cb(null, this.writeSync(buffer$$1, offset, length, position), buffer$$1);\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t /**\n\t * Write buffer to the file.\n\t * Note that it is unsafe to use fs.writeSync multiple times on the same file\n\t * without waiting for the callback.\n\t * @param [BrowserFS.node.Buffer] buffer Buffer containing the data to write to\n\t * the file.\n\t * @param [Number] offset Offset in the buffer to start reading data from.\n\t * @param [Number] length The amount of bytes to write to the file.\n\t * @param [Number] position Offset from the beginning of the file where this\n\t * data should be written. If position is null, the data will be written at\n\t * the current position.\n\t * @return [Number]\n\t */\n\t PreloadFile.prototype.writeSync = function writeSync (buffer$$1, offset, length, position) {\n\t this._dirty = true;\n\t if (position === undefined || position === null) {\n\t position = this.getPos();\n\t }\n\t if (!this._flag.isWriteable()) {\n\t throw new ApiError(ErrorCode.EPERM, 'File not opened with a writeable mode.');\n\t }\n\t var endFp = position + length;\n\t if (endFp > this._stat.size) {\n\t this._stat.size = endFp;\n\t if (endFp > this._buffer.length) {\n\t // Extend the buffer!\n\t var newBuff = Buffer.alloc(endFp);\n\t this._buffer.copy(newBuff);\n\t this._buffer = newBuff;\n\t }\n\t }\n\t var len = buffer$$1.copy(this._buffer, position, offset, offset + length);\n\t this._stat.mtime = new Date();\n\t if (this._flag.isSynchronous()) {\n\t this.syncSync();\n\t return len;\n\t }\n\t this.setPos(position + len);\n\t return len;\n\t };\n\t /**\n\t * Read data from the file.\n\t * @param [BrowserFS.node.Buffer] buffer The buffer that the data will be\n\t * written to.\n\t * @param [Number] offset The offset within the buffer where writing will\n\t * start.\n\t * @param [Number] length An integer specifying the number of bytes to read.\n\t * @param [Number] position An integer specifying where to begin reading from\n\t * in the file. If position is null, data will be read from the current file\n\t * position.\n\t * @param [Function(BrowserFS.ApiError, Number, BrowserFS.node.Buffer)] cb The\n\t * number is the number of bytes read\n\t */\n\t PreloadFile.prototype.read = function read (buffer$$1, offset, length, position, cb) {\n\t try {\n\t cb(null, this.readSync(buffer$$1, offset, length, position), buffer$$1);\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t /**\n\t * Read data from the file.\n\t * @param [BrowserFS.node.Buffer] buffer The buffer that the data will be\n\t * written to.\n\t * @param [Number] offset The offset within the buffer where writing will\n\t * start.\n\t * @param [Number] length An integer specifying the number of bytes to read.\n\t * @param [Number] position An integer specifying where to begin reading from\n\t * in the file. If position is null, data will be read from the current file\n\t * position.\n\t * @return [Number]\n\t */\n\t PreloadFile.prototype.readSync = function readSync (buffer$$1, offset, length, position) {\n\t if (!this._flag.isReadable()) {\n\t throw new ApiError(ErrorCode.EPERM, 'File not opened with a readable mode.');\n\t }\n\t if (position === undefined || position === null) {\n\t position = this.getPos();\n\t }\n\t var endRead = position + length;\n\t if (endRead > this._stat.size) {\n\t length = this._stat.size - position;\n\t }\n\t var rv = this._buffer.copy(buffer$$1, offset, position, position + length);\n\t this._stat.atime = new Date();\n\t this._pos = position + length;\n\t return rv;\n\t };\n\t /**\n\t * Asynchronous `fchmod`.\n\t * @param [Number|String] mode\n\t * @param [Function(BrowserFS.ApiError)] cb\n\t */\n\t PreloadFile.prototype.chmod = function chmod (mode, cb) {\n\t try {\n\t this.chmodSync(mode);\n\t cb();\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t /**\n\t * Asynchronous `fchmod`.\n\t * @param [Number] mode\n\t */\n\t PreloadFile.prototype.chmodSync = function chmodSync (mode) {\n\t if (!this._fs.supportsProps()) {\n\t throw new ApiError(ErrorCode.ENOTSUP);\n\t }\n\t this._dirty = true;\n\t this._stat.chmod(mode);\n\t this.syncSync();\n\t };\n\t PreloadFile.prototype.isDirty = function isDirty () {\n\t return this._dirty;\n\t };\n\t /**\n\t * Resets the dirty bit. Should only be called after a sync has completed successfully.\n\t */\n\t PreloadFile.prototype.resetDirty = function resetDirty () {\n\t this._dirty = false;\n\t };\n\t\n\t return PreloadFile;\n\t}(BaseFile));\n\t\n\t/**\n\t * File class for the InMemory and XHR file systems.\n\t * Doesn't sync to anything, so it works nicely for memory-only files.\n\t */\n\tvar NoSyncFile = (function (PreloadFile) {\n\t function NoSyncFile(_fs, _path, _flag, _stat, contents) {\n\t PreloadFile.call(this, _fs, _path, _flag, _stat, contents);\n\t }\n\t\n\t if ( PreloadFile ) NoSyncFile.__proto__ = PreloadFile;\n\t NoSyncFile.prototype = Object.create( PreloadFile && PreloadFile.prototype );\n\t NoSyncFile.prototype.constructor = NoSyncFile;\n\t /**\n\t * Asynchronous sync. Doesn't do anything, simply calls the cb.\n\t * @param [Function(BrowserFS.ApiError)] cb\n\t */\n\t NoSyncFile.prototype.sync = function sync (cb) {\n\t cb();\n\t };\n\t /**\n\t * Synchronous sync. Doesn't do anything.\n\t */\n\t NoSyncFile.prototype.syncSync = function syncSync () {\n\t // NOP.\n\t };\n\t /**\n\t * Asynchronous close. Doesn't do anything, simply calls the cb.\n\t * @param [Function(BrowserFS.ApiError)] cb\n\t */\n\t NoSyncFile.prototype.close = function close (cb) {\n\t cb();\n\t };\n\t /**\n\t * Synchronous close. Doesn't do anything.\n\t */\n\t NoSyncFile.prototype.closeSync = function closeSync () {\n\t // NOP.\n\t };\n\t\n\t return NoSyncFile;\n\t}(PreloadFile));\n\t\n\t/**\n\t * We define our own file to interpose on syncSync() for mirroring purposes.\n\t */\n\tvar MirrorFile = (function (PreloadFile$$1) {\n\t function MirrorFile(fs, path$$1, flag, stat, data) {\n\t PreloadFile$$1.call(this, fs, path$$1, flag, stat, data);\n\t }\n\t\n\t if ( PreloadFile$$1 ) MirrorFile.__proto__ = PreloadFile$$1;\n\t MirrorFile.prototype = Object.create( PreloadFile$$1 && PreloadFile$$1.prototype );\n\t MirrorFile.prototype.constructor = MirrorFile;\n\t MirrorFile.prototype.syncSync = function syncSync () {\n\t if (this.isDirty()) {\n\t this._fs._syncSync(this);\n\t this.resetDirty();\n\t }\n\t };\n\t MirrorFile.prototype.closeSync = function closeSync () {\n\t this.syncSync();\n\t };\n\t\n\t return MirrorFile;\n\t}(PreloadFile));\n\t/**\n\t * AsyncMirrorFS mirrors a synchronous filesystem into an asynchronous filesystem\n\t * by:\n\t *\n\t * * Performing operations over the in-memory copy, while asynchronously pipelining them\n\t * to the backing store.\n\t * * During application loading, the contents of the async file system can be reloaded into\n\t * the synchronous store, if desired.\n\t *\n\t * The two stores will be kept in sync. The most common use-case is to pair a synchronous\n\t * in-memory filesystem with an asynchronous backing store.\n\t *\n\t * Example: Mirroring an IndexedDB file system to an in memory file system. Now, you can use\n\t * IndexedDB synchronously.\n\t *\n\t * ```javascript\n\t * BrowserFS.configure({\n\t * fs: \"AsyncMirror\",\n\t * options: {\n\t * sync: { fs: \"InMemory\" },\n\t * async: { fs: \"IndexedDB\" }\n\t * }\n\t * }, function(e) {\n\t * // BrowserFS is initialized and ready-to-use!\n\t * });\n\t * ```\n\t *\n\t * Or, alternatively:\n\t *\n\t * ```javascript\n\t * BrowserFS.FileSystem.IndexedDB.Create(function(e, idbfs) {\n\t * BrowserFS.FileSystem.InMemory.Create(function(e, inMemory) {\n\t * BrowserFS.FileSystem.AsyncMirror({\n\t * sync: inMemory, async: idbfs\n\t * }, function(e, mirrored) {\n\t * BrowserFS.initialize(mirrored);\n\t * });\n\t * });\n\t * });\n\t * ```\n\t */\n\tvar AsyncMirror = (function (SynchronousFileSystem$$1) {\n\t function AsyncMirror(sync, async, deprecateMsg) {\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t SynchronousFileSystem$$1.call(this);\n\t /**\n\t * Queue of pending asynchronous operations.\n\t */\n\t this._queue = [];\n\t this._queueRunning = false;\n\t this._isInitialized = false;\n\t this._initializeCallbacks = [];\n\t this._sync = sync;\n\t this._async = async;\n\t if (!sync.supportsSynch()) {\n\t throw new Error(\"The first argument to AsyncMirror needs to be a synchronous file system.\");\n\t }\n\t deprecationMessage(deprecateMsg, AsyncMirror.Name, { sync: \"sync file system instance\", async: \"async file system instance\" });\n\t }\n\t\n\t if ( SynchronousFileSystem$$1 ) AsyncMirror.__proto__ = SynchronousFileSystem$$1;\n\t AsyncMirror.prototype = Object.create( SynchronousFileSystem$$1 && SynchronousFileSystem$$1.prototype );\n\t AsyncMirror.prototype.constructor = AsyncMirror;\n\t /**\n\t * Constructs and initializes an AsyncMirror file system with the given options.\n\t */\n\t AsyncMirror.Create = function Create (opts, cb) {\n\t try {\n\t var fs = new AsyncMirror(opts.sync, opts.async, false);\n\t fs.initialize(function (e) {\n\t if (e) {\n\t cb(e);\n\t }\n\t else {\n\t cb(null, fs);\n\t }\n\t }, false);\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t AsyncMirror.isAvailable = function isAvailable () {\n\t return true;\n\t };\n\t AsyncMirror.prototype.getName = function getName () {\n\t return AsyncMirror.Name;\n\t };\n\t AsyncMirror.prototype._syncSync = function _syncSync (fd) {\n\t this._sync.writeFileSync(fd.getPath(), fd.getBuffer(), null, FileFlag.getFileFlag('w'), fd.getStats().mode);\n\t this.enqueueOp({\n\t apiMethod: 'writeFile',\n\t arguments: [fd.getPath(), fd.getBuffer(), null, fd.getFlag(), fd.getStats().mode]\n\t });\n\t };\n\t /**\n\t * Called once to load up files from async storage into sync storage.\n\t */\n\t AsyncMirror.prototype.initialize = function initialize (userCb, deprecateMsg) {\n\t var this$1 = this;\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t if (deprecateMsg) {\n\t console.warn(\"[AsyncMirror] AsyncMirror.initialize() is deprecated and will be removed in the next major version. Please use 'AsyncMirror.Create({ sync: (sync file system instance), async: (async file system instance)}, cb)' to create and initialize AsyncMirror instances.\");\n\t }\n\t var callbacks = this._initializeCallbacks;\n\t var end = function (e) {\n\t this$1._isInitialized = !e;\n\t this$1._initializeCallbacks = [];\n\t callbacks.forEach(function (cb) { return cb(e); });\n\t };\n\t if (!this._isInitialized) {\n\t // First call triggers initialization, the rest wait.\n\t if (callbacks.push(userCb) === 1) {\n\t var copyDirectory = function (p, mode, cb) {\n\t if (p !== '/') {\n\t this$1._sync.mkdirSync(p, mode);\n\t }\n\t this$1._async.readdir(p, function (err, files) {\n\t var i = 0;\n\t // NOTE: This function must not be in a lexically nested statement,\n\t // such as an if or while statement. Safari refuses to run the\n\t // script since it is undefined behavior.\n\t function copyNextFile(err) {\n\t if (err) {\n\t cb(err);\n\t }\n\t else if (i < files.length) {\n\t copyItem(path.join(p, files[i]), copyNextFile);\n\t i++;\n\t }\n\t else {\n\t cb();\n\t }\n\t }\n\t if (err) {\n\t cb(err);\n\t }\n\t else {\n\t copyNextFile();\n\t }\n\t });\n\t }, copyFile = function (p, mode, cb) {\n\t this$1._async.readFile(p, null, FileFlag.getFileFlag('r'), function (err, data) {\n\t if (err) {\n\t cb(err);\n\t }\n\t else {\n\t try {\n\t this$1._sync.writeFileSync(p, data, null, FileFlag.getFileFlag('w'), mode);\n\t }\n\t catch (e) {\n\t err = e;\n\t }\n\t finally {\n\t cb(err);\n\t }\n\t }\n\t });\n\t }, copyItem = function (p, cb) {\n\t this$1._async.stat(p, false, function (err, stats) {\n\t if (err) {\n\t cb(err);\n\t }\n\t else if (stats.isDirectory()) {\n\t copyDirectory(p, stats.mode, cb);\n\t }\n\t else {\n\t copyFile(p, stats.mode, cb);\n\t }\n\t });\n\t };\n\t copyDirectory('/', 0, end);\n\t }\n\t }\n\t else {\n\t userCb();\n\t }\n\t };\n\t AsyncMirror.prototype.isReadOnly = function isReadOnly () { return false; };\n\t AsyncMirror.prototype.supportsSynch = function supportsSynch () { return true; };\n\t AsyncMirror.prototype.supportsLinks = function supportsLinks () { return false; };\n\t AsyncMirror.prototype.supportsProps = function supportsProps () { return this._sync.supportsProps() && this._async.supportsProps(); };\n\t AsyncMirror.prototype.renameSync = function renameSync (oldPath, newPath) {\n\t this.checkInitialized();\n\t this._sync.renameSync(oldPath, newPath);\n\t this.enqueueOp({\n\t apiMethod: 'rename',\n\t arguments: [oldPath, newPath]\n\t });\n\t };\n\t AsyncMirror.prototype.statSync = function statSync (p, isLstat) {\n\t this.checkInitialized();\n\t return this._sync.statSync(p, isLstat);\n\t };\n\t AsyncMirror.prototype.openSync = function openSync (p, flag, mode) {\n\t this.checkInitialized();\n\t // Sanity check: Is this open/close permitted?\n\t var fd = this._sync.openSync(p, flag, mode);\n\t fd.closeSync();\n\t return new MirrorFile(this, p, flag, this._sync.statSync(p, false), this._sync.readFileSync(p, null, FileFlag.getFileFlag('r')));\n\t };\n\t AsyncMirror.prototype.unlinkSync = function unlinkSync (p) {\n\t this.checkInitialized();\n\t this._sync.unlinkSync(p);\n\t this.enqueueOp({\n\t apiMethod: 'unlink',\n\t arguments: [p]\n\t });\n\t };\n\t AsyncMirror.prototype.rmdirSync = function rmdirSync (p) {\n\t this.checkInitialized();\n\t this._sync.rmdirSync(p);\n\t this.enqueueOp({\n\t apiMethod: 'rmdir',\n\t arguments: [p]\n\t });\n\t };\n\t AsyncMirror.prototype.mkdirSync = function mkdirSync (p, mode) {\n\t this.checkInitialized();\n\t this._sync.mkdirSync(p, mode);\n\t this.enqueueOp({\n\t apiMethod: 'mkdir',\n\t arguments: [p, mode]\n\t });\n\t };\n\t AsyncMirror.prototype.readdirSync = function readdirSync (p) {\n\t this.checkInitialized();\n\t return this._sync.readdirSync(p);\n\t };\n\t AsyncMirror.prototype.existsSync = function existsSync (p) {\n\t this.checkInitialized();\n\t return this._sync.existsSync(p);\n\t };\n\t AsyncMirror.prototype.chmodSync = function chmodSync (p, isLchmod, mode) {\n\t this.checkInitialized();\n\t this._sync.chmodSync(p, isLchmod, mode);\n\t this.enqueueOp({\n\t apiMethod: 'chmod',\n\t arguments: [p, isLchmod, mode]\n\t });\n\t };\n\t AsyncMirror.prototype.chownSync = function chownSync (p, isLchown, uid, gid) {\n\t this.checkInitialized();\n\t this._sync.chownSync(p, isLchown, uid, gid);\n\t this.enqueueOp({\n\t apiMethod: 'chown',\n\t arguments: [p, isLchown, uid, gid]\n\t });\n\t };\n\t AsyncMirror.prototype.utimesSync = function utimesSync (p, atime, mtime) {\n\t this.checkInitialized();\n\t this._sync.utimesSync(p, atime, mtime);\n\t this.enqueueOp({\n\t apiMethod: 'utimes',\n\t arguments: [p, atime, mtime]\n\t });\n\t };\n\t AsyncMirror.prototype.checkInitialized = function checkInitialized () {\n\t if (!this._isInitialized) {\n\t throw new ApiError(ErrorCode.EPERM, \"AsyncMirrorFS is not initialized. Please initialize AsyncMirrorFS using its initialize() method before using it.\");\n\t }\n\t };\n\t AsyncMirror.prototype.enqueueOp = function enqueueOp (op) {\n\t var this$1 = this;\n\t\n\t this._queue.push(op);\n\t if (!this._queueRunning) {\n\t this._queueRunning = true;\n\t var doNextOp = function (err) {\n\t if (err) {\n\t console.error((\"WARNING: File system has desynchronized. Received following error: \" + err + \"\\n$\"));\n\t }\n\t if (this$1._queue.length > 0) {\n\t var op = this$1._queue.shift(), args = op.arguments;\n\t args.push(doNextOp);\n\t this$1._async[op.apiMethod].apply(this$1._async, args);\n\t }\n\t else {\n\t this$1._queueRunning = false;\n\t }\n\t };\n\t doNextOp();\n\t }\n\t };\n\t\n\t return AsyncMirror;\n\t}(SynchronousFileSystem));\n\t\n\tAsyncMirror.Name = \"AsyncMirror\";\n\tAsyncMirror.Options = {\n\t sync: {\n\t type: \"object\",\n\t description: \"The synchronous file system to mirror the asynchronous file system to.\"\n\t },\n\t async: {\n\t type: \"object\",\n\t description: \"The asynchronous file system to mirror.\"\n\t }\n\t};\n\t\n\t/**\n\t * A faster alternative to `Function#apply`, this function invokes `func`\n\t * with the `this` binding of `thisArg` and the arguments of `args`.\n\t *\n\t * @private\n\t * @param {Function} func The function to invoke.\n\t * @param {*} thisArg The `this` binding of `func`.\n\t * @param {Array} args The arguments to invoke `func` with.\n\t * @returns {*} Returns the result of `func`.\n\t */\n\tfunction apply(func, thisArg, args) {\n\t switch (args.length) {\n\t case 0: return func.call(thisArg);\n\t case 1: return func.call(thisArg, args[0]);\n\t case 2: return func.call(thisArg, args[0], args[1]);\n\t case 3: return func.call(thisArg, args[0], args[1], args[2]);\n\t }\n\t return func.apply(thisArg, args);\n\t}\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeMax = Math.max;\n\t\n\t/**\n\t * A specialized version of `baseRest` which transforms the rest array.\n\t *\n\t * @private\n\t * @param {Function} func The function to apply a rest parameter to.\n\t * @param {number} [start=func.length-1] The start position of the rest parameter.\n\t * @param {Function} transform The rest array transform.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction overRest$1(func, start, transform) {\n\t start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n\t return function() {\n\t var args = arguments,\n\t index = -1,\n\t length = nativeMax(args.length - start, 0),\n\t array = Array(length);\n\t\n\t while (++index < length) {\n\t array[index] = args[start + index];\n\t }\n\t index = -1;\n\t var otherArgs = Array(start + 1);\n\t while (++index < start) {\n\t otherArgs[index] = args[index];\n\t }\n\t otherArgs[start] = transform(array);\n\t return apply(func, this, otherArgs);\n\t };\n\t}\n\t\n\t/**\n\t * This method returns the first argument it receives.\n\t *\n\t * @static\n\t * @since 0.1.0\n\t * @memberOf _\n\t * @category Util\n\t * @param {*} value Any value.\n\t * @returns {*} Returns `value`.\n\t * @example\n\t *\n\t * var object = { 'a': 1 };\n\t *\n\t * console.log(_.identity(object) === object);\n\t * // => true\n\t */\n\tfunction identity(value) {\n\t return value;\n\t}\n\t\n\t// Lodash rest function without function.toString()\n\t// remappings\n\tfunction rest(func, start) {\n\t return overRest$1(func, start, identity);\n\t}\n\t\n\tvar initialParams = function (fn) {\n\t return rest(function (args/*..., callback*/) {\n\t var callback = args.pop();\n\t fn.call(this, args, callback);\n\t });\n\t};\n\t\n\tfunction applyEach$1(eachfn) {\n\t return rest(function(fns, args) {\n\t var go = initialParams(function(args, callback) {\n\t var that = this;\n\t return eachfn(fns, function (fn, cb) {\n\t fn.apply(that, args.concat(cb));\n\t }, callback);\n\t });\n\t if (args.length) {\n\t return go.apply(this, args);\n\t }\n\t else {\n\t return go;\n\t }\n\t });\n\t}\n\t\n\t/** Detect free variable `global` from Node.js. */\n\tvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\t\n\t/** Detect free variable `self`. */\n\tvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\t\n\t/** Used as a reference to the global object. */\n\tvar root = freeGlobal || freeSelf || Function('return this')();\n\t\n\t/** Built-in value references. */\n\tvar Symbol$1 = root.Symbol;\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar nativeObjectToString = objectProto.toString;\n\t\n\t/** Built-in value references. */\n\tvar symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;\n\t\n\t/**\n\t * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @returns {string} Returns the raw `toStringTag`.\n\t */\n\tfunction getRawTag(value) {\n\t var isOwn = hasOwnProperty.call(value, symToStringTag$1),\n\t tag = value[symToStringTag$1];\n\t\n\t try {\n\t value[symToStringTag$1] = undefined;\n\t var unmasked = true;\n\t } catch (e) {}\n\t\n\t var result = nativeObjectToString.call(value);\n\t if (unmasked) {\n\t if (isOwn) {\n\t value[symToStringTag$1] = tag;\n\t } else {\n\t delete value[symToStringTag$1];\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto$1 = Object.prototype;\n\t\n\t/**\n\t * Used to resolve the\n\t * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar nativeObjectToString$1 = objectProto$1.toString;\n\t\n\t/**\n\t * Converts `value` to a string using `Object.prototype.toString`.\n\t *\n\t * @private\n\t * @param {*} value The value to convert.\n\t * @returns {string} Returns the converted string.\n\t */\n\tfunction objectToString(value) {\n\t return nativeObjectToString$1.call(value);\n\t}\n\t\n\t/** `Object#toString` result references. */\n\tvar nullTag = '[object Null]';\n\tvar undefinedTag = '[object Undefined]';\n\t\n\t/** Built-in value references. */\n\tvar symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;\n\t\n\t/**\n\t * The base implementation of `getTag` without fallbacks for buggy environments.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @returns {string} Returns the `toStringTag`.\n\t */\n\tfunction baseGetTag(value) {\n\t if (value == null) {\n\t return value === undefined ? undefinedTag : nullTag;\n\t }\n\t return (symToStringTag && symToStringTag in Object(value))\n\t ? getRawTag(value)\n\t : objectToString(value);\n\t}\n\t\n\t/**\n\t * Checks if `value` is the\n\t * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n\t * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return value != null && (type == 'object' || type == 'function');\n\t}\n\t\n\t/** `Object#toString` result references. */\n\tvar asyncTag = '[object AsyncFunction]';\n\tvar funcTag = '[object Function]';\n\tvar genTag = '[object GeneratorFunction]';\n\tvar proxyTag = '[object Proxy]';\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t if (!isObject(value)) {\n\t return false;\n\t }\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 9 which returns 'object' for typed arrays and other constructors.\n\t var tag = baseGetTag(value);\n\t return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n\t}\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar MAX_SAFE_INTEGER = 9007199254740991;\n\t\n\t/**\n\t * Checks if `value` is a valid array-like length.\n\t *\n\t * **Note:** This method is loosely based on\n\t * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n\t * @example\n\t *\n\t * _.isLength(3);\n\t * // => true\n\t *\n\t * _.isLength(Number.MIN_VALUE);\n\t * // => false\n\t *\n\t * _.isLength(Infinity);\n\t * // => false\n\t *\n\t * _.isLength('3');\n\t * // => false\n\t */\n\tfunction isLength(value) {\n\t return typeof value == 'number' &&\n\t value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n\t}\n\t\n\t/**\n\t * Checks if `value` is array-like. A value is considered array-like if it's\n\t * not a function and has a `value.length` that's an integer greater than or\n\t * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n\t * @example\n\t *\n\t * _.isArrayLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLike(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLike('abc');\n\t * // => true\n\t *\n\t * _.isArrayLike(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLike(value) {\n\t return value != null && isLength(value.length) && !isFunction(value);\n\t}\n\t\n\t// A temporary value used to identify if the loop should be broken.\n\t// See #1064, #1293\n\tvar breakLoop = {};\n\t\n\t/**\n\t * This method returns `undefined`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 2.3.0\n\t * @category Util\n\t * @example\n\t *\n\t * _.times(2, _.noop);\n\t * // => [undefined, undefined]\n\t */\n\tfunction noop() {\n\t // No operation performed.\n\t}\n\t\n\tfunction once(fn) {\n\t return function () {\n\t if (fn === null) { return; }\n\t var callFn = fn;\n\t fn = null;\n\t callFn.apply(this, arguments);\n\t };\n\t}\n\t\n\tvar iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;\n\t\n\tvar getIterator = function (coll) {\n\t return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();\n\t};\n\t\n\t/**\n\t * The base implementation of `_.times` without support for iteratee shorthands\n\t * or max array length checks.\n\t *\n\t * @private\n\t * @param {number} n The number of times to invoke `iteratee`.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Array} Returns the array of results.\n\t */\n\tfunction baseTimes(n, iteratee) {\n\t var index = -1,\n\t result = Array(n);\n\t\n\t while (++index < n) {\n\t result[index] = iteratee(index);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\tfunction isObjectLike(value) {\n\t return value != null && typeof value == 'object';\n\t}\n\t\n\t/** `Object#toString` result references. */\n\tvar argsTag = '[object Arguments]';\n\t\n\t/**\n\t * The base implementation of `_.isArguments`.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n\t */\n\tfunction baseIsArguments(value) {\n\t return isObjectLike(value) && baseGetTag(value) == argsTag;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto$3 = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty$2 = objectProto$3.hasOwnProperty;\n\t\n\t/** Built-in value references. */\n\tvar propertyIsEnumerable = objectProto$3.propertyIsEnumerable;\n\t\n\t/**\n\t * Checks if `value` is likely an `arguments` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n\t * else `false`.\n\t * @example\n\t *\n\t * _.isArguments(function() { return arguments; }());\n\t * // => true\n\t *\n\t * _.isArguments([1, 2, 3]);\n\t * // => false\n\t */\n\tvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n\t return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&\n\t !propertyIsEnumerable.call(value, 'callee');\n\t};\n\t\n\t/**\n\t * Checks if `value` is classified as an `Array` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 0.1.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n\t * @example\n\t *\n\t * _.isArray([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArray(document.body.children);\n\t * // => false\n\t *\n\t * _.isArray('abc');\n\t * // => false\n\t *\n\t * _.isArray(_.noop);\n\t * // => false\n\t */\n\tvar isArray = Array.isArray;\n\t\n\t/**\n\t * This method returns `false`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.13.0\n\t * @category Util\n\t * @returns {boolean} Returns `false`.\n\t * @example\n\t *\n\t * _.times(2, _.stubFalse);\n\t * // => [false, false]\n\t */\n\tfunction stubFalse() {\n\t return false;\n\t}\n\t\n\t/** Detect free variable `exports`. */\n\tvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\t\n\t/** Detect free variable `module`. */\n\tvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\t\n\t/** Detect the popular CommonJS extension `module.exports`. */\n\tvar moduleExports = freeModule && freeModule.exports === freeExports;\n\t\n\t/** Built-in value references. */\n\tvar Buffer$1 = moduleExports ? root.Buffer : undefined;\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;\n\t\n\t/**\n\t * Checks if `value` is a buffer.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 4.3.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n\t * @example\n\t *\n\t * _.isBuffer(new Buffer(2));\n\t * // => true\n\t *\n\t * _.isBuffer(new Uint8Array(2));\n\t * // => false\n\t */\n\tvar isBuffer = nativeIsBuffer || stubFalse;\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar MAX_SAFE_INTEGER$1 = 9007199254740991;\n\t\n\t/** Used to detect unsigned integer values. */\n\tvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\t\n\t/**\n\t * Checks if `value` is a valid array-like index.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n\t * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n\t */\n\tfunction isIndex(value, length) {\n\t length = length == null ? MAX_SAFE_INTEGER$1 : length;\n\t return !!length &&\n\t (typeof value == 'number' || reIsUint.test(value)) &&\n\t (value > -1 && value % 1 == 0 && value < length);\n\t}\n\t\n\t/** `Object#toString` result references. */\n\tvar argsTag$1 = '[object Arguments]';\n\tvar arrayTag = '[object Array]';\n\tvar boolTag = '[object Boolean]';\n\tvar dateTag = '[object Date]';\n\tvar errorTag = '[object Error]';\n\tvar funcTag$1 = '[object Function]';\n\tvar mapTag = '[object Map]';\n\tvar numberTag = '[object Number]';\n\tvar objectTag = '[object Object]';\n\tvar regexpTag = '[object RegExp]';\n\tvar setTag = '[object Set]';\n\tvar stringTag = '[object String]';\n\tvar weakMapTag = '[object WeakMap]';\n\t\n\tvar arrayBufferTag = '[object ArrayBuffer]';\n\tvar dataViewTag = '[object DataView]';\n\tvar float32Tag = '[object Float32Array]';\n\tvar float64Tag = '[object Float64Array]';\n\tvar int8Tag = '[object Int8Array]';\n\tvar int16Tag = '[object Int16Array]';\n\tvar int32Tag = '[object Int32Array]';\n\tvar uint8Tag = '[object Uint8Array]';\n\tvar uint8ClampedTag = '[object Uint8ClampedArray]';\n\tvar uint16Tag = '[object Uint16Array]';\n\tvar uint32Tag = '[object Uint32Array]';\n\t\n\t/** Used to identify `toStringTag` values of typed arrays. */\n\tvar typedArrayTags = {};\n\ttypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n\ttypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n\ttypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n\ttypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n\ttypedArrayTags[uint32Tag] = true;\n\ttypedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =\n\ttypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n\ttypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n\ttypedArrayTags[errorTag] = typedArrayTags[funcTag$1] =\n\ttypedArrayTags[mapTag] = typedArrayTags[numberTag] =\n\ttypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n\ttypedArrayTags[setTag] = typedArrayTags[stringTag] =\n\ttypedArrayTags[weakMapTag] = false;\n\t\n\t/**\n\t * The base implementation of `_.isTypedArray` without Node.js optimizations.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n\t */\n\tfunction baseIsTypedArray(value) {\n\t return isObjectLike(value) &&\n\t isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n\t}\n\t\n\t/**\n\t * The base implementation of `_.unary` without support for storing metadata.\n\t *\n\t * @private\n\t * @param {Function} func The function to cap arguments for.\n\t * @returns {Function} Returns the new capped function.\n\t */\n\tfunction baseUnary(func) {\n\t return function(value) {\n\t return func(value);\n\t };\n\t}\n\t\n\t/** Detect free variable `exports`. */\n\tvar freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\t\n\t/** Detect free variable `module`. */\n\tvar freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;\n\t\n\t/** Detect the popular CommonJS extension `module.exports`. */\n\tvar moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;\n\t\n\t/** Detect free variable `process` from Node.js. */\n\tvar freeProcess = moduleExports$1 && freeGlobal.process;\n\t\n\t/** Used to access faster Node.js helpers. */\n\tvar nodeUtil = (function() {\n\t try {\n\t return freeProcess && freeProcess.binding && freeProcess.binding('util');\n\t } catch (e) {}\n\t}());\n\t\n\t/* Node.js helper references. */\n\tvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\t\n\t/**\n\t * Checks if `value` is classified as a typed array.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 3.0.0\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n\t * @example\n\t *\n\t * _.isTypedArray(new Uint8Array);\n\t * // => true\n\t *\n\t * _.isTypedArray([]);\n\t * // => false\n\t */\n\tvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto$2 = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty$1 = objectProto$2.hasOwnProperty;\n\t\n\t/**\n\t * Creates an array of the enumerable property names of the array-like `value`.\n\t *\n\t * @private\n\t * @param {*} value The value to query.\n\t * @param {boolean} inherited Specify returning inherited property names.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction arrayLikeKeys(value, inherited) {\n\t var isArr = isArray(value),\n\t isArg = !isArr && isArguments(value),\n\t isBuff = !isArr && !isArg && isBuffer(value),\n\t isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n\t skipIndexes = isArr || isArg || isBuff || isType,\n\t result = skipIndexes ? baseTimes(value.length, String) : [],\n\t length = result.length;\n\t\n\t for (var key in value) {\n\t if ((inherited || hasOwnProperty$1.call(value, key)) &&\n\t !(skipIndexes && (\n\t // Safari 9 has enumerable `arguments.length` in strict mode.\n\t key == 'length' ||\n\t // Node.js 0.10 has enumerable non-index properties on buffers.\n\t (isBuff && (key == 'offset' || key == 'parent')) ||\n\t // PhantomJS 2 has enumerable non-index properties on typed arrays.\n\t (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n\t // Skip index properties.\n\t isIndex(key, length)\n\t ))) {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto$5 = Object.prototype;\n\t\n\t/**\n\t * Checks if `value` is likely a prototype object.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n\t */\n\tfunction isPrototype(value) {\n\t var Ctor = value && value.constructor,\n\t proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;\n\t\n\t return value === proto;\n\t}\n\t\n\t/**\n\t * Creates a unary function that invokes `func` with its argument transformed.\n\t *\n\t * @private\n\t * @param {Function} func The function to wrap.\n\t * @param {Function} transform The argument transform.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction overArg(func, transform) {\n\t return function(arg) {\n\t return func(transform(arg));\n\t };\n\t}\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeKeys = overArg(Object.keys, Object);\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto$4 = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty$3 = objectProto$4.hasOwnProperty;\n\t\n\t/**\n\t * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction baseKeys(object) {\n\t if (!isPrototype(object)) {\n\t return nativeKeys(object);\n\t }\n\t var result = [];\n\t for (var key in Object(object)) {\n\t if (hasOwnProperty$3.call(object, key) && key != 'constructor') {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Creates an array of the own enumerable property names of `object`.\n\t *\n\t * **Note:** Non-object values are coerced to objects. See the\n\t * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n\t * for more details.\n\t *\n\t * @static\n\t * @since 0.1.0\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.keys(new Foo);\n\t * // => ['a', 'b'] (iteration order is not guaranteed)\n\t *\n\t * _.keys('hi');\n\t * // => ['0', '1']\n\t */\n\tfunction keys(object) {\n\t return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n\t}\n\t\n\tfunction createArrayIterator(coll) {\n\t var i = -1;\n\t var len = coll.length;\n\t return function next() {\n\t return ++i < len ? {value: coll[i], key: i} : null;\n\t }\n\t}\n\t\n\tfunction createES2015Iterator(iterator) {\n\t var i = -1;\n\t return function next() {\n\t var item = iterator.next();\n\t if (item.done)\n\t { return null; }\n\t i++;\n\t return {value: item.value, key: i};\n\t }\n\t}\n\t\n\tfunction createObjectIterator(obj) {\n\t var okeys = keys(obj);\n\t var i = -1;\n\t var len = okeys.length;\n\t return function next() {\n\t var key = okeys[++i];\n\t return i < len ? {value: obj[key], key: key} : null;\n\t };\n\t}\n\t\n\tfunction iterator(coll) {\n\t if (isArrayLike(coll)) {\n\t return createArrayIterator(coll);\n\t }\n\t\n\t var iterator = getIterator(coll);\n\t return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n\t}\n\t\n\tfunction onlyOnce(fn) {\n\t return function() {\n\t if (fn === null) { throw new Error(\"Callback was already called.\"); }\n\t var callFn = fn;\n\t fn = null;\n\t callFn.apply(this, arguments);\n\t };\n\t}\n\t\n\tfunction _eachOfLimit(limit) {\n\t return function (obj, iteratee, callback) {\n\t callback = once(callback || noop);\n\t if (limit <= 0 || !obj) {\n\t return callback(null);\n\t }\n\t var nextElem = iterator(obj);\n\t var done = false;\n\t var running = 0;\n\t\n\t function iterateeCallback(err, value) {\n\t running -= 1;\n\t if (err) {\n\t done = true;\n\t callback(err);\n\t }\n\t else if (value === breakLoop || (done && running <= 0)) {\n\t done = true;\n\t return callback(null);\n\t }\n\t else {\n\t replenish();\n\t }\n\t }\n\t\n\t function replenish () {\n\t while (running < limit && !done) {\n\t var elem = nextElem();\n\t if (elem === null) {\n\t done = true;\n\t if (running <= 0) {\n\t callback(null);\n\t }\n\t return;\n\t }\n\t running += 1;\n\t iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));\n\t }\n\t }\n\t\n\t replenish();\n\t };\n\t}\n\t\n\t/**\n\t * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a\n\t * time.\n\t *\n\t * @name eachOfLimit\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.eachOf]{@link module:Collections.eachOf}\n\t * @alias forEachOfLimit\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {number} limit - The maximum number of async operations at a time.\n\t * @param {Function} iteratee - A function to apply to each\n\t * item in `coll`. The `key` is the item's key, or index in the case of an\n\t * array. The iteratee is passed a `callback(err)` which must be called once it\n\t * has completed. If no error has occurred, the callback should be run without\n\t * arguments or with an explicit `null` argument. Invoked with\n\t * (item, key, callback).\n\t * @param {Function} [callback] - A callback which is called when all\n\t * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n\t */\n\tfunction eachOfLimit(coll, limit, iteratee, callback) {\n\t _eachOfLimit(limit)(coll, iteratee, callback);\n\t}\n\t\n\tfunction doLimit(fn, limit) {\n\t return function (iterable, iteratee, callback) {\n\t return fn(iterable, limit, iteratee, callback);\n\t };\n\t}\n\t\n\t// eachOf implementation optimized for array-likes\n\tfunction eachOfArrayLike(coll, iteratee, callback) {\n\t callback = once(callback || noop);\n\t var index = 0,\n\t completed = 0,\n\t length = coll.length;\n\t if (length === 0) {\n\t callback(null);\n\t }\n\t\n\t function iteratorCallback(err, value) {\n\t if (err) {\n\t callback(err);\n\t } else if ((++completed === length) || value === breakLoop) {\n\t callback(null);\n\t }\n\t }\n\t\n\t for (; index < length; index++) {\n\t iteratee(coll[index], index, onlyOnce(iteratorCallback));\n\t }\n\t}\n\t\n\t// a generic version of eachOf which can handle array, object, and iterator cases.\n\tvar eachOfGeneric = doLimit(eachOfLimit, Infinity);\n\t\n\t/**\n\t * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n\t * to the iteratee.\n\t *\n\t * @name eachOf\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @alias forEachOf\n\t * @category Collection\n\t * @see [async.each]{@link module:Collections.each}\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A function to apply to each\n\t * item in `coll`. The `key` is the item's key, or index in the case of an\n\t * array. The iteratee is passed a `callback(err)` which must be called once it\n\t * has completed. If no error has occurred, the callback should be run without\n\t * arguments or with an explicit `null` argument. Invoked with\n\t * (item, key, callback).\n\t * @param {Function} [callback] - A callback which is called when all\n\t * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n\t * @example\n\t *\n\t * var obj = {dev: \"/dev.json\", test: \"/test.json\", prod: \"/prod.json\"};\n\t * var configs = {};\n\t *\n\t * async.forEachOf(obj, function (value, key, callback) {\n\t * fs.readFile(__dirname + value, \"utf8\", function (err, data) {\n\t * if (err) return callback(err);\n\t * try {\n\t * configs[key] = JSON.parse(data);\n\t * } catch (e) {\n\t * return callback(e);\n\t * }\n\t * callback();\n\t * });\n\t * }, function (err) {\n\t * if (err) console.error(err.message);\n\t * // configs is now a map of JSON data\n\t * doSomethingWith(configs);\n\t * });\n\t */\n\tvar eachOf = function(coll, iteratee, callback) {\n\t var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;\n\t eachOfImplementation(coll, iteratee, callback);\n\t};\n\t\n\tfunction doParallel(fn) {\n\t return function (obj, iteratee, callback) {\n\t return fn(eachOf, obj, iteratee, callback);\n\t };\n\t}\n\t\n\tfunction _asyncMap(eachfn, arr, iteratee, callback) {\n\t callback = callback || noop;\n\t arr = arr || [];\n\t var results = [];\n\t var counter = 0;\n\t\n\t eachfn(arr, function (value, _, callback) {\n\t var index = counter++;\n\t iteratee(value, function (err, v) {\n\t results[index] = v;\n\t callback(err);\n\t });\n\t }, function (err) {\n\t callback(err, results);\n\t });\n\t}\n\t\n\t/**\n\t * Produces a new collection of values by mapping each value in `coll` through\n\t * the `iteratee` function. The `iteratee` is called with an item from `coll`\n\t * and a callback for when it has finished processing. Each of these callback\n\t * takes 2 arguments: an `error`, and the transformed item from `coll`. If\n\t * `iteratee` passes an error to its callback, the main `callback` (for the\n\t * `map` function) is immediately called with the error.\n\t *\n\t * Note, that since this function applies the `iteratee` to each item in\n\t * parallel, there is no guarantee that the `iteratee` functions will complete\n\t * in order. However, the results array will be in the same order as the\n\t * original `coll`.\n\t *\n\t * If `map` is passed an Object, the results will be an Array. The results\n\t * will roughly be in the order of the original Objects' keys (but this can\n\t * vary across JavaScript engines)\n\t *\n\t * @name map\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A function to apply to each item in `coll`.\n\t * The iteratee is passed a `callback(err, transformed)` which must be called\n\t * once it has completed with an error (which can be `null`) and a\n\t * transformed item. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called when all `iteratee`\n\t * functions have finished, or an error occurs. Results is an Array of the\n\t * transformed items from the `coll`. Invoked with (err, results).\n\t * @example\n\t *\n\t * async.map(['file1','file2','file3'], fs.stat, function(err, results) {\n\t * // results is now an array of stats for each file\n\t * });\n\t */\n\tvar map = doParallel(_asyncMap);\n\t\n\t/**\n\t * Applies the provided arguments to each function in the array, calling\n\t * `callback` after all functions have completed. If you only provide the first\n\t * argument, `fns`, then it will return a function which lets you pass in the\n\t * arguments as if it were a single function call. If more arguments are\n\t * provided, `callback` is required while `args` is still optional.\n\t *\n\t * @name applyEach\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @category Control Flow\n\t * @param {Array|Iterable|Object} fns - A collection of asynchronous functions\n\t * to all call with the same arguments\n\t * @param {...*} [args] - any number of separate arguments to pass to the\n\t * function.\n\t * @param {Function} [callback] - the final argument should be the callback,\n\t * called when all functions have completed processing.\n\t * @returns {Function} - If only the first argument, `fns`, is provided, it will\n\t * return a function which lets you pass in the arguments as if it were a single\n\t * function call. The signature is `(..args, callback)`. If invoked with any\n\t * arguments, `callback` is required.\n\t * @example\n\t *\n\t * async.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\t *\n\t * // partial application example:\n\t * async.each(\n\t * buckets,\n\t * async.applyEach([enableSearch, updateSchema]),\n\t * callback\n\t * );\n\t */\n\tapplyEach$1(map);\n\t\n\tfunction doParallelLimit(fn) {\n\t return function (obj, limit, iteratee, callback) {\n\t return fn(_eachOfLimit(limit), obj, iteratee, callback);\n\t };\n\t}\n\t\n\t/**\n\t * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.\n\t *\n\t * @name mapLimit\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.map]{@link module:Collections.map}\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {number} limit - The maximum number of async operations at a time.\n\t * @param {Function} iteratee - A function to apply to each item in `coll`.\n\t * The iteratee is passed a `callback(err, transformed)` which must be called\n\t * once it has completed with an error (which can be `null`) and a transformed\n\t * item. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called when all `iteratee`\n\t * functions have finished, or an error occurs. Results is an array of the\n\t * transformed items from the `coll`. Invoked with (err, results).\n\t */\n\tvar mapLimit = doParallelLimit(_asyncMap);\n\t\n\t/**\n\t * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.\n\t *\n\t * @name mapSeries\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.map]{@link module:Collections.map}\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A function to apply to each item in `coll`.\n\t * The iteratee is passed a `callback(err, transformed)` which must be called\n\t * once it has completed with an error (which can be `null`) and a\n\t * transformed item. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called when all `iteratee`\n\t * functions have finished, or an error occurs. Results is an array of the\n\t * transformed items from the `coll`. Invoked with (err, results).\n\t */\n\tvar mapSeries = doLimit(mapLimit, 1);\n\t\n\t/**\n\t * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.\n\t *\n\t * @name applyEachSeries\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @see [async.applyEach]{@link module:ControlFlow.applyEach}\n\t * @category Control Flow\n\t * @param {Array|Iterable|Object} fns - A collection of asynchronous functions to all\n\t * call with the same arguments\n\t * @param {...*} [args] - any number of separate arguments to pass to the\n\t * function.\n\t * @param {Function} [callback] - the final argument should be the callback,\n\t * called when all functions have completed processing.\n\t * @returns {Function} - If only the first argument is provided, it will return\n\t * a function which lets you pass in the arguments as if it were a single\n\t * function call.\n\t */\n\tapplyEach$1(mapSeries);\n\t\n\t/**\n\t * Creates a continuation function with some arguments already applied.\n\t *\n\t * Useful as a shorthand when combined with other control flow functions. Any\n\t * arguments passed to the returned function are added to the arguments\n\t * originally passed to apply.\n\t *\n\t * @name apply\n\t * @static\n\t * @memberOf module:Utils\n\t * @method\n\t * @category Util\n\t * @param {Function} function - The function you want to eventually apply all\n\t * arguments to. Invokes with (arguments...).\n\t * @param {...*} arguments... - Any number of arguments to automatically apply\n\t * when the continuation is called.\n\t * @example\n\t *\n\t * // using apply\n\t * async.parallel([\n\t * async.apply(fs.writeFile, 'testfile1', 'test1'),\n\t * async.apply(fs.writeFile, 'testfile2', 'test2')\n\t * ]);\n\t *\n\t *\n\t * // the same process without using apply\n\t * async.parallel([\n\t * function(callback) {\n\t * fs.writeFile('testfile1', 'test1', callback);\n\t * },\n\t * function(callback) {\n\t * fs.writeFile('testfile2', 'test2', callback);\n\t * }\n\t * ]);\n\t *\n\t * // It's possible to pass any number of additional arguments when calling the\n\t * // continuation:\n\t *\n\t * node> var fn = async.apply(sys.puts, 'one');\n\t * node> fn('two', 'three');\n\t * one\n\t * two\n\t * three\n\t */\n\trest(function(fn, args) {\n\t return rest(function(callArgs) {\n\t return fn.apply(null, args.concat(callArgs));\n\t });\n\t});\n\t\n\t/**\n\t * A specialized version of `_.forEach` for arrays without support for\n\t * iteratee shorthands.\n\t *\n\t * @private\n\t * @param {Array} [array] The array to iterate over.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Array} Returns `array`.\n\t */\n\tfunction arrayEach(array, iteratee) {\n\t var index = -1,\n\t length = array == null ? 0 : array.length;\n\t\n\t while (++index < length) {\n\t if (iteratee(array[index], index, array) === false) {\n\t break;\n\t }\n\t }\n\t return array;\n\t}\n\t\n\t/**\n\t * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n\t *\n\t * @private\n\t * @param {boolean} [fromRight] Specify iterating from right to left.\n\t * @returns {Function} Returns the new base function.\n\t */\n\tfunction createBaseFor(fromRight) {\n\t return function(object, iteratee, keysFunc) {\n\t var index = -1,\n\t iterable = Object(object),\n\t props = keysFunc(object),\n\t length = props.length;\n\t\n\t while (length--) {\n\t var key = props[fromRight ? length : ++index];\n\t if (iteratee(iterable[key], key, iterable) === false) {\n\t break;\n\t }\n\t }\n\t return object;\n\t };\n\t}\n\t\n\t/**\n\t * The base implementation of `baseForOwn` which iterates over `object`\n\t * properties returned by `keysFunc` and invokes `iteratee` for each property.\n\t * Iteratee functions may exit iteration early by explicitly returning `false`.\n\t *\n\t * @private\n\t * @param {Object} object The object to iterate over.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @param {Function} keysFunc The function to get the keys of `object`.\n\t * @returns {Object} Returns `object`.\n\t */\n\tvar baseFor = createBaseFor();\n\t\n\t/**\n\t * The base implementation of `_.forOwn` without support for iteratee shorthands.\n\t *\n\t * @private\n\t * @param {Object} object The object to iterate over.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction baseForOwn(object, iteratee) {\n\t return object && baseFor(object, iteratee, keys);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.findIndex` and `_.findLastIndex` without\n\t * support for iteratee shorthands.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {Function} predicate The function invoked per iteration.\n\t * @param {number} fromIndex The index to search from.\n\t * @param {boolean} [fromRight] Specify iterating from right to left.\n\t * @returns {number} Returns the index of the matched value, else `-1`.\n\t */\n\tfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n\t var length = array.length,\n\t index = fromIndex + (fromRight ? 1 : -1);\n\t\n\t while ((fromRight ? index-- : ++index < length)) {\n\t if (predicate(array[index], index, array)) {\n\t return index;\n\t }\n\t }\n\t return -1;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.isNaN` without support for number objects.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n\t */\n\tfunction baseIsNaN(value) {\n\t return value !== value;\n\t}\n\t\n\t/**\n\t * A specialized version of `_.indexOf` which performs strict equality\n\t * comparisons of values, i.e. `===`.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {*} value The value to search for.\n\t * @param {number} fromIndex The index to search from.\n\t * @returns {number} Returns the index of the matched value, else `-1`.\n\t */\n\tfunction strictIndexOf(array, value, fromIndex) {\n\t var index = fromIndex - 1,\n\t length = array.length;\n\t\n\t while (++index < length) {\n\t if (array[index] === value) {\n\t return index;\n\t }\n\t }\n\t return -1;\n\t}\n\t\n\t/**\n\t * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n\t *\n\t * @private\n\t * @param {Array} array The array to inspect.\n\t * @param {*} value The value to search for.\n\t * @param {number} fromIndex The index to search from.\n\t * @returns {number} Returns the index of the matched value, else `-1`.\n\t */\n\tfunction baseIndexOf(array, value, fromIndex) {\n\t return value === value\n\t ? strictIndexOf(array, value, fromIndex)\n\t : baseFindIndex(array, baseIsNaN, fromIndex);\n\t}\n\t\n\t/**\n\t * Determines the best order for running the functions in `tasks`, based on\n\t * their requirements. Each function can optionally depend on other functions\n\t * being completed first, and each function is run as soon as its requirements\n\t * are satisfied.\n\t *\n\t * If any of the functions pass an error to their callback, the `auto` sequence\n\t * will stop. Further tasks will not execute (so any other functions depending\n\t * on it will not run), and the main `callback` is immediately called with the\n\t * error.\n\t *\n\t * Functions also receive an object containing the results of functions which\n\t * have completed so far as the first argument, if they have dependencies. If a\n\t * task function has no dependencies, it will only be passed a callback.\n\t *\n\t * @name auto\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @category Control Flow\n\t * @param {Object} tasks - An object. Each of its properties is either a\n\t * function or an array of requirements, with the function itself the last item\n\t * in the array. The object's key of a property serves as the name of the task\n\t * defined by that property, i.e. can be used when specifying requirements for\n\t * other tasks. The function receives one or two arguments:\n\t * * a `results` object, containing the results of the previously executed\n\t * functions, only passed if the task has any dependencies,\n\t * * a `callback(err, result)` function, which must be called when finished,\n\t * passing an `error` (which can be `null`) and the result of the function's\n\t * execution.\n\t * @param {number} [concurrency=Infinity] - An optional `integer` for\n\t * determining the maximum number of tasks that can be run in parallel. By\n\t * default, as many as possible.\n\t * @param {Function} [callback] - An optional callback which is called when all\n\t * the tasks have been completed. It receives the `err` argument if any `tasks`\n\t * pass an error to their callback. Results are always returned; however, if an\n\t * error occurs, no further `tasks` will be performed, and the results object\n\t * will only contain partial results. Invoked with (err, results).\n\t * @returns undefined\n\t * @example\n\t *\n\t * async.auto({\n\t * // this function will just be passed a callback\n\t * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),\n\t * showData: ['readData', function(results, cb) {\n\t * // results.readData is the file's contents\n\t * // ...\n\t * }]\n\t * }, callback);\n\t *\n\t * async.auto({\n\t * get_data: function(callback) {\n\t * console.log('in get_data');\n\t * // async code to get some data\n\t * callback(null, 'data', 'converted to array');\n\t * },\n\t * make_folder: function(callback) {\n\t * console.log('in make_folder');\n\t * // async code to create a directory to store a file in\n\t * // this is run at the same time as getting the data\n\t * callback(null, 'folder');\n\t * },\n\t * write_file: ['get_data', 'make_folder', function(results, callback) {\n\t * console.log('in write_file', JSON.stringify(results));\n\t * // once there is some data and the directory exists,\n\t * // write the data to a file in the directory\n\t * callback(null, 'filename');\n\t * }],\n\t * email_link: ['write_file', function(results, callback) {\n\t * console.log('in email_link', JSON.stringify(results));\n\t * // once the file is written let's email a link to it...\n\t * // results.write_file contains the filename returned by write_file.\n\t * callback(null, {'file':results.write_file, 'email':'user@example.com'});\n\t * }]\n\t * }, function(err, results) {\n\t * console.log('err = ', err);\n\t * console.log('results = ', results);\n\t * });\n\t */\n\t\n\t/**\n\t * A specialized version of `_.map` for arrays without support for iteratee\n\t * shorthands.\n\t *\n\t * @private\n\t * @param {Array} [array] The array to iterate over.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Array} Returns the new mapped array.\n\t */\n\t\n\t/**\n\t * The base implementation of `_.slice` without an iteratee call guard.\n\t *\n\t * @private\n\t * @param {Array} array The array to slice.\n\t * @param {number} [start=0] The start position.\n\t * @param {number} [end=array.length] The end position.\n\t * @returns {Array} Returns the slice of `array`.\n\t */\n\t\n\t/**\n\t * Converts an ASCII `string` to an array.\n\t *\n\t * @private\n\t * @param {string} string The string to convert.\n\t * @returns {Array} Returns the converted array.\n\t */\n\t\n\t/** Used to compose unicode character classes. */\n\t\n\t/** Used to compose unicode character classes. */\n\tvar rsAstralRange$1 = '\\\\ud800-\\\\udfff';\n\tvar rsComboMarksRange$1 = '\\\\u0300-\\\\u036f';\n\tvar reComboHalfMarksRange$1 = '\\\\ufe20-\\\\ufe2f';\n\tvar rsComboSymbolsRange$1 = '\\\\u20d0-\\\\u20ff';\n\tvar rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;\n\tvar rsVarRange$1 = '\\\\ufe0e\\\\ufe0f';\n\t\n\t/** Used to compose unicode capture groups. */\n\tvar rsAstral = '[' + rsAstralRange$1 + ']';\n\tvar rsCombo = '[' + rsComboRange$1 + ']';\n\tvar rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]';\n\tvar rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')';\n\tvar rsNonAstral = '[^' + rsAstralRange$1 + ']';\n\tvar rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}';\n\tvar rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]';\n\tvar rsZWJ$1 = '\\\\u200d';\n\t\n\t/** Used to compose unicode regexes. */\n\tvar reOptMod = rsModifier + '?';\n\tvar rsOptVar = '[' + rsVarRange$1 + ']?';\n\tvar rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*';\n\tvar rsSeq = rsOptVar + reOptMod + rsOptJoin;\n\tvar rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\t\n\tvar hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\n\tvar hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\n\t\n\tfunction fallback(fn) {\n\t setTimeout(fn, 0);\n\t}\n\t\n\tfunction wrap(defer) {\n\t return rest(function (fn, args) {\n\t defer(function () {\n\t fn.apply(null, args);\n\t });\n\t });\n\t}\n\t\n\tvar _defer;\n\t\n\tif (hasSetImmediate) {\n\t _defer = setImmediate;\n\t} else if (hasNextTick) {\n\t _defer = process.nextTick;\n\t} else {\n\t _defer = fallback;\n\t}\n\t\n\twrap(_defer);\n\t\n\t// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation\n\t// used for queues. This implementation assumes that the node provided by the user can be modified\n\t// to adjust the next and last properties. We implement only the minimal functionality\n\t// for queue support.\n\t\n\t/**\n\t * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.\n\t *\n\t * @name eachOfSeries\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.eachOf]{@link module:Collections.eachOf}\n\t * @alias forEachOfSeries\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A function to apply to each item in `coll`. The\n\t * `key` is the item's key, or index in the case of an array. The iteratee is\n\t * passed a `callback(err)` which must be called once it has completed. If no\n\t * error has occurred, the callback should be run without arguments or with an\n\t * explicit `null` argument. Invoked with (item, key, callback).\n\t * @param {Function} [callback] - A callback which is called when all `iteratee`\n\t * functions have finished, or an error occurs. Invoked with (err).\n\t */\n\tvar eachOfSeries = doLimit(eachOfLimit, 1);\n\t\n\t/**\n\t * Reduces `coll` into a single value using an async `iteratee` to return each\n\t * successive step. `memo` is the initial state of the reduction. This function\n\t * only operates in series.\n\t *\n\t * For performance reasons, it may make sense to split a call to this function\n\t * into a parallel map, and then use the normal `Array.prototype.reduce` on the\n\t * results. This function is for situations where each step in the reduction\n\t * needs to be async; if you can get the data before reducing it, then it's\n\t * probably a good idea to do so.\n\t *\n\t * @name reduce\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @alias inject\n\t * @alias foldl\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {*} memo - The initial state of the reduction.\n\t * @param {Function} iteratee - A function applied to each item in the\n\t * array to produce the next step in the reduction. The `iteratee` is passed a\n\t * `callback(err, reduction)` which accepts an optional error as its first\n\t * argument, and the state of the reduction as the second. If an error is\n\t * passed to the callback, the reduction is stopped and the main `callback` is\n\t * immediately called with the error. Invoked with (memo, item, callback).\n\t * @param {Function} [callback] - A callback which is called after all the\n\t * `iteratee` functions have finished. Result is the reduced value. Invoked with\n\t * (err, result).\n\t * @example\n\t *\n\t * async.reduce([1,2,3], 0, function(memo, item, callback) {\n\t * // pointless async:\n\t * process.nextTick(function() {\n\t * callback(null, memo + item)\n\t * });\n\t * }, function(err, result) {\n\t * // result is now equal to the last value of memo, which is 6\n\t * });\n\t */\n\tfunction reduce(coll, memo, iteratee, callback) {\n\t callback = once(callback || noop);\n\t eachOfSeries(coll, function(x, i, callback) {\n\t iteratee(memo, x, function(err, v) {\n\t memo = v;\n\t callback(err);\n\t });\n\t }, function(err) {\n\t callback(err, memo);\n\t });\n\t}\n\t\n\t/**\n\t * Version of the compose function that is more natural to read. Each function\n\t * consumes the return value of the previous function. It is the equivalent of\n\t * [compose]{@link module:ControlFlow.compose} with the arguments reversed.\n\t *\n\t * Each function is executed with the `this` binding of the composed function.\n\t *\n\t * @name seq\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @see [async.compose]{@link module:ControlFlow.compose}\n\t * @category Control Flow\n\t * @param {...Function} functions - the asynchronous functions to compose\n\t * @returns {Function} a function that composes the `functions` in order\n\t * @example\n\t *\n\t * // Requires lodash (or underscore), express3 and dresende's orm2.\n\t * // Part of an app, that fetches cats of the logged user.\n\t * // This example uses `seq` function to avoid overnesting and error\n\t * // handling clutter.\n\t * app.get('/cats', function(request, response) {\n\t * var User = request.models.User;\n\t * async.seq(\n\t * _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))\n\t * function(user, fn) {\n\t * user.getCats(fn); // 'getCats' has signature (callback(err, data))\n\t * }\n\t * )(req.session.user_id, function (err, cats) {\n\t * if (err) {\n\t * console.error(err);\n\t * response.json({ status: 'error', message: err.message });\n\t * } else {\n\t * response.json({ status: 'ok', message: 'Cats found', data: cats });\n\t * }\n\t * });\n\t * });\n\t */\n\tvar seq = rest(function seq(functions) {\n\t return rest(function(args) {\n\t var that = this;\n\t\n\t var cb = args[args.length - 1];\n\t if (typeof cb == 'function') {\n\t args.pop();\n\t } else {\n\t cb = noop;\n\t }\n\t\n\t reduce(functions, args, function(newargs, fn, cb) {\n\t fn.apply(that, newargs.concat(rest(function(err, nextargs) {\n\t cb(err, nextargs);\n\t })));\n\t },\n\t function(err, results) {\n\t cb.apply(that, [err].concat(results));\n\t });\n\t });\n\t});\n\t\n\t/**\n\t * Creates a function which is a composition of the passed asynchronous\n\t * functions. Each function consumes the return value of the function that\n\t * follows. Composing functions `f()`, `g()`, and `h()` would produce the result\n\t * of `f(g(h()))`, only this version uses callbacks to obtain the return values.\n\t *\n\t * Each function is executed with the `this` binding of the composed function.\n\t *\n\t * @name compose\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @category Control Flow\n\t * @param {...Function} functions - the asynchronous functions to compose\n\t * @returns {Function} an asynchronous function that is the composed\n\t * asynchronous `functions`\n\t * @example\n\t *\n\t * function add1(n, callback) {\n\t * setTimeout(function () {\n\t * callback(null, n + 1);\n\t * }, 10);\n\t * }\n\t *\n\t * function mul3(n, callback) {\n\t * setTimeout(function () {\n\t * callback(null, n * 3);\n\t * }, 10);\n\t * }\n\t *\n\t * var add1mul3 = async.compose(mul3, add1);\n\t * add1mul3(4, function (err, result) {\n\t * // result now equals 15\n\t * });\n\t */\n\trest(function(args) {\n\t return seq.apply(null, args.reverse());\n\t});\n\t\n\t/**\n\t * Applies `iteratee` to each item in `coll`, concatenating the results. Returns\n\t * the concatenated list. The `iteratee`s are called in parallel, and the\n\t * results are concatenated as they return. There is no guarantee that the\n\t * results array will be returned in the original order of `coll` passed to the\n\t * `iteratee` function.\n\t *\n\t * @name concat\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A function to apply to each item in `coll`.\n\t * The iteratee is passed a `callback(err, results)` which must be called once\n\t * it has completed with an error (which can be `null`) and an array of results.\n\t * Invoked with (item, callback).\n\t * @param {Function} [callback(err)] - A callback which is called after all the\n\t * `iteratee` functions have finished, or an error occurs. Results is an array\n\t * containing the concatenated results of the `iteratee` function. Invoked with\n\t * (err, results).\n\t * @example\n\t *\n\t * async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files) {\n\t * // files is now a list of filenames that exist in the 3 directories\n\t * });\n\t */\n\t\n\t/**\n\t * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time.\n\t *\n\t * @name concatSeries\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.concat]{@link module:Collections.concat}\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A function to apply to each item in `coll`.\n\t * The iteratee is passed a `callback(err, results)` which must be called once\n\t * it has completed with an error (which can be `null`) and an array of results.\n\t * Invoked with (item, callback).\n\t * @param {Function} [callback(err)] - A callback which is called after all the\n\t * `iteratee` functions have finished, or an error occurs. Results is an array\n\t * containing the concatenated results of the `iteratee` function. Invoked with\n\t * (err, results).\n\t */\n\t\n\t/**\n\t * Returns a function that when called, calls-back with the values provided.\n\t * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to\n\t * [`auto`]{@link module:ControlFlow.auto}.\n\t *\n\t * @name constant\n\t * @static\n\t * @memberOf module:Utils\n\t * @method\n\t * @category Util\n\t * @param {...*} arguments... - Any number of arguments to automatically invoke\n\t * callback with.\n\t * @returns {Function} Returns a function that when invoked, automatically\n\t * invokes the callback with the previous given arguments.\n\t * @example\n\t *\n\t * async.waterfall([\n\t * async.constant(42),\n\t * function (value, next) {\n\t * // value === 42\n\t * },\n\t * //...\n\t * ], callback);\n\t *\n\t * async.waterfall([\n\t * async.constant(filename, \"utf8\"),\n\t * fs.readFile,\n\t * function (fileData, next) {\n\t * //...\n\t * }\n\t * //...\n\t * ], callback);\n\t *\n\t * async.auto({\n\t * hostname: async.constant(\"https://server.net/\"),\n\t * port: findFreePort,\n\t * launchServer: [\"hostname\", \"port\", function (options, cb) {\n\t * startServer(options, cb);\n\t * }],\n\t * //...\n\t * }, callback);\n\t */\n\trest(function(values) {\n\t var args = [null].concat(values);\n\t return initialParams(function (ignoredArgs, callback) {\n\t return callback.apply(this, args);\n\t });\n\t});\n\t\n\t/**\n\t * Returns the first value in `coll` that passes an async truth test. The\n\t * `iteratee` is applied in parallel, meaning the first iteratee to return\n\t * `true` will fire the detect `callback` with that result. That means the\n\t * result might not be the first item in the original `coll` (in terms of order)\n\t * that passes the test.\n\t\n\t * If order within the original `coll` is important, then look at\n\t * [`detectSeries`]{@link module:Collections.detectSeries}.\n\t *\n\t * @name detect\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @alias find\n\t * @category Collections\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n\t * The iteratee is passed a `callback(err, truthValue)` which must be called\n\t * with a boolean argument once it has completed. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called as soon as any\n\t * iteratee returns `true`, or after all the `iteratee` functions have finished.\n\t * Result will be the first item in the array that passes the truth test\n\t * (iteratee) or the value `undefined` if none passed. Invoked with\n\t * (err, result).\n\t * @example\n\t *\n\t * async.detect(['file1','file2','file3'], function(filePath, callback) {\n\t * fs.access(filePath, function(err) {\n\t * callback(null, !err)\n\t * });\n\t * }, function(err, result) {\n\t * // result now equals the first file in the list that exists\n\t * });\n\t */\n\t\n\t/**\n\t * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a\n\t * time.\n\t *\n\t * @name detectLimit\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.detect]{@link module:Collections.detect}\n\t * @alias findLimit\n\t * @category Collections\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {number} limit - The maximum number of async operations at a time.\n\t * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n\t * The iteratee is passed a `callback(err, truthValue)` which must be called\n\t * with a boolean argument once it has completed. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called as soon as any\n\t * iteratee returns `true`, or after all the `iteratee` functions have finished.\n\t * Result will be the first item in the array that passes the truth test\n\t * (iteratee) or the value `undefined` if none passed. Invoked with\n\t * (err, result).\n\t */\n\t\n\t/**\n\t * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.\n\t *\n\t * @name detectSeries\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.detect]{@link module:Collections.detect}\n\t * @alias findSeries\n\t * @category Collections\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n\t * The iteratee is passed a `callback(err, truthValue)` which must be called\n\t * with a boolean argument once it has completed. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called as soon as any\n\t * iteratee returns `true`, or after all the `iteratee` functions have finished.\n\t * Result will be the first item in the array that passes the truth test\n\t * (iteratee) or the value `undefined` if none passed. Invoked with\n\t * (err, result).\n\t */\n\t\n\tfunction consoleFunc(name) {\n\t return rest(function (fn, args) {\n\t fn.apply(null, args.concat(rest(function (err, args) {\n\t if (typeof console === 'object') {\n\t if (err) {\n\t if (console.error) {\n\t console.error(err);\n\t }\n\t }\n\t else if (console[name]) {\n\t arrayEach(args, function (x) {\n\t console[name](x);\n\t });\n\t }\n\t }\n\t })));\n\t });\n\t}\n\t\n\t/**\n\t * Logs the result of an `async` function to the `console` using `console.dir`\n\t * to display the properties of the resulting object. Only works in Node.js or\n\t * in browsers that support `console.dir` and `console.error` (such as FF and\n\t * Chrome). If multiple arguments are returned from the async function,\n\t * `console.dir` is called on each argument in order.\n\t *\n\t * @name dir\n\t * @static\n\t * @memberOf module:Utils\n\t * @method\n\t * @category Util\n\t * @param {Function} function - The function you want to eventually apply all\n\t * arguments to.\n\t * @param {...*} arguments... - Any number of arguments to apply to the function.\n\t * @example\n\t *\n\t * // in a module\n\t * var hello = function(name, callback) {\n\t * setTimeout(function() {\n\t * callback(null, {hello: name});\n\t * }, 1000);\n\t * };\n\t *\n\t * // in the node repl\n\t * node> async.dir(hello, 'world');\n\t * {hello: 'world'}\n\t */\n\tconsoleFunc('dir');\n\t\n\tfunction _withoutIndex(iteratee) {\n\t return function (value, index, callback) {\n\t return iteratee(value, callback);\n\t };\n\t}\n\t\n\t/**\n\t * Applies the function `iteratee` to each item in `coll`, in parallel.\n\t * The `iteratee` is called with an item from the list, and a callback for when\n\t * it has finished. If the `iteratee` passes an error to its `callback`, the\n\t * main `callback` (for the `each` function) is immediately called with the\n\t * error.\n\t *\n\t * Note, that since this function applies `iteratee` to each item in parallel,\n\t * there is no guarantee that the iteratee functions will complete in order.\n\t *\n\t * @name each\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @alias forEach\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A function to apply to each item\n\t * in `coll`. The iteratee is passed a `callback(err)` which must be called once\n\t * it has completed. If no error has occurred, the `callback` should be run\n\t * without arguments or with an explicit `null` argument. The array index is not\n\t * passed to the iteratee. Invoked with (item, callback). If you need the index,\n\t * use `eachOf`.\n\t * @param {Function} [callback] - A callback which is called when all\n\t * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n\t * @example\n\t *\n\t * // assuming openFiles is an array of file names and saveFile is a function\n\t * // to save the modified contents of that file:\n\t *\n\t * async.each(openFiles, saveFile, function(err){\n\t * // if any of the saves produced an error, err would equal that error\n\t * });\n\t *\n\t * // assuming openFiles is an array of file names\n\t * async.each(openFiles, function(file, callback) {\n\t *\n\t * // Perform operation on file here.\n\t * console.log('Processing file ' + file);\n\t *\n\t * if( file.length > 32 ) {\n\t * console.log('This file name is too long');\n\t * callback('File name too long');\n\t * } else {\n\t * // Do work to process file here\n\t * console.log('File processed');\n\t * callback();\n\t * }\n\t * }, function(err) {\n\t * // if any of the file processing produced an error, err would equal that error\n\t * if( err ) {\n\t * // One of the iterations produced an error.\n\t * // All processing will now stop.\n\t * console.log('A file failed to process');\n\t * } else {\n\t * console.log('All files have been processed successfully');\n\t * }\n\t * });\n\t */\n\tfunction eachLimit(coll, iteratee, callback) {\n\t eachOf(coll, _withoutIndex(iteratee), callback);\n\t}\n\t\n\t/**\n\t * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.\n\t *\n\t * @name eachSeries\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.each]{@link module:Collections.each}\n\t * @alias forEachSeries\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A function to apply to each\n\t * item in `coll`. The iteratee is passed a `callback(err)` which must be called\n\t * once it has completed. If no error has occurred, the `callback` should be run\n\t * without arguments or with an explicit `null` argument. The array index is\n\t * not passed to the iteratee. Invoked with (item, callback). If you need the\n\t * index, use `eachOfSeries`.\n\t * @param {Function} [callback] - A callback which is called when all\n\t * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n\t */\n\t\n\t/**\n\t * Returns `true` if every element in `coll` satisfies an async test. If any\n\t * iteratee call returns `false`, the main `callback` is immediately called.\n\t *\n\t * @name every\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @alias all\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A truth test to apply to each item in the\n\t * collection in parallel. The iteratee is passed a `callback(err, truthValue)`\n\t * which must be called with a boolean argument once it has completed. Invoked\n\t * with (item, callback).\n\t * @param {Function} [callback] - A callback which is called after all the\n\t * `iteratee` functions have finished. Result will be either `true` or `false`\n\t * depending on the values of the async tests. Invoked with (err, result).\n\t * @example\n\t *\n\t * async.every(['file1','file2','file3'], function(filePath, callback) {\n\t * fs.access(filePath, function(err) {\n\t * callback(null, !err)\n\t * });\n\t * }, function(err, result) {\n\t * // if result is true then every file exists\n\t * });\n\t */\n\t\n\t/**\n\t * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.\n\t *\n\t * @name everyLimit\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.every]{@link module:Collections.every}\n\t * @alias allLimit\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {number} limit - The maximum number of async operations at a time.\n\t * @param {Function} iteratee - A truth test to apply to each item in the\n\t * collection in parallel. The iteratee is passed a `callback(err, truthValue)`\n\t * which must be called with a boolean argument once it has completed. Invoked\n\t * with (item, callback).\n\t * @param {Function} [callback] - A callback which is called after all the\n\t * `iteratee` functions have finished. Result will be either `true` or `false`\n\t * depending on the values of the async tests. Invoked with (err, result).\n\t */\n\t\n\t/**\n\t * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.\n\t *\n\t * @name everySeries\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.every]{@link module:Collections.every}\n\t * @alias allSeries\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A truth test to apply to each item in the\n\t * collection in parallel. The iteratee is passed a `callback(err, truthValue)`\n\t * which must be called with a boolean argument once it has completed. Invoked\n\t * with (item, callback).\n\t * @param {Function} [callback] - A callback which is called after all the\n\t * `iteratee` functions have finished. Result will be either `true` or `false`\n\t * depending on the values of the async tests. Invoked with (err, result).\n\t */\n\t\n\t/**\n\t * The base implementation of `_.property` without support for deep paths.\n\t *\n\t * @private\n\t * @param {string} key The key of the property to get.\n\t * @returns {Function} Returns the new accessor function.\n\t */\n\t\n\t/**\n\t * Returns a new array of all the values in `coll` which pass an async truth\n\t * test. This operation is performed in parallel, but the results array will be\n\t * in the same order as the original.\n\t *\n\t * @name filter\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @alias select\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n\t * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n\t * with a boolean argument once it has completed. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called after all the\n\t * `iteratee` functions have finished. Invoked with (err, results).\n\t * @example\n\t *\n\t * async.filter(['file1','file2','file3'], function(filePath, callback) {\n\t * fs.access(filePath, function(err) {\n\t * callback(null, !err)\n\t * });\n\t * }, function(err, results) {\n\t * // results now equals an array of the existing files\n\t * });\n\t */\n\t\n\t/**\n\t * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a\n\t * time.\n\t *\n\t * @name filterLimit\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.filter]{@link module:Collections.filter}\n\t * @alias selectLimit\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {number} limit - The maximum number of async operations at a time.\n\t * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n\t * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n\t * with a boolean argument once it has completed. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called after all the\n\t * `iteratee` functions have finished. Invoked with (err, results).\n\t */\n\t\n\t/**\n\t * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.\n\t *\n\t * @name filterSeries\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.filter]{@link module:Collections.filter}\n\t * @alias selectSeries\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n\t * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n\t * with a boolean argument once it has completed. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called after all the\n\t * `iteratee` functions have finished. Invoked with (err, results)\n\t */\n\t\n\t/**\n\t * Logs the result of an `async` function to the `console`. Only works in\n\t * Node.js or in browsers that support `console.log` and `console.error` (such\n\t * as FF and Chrome). If multiple arguments are returned from the async\n\t * function, `console.log` is called on each argument in order.\n\t *\n\t * @name log\n\t * @static\n\t * @memberOf module:Utils\n\t * @method\n\t * @category Util\n\t * @param {Function} function - The function you want to eventually apply all\n\t * arguments to.\n\t * @param {...*} arguments... - Any number of arguments to apply to the function.\n\t * @example\n\t *\n\t * // in a module\n\t * var hello = function(name, callback) {\n\t * setTimeout(function() {\n\t * callback(null, 'hello ' + name);\n\t * }, 1000);\n\t * };\n\t *\n\t * // in the node repl\n\t * node> async.log(hello, 'world');\n\t * 'hello world'\n\t */\n\tconsoleFunc('log');\n\t\n\t/**\n\t * A relative of [`map`]{@link module:Collections.map}, designed for use with objects.\n\t *\n\t * Produces a new Object by mapping each value of `obj` through the `iteratee`\n\t * function. The `iteratee` is called each `value` and `key` from `obj` and a\n\t * callback for when it has finished processing. Each of these callbacks takes\n\t * two arguments: an `error`, and the transformed item from `obj`. If `iteratee`\n\t * passes an error to its callback, the main `callback` (for the `mapValues`\n\t * function) is immediately called with the error.\n\t *\n\t * Note, the order of the keys in the result is not guaranteed. The keys will\n\t * be roughly in the order they complete, (but this is very engine-specific)\n\t *\n\t * @name mapValues\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @category Collection\n\t * @param {Object} obj - A collection to iterate over.\n\t * @param {Function} iteratee - A function to apply to each value and key in\n\t * `coll`. The iteratee is passed a `callback(err, transformed)` which must be\n\t * called once it has completed with an error (which can be `null`) and a\n\t * transformed value. Invoked with (value, key, callback).\n\t * @param {Function} [callback] - A callback which is called when all `iteratee`\n\t * functions have finished, or an error occurs. `result` is a new object consisting\n\t * of each key from `obj`, with each transformed value on the right-hand side.\n\t * Invoked with (err, result).\n\t * @example\n\t *\n\t * async.mapValues({\n\t * f1: 'file1',\n\t * f2: 'file2',\n\t * f3: 'file3'\n\t * }, function (file, key, callback) {\n\t * fs.stat(file, callback);\n\t * }, function(err, result) {\n\t * // result is now a map of stats for each file, e.g.\n\t * // {\n\t * // f1: [stats for file1],\n\t * // f2: [stats for file2],\n\t * // f3: [stats for file3]\n\t * // }\n\t * });\n\t */\n\t\n\t/**\n\t * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.\n\t *\n\t * @name mapValuesSeries\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.mapValues]{@link module:Collections.mapValues}\n\t * @category Collection\n\t * @param {Object} obj - A collection to iterate over.\n\t * @param {Function} iteratee - A function to apply to each value in `obj`.\n\t * The iteratee is passed a `callback(err, transformed)` which must be called\n\t * once it has completed with an error (which can be `null`) and a\n\t * transformed value. Invoked with (value, key, callback).\n\t * @param {Function} [callback] - A callback which is called when all `iteratee`\n\t * functions have finished, or an error occurs. `result` is a new object consisting\n\t * of each key from `obj`, with each transformed value on the right-hand side.\n\t * Invoked with (err, result).\n\t */\n\t\n\t/**\n\t * Calls `callback` on a later loop around the event loop. In Node.js this just\n\t * calls `setImmediate`. In the browser it will use `setImmediate` if\n\t * available, otherwise `setTimeout(callback, 0)`, which means other higher\n\t * priority events may precede the execution of `callback`.\n\t *\n\t * This is used internally for browser-compatibility purposes.\n\t *\n\t * @name nextTick\n\t * @static\n\t * @memberOf module:Utils\n\t * @method\n\t * @alias setImmediate\n\t * @category Util\n\t * @param {Function} callback - The function to call on a later loop around\n\t * the event loop. Invoked with (args...).\n\t * @param {...*} args... - any number of additional arguments to pass to the\n\t * callback on the next tick.\n\t * @example\n\t *\n\t * var call_order = [];\n\t * async.nextTick(function() {\n\t * call_order.push('two');\n\t * // call_order now equals ['one','two']\n\t * });\n\t * call_order.push('one');\n\t *\n\t * async.setImmediate(function (a, b, c) {\n\t * // a, b, and c equal 1, 2, and 3\n\t * }, 1, 2, 3);\n\t */\n\tvar _defer$1;\n\t\n\tif (hasNextTick) {\n\t _defer$1 = process.nextTick;\n\t} else if (hasSetImmediate) {\n\t _defer$1 = setImmediate;\n\t} else {\n\t _defer$1 = fallback;\n\t}\n\t\n\twrap(_defer$1);\n\t\n\t/**\n\t * Calls `callback` on a later loop around the event loop. In Node.js this just\n\t * calls `setImmediate`. In the browser it will use `setImmediate` if\n\t * available, otherwise `setTimeout(callback, 0)`, which means other higher\n\t * priority events may precede the execution of `callback`.\n\t *\n\t * This is used internally for browser-compatibility purposes.\n\t *\n\t * @name setImmediate\n\t * @static\n\t * @memberOf module:Utils\n\t * @method\n\t * @alias nextTick\n\t * @category Util\n\t * @param {Function} callback - The function to call on a later loop around\n\t * the event loop. Invoked with (args...).\n\t * @param {...*} args... - any number of additional arguments to pass to the\n\t * callback on the next tick.\n\t * @example\n\t *\n\t * var call_order = [];\n\t * async.nextTick(function() {\n\t * call_order.push('two');\n\t * // call_order now equals ['one','two']\n\t * });\n\t * call_order.push('one');\n\t *\n\t * async.setImmediate(function (a, b, c) {\n\t * // a, b, and c equal 1, 2, and 3\n\t * }, 1, 2, 3);\n\t */\n\t\n\t/**\n\t * A queue of tasks for the worker function to complete.\n\t * @typedef {Object} QueueObject\n\t * @memberOf module:ControlFlow\n\t * @property {Function} length - a function returning the number of items\n\t * waiting to be processed. Invoke with `queue.length()`.\n\t * @property {boolean} started - a boolean indicating whether or not any\n\t * items have been pushed and processed by the queue.\n\t * @property {Function} running - a function returning the number of items\n\t * currently being processed. Invoke with `queue.running()`.\n\t * @property {Function} workersList - a function returning the array of items\n\t * currently being processed. Invoke with `queue.workersList()`.\n\t * @property {Function} idle - a function returning false if there are items\n\t * waiting or being processed, or true if not. Invoke with `queue.idle()`.\n\t * @property {number} concurrency - an integer for determining how many `worker`\n\t * functions should be run in parallel. This property can be changed after a\n\t * `queue` is created to alter the concurrency on-the-fly.\n\t * @property {Function} push - add a new task to the `queue`. Calls `callback`\n\t * once the `worker` has finished processing the task. Instead of a single task,\n\t * a `tasks` array can be submitted. The respective callback is used for every\n\t * task in the list. Invoke with `queue.push(task, [callback])`,\n\t * @property {Function} unshift - add a new task to the front of the `queue`.\n\t * Invoke with `queue.unshift(task, [callback])`.\n\t * @property {Function} saturated - a callback that is called when the number of\n\t * running workers hits the `concurrency` limit, and further tasks will be\n\t * queued.\n\t * @property {Function} unsaturated - a callback that is called when the number\n\t * of running workers is less than the `concurrency` & `buffer` limits, and\n\t * further tasks will not be queued.\n\t * @property {number} buffer - A minimum threshold buffer in order to say that\n\t * the `queue` is `unsaturated`.\n\t * @property {Function} empty - a callback that is called when the last item\n\t * from the `queue` is given to a `worker`.\n\t * @property {Function} drain - a callback that is called when the last item\n\t * from the `queue` has returned from the `worker`.\n\t * @property {Function} error - a callback that is called when a task errors.\n\t * Has the signature `function(error, task)`.\n\t * @property {boolean} paused - a boolean for determining whether the queue is\n\t * in a paused state.\n\t * @property {Function} pause - a function that pauses the processing of tasks\n\t * until `resume()` is called. Invoke with `queue.pause()`.\n\t * @property {Function} resume - a function that resumes the processing of\n\t * queued tasks when the queue is paused. Invoke with `queue.resume()`.\n\t * @property {Function} kill - a function that removes the `drain` callback and\n\t * empties remaining tasks from the queue forcing it to go idle. Invoke with `queue.kill()`.\n\t */\n\t\n\t/**\n\t * Creates a `queue` object with the specified `concurrency`. Tasks added to the\n\t * `queue` are processed in parallel (up to the `concurrency` limit). If all\n\t * `worker`s are in progress, the task is queued until one becomes available.\n\t * Once a `worker` completes a `task`, that `task`'s callback is called.\n\t *\n\t * @name queue\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @category Control Flow\n\t * @param {Function} worker - An asynchronous function for processing a queued\n\t * task, which must call its `callback(err)` argument when finished, with an\n\t * optional `error` as an argument. If you want to handle errors from an\n\t * individual task, pass a callback to `q.push()`. Invoked with\n\t * (task, callback).\n\t * @param {number} [concurrency=1] - An `integer` for determining how many\n\t * `worker` functions should be run in parallel. If omitted, the concurrency\n\t * defaults to `1`. If the concurrency is `0`, an error is thrown.\n\t * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can\n\t * attached as certain properties to listen for specific events during the\n\t * lifecycle of the queue.\n\t * @example\n\t *\n\t * // create a queue object with concurrency 2\n\t * var q = async.queue(function(task, callback) {\n\t * console.log('hello ' + task.name);\n\t * callback();\n\t * }, 2);\n\t *\n\t * // assign a callback\n\t * q.drain = function() {\n\t * console.log('all items have been processed');\n\t * };\n\t *\n\t * // add some items to the queue\n\t * q.push({name: 'foo'}, function(err) {\n\t * console.log('finished processing foo');\n\t * });\n\t * q.push({name: 'bar'}, function (err) {\n\t * console.log('finished processing bar');\n\t * });\n\t *\n\t * // add some items to the queue (batch-wise)\n\t * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {\n\t * console.log('finished processing item');\n\t * });\n\t *\n\t * // add some items to the front of the queue\n\t * q.unshift({name: 'bar'}, function (err) {\n\t * console.log('finished processing bar');\n\t * });\n\t */\n\t\n\t/**\n\t * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and\n\t * completed in ascending priority order.\n\t *\n\t * @name priorityQueue\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @see [async.queue]{@link module:ControlFlow.queue}\n\t * @category Control Flow\n\t * @param {Function} worker - An asynchronous function for processing a queued\n\t * task, which must call its `callback(err)` argument when finished, with an\n\t * optional `error` as an argument. If you want to handle errors from an\n\t * individual task, pass a callback to `q.push()`. Invoked with\n\t * (task, callback).\n\t * @param {number} concurrency - An `integer` for determining how many `worker`\n\t * functions should be run in parallel. If omitted, the concurrency defaults to\n\t * `1`. If the concurrency is `0`, an error is thrown.\n\t * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two\n\t * differences between `queue` and `priorityQueue` objects:\n\t * * `push(task, priority, [callback])` - `priority` should be a number. If an\n\t * array of `tasks` is given, all tasks will be assigned the same priority.\n\t * * The `unshift` method was removed.\n\t */\n\t\n\t/**\n\t * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.\n\t *\n\t * @name reject\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.filter]{@link module:Collections.filter}\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n\t * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n\t * with a boolean argument once it has completed. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called after all the\n\t * `iteratee` functions have finished. Invoked with (err, results).\n\t * @example\n\t *\n\t * async.reject(['file1','file2','file3'], function(filePath, callback) {\n\t * fs.access(filePath, function(err) {\n\t * callback(null, !err)\n\t * });\n\t * }, function(err, results) {\n\t * // results now equals an array of missing files\n\t * createFiles(results);\n\t * });\n\t */\n\t\n\t/**\n\t * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a\n\t * time.\n\t *\n\t * @name rejectLimit\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.reject]{@link module:Collections.reject}\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {number} limit - The maximum number of async operations at a time.\n\t * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n\t * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n\t * with a boolean argument once it has completed. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called after all the\n\t * `iteratee` functions have finished. Invoked with (err, results).\n\t */\n\t\n\t/**\n\t * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.\n\t *\n\t * @name rejectSeries\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.reject]{@link module:Collections.reject}\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n\t * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n\t * with a boolean argument once it has completed. Invoked with (item, callback).\n\t * @param {Function} [callback] - A callback which is called after all the\n\t * `iteratee` functions have finished. Invoked with (err, results).\n\t */\n\t\n\t/**\n\t * Creates a function that returns `value`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @since 2.4.0\n\t * @category Util\n\t * @param {*} value The value to return from the new function.\n\t * @returns {Function} Returns the new constant function.\n\t * @example\n\t *\n\t * var objects = _.times(2, _.constant({ 'a': 1 }));\n\t *\n\t * console.log(objects);\n\t * // => [{ 'a': 1 }, { 'a': 1 }]\n\t *\n\t * console.log(objects[0] === objects[1]);\n\t * // => true\n\t */\n\t\n\t/**\n\t * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method wraps a task and makes it\n\t * retryable, rather than immediately calling it with retries.\n\t *\n\t * @name retryable\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @see [async.retry]{@link module:ControlFlow.retry}\n\t * @category Control Flow\n\t * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional\n\t * options, exactly the same as from `retry`\n\t * @param {Function} task - the asynchronous function to wrap\n\t * @returns {Functions} The wrapped function, which when invoked, will retry on\n\t * an error, based on the parameters specified in `opts`.\n\t * @example\n\t *\n\t * async.auto({\n\t * dep1: async.retryable(3, getFromFlakyService),\n\t * process: [\"dep1\", async.retryable(3, function (results, cb) {\n\t * maybeProcessData(results.dep1, cb);\n\t * })]\n\t * }, callback);\n\t */\n\t\n\t/**\n\t * Returns `true` if at least one element in the `coll` satisfies an async test.\n\t * If any iteratee call returns `true`, the main `callback` is immediately\n\t * called.\n\t *\n\t * @name some\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @alias any\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A truth test to apply to each item in the array\n\t * in parallel. The iteratee is passed a `callback(err, truthValue)` which must\n\t * be called with a boolean argument once it has completed. Invoked with\n\t * (item, callback).\n\t * @param {Function} [callback] - A callback which is called as soon as any\n\t * iteratee returns `true`, or after all the iteratee functions have finished.\n\t * Result will be either `true` or `false` depending on the values of the async\n\t * tests. Invoked with (err, result).\n\t * @example\n\t *\n\t * async.some(['file1','file2','file3'], function(filePath, callback) {\n\t * fs.access(filePath, function(err) {\n\t * callback(null, !err)\n\t * });\n\t * }, function(err, result) {\n\t * // if result is true then at least one of the files exists\n\t * });\n\t */\n\t\n\t/**\n\t * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.\n\t *\n\t * @name someLimit\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.some]{@link module:Collections.some}\n\t * @alias anyLimit\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {number} limit - The maximum number of async operations at a time.\n\t * @param {Function} iteratee - A truth test to apply to each item in the array\n\t * in parallel. The iteratee is passed a `callback(err, truthValue)` which must\n\t * be called with a boolean argument once it has completed. Invoked with\n\t * (item, callback).\n\t * @param {Function} [callback] - A callback which is called as soon as any\n\t * iteratee returns `true`, or after all the iteratee functions have finished.\n\t * Result will be either `true` or `false` depending on the values of the async\n\t * tests. Invoked with (err, result).\n\t */\n\t\n\t/**\n\t * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.\n\t *\n\t * @name someSeries\n\t * @static\n\t * @memberOf module:Collections\n\t * @method\n\t * @see [async.some]{@link module:Collections.some}\n\t * @alias anySeries\n\t * @category Collection\n\t * @param {Array|Iterable|Object} coll - A collection to iterate over.\n\t * @param {Function} iteratee - A truth test to apply to each item in the array\n\t * in parallel. The iteratee is passed a `callback(err, truthValue)` which must\n\t * be called with a boolean argument once it has completed. Invoked with\n\t * (item, callback).\n\t * @param {Function} [callback] - A callback which is called as soon as any\n\t * iteratee returns `true`, or after all the iteratee functions have finished.\n\t * Result will be either `true` or `false` depending on the values of the async\n\t * tests. Invoked with (err, result).\n\t */\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeCeil = Math.ceil;\n\tvar nativeMax$1 = Math.max;\n\t\n\t/**\n\t * Calls the `iteratee` function `n` times, and accumulates results in the same\n\t * manner you would use with [map]{@link module:Collections.map}.\n\t *\n\t * @name times\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @see [async.map]{@link module:Collections.map}\n\t * @category Control Flow\n\t * @param {number} n - The number of times to run the function.\n\t * @param {Function} iteratee - The function to call `n` times. Invoked with the\n\t * iteration index and a callback (n, next).\n\t * @param {Function} callback - see {@link module:Collections.map}.\n\t * @example\n\t *\n\t * // Pretend this is some complicated async factory\n\t * var createUser = function(id, callback) {\n\t * callback(null, {\n\t * id: 'user' + id\n\t * });\n\t * };\n\t *\n\t * // generate 5 users\n\t * async.times(5, function(n, next) {\n\t * createUser(n, function(err, user) {\n\t * next(err, user);\n\t * });\n\t * }, function(err, users) {\n\t * // we should now have 5 users\n\t * });\n\t */\n\t\n\t/**\n\t * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.\n\t *\n\t * @name timesSeries\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @see [async.times]{@link module:ControlFlow.times}\n\t * @category Control Flow\n\t * @param {number} n - The number of times to run the function.\n\t * @param {Function} iteratee - The function to call `n` times. Invoked with the\n\t * iteration index and a callback (n, next).\n\t * @param {Function} callback - see {@link module:Collections.map}.\n\t */\n\t\n\t/**\n\t * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,\n\t * unmemoized form. Handy for testing.\n\t *\n\t * @name unmemoize\n\t * @static\n\t * @memberOf module:Utils\n\t * @method\n\t * @see [async.memoize]{@link module:Utils.memoize}\n\t * @category Util\n\t * @param {Function} fn - the memoized function\n\t * @returns {Function} a function that calls the original unmemoized function\n\t */\n\t\n\t/**\n\t * Runs the `tasks` array of functions in series, each passing their results to\n\t * the next in the array. However, if any of the `tasks` pass an error to their\n\t * own callback, the next function is not executed, and the main `callback` is\n\t * immediately called with the error.\n\t *\n\t * @name waterfall\n\t * @static\n\t * @memberOf module:ControlFlow\n\t * @method\n\t * @category Control Flow\n\t * @param {Array} tasks - An array of functions to run, each function is passed\n\t * a `callback(err, result1, result2, ...)` it must call on completion. The\n\t * first argument is an error (which can be `null`) and any further arguments\n\t * will be passed as arguments in order to the next task.\n\t * @param {Function} [callback] - An optional callback to run once all the\n\t * functions have completed. This will be passed the results of the last task's\n\t * callback. Invoked with (err, [results]).\n\t * @returns undefined\n\t * @example\n\t *\n\t * async.waterfall([\n\t * function(callback) {\n\t * callback(null, 'one', 'two');\n\t * },\n\t * function(arg1, arg2, callback) {\n\t * // arg1 now equals 'one' and arg2 now equals 'two'\n\t * callback(null, 'three');\n\t * },\n\t * function(arg1, callback) {\n\t * // arg1 now equals 'three'\n\t * callback(null, 'done');\n\t * }\n\t * ], function (err, result) {\n\t * // result now equals 'done'\n\t * });\n\t *\n\t * // Or, with named functions:\n\t * async.waterfall([\n\t * myFirstFunction,\n\t * mySecondFunction,\n\t * myLastFunction,\n\t * ], function (err, result) {\n\t * // result now equals 'done'\n\t * });\n\t * function myFirstFunction(callback) {\n\t * callback(null, 'one', 'two');\n\t * }\n\t * function mySecondFunction(arg1, arg2, callback) {\n\t * // arg1 now equals 'one' and arg2 now equals 'two'\n\t * callback(null, 'three');\n\t * }\n\t * function myLastFunction(arg1, callback) {\n\t * // arg1 now equals 'three'\n\t * callback(null, 'done');\n\t * }\n\t */\n\t\n\t/**\n\t * Async is a utility module which provides straight-forward, powerful functions\n\t * for working with asynchronous JavaScript. Although originally designed for\n\t * use with [Node.js](http://nodejs.org) and installable via\n\t * `npm install --save async`, it can also be used directly in the browser.\n\t * @module async\n\t */\n\t\n\t/**\n\t * A collection of `async` functions for manipulating collections, such as\n\t * arrays and objects.\n\t * @module Collections\n\t */\n\t\n\t/**\n\t * A collection of `async` functions for controlling the flow through a script.\n\t * @module ControlFlow\n\t */\n\t\n\t /**\n\t * A collection of `async` utility functions.\n\t * @module Utils\n\t */\n\t\n\t/**\n\t * @hidden\n\t */\n\tvar errorCodeLookup;\n\t/**\n\t * Lazily construct error code lookup, since DropboxJS might be loaded *after* BrowserFS (or not at all!)\n\t * @hidden\n\t */\n\tfunction constructErrorCodeLookup() {\n\t if (errorCodeLookup) {\n\t return;\n\t }\n\t errorCodeLookup = {};\n\t // This indicates a network transmission error on modern browsers. Internet Explorer might cause this code to be reported on some API server errors.\n\t errorCodeLookup[Dropbox.ApiError.NETWORK_ERROR] = ErrorCode.EIO;\n\t // This happens when the contentHash parameter passed to a Dropbox.Client#readdir or Dropbox.Client#stat matches the most recent content, so the API call response is omitted, to save bandwidth.\n\t // errorCodeLookup[Dropbox.ApiError.NO_CONTENT];\n\t // The error property on {Dropbox.ApiError#response} should indicate which input parameter is invalid and why.\n\t errorCodeLookup[Dropbox.ApiError.INVALID_PARAM] = ErrorCode.EINVAL;\n\t // The OAuth token used for the request will never become valid again, so the user should be re-authenticated.\n\t errorCodeLookup[Dropbox.ApiError.INVALID_TOKEN] = ErrorCode.EPERM;\n\t // This indicates a bug in dropbox.js and should never occur under normal circumstances.\n\t // ^ Actually, that's false. This occurs when you try to move folders to themselves, or move a file over another file.\n\t errorCodeLookup[Dropbox.ApiError.OAUTH_ERROR] = ErrorCode.EPERM;\n\t // This happens when trying to read from a non-existing file, readdir a non-existing directory, write a file into a non-existing directory, etc.\n\t errorCodeLookup[Dropbox.ApiError.NOT_FOUND] = ErrorCode.ENOENT;\n\t // This indicates a bug in dropbox.js and should never occur under normal circumstances.\n\t errorCodeLookup[Dropbox.ApiError.INVALID_METHOD] = ErrorCode.EINVAL;\n\t // This happens when a Dropbox.Client#readdir or Dropbox.Client#stat call would return more than a maximum amount of directory entries.\n\t errorCodeLookup[Dropbox.ApiError.NOT_ACCEPTABLE] = ErrorCode.EINVAL;\n\t // This is used by some backend methods to indicate that the client needs to download server-side changes and perform conflict resolution. Under normal usage, errors with this code should never surface to the code using dropbox.js.\n\t errorCodeLookup[Dropbox.ApiError.CONFLICT] = ErrorCode.EINVAL;\n\t // Status value indicating that the application is making too many requests.\n\t errorCodeLookup[Dropbox.ApiError.RATE_LIMITED] = ErrorCode.EBUSY;\n\t // The request should be retried after some time.\n\t errorCodeLookup[Dropbox.ApiError.SERVER_ERROR] = ErrorCode.EBUSY;\n\t // Status value indicating that the user's Dropbox is over its storage quota.\n\t errorCodeLookup[Dropbox.ApiError.OVER_QUOTA] = ErrorCode.ENOSPC;\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction isFileInfo(cache) {\n\t return cache && cache.stat.isFile;\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction isDirInfo(cache) {\n\t return cache && cache.stat.isFolder;\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction isArrayBuffer(ab) {\n\t // Accept null / undefined, too.\n\t return ab === null || ab === undefined || (typeof (ab) === 'object' && typeof (ab['byteLength']) === 'number');\n\t}\n\t/**\n\t * Wraps a Dropbox client and caches operations.\n\t * @hidden\n\t */\n\tvar CachedDropboxClient = function CachedDropboxClient(client) {\n\t this._cache = {};\n\t this._client = client;\n\t};\n\tCachedDropboxClient.prototype.readdir = function readdir (p, cb) {\n\t var this$1 = this;\n\t\n\t var cacheInfo = this.getCachedDirInfo(p);\n\t this._wrap(function (interceptCb) {\n\t if (cacheInfo !== null && cacheInfo.contents) {\n\t this$1._client.readdir(p, {\n\t contentHash: cacheInfo.stat.contentHash\n\t }, interceptCb);\n\t }\n\t else {\n\t this$1._client.readdir(p, interceptCb);\n\t }\n\t }, function (err, filenames, stat, folderEntries) {\n\t if (err) {\n\t if (err.status === Dropbox.ApiError.NO_CONTENT && cacheInfo !== null) {\n\t cb(null, cacheInfo.contents.slice(0));\n\t }\n\t else {\n\t cb(err);\n\t }\n\t }\n\t else {\n\t this$1.updateCachedDirInfo(p, stat, filenames.slice(0));\n\t folderEntries.forEach(function (entry) {\n\t this$1.updateCachedInfo(path.join(p, entry.name), entry);\n\t });\n\t cb(null, filenames);\n\t }\n\t });\n\t};\n\tCachedDropboxClient.prototype.remove = function remove (p, cb) {\n\t var this$1 = this;\n\t\n\t this._wrap(function (interceptCb) {\n\t this$1._client.remove(p, interceptCb);\n\t }, function (err, stat) {\n\t if (!err) {\n\t this$1.updateCachedInfo(p, stat);\n\t }\n\t cb(err);\n\t });\n\t};\n\tCachedDropboxClient.prototype.move = function move (src, dest, cb) {\n\t var this$1 = this;\n\t\n\t this._wrap(function (interceptCb) {\n\t this$1._client.move(src, dest, interceptCb);\n\t }, function (err, stat) {\n\t if (!err) {\n\t this$1.deleteCachedInfo(src);\n\t this$1.updateCachedInfo(dest, stat);\n\t }\n\t cb(err);\n\t });\n\t};\n\tCachedDropboxClient.prototype.stat = function stat (p, cb) {\n\t var this$1 = this;\n\t\n\t this._wrap(function (interceptCb) {\n\t this$1._client.stat(p, interceptCb);\n\t }, function (err, stat) {\n\t if (!err) {\n\t this$1.updateCachedInfo(p, stat);\n\t }\n\t cb(err, stat);\n\t });\n\t};\n\tCachedDropboxClient.prototype.readFile = function readFile (p, cb) {\n\t var this$1 = this;\n\t\n\t var cacheInfo = this.getCachedFileInfo(p);\n\t if (cacheInfo !== null && cacheInfo.contents !== null) {\n\t // Try to use cached info; issue a stat to see if contents are up-to-date.\n\t this.stat(p, function (error, stat) {\n\t if (error) {\n\t cb(error);\n\t }\n\t else if (stat.contentHash === cacheInfo.stat.contentHash) {\n\t // No file changes.\n\t cb(error, cacheInfo.contents.slice(0), cacheInfo.stat);\n\t }\n\t else {\n\t // File changes; rerun to trigger actual readFile.\n\t this$1.readFile(p, cb);\n\t }\n\t });\n\t }\n\t else {\n\t this._wrap(function (interceptCb) {\n\t this$1._client.readFile(p, { arrayBuffer: true }, interceptCb);\n\t }, function (err, contents, stat) {\n\t if (!err) {\n\t this$1.updateCachedInfo(p, stat, contents.slice(0));\n\t }\n\t cb(err, contents, stat);\n\t });\n\t }\n\t};\n\tCachedDropboxClient.prototype.writeFile = function writeFile (p, contents, cb) {\n\t var this$1 = this;\n\t\n\t this._wrap(function (interceptCb) {\n\t this$1._client.writeFile(p, contents, interceptCb);\n\t }, function (err, stat) {\n\t if (!err) {\n\t this$1.updateCachedInfo(p, stat, contents.slice(0));\n\t }\n\t cb(err, stat);\n\t });\n\t};\n\tCachedDropboxClient.prototype.mkdir = function mkdir (p, cb) {\n\t var this$1 = this;\n\t\n\t this._wrap(function (interceptCb) {\n\t this$1._client.mkdir(p, interceptCb);\n\t }, function (err, stat) {\n\t if (!err) {\n\t this$1.updateCachedInfo(p, stat, []);\n\t }\n\t cb(err);\n\t });\n\t};\n\t/**\n\t * Wraps an operation such that we retry a failed operation 3 times.\n\t * Necessary to deal with Dropbox rate limiting.\n\t *\n\t * @param performOp Function that performs the operation. Will be called up to three times.\n\t * @param cb Called when the operation succeeds, fails in a non-temporary manner, or fails three times.\n\t */\n\tCachedDropboxClient.prototype._wrap = function _wrap (performOp, cb) {\n\t var numRun = 0;\n\t var interceptCb = function (error) {\n\t // Timeout duration, in seconds.\n\t var timeoutDuration = 2;\n\t if (error && 3 > (++numRun)) {\n\t switch (error.status) {\n\t case Dropbox.ApiError.SERVER_ERROR:\n\t case Dropbox.ApiError.NETWORK_ERROR:\n\t case Dropbox.ApiError.RATE_LIMITED:\n\t setTimeout(function () {\n\t performOp(interceptCb);\n\t }, timeoutDuration * 1000);\n\t break;\n\t default:\n\t cb.apply(null, arguments);\n\t break;\n\t }\n\t }\n\t else {\n\t cb.apply(null, arguments);\n\t }\n\t };\n\t performOp(interceptCb);\n\t};\n\tCachedDropboxClient.prototype.getCachedInfo = function getCachedInfo (p) {\n\t return this._cache[p.toLowerCase()];\n\t};\n\tCachedDropboxClient.prototype.putCachedInfo = function putCachedInfo (p, cache) {\n\t this._cache[p.toLowerCase()] = cache;\n\t};\n\tCachedDropboxClient.prototype.deleteCachedInfo = function deleteCachedInfo (p) {\n\t delete this._cache[p.toLowerCase()];\n\t};\n\tCachedDropboxClient.prototype.getCachedDirInfo = function getCachedDirInfo (p) {\n\t var info = this.getCachedInfo(p);\n\t if (isDirInfo(info)) {\n\t return info;\n\t }\n\t else {\n\t return null;\n\t }\n\t};\n\tCachedDropboxClient.prototype.getCachedFileInfo = function getCachedFileInfo (p) {\n\t var info = this.getCachedInfo(p);\n\t if (isFileInfo(info)) {\n\t return info;\n\t }\n\t else {\n\t return null;\n\t }\n\t};\n\tCachedDropboxClient.prototype.updateCachedDirInfo = function updateCachedDirInfo (p, stat, contents) {\n\t if ( contents === void 0 ) contents = null;\n\t\n\t var cachedInfo = this.getCachedInfo(p);\n\t // Dropbox uses the *contentHash* property for directories.\n\t // Ignore stat objects w/o a contentHash defined; those actually exist!!!\n\t // (Example: readdir returns an array of stat objs; stat objs for dirs in that context have no contentHash)\n\t if (stat.contentHash !== null && (cachedInfo === undefined || cachedInfo.stat.contentHash !== stat.contentHash)) {\n\t this.putCachedInfo(p, {\n\t stat: stat,\n\t contents: contents\n\t });\n\t }\n\t};\n\tCachedDropboxClient.prototype.updateCachedFileInfo = function updateCachedFileInfo (p, stat, contents) {\n\t if ( contents === void 0 ) contents = null;\n\t\n\t var cachedInfo = this.getCachedInfo(p);\n\t // Dropbox uses the *versionTag* property for files.\n\t // Ignore stat objects w/o a versionTag defined.\n\t if (stat.versionTag !== null && (cachedInfo === undefined || cachedInfo.stat.versionTag !== stat.versionTag)) {\n\t this.putCachedInfo(p, {\n\t stat: stat,\n\t contents: contents\n\t });\n\t }\n\t};\n\tCachedDropboxClient.prototype.updateCachedInfo = function updateCachedInfo (p, stat, contents) {\n\t if ( contents === void 0 ) contents = null;\n\t\n\t if (stat.isFile && isArrayBuffer(contents)) {\n\t this.updateCachedFileInfo(p, stat, contents);\n\t }\n\t else if (stat.isFolder && Array.isArray(contents)) {\n\t this.updateCachedDirInfo(p, stat, contents);\n\t }\n\t};\n\tvar DropboxFile = (function (PreloadFile$$1) {\n\t function DropboxFile(_fs, _path, _flag, _stat, contents) {\n\t PreloadFile$$1.call(this, _fs, _path, _flag, _stat, contents);\n\t }\n\t\n\t if ( PreloadFile$$1 ) DropboxFile.__proto__ = PreloadFile$$1;\n\t DropboxFile.prototype = Object.create( PreloadFile$$1 && PreloadFile$$1.prototype );\n\t DropboxFile.prototype.constructor = DropboxFile;\n\t DropboxFile.prototype.sync = function sync (cb) {\n\t var this$1 = this;\n\t\n\t if (this.isDirty()) {\n\t var buffer$$1 = this.getBuffer(), arrayBuffer = buffer2ArrayBuffer(buffer$$1);\n\t this._fs._writeFileStrict(this.getPath(), arrayBuffer, function (e) {\n\t if (!e) {\n\t this$1.resetDirty();\n\t }\n\t cb(e);\n\t });\n\t }\n\t else {\n\t cb();\n\t }\n\t };\n\t DropboxFile.prototype.close = function close (cb) {\n\t this.sync(cb);\n\t };\n\t\n\t return DropboxFile;\n\t}(PreloadFile));\n\t/**\n\t * A read/write file system backed by Dropbox cloud storage.\n\t *\n\t * Uses the Dropbox V1 API.\n\t *\n\t * NOTE: You must use the v0.10 version of the [Dropbox JavaScript SDK](https://www.npmjs.com/package/dropbox).\n\t */\n\tvar DropboxFileSystem = (function (BaseFileSystem$$1) {\n\t function DropboxFileSystem(client, deprecateMsg) {\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t BaseFileSystem$$1.call(this);\n\t this._client = new CachedDropboxClient(client);\n\t deprecationMessage(deprecateMsg, DropboxFileSystem.Name, { client: \"authenticated dropbox client instance\" });\n\t constructErrorCodeLookup();\n\t }\n\t\n\t if ( BaseFileSystem$$1 ) DropboxFileSystem.__proto__ = BaseFileSystem$$1;\n\t DropboxFileSystem.prototype = Object.create( BaseFileSystem$$1 && BaseFileSystem$$1.prototype );\n\t DropboxFileSystem.prototype.constructor = DropboxFileSystem;\n\t /**\n\t * Creates a new DropboxFileSystem instance with the given options.\n\t * Must be given an *authenticated* DropboxJS client from the old v0.10 version of the Dropbox JS SDK.\n\t */\n\t DropboxFileSystem.Create = function Create (opts, cb) {\n\t cb(null, new DropboxFileSystem(opts.client, false));\n\t };\n\t DropboxFileSystem.isAvailable = function isAvailable () {\n\t // Checks if the Dropbox library is loaded.\n\t return typeof Dropbox !== 'undefined';\n\t };\n\t DropboxFileSystem.prototype.getName = function getName () {\n\t return DropboxFileSystem.Name;\n\t };\n\t DropboxFileSystem.prototype.isReadOnly = function isReadOnly () {\n\t return false;\n\t };\n\t // Dropbox doesn't support symlinks, properties, or synchronous calls\n\t DropboxFileSystem.prototype.supportsSymlinks = function supportsSymlinks () {\n\t return false;\n\t };\n\t DropboxFileSystem.prototype.supportsProps = function supportsProps () {\n\t return false;\n\t };\n\t DropboxFileSystem.prototype.supportsSynch = function supportsSynch () {\n\t return false;\n\t };\n\t DropboxFileSystem.prototype.empty = function empty (mainCb) {\n\t var this$1 = this;\n\t\n\t this._client.readdir('/', function (error, files) {\n\t if (error) {\n\t mainCb(this$1.convert(error, '/'));\n\t }\n\t else {\n\t var deleteFile = function (file, cb) {\n\t var p = path.join('/', file);\n\t this$1._client.remove(p, function (err) {\n\t cb(err ? this$1.convert(err, p) : null);\n\t });\n\t };\n\t var finished = function (err) {\n\t if (err) {\n\t mainCb(err);\n\t }\n\t else {\n\t mainCb();\n\t }\n\t };\n\t // XXX: typing is to get around overly-restrictive ErrorCallback typing.\n\t eachLimit(files, deleteFile, finished);\n\t }\n\t });\n\t };\n\t DropboxFileSystem.prototype.rename = function rename (oldPath, newPath, cb) {\n\t var this$1 = this;\n\t\n\t this._client.move(oldPath, newPath, function (error) {\n\t if (error) {\n\t // the move is permitted if newPath is a file.\n\t // Check if this is the case, and remove if so.\n\t this$1._client.stat(newPath, function (error2, stat) {\n\t if (error2 || stat.isFolder) {\n\t var missingPath = error.response.error.indexOf(oldPath) > -1 ? oldPath : newPath;\n\t cb(this$1.convert(error, missingPath));\n\t }\n\t else {\n\t // Delete file, repeat rename.\n\t this$1._client.remove(newPath, function (error2) {\n\t if (error2) {\n\t cb(this$1.convert(error2, newPath));\n\t }\n\t else {\n\t this$1.rename(oldPath, newPath, cb);\n\t }\n\t });\n\t }\n\t });\n\t }\n\t else {\n\t cb();\n\t }\n\t });\n\t };\n\t DropboxFileSystem.prototype.stat = function stat (path$$1, isLstat, cb) {\n\t var this$1 = this;\n\t\n\t // Ignore lstat case -- Dropbox doesn't support symlinks\n\t // Stat the file\n\t this._client.stat(path$$1, function (error, stat) {\n\t if (error) {\n\t cb(this$1.convert(error, path$$1));\n\t }\n\t else if (stat && stat.isRemoved) {\n\t // Dropbox keeps track of deleted files, so if a file has existed in the\n\t // past but doesn't any longer, you wont get an error\n\t cb(ApiError.FileError(ErrorCode.ENOENT, path$$1));\n\t }\n\t else {\n\t var stats = new Stats(this$1._statType(stat), stat.size);\n\t return cb(null, stats);\n\t }\n\t });\n\t };\n\t DropboxFileSystem.prototype.open = function open (path$$1, flags, mode, cb) {\n\t var this$1 = this;\n\t\n\t // Try and get the file's contents\n\t this._client.readFile(path$$1, function (error, content, dbStat) {\n\t if (error) {\n\t // If the file's being opened for reading and doesn't exist, return an\n\t // error\n\t if (flags.isReadable()) {\n\t cb(this$1.convert(error, path$$1));\n\t }\n\t else {\n\t switch (error.status) {\n\t // If it's being opened for writing or appending, create it so that\n\t // it can be written to\n\t case Dropbox.ApiError.NOT_FOUND:\n\t var ab = new ArrayBuffer(0);\n\t return this$1._writeFileStrict(path$$1, ab, function (error2, stat) {\n\t if (error2) {\n\t cb(error2);\n\t }\n\t else {\n\t var file = this$1._makeFile(path$$1, flags, stat, arrayBuffer2Buffer(ab));\n\t cb(null, file);\n\t }\n\t });\n\t default:\n\t return cb(this$1.convert(error, path$$1));\n\t }\n\t }\n\t }\n\t else {\n\t // No error\n\t var buffer$$1;\n\t // Dropbox.js seems to set `content` to `null` rather than to an empty\n\t // buffer when reading an empty file. Not sure why this is.\n\t if (content === null) {\n\t buffer$$1 = emptyBuffer();\n\t }\n\t else {\n\t buffer$$1 = arrayBuffer2Buffer(content);\n\t }\n\t var file = this$1._makeFile(path$$1, flags, dbStat, buffer$$1);\n\t return cb(null, file);\n\t }\n\t });\n\t };\n\t DropboxFileSystem.prototype._writeFileStrict = function _writeFileStrict (p, data, cb) {\n\t var this$1 = this;\n\t\n\t var parent = path.dirname(p);\n\t this.stat(parent, false, function (error, stat) {\n\t if (error) {\n\t cb(ApiError.FileError(ErrorCode.ENOENT, parent));\n\t }\n\t else {\n\t this$1._client.writeFile(p, data, function (error2, stat) {\n\t if (error2) {\n\t cb(this$1.convert(error2, p));\n\t }\n\t else {\n\t cb(null, stat);\n\t }\n\t });\n\t }\n\t });\n\t };\n\t /**\n\t * Private\n\t * Returns a BrowserFS object representing the type of a Dropbox.js stat object\n\t */\n\t DropboxFileSystem.prototype._statType = function _statType (stat) {\n\t return stat.isFile ? FileType.FILE : FileType.DIRECTORY;\n\t };\n\t /**\n\t * Private\n\t * Returns a BrowserFS object representing a File, created from the data\n\t * returned by calls to the Dropbox API.\n\t */\n\t DropboxFileSystem.prototype._makeFile = function _makeFile (path$$1, flag, stat, buffer$$1) {\n\t var type = this._statType(stat);\n\t var stats = new Stats(type, stat.size);\n\t return new DropboxFile(this, path$$1, flag, stats, buffer$$1);\n\t };\n\t /**\n\t * Private\n\t * Delete a file or directory from Dropbox\n\t * isFile should reflect which call was made to remove the it (`unlink` or\n\t * `rmdir`). If this doesn't match what's actually at `path`, an error will be\n\t * returned\n\t */\n\t DropboxFileSystem.prototype._remove = function _remove (path$$1, cb, isFile) {\n\t var this$1 = this;\n\t\n\t this._client.stat(path$$1, function (error, stat) {\n\t if (error) {\n\t cb(this$1.convert(error, path$$1));\n\t }\n\t else {\n\t if (stat.isFile && !isFile) {\n\t cb(ApiError.FileError(ErrorCode.ENOTDIR, path$$1));\n\t }\n\t else if (!stat.isFile && isFile) {\n\t cb(ApiError.FileError(ErrorCode.EISDIR, path$$1));\n\t }\n\t else {\n\t this$1._client.remove(path$$1, function (error) {\n\t if (error) {\n\t cb(this$1.convert(error, path$$1));\n\t }\n\t else {\n\t cb(null);\n\t }\n\t });\n\t }\n\t }\n\t });\n\t };\n\t /**\n\t * Delete a file\n\t */\n\t DropboxFileSystem.prototype.unlink = function unlink (path$$1, cb) {\n\t this._remove(path$$1, cb, true);\n\t };\n\t /**\n\t * Delete a directory\n\t */\n\t DropboxFileSystem.prototype.rmdir = function rmdir (path$$1, cb) {\n\t this._remove(path$$1, cb, false);\n\t };\n\t /**\n\t * Create a directory\n\t */\n\t DropboxFileSystem.prototype.mkdir = function mkdir (p, mode, cb) {\n\t var this$1 = this;\n\t\n\t // Dropbox.js' client.mkdir() behaves like `mkdir -p`, i.e. it creates a\n\t // directory and all its ancestors if they don't exist.\n\t // Node's fs.mkdir() behaves like `mkdir`, i.e. it throws an error if an attempt\n\t // is made to create a directory without a parent.\n\t // To handle this inconsistency, a check for the existence of `path`'s parent\n\t // must be performed before it is created, and an error thrown if it does\n\t // not exist\n\t var parent = path.dirname(p);\n\t this._client.stat(parent, function (error, stat) {\n\t if (error) {\n\t cb(this$1.convert(error, parent));\n\t }\n\t else {\n\t this$1._client.mkdir(p, function (error) {\n\t if (error) {\n\t cb(ApiError.FileError(ErrorCode.EEXIST, p));\n\t }\n\t else {\n\t cb(null);\n\t }\n\t });\n\t }\n\t });\n\t };\n\t /**\n\t * Get the names of the files in a directory\n\t */\n\t DropboxFileSystem.prototype.readdir = function readdir (path$$1, cb) {\n\t var this$1 = this;\n\t\n\t this._client.readdir(path$$1, function (error, files) {\n\t if (error) {\n\t return cb(this$1.convert(error));\n\t }\n\t else {\n\t return cb(null, files);\n\t }\n\t });\n\t };\n\t /**\n\t * Converts a Dropbox-JS error into a BFS error.\n\t */\n\t DropboxFileSystem.prototype.convert = function convert (err, path$$1) {\n\t if ( path$$1 === void 0 ) path$$1 = null;\n\t\n\t var errorCode = errorCodeLookup[err.status];\n\t if (errorCode === undefined) {\n\t errorCode = ErrorCode.EIO;\n\t }\n\t if (!path$$1) {\n\t return new ApiError(errorCode);\n\t }\n\t else {\n\t return ApiError.FileError(errorCode, path$$1);\n\t }\n\t };\n\t\n\t return DropboxFileSystem;\n\t}(BaseFileSystem));\n\t\n\tDropboxFileSystem.Name = \"Dropbox\";\n\tDropboxFileSystem.Options = {\n\t client: {\n\t type: \"object\",\n\t description: \"An *authenticated* Dropbox client. Must be from the 0.10 JS SDK.\",\n\t validator: function (opt, cb) {\n\t if (opt.isAuthenticated && opt.isAuthenticated()) {\n\t cb();\n\t }\n\t else {\n\t cb(new ApiError(ErrorCode.EINVAL, \"'client' option must be an authenticated Dropbox client from the v0.10 JS SDK.\"));\n\t }\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * @hidden\n\t */\n\tfunction convertError(e, path$$1) {\n\t if ( path$$1 === void 0 ) path$$1 = '';\n\t\n\t var errno = e.errno;\n\t var parent = e.node;\n\t var paths = [];\n\t while (parent) {\n\t paths.unshift(parent.name);\n\t if (parent === parent.parent) {\n\t break;\n\t }\n\t parent = parent.parent;\n\t }\n\t return new ApiError(errno, ErrorStrings[errno], paths.length > 0 ? '/' + paths.join('/') : path$$1);\n\t}\n\tvar EmscriptenFile = (function (BaseFile$$1) {\n\t function EmscriptenFile(_fs, _FS, _path, _stream) {\n\t BaseFile$$1.call(this);\n\t this._fs = _fs;\n\t this._FS = _FS;\n\t this._path = _path;\n\t this._stream = _stream;\n\t }\n\t\n\t if ( BaseFile$$1 ) EmscriptenFile.__proto__ = BaseFile$$1;\n\t EmscriptenFile.prototype = Object.create( BaseFile$$1 && BaseFile$$1.prototype );\n\t EmscriptenFile.prototype.constructor = EmscriptenFile;\n\t EmscriptenFile.prototype.getPos = function getPos () {\n\t return undefined;\n\t };\n\t EmscriptenFile.prototype.close = function close (cb) {\n\t var err = null;\n\t try {\n\t this.closeSync();\n\t }\n\t catch (e) {\n\t err = e;\n\t }\n\t finally {\n\t cb(err);\n\t }\n\t };\n\t EmscriptenFile.prototype.closeSync = function closeSync () {\n\t try {\n\t this._FS.close(this._stream);\n\t }\n\t catch (e) {\n\t throw convertError(e, this._path);\n\t }\n\t };\n\t EmscriptenFile.prototype.stat = function stat (cb) {\n\t try {\n\t cb(null, this.statSync());\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t EmscriptenFile.prototype.statSync = function statSync () {\n\t try {\n\t return this._fs.statSync(this._path, false);\n\t }\n\t catch (e) {\n\t throw convertError(e, this._path);\n\t }\n\t };\n\t EmscriptenFile.prototype.truncate = function truncate (len, cb) {\n\t var err = null;\n\t try {\n\t this.truncateSync(len);\n\t }\n\t catch (e) {\n\t err = e;\n\t }\n\t finally {\n\t cb(err);\n\t }\n\t };\n\t EmscriptenFile.prototype.truncateSync = function truncateSync (len) {\n\t try {\n\t this._FS.ftruncate(this._stream.fd, len);\n\t }\n\t catch (e) {\n\t throw convertError(e, this._path);\n\t }\n\t };\n\t EmscriptenFile.prototype.write = function write (buffer$$1, offset, length, position, cb) {\n\t try {\n\t cb(null, this.writeSync(buffer$$1, offset, length, position), buffer$$1);\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t EmscriptenFile.prototype.writeSync = function writeSync (buffer$$1, offset, length, position) {\n\t try {\n\t var u8 = buffer2Uint8array(buffer$$1);\n\t // Emscripten is particular about what position is set to.\n\t var emPosition = position === null ? undefined : position;\n\t return this._FS.write(this._stream, u8, offset, length, emPosition);\n\t }\n\t catch (e) {\n\t throw convertError(e, this._path);\n\t }\n\t };\n\t EmscriptenFile.prototype.read = function read (buffer$$1, offset, length, position, cb) {\n\t try {\n\t cb(null, this.readSync(buffer$$1, offset, length, position), buffer$$1);\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t EmscriptenFile.prototype.readSync = function readSync (buffer$$1, offset, length, position) {\n\t try {\n\t var u8 = buffer2Uint8array(buffer$$1);\n\t // Emscripten is particular about what position is set to.\n\t var emPosition = position === null ? undefined : position;\n\t return this._FS.read(this._stream, u8, offset, length, emPosition);\n\t }\n\t catch (e) {\n\t throw convertError(e, this._path);\n\t }\n\t };\n\t EmscriptenFile.prototype.sync = function sync (cb) {\n\t // NOP.\n\t cb();\n\t };\n\t EmscriptenFile.prototype.syncSync = function syncSync () {\n\t // NOP.\n\t };\n\t EmscriptenFile.prototype.chown = function chown (uid, gid, cb) {\n\t var err = null;\n\t try {\n\t this.chownSync(uid, gid);\n\t }\n\t catch (e) {\n\t err = e;\n\t }\n\t finally {\n\t cb(err);\n\t }\n\t };\n\t EmscriptenFile.prototype.chownSync = function chownSync (uid, gid) {\n\t try {\n\t this._FS.fchown(this._stream.fd, uid, gid);\n\t }\n\t catch (e) {\n\t throw convertError(e, this._path);\n\t }\n\t };\n\t EmscriptenFile.prototype.chmod = function chmod (mode, cb) {\n\t var err = null;\n\t try {\n\t this.chmodSync(mode);\n\t }\n\t catch (e) {\n\t err = e;\n\t }\n\t finally {\n\t cb(err);\n\t }\n\t };\n\t EmscriptenFile.prototype.chmodSync = function chmodSync (mode) {\n\t try {\n\t this._FS.fchmod(this._stream.fd, mode);\n\t }\n\t catch (e) {\n\t throw convertError(e, this._path);\n\t }\n\t };\n\t EmscriptenFile.prototype.utimes = function utimes (atime, mtime, cb) {\n\t var err = null;\n\t try {\n\t this.utimesSync(atime, mtime);\n\t }\n\t catch (e) {\n\t err = e;\n\t }\n\t finally {\n\t cb(err);\n\t }\n\t };\n\t EmscriptenFile.prototype.utimesSync = function utimesSync (atime, mtime) {\n\t this._fs.utimesSync(this._path, atime, mtime);\n\t };\n\t\n\t return EmscriptenFile;\n\t}(BaseFile));\n\t/**\n\t * Mounts an Emscripten file system into the BrowserFS file system.\n\t */\n\tvar EmscriptenFileSystem = (function (SynchronousFileSystem$$1) {\n\t function EmscriptenFileSystem(_FS) {\n\t SynchronousFileSystem$$1.call(this);\n\t this._FS = _FS;\n\t }\n\t\n\t if ( SynchronousFileSystem$$1 ) EmscriptenFileSystem.__proto__ = SynchronousFileSystem$$1;\n\t EmscriptenFileSystem.prototype = Object.create( SynchronousFileSystem$$1 && SynchronousFileSystem$$1.prototype );\n\t EmscriptenFileSystem.prototype.constructor = EmscriptenFileSystem;\n\t /**\n\t * Create an EmscriptenFileSystem instance with the given options.\n\t */\n\t EmscriptenFileSystem.Create = function Create (opts, cb) {\n\t cb(null, new EmscriptenFileSystem(opts.FS));\n\t };\n\t EmscriptenFileSystem.isAvailable = function isAvailable () { return true; };\n\t EmscriptenFileSystem.prototype.getName = function getName () { return this._FS.DB_NAME(); };\n\t EmscriptenFileSystem.prototype.isReadOnly = function isReadOnly () { return false; };\n\t EmscriptenFileSystem.prototype.supportsLinks = function supportsLinks () { return true; };\n\t EmscriptenFileSystem.prototype.supportsProps = function supportsProps () { return true; };\n\t EmscriptenFileSystem.prototype.supportsSynch = function supportsSynch () { return true; };\n\t EmscriptenFileSystem.prototype.renameSync = function renameSync (oldPath, newPath) {\n\t try {\n\t this._FS.rename(oldPath, newPath);\n\t }\n\t catch (e) {\n\t if (e.errno === ErrorCode.ENOENT) {\n\t throw convertError(e, this.existsSync(oldPath) ? newPath : oldPath);\n\t }\n\t else {\n\t throw convertError(e);\n\t }\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.statSync = function statSync (p, isLstat) {\n\t try {\n\t var stats = isLstat ? this._FS.lstat(p) : this._FS.stat(p);\n\t var itemType = this.modeToFileType(stats.mode);\n\t return new Stats(itemType, stats.size, stats.mode, stats.atime, stats.mtime, stats.ctime);\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.openSync = function openSync (p, flag, mode) {\n\t try {\n\t var stream = this._FS.open(p, flag.getFlagString(), mode);\n\t if (this._FS.isDir(stream.node.mode)) {\n\t this._FS.close(stream);\n\t throw ApiError.EISDIR(p);\n\t }\n\t return new EmscriptenFile(this, this._FS, p, stream);\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.unlinkSync = function unlinkSync (p) {\n\t try {\n\t this._FS.unlink(p);\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.rmdirSync = function rmdirSync (p) {\n\t try {\n\t this._FS.rmdir(p);\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.mkdirSync = function mkdirSync (p, mode) {\n\t try {\n\t this._FS.mkdir(p, mode);\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.readdirSync = function readdirSync (p) {\n\t try {\n\t // Emscripten returns items for '.' and '..'. Node does not.\n\t return this._FS.readdir(p).filter(function (p) { return p !== '.' && p !== '..'; });\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.truncateSync = function truncateSync (p, len) {\n\t try {\n\t this._FS.truncate(p, len);\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.readFileSync = function readFileSync (p, encoding, flag) {\n\t try {\n\t var data = this._FS.readFile(p, { flags: flag.getFlagString() });\n\t var buff = uint8Array2Buffer(data);\n\t if (encoding) {\n\t return buff.toString(encoding);\n\t }\n\t else {\n\t return buff;\n\t }\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.writeFileSync = function writeFileSync (p, data, encoding, flag, mode) {\n\t try {\n\t if (encoding) {\n\t data = Buffer.from(data, encoding);\n\t }\n\t var u8 = buffer2Uint8array(data);\n\t this._FS.writeFile(p, u8, { flags: flag.getFlagString(), encoding: 'binary' });\n\t this._FS.chmod(p, mode);\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.chmodSync = function chmodSync (p, isLchmod, mode) {\n\t try {\n\t isLchmod ? this._FS.lchmod(p, mode) : this._FS.chmod(p, mode);\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.chownSync = function chownSync (p, isLchown, uid, gid) {\n\t try {\n\t isLchown ? this._FS.lchown(p, uid, gid) : this._FS.chown(p, uid, gid);\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.symlinkSync = function symlinkSync (srcpath, dstpath, type) {\n\t try {\n\t this._FS.symlink(srcpath, dstpath);\n\t }\n\t catch (e) {\n\t throw convertError(e);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.readlinkSync = function readlinkSync (p) {\n\t try {\n\t return this._FS.readlink(p);\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.utimesSync = function utimesSync (p, atime, mtime) {\n\t try {\n\t this._FS.utime(p, atime.getTime(), mtime.getTime());\n\t }\n\t catch (e) {\n\t throw convertError(e, p);\n\t }\n\t };\n\t EmscriptenFileSystem.prototype.modeToFileType = function modeToFileType (mode) {\n\t if (this._FS.isDir(mode)) {\n\t return FileType.DIRECTORY;\n\t }\n\t else if (this._FS.isFile(mode)) {\n\t return FileType.FILE;\n\t }\n\t else if (this._FS.isLink(mode)) {\n\t return FileType.SYMLINK;\n\t }\n\t else {\n\t throw ApiError.EPERM((\"Invalid mode: \" + mode));\n\t }\n\t };\n\t\n\t return EmscriptenFileSystem;\n\t}(SynchronousFileSystem));\n\t\n\tEmscriptenFileSystem.Name = \"EmscriptenFileSystem\";\n\tEmscriptenFileSystem.Options = {\n\t FS: {\n\t type: \"object\",\n\t description: \"The Emscripten file system to use (the `FS` variable)\"\n\t }\n\t};\n\t\n\t/**\n\t * The FolderAdapter file system wraps a file system, and scopes all interactions to a subfolder of that file system.\n\t *\n\t * Example: Given a file system `foo` with folder `bar` and file `bar/baz`...\n\t *\n\t * ```javascript\n\t * BrowserFS.configure({\n\t * fs: \"FolderAdapter\",\n\t * options: {\n\t * folder: \"bar\",\n\t * wrapped: foo\n\t * }\n\t * }, function(e) {\n\t * var fs = BrowserFS.BFSRequire('fs');\n\t * fs.readdirSync('/'); // ['baz']\n\t * });\n\t * ```\n\t */\n\tvar FolderAdapter = (function (BaseFileSystem$$1) {\n\t function FolderAdapter(folder, wrapped) {\n\t BaseFileSystem$$1.call(this);\n\t this._folder = folder;\n\t this._wrapped = wrapped;\n\t }\n\t\n\t if ( BaseFileSystem$$1 ) FolderAdapter.__proto__ = BaseFileSystem$$1;\n\t FolderAdapter.prototype = Object.create( BaseFileSystem$$1 && BaseFileSystem$$1.prototype );\n\t FolderAdapter.prototype.constructor = FolderAdapter;\n\t /**\n\t * Creates a FolderAdapter instance with the given options.\n\t */\n\t FolderAdapter.Create = function Create (opts, cb) {\n\t cb(null, new FolderAdapter(opts.folder, opts.wrapped));\n\t };\n\t FolderAdapter.isAvailable = function isAvailable () {\n\t return true;\n\t };\n\t /**\n\t * Initialize the file system. Ensures that the wrapped file system\n\t * has the given folder.\n\t */\n\t FolderAdapter.prototype.initialize = function initialize (cb) {\n\t var this$1 = this;\n\t\n\t this._wrapped.exists(this._folder, function (exists) {\n\t if (exists) {\n\t cb();\n\t }\n\t else if (this$1._wrapped.isReadOnly()) {\n\t cb(ApiError.ENOENT(this$1._folder));\n\t }\n\t else {\n\t this$1._wrapped.mkdir(this$1._folder, 0x1ff, cb);\n\t }\n\t });\n\t };\n\t FolderAdapter.prototype.getName = function getName () { return this._wrapped.getName(); };\n\t FolderAdapter.prototype.isReadOnly = function isReadOnly () { return this._wrapped.isReadOnly(); };\n\t FolderAdapter.prototype.supportsProps = function supportsProps () { return this._wrapped.supportsProps(); };\n\t FolderAdapter.prototype.supportsSynch = function supportsSynch () { return this._wrapped.supportsSynch(); };\n\t FolderAdapter.prototype.supportsLinks = function supportsLinks () { return false; };\n\t\n\t return FolderAdapter;\n\t}(BaseFileSystem));\n\t\n\tFolderAdapter.Name = \"FolderAdapter\";\n\tFolderAdapter.Options = {\n\t folder: {\n\t type: \"string\",\n\t description: \"The folder to use as the root directory\"\n\t },\n\t wrapped: {\n\t type: \"object\",\n\t description: \"The file system to wrap\"\n\t }\n\t};\n\t/**\n\t * @hidden\n\t */\n\tfunction translateError(folder, e) {\n\t if (e !== null && typeof e === 'object') {\n\t var err = e;\n\t var p = err.path;\n\t if (p) {\n\t p = '/' + path.relative(folder, p);\n\t err.message = err.message.replace(err.path, p);\n\t err.path = p;\n\t }\n\t }\n\t return e;\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction wrapCallback(folder, cb) {\n\t if (typeof cb === 'function') {\n\t return function (err) {\n\t if (arguments.length > 0) {\n\t arguments[0] = translateError(folder, err);\n\t }\n\t cb.apply(null, arguments);\n\t };\n\t }\n\t else {\n\t return cb;\n\t }\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction wrapFunction(name, wrapFirst, wrapSecond) {\n\t if (name.slice(name.length - 4) !== 'Sync') {\n\t // Async function. Translate error in callback.\n\t return function () {\n\t if (arguments.length > 0) {\n\t if (wrapFirst) {\n\t arguments[0] = path.join(this._folder, arguments[0]);\n\t }\n\t if (wrapSecond) {\n\t arguments[1] = path.join(this._folder, arguments[1]);\n\t }\n\t arguments[arguments.length - 1] = wrapCallback(this._folder, arguments[arguments.length - 1]);\n\t }\n\t return this._wrapped[name].apply(this._wrapped, arguments);\n\t };\n\t }\n\t else {\n\t // Sync function. Translate error in catch.\n\t return function () {\n\t try {\n\t if (wrapFirst) {\n\t arguments[0] = path.join(this._folder, arguments[0]);\n\t }\n\t if (wrapSecond) {\n\t arguments[1] = path.join(this._folder, arguments[1]);\n\t }\n\t return this._wrapped[name].apply(this._wrapped, arguments);\n\t }\n\t catch (e) {\n\t throw translateError(this._folder, e);\n\t }\n\t };\n\t }\n\t}\n\t// First argument is a path.\n\t['diskSpace', 'stat', 'statSync', 'open', 'openSync', 'unlink', 'unlinkSync',\n\t 'rmdir', 'rmdirSync', 'mkdir', 'mkdirSync', 'readdir', 'readdirSync', 'exists',\n\t 'existsSync', 'realpath', 'realpathSync', 'truncate', 'truncateSync', 'readFile',\n\t 'readFileSync', 'writeFile', 'writeFileSync', 'appendFile', 'appendFileSync',\n\t 'chmod', 'chmodSync', 'chown', 'chownSync', 'utimes', 'utimesSync', 'readlink',\n\t 'readlinkSync'].forEach(function (name) {\n\t FolderAdapter.prototype[name] = wrapFunction(name, true, false);\n\t});\n\t// First and second arguments are paths.\n\t['rename', 'renameSync', 'link', 'linkSync', 'symlink', 'symlinkSync'].forEach(function (name) {\n\t FolderAdapter.prototype[name] = wrapFunction(name, true, true);\n\t});\n\t\n\t/**\n\t * @hidden\n\t */\n\tvar toExport;\n\tif (typeof (window) !== 'undefined') {\n\t toExport = window;\n\t}\n\telse if (typeof (self) !== 'undefined') {\n\t toExport = self;\n\t}\n\telse {\n\t toExport = global;\n\t}\n\tvar global$1 = toExport;\n\t\n\t/**\n\t * @hidden\n\t */\n\tfunction isDirectoryEntry(entry) {\n\t return entry.isDirectory;\n\t}\n\t/**\n\t * @hidden\n\t */\n\tvar _getFS = global$1.webkitRequestFileSystem || global$1.requestFileSystem || null;\n\t/**\n\t * @hidden\n\t */\n\tfunction _requestQuota(type, size, success, errorCallback) {\n\t // We cast navigator and window to '' because everything here is\n\t // nonstandard functionality, despite the fact that Chrome has the only\n\t // implementation of the HTML5FS and is likely driving the standardization\n\t // process. Thus, these objects defined off of navigator and window are not\n\t // present in the DefinitelyTyped TypeScript typings for FileSystem.\n\t if (typeof navigator['webkitPersistentStorage'] !== 'undefined') {\n\t switch (type) {\n\t case global$1.PERSISTENT:\n\t navigator.webkitPersistentStorage.requestQuota(size, success, errorCallback);\n\t break;\n\t case global$1.TEMPORARY:\n\t navigator.webkitTemporaryStorage.requestQuota(size, success, errorCallback);\n\t break;\n\t default:\n\t errorCallback(new TypeError((\"Invalid storage type: \" + type)));\n\t break;\n\t }\n\t }\n\t else {\n\t global$1.webkitStorageInfo.requestQuota(type, size, success, errorCallback);\n\t }\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction _toArray(list) {\n\t return Array.prototype.slice.call(list || [], 0);\n\t}\n\t/**\n\t * Converts the given DOMError into an appropriate ApiError.\n\t * @url https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n\t * @hidden\n\t */\n\tfunction convertError$1(err, p, expectedDir) {\n\t switch (err.name) {\n\t /* The user agent failed to create a file or directory due to the existence of a file or\n\t directory with the same path. */\n\t case \"PathExistsError\":\n\t return ApiError.EEXIST(p);\n\t /* The operation failed because it would cause the application to exceed its storage quota. */\n\t case 'QuotaExceededError':\n\t return ApiError.FileError(ErrorCode.ENOSPC, p);\n\t /* A required file or directory could not be found at the time an operation was processed. */\n\t case 'NotFoundError':\n\t return ApiError.ENOENT(p);\n\t /* This is a security error code to be used in situations not covered by any other error codes.\n\t - A required file was unsafe for access within a Web application\n\t - Too many calls are being made on filesystem resources */\n\t case 'SecurityError':\n\t return ApiError.FileError(ErrorCode.EACCES, p);\n\t /* The modification requested was illegal. Examples of invalid modifications include moving a\n\t directory into its own child, moving a file into its parent directory without changing its name,\n\t or copying a directory to a path occupied by a file. */\n\t case 'InvalidModificationError':\n\t return ApiError.FileError(ErrorCode.EPERM, p);\n\t /* The user has attempted to look up a file or directory, but the Entry found is of the wrong type\n\t [e.g. is a DirectoryEntry when the user requested a FileEntry]. */\n\t case 'TypeMismatchError':\n\t return ApiError.FileError(expectedDir ? ErrorCode.ENOTDIR : ErrorCode.EISDIR, p);\n\t /* A path or URL supplied to the API was malformed. */\n\t case \"EncodingError\":\n\t /* An operation depended on state cached in an interface object, but that state that has changed\n\t since it was read from disk. */\n\t case \"InvalidStateError\":\n\t /* The user attempted to write to a file or directory which could not be modified due to the state\n\t of the underlying filesystem. */\n\t case \"NoModificationAllowedError\":\n\t default:\n\t return ApiError.FileError(ErrorCode.EINVAL, p);\n\t }\n\t}\n\t// A note about getFile and getDirectory options:\n\t// These methods are called at numerous places in this file, and are passed\n\t// some combination of these two options:\n\t// - create: If true, the entry will be created if it doesn't exist.\n\t// If false, an error will be thrown if it doesn't exist.\n\t// - exclusive: If true, only create the entry if it doesn't already exist,\n\t// and throw an error if it does.\n\tvar HTML5FSFile = (function (PreloadFile$$1) {\n\t function HTML5FSFile(fs, entry, path$$1, flag, stat, contents) {\n\t PreloadFile$$1.call(this, fs, path$$1, flag, stat, contents);\n\t this._entry = entry;\n\t }\n\t\n\t if ( PreloadFile$$1 ) HTML5FSFile.__proto__ = PreloadFile$$1;\n\t HTML5FSFile.prototype = Object.create( PreloadFile$$1 && PreloadFile$$1.prototype );\n\t HTML5FSFile.prototype.constructor = HTML5FSFile;\n\t HTML5FSFile.prototype.sync = function sync (cb) {\n\t var this$1 = this;\n\t\n\t if (!this.isDirty()) {\n\t return cb();\n\t }\n\t this._entry.createWriter(function (writer) {\n\t var buffer$$1 = this$1.getBuffer();\n\t var blob = new Blob([buffer2ArrayBuffer(buffer$$1)]);\n\t var length = blob.size;\n\t writer.onwriteend = function (err) {\n\t writer.onwriteend = null;\n\t writer.onerror = null;\n\t writer.truncate(length);\n\t this$1.resetDirty();\n\t cb();\n\t };\n\t writer.onerror = function (err) {\n\t cb(convertError$1(err, this$1.getPath(), false));\n\t };\n\t writer.write(blob);\n\t });\n\t };\n\t HTML5FSFile.prototype.close = function close (cb) {\n\t this.sync(cb);\n\t };\n\t\n\t return HTML5FSFile;\n\t}(PreloadFile));\n\t/**\n\t * A read-write filesystem backed by the HTML5 FileSystem API.\n\t *\n\t * As the HTML5 FileSystem is only implemented in Blink, this interface is\n\t * only available in Chrome.\n\t */\n\tvar HTML5FS = (function (BaseFileSystem$$1) {\n\t function HTML5FS(size, type, deprecateMsg) {\n\t if ( size === void 0 ) size = 5;\n\t if ( type === void 0 ) type = global$1.PERSISTENT;\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t BaseFileSystem$$1.call(this);\n\t // Convert MB to bytes.\n\t this.size = 1024 * 1024 * size;\n\t this.type = type;\n\t deprecationMessage(deprecateMsg, HTML5FS.Name, { size: size, type: type });\n\t }\n\t\n\t if ( BaseFileSystem$$1 ) HTML5FS.__proto__ = BaseFileSystem$$1;\n\t HTML5FS.prototype = Object.create( BaseFileSystem$$1 && BaseFileSystem$$1.prototype );\n\t HTML5FS.prototype.constructor = HTML5FS;\n\t /**\n\t * Creates an HTML5FS instance with the given options.\n\t */\n\t HTML5FS.Create = function Create (opts, cb) {\n\t var fs = new HTML5FS(opts.size, opts.type, false);\n\t fs.allocate(function (e) { return e ? cb(e) : cb(null, fs); }, false);\n\t };\n\t HTML5FS.isAvailable = function isAvailable () {\n\t return !!_getFS;\n\t };\n\t HTML5FS.prototype.getName = function getName () {\n\t return HTML5FS.Name;\n\t };\n\t HTML5FS.prototype.isReadOnly = function isReadOnly () {\n\t return false;\n\t };\n\t HTML5FS.prototype.supportsSymlinks = function supportsSymlinks () {\n\t return false;\n\t };\n\t HTML5FS.prototype.supportsProps = function supportsProps () {\n\t return false;\n\t };\n\t HTML5FS.prototype.supportsSynch = function supportsSynch () {\n\t return false;\n\t };\n\t /**\n\t * **Deprecated. Please use Create() method instead to create and allocate an HTML5FS.**\n\t *\n\t * Requests a storage quota from the browser to back this FS.\n\t * Must be called before file system can be used!\n\t */\n\t HTML5FS.prototype.allocate = function allocate (cb, deprecateMsg) {\n\t var this$1 = this;\n\t if ( cb === void 0 ) cb = function () { };\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t if (deprecateMsg) {\n\t console.warn((\"[HTML5FS] HTML5FS.allocate() is deprecated and will be removed in the next major release. Please use 'HTML5FS.Create({type: \" + (this.type) + \", size: \" + (this.size) + \"}, cb)' to create and allocate HTML5FS instances.\"));\n\t }\n\t var success = function (fs) {\n\t this$1.fs = fs;\n\t cb();\n\t };\n\t var error = function (err) {\n\t cb(convertError$1(err, \"/\", true));\n\t };\n\t if (this.type === global$1.PERSISTENT) {\n\t _requestQuota(this.type, this.size, function (granted) {\n\t _getFS(this$1.type, granted, success, error);\n\t }, error);\n\t }\n\t else {\n\t _getFS(this.type, this.size, success, error);\n\t }\n\t };\n\t /**\n\t * Deletes everything in the FS. Used for testing.\n\t * Karma clears the storage after you quit it but not between runs of the test\n\t * suite, and the tests expect an empty FS every time.\n\t */\n\t HTML5FS.prototype.empty = function empty (mainCb) {\n\t // Get a list of all entries in the root directory to delete them\n\t this._readdir('/', function (err, entries) {\n\t if (err) {\n\t console.error('Failed to empty FS');\n\t mainCb(err);\n\t }\n\t else {\n\t // Called when every entry has been operated on\n\t var finished = function (er) {\n\t if (err) {\n\t console.error(\"Failed to empty FS\");\n\t mainCb(err);\n\t }\n\t else {\n\t mainCb();\n\t }\n\t };\n\t // Removes files and recursively removes directories\n\t var deleteEntry = function (entry, cb) {\n\t var succ = function () {\n\t cb();\n\t };\n\t var error = function (err) {\n\t cb(convertError$1(err, entry.fullPath, !entry.isDirectory));\n\t };\n\t if (isDirectoryEntry(entry)) {\n\t entry.removeRecursively(succ, error);\n\t }\n\t else {\n\t entry.remove(succ, error);\n\t }\n\t };\n\t // Loop through the entries and remove them, then call the callback\n\t // when they're all finished.\n\t eachLimit(entries, deleteEntry, finished);\n\t }\n\t });\n\t };\n\t HTML5FS.prototype.rename = function rename (oldPath, newPath, cb) {\n\t var this$1 = this;\n\t\n\t var semaphore = 2;\n\t var successCount = 0;\n\t var root = this.fs.root;\n\t var currentPath = oldPath;\n\t var error = function (err) {\n\t if (--semaphore <= 0) {\n\t cb(convertError$1(err, currentPath, false));\n\t }\n\t };\n\t var success = function (file) {\n\t if (++successCount === 2) {\n\t return cb(new ApiError(ErrorCode.EINVAL, \"Something was identified as both a file and a directory. This should never happen.\"));\n\t }\n\t // SPECIAL CASE: If newPath === oldPath, and the path exists, then\n\t // this operation trivially succeeds.\n\t if (oldPath === newPath) {\n\t return cb();\n\t }\n\t // Get the new parent directory.\n\t currentPath = path.dirname(newPath);\n\t root.getDirectory(currentPath, {}, function (parentDir) {\n\t currentPath = path.basename(newPath);\n\t file.moveTo(parentDir, currentPath, function (entry) { cb(); }, function (err) {\n\t // SPECIAL CASE: If oldPath is a directory, and newPath is a\n\t // file, rename should delete the file and perform the move.\n\t if (file.isDirectory) {\n\t currentPath = newPath;\n\t // Unlink only works on files. Try to delete newPath.\n\t this$1.unlink(newPath, function (e) {\n\t if (e) {\n\t // newPath is probably a directory.\n\t error(err);\n\t }\n\t else {\n\t // Recur, now that newPath doesn't exist.\n\t this$1.rename(oldPath, newPath, cb);\n\t }\n\t });\n\t }\n\t else {\n\t error(err);\n\t }\n\t });\n\t }, error);\n\t };\n\t // We don't know if oldPath is a *file* or a *directory*, and there's no\n\t // way to stat items. So launch both requests, see which one succeeds.\n\t root.getFile(oldPath, {}, success, error);\n\t root.getDirectory(oldPath, {}, success, error);\n\t };\n\t HTML5FS.prototype.stat = function stat (path$$1, isLstat, cb) {\n\t var this$1 = this;\n\t\n\t // Throw an error if the entry doesn't exist, because then there's nothing\n\t // to stat.\n\t var opts = {\n\t create: false\n\t };\n\t // Called when the path has been successfully loaded as a file.\n\t var loadAsFile = function (entry) {\n\t var fileFromEntry = function (file) {\n\t var stat = new Stats(FileType.FILE, file.size);\n\t cb(null, stat);\n\t };\n\t entry.file(fileFromEntry, failedToLoad);\n\t };\n\t // Called when the path has been successfully loaded as a directory.\n\t var loadAsDir = function (dir$$1) {\n\t // Directory entry size can't be determined from the HTML5 FS API, and is\n\t // implementation-dependant anyway, so a dummy value is used.\n\t var size = 4096;\n\t var stat = new Stats(FileType.DIRECTORY, size);\n\t cb(null, stat);\n\t };\n\t // Called when the path couldn't be opened as a directory or a file.\n\t var failedToLoad = function (err) {\n\t cb(convertError$1(err, path$$1, false /* Unknown / irrelevant */));\n\t };\n\t // Called when the path couldn't be opened as a file, but might still be a\n\t // directory.\n\t var failedToLoadAsFile = function () {\n\t this$1.fs.root.getDirectory(path$$1, opts, loadAsDir, failedToLoad);\n\t };\n\t // No method currently exists to determine whether a path refers to a\n\t // directory or a file, so this implementation tries both and uses the first\n\t // one that succeeds.\n\t this.fs.root.getFile(path$$1, opts, loadAsFile, failedToLoadAsFile);\n\t };\n\t HTML5FS.prototype.open = function open (p, flags, mode, cb) {\n\t var this$1 = this;\n\t\n\t // XXX: err is a DOMError\n\t var error = function (err) {\n\t if (err.name === 'InvalidModificationError' && flags.isExclusive()) {\n\t cb(ApiError.EEXIST(p));\n\t }\n\t else {\n\t cb(convertError$1(err, p, false));\n\t }\n\t };\n\t this.fs.root.getFile(p, {\n\t create: flags.pathNotExistsAction() === ActionType.CREATE_FILE,\n\t exclusive: flags.isExclusive()\n\t }, function (entry) {\n\t // Try to fetch corresponding file.\n\t entry.file(function (file) {\n\t var reader = new FileReader();\n\t reader.onloadend = function (event) {\n\t var bfsFile = this$1._makeFile(p, entry, flags, file, reader.result);\n\t cb(null, bfsFile);\n\t };\n\t reader.onerror = function (ev) {\n\t error(reader.error);\n\t };\n\t reader.readAsArrayBuffer(file);\n\t }, error);\n\t }, error);\n\t };\n\t HTML5FS.prototype.unlink = function unlink (path$$1, cb) {\n\t this._remove(path$$1, cb, true);\n\t };\n\t HTML5FS.prototype.rmdir = function rmdir (path$$1, cb) {\n\t var this$1 = this;\n\t\n\t // Check if directory is non-empty, first.\n\t this.readdir(path$$1, function (e, files) {\n\t if (e) {\n\t cb(e);\n\t }\n\t else if (files.length > 0) {\n\t cb(ApiError.ENOTEMPTY(path$$1));\n\t }\n\t else {\n\t this$1._remove(path$$1, cb, false);\n\t }\n\t });\n\t };\n\t HTML5FS.prototype.mkdir = function mkdir (path$$1, mode, cb) {\n\t // Create the directory, but throw an error if it already exists, as per\n\t // mkdir(1)\n\t var opts = {\n\t create: true,\n\t exclusive: true\n\t };\n\t var success = function (dir$$1) {\n\t cb();\n\t };\n\t var error = function (err) {\n\t cb(convertError$1(err, path$$1, true));\n\t };\n\t this.fs.root.getDirectory(path$$1, opts, success, error);\n\t };\n\t /**\n\t * Map _readdir's list of `FileEntry`s to their names and return that.\n\t */\n\t HTML5FS.prototype.readdir = function readdir (path$$1, cb) {\n\t this._readdir(path$$1, function (e, entries) {\n\t if (entries) {\n\t var rv = [];\n\t for (var i = 0, list = entries; i < list.length; i += 1) {\n\t var entry = list[i];\n\t\n\t rv.push(entry.name);\n\t }\n\t cb(null, rv);\n\t }\n\t else {\n\t return cb(e);\n\t }\n\t });\n\t };\n\t /**\n\t * Returns a BrowserFS object representing a File.\n\t */\n\t HTML5FS.prototype._makeFile = function _makeFile (path$$1, entry, flag, stat, data) {\n\t if ( data === void 0 ) data = new ArrayBuffer(0);\n\t\n\t var stats = new Stats(FileType.FILE, stat.size);\n\t var buffer$$1 = arrayBuffer2Buffer(data);\n\t return new HTML5FSFile(this, entry, path$$1, flag, stats, buffer$$1);\n\t };\n\t /**\n\t * Returns an array of `FileEntry`s. Used internally by empty and readdir.\n\t */\n\t HTML5FS.prototype._readdir = function _readdir (path$$1, cb) {\n\t var error = function (err) {\n\t cb(convertError$1(err, path$$1, true));\n\t };\n\t // Grab the requested directory.\n\t this.fs.root.getDirectory(path$$1, { create: false }, function (dirEntry) {\n\t var reader = dirEntry.createReader();\n\t var entries = [];\n\t // Call the reader.readEntries() until no more results are returned.\n\t var readEntries = function () {\n\t reader.readEntries((function (results) {\n\t if (results.length) {\n\t entries = entries.concat(_toArray(results));\n\t readEntries();\n\t }\n\t else {\n\t cb(null, entries);\n\t }\n\t }), error);\n\t };\n\t readEntries();\n\t }, error);\n\t };\n\t /**\n\t * Delete a file or directory from the file system\n\t * isFile should reflect which call was made to remove the it (`unlink` or\n\t * `rmdir`). If this doesn't match what's actually at `path`, an error will be\n\t * returned\n\t */\n\t HTML5FS.prototype._remove = function _remove (path$$1, cb, isFile) {\n\t var success = function (entry) {\n\t var succ = function () {\n\t cb();\n\t };\n\t var err = function (err) {\n\t cb(convertError$1(err, path$$1, !isFile));\n\t };\n\t entry.remove(succ, err);\n\t };\n\t var error = function (err) {\n\t cb(convertError$1(err, path$$1, !isFile));\n\t };\n\t // Deleting the entry, so don't create it\n\t var opts = {\n\t create: false\n\t };\n\t if (isFile) {\n\t this.fs.root.getFile(path$$1, opts, success, error);\n\t }\n\t else {\n\t this.fs.root.getDirectory(path$$1, opts, success, error);\n\t }\n\t };\n\t\n\t return HTML5FS;\n\t}(BaseFileSystem));\n\t\n\tHTML5FS.Name = \"HTML5FS\";\n\tHTML5FS.Options = {\n\t size: {\n\t type: \"number\",\n\t optional: true,\n\t description: \"Storage quota to request, in megabytes. Allocated value may be less. Defaults to 5.\"\n\t },\n\t type: {\n\t type: \"number\",\n\t optional: true,\n\t description: \"window.PERSISTENT or window.TEMPORARY. Defaults to PERSISTENT.\"\n\t }\n\t};\n\t\n\t/**\n\t * Generic inode definition that can easily be serialized.\n\t */\n\tvar Inode = function Inode(id, size, mode, atime, mtime, ctime) {\n\t this.id = id;\n\t this.size = size;\n\t this.mode = mode;\n\t this.atime = atime;\n\t this.mtime = mtime;\n\t this.ctime = ctime;\n\t};\n\t/**\n\t * Converts the buffer into an Inode.\n\t */\n\tInode.fromBuffer = function fromBuffer (buffer$$1) {\n\t if (buffer$$1 === undefined) {\n\t throw new Error(\"NO\");\n\t }\n\t return new Inode(buffer$$1.toString('ascii', 30), buffer$$1.readUInt32LE(0), buffer$$1.readUInt16LE(4), buffer$$1.readDoubleLE(6), buffer$$1.readDoubleLE(14), buffer$$1.readDoubleLE(22));\n\t};\n\t/**\n\t * Handy function that converts the Inode to a Node Stats object.\n\t */\n\tInode.prototype.toStats = function toStats () {\n\t return new Stats((this.mode & 0xF000) === FileType.DIRECTORY ? FileType.DIRECTORY : FileType.FILE, this.size, this.mode, new Date(this.atime), new Date(this.mtime), new Date(this.ctime));\n\t};\n\t/**\n\t * Get the size of this Inode, in bytes.\n\t */\n\tInode.prototype.getSize = function getSize () {\n\t // ASSUMPTION: ID is ASCII (1 byte per char).\n\t return 30 + this.id.length;\n\t};\n\t/**\n\t * Writes the inode into the start of the buffer.\n\t */\n\tInode.prototype.toBuffer = function toBuffer (buff) {\n\t if ( buff === void 0 ) buff = Buffer.alloc(this.getSize());\n\t\n\t buff.writeUInt32LE(this.size, 0);\n\t buff.writeUInt16LE(this.mode, 4);\n\t buff.writeDoubleLE(this.atime, 6);\n\t buff.writeDoubleLE(this.mtime, 14);\n\t buff.writeDoubleLE(this.ctime, 22);\n\t buff.write(this.id, 30, this.id.length, 'ascii');\n\t return buff;\n\t};\n\t/**\n\t * Updates the Inode using information from the stats object. Used by file\n\t * systems at sync time, e.g.:\n\t * - Program opens file and gets a File object.\n\t * - Program mutates file. File object is responsible for maintaining\n\t * metadata changes locally -- typically in a Stats object.\n\t * - Program closes file. File object's metadata changes are synced with the\n\t * file system.\n\t * @return True if any changes have occurred.\n\t */\n\tInode.prototype.update = function update (stats) {\n\t var hasChanged = false;\n\t if (this.size !== stats.size) {\n\t this.size = stats.size;\n\t hasChanged = true;\n\t }\n\t if (this.mode !== stats.mode) {\n\t this.mode = stats.mode;\n\t hasChanged = true;\n\t }\n\t var atimeMs = stats.atime.getTime();\n\t if (this.atime !== atimeMs) {\n\t this.atime = atimeMs;\n\t hasChanged = true;\n\t }\n\t var mtimeMs = stats.mtime.getTime();\n\t if (this.mtime !== mtimeMs) {\n\t this.mtime = mtimeMs;\n\t hasChanged = true;\n\t }\n\t var ctimeMs = stats.ctime.getTime();\n\t if (this.ctime !== ctimeMs) {\n\t this.ctime = ctimeMs;\n\t hasChanged = true;\n\t }\n\t return hasChanged;\n\t};\n\t// XXX: Copied from Stats. Should reconcile these two into something more\n\t// compact.\n\t/**\n\t * @return [Boolean] True if this item is a file.\n\t */\n\tInode.prototype.isFile = function isFile () {\n\t return (this.mode & 0xF000) === FileType.FILE;\n\t};\n\t/**\n\t * @return [Boolean] True if this item is a directory.\n\t */\n\tInode.prototype.isDirectory = function isDirectory () {\n\t return (this.mode & 0xF000) === FileType.DIRECTORY;\n\t};\n\t\n\t/**\n\t * @hidden\n\t */\n\tvar ROOT_NODE_ID = \"/\";\n\t/**\n\t * @hidden\n\t */\n\tvar emptyDirNode = null;\n\t/**\n\t * Returns an empty directory node.\n\t * @hidden\n\t */\n\tfunction getEmptyDirNode() {\n\t if (emptyDirNode) {\n\t return emptyDirNode;\n\t }\n\t return emptyDirNode = Buffer.from(\"{}\");\n\t}\n\t/**\n\t * Generates a random ID.\n\t * @hidden\n\t */\n\tfunction GenerateRandomID() {\n\t // From http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\n\t return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n\t var r = Math.random() * 16 | 0;\n\t var v = c === 'x' ? r : (r & 0x3 | 0x8);\n\t return v.toString(16);\n\t });\n\t}\n\t/**\n\t * Helper function. Checks if 'e' is defined. If so, it triggers the callback\n\t * with 'e' and returns false. Otherwise, returns true.\n\t * @hidden\n\t */\n\tfunction noError(e, cb) {\n\t if (e) {\n\t cb(e);\n\t return false;\n\t }\n\t return true;\n\t}\n\t/**\n\t * Helper function. Checks if 'e' is defined. If so, it aborts the transaction,\n\t * triggers the callback with 'e', and returns false. Otherwise, returns true.\n\t * @hidden\n\t */\n\tfunction noErrorTx(e, tx, cb) {\n\t if (e) {\n\t tx.abort(function () {\n\t cb(e);\n\t });\n\t return false;\n\t }\n\t return true;\n\t}\n\t/**\n\t * A simple RW transaction for simple synchronous key-value stores.\n\t */\n\tvar SimpleSyncRWTransaction = function SimpleSyncRWTransaction(store) {\n\t this.store = store;\n\t /**\n\t * Stores data in the keys we modify prior to modifying them.\n\t * Allows us to roll back commits.\n\t */\n\t this.originalData = {};\n\t /**\n\t * List of keys modified in this transaction, if any.\n\t */\n\t this.modifiedKeys = [];\n\t};\n\tSimpleSyncRWTransaction.prototype.get = function get (key) {\n\t var val = this.store.get(key);\n\t this.stashOldValue(key, val);\n\t return val;\n\t};\n\tSimpleSyncRWTransaction.prototype.put = function put (key, data, overwrite) {\n\t this.markModified(key);\n\t return this.store.put(key, data, overwrite);\n\t};\n\tSimpleSyncRWTransaction.prototype.del = function del (key) {\n\t this.markModified(key);\n\t this.store.del(key);\n\t};\n\tSimpleSyncRWTransaction.prototype.commit = function commit () { };\n\tSimpleSyncRWTransaction.prototype.abort = function abort () {\n\t var this$1 = this;\n\t\n\t // Rollback old values.\n\t for (var i = 0, list = this$1.modifiedKeys; i < list.length; i += 1) {\n\t var key = list[i];\n\t\n\t var value = this$1.originalData[key];\n\t if (!value) {\n\t // Key didn't exist.\n\t this$1.store.del(key);\n\t }\n\t else {\n\t // Key existed. Store old value.\n\t this$1.store.put(key, value, true);\n\t }\n\t }\n\t};\n\t/**\n\t * Stashes given key value pair into `originalData` if it doesn't already\n\t * exist. Allows us to stash values the program is requesting anyway to\n\t * prevent needless `get` requests if the program modifies the data later\n\t * on during the transaction.\n\t */\n\tSimpleSyncRWTransaction.prototype.stashOldValue = function stashOldValue (key, value) {\n\t // Keep only the earliest value in the transaction.\n\t if (!this.originalData.hasOwnProperty(key)) {\n\t this.originalData[key] = value;\n\t }\n\t};\n\t/**\n\t * Marks the given key as modified, and stashes its value if it has not been\n\t * stashed already.\n\t */\n\tSimpleSyncRWTransaction.prototype.markModified = function markModified (key) {\n\t if (this.modifiedKeys.indexOf(key) === -1) {\n\t this.modifiedKeys.push(key);\n\t if (!this.originalData.hasOwnProperty(key)) {\n\t this.originalData[key] = this.store.get(key);\n\t }\n\t }\n\t};\n\tvar SyncKeyValueFile = (function (PreloadFile$$1) {\n\t function SyncKeyValueFile(_fs, _path, _flag, _stat, contents) {\n\t PreloadFile$$1.call(this, _fs, _path, _flag, _stat, contents);\n\t }\n\t\n\t if ( PreloadFile$$1 ) SyncKeyValueFile.__proto__ = PreloadFile$$1;\n\t SyncKeyValueFile.prototype = Object.create( PreloadFile$$1 && PreloadFile$$1.prototype );\n\t SyncKeyValueFile.prototype.constructor = SyncKeyValueFile;\n\t SyncKeyValueFile.prototype.syncSync = function syncSync () {\n\t if (this.isDirty()) {\n\t this._fs._syncSync(this.getPath(), this.getBuffer(), this.getStats());\n\t this.resetDirty();\n\t }\n\t };\n\t SyncKeyValueFile.prototype.closeSync = function closeSync () {\n\t this.syncSync();\n\t };\n\t\n\t return SyncKeyValueFile;\n\t}(PreloadFile));\n\t/**\n\t * A \"Synchronous key-value file system\". Stores data to/retrieves data from an\n\t * underlying key-value store.\n\t *\n\t * We use a unique ID for each node in the file system. The root node has a\n\t * fixed ID.\n\t * @todo Introduce Node ID caching.\n\t * @todo Check modes.\n\t */\n\tvar SyncKeyValueFileSystem = (function (SynchronousFileSystem$$1) {\n\t function SyncKeyValueFileSystem(options) {\n\t SynchronousFileSystem$$1.call(this);\n\t this.store = options.store;\n\t // INVARIANT: Ensure that the root exists.\n\t this.makeRootDirectory();\n\t }\n\t\n\t if ( SynchronousFileSystem$$1 ) SyncKeyValueFileSystem.__proto__ = SynchronousFileSystem$$1;\n\t SyncKeyValueFileSystem.prototype = Object.create( SynchronousFileSystem$$1 && SynchronousFileSystem$$1.prototype );\n\t SyncKeyValueFileSystem.prototype.constructor = SyncKeyValueFileSystem;\n\t SyncKeyValueFileSystem.isAvailable = function isAvailable () { return true; };\n\t\n\t SyncKeyValueFileSystem.prototype.getName = function getName () { return this.store.name(); };\n\t SyncKeyValueFileSystem.prototype.isReadOnly = function isReadOnly () { return false; };\n\t SyncKeyValueFileSystem.prototype.supportsSymlinks = function supportsSymlinks () { return false; };\n\t SyncKeyValueFileSystem.prototype.supportsProps = function supportsProps () { return false; };\n\t SyncKeyValueFileSystem.prototype.supportsSynch = function supportsSynch () { return true; };\n\t /**\n\t * Delete all contents stored in the file system.\n\t */\n\t SyncKeyValueFileSystem.prototype.empty = function empty () {\n\t this.store.clear();\n\t // INVARIANT: Root always exists.\n\t this.makeRootDirectory();\n\t };\n\t SyncKeyValueFileSystem.prototype.renameSync = function renameSync (oldPath, newPath) {\n\t var tx = this.store.beginTransaction('readwrite'), oldParent = path.dirname(oldPath), oldName = path.basename(oldPath), newParent = path.dirname(newPath), newName = path.basename(newPath), \n\t // Remove oldPath from parent's directory listing.\n\t oldDirNode = this.findINode(tx, oldParent), oldDirList = this.getDirListing(tx, oldParent, oldDirNode);\n\t if (!oldDirList[oldName]) {\n\t throw ApiError.ENOENT(oldPath);\n\t }\n\t var nodeId = oldDirList[oldName];\n\t delete oldDirList[oldName];\n\t // Invariant: Can't move a folder inside itself.\n\t // This funny little hack ensures that the check passes only if oldPath\n\t // is a subpath of newParent. We append '/' to avoid matching folders that\n\t // are a substring of the bottom-most folder in the path.\n\t if ((newParent + '/').indexOf(oldPath + '/') === 0) {\n\t throw new ApiError(ErrorCode.EBUSY, oldParent);\n\t }\n\t // Add newPath to parent's directory listing.\n\t var newDirNode, newDirList;\n\t if (newParent === oldParent) {\n\t // Prevent us from re-grabbing the same directory listing, which still\n\t // contains oldName.\n\t newDirNode = oldDirNode;\n\t newDirList = oldDirList;\n\t }\n\t else {\n\t newDirNode = this.findINode(tx, newParent);\n\t newDirList = this.getDirListing(tx, newParent, newDirNode);\n\t }\n\t if (newDirList[newName]) {\n\t // If it's a file, delete it.\n\t var newNameNode = this.getINode(tx, newPath, newDirList[newName]);\n\t if (newNameNode.isFile()) {\n\t try {\n\t tx.del(newNameNode.id);\n\t tx.del(newDirList[newName]);\n\t }\n\t catch (e) {\n\t tx.abort();\n\t throw e;\n\t }\n\t }\n\t else {\n\t // If it's a directory, throw a permissions error.\n\t throw ApiError.EPERM(newPath);\n\t }\n\t }\n\t newDirList[newName] = nodeId;\n\t // Commit the two changed directory listings.\n\t try {\n\t tx.put(oldDirNode.id, Buffer.from(JSON.stringify(oldDirList)), true);\n\t tx.put(newDirNode.id, Buffer.from(JSON.stringify(newDirList)), true);\n\t }\n\t catch (e) {\n\t tx.abort();\n\t throw e;\n\t }\n\t tx.commit();\n\t };\n\t SyncKeyValueFileSystem.prototype.statSync = function statSync (p, isLstat) {\n\t // Get the inode to the item, convert it into a Stats object.\n\t return this.findINode(this.store.beginTransaction('readonly'), p).toStats();\n\t };\n\t SyncKeyValueFileSystem.prototype.createFileSync = function createFileSync (p, flag, mode) {\n\t var tx = this.store.beginTransaction('readwrite'), data = emptyBuffer(), newFile = this.commitNewFile(tx, p, FileType.FILE, mode, data);\n\t // Open the file.\n\t return new SyncKeyValueFile(this, p, flag, newFile.toStats(), data);\n\t };\n\t SyncKeyValueFileSystem.prototype.openFileSync = function openFileSync (p, flag) {\n\t var tx = this.store.beginTransaction('readonly'), node = this.findINode(tx, p), data = tx.get(node.id);\n\t if (data === undefined) {\n\t throw ApiError.ENOENT(p);\n\t }\n\t return new SyncKeyValueFile(this, p, flag, node.toStats(), data);\n\t };\n\t SyncKeyValueFileSystem.prototype.unlinkSync = function unlinkSync (p) {\n\t this.removeEntry(p, false);\n\t };\n\t SyncKeyValueFileSystem.prototype.rmdirSync = function rmdirSync (p) {\n\t // Check first if directory is empty.\n\t if (this.readdirSync(p).length > 0) {\n\t throw ApiError.ENOTEMPTY(p);\n\t }\n\t else {\n\t this.removeEntry(p, true);\n\t }\n\t };\n\t SyncKeyValueFileSystem.prototype.mkdirSync = function mkdirSync (p, mode) {\n\t var tx = this.store.beginTransaction('readwrite'), data = Buffer.from('{}');\n\t this.commitNewFile(tx, p, FileType.DIRECTORY, mode, data);\n\t };\n\t SyncKeyValueFileSystem.prototype.readdirSync = function readdirSync (p) {\n\t var tx = this.store.beginTransaction('readonly');\n\t return Object.keys(this.getDirListing(tx, p, this.findINode(tx, p)));\n\t };\n\t SyncKeyValueFileSystem.prototype._syncSync = function _syncSync (p, data, stats) {\n\t // @todo Ensure mtime updates properly, and use that to determine if a data\n\t // update is required.\n\t var tx = this.store.beginTransaction('readwrite'), \n\t // We use the _findInode helper because we actually need the INode id.\n\t fileInodeId = this._findINode(tx, path.dirname(p), path.basename(p)), fileInode = this.getINode(tx, p, fileInodeId), inodeChanged = fileInode.update(stats);\n\t try {\n\t // Sync data.\n\t tx.put(fileInode.id, data, true);\n\t // Sync metadata.\n\t if (inodeChanged) {\n\t tx.put(fileInodeId, fileInode.toBuffer(), true);\n\t }\n\t }\n\t catch (e) {\n\t tx.abort();\n\t throw e;\n\t }\n\t tx.commit();\n\t };\n\t /**\n\t * Checks if the root directory exists. Creates it if it doesn't.\n\t */\n\t SyncKeyValueFileSystem.prototype.makeRootDirectory = function makeRootDirectory () {\n\t var tx = this.store.beginTransaction('readwrite');\n\t if (tx.get(ROOT_NODE_ID) === undefined) {\n\t // Create new inode.\n\t var currTime = (new Date()).getTime(), \n\t // Mode 0666\n\t dirInode = new Inode(GenerateRandomID(), 4096, 511 | FileType.DIRECTORY, currTime, currTime, currTime);\n\t // If the root doesn't exist, the first random ID shouldn't exist,\n\t // either.\n\t tx.put(dirInode.id, getEmptyDirNode(), false);\n\t tx.put(ROOT_NODE_ID, dirInode.toBuffer(), false);\n\t tx.commit();\n\t }\n\t };\n\t /**\n\t * Helper function for findINode.\n\t * @param parent The parent directory of the file we are attempting to find.\n\t * @param filename The filename of the inode we are attempting to find, minus\n\t * the parent.\n\t * @return string The ID of the file's inode in the file system.\n\t */\n\t SyncKeyValueFileSystem.prototype._findINode = function _findINode (tx, parent, filename) {\n\t var this$1 = this;\n\t\n\t var readDirectory = function (inode) {\n\t // Get the root's directory listing.\n\t var dirList = this$1.getDirListing(tx, parent, inode);\n\t // Get the file's ID.\n\t if (dirList[filename]) {\n\t return dirList[filename];\n\t }\n\t else {\n\t throw ApiError.ENOENT(path.resolve(parent, filename));\n\t }\n\t };\n\t if (parent === '/') {\n\t if (filename === '') {\n\t // BASE CASE #1: Return the root's ID.\n\t return ROOT_NODE_ID;\n\t }\n\t else {\n\t // BASE CASE #2: Find the item in the root ndoe.\n\t return readDirectory(this.getINode(tx, parent, ROOT_NODE_ID));\n\t }\n\t }\n\t else {\n\t return readDirectory(this.getINode(tx, parent + path.sep + filename, this._findINode(tx, path.dirname(parent), path.basename(parent))));\n\t }\n\t };\n\t /**\n\t * Finds the Inode of the given path.\n\t * @param p The path to look up.\n\t * @return The Inode of the path p.\n\t * @todo memoize/cache\n\t */\n\t SyncKeyValueFileSystem.prototype.findINode = function findINode (tx, p) {\n\t return this.getINode(tx, p, this._findINode(tx, path.dirname(p), path.basename(p)));\n\t };\n\t /**\n\t * Given the ID of a node, retrieves the corresponding Inode.\n\t * @param tx The transaction to use.\n\t * @param p The corresponding path to the file (used for error messages).\n\t * @param id The ID to look up.\n\t */\n\t SyncKeyValueFileSystem.prototype.getINode = function getINode (tx, p, id) {\n\t var inode = tx.get(id);\n\t if (inode === undefined) {\n\t throw ApiError.ENOENT(p);\n\t }\n\t return Inode.fromBuffer(inode);\n\t };\n\t /**\n\t * Given the Inode of a directory, retrieves the corresponding directory\n\t * listing.\n\t */\n\t SyncKeyValueFileSystem.prototype.getDirListing = function getDirListing (tx, p, inode) {\n\t if (!inode.isDirectory()) {\n\t throw ApiError.ENOTDIR(p);\n\t }\n\t var data = tx.get(inode.id);\n\t if (data === undefined) {\n\t throw ApiError.ENOENT(p);\n\t }\n\t return JSON.parse(data.toString());\n\t };\n\t /**\n\t * Creates a new node under a random ID. Retries 5 times before giving up in\n\t * the exceedingly unlikely chance that we try to reuse a random GUID.\n\t * @return The GUID that the data was stored under.\n\t */\n\t SyncKeyValueFileSystem.prototype.addNewNode = function addNewNode (tx, data) {\n\t var retries = 0;\n\t var currId;\n\t while (retries < 5) {\n\t try {\n\t currId = GenerateRandomID();\n\t tx.put(currId, data, false);\n\t return currId;\n\t }\n\t catch (e) {\n\t // Ignore and reroll.\n\t }\n\t }\n\t throw new ApiError(ErrorCode.EIO, 'Unable to commit data to key-value store.');\n\t };\n\t /**\n\t * Commits a new file (well, a FILE or a DIRECTORY) to the file system with\n\t * the given mode.\n\t * Note: This will commit the transaction.\n\t * @param p The path to the new file.\n\t * @param type The type of the new file.\n\t * @param mode The mode to create the new file with.\n\t * @param data The data to store at the file's data node.\n\t * @return The Inode for the new file.\n\t */\n\t SyncKeyValueFileSystem.prototype.commitNewFile = function commitNewFile (tx, p, type, mode, data) {\n\t var parentDir = path.dirname(p), fname = path.basename(p), parentNode = this.findINode(tx, parentDir), dirListing = this.getDirListing(tx, parentDir, parentNode), currTime = (new Date()).getTime();\n\t // Invariant: The root always exists.\n\t // If we don't check this prior to taking steps below, we will create a\n\t // file with name '' in root should p == '/'.\n\t if (p === '/') {\n\t throw ApiError.EEXIST(p);\n\t }\n\t // Check if file already exists.\n\t if (dirListing[fname]) {\n\t throw ApiError.EEXIST(p);\n\t }\n\t var fileNode;\n\t try {\n\t // Commit data.\n\t var dataId = this.addNewNode(tx, data);\n\t fileNode = new Inode(dataId, data.length, mode | type, currTime, currTime, currTime);\n\t // Commit file node.\n\t var fileNodeId = this.addNewNode(tx, fileNode.toBuffer());\n\t // Update and commit parent directory listing.\n\t dirListing[fname] = fileNodeId;\n\t tx.put(parentNode.id, Buffer.from(JSON.stringify(dirListing)), true);\n\t }\n\t catch (e) {\n\t tx.abort();\n\t throw e;\n\t }\n\t tx.commit();\n\t return fileNode;\n\t };\n\t /**\n\t * Remove all traces of the given path from the file system.\n\t * @param p The path to remove from the file system.\n\t * @param isDir Does the path belong to a directory, or a file?\n\t * @todo Update mtime.\n\t */\n\t SyncKeyValueFileSystem.prototype.removeEntry = function removeEntry (p, isDir) {\n\t var tx = this.store.beginTransaction('readwrite'), parent = path.dirname(p), parentNode = this.findINode(tx, parent), parentListing = this.getDirListing(tx, parent, parentNode), fileName = path.basename(p);\n\t if (!parentListing[fileName]) {\n\t throw ApiError.ENOENT(p);\n\t }\n\t // Remove from directory listing of parent.\n\t var fileNodeId = parentListing[fileName];\n\t delete parentListing[fileName];\n\t // Get file inode.\n\t var fileNode = this.getINode(tx, p, fileNodeId);\n\t if (!isDir && fileNode.isDirectory()) {\n\t throw ApiError.EISDIR(p);\n\t }\n\t else if (isDir && !fileNode.isDirectory()) {\n\t throw ApiError.ENOTDIR(p);\n\t }\n\t try {\n\t // Delete data.\n\t tx.del(fileNode.id);\n\t // Delete node.\n\t tx.del(fileNodeId);\n\t // Update directory listing.\n\t tx.put(parentNode.id, Buffer.from(JSON.stringify(parentListing)), true);\n\t }\n\t catch (e) {\n\t tx.abort();\n\t throw e;\n\t }\n\t // Success.\n\t tx.commit();\n\t };\n\t\n\t return SyncKeyValueFileSystem;\n\t}(SynchronousFileSystem));\n\tvar AsyncKeyValueFile = (function (PreloadFile$$1) {\n\t function AsyncKeyValueFile(_fs, _path, _flag, _stat, contents) {\n\t PreloadFile$$1.call(this, _fs, _path, _flag, _stat, contents);\n\t }\n\t\n\t if ( PreloadFile$$1 ) AsyncKeyValueFile.__proto__ = PreloadFile$$1;\n\t AsyncKeyValueFile.prototype = Object.create( PreloadFile$$1 && PreloadFile$$1.prototype );\n\t AsyncKeyValueFile.prototype.constructor = AsyncKeyValueFile;\n\t AsyncKeyValueFile.prototype.sync = function sync (cb) {\n\t var this$1 = this;\n\t\n\t if (this.isDirty()) {\n\t this._fs._sync(this.getPath(), this.getBuffer(), this.getStats(), function (e) {\n\t if (!e) {\n\t this$1.resetDirty();\n\t }\n\t cb(e);\n\t });\n\t }\n\t else {\n\t cb();\n\t }\n\t };\n\t AsyncKeyValueFile.prototype.close = function close (cb) {\n\t this.sync(cb);\n\t };\n\t\n\t return AsyncKeyValueFile;\n\t}(PreloadFile));\n\t/**\n\t * An \"Asynchronous key-value file system\". Stores data to/retrieves data from\n\t * an underlying asynchronous key-value store.\n\t */\n\tvar AsyncKeyValueFileSystem = (function (BaseFileSystem$$1) {\n\t function AsyncKeyValueFileSystem () {\n\t BaseFileSystem$$1.apply(this, arguments);\n\t }\n\t\n\t if ( BaseFileSystem$$1 ) AsyncKeyValueFileSystem.__proto__ = BaseFileSystem$$1;\n\t AsyncKeyValueFileSystem.prototype = Object.create( BaseFileSystem$$1 && BaseFileSystem$$1.prototype );\n\t AsyncKeyValueFileSystem.prototype.constructor = AsyncKeyValueFileSystem;\n\t\n\t AsyncKeyValueFileSystem.isAvailable = function isAvailable () { return true; };\n\t /**\n\t * Initializes the file system. Typically called by subclasses' async\n\t * constructors.\n\t */\n\t AsyncKeyValueFileSystem.prototype.init = function init (store, cb) {\n\t this.store = store;\n\t // INVARIANT: Ensure that the root exists.\n\t this.makeRootDirectory(cb);\n\t };\n\t AsyncKeyValueFileSystem.prototype.getName = function getName () { return this.store.name(); };\n\t AsyncKeyValueFileSystem.prototype.isReadOnly = function isReadOnly () { return false; };\n\t AsyncKeyValueFileSystem.prototype.supportsSymlinks = function supportsSymlinks () { return false; };\n\t AsyncKeyValueFileSystem.prototype.supportsProps = function supportsProps () { return false; };\n\t AsyncKeyValueFileSystem.prototype.supportsSynch = function supportsSynch () { return false; };\n\t /**\n\t * Delete all contents stored in the file system.\n\t */\n\t AsyncKeyValueFileSystem.prototype.empty = function empty (cb) {\n\t var this$1 = this;\n\t\n\t this.store.clear(function (e) {\n\t if (noError(e, cb)) {\n\t // INVARIANT: Root always exists.\n\t this$1.makeRootDirectory(cb);\n\t }\n\t });\n\t };\n\t AsyncKeyValueFileSystem.prototype.rename = function rename (oldPath, newPath, cb) {\n\t var this$1 = this;\n\t\n\t var tx = this.store.beginTransaction('readwrite');\n\t var oldParent = path.dirname(oldPath), oldName = path.basename(oldPath);\n\t var newParent = path.dirname(newPath), newName = path.basename(newPath);\n\t var inodes = {};\n\t var lists = {};\n\t var errorOccurred = false;\n\t // Invariant: Can't move a folder inside itself.\n\t // This funny little hack ensures that the check passes only if oldPath\n\t // is a subpath of newParent. We append '/' to avoid matching folders that\n\t // are a substring of the bottom-most folder in the path.\n\t if ((newParent + '/').indexOf(oldPath + '/') === 0) {\n\t return cb(new ApiError(ErrorCode.EBUSY, oldParent));\n\t }\n\t /**\n\t * Responsible for Phase 2 of the rename operation: Modifying and\n\t * committing the directory listings. Called once we have successfully\n\t * retrieved both the old and new parent's inodes and listings.\n\t */\n\t var theOleSwitcharoo = function () {\n\t // Sanity check: Ensure both paths are present, and no error has occurred.\n\t if (errorOccurred || !lists.hasOwnProperty(oldParent) || !lists.hasOwnProperty(newParent)) {\n\t return;\n\t }\n\t var oldParentList = lists[oldParent], oldParentINode = inodes[oldParent], newParentList = lists[newParent], newParentINode = inodes[newParent];\n\t // Delete file from old parent.\n\t if (!oldParentList[oldName]) {\n\t cb(ApiError.ENOENT(oldPath));\n\t }\n\t else {\n\t var fileId = oldParentList[oldName];\n\t delete oldParentList[oldName];\n\t // Finishes off the renaming process by adding the file to the new\n\t // parent.\n\t var completeRename = function () {\n\t newParentList[newName] = fileId;\n\t // Commit old parent's list.\n\t tx.put(oldParentINode.id, Buffer.from(JSON.stringify(oldParentList)), true, function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t if (oldParent === newParent) {\n\t // DONE!\n\t tx.commit(cb);\n\t }\n\t else {\n\t // Commit new parent's list.\n\t tx.put(newParentINode.id, Buffer.from(JSON.stringify(newParentList)), true, function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t tx.commit(cb);\n\t }\n\t });\n\t }\n\t }\n\t });\n\t };\n\t if (newParentList[newName]) {\n\t // 'newPath' already exists. Check if it's a file or a directory, and\n\t // act accordingly.\n\t this$1.getINode(tx, newPath, newParentList[newName], function (e, inode) {\n\t if (noErrorTx(e, tx, cb)) {\n\t if (inode.isFile()) {\n\t // Delete the file and continue.\n\t tx.del(inode.id, function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t tx.del(newParentList[newName], function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t completeRename();\n\t }\n\t });\n\t }\n\t });\n\t }\n\t else {\n\t // Can't overwrite a directory using rename.\n\t tx.abort(function (e) {\n\t cb(ApiError.EPERM(newPath));\n\t });\n\t }\n\t }\n\t });\n\t }\n\t else {\n\t completeRename();\n\t }\n\t }\n\t };\n\t /**\n\t * Grabs a path's inode and directory listing, and shoves it into the\n\t * inodes and lists hashes.\n\t */\n\t var processInodeAndListings = function (p) {\n\t this$1.findINodeAndDirListing(tx, p, function (e, node, dirList) {\n\t if (e) {\n\t if (!errorOccurred) {\n\t errorOccurred = true;\n\t tx.abort(function () {\n\t cb(e);\n\t });\n\t }\n\t // If error has occurred already, just stop here.\n\t }\n\t else {\n\t inodes[p] = node;\n\t lists[p] = dirList;\n\t theOleSwitcharoo();\n\t }\n\t });\n\t };\n\t processInodeAndListings(oldParent);\n\t if (oldParent !== newParent) {\n\t processInodeAndListings(newParent);\n\t }\n\t };\n\t AsyncKeyValueFileSystem.prototype.stat = function stat (p, isLstat, cb) {\n\t var tx = this.store.beginTransaction('readonly');\n\t this.findINode(tx, p, function (e, inode) {\n\t if (noError(e, cb)) {\n\t cb(null, inode.toStats());\n\t }\n\t });\n\t };\n\t AsyncKeyValueFileSystem.prototype.createFile = function createFile (p, flag, mode, cb) {\n\t var this$1 = this;\n\t\n\t var tx = this.store.beginTransaction('readwrite'), data = emptyBuffer();\n\t this.commitNewFile(tx, p, FileType.FILE, mode, data, function (e, newFile) {\n\t if (noError(e, cb)) {\n\t cb(null, new AsyncKeyValueFile(this$1, p, flag, newFile.toStats(), data));\n\t }\n\t });\n\t };\n\t AsyncKeyValueFileSystem.prototype.openFile = function openFile (p, flag, cb) {\n\t var this$1 = this;\n\t\n\t var tx = this.store.beginTransaction('readonly');\n\t // Step 1: Grab the file's inode.\n\t this.findINode(tx, p, function (e, inode) {\n\t if (noError(e, cb)) {\n\t // Step 2: Grab the file's data.\n\t tx.get(inode.id, function (e, data) {\n\t if (noError(e, cb)) {\n\t if (data === undefined) {\n\t cb(ApiError.ENOENT(p));\n\t }\n\t else {\n\t cb(null, new AsyncKeyValueFile(this$1, p, flag, inode.toStats(), data));\n\t }\n\t }\n\t });\n\t }\n\t });\n\t };\n\t AsyncKeyValueFileSystem.prototype.unlink = function unlink (p, cb) {\n\t this.removeEntry(p, false, cb);\n\t };\n\t AsyncKeyValueFileSystem.prototype.rmdir = function rmdir (p, cb) {\n\t var this$1 = this;\n\t\n\t // Check first if directory is empty.\n\t this.readdir(p, function (err, files) {\n\t if (err) {\n\t cb(err);\n\t }\n\t else if (files.length > 0) {\n\t cb(ApiError.ENOTEMPTY(p));\n\t }\n\t else {\n\t this$1.removeEntry(p, true, cb);\n\t }\n\t });\n\t };\n\t AsyncKeyValueFileSystem.prototype.mkdir = function mkdir (p, mode, cb) {\n\t var tx = this.store.beginTransaction('readwrite'), data = Buffer.from('{}');\n\t this.commitNewFile(tx, p, FileType.DIRECTORY, mode, data, cb);\n\t };\n\t AsyncKeyValueFileSystem.prototype.readdir = function readdir (p, cb) {\n\t var this$1 = this;\n\t\n\t var tx = this.store.beginTransaction('readonly');\n\t this.findINode(tx, p, function (e, inode) {\n\t if (noError(e, cb)) {\n\t this$1.getDirListing(tx, p, inode, function (e, dirListing) {\n\t if (noError(e, cb)) {\n\t cb(null, Object.keys(dirListing));\n\t }\n\t });\n\t }\n\t });\n\t };\n\t AsyncKeyValueFileSystem.prototype._sync = function _sync (p, data, stats, cb) {\n\t var this$1 = this;\n\t\n\t // @todo Ensure mtime updates properly, and use that to determine if a data\n\t // update is required.\n\t var tx = this.store.beginTransaction('readwrite');\n\t // Step 1: Get the file node's ID.\n\t this._findINode(tx, path.dirname(p), path.basename(p), function (e, fileInodeId) {\n\t if (noErrorTx(e, tx, cb)) {\n\t // Step 2: Get the file inode.\n\t this$1.getINode(tx, p, fileInodeId, function (e, fileInode) {\n\t if (noErrorTx(e, tx, cb)) {\n\t var inodeChanged = fileInode.update(stats);\n\t // Step 3: Sync the data.\n\t tx.put(fileInode.id, data, true, function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t // Step 4: Sync the metadata (if it changed)!\n\t if (inodeChanged) {\n\t tx.put(fileInodeId, fileInode.toBuffer(), true, function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t tx.commit(cb);\n\t }\n\t });\n\t }\n\t else {\n\t // No need to sync metadata; return.\n\t tx.commit(cb);\n\t }\n\t }\n\t });\n\t }\n\t });\n\t }\n\t });\n\t };\n\t /**\n\t * Checks if the root directory exists. Creates it if it doesn't.\n\t */\n\t AsyncKeyValueFileSystem.prototype.makeRootDirectory = function makeRootDirectory (cb) {\n\t var tx = this.store.beginTransaction('readwrite');\n\t tx.get(ROOT_NODE_ID, function (e, data) {\n\t if (e || data === undefined) {\n\t // Create new inode.\n\t var currTime = (new Date()).getTime(), \n\t // Mode 0666\n\t dirInode = new Inode(GenerateRandomID(), 4096, 511 | FileType.DIRECTORY, currTime, currTime, currTime);\n\t // If the root doesn't exist, the first random ID shouldn't exist,\n\t // either.\n\t tx.put(dirInode.id, getEmptyDirNode(), false, function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t tx.put(ROOT_NODE_ID, dirInode.toBuffer(), false, function (e) {\n\t if (e) {\n\t tx.abort(function () { cb(e); });\n\t }\n\t else {\n\t tx.commit(cb);\n\t }\n\t });\n\t }\n\t });\n\t }\n\t else {\n\t // We're good.\n\t tx.commit(cb);\n\t }\n\t });\n\t };\n\t /**\n\t * Helper function for findINode.\n\t * @param parent The parent directory of the file we are attempting to find.\n\t * @param filename The filename of the inode we are attempting to find, minus\n\t * the parent.\n\t * @param cb Passed an error or the ID of the file's inode in the file system.\n\t */\n\t AsyncKeyValueFileSystem.prototype._findINode = function _findINode (tx, parent, filename, cb) {\n\t var this$1 = this;\n\t\n\t var handleDirectoryListings = function (e, inode, dirList) {\n\t if (e) {\n\t cb(e);\n\t }\n\t else if (dirList[filename]) {\n\t cb(null, dirList[filename]);\n\t }\n\t else {\n\t cb(ApiError.ENOENT(path.resolve(parent, filename)));\n\t }\n\t };\n\t if (parent === '/') {\n\t if (filename === '') {\n\t // BASE CASE #1: Return the root's ID.\n\t cb(null, ROOT_NODE_ID);\n\t }\n\t else {\n\t // BASE CASE #2: Find the item in the root node.\n\t this.getINode(tx, parent, ROOT_NODE_ID, function (e, inode) {\n\t if (noError(e, cb)) {\n\t this$1.getDirListing(tx, parent, inode, function (e, dirList) {\n\t // handle_directory_listings will handle e for us.\n\t handleDirectoryListings(e, inode, dirList);\n\t });\n\t }\n\t });\n\t }\n\t }\n\t else {\n\t // Get the parent directory's INode, and find the file in its directory\n\t // listing.\n\t this.findINodeAndDirListing(tx, parent, handleDirectoryListings);\n\t }\n\t };\n\t /**\n\t * Finds the Inode of the given path.\n\t * @param p The path to look up.\n\t * @param cb Passed an error or the Inode of the path p.\n\t * @todo memoize/cache\n\t */\n\t AsyncKeyValueFileSystem.prototype.findINode = function findINode (tx, p, cb) {\n\t var this$1 = this;\n\t\n\t this._findINode(tx, path.dirname(p), path.basename(p), function (e, id) {\n\t if (noError(e, cb)) {\n\t this$1.getINode(tx, p, id, cb);\n\t }\n\t });\n\t };\n\t /**\n\t * Given the ID of a node, retrieves the corresponding Inode.\n\t * @param tx The transaction to use.\n\t * @param p The corresponding path to the file (used for error messages).\n\t * @param id The ID to look up.\n\t * @param cb Passed an error or the inode under the given id.\n\t */\n\t AsyncKeyValueFileSystem.prototype.getINode = function getINode (tx, p, id, cb) {\n\t tx.get(id, function (e, data) {\n\t if (noError(e, cb)) {\n\t if (data === undefined) {\n\t cb(ApiError.ENOENT(p));\n\t }\n\t else {\n\t cb(null, Inode.fromBuffer(data));\n\t }\n\t }\n\t });\n\t };\n\t /**\n\t * Given the Inode of a directory, retrieves the corresponding directory\n\t * listing.\n\t */\n\t AsyncKeyValueFileSystem.prototype.getDirListing = function getDirListing (tx, p, inode, cb) {\n\t if (!inode.isDirectory()) {\n\t cb(ApiError.ENOTDIR(p));\n\t }\n\t else {\n\t tx.get(inode.id, function (e, data) {\n\t if (noError(e, cb)) {\n\t try {\n\t cb(null, JSON.parse(data.toString()));\n\t }\n\t catch (e) {\n\t // Occurs when data is undefined, or corresponds to something other\n\t // than a directory listing. The latter should never occur unless\n\t // the file system is corrupted.\n\t cb(ApiError.ENOENT(p));\n\t }\n\t }\n\t });\n\t }\n\t };\n\t /**\n\t * Given a path to a directory, retrieves the corresponding INode and\n\t * directory listing.\n\t */\n\t AsyncKeyValueFileSystem.prototype.findINodeAndDirListing = function findINodeAndDirListing (tx, p, cb) {\n\t var this$1 = this;\n\t\n\t this.findINode(tx, p, function (e, inode) {\n\t if (noError(e, cb)) {\n\t this$1.getDirListing(tx, p, inode, function (e, listing) {\n\t if (noError(e, cb)) {\n\t cb(null, inode, listing);\n\t }\n\t });\n\t }\n\t });\n\t };\n\t /**\n\t * Adds a new node under a random ID. Retries 5 times before giving up in\n\t * the exceedingly unlikely chance that we try to reuse a random GUID.\n\t * @param cb Passed an error or the GUID that the data was stored under.\n\t */\n\t AsyncKeyValueFileSystem.prototype.addNewNode = function addNewNode (tx, data, cb) {\n\t var retries = 0, currId;\n\t var reroll = function () {\n\t if (++retries === 5) {\n\t // Max retries hit. Return with an error.\n\t cb(new ApiError(ErrorCode.EIO, 'Unable to commit data to key-value store.'));\n\t }\n\t else {\n\t // Try again.\n\t currId = GenerateRandomID();\n\t tx.put(currId, data, false, function (e, committed) {\n\t if (e || !committed) {\n\t reroll();\n\t }\n\t else {\n\t // Successfully stored under 'currId'.\n\t cb(null, currId);\n\t }\n\t });\n\t }\n\t };\n\t reroll();\n\t };\n\t /**\n\t * Commits a new file (well, a FILE or a DIRECTORY) to the file system with\n\t * the given mode.\n\t * Note: This will commit the transaction.\n\t * @param p The path to the new file.\n\t * @param type The type of the new file.\n\t * @param mode The mode to create the new file with.\n\t * @param data The data to store at the file's data node.\n\t * @param cb Passed an error or the Inode for the new file.\n\t */\n\t AsyncKeyValueFileSystem.prototype.commitNewFile = function commitNewFile (tx, p, type, mode, data, cb) {\n\t var this$1 = this;\n\t\n\t var parentDir = path.dirname(p), fname = path.basename(p), currTime = (new Date()).getTime();\n\t // Invariant: The root always exists.\n\t // If we don't check this prior to taking steps below, we will create a\n\t // file with name '' in root should p == '/'.\n\t if (p === '/') {\n\t return cb(ApiError.EEXIST(p));\n\t }\n\t // Let's build a pyramid of code!\n\t // Step 1: Get the parent directory's inode and directory listing\n\t this.findINodeAndDirListing(tx, parentDir, function (e, parentNode, dirListing) {\n\t if (noErrorTx(e, tx, cb)) {\n\t if (dirListing[fname]) {\n\t // File already exists.\n\t tx.abort(function () {\n\t cb(ApiError.EEXIST(p));\n\t });\n\t }\n\t else {\n\t // Step 2: Commit data to store.\n\t this$1.addNewNode(tx, data, function (e, dataId) {\n\t if (noErrorTx(e, tx, cb)) {\n\t // Step 3: Commit the file's inode to the store.\n\t var fileInode = new Inode(dataId, data.length, mode | type, currTime, currTime, currTime);\n\t this$1.addNewNode(tx, fileInode.toBuffer(), function (e, fileInodeId) {\n\t if (noErrorTx(e, tx, cb)) {\n\t // Step 4: Update parent directory's listing.\n\t dirListing[fname] = fileInodeId;\n\t tx.put(parentNode.id, Buffer.from(JSON.stringify(dirListing)), true, function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t // Step 5: Commit and return the new inode.\n\t tx.commit(function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t cb(null, fileInode);\n\t }\n\t });\n\t }\n\t });\n\t }\n\t });\n\t }\n\t });\n\t }\n\t }\n\t });\n\t };\n\t /**\n\t * Remove all traces of the given path from the file system.\n\t * @param p The path to remove from the file system.\n\t * @param isDir Does the path belong to a directory, or a file?\n\t * @todo Update mtime.\n\t */\n\t AsyncKeyValueFileSystem.prototype.removeEntry = function removeEntry (p, isDir, cb) {\n\t var this$1 = this;\n\t\n\t var tx = this.store.beginTransaction('readwrite'), parent = path.dirname(p), fileName = path.basename(p);\n\t // Step 1: Get parent directory's node and directory listing.\n\t this.findINodeAndDirListing(tx, parent, function (e, parentNode, parentListing) {\n\t if (noErrorTx(e, tx, cb)) {\n\t if (!parentListing[fileName]) {\n\t tx.abort(function () {\n\t cb(ApiError.ENOENT(p));\n\t });\n\t }\n\t else {\n\t // Remove from directory listing of parent.\n\t var fileNodeId = parentListing[fileName];\n\t delete parentListing[fileName];\n\t // Step 2: Get file inode.\n\t this$1.getINode(tx, p, fileNodeId, function (e, fileNode) {\n\t if (noErrorTx(e, tx, cb)) {\n\t if (!isDir && fileNode.isDirectory()) {\n\t tx.abort(function () {\n\t cb(ApiError.EISDIR(p));\n\t });\n\t }\n\t else if (isDir && !fileNode.isDirectory()) {\n\t tx.abort(function () {\n\t cb(ApiError.ENOTDIR(p));\n\t });\n\t }\n\t else {\n\t // Step 3: Delete data.\n\t tx.del(fileNode.id, function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t // Step 4: Delete node.\n\t tx.del(fileNodeId, function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t // Step 5: Update directory listing.\n\t tx.put(parentNode.id, Buffer.from(JSON.stringify(parentListing)), true, function (e) {\n\t if (noErrorTx(e, tx, cb)) {\n\t tx.commit(cb);\n\t }\n\t });\n\t }\n\t });\n\t }\n\t });\n\t }\n\t }\n\t });\n\t }\n\t }\n\t });\n\t };\n\t\n\t return AsyncKeyValueFileSystem;\n\t}(BaseFileSystem));\n\t\n\t/**\n\t * A simple in-memory key-value store backed by a JavaScript object.\n\t */\n\tvar InMemoryStore = function InMemoryStore() {\n\t this.store = {};\n\t};\n\tInMemoryStore.prototype.name = function name () { return InMemoryFileSystem.Name; };\n\tInMemoryStore.prototype.clear = function clear () { this.store = {}; };\n\tInMemoryStore.prototype.beginTransaction = function beginTransaction (type) {\n\t return new SimpleSyncRWTransaction(this);\n\t};\n\tInMemoryStore.prototype.get = function get (key) {\n\t return this.store[key];\n\t};\n\tInMemoryStore.prototype.put = function put (key, data, overwrite) {\n\t if (!overwrite && this.store.hasOwnProperty(key)) {\n\t return false;\n\t }\n\t this.store[key] = data;\n\t return true;\n\t};\n\tInMemoryStore.prototype.del = function del (key) {\n\t delete this.store[key];\n\t};\n\t/**\n\t * A simple in-memory file system backed by an InMemoryStore.\n\t * Files are not persisted across page loads.\n\t */\n\tvar InMemoryFileSystem = (function (SyncKeyValueFileSystem$$1) {\n\t function InMemoryFileSystem() {\n\t SyncKeyValueFileSystem$$1.call(this, { store: new InMemoryStore() });\n\t }\n\t\n\t if ( SyncKeyValueFileSystem$$1 ) InMemoryFileSystem.__proto__ = SyncKeyValueFileSystem$$1;\n\t InMemoryFileSystem.prototype = Object.create( SyncKeyValueFileSystem$$1 && SyncKeyValueFileSystem$$1.prototype );\n\t InMemoryFileSystem.prototype.constructor = InMemoryFileSystem;\n\t /**\n\t * Creates an InMemoryFileSystem instance.\n\t */\n\t InMemoryFileSystem.Create = function Create (options, cb) {\n\t cb(null, new InMemoryFileSystem());\n\t };\n\t\n\t return InMemoryFileSystem;\n\t}(SyncKeyValueFileSystem));\n\t\n\tInMemoryFileSystem.Name = \"InMemory\";\n\tInMemoryFileSystem.Options = {};\n\t\n\t/**\n\t * Get the indexedDB constructor for the current browser.\n\t * @hidden\n\t */\n\tvar indexedDB = global$1.indexedDB ||\n\t global$1.mozIndexedDB ||\n\t global$1.webkitIndexedDB ||\n\t global$1.msIndexedDB;\n\t/**\n\t * Converts a DOMException or a DOMError from an IndexedDB event into a\n\t * standardized BrowserFS API error.\n\t * @hidden\n\t */\n\tfunction convertError$2(e, message) {\n\t if ( message === void 0 ) message = e.toString();\n\t\n\t switch (e.name) {\n\t case \"NotFoundError\":\n\t return new ApiError(ErrorCode.ENOENT, message);\n\t case \"QuotaExceededError\":\n\t return new ApiError(ErrorCode.ENOSPC, message);\n\t default:\n\t // The rest do not seem to map cleanly to standard error codes.\n\t return new ApiError(ErrorCode.EIO, message);\n\t }\n\t}\n\t/**\n\t * Produces a new onerror handler for IDB. Our errors are always fatal, so we\n\t * handle them generically: Call the user-supplied callback with a translated\n\t * version of the error, and let the error bubble up.\n\t * @hidden\n\t */\n\tfunction onErrorHandler(cb, code, message) {\n\t if ( code === void 0 ) code = ErrorCode.EIO;\n\t if ( message === void 0 ) message = null;\n\t\n\t return function (e) {\n\t // Prevent the error from canceling the transaction.\n\t e.preventDefault();\n\t cb(new ApiError(code, message !== null ? message : undefined));\n\t };\n\t}\n\t/**\n\t * @hidden\n\t */\n\tvar IndexedDBROTransaction = function IndexedDBROTransaction(tx, store) {\n\t this.tx = tx;\n\t this.store = store;\n\t};\n\tIndexedDBROTransaction.prototype.get = function get (key, cb) {\n\t try {\n\t var r = this.store.get(key);\n\t r.onerror = onErrorHandler(cb);\n\t r.onsuccess = function (event) {\n\t // IDB returns the value 'undefined' when you try to get keys that\n\t // don't exist. The caller expects this behavior.\n\t var result = event.target.result;\n\t if (result === undefined) {\n\t cb(null, result);\n\t }\n\t else {\n\t // IDB data is stored as an ArrayBuffer\n\t cb(null, arrayBuffer2Buffer(result));\n\t }\n\t };\n\t }\n\t catch (e) {\n\t cb(convertError$2(e));\n\t }\n\t};\n\t/**\n\t * @hidden\n\t */\n\tvar IndexedDBRWTransaction = (function (IndexedDBROTransaction) {\n\t function IndexedDBRWTransaction(tx, store) {\n\t IndexedDBROTransaction.call(this, tx, store);\n\t }\n\t\n\t if ( IndexedDBROTransaction ) IndexedDBRWTransaction.__proto__ = IndexedDBROTransaction;\n\t IndexedDBRWTransaction.prototype = Object.create( IndexedDBROTransaction && IndexedDBROTransaction.prototype );\n\t IndexedDBRWTransaction.prototype.constructor = IndexedDBRWTransaction;\n\t IndexedDBRWTransaction.prototype.put = function put (key, data, overwrite, cb) {\n\t try {\n\t var arraybuffer = buffer2ArrayBuffer(data);\n\t var r;\n\t if (overwrite) {\n\t r = this.store.put(arraybuffer, key);\n\t }\n\t else {\n\t // 'add' will never overwrite an existing key.\n\t r = this.store.add(arraybuffer, key);\n\t }\n\t // XXX: NEED TO RETURN FALSE WHEN ADD HAS A KEY CONFLICT. NO ERROR.\n\t r.onerror = onErrorHandler(cb);\n\t r.onsuccess = function (event) {\n\t cb(null, true);\n\t };\n\t }\n\t catch (e) {\n\t cb(convertError$2(e));\n\t }\n\t };\n\t IndexedDBRWTransaction.prototype.del = function del (key, cb) {\n\t try {\n\t // NOTE: IE8 has a bug with identifiers named 'delete' unless used as a string\n\t // like this.\n\t // http://stackoverflow.com/a/26479152\n\t var r = this.store['delete'](key);\n\t r.onerror = onErrorHandler(cb);\n\t r.onsuccess = function (event) {\n\t cb();\n\t };\n\t }\n\t catch (e) {\n\t cb(convertError$2(e));\n\t }\n\t };\n\t IndexedDBRWTransaction.prototype.commit = function commit (cb) {\n\t // Return to the event loop to commit the transaction.\n\t setTimeout(cb, 0);\n\t };\n\t IndexedDBRWTransaction.prototype.abort = function abort (cb) {\n\t var _e = null;\n\t try {\n\t this.tx.abort();\n\t }\n\t catch (e) {\n\t _e = convertError$2(e);\n\t }\n\t finally {\n\t cb(_e);\n\t }\n\t };\n\t\n\t return IndexedDBRWTransaction;\n\t}(IndexedDBROTransaction));\n\tvar IndexedDBStore = function IndexedDBStore(cb, storeName) {\n\t var this$1 = this;\n\t if ( storeName === void 0 ) storeName = 'browserfs';\n\t\n\t this.storeName = storeName;\n\t var openReq = indexedDB.open(this.storeName, 1);\n\t openReq.onupgradeneeded = function (event) {\n\t var db = event.target.result;\n\t // Huh. This should never happen; we're at version 1. Why does another\n\t // database exist?\n\t if (db.objectStoreNames.contains(this$1.storeName)) {\n\t db.deleteObjectStore(this$1.storeName);\n\t }\n\t db.createObjectStore(this$1.storeName);\n\t };\n\t openReq.onsuccess = function (event) {\n\t this$1.db = event.target.result;\n\t cb(null, this$1);\n\t };\n\t openReq.onerror = onErrorHandler(cb, ErrorCode.EACCES);\n\t};\n\tIndexedDBStore.prototype.name = function name () {\n\t return IndexedDBFileSystem.Name + \" - \" + this.storeName;\n\t};\n\tIndexedDBStore.prototype.clear = function clear (cb) {\n\t try {\n\t var tx = this.db.transaction(this.storeName, 'readwrite'), objectStore = tx.objectStore(this.storeName), r = objectStore.clear();\n\t r.onsuccess = function (event) {\n\t // Use setTimeout to commit transaction.\n\t setTimeout(cb, 0);\n\t };\n\t r.onerror = onErrorHandler(cb);\n\t }\n\t catch (e) {\n\t cb(convertError$2(e));\n\t }\n\t};\n\tIndexedDBStore.prototype.beginTransaction = function beginTransaction (type) {\n\t if ( type === void 0 ) type = 'readonly';\n\t\n\t var tx = this.db.transaction(this.storeName, type), objectStore = tx.objectStore(this.storeName);\n\t if (type === 'readwrite') {\n\t return new IndexedDBRWTransaction(tx, objectStore);\n\t }\n\t else if (type === 'readonly') {\n\t return new IndexedDBROTransaction(tx, objectStore);\n\t }\n\t else {\n\t throw new ApiError(ErrorCode.EINVAL, 'Invalid transaction type.');\n\t }\n\t};\n\t/**\n\t * A file system that uses the IndexedDB key value file system.\n\t */\n\tvar IndexedDBFileSystem = (function (AsyncKeyValueFileSystem$$1) {\n\t function IndexedDBFileSystem(cb, storeName, deprecateMsg) {\n\t var this$1 = this;\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t AsyncKeyValueFileSystem$$1.call(this);\n\t this.store = new IndexedDBStore(function (e) {\n\t if (e) {\n\t cb(e);\n\t }\n\t else {\n\t this$1.init(this$1.store, function (e) {\n\t cb(e, this$1);\n\t });\n\t }\n\t }, storeName);\n\t deprecationMessage(deprecateMsg, IndexedDBFileSystem.Name, { storeName: storeName });\n\t }\n\t\n\t if ( AsyncKeyValueFileSystem$$1 ) IndexedDBFileSystem.__proto__ = AsyncKeyValueFileSystem$$1;\n\t IndexedDBFileSystem.prototype = Object.create( AsyncKeyValueFileSystem$$1 && AsyncKeyValueFileSystem$$1.prototype );\n\t IndexedDBFileSystem.prototype.constructor = IndexedDBFileSystem;\n\t /**\n\t * Constructs an IndexedDB file system with the given options.\n\t */\n\t IndexedDBFileSystem.Create = function Create (opts, cb) {\n\t // tslint:disable-next-line:no-unused-new\n\t new IndexedDBFileSystem(cb, opts.storeName, false);\n\t // tslint:enable-next-line:no-unused-new\n\t };\n\t IndexedDBFileSystem.isAvailable = function isAvailable () {\n\t // In Safari's private browsing mode, indexedDB.open returns NULL.\n\t // In Firefox, it throws an exception.\n\t // In Chrome, it \"just works\", and clears the database when you leave the page.\n\t // Untested: Opera, IE.\n\t try {\n\t return typeof indexedDB !== 'undefined' && null !== indexedDB.open(\"__browserfs_test__\");\n\t }\n\t catch (e) {\n\t return false;\n\t }\n\t };\n\t\n\t return IndexedDBFileSystem;\n\t}(AsyncKeyValueFileSystem));\n\t\n\tIndexedDBFileSystem.Name = \"IndexedDB\";\n\tIndexedDBFileSystem.Options = {\n\t storeName: {\n\t type: \"string\",\n\t optional: true,\n\t description: \"The name of this file system. You can have multiple IndexedDB file systems operating at once, but each must have a different name.\"\n\t }\n\t};\n\t\n\t/**\n\t * Some versions of FF and all versions of IE do not support the full range of\n\t * 16-bit numbers encoded as characters, as they enforce UTF-16 restrictions.\n\t * @url http://stackoverflow.com/questions/11170716/are-there-any-characters-that-are-not-allowed-in-localstorage/11173673#11173673\n\t * @hidden\n\t */\n\tvar supportsBinaryString = false;\n\tvar binaryEncoding;\n\ttry {\n\t global$1.localStorage.setItem(\"__test__\", String.fromCharCode(0xD800));\n\t supportsBinaryString = global$1.localStorage.getItem(\"__test__\") === String.fromCharCode(0xD800);\n\t}\n\tcatch (e) {\n\t // IE throws an exception.\n\t supportsBinaryString = false;\n\t}\n\tbinaryEncoding = supportsBinaryString ? 'binary_string' : 'binary_string_ie';\n\tif (!Buffer.isEncoding(binaryEncoding)) {\n\t // Fallback for non BrowserFS implementations of buffer that lack a\n\t // binary_string format.\n\t binaryEncoding = \"base64\";\n\t}\n\t/**\n\t * A synchronous key-value store backed by localStorage.\n\t */\n\tvar LocalStorageStore = function LocalStorageStore () {};\n\t\n\tLocalStorageStore.prototype.name = function name () {\n\t return LocalStorageFileSystem.Name;\n\t};\n\tLocalStorageStore.prototype.clear = function clear () {\n\t global$1.localStorage.clear();\n\t};\n\tLocalStorageStore.prototype.beginTransaction = function beginTransaction (type) {\n\t // No need to differentiate.\n\t return new SimpleSyncRWTransaction(this);\n\t};\n\tLocalStorageStore.prototype.get = function get (key) {\n\t try {\n\t var data = global$1.localStorage.getItem(key);\n\t if (data !== null) {\n\t return Buffer.from(data, binaryEncoding);\n\t }\n\t }\n\t catch (e) {\n\t // Do nothing.\n\t }\n\t // Key doesn't exist, or a failure occurred.\n\t return undefined;\n\t};\n\tLocalStorageStore.prototype.put = function put (key, data, overwrite) {\n\t try {\n\t if (!overwrite && global$1.localStorage.getItem(key) !== null) {\n\t // Don't want to overwrite the key!\n\t return false;\n\t }\n\t global$1.localStorage.setItem(key, data.toString(binaryEncoding));\n\t return true;\n\t }\n\t catch (e) {\n\t throw new ApiError(ErrorCode.ENOSPC, \"LocalStorage is full.\");\n\t }\n\t};\n\tLocalStorageStore.prototype.del = function del (key) {\n\t try {\n\t global$1.localStorage.removeItem(key);\n\t }\n\t catch (e) {\n\t throw new ApiError(ErrorCode.EIO, \"Unable to delete key \" + key + \": \" + e);\n\t }\n\t};\n\t/**\n\t * A synchronous file system backed by localStorage. Connects our\n\t * LocalStorageStore to our SyncKeyValueFileSystem.\n\t */\n\tvar LocalStorageFileSystem = (function (SyncKeyValueFileSystem$$1) {\n\t function LocalStorageFileSystem() { SyncKeyValueFileSystem$$1.call(this, { store: new LocalStorageStore() }); }\n\t\n\t if ( SyncKeyValueFileSystem$$1 ) LocalStorageFileSystem.__proto__ = SyncKeyValueFileSystem$$1;\n\t LocalStorageFileSystem.prototype = Object.create( SyncKeyValueFileSystem$$1 && SyncKeyValueFileSystem$$1.prototype );\n\t LocalStorageFileSystem.prototype.constructor = LocalStorageFileSystem;\n\t /**\n\t * Creates a LocalStorageFileSystem instance.\n\t */\n\t LocalStorageFileSystem.Create = function Create (options, cb) {\n\t cb(null, new LocalStorageFileSystem());\n\t };\n\t LocalStorageFileSystem.isAvailable = function isAvailable () {\n\t return typeof global$1.localStorage !== 'undefined';\n\t };\n\t\n\t return LocalStorageFileSystem;\n\t}(SyncKeyValueFileSystem));\n\t\n\tLocalStorageFileSystem.Name = \"LocalStorage\";\n\tLocalStorageFileSystem.Options = {};\n\t\n\t/**\n\t * The MountableFileSystem allows you to mount multiple backend types or\n\t * multiple instantiations of the same backend into a single file system tree.\n\t * The file systems do not need to know about each other; all interactions are\n\t * automatically facilitated through this interface.\n\t *\n\t * For example, if a file system is mounted at /mnt/blah, and a request came in\n\t * for /mnt/blah/foo.txt, the file system would see a request for /foo.txt.\n\t *\n\t * You can mount file systems when you configure the file system:\n\t * ```javascript\n\t * BrowserFS.configure({\n\t * fs: \"MountableFileSystem\",\n\t * options: {\n\t * '/data': { fs: 'XmlHttpRequest', options: { index: \"http://mysite.com/files/index.json\" } },\n\t * '/home': { fs: 'LocalStorage' }\n\t * }\n\t * }, function(e) {\n\t *\n\t * });\n\t * ```\n\t *\n\t * For advanced users, you can also mount file systems *after* MFS is constructed:\n\t * ```javascript\n\t * BrowserFS.FileSystem.XmlHttpRequest.Create({\n\t * index: \"http://mysite.com/files/index.json\"\n\t * }, function(e, xhrfs) {\n\t * BrowserFS.FileSystem.MountableFileSystem.Create({\n\t * '/data': xhrfs\n\t * }, function(e, mfs) {\n\t * BrowserFS.initialize(mfs);\n\t *\n\t * // Added after-the-fact...\n\t * BrowserFS.FileSystem.LocalStorage.Create(function(e, lsfs) {\n\t * mfs.mount('/home', lsfs);\n\t * });\n\t * });\n\t * });\n\t * ```\n\t *\n\t * Since MountableFileSystem simply proxies requests to mounted file systems, it supports all of the operations that the mounted file systems support.\n\t *\n\t * With no mounted file systems, `MountableFileSystem` acts as a simple `InMemory` filesystem.\n\t */\n\tvar MountableFileSystem = (function (BaseFileSystem$$1) {\n\t function MountableFileSystem() {\n\t BaseFileSystem$$1.call(this);\n\t // Contains the list of mount points in mntMap, sorted by string length in decreasing order.\n\t // Ensures that we scan the most specific mount points for a match first, which lets us\n\t // nest mount points.\n\t this.mountList = [];\n\t this.mntMap = {};\n\t // The InMemory file system serves purely to provide directory listings for\n\t // mounted file systems.\n\t this.rootFs = new InMemoryFileSystem();\n\t }\n\t\n\t if ( BaseFileSystem$$1 ) MountableFileSystem.__proto__ = BaseFileSystem$$1;\n\t MountableFileSystem.prototype = Object.create( BaseFileSystem$$1 && BaseFileSystem$$1.prototype );\n\t MountableFileSystem.prototype.constructor = MountableFileSystem;\n\t /**\n\t * Creates a MountableFileSystem instance with the given options.\n\t */\n\t MountableFileSystem.Create = function Create (opts, cb) {\n\t var fs = new MountableFileSystem();\n\t Object.keys(opts).forEach(function (mountPoint) {\n\t fs.mount(mountPoint, opts[mountPoint]);\n\t });\n\t cb(null, fs);\n\t };\n\t MountableFileSystem.isAvailable = function isAvailable () {\n\t return true;\n\t };\n\t /**\n\t * Mounts the file system at the given mount point.\n\t */\n\t MountableFileSystem.prototype.mount = function mount (mountPoint, fs) {\n\t if (mountPoint[0] !== '/') {\n\t mountPoint = \"/\" + mountPoint;\n\t }\n\t mountPoint = path.resolve(mountPoint);\n\t if (this.mntMap[mountPoint]) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Mount point \" + mountPoint + \" is already taken.\");\n\t }\n\t mkdirpSync(mountPoint, 0x1ff, this.rootFs);\n\t this.mntMap[mountPoint] = fs;\n\t this.mountList.push(mountPoint);\n\t this.mountList = this.mountList.sort(function (a, b) { return b.length - a.length; });\n\t };\n\t MountableFileSystem.prototype.umount = function umount (mountPoint) {\n\t var this$1 = this;\n\t\n\t if (mountPoint[0] !== '/') {\n\t mountPoint = \"/\" + mountPoint;\n\t }\n\t mountPoint = path.resolve(mountPoint);\n\t if (!this.mntMap[mountPoint]) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Mount point \" + mountPoint + \" is already unmounted.\");\n\t }\n\t delete this.mntMap[mountPoint];\n\t this.mountList.splice(this.mountList.indexOf(mountPoint), 1);\n\t while (mountPoint !== '/') {\n\t if (this$1.rootFs.readdirSync(mountPoint).length === 0) {\n\t this$1.rootFs.rmdirSync(mountPoint);\n\t mountPoint = path.dirname(mountPoint);\n\t }\n\t else {\n\t break;\n\t }\n\t }\n\t };\n\t /**\n\t * Returns the file system that the path points to.\n\t */\n\t MountableFileSystem.prototype._getFs = function _getFs (path$$1) {\n\t var this$1 = this;\n\t\n\t var mountList = this.mountList, len = mountList.length;\n\t for (var i = 0; i < len; i++) {\n\t var mountPoint = mountList[i];\n\t // We know path is normalized, so it is a substring of the mount point.\n\t if (mountPoint.length <= path$$1.length && path$$1.indexOf(mountPoint) === 0) {\n\t path$$1 = path$$1.substr(mountPoint.length > 1 ? mountPoint.length : 0);\n\t if (path$$1 === '') {\n\t path$$1 = '/';\n\t }\n\t return { fs: this$1.mntMap[mountPoint], path: path$$1 };\n\t }\n\t }\n\t // Query our root file system.\n\t return { fs: this.rootFs, path: path$$1 };\n\t };\n\t // Global information methods\n\t MountableFileSystem.prototype.getName = function getName () {\n\t return MountableFileSystem.Name;\n\t };\n\t MountableFileSystem.prototype.diskSpace = function diskSpace (path$$1, cb) {\n\t cb(0, 0);\n\t };\n\t MountableFileSystem.prototype.isReadOnly = function isReadOnly () {\n\t return false;\n\t };\n\t MountableFileSystem.prototype.supportsLinks = function supportsLinks () {\n\t // I'm not ready for cross-FS links yet.\n\t return false;\n\t };\n\t MountableFileSystem.prototype.supportsProps = function supportsProps () {\n\t return false;\n\t };\n\t MountableFileSystem.prototype.supportsSynch = function supportsSynch () {\n\t return true;\n\t };\n\t /**\n\t * Fixes up error messages so they mention the mounted file location relative\n\t * to the MFS root, not to the particular FS's root.\n\t * Mutates the input error, and returns it.\n\t */\n\t MountableFileSystem.prototype.standardizeError = function standardizeError (err, path$$1, realPath) {\n\t var index = err.message.indexOf(path$$1);\n\t if (index !== -1) {\n\t err.message = err.message.substr(0, index) + realPath + err.message.substr(index + path$$1.length);\n\t err.path = realPath;\n\t }\n\t return err;\n\t };\n\t // The following methods involve multiple file systems, and thus have custom\n\t // logic.\n\t // Note that we go through the Node API to use its robust default argument\n\t // processing.\n\t MountableFileSystem.prototype.rename = function rename (oldPath, newPath, cb) {\n\t var this$1 = this;\n\t\n\t // Scenario 1: old and new are on same FS.\n\t var fs1rv = this._getFs(oldPath);\n\t var fs2rv = this._getFs(newPath);\n\t if (fs1rv.fs === fs2rv.fs) {\n\t return fs1rv.fs.rename(fs1rv.path, fs2rv.path, function (e) {\n\t if (e) {\n\t this$1.standardizeError(this$1.standardizeError(e, fs1rv.path, oldPath), fs2rv.path, newPath);\n\t }\n\t cb(e);\n\t });\n\t }\n\t // Scenario 2: Different file systems.\n\t // Read old file, write new file, delete old file.\n\t return _fsMock.readFile(oldPath, function (err, data) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t _fsMock.writeFile(newPath, data, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t _fsMock.unlink(oldPath, cb);\n\t });\n\t });\n\t };\n\t MountableFileSystem.prototype.renameSync = function renameSync (oldPath, newPath) {\n\t // Scenario 1: old and new are on same FS.\n\t var fs1rv = this._getFs(oldPath);\n\t var fs2rv = this._getFs(newPath);\n\t if (fs1rv.fs === fs2rv.fs) {\n\t try {\n\t return fs1rv.fs.renameSync(fs1rv.path, fs2rv.path);\n\t }\n\t catch (e) {\n\t this.standardizeError(this.standardizeError(e, fs1rv.path, oldPath), fs2rv.path, newPath);\n\t throw e;\n\t }\n\t }\n\t // Scenario 2: Different file systems.\n\t var data = _fsMock.readFileSync(oldPath);\n\t _fsMock.writeFileSync(newPath, data);\n\t return _fsMock.unlinkSync(oldPath);\n\t };\n\t MountableFileSystem.prototype.readdirSync = function readdirSync (p) {\n\t var fsInfo = this._getFs(p);\n\t // If null, rootfs did not have the directory\n\t // (or the target FS is the root fs).\n\t var rv = null;\n\t // Mount points are all defined in the root FS.\n\t // Ensure that we list those, too.\n\t if (fsInfo.fs !== this.rootFs) {\n\t try {\n\t rv = this.rootFs.readdirSync(p);\n\t }\n\t catch (e) {\n\t // Ignore.\n\t }\n\t }\n\t try {\n\t var rv2 = fsInfo.fs.readdirSync(fsInfo.path);\n\t if (rv === null) {\n\t return rv2;\n\t }\n\t else {\n\t // Filter out duplicates.\n\t return rv2.concat(rv.filter(function (val) { return rv2.indexOf(val) === -1; }));\n\t }\n\t }\n\t catch (e) {\n\t if (rv === null) {\n\t throw this.standardizeError(e, fsInfo.path, p);\n\t }\n\t else {\n\t // The root FS had something.\n\t return rv;\n\t }\n\t }\n\t };\n\t MountableFileSystem.prototype.readdir = function readdir (p, cb) {\n\t var this$1 = this;\n\t\n\t var fsInfo = this._getFs(p);\n\t fsInfo.fs.readdir(fsInfo.path, function (err, files) {\n\t if (fsInfo.fs !== this$1.rootFs) {\n\t try {\n\t var rv = this$1.rootFs.readdirSync(p);\n\t if (files) {\n\t // Filter out duplicates.\n\t files = files.concat(rv.filter(function (val) { return files.indexOf(val) === -1; }));\n\t }\n\t else {\n\t files = rv;\n\t }\n\t }\n\t catch (e) {\n\t // Root FS and target FS did not have directory.\n\t if (err) {\n\t return cb(this$1.standardizeError(err, fsInfo.path, p));\n\t }\n\t }\n\t }\n\t else if (err) {\n\t // Root FS and target FS are the same, and did not have directory.\n\t return cb(this$1.standardizeError(err, fsInfo.path, p));\n\t }\n\t cb(null, files);\n\t });\n\t };\n\t MountableFileSystem.prototype.rmdirSync = function rmdirSync (p) {\n\t var fsInfo = this._getFs(p);\n\t if (this._containsMountPt(p)) {\n\t throw ApiError.ENOTEMPTY(p);\n\t }\n\t else {\n\t try {\n\t fsInfo.fs.rmdirSync(fsInfo.path);\n\t }\n\t catch (e) {\n\t throw this.standardizeError(e, fsInfo.path, p);\n\t }\n\t }\n\t };\n\t MountableFileSystem.prototype.rmdir = function rmdir (p, cb) {\n\t var this$1 = this;\n\t\n\t var fsInfo = this._getFs(p);\n\t if (this._containsMountPt(p)) {\n\t cb(ApiError.ENOTEMPTY(p));\n\t }\n\t else {\n\t fsInfo.fs.rmdir(fsInfo.path, function (err) {\n\t cb(err ? this$1.standardizeError(err, fsInfo.path, p) : null);\n\t });\n\t }\n\t };\n\t /**\n\t * Returns true if the given path contains a mount point.\n\t */\n\t MountableFileSystem.prototype._containsMountPt = function _containsMountPt (p) {\n\t var mountPoints = this.mountList, len = mountPoints.length;\n\t for (var i = 0; i < len; i++) {\n\t var pt = mountPoints[i];\n\t if (pt.length >= p.length && pt.slice(0, p.length) === p) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t };\n\t\n\t return MountableFileSystem;\n\t}(BaseFileSystem));\n\t\n\tMountableFileSystem.Name = \"MountableFileSystem\";\n\tMountableFileSystem.Options = {};\n\t/**\n\t * Tricky: Define all of the functions that merely forward arguments to the\n\t * relevant file system, or return/throw an error.\n\t * Take advantage of the fact that the *first* argument is always the path, and\n\t * the *last* is the callback function (if async).\n\t * @todo Can use numArgs to make proxying more efficient.\n\t * @hidden\n\t */\n\tfunction defineFcn(name, isSync, numArgs) {\n\t if (isSync) {\n\t return function () {\n\t var args = [], len = arguments.length;\n\t while ( len-- ) args[ len ] = arguments[ len ];\n\t\n\t var path$$1 = args[0];\n\t var rv = this._getFs(path$$1);\n\t args[0] = rv.path;\n\t try {\n\t return rv.fs[name].apply(rv.fs, args);\n\t }\n\t catch (e) {\n\t this.standardizeError(e, rv.path, path$$1);\n\t throw e;\n\t }\n\t };\n\t }\n\t else {\n\t return function () {\n\t var this$1 = this;\n\t var args = [], len = arguments.length;\n\t while ( len-- ) args[ len ] = arguments[ len ];\n\t\n\t var path$$1 = args[0];\n\t var rv = this._getFs(path$$1);\n\t args[0] = rv.path;\n\t if (typeof args[args.length - 1] === 'function') {\n\t var cb = args[args.length - 1];\n\t args[args.length - 1] = function () {\n\t var args = [], len = arguments.length;\n\t while ( len-- ) args[ len ] = arguments[ len ];\n\t\n\t if (args.length > 0 && args[0] instanceof ApiError) {\n\t this$1.standardizeError(args[0], rv.path, path$$1);\n\t }\n\t cb.apply(null, args);\n\t };\n\t }\n\t return rv.fs[name].apply(rv.fs, args);\n\t };\n\t }\n\t}\n\t/**\n\t * @hidden\n\t */\n\tvar fsCmdMap = [\n\t // 1 arg functions\n\t ['exists', 'unlink', 'readlink'],\n\t // 2 arg functions\n\t ['stat', 'mkdir', 'realpath', 'truncate'],\n\t // 3 arg functions\n\t ['open', 'readFile', 'chmod', 'utimes'],\n\t // 4 arg functions\n\t ['chown'],\n\t // 5 arg functions\n\t ['writeFile', 'appendFile']\n\t];\n\tfor (var i = 0; i < fsCmdMap.length; i++) {\n\t var cmds = fsCmdMap[i];\n\t for (var i$1 = 0, list = cmds; i$1 < list.length; i$1 += 1) {\n\t var fnName = list[i$1];\n\t\n\t MountableFileSystem.prototype[fnName] = defineFcn(fnName, false, i + 1);\n\t MountableFileSystem.prototype[fnName + 'Sync'] = defineFcn(fnName + 'Sync', true, i + 1);\n\t }\n\t}\n\t\n\t/**\n\t * @hidden\n\t */\n\tvar bfsSetImmediate;\n\tif (typeof (setImmediate) !== \"undefined\") {\n\t bfsSetImmediate = setImmediate;\n\t}\n\telse {\n\t var gScope = global$1;\n\t var timeouts = [];\n\t var messageName = \"zero-timeout-message\";\n\t var canUsePostMessage = function () {\n\t if (typeof gScope.importScripts !== 'undefined' || !gScope.postMessage) {\n\t return false;\n\t }\n\t var postMessageIsAsync = true;\n\t var oldOnMessage = gScope.onmessage;\n\t gScope.onmessage = function () {\n\t postMessageIsAsync = false;\n\t };\n\t gScope.postMessage('', '*');\n\t gScope.onmessage = oldOnMessage;\n\t return postMessageIsAsync;\n\t };\n\t if (canUsePostMessage()) {\n\t bfsSetImmediate = function (fn) {\n\t timeouts.push(fn);\n\t gScope.postMessage(messageName, \"*\");\n\t };\n\t var handleMessage = function (event) {\n\t if (event.source === self && event.data === messageName) {\n\t if (event.stopPropagation) {\n\t event.stopPropagation();\n\t }\n\t else {\n\t event.cancelBubble = true;\n\t }\n\t if (timeouts.length > 0) {\n\t var fn = timeouts.shift();\n\t return fn();\n\t }\n\t }\n\t };\n\t if (gScope.addEventListener) {\n\t gScope.addEventListener('message', handleMessage, true);\n\t }\n\t else {\n\t gScope.attachEvent('onmessage', handleMessage);\n\t }\n\t }\n\t else if (gScope.MessageChannel) {\n\t // WebWorker MessageChannel\n\t var channel = new gScope.MessageChannel();\n\t channel.port1.onmessage = function (event) {\n\t if (timeouts.length > 0) {\n\t return timeouts.shift()();\n\t }\n\t };\n\t bfsSetImmediate = function (fn) {\n\t timeouts.push(fn);\n\t channel.port2.postMessage('');\n\t };\n\t }\n\t else {\n\t bfsSetImmediate = function (fn) {\n\t return setTimeout(fn, 0);\n\t };\n\t }\n\t}\n\tvar setImmediate$3 = bfsSetImmediate;\n\t\n\t/**\n\t * Non-recursive mutex\n\t * @hidden\n\t */\n\tvar Mutex = function Mutex() {\n\t this._locked = false;\n\t this._waiters = [];\n\t};\n\tMutex.prototype.lock = function lock (cb) {\n\t if (this._locked) {\n\t this._waiters.push(cb);\n\t return;\n\t }\n\t this._locked = true;\n\t cb();\n\t};\n\tMutex.prototype.unlock = function unlock () {\n\t if (!this._locked) {\n\t throw new Error('unlock of a non-locked mutex');\n\t }\n\t var next = this._waiters.shift();\n\t // don't unlock - we want to queue up next for the\n\t // _end_ of the current task execution, but we don't\n\t // want it to be called inline with whatever the\n\t // current stack is. This way we still get the nice\n\t // behavior that an unlock immediately followed by a\n\t // lock won't cause starvation.\n\t if (next) {\n\t setImmediate$3(next);\n\t return;\n\t }\n\t this._locked = false;\n\t};\n\tMutex.prototype.tryLock = function tryLock () {\n\t if (this._locked) {\n\t return false;\n\t }\n\t this._locked = true;\n\t return true;\n\t};\n\tMutex.prototype.isLocked = function isLocked () {\n\t return this._locked;\n\t};\n\t\n\t/**\n\t * This class serializes access to an underlying async filesystem.\n\t * For example, on an OverlayFS instance with an async lower\n\t * directory operations like rename and rmdir may involve multiple\n\t * requests involving both the upper and lower filesystems -- they\n\t * are not executed in a single atomic step. OverlayFS uses this\n\t * LockedFS to avoid having to reason about the correctness of\n\t * multiple requests interleaving.\n\t */\n\tvar LockedFS = function LockedFS(fs) {\n\t this._fs = fs;\n\t this._mu = new Mutex();\n\t};\n\tLockedFS.prototype.getName = function getName () {\n\t return 'LockedFS<' + this._fs.getName() + '>';\n\t};\n\tLockedFS.prototype.getFSUnlocked = function getFSUnlocked () {\n\t return this._fs;\n\t};\n\tLockedFS.prototype.initialize = function initialize (cb) {\n\t // FIXME: check to see if FS supports initialization\n\t this._fs.initialize(cb);\n\t};\n\tLockedFS.prototype.diskSpace = function diskSpace (p, cb) {\n\t // FIXME: should this lock?\n\t this._fs.diskSpace(p, cb);\n\t};\n\tLockedFS.prototype.isReadOnly = function isReadOnly () {\n\t return this._fs.isReadOnly();\n\t};\n\tLockedFS.prototype.supportsLinks = function supportsLinks () {\n\t return this._fs.supportsLinks();\n\t};\n\tLockedFS.prototype.supportsProps = function supportsProps () {\n\t return this._fs.supportsProps();\n\t};\n\tLockedFS.prototype.supportsSynch = function supportsSynch () {\n\t return this._fs.supportsSynch();\n\t};\n\tLockedFS.prototype.rename = function rename (oldPath, newPath, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.rename(oldPath, newPath, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.renameSync = function renameSync (oldPath, newPath) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.renameSync(oldPath, newPath);\n\t};\n\tLockedFS.prototype.stat = function stat (p, isLstat, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.stat(p, isLstat, function (err, stat) {\n\t this$1._mu.unlock();\n\t cb(err, stat);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.statSync = function statSync (p, isLstat) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.statSync(p, isLstat);\n\t};\n\tLockedFS.prototype.open = function open (p, flag, mode, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.open(p, flag, mode, function (err, fd) {\n\t this$1._mu.unlock();\n\t cb(err, fd);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.openSync = function openSync (p, flag, mode) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.openSync(p, flag, mode);\n\t};\n\tLockedFS.prototype.unlink = function unlink (p, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.unlink(p, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.unlinkSync = function unlinkSync (p) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.unlinkSync(p);\n\t};\n\tLockedFS.prototype.rmdir = function rmdir (p, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.rmdir(p, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.rmdirSync = function rmdirSync (p) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.rmdirSync(p);\n\t};\n\tLockedFS.prototype.mkdir = function mkdir (p, mode, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.mkdir(p, mode, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.mkdirSync = function mkdirSync (p, mode) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.mkdirSync(p, mode);\n\t};\n\tLockedFS.prototype.readdir = function readdir (p, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.readdir(p, function (err, files) {\n\t this$1._mu.unlock();\n\t cb(err, files);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.readdirSync = function readdirSync (p) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.readdirSync(p);\n\t};\n\tLockedFS.prototype.exists = function exists (p, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.exists(p, function (exists) {\n\t this$1._mu.unlock();\n\t cb(exists);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.existsSync = function existsSync (p) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.existsSync(p);\n\t};\n\tLockedFS.prototype.realpath = function realpath (p, cache, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.realpath(p, cache, function (err, resolvedPath) {\n\t this$1._mu.unlock();\n\t cb(err, resolvedPath);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.realpathSync = function realpathSync (p, cache) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.realpathSync(p, cache);\n\t};\n\tLockedFS.prototype.truncate = function truncate (p, len, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.truncate(p, len, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.truncateSync = function truncateSync (p, len) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.truncateSync(p, len);\n\t};\n\tLockedFS.prototype.readFile = function readFile (fname, encoding, flag, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.readFile(fname, encoding, flag, function (err, data) {\n\t this$1._mu.unlock();\n\t cb(err, data);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.readFileSync = function readFileSync (fname, encoding, flag) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.readFileSync(fname, encoding, flag);\n\t};\n\tLockedFS.prototype.writeFile = function writeFile (fname, data, encoding, flag, mode, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.writeFile(fname, data, encoding, flag, mode, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.writeFileSync = function writeFileSync (fname, data, encoding, flag, mode) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.writeFileSync(fname, data, encoding, flag, mode);\n\t};\n\tLockedFS.prototype.appendFile = function appendFile (fname, data, encoding, flag, mode, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.appendFile(fname, data, encoding, flag, mode, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.appendFileSync = function appendFileSync (fname, data, encoding, flag, mode) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.appendFileSync(fname, data, encoding, flag, mode);\n\t};\n\tLockedFS.prototype.chmod = function chmod (p, isLchmod, mode, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.chmod(p, isLchmod, mode, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.chmodSync = function chmodSync (p, isLchmod, mode) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.chmodSync(p, isLchmod, mode);\n\t};\n\tLockedFS.prototype.chown = function chown (p, isLchown, uid, gid, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.chown(p, isLchown, uid, gid, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.chownSync = function chownSync (p, isLchown, uid, gid) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.chownSync(p, isLchown, uid, gid);\n\t};\n\tLockedFS.prototype.utimes = function utimes (p, atime, mtime, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.utimes(p, atime, mtime, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.utimesSync = function utimesSync (p, atime, mtime) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.utimesSync(p, atime, mtime);\n\t};\n\tLockedFS.prototype.link = function link (srcpath, dstpath, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.link(srcpath, dstpath, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.linkSync = function linkSync (srcpath, dstpath) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.linkSync(srcpath, dstpath);\n\t};\n\tLockedFS.prototype.symlink = function symlink (srcpath, dstpath, type, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.symlink(srcpath, dstpath, type, function (err) {\n\t this$1._mu.unlock();\n\t cb(err);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.symlinkSync = function symlinkSync (srcpath, dstpath, type) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.symlinkSync(srcpath, dstpath, type);\n\t};\n\tLockedFS.prototype.readlink = function readlink (p, cb) {\n\t var this$1 = this;\n\t\n\t this._mu.lock(function () {\n\t this$1._fs.readlink(p, function (err, linkString) {\n\t this$1._mu.unlock();\n\t cb(err, linkString);\n\t });\n\t });\n\t};\n\tLockedFS.prototype.readlinkSync = function readlinkSync (p) {\n\t if (this._mu.isLocked()) {\n\t throw new Error('invalid sync call');\n\t }\n\t return this._fs.readlinkSync(p);\n\t};\n\t\n\t/**\n\t * @hidden\n\t */\n\tvar deletionLogPath = '/.deletedFiles.log';\n\t/**\n\t * Given a read-only mode, makes it writable.\n\t * @hidden\n\t */\n\tfunction makeModeWritable(mode) {\n\t return 146 | mode;\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction getFlag(f) {\n\t return FileFlag.getFileFlag(f);\n\t}\n\t/**\n\t * Overlays a RO file to make it writable.\n\t */\n\tvar OverlayFile = (function (PreloadFile$$1) {\n\t function OverlayFile(fs, path$$1, flag, stats, data) {\n\t PreloadFile$$1.call(this, fs, path$$1, flag, stats, data);\n\t }\n\t\n\t if ( PreloadFile$$1 ) OverlayFile.__proto__ = PreloadFile$$1;\n\t OverlayFile.prototype = Object.create( PreloadFile$$1 && PreloadFile$$1.prototype );\n\t OverlayFile.prototype.constructor = OverlayFile;\n\t OverlayFile.prototype.sync = function sync (cb) {\n\t var this$1 = this;\n\t\n\t if (!this.isDirty()) {\n\t cb(null);\n\t return;\n\t }\n\t this._fs._syncAsync(this, function (err) {\n\t this$1.resetDirty();\n\t cb(err);\n\t });\n\t };\n\t OverlayFile.prototype.syncSync = function syncSync () {\n\t if (this.isDirty()) {\n\t this._fs._syncSync(this);\n\t this.resetDirty();\n\t }\n\t };\n\t OverlayFile.prototype.close = function close (cb) {\n\t this.sync(cb);\n\t };\n\t OverlayFile.prototype.closeSync = function closeSync () {\n\t this.syncSync();\n\t };\n\t\n\t return OverlayFile;\n\t}(PreloadFile));\n\t/**\n\t * *INTERNAL, DO NOT USE DIRECTLY!*\n\t *\n\t * Core OverlayFS class that contains no locking whatsoever. We wrap these objects\n\t * in a LockedFS to prevent races.\n\t */\n\tvar UnlockedOverlayFS = (function (BaseFileSystem$$1) {\n\t function UnlockedOverlayFS(writable, readable) {\n\t BaseFileSystem$$1.call(this);\n\t this._isInitialized = false;\n\t this._initializeCallbacks = [];\n\t this._deletedFiles = {};\n\t this._deleteLog = '';\n\t // If 'true', we have scheduled a delete log update.\n\t this._deleteLogUpdatePending = false;\n\t // If 'true', a delete log update is needed after the scheduled delete log\n\t // update finishes.\n\t this._deleteLogUpdateNeeded = false;\n\t // If there was an error updating the delete log...\n\t this._deleteLogError = null;\n\t this._writable = writable;\n\t this._readable = readable;\n\t if (this._writable.isReadOnly()) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Writable file system must be writable.\");\n\t }\n\t }\n\t\n\t if ( BaseFileSystem$$1 ) UnlockedOverlayFS.__proto__ = BaseFileSystem$$1;\n\t UnlockedOverlayFS.prototype = Object.create( BaseFileSystem$$1 && BaseFileSystem$$1.prototype );\n\t UnlockedOverlayFS.prototype.constructor = UnlockedOverlayFS;\n\t UnlockedOverlayFS.isAvailable = function isAvailable () {\n\t return true;\n\t };\n\t UnlockedOverlayFS.prototype.getOverlayedFileSystems = function getOverlayedFileSystems () {\n\t return {\n\t readable: this._readable,\n\t writable: this._writable\n\t };\n\t };\n\t UnlockedOverlayFS.prototype._syncAsync = function _syncAsync (file, cb) {\n\t var this$1 = this;\n\t\n\t this.createParentDirectoriesAsync(file.getPath(), function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t this$1._writable.writeFile(file.getPath(), file.getBuffer(), null, getFlag('w'), file.getStats().mode, cb);\n\t });\n\t };\n\t UnlockedOverlayFS.prototype._syncSync = function _syncSync (file) {\n\t this.createParentDirectories(file.getPath());\n\t this._writable.writeFileSync(file.getPath(), file.getBuffer(), null, getFlag('w'), file.getStats().mode);\n\t };\n\t UnlockedOverlayFS.prototype.getName = function getName () {\n\t return OverlayFS.Name;\n\t };\n\t /**\n\t * Called once to load up metadata stored on the writable file system.\n\t */\n\t UnlockedOverlayFS.prototype.initialize = function initialize (cb) {\n\t var this$1 = this;\n\t\n\t var callbackArray = this._initializeCallbacks;\n\t var end = function (e) {\n\t this$1._isInitialized = !e;\n\t this$1._initializeCallbacks = [];\n\t callbackArray.forEach((function (cb) { return cb(e); }));\n\t };\n\t // if we're already initialized, immediately invoke the callback\n\t if (this._isInitialized) {\n\t return cb();\n\t }\n\t callbackArray.push(cb);\n\t // The first call to initialize initializes, the rest wait for it to complete.\n\t if (callbackArray.length !== 1) {\n\t return;\n\t }\n\t // Read deletion log, process into metadata.\n\t this._writable.readFile(deletionLogPath, 'utf8', getFlag('r'), function (err, data) {\n\t if (err) {\n\t // ENOENT === Newly-instantiated file system, and thus empty log.\n\t if (err.errno !== ErrorCode.ENOENT) {\n\t return end(err);\n\t }\n\t }\n\t else {\n\t this$1._deleteLog = data;\n\t }\n\t this$1._reparseDeletionLog();\n\t end();\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.isReadOnly = function isReadOnly () { return false; };\n\t UnlockedOverlayFS.prototype.supportsSynch = function supportsSynch () { return this._readable.supportsSynch() && this._writable.supportsSynch(); };\n\t UnlockedOverlayFS.prototype.supportsLinks = function supportsLinks () { return false; };\n\t UnlockedOverlayFS.prototype.supportsProps = function supportsProps () { return this._readable.supportsProps() && this._writable.supportsProps(); };\n\t UnlockedOverlayFS.prototype.getDeletionLog = function getDeletionLog () {\n\t return this._deleteLog;\n\t };\n\t UnlockedOverlayFS.prototype.restoreDeletionLog = function restoreDeletionLog (log) {\n\t this._deleteLog = log;\n\t this._reparseDeletionLog();\n\t this.updateLog('');\n\t };\n\t UnlockedOverlayFS.prototype.rename = function rename (oldPath, newPath, cb) {\n\t var this$1 = this;\n\t\n\t if (!this.checkInitAsync(cb) || this.checkPathAsync(oldPath, cb) || this.checkPathAsync(newPath, cb)) {\n\t return;\n\t }\n\t if (oldPath === deletionLogPath || newPath === deletionLogPath) {\n\t return cb(ApiError.EPERM('Cannot rename deletion log.'));\n\t }\n\t // nothing to do if paths match\n\t if (oldPath === newPath) {\n\t return cb();\n\t }\n\t this.stat(oldPath, false, function (oldErr, oldStats) {\n\t if (oldErr) {\n\t return cb(oldErr);\n\t }\n\t return this$1.stat(newPath, false, function (newErr, newStats) {\n\t var self = this$1;\n\t // precondition: both oldPath and newPath exist and are dirs.\n\t // decreases: |files|\n\t // Need to move *every file/folder* currently stored on\n\t // readable to its new location on writable.\n\t function copyDirContents(files) {\n\t var file = files.shift();\n\t if (!file) {\n\t return cb();\n\t }\n\t var oldFile = path.resolve(oldPath, file);\n\t var newFile = path.resolve(newPath, file);\n\t // Recursion! Should work for any nested files / folders.\n\t self.rename(oldFile, newFile, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t copyDirContents(files);\n\t });\n\t }\n\t var mode = 511;\n\t // from linux's rename(2) manpage: oldpath can specify a\n\t // directory. In this case, newpath must either not exist, or\n\t // it must specify an empty directory.\n\t if (oldStats.isDirectory()) {\n\t if (newErr) {\n\t if (newErr.errno !== ErrorCode.ENOENT) {\n\t return cb(newErr);\n\t }\n\t return this$1._writable.exists(oldPath, function (exists) {\n\t // simple case - both old and new are on the writable layer\n\t if (exists) {\n\t return this$1._writable.rename(oldPath, newPath, cb);\n\t }\n\t this$1._writable.mkdir(newPath, mode, function (mkdirErr) {\n\t if (mkdirErr) {\n\t return cb(mkdirErr);\n\t }\n\t this$1._readable.readdir(oldPath, function (err, files) {\n\t if (err) {\n\t return cb();\n\t }\n\t copyDirContents(files);\n\t });\n\t });\n\t });\n\t }\n\t mode = newStats.mode;\n\t if (!newStats.isDirectory()) {\n\t return cb(ApiError.ENOTDIR(newPath));\n\t }\n\t this$1.readdir(newPath, function (readdirErr, files) {\n\t if (files && files.length) {\n\t return cb(ApiError.ENOTEMPTY(newPath));\n\t }\n\t this$1._readable.readdir(oldPath, function (err, files) {\n\t if (err) {\n\t return cb();\n\t }\n\t copyDirContents(files);\n\t });\n\t });\n\t }\n\t if (newStats && newStats.isDirectory()) {\n\t return cb(ApiError.EISDIR(newPath));\n\t }\n\t this$1.readFile(oldPath, null, getFlag('r'), function (err, data) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t return this$1.writeFile(newPath, data, null, getFlag('w'), oldStats.mode, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t return this$1.unlink(oldPath, cb);\n\t });\n\t });\n\t });\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.renameSync = function renameSync (oldPath, newPath) {\n\t var this$1 = this;\n\t\n\t this.checkInitialized();\n\t this.checkPath(oldPath);\n\t this.checkPath(newPath);\n\t if (oldPath === deletionLogPath || newPath === deletionLogPath) {\n\t throw ApiError.EPERM('Cannot rename deletion log.');\n\t }\n\t // Write newPath using oldPath's contents, delete oldPath.\n\t var oldStats = this.statSync(oldPath, false);\n\t if (oldStats.isDirectory()) {\n\t // Optimization: Don't bother moving if old === new.\n\t if (oldPath === newPath) {\n\t return;\n\t }\n\t var mode = 511;\n\t if (this.existsSync(newPath)) {\n\t var stats = this.statSync(newPath, false);\n\t mode = stats.mode;\n\t if (stats.isDirectory()) {\n\t if (this.readdirSync(newPath).length > 0) {\n\t throw ApiError.ENOTEMPTY(newPath);\n\t }\n\t }\n\t else {\n\t throw ApiError.ENOTDIR(newPath);\n\t }\n\t }\n\t // Take care of writable first. Move any files there, or create an empty directory\n\t // if it doesn't exist.\n\t if (this._writable.existsSync(oldPath)) {\n\t this._writable.renameSync(oldPath, newPath);\n\t }\n\t else if (!this._writable.existsSync(newPath)) {\n\t this._writable.mkdirSync(newPath, mode);\n\t }\n\t // Need to move *every file/folder* currently stored on readable to its new location\n\t // on writable.\n\t if (this._readable.existsSync(oldPath)) {\n\t this._readable.readdirSync(oldPath).forEach(function (name) {\n\t // Recursion! Should work for any nested files / folders.\n\t this$1.renameSync(path.resolve(oldPath, name), path.resolve(newPath, name));\n\t });\n\t }\n\t }\n\t else {\n\t if (this.existsSync(newPath) && this.statSync(newPath, false).isDirectory()) {\n\t throw ApiError.EISDIR(newPath);\n\t }\n\t this.writeFileSync(newPath, this.readFileSync(oldPath, null, getFlag('r')), null, getFlag('w'), oldStats.mode);\n\t }\n\t if (oldPath !== newPath && this.existsSync(oldPath)) {\n\t this.unlinkSync(oldPath);\n\t }\n\t };\n\t UnlockedOverlayFS.prototype.stat = function stat (p, isLstat, cb) {\n\t var this$1 = this;\n\t\n\t if (!this.checkInitAsync(cb)) {\n\t return;\n\t }\n\t this._writable.stat(p, isLstat, function (err, stat) {\n\t if (err && err.errno === ErrorCode.ENOENT) {\n\t if (this$1._deletedFiles[p]) {\n\t cb(ApiError.ENOENT(p));\n\t }\n\t this$1._readable.stat(p, isLstat, function (err, stat) {\n\t if (stat) {\n\t // Make the oldStat's mode writable. Preserve the topmost\n\t // part of the mode, which specifies if it is a file or a\n\t // directory.\n\t stat = stat.clone();\n\t stat.mode = makeModeWritable(stat.mode);\n\t }\n\t cb(err, stat);\n\t });\n\t }\n\t else {\n\t cb(err, stat);\n\t }\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.statSync = function statSync (p, isLstat) {\n\t this.checkInitialized();\n\t try {\n\t return this._writable.statSync(p, isLstat);\n\t }\n\t catch (e) {\n\t if (this._deletedFiles[p]) {\n\t throw ApiError.ENOENT(p);\n\t }\n\t var oldStat = this._readable.statSync(p, isLstat).clone();\n\t // Make the oldStat's mode writable. Preserve the topmost part of the\n\t // mode, which specifies if it is a file or a directory.\n\t oldStat.mode = makeModeWritable(oldStat.mode);\n\t return oldStat;\n\t }\n\t };\n\t UnlockedOverlayFS.prototype.open = function open (p, flag, mode, cb) {\n\t var this$1 = this;\n\t\n\t if (!this.checkInitAsync(cb) || this.checkPathAsync(p, cb)) {\n\t return;\n\t }\n\t this.stat(p, false, function (err, stats) {\n\t if (stats) {\n\t switch (flag.pathExistsAction()) {\n\t case ActionType.TRUNCATE_FILE:\n\t return this$1.createParentDirectoriesAsync(p, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t this$1._writable.open(p, flag, mode, cb);\n\t });\n\t case ActionType.NOP:\n\t return this$1._writable.exists(p, function (exists) {\n\t if (exists) {\n\t this$1._writable.open(p, flag, mode, cb);\n\t }\n\t else {\n\t // at this point we know the stats object we got is from\n\t // the readable FS.\n\t stats = stats.clone();\n\t stats.mode = mode;\n\t this$1._readable.readFile(p, null, getFlag('r'), function (readFileErr, data) {\n\t if (readFileErr) {\n\t return cb(readFileErr);\n\t }\n\t if (stats.size === -1) {\n\t stats.size = data.length;\n\t }\n\t var f = new OverlayFile(this$1, p, flag, stats, data);\n\t cb(null, f);\n\t });\n\t }\n\t });\n\t default:\n\t return cb(ApiError.EEXIST(p));\n\t }\n\t }\n\t else {\n\t switch (flag.pathNotExistsAction()) {\n\t case ActionType.CREATE_FILE:\n\t return this$1.createParentDirectoriesAsync(p, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t return this$1._writable.open(p, flag, mode, cb);\n\t });\n\t default:\n\t return cb(ApiError.ENOENT(p));\n\t }\n\t }\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.openSync = function openSync (p, flag, mode) {\n\t this.checkInitialized();\n\t this.checkPath(p);\n\t if (p === deletionLogPath) {\n\t throw ApiError.EPERM('Cannot open deletion log.');\n\t }\n\t if (this.existsSync(p)) {\n\t switch (flag.pathExistsAction()) {\n\t case ActionType.TRUNCATE_FILE:\n\t this.createParentDirectories(p);\n\t return this._writable.openSync(p, flag, mode);\n\t case ActionType.NOP:\n\t if (this._writable.existsSync(p)) {\n\t return this._writable.openSync(p, flag, mode);\n\t }\n\t else {\n\t // Create an OverlayFile.\n\t var buf = this._readable.readFileSync(p, null, getFlag('r'));\n\t var stats = this._readable.statSync(p, false).clone();\n\t stats.mode = mode;\n\t return new OverlayFile(this, p, flag, stats, buf);\n\t }\n\t default:\n\t throw ApiError.EEXIST(p);\n\t }\n\t }\n\t else {\n\t switch (flag.pathNotExistsAction()) {\n\t case ActionType.CREATE_FILE:\n\t this.createParentDirectories(p);\n\t return this._writable.openSync(p, flag, mode);\n\t default:\n\t throw ApiError.ENOENT(p);\n\t }\n\t }\n\t };\n\t UnlockedOverlayFS.prototype.unlink = function unlink (p, cb) {\n\t var this$1 = this;\n\t\n\t if (!this.checkInitAsync(cb) || this.checkPathAsync(p, cb)) {\n\t return;\n\t }\n\t this.exists(p, function (exists) {\n\t if (!exists) {\n\t return cb(ApiError.ENOENT(p));\n\t }\n\t this$1._writable.exists(p, function (writableExists) {\n\t if (writableExists) {\n\t return this$1._writable.unlink(p, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t this$1.exists(p, function (readableExists) {\n\t if (readableExists) {\n\t this$1.deletePath(p);\n\t }\n\t cb(null);\n\t });\n\t });\n\t }\n\t else {\n\t // if this only exists on the readable FS, add it to the\n\t // delete map.\n\t this$1.deletePath(p);\n\t cb(null);\n\t }\n\t });\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.unlinkSync = function unlinkSync (p) {\n\t this.checkInitialized();\n\t this.checkPath(p);\n\t if (this.existsSync(p)) {\n\t if (this._writable.existsSync(p)) {\n\t this._writable.unlinkSync(p);\n\t }\n\t // if it still exists add to the delete log\n\t if (this.existsSync(p)) {\n\t this.deletePath(p);\n\t }\n\t }\n\t else {\n\t throw ApiError.ENOENT(p);\n\t }\n\t };\n\t UnlockedOverlayFS.prototype.rmdir = function rmdir (p, cb) {\n\t var this$1 = this;\n\t\n\t if (!this.checkInitAsync(cb)) {\n\t return;\n\t }\n\t var rmdirLower = function () {\n\t this$1.readdir(p, function (err, files) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t if (files.length) {\n\t return cb(ApiError.ENOTEMPTY(p));\n\t }\n\t this$1.deletePath(p);\n\t cb(null);\n\t });\n\t };\n\t this.exists(p, function (exists) {\n\t if (!exists) {\n\t return cb(ApiError.ENOENT(p));\n\t }\n\t this$1._writable.exists(p, function (writableExists) {\n\t if (writableExists) {\n\t this$1._writable.rmdir(p, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t this$1._readable.exists(p, function (readableExists) {\n\t if (readableExists) {\n\t rmdirLower();\n\t }\n\t else {\n\t cb();\n\t }\n\t });\n\t });\n\t }\n\t else {\n\t rmdirLower();\n\t }\n\t });\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.rmdirSync = function rmdirSync (p) {\n\t this.checkInitialized();\n\t if (this.existsSync(p)) {\n\t if (this._writable.existsSync(p)) {\n\t this._writable.rmdirSync(p);\n\t }\n\t if (this.existsSync(p)) {\n\t // Check if directory is empty.\n\t if (this.readdirSync(p).length > 0) {\n\t throw ApiError.ENOTEMPTY(p);\n\t }\n\t else {\n\t this.deletePath(p);\n\t }\n\t }\n\t }\n\t else {\n\t throw ApiError.ENOENT(p);\n\t }\n\t };\n\t UnlockedOverlayFS.prototype.mkdir = function mkdir (p, mode, cb) {\n\t var this$1 = this;\n\t\n\t if (!this.checkInitAsync(cb)) {\n\t return;\n\t }\n\t this.exists(p, function (exists) {\n\t if (exists) {\n\t return cb(ApiError.EEXIST(p));\n\t }\n\t // The below will throw should any of the parent directories\n\t // fail to exist on _writable.\n\t this$1.createParentDirectoriesAsync(p, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t this$1._writable.mkdir(p, mode, cb);\n\t });\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.mkdirSync = function mkdirSync (p, mode) {\n\t this.checkInitialized();\n\t if (this.existsSync(p)) {\n\t throw ApiError.EEXIST(p);\n\t }\n\t else {\n\t // The below will throw should any of the parent directories fail to exist\n\t // on _writable.\n\t this.createParentDirectories(p);\n\t this._writable.mkdirSync(p, mode);\n\t }\n\t };\n\t UnlockedOverlayFS.prototype.readdir = function readdir (p, cb) {\n\t var this$1 = this;\n\t\n\t if (!this.checkInitAsync(cb)) {\n\t return;\n\t }\n\t this.stat(p, false, function (err, dirStats) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t if (!dirStats.isDirectory()) {\n\t return cb(ApiError.ENOTDIR(p));\n\t }\n\t this$1._writable.readdir(p, function (err, wFiles) {\n\t if (err && err.code !== 'ENOENT') {\n\t return cb(err);\n\t }\n\t else if (err || !wFiles) {\n\t wFiles = [];\n\t }\n\t this$1._readable.readdir(p, function (err, rFiles) {\n\t // if the directory doesn't exist on the lower FS set rFiles\n\t // here to simplify the following code.\n\t if (err || !rFiles) {\n\t rFiles = [];\n\t }\n\t // Readdir in both, check delete log on read-only file system's files, merge, return.\n\t var seenMap = {};\n\t var filtered = wFiles.concat(rFiles.filter(function (fPath) { return !this$1._deletedFiles[(p + \"/\" + fPath)]; })).filter(function (fPath) {\n\t // Remove duplicates.\n\t var result = !seenMap[fPath];\n\t seenMap[fPath] = true;\n\t return result;\n\t });\n\t cb(null, filtered);\n\t });\n\t });\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.readdirSync = function readdirSync (p) {\n\t var this$1 = this;\n\t\n\t this.checkInitialized();\n\t var dirStats = this.statSync(p, false);\n\t if (!dirStats.isDirectory()) {\n\t throw ApiError.ENOTDIR(p);\n\t }\n\t // Readdir in both, check delete log on RO file system's listing, merge, return.\n\t var contents = [];\n\t try {\n\t contents = contents.concat(this._writable.readdirSync(p));\n\t }\n\t catch (e) {\n\t // NOP.\n\t }\n\t try {\n\t contents = contents.concat(this._readable.readdirSync(p).filter(function (fPath) { return !this$1._deletedFiles[(p + \"/\" + fPath)]; }));\n\t }\n\t catch (e) {\n\t // NOP.\n\t }\n\t var seenMap = {};\n\t return contents.filter(function (fileP) {\n\t var result = !seenMap[fileP];\n\t seenMap[fileP] = true;\n\t return result;\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.exists = function exists (p, cb) {\n\t var this$1 = this;\n\t\n\t // Cannot pass an error back to callback, so throw an exception instead\n\t // if not initialized.\n\t this.checkInitialized();\n\t this._writable.exists(p, function (existsWritable) {\n\t if (existsWritable) {\n\t return cb(true);\n\t }\n\t this$1._readable.exists(p, function (existsReadable) {\n\t cb(existsReadable && this$1._deletedFiles[p] !== true);\n\t });\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.existsSync = function existsSync (p) {\n\t this.checkInitialized();\n\t return this._writable.existsSync(p) || (this._readable.existsSync(p) && this._deletedFiles[p] !== true);\n\t };\n\t UnlockedOverlayFS.prototype.chmod = function chmod (p, isLchmod, mode, cb) {\n\t var this$1 = this;\n\t\n\t if (!this.checkInitAsync(cb)) {\n\t return;\n\t }\n\t this.operateOnWritableAsync(p, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t else {\n\t this$1._writable.chmod(p, isLchmod, mode, cb);\n\t }\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.chmodSync = function chmodSync (p, isLchmod, mode) {\n\t var this$1 = this;\n\t\n\t this.checkInitialized();\n\t this.operateOnWritable(p, function () {\n\t this$1._writable.chmodSync(p, isLchmod, mode);\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.chown = function chown (p, isLchmod, uid, gid, cb) {\n\t var this$1 = this;\n\t\n\t if (!this.checkInitAsync(cb)) {\n\t return;\n\t }\n\t this.operateOnWritableAsync(p, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t else {\n\t this$1._writable.chown(p, isLchmod, uid, gid, cb);\n\t }\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.chownSync = function chownSync (p, isLchown, uid, gid) {\n\t var this$1 = this;\n\t\n\t this.checkInitialized();\n\t this.operateOnWritable(p, function () {\n\t this$1._writable.chownSync(p, isLchown, uid, gid);\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.utimes = function utimes (p, atime, mtime, cb) {\n\t var this$1 = this;\n\t\n\t if (!this.checkInitAsync(cb)) {\n\t return;\n\t }\n\t this.operateOnWritableAsync(p, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t else {\n\t this$1._writable.utimes(p, atime, mtime, cb);\n\t }\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.utimesSync = function utimesSync (p, atime, mtime) {\n\t var this$1 = this;\n\t\n\t this.checkInitialized();\n\t this.operateOnWritable(p, function () {\n\t this$1._writable.utimesSync(p, atime, mtime);\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.deletePath = function deletePath (p) {\n\t this._deletedFiles[p] = true;\n\t this.updateLog((\"d\" + p + \"\\n\"));\n\t };\n\t UnlockedOverlayFS.prototype.updateLog = function updateLog (addition) {\n\t var this$1 = this;\n\t\n\t this._deleteLog += addition;\n\t if (this._deleteLogUpdatePending) {\n\t this._deleteLogUpdateNeeded = true;\n\t }\n\t else {\n\t this._deleteLogUpdatePending = true;\n\t this._writable.writeFile(deletionLogPath, this._deleteLog, 'utf8', FileFlag.getFileFlag('w'), 420, function (e) {\n\t this$1._deleteLogUpdatePending = false;\n\t if (e) {\n\t this$1._deleteLogError = e;\n\t }\n\t else if (this$1._deleteLogUpdateNeeded) {\n\t this$1._deleteLogUpdateNeeded = false;\n\t this$1.updateLog('');\n\t }\n\t });\n\t }\n\t };\n\t UnlockedOverlayFS.prototype._reparseDeletionLog = function _reparseDeletionLog () {\n\t var this$1 = this;\n\t\n\t this._deletedFiles = {};\n\t this._deleteLog.split('\\n').forEach(function (path$$1) {\n\t // If the log entry begins w/ 'd', it's a deletion.\n\t this$1._deletedFiles[path$$1.slice(1)] = path$$1.slice(0, 1) === 'd';\n\t });\n\t };\n\t UnlockedOverlayFS.prototype.checkInitialized = function checkInitialized () {\n\t if (!this._isInitialized) {\n\t throw new ApiError(ErrorCode.EPERM, \"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.\");\n\t }\n\t else if (this._deleteLogError !== null) {\n\t var e = this._deleteLogError;\n\t this._deleteLogError = null;\n\t throw e;\n\t }\n\t };\n\t UnlockedOverlayFS.prototype.checkInitAsync = function checkInitAsync (cb) {\n\t if (!this._isInitialized) {\n\t cb(new ApiError(ErrorCode.EPERM, \"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.\"));\n\t return false;\n\t }\n\t else if (this._deleteLogError !== null) {\n\t var e = this._deleteLogError;\n\t this._deleteLogError = null;\n\t cb(e);\n\t return false;\n\t }\n\t return true;\n\t };\n\t UnlockedOverlayFS.prototype.checkPath = function checkPath (p) {\n\t if (p === deletionLogPath) {\n\t throw ApiError.EPERM(p);\n\t }\n\t };\n\t UnlockedOverlayFS.prototype.checkPathAsync = function checkPathAsync (p, cb) {\n\t if (p === deletionLogPath) {\n\t cb(ApiError.EPERM(p));\n\t return true;\n\t }\n\t return false;\n\t };\n\t UnlockedOverlayFS.prototype.createParentDirectoriesAsync = function createParentDirectoriesAsync (p, cb) {\n\t var parent = path.dirname(p);\n\t var toCreate = [];\n\t var self = this;\n\t this._writable.stat(parent, false, statDone);\n\t function statDone(err, stat) {\n\t if (err) {\n\t toCreate.push(parent);\n\t parent = path.dirname(parent);\n\t self._writable.stat(parent, false, statDone);\n\t }\n\t else {\n\t createParents();\n\t }\n\t }\n\t function createParents() {\n\t if (!toCreate.length) {\n\t return cb();\n\t }\n\t var dir = toCreate.pop();\n\t self._readable.stat(dir, false, function (err, stats) {\n\t // stop if we couldn't read the dir\n\t if (!stats) {\n\t return cb();\n\t }\n\t self._writable.mkdir(dir, stats.mode, function (err) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t createParents();\n\t });\n\t });\n\t }\n\t };\n\t /**\n\t * With the given path, create the needed parent directories on the writable storage\n\t * should they not exist. Use modes from the read-only storage.\n\t */\n\t UnlockedOverlayFS.prototype.createParentDirectories = function createParentDirectories (p) {\n\t var this$1 = this;\n\t\n\t var parent = path.dirname(p), toCreate = [];\n\t while (!this._writable.existsSync(parent)) {\n\t toCreate.push(parent);\n\t parent = path.dirname(parent);\n\t }\n\t toCreate = toCreate.reverse();\n\t toCreate.forEach(function (p) {\n\t this$1._writable.mkdirSync(p, this$1.statSync(p, false).mode);\n\t });\n\t };\n\t /**\n\t * Helper function:\n\t * - Ensures p is on writable before proceeding. Throws an error if it doesn't exist.\n\t * - Calls f to perform operation on writable.\n\t */\n\t UnlockedOverlayFS.prototype.operateOnWritable = function operateOnWritable (p, f) {\n\t if (this.existsSync(p)) {\n\t if (!this._writable.existsSync(p)) {\n\t // File is on readable storage. Copy to writable storage before\n\t // changing its mode.\n\t this.copyToWritable(p);\n\t }\n\t f();\n\t }\n\t else {\n\t throw ApiError.ENOENT(p);\n\t }\n\t };\n\t UnlockedOverlayFS.prototype.operateOnWritableAsync = function operateOnWritableAsync (p, cb) {\n\t var this$1 = this;\n\t\n\t this.exists(p, function (exists) {\n\t if (!exists) {\n\t return cb(ApiError.ENOENT(p));\n\t }\n\t this$1._writable.exists(p, function (existsWritable) {\n\t if (existsWritable) {\n\t cb();\n\t }\n\t else {\n\t return this$1.copyToWritableAsync(p, cb);\n\t }\n\t });\n\t });\n\t };\n\t /**\n\t * Copy from readable to writable storage.\n\t * PRECONDITION: File does not exist on writable storage.\n\t */\n\t UnlockedOverlayFS.prototype.copyToWritable = function copyToWritable (p) {\n\t var pStats = this.statSync(p, false);\n\t if (pStats.isDirectory()) {\n\t this._writable.mkdirSync(p, pStats.mode);\n\t }\n\t else {\n\t this.writeFileSync(p, this._readable.readFileSync(p, null, getFlag('r')), null, getFlag('w'), this.statSync(p, false).mode);\n\t }\n\t };\n\t UnlockedOverlayFS.prototype.copyToWritableAsync = function copyToWritableAsync (p, cb) {\n\t var this$1 = this;\n\t\n\t this.stat(p, false, function (err, pStats) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t if (pStats.isDirectory()) {\n\t return this$1._writable.mkdir(p, pStats.mode, cb);\n\t }\n\t // need to copy file.\n\t this$1._readable.readFile(p, null, getFlag('r'), function (err, data) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t this$1.writeFile(p, data, null, getFlag('w'), pStats.mode, cb);\n\t });\n\t });\n\t };\n\t\n\t return UnlockedOverlayFS;\n\t}(BaseFileSystem));\n\t/**\n\t * OverlayFS makes a read-only filesystem writable by storing writes on a second,\n\t * writable file system. Deletes are persisted via metadata stored on the writable\n\t * file system.\n\t */\n\tvar OverlayFS = (function (LockedFS$$1) {\n\t function OverlayFS(writable, readable, deprecateMsg) {\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t LockedFS$$1.call(this, new UnlockedOverlayFS(writable, readable));\n\t deprecationMessage(deprecateMsg, OverlayFS.Name, { readable: \"readable file system\", writable: \"writable file system\" });\n\t }\n\t\n\t if ( LockedFS$$1 ) OverlayFS.__proto__ = LockedFS$$1;\n\t OverlayFS.prototype = Object.create( LockedFS$$1 && LockedFS$$1.prototype );\n\t OverlayFS.prototype.constructor = OverlayFS;\n\t /**\n\t * Constructs and initializes an OverlayFS instance with the given options.\n\t */\n\t OverlayFS.Create = function Create (opts, cb) {\n\t try {\n\t var fs = new OverlayFS(opts.writable, opts.readable, false);\n\t fs.initialize(function (e) {\n\t cb(e, fs);\n\t }, false);\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t OverlayFS.isAvailable = function isAvailable () {\n\t return UnlockedOverlayFS.isAvailable();\n\t };\n\t /**\n\t * **Deprecated. Please use OverlayFS.Create() to construct and initialize OverlayFS instances.**\n\t */\n\t OverlayFS.prototype.initialize = function initialize (cb, deprecateMsg) {\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t if (deprecateMsg) {\n\t console.warn(\"[OverlayFS] OverlayFS.initialize() is deprecated and will be removed in the next major release. Please use 'OverlayFS.Create({readable: readable file system instance, writable: writable file system instance}, cb)' to create and initialize OverlayFS instances.\");\n\t }\n\t LockedFS$$1.prototype.initialize.call(this, cb);\n\t };\n\t OverlayFS.prototype.getOverlayedFileSystems = function getOverlayedFileSystems () {\n\t return LockedFS$$1.prototype.getFSUnlocked.call(this).getOverlayedFileSystems();\n\t };\n\t OverlayFS.prototype.unwrap = function unwrap () {\n\t return LockedFS$$1.prototype.getFSUnlocked.call(this);\n\t };\n\t\n\t return OverlayFS;\n\t}(LockedFS));\n\t\n\tOverlayFS.Name = \"OverlayFS\";\n\tOverlayFS.Options = {\n\t writable: {\n\t type: \"object\",\n\t description: \"The file system to write modified files to.\"\n\t },\n\t readable: {\n\t type: \"object\",\n\t description: \"The file system that initially populates this file system.\"\n\t }\n\t};\n\t\n\t/**\n\t * @hidden\n\t */\n\tvar SpecialArgType;\n\t(function (SpecialArgType) {\n\t // Callback\n\t SpecialArgType[SpecialArgType[\"CB\"] = 0] = \"CB\";\n\t // File descriptor\n\t SpecialArgType[SpecialArgType[\"FD\"] = 1] = \"FD\";\n\t // API error\n\t SpecialArgType[SpecialArgType[\"API_ERROR\"] = 2] = \"API_ERROR\";\n\t // Stats object\n\t SpecialArgType[SpecialArgType[\"STATS\"] = 3] = \"STATS\";\n\t // Initial probe for file system information.\n\t SpecialArgType[SpecialArgType[\"PROBE\"] = 4] = \"PROBE\";\n\t // FileFlag object.\n\t SpecialArgType[SpecialArgType[\"FILEFLAG\"] = 5] = \"FILEFLAG\";\n\t // Buffer object.\n\t SpecialArgType[SpecialArgType[\"BUFFER\"] = 6] = \"BUFFER\";\n\t // Generic Error object.\n\t SpecialArgType[SpecialArgType[\"ERROR\"] = 7] = \"ERROR\";\n\t})(SpecialArgType || (SpecialArgType = {}));\n\t/**\n\t * Converts callback arguments into ICallbackArgument objects, and back\n\t * again.\n\t * @hidden\n\t */\n\tvar CallbackArgumentConverter = function CallbackArgumentConverter() {\n\t this._callbacks = {};\n\t this._nextId = 0;\n\t};\n\tCallbackArgumentConverter.prototype.toRemoteArg = function toRemoteArg (cb) {\n\t var id = this._nextId++;\n\t this._callbacks[id] = cb;\n\t return {\n\t type: SpecialArgType.CB,\n\t id: id\n\t };\n\t};\n\tCallbackArgumentConverter.prototype.toLocalArg = function toLocalArg (id) {\n\t var cb = this._callbacks[id];\n\t delete this._callbacks[id];\n\t return cb;\n\t};\n\t/**\n\t * @hidden\n\t */\n\tvar FileDescriptorArgumentConverter = function FileDescriptorArgumentConverter() {\n\t this._fileDescriptors = {};\n\t this._nextId = 0;\n\t};\n\tFileDescriptorArgumentConverter.prototype.toRemoteArg = function toRemoteArg (fd, p, flag, cb) {\n\t var id = this._nextId++;\n\t var data;\n\t var stat;\n\t this._fileDescriptors[id] = fd;\n\t // Extract needed information asynchronously.\n\t fd.stat(function (err, stats) {\n\t if (err) {\n\t cb(err);\n\t }\n\t else {\n\t stat = bufferToTransferrableObject(stats.toBuffer());\n\t // If it's a readable flag, we need to grab contents.\n\t if (flag.isReadable()) {\n\t fd.read(Buffer.alloc(stats.size), 0, stats.size, 0, function (err, bytesRead, buff) {\n\t if (err) {\n\t cb(err);\n\t }\n\t else {\n\t data = bufferToTransferrableObject(buff);\n\t cb(null, {\n\t type: SpecialArgType.FD,\n\t id: id,\n\t data: data,\n\t stat: stat,\n\t path: p,\n\t flag: flag.getFlagString()\n\t });\n\t }\n\t });\n\t }\n\t else {\n\t // File is not readable, which means writing to it will append or\n\t // truncate/replace existing contents. Return an empty arraybuffer.\n\t cb(null, {\n\t type: SpecialArgType.FD,\n\t id: id,\n\t data: new ArrayBuffer(0),\n\t stat: stat,\n\t path: p,\n\t flag: flag.getFlagString()\n\t });\n\t }\n\t }\n\t });\n\t};\n\tFileDescriptorArgumentConverter.prototype.applyFdAPIRequest = function applyFdAPIRequest (request, cb) {\n\t var this$1 = this;\n\t\n\t var fdArg = request.args[0];\n\t this._applyFdChanges(fdArg, function (err, fd) {\n\t if (err) {\n\t cb(err);\n\t }\n\t else {\n\t // Apply method on now-changed file descriptor.\n\t fd[request.method](function (e) {\n\t if (request.method === 'close') {\n\t delete this$1._fileDescriptors[fdArg.id];\n\t }\n\t cb(e);\n\t });\n\t }\n\t });\n\t};\n\tFileDescriptorArgumentConverter.prototype._applyFdChanges = function _applyFdChanges (remoteFd, cb) {\n\t var fd = this._fileDescriptors[remoteFd.id], data = transferrableObjectToBuffer(remoteFd.data), remoteStats = Stats.fromBuffer(transferrableObjectToBuffer(remoteFd.stat));\n\t // Write data if the file is writable.\n\t var flag = FileFlag.getFileFlag(remoteFd.flag);\n\t if (flag.isWriteable()) {\n\t // Appendable: Write to end of file.\n\t // Writeable: Replace entire contents of file.\n\t fd.write(data, 0, data.length, flag.isAppendable() ? fd.getPos() : 0, function (e) {\n\t function applyStatChanges() {\n\t // Check if mode changed.\n\t fd.stat(function (e, stats) {\n\t if (e) {\n\t cb(e);\n\t }\n\t else {\n\t if (stats.mode !== remoteStats.mode) {\n\t fd.chmod(remoteStats.mode, function (e) {\n\t cb(e, fd);\n\t });\n\t }\n\t else {\n\t cb(e, fd);\n\t }\n\t }\n\t });\n\t }\n\t if (e) {\n\t cb(e);\n\t }\n\t else {\n\t // If writeable & not appendable, we need to ensure file contents are\n\t // identical to those from the remote FD. Thus, we truncate to the\n\t // length of the remote file.\n\t if (!flag.isAppendable()) {\n\t fd.truncate(data.length, function () {\n\t applyStatChanges();\n\t });\n\t }\n\t else {\n\t applyStatChanges();\n\t }\n\t }\n\t });\n\t }\n\t else {\n\t cb(null, fd);\n\t }\n\t};\n\t/**\n\t * @hidden\n\t */\n\tfunction apiErrorLocal2Remote(e) {\n\t return {\n\t type: SpecialArgType.API_ERROR,\n\t errorData: bufferToTransferrableObject(e.writeToBuffer())\n\t };\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction apiErrorRemote2Local(e) {\n\t return ApiError.fromBuffer(transferrableObjectToBuffer(e.errorData));\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction errorLocal2Remote(e) {\n\t return {\n\t type: SpecialArgType.ERROR,\n\t name: e.name,\n\t message: e.message,\n\t stack: e.stack\n\t };\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction errorRemote2Local(e) {\n\t var cnstr = global$1[e.name];\n\t if (typeof (cnstr) !== 'function') {\n\t cnstr = Error;\n\t }\n\t var err = new cnstr(e.message);\n\t err.stack = e.stack;\n\t return err;\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction statsLocal2Remote(stats) {\n\t return {\n\t type: SpecialArgType.STATS,\n\t statsData: bufferToTransferrableObject(stats.toBuffer())\n\t };\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction statsRemote2Local(stats) {\n\t return Stats.fromBuffer(transferrableObjectToBuffer(stats.statsData));\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction fileFlagLocal2Remote(flag) {\n\t return {\n\t type: SpecialArgType.FILEFLAG,\n\t flagStr: flag.getFlagString()\n\t };\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction fileFlagRemote2Local(remoteFlag) {\n\t return FileFlag.getFileFlag(remoteFlag.flagStr);\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction bufferToTransferrableObject(buff) {\n\t return buffer2ArrayBuffer(buff);\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction transferrableObjectToBuffer(buff) {\n\t return arrayBuffer2Buffer(buff);\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction bufferLocal2Remote(buff) {\n\t return {\n\t type: SpecialArgType.BUFFER,\n\t data: bufferToTransferrableObject(buff)\n\t };\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction bufferRemote2Local(buffArg) {\n\t return transferrableObjectToBuffer(buffArg.data);\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction isAPIRequest(data) {\n\t return data && typeof data === 'object' && data.hasOwnProperty('browserfsMessage') && data['browserfsMessage'];\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction isAPIResponse(data) {\n\t return data && typeof data === 'object' && data.hasOwnProperty('browserfsMessage') && data['browserfsMessage'];\n\t}\n\t/**\n\t * Represents a remote file in a different worker/thread.\n\t */\n\tvar WorkerFile = (function (PreloadFile$$1) {\n\t function WorkerFile(_fs, _path, _flag, _stat, remoteFdId, contents) {\n\t PreloadFile$$1.call(this, _fs, _path, _flag, _stat, contents);\n\t this._remoteFdId = remoteFdId;\n\t }\n\t\n\t if ( PreloadFile$$1 ) WorkerFile.__proto__ = PreloadFile$$1;\n\t WorkerFile.prototype = Object.create( PreloadFile$$1 && PreloadFile$$1.prototype );\n\t WorkerFile.prototype.constructor = WorkerFile;\n\t WorkerFile.prototype.getRemoteFdId = function getRemoteFdId () {\n\t return this._remoteFdId;\n\t };\n\t /**\n\t * @hidden\n\t */\n\t WorkerFile.prototype.toRemoteArg = function toRemoteArg () {\n\t return {\n\t type: SpecialArgType.FD,\n\t id: this._remoteFdId,\n\t data: bufferToTransferrableObject(this.getBuffer()),\n\t stat: bufferToTransferrableObject(this.getStats().toBuffer()),\n\t path: this.getPath(),\n\t flag: this.getFlag().getFlagString()\n\t };\n\t };\n\t WorkerFile.prototype.sync = function sync (cb) {\n\t this._syncClose('sync', cb);\n\t };\n\t WorkerFile.prototype.close = function close (cb) {\n\t this._syncClose('close', cb);\n\t };\n\t WorkerFile.prototype._syncClose = function _syncClose (type, cb) {\n\t var this$1 = this;\n\t\n\t if (this.isDirty()) {\n\t this._fs.syncClose(type, this, function (e) {\n\t if (!e) {\n\t this$1.resetDirty();\n\t }\n\t cb(e);\n\t });\n\t }\n\t else {\n\t cb();\n\t }\n\t };\n\t\n\t return WorkerFile;\n\t}(PreloadFile));\n\t/**\n\t * WorkerFS lets you access a BrowserFS instance that is running in a different\n\t * JavaScript context (e.g. access BrowserFS in one of your WebWorkers, or\n\t * access BrowserFS running on the main page from a WebWorker).\n\t *\n\t * For example, to have a WebWorker access files in the main browser thread,\n\t * do the following:\n\t *\n\t * MAIN BROWSER THREAD:\n\t *\n\t * ```javascript\n\t * // Listen for remote file system requests.\n\t * BrowserFS.FileSystem.WorkerFS.attachRemoteListener(webWorkerObject);\n\t * ```\n\t *\n\t * WEBWORKER THREAD:\n\t *\n\t * ```javascript\n\t * // Set the remote file system as the root file system.\n\t * BrowserFS.configure({ fs: \"WorkerFS\", options: { worker: self }}, function(e) {\n\t * // Ready!\n\t * });\n\t * ```\n\t *\n\t * Note that synchronous operations are not permitted on the WorkerFS, regardless\n\t * of the configuration option of the remote FS.\n\t */\n\tvar WorkerFS = (function (BaseFileSystem$$1) {\n\t function WorkerFS(worker, deprecateMsg) {\n\t var this$1 = this;\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t BaseFileSystem$$1.call(this);\n\t this._callbackConverter = new CallbackArgumentConverter();\n\t this._isInitialized = false;\n\t this._isReadOnly = false;\n\t this._supportLinks = false;\n\t this._supportProps = false;\n\t this._worker = worker;\n\t deprecationMessage(deprecateMsg, WorkerFS.Name, { worker: \"Web Worker instance\" });\n\t this._worker.addEventListener('message', function (e) {\n\t var resp = e.data;\n\t if (isAPIResponse(resp)) {\n\t var i;\n\t var args = resp.args;\n\t var fixedArgs = new Array(args.length);\n\t // Dispatch event to correct id.\n\t for (i = 0; i < fixedArgs.length; i++) {\n\t fixedArgs[i] = this$1._argRemote2Local(args[i]);\n\t }\n\t this$1._callbackConverter.toLocalArg(resp.cbId).apply(null, fixedArgs);\n\t }\n\t });\n\t }\n\t\n\t if ( BaseFileSystem$$1 ) WorkerFS.__proto__ = BaseFileSystem$$1;\n\t WorkerFS.prototype = Object.create( BaseFileSystem$$1 && BaseFileSystem$$1.prototype );\n\t WorkerFS.prototype.constructor = WorkerFS;\n\t WorkerFS.Create = function Create (opts, cb) {\n\t var fs = new WorkerFS(opts.worker, false);\n\t fs.initialize(function () {\n\t cb(null, fs);\n\t });\n\t };\n\t WorkerFS.isAvailable = function isAvailable () {\n\t return typeof (importScripts) !== 'undefined' || typeof (Worker) !== 'undefined';\n\t };\n\t /**\n\t * Attaches a listener to the remote worker for file system requests.\n\t */\n\t WorkerFS.attachRemoteListener = function attachRemoteListener (worker) {\n\t var fdConverter = new FileDescriptorArgumentConverter();\n\t function argLocal2Remote(arg, requestArgs, cb) {\n\t switch (typeof arg) {\n\t case 'object':\n\t if (arg instanceof Stats) {\n\t cb(null, statsLocal2Remote(arg));\n\t }\n\t else if (arg instanceof ApiError) {\n\t cb(null, apiErrorLocal2Remote(arg));\n\t }\n\t else if (arg instanceof BaseFile) {\n\t // Pass in p and flags from original request.\n\t cb(null, fdConverter.toRemoteArg(arg, requestArgs[0], requestArgs[1], cb));\n\t }\n\t else if (arg instanceof FileFlag) {\n\t cb(null, fileFlagLocal2Remote(arg));\n\t }\n\t else if (arg instanceof Buffer) {\n\t cb(null, bufferLocal2Remote(arg));\n\t }\n\t else if (arg instanceof Error) {\n\t cb(null, errorLocal2Remote(arg));\n\t }\n\t else {\n\t cb(null, arg);\n\t }\n\t break;\n\t default:\n\t cb(null, arg);\n\t break;\n\t }\n\t }\n\t function argRemote2Local(arg, fixedRequestArgs) {\n\t if (!arg) {\n\t return arg;\n\t }\n\t switch (typeof arg) {\n\t case 'object':\n\t if (typeof arg['type'] === 'number') {\n\t var specialArg = arg;\n\t switch (specialArg.type) {\n\t case SpecialArgType.CB:\n\t var cbId = arg.id;\n\t return function () {\n\t var arguments$1 = arguments;\n\t\n\t var i;\n\t var fixedArgs = new Array(arguments.length);\n\t var message, countdown = arguments.length;\n\t function abortAndSendError(err) {\n\t if (countdown > 0) {\n\t countdown = -1;\n\t message = {\n\t browserfsMessage: true,\n\t cbId: cbId,\n\t args: [apiErrorLocal2Remote(err)]\n\t };\n\t worker.postMessage(message);\n\t }\n\t }\n\t for (i = 0; i < arguments.length; i++) {\n\t // Capture i and argument.\n\t (function (i, arg) {\n\t argLocal2Remote(arg, fixedRequestArgs, function (err, fixedArg) {\n\t fixedArgs[i] = fixedArg;\n\t if (err) {\n\t abortAndSendError(err);\n\t }\n\t else if (--countdown === 0) {\n\t message = {\n\t browserfsMessage: true,\n\t cbId: cbId,\n\t args: fixedArgs\n\t };\n\t worker.postMessage(message);\n\t }\n\t });\n\t })(i, arguments$1[i]);\n\t }\n\t if (arguments.length === 0) {\n\t message = {\n\t browserfsMessage: true,\n\t cbId: cbId,\n\t args: fixedArgs\n\t };\n\t worker.postMessage(message);\n\t }\n\t };\n\t case SpecialArgType.API_ERROR:\n\t return apiErrorRemote2Local(specialArg);\n\t case SpecialArgType.STATS:\n\t return statsRemote2Local(specialArg);\n\t case SpecialArgType.FILEFLAG:\n\t return fileFlagRemote2Local(specialArg);\n\t case SpecialArgType.BUFFER:\n\t return bufferRemote2Local(specialArg);\n\t case SpecialArgType.ERROR:\n\t return errorRemote2Local(specialArg);\n\t default:\n\t // No idea what this is.\n\t return arg;\n\t }\n\t }\n\t else {\n\t return arg;\n\t }\n\t default:\n\t return arg;\n\t }\n\t }\n\t worker.addEventListener('message', function (e) {\n\t var request = e.data;\n\t if (isAPIRequest(request)) {\n\t var args = request.args, fixedArgs = new Array(args.length);\n\t switch (request.method) {\n\t case 'close':\n\t case 'sync':\n\t (function () {\n\t // File descriptor-relative methods.\n\t var remoteCb = args[1];\n\t fdConverter.applyFdAPIRequest(request, function (err) {\n\t // Send response.\n\t var response = {\n\t browserfsMessage: true,\n\t cbId: remoteCb.id,\n\t args: err ? [apiErrorLocal2Remote(err)] : []\n\t };\n\t worker.postMessage(response);\n\t });\n\t })();\n\t break;\n\t case 'probe':\n\t (function () {\n\t var rootFs = _fsMock.getRootFS(), remoteCb = args[1], probeResponse = {\n\t type: SpecialArgType.PROBE,\n\t isReadOnly: rootFs.isReadOnly(),\n\t supportsLinks: rootFs.supportsLinks(),\n\t supportsProps: rootFs.supportsProps()\n\t }, response = {\n\t browserfsMessage: true,\n\t cbId: remoteCb.id,\n\t args: [probeResponse]\n\t };\n\t worker.postMessage(response);\n\t })();\n\t break;\n\t default:\n\t // File system methods.\n\t for (var i = 0; i < args.length; i++) {\n\t fixedArgs[i] = argRemote2Local(args[i], fixedArgs);\n\t }\n\t var rootFS = _fsMock.getRootFS();\n\t rootFS[request.method].apply(rootFS, fixedArgs);\n\t break;\n\t }\n\t }\n\t });\n\t };\n\t WorkerFS.prototype.getName = function getName () {\n\t return WorkerFS.Name;\n\t };\n\t /**\n\t * **Deprecated. Please use WorkerFS.Create() method to construct and initialize WorkerFS instances.**\n\t *\n\t * Called once both local and remote sides are set up.\n\t */\n\t WorkerFS.prototype.initialize = function initialize (cb) {\n\t var this$1 = this;\n\t\n\t if (!this._isInitialized) {\n\t var message = {\n\t browserfsMessage: true,\n\t method: 'probe',\n\t args: [this._argLocal2Remote(emptyBuffer()), this._callbackConverter.toRemoteArg(function (probeResponse) {\n\t this$1._isInitialized = true;\n\t this$1._isReadOnly = probeResponse.isReadOnly;\n\t this$1._supportLinks = probeResponse.supportsLinks;\n\t this$1._supportProps = probeResponse.supportsProps;\n\t cb();\n\t })]\n\t };\n\t this._worker.postMessage(message);\n\t }\n\t else {\n\t cb();\n\t }\n\t };\n\t WorkerFS.prototype.isReadOnly = function isReadOnly () { return this._isReadOnly; };\n\t WorkerFS.prototype.supportsSynch = function supportsSynch () { return false; };\n\t WorkerFS.prototype.supportsLinks = function supportsLinks () { return this._supportLinks; };\n\t WorkerFS.prototype.supportsProps = function supportsProps () { return this._supportProps; };\n\t WorkerFS.prototype.rename = function rename (oldPath, newPath, cb) {\n\t this._rpc('rename', arguments);\n\t };\n\t WorkerFS.prototype.stat = function stat (p, isLstat, cb) {\n\t this._rpc('stat', arguments);\n\t };\n\t WorkerFS.prototype.open = function open (p, flag, mode, cb) {\n\t this._rpc('open', arguments);\n\t };\n\t WorkerFS.prototype.unlink = function unlink (p, cb) {\n\t this._rpc('unlink', arguments);\n\t };\n\t WorkerFS.prototype.rmdir = function rmdir (p, cb) {\n\t this._rpc('rmdir', arguments);\n\t };\n\t WorkerFS.prototype.mkdir = function mkdir (p, mode, cb) {\n\t this._rpc('mkdir', arguments);\n\t };\n\t WorkerFS.prototype.readdir = function readdir (p, cb) {\n\t this._rpc('readdir', arguments);\n\t };\n\t WorkerFS.prototype.exists = function exists (p, cb) {\n\t this._rpc('exists', arguments);\n\t };\n\t WorkerFS.prototype.realpath = function realpath (p, cache, cb) {\n\t this._rpc('realpath', arguments);\n\t };\n\t WorkerFS.prototype.truncate = function truncate (p, len, cb) {\n\t this._rpc('truncate', arguments);\n\t };\n\t WorkerFS.prototype.readFile = function readFile (fname, encoding, flag, cb) {\n\t this._rpc('readFile', arguments);\n\t };\n\t WorkerFS.prototype.writeFile = function writeFile (fname, data, encoding, flag, mode, cb) {\n\t this._rpc('writeFile', arguments);\n\t };\n\t WorkerFS.prototype.appendFile = function appendFile (fname, data, encoding, flag, mode, cb) {\n\t this._rpc('appendFile', arguments);\n\t };\n\t WorkerFS.prototype.chmod = function chmod (p, isLchmod, mode, cb) {\n\t this._rpc('chmod', arguments);\n\t };\n\t WorkerFS.prototype.chown = function chown (p, isLchown, uid, gid, cb) {\n\t this._rpc('chown', arguments);\n\t };\n\t WorkerFS.prototype.utimes = function utimes (p, atime, mtime, cb) {\n\t this._rpc('utimes', arguments);\n\t };\n\t WorkerFS.prototype.link = function link (srcpath, dstpath, cb) {\n\t this._rpc('link', arguments);\n\t };\n\t WorkerFS.prototype.symlink = function symlink (srcpath, dstpath, type, cb) {\n\t this._rpc('symlink', arguments);\n\t };\n\t WorkerFS.prototype.readlink = function readlink (p, cb) {\n\t this._rpc('readlink', arguments);\n\t };\n\t WorkerFS.prototype.syncClose = function syncClose (method, fd, cb) {\n\t this._worker.postMessage({\n\t browserfsMessage: true,\n\t method: method,\n\t args: [fd.toRemoteArg(), this._callbackConverter.toRemoteArg(cb)]\n\t });\n\t };\n\t WorkerFS.prototype._argRemote2Local = function _argRemote2Local (arg) {\n\t if (!arg) {\n\t return arg;\n\t }\n\t switch (typeof arg) {\n\t case 'object':\n\t if (typeof arg['type'] === 'number') {\n\t var specialArg = arg;\n\t switch (specialArg.type) {\n\t case SpecialArgType.API_ERROR:\n\t return apiErrorRemote2Local(specialArg);\n\t case SpecialArgType.FD:\n\t var fdArg = specialArg;\n\t return new WorkerFile(this, fdArg.path, FileFlag.getFileFlag(fdArg.flag), Stats.fromBuffer(transferrableObjectToBuffer(fdArg.stat)), fdArg.id, transferrableObjectToBuffer(fdArg.data));\n\t case SpecialArgType.STATS:\n\t return statsRemote2Local(specialArg);\n\t case SpecialArgType.FILEFLAG:\n\t return fileFlagRemote2Local(specialArg);\n\t case SpecialArgType.BUFFER:\n\t return bufferRemote2Local(specialArg);\n\t case SpecialArgType.ERROR:\n\t return errorRemote2Local(specialArg);\n\t default:\n\t return arg;\n\t }\n\t }\n\t else {\n\t return arg;\n\t }\n\t default:\n\t return arg;\n\t }\n\t };\n\t WorkerFS.prototype._rpc = function _rpc (methodName, args) {\n\t var this$1 = this;\n\t\n\t var fixedArgs = new Array(args.length);\n\t for (var i = 0; i < args.length; i++) {\n\t fixedArgs[i] = this$1._argLocal2Remote(args[i]);\n\t }\n\t var message = {\n\t browserfsMessage: true,\n\t method: methodName,\n\t args: fixedArgs\n\t };\n\t this._worker.postMessage(message);\n\t };\n\t /**\n\t * Converts a local argument into a remote argument. Public so WorkerFile objects can call it.\n\t */\n\t WorkerFS.prototype._argLocal2Remote = function _argLocal2Remote (arg) {\n\t if (!arg) {\n\t return arg;\n\t }\n\t switch (typeof arg) {\n\t case \"object\":\n\t if (arg instanceof Stats) {\n\t return statsLocal2Remote(arg);\n\t }\n\t else if (arg instanceof ApiError) {\n\t return apiErrorLocal2Remote(arg);\n\t }\n\t else if (arg instanceof WorkerFile) {\n\t return arg.toRemoteArg();\n\t }\n\t else if (arg instanceof FileFlag) {\n\t return fileFlagLocal2Remote(arg);\n\t }\n\t else if (arg instanceof Buffer) {\n\t return bufferLocal2Remote(arg);\n\t }\n\t else if (arg instanceof Error) {\n\t return errorLocal2Remote(arg);\n\t }\n\t else {\n\t return \"Unknown argument\";\n\t }\n\t case \"function\":\n\t return this._callbackConverter.toRemoteArg(arg);\n\t default:\n\t return arg;\n\t }\n\t };\n\t\n\t return WorkerFS;\n\t}(BaseFileSystem));\n\t\n\tWorkerFS.Name = \"WorkerFS\";\n\tWorkerFS.Options = {\n\t worker: {\n\t type: \"object\",\n\t description: \"The target worker that you want to connect to, or the current worker if in a worker context.\",\n\t validator: function (v, cb) {\n\t // Check for a `postMessage` function.\n\t if (v['postMessage']) {\n\t cb();\n\t }\n\t else {\n\t cb(new ApiError(ErrorCode.EINVAL, \"option must be a Web Worker instance.\"));\n\t }\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Contains utility methods for performing a variety of tasks with\n\t * XmlHttpRequest across browsers.\n\t */\n\tfunction asyncDownloadFileModern(p, type, cb) {\n\t var req = new XMLHttpRequest();\n\t req.open('GET', p, true);\n\t var jsonSupported = true;\n\t switch (type) {\n\t case 'buffer':\n\t req.responseType = 'arraybuffer';\n\t break;\n\t case 'json':\n\t // Some browsers don't support the JSON response type.\n\t // They either reset responseType, or throw an exception.\n\t // @see https://github.com/Modernizr/Modernizr/blob/master/src/testXhrType.js\n\t try {\n\t req.responseType = 'json';\n\t jsonSupported = req.responseType === 'json';\n\t }\n\t catch (e) {\n\t jsonSupported = false;\n\t }\n\t break;\n\t default:\n\t return cb(new ApiError(ErrorCode.EINVAL, \"Invalid download type: \" + type));\n\t }\n\t req.onreadystatechange = function (e) {\n\t if (req.readyState === 4) {\n\t if (req.status === 200) {\n\t switch (type) {\n\t case 'buffer':\n\t // XXX: WebKit-based browsers return *null* when XHRing an empty file.\n\t return cb(null, req.response ? Buffer.from(req.response) : emptyBuffer());\n\t case 'json':\n\t if (jsonSupported) {\n\t return cb(null, req.response);\n\t }\n\t else {\n\t return cb(null, JSON.parse(req.responseText));\n\t }\n\t }\n\t }\n\t else {\n\t return cb(new ApiError(req.status, \"XHR error.\"));\n\t }\n\t }\n\t };\n\t req.send();\n\t}\n\tfunction syncDownloadFileModern(p, type) {\n\t var req = new XMLHttpRequest();\n\t req.open('GET', p, false);\n\t // On most platforms, we cannot set the responseType of synchronous downloads.\n\t // @todo Test for this; IE10 allows this, as do older versions of Chrome/FF.\n\t var data = null;\n\t var err = null;\n\t // Classic hack to download binary data as a string.\n\t req.overrideMimeType('text/plain; charset=x-user-defined');\n\t req.onreadystatechange = function (e) {\n\t if (req.readyState === 4) {\n\t if (req.status === 200) {\n\t switch (type) {\n\t case 'buffer':\n\t // Convert the text into a buffer.\n\t var text = req.responseText;\n\t data = Buffer.alloc(text.length);\n\t // Throw away the upper bits of each character.\n\t for (var i = 0; i < text.length; i++) {\n\t // This will automatically throw away the upper bit of each\n\t // character for us.\n\t data[i] = text.charCodeAt(i);\n\t }\n\t return;\n\t case 'json':\n\t data = JSON.parse(req.responseText);\n\t return;\n\t }\n\t }\n\t else {\n\t err = new ApiError(req.status, \"XHR error.\");\n\t return;\n\t }\n\t }\n\t };\n\t req.send();\n\t if (err) {\n\t throw err;\n\t }\n\t return data;\n\t}\n\tfunction syncDownloadFileIE10(p, type) {\n\t var req = new XMLHttpRequest();\n\t req.open('GET', p, false);\n\t switch (type) {\n\t case 'buffer':\n\t req.responseType = 'arraybuffer';\n\t break;\n\t case 'json':\n\t // IE10 does not support the JSON type.\n\t break;\n\t default:\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid download type: \" + type);\n\t }\n\t var data;\n\t var err;\n\t req.onreadystatechange = function (e) {\n\t if (req.readyState === 4) {\n\t if (req.status === 200) {\n\t switch (type) {\n\t case 'buffer':\n\t data = Buffer.from(req.response);\n\t break;\n\t case 'json':\n\t data = JSON.parse(req.response);\n\t break;\n\t }\n\t }\n\t else {\n\t err = new ApiError(req.status, \"XHR error.\");\n\t }\n\t }\n\t };\n\t req.send();\n\t if (err) {\n\t throw err;\n\t }\n\t return data;\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction getFileSize(async, p, cb) {\n\t var req = new XMLHttpRequest();\n\t req.open('HEAD', p, async);\n\t req.onreadystatechange = function (e) {\n\t if (req.readyState === 4) {\n\t if (req.status === 200) {\n\t try {\n\t return cb(null, parseInt(req.getResponseHeader('Content-Length') || '-1', 10));\n\t }\n\t catch (e) {\n\t // In the event that the header isn't present or there is an error...\n\t return cb(new ApiError(ErrorCode.EIO, \"XHR HEAD error: Could not read content-length.\"));\n\t }\n\t }\n\t else {\n\t return cb(new ApiError(req.status, \"XHR HEAD error.\"));\n\t }\n\t }\n\t };\n\t req.send();\n\t}\n\t/**\n\t * Asynchronously download a file as a buffer or a JSON object.\n\t * Note that the third function signature with a non-specialized type is\n\t * invalid, but TypeScript requires it when you specialize string arguments to\n\t * constants.\n\t * @hidden\n\t */\n\tvar asyncDownloadFile = asyncDownloadFileModern;\n\t/**\n\t * Synchronously download a file as a buffer or a JSON object.\n\t * Note that the third function signature with a non-specialized type is\n\t * invalid, but TypeScript requires it when you specialize string arguments to\n\t * constants.\n\t * @hidden\n\t */\n\tvar syncDownloadFile = (isIE && typeof Blob !== 'undefined') ? syncDownloadFileIE10 : syncDownloadFileModern;\n\t/**\n\t * Synchronously retrieves the size of the given file in bytes.\n\t * @hidden\n\t */\n\tfunction getFileSizeSync(p) {\n\t var rv = -1;\n\t getFileSize(false, p, function (err, size) {\n\t if (err) {\n\t throw err;\n\t }\n\t rv = size;\n\t });\n\t return rv;\n\t}\n\t/**\n\t * Asynchronously retrieves the size of the given file in bytes.\n\t * @hidden\n\t */\n\tfunction getFileSizeAsync(p, cb) {\n\t getFileSize(true, p, cb);\n\t}\n\t\n\t/**\n\t * A simple class for storing a filesystem index. Assumes that all paths passed\n\t * to it are *absolute* paths.\n\t *\n\t * Can be used as a partial or a full index, although care must be taken if used\n\t * for the former purpose, especially when directories are concerned.\n\t */\n\tvar FileIndex = function FileIndex() {\n\t // _index is a single-level key,value store that maps *directory* paths to\n\t // DirInodes. File information is only contained in DirInodes themselves.\n\t this._index = {};\n\t // Create the root directory.\n\t this.addPath('/', new DirInode());\n\t};\n\t/**\n\t * Static method for constructing indices from a JSON listing.\n\t * @param listing Directory listing generated by tools/XHRIndexer.coffee\n\t * @return A new FileIndex object.\n\t */\n\tFileIndex.fromListing = function fromListing (listing) {\n\t var idx = new FileIndex();\n\t // Add a root DirNode.\n\t var rootInode = new DirInode();\n\t idx._index['/'] = rootInode;\n\t var queue = [['', listing, rootInode]];\n\t while (queue.length > 0) {\n\t var inode = (void 0);\n\t var next = queue.pop();\n\t var pwd = next[0];\n\t var tree = next[1];\n\t var parent = next[2];\n\t for (var node in tree) {\n\t if (tree.hasOwnProperty(node)) {\n\t var children = tree[node];\n\t var name = pwd + \"/\" + node;\n\t if (children) {\n\t idx._index[name] = inode = new DirInode();\n\t queue.push([name, children, inode]);\n\t }\n\t else {\n\t // This inode doesn't have correct size information, noted with -1.\n\t inode = new FileInode(new Stats(FileType.FILE, -1, 0x16D));\n\t }\n\t if (parent) {\n\t parent._ls[node] = inode;\n\t }\n\t }\n\t }\n\t }\n\t return idx;\n\t};\n\t/**\n\t * Runs the given function over all files in the index.\n\t */\n\tFileIndex.prototype.fileIterator = function fileIterator (cb) {\n\t var this$1 = this;\n\t\n\t for (var path$$1 in this$1._index) {\n\t if (this$1._index.hasOwnProperty(path$$1)) {\n\t var dir = this$1._index[path$$1];\n\t var files = dir.getListing();\n\t for (var i = 0, list = files; i < list.length; i += 1) {\n\t var file = list[i];\n\t\n\t var item = dir.getItem(file);\n\t if (isFileInode(item)) {\n\t cb(item.getData());\n\t }\n\t }\n\t }\n\t }\n\t};\n\t/**\n\t * Adds the given absolute path to the index if it is not already in the index.\n\t * Creates any needed parent directories.\n\t * @param path The path to add to the index.\n\t * @param inode The inode for the\n\t * path to add.\n\t * @return 'True' if it was added or already exists, 'false' if there\n\t * was an issue adding it (e.g. item in path is a file, item exists but is\n\t * different).\n\t * @todo If adding fails and implicitly creates directories, we do not clean up\n\t * the new empty directories.\n\t */\n\tFileIndex.prototype.addPath = function addPath (path$$1, inode) {\n\t if (!inode) {\n\t throw new Error('Inode must be specified');\n\t }\n\t if (path$$1[0] !== '/') {\n\t throw new Error('Path must be absolute, got: ' + path$$1);\n\t }\n\t // Check if it already exists.\n\t if (this._index.hasOwnProperty(path$$1)) {\n\t return this._index[path$$1] === inode;\n\t }\n\t var splitPath = this._split_path(path$$1);\n\t var dirpath = splitPath[0];\n\t var itemname = splitPath[1];\n\t // Try to add to its parent directory first.\n\t var parent = this._index[dirpath];\n\t if (parent === undefined && path$$1 !== '/') {\n\t // Create parent.\n\t parent = new DirInode();\n\t if (!this.addPath(dirpath, parent)) {\n\t return false;\n\t }\n\t }\n\t // Add myself to my parent.\n\t if (path$$1 !== '/') {\n\t if (!parent.addItem(itemname, inode)) {\n\t return false;\n\t }\n\t }\n\t // If I'm a directory, add myself to the index.\n\t if (isDirInode(inode)) {\n\t this._index[path$$1] = inode;\n\t }\n\t return true;\n\t};\n\t/**\n\t * Adds the given absolute path to the index if it is not already in the index.\n\t * The path is added without special treatment (no joining of adjacent separators, etc).\n\t * Creates any needed parent directories.\n\t * @param path The path to add to the index.\n\t * @param inode The inode for the\n\t * path to add.\n\t * @return 'True' if it was added or already exists, 'false' if there\n\t * was an issue adding it (e.g. item in path is a file, item exists but is\n\t * different).\n\t * @todo If adding fails and implicitly creates directories, we do not clean up\n\t * the new empty directories.\n\t */\n\tFileIndex.prototype.addPathFast = function addPathFast (path$$1, inode) {\n\t var itemNameMark = path$$1.lastIndexOf('/');\n\t var parentPath = itemNameMark === 0 ? \"/\" : path$$1.substring(0, itemNameMark);\n\t var itemName = path$$1.substring(itemNameMark + 1);\n\t // Try to add to its parent directory first.\n\t var parent = this._index[parentPath];\n\t if (parent === undefined) {\n\t // Create parent.\n\t parent = new DirInode();\n\t this.addPathFast(parentPath, parent);\n\t }\n\t if (!parent.addItem(itemName, inode)) {\n\t return false;\n\t }\n\t // If adding a directory, add to the index as well.\n\t if (inode.isDir()) {\n\t this._index[path$$1] = inode;\n\t }\n\t return true;\n\t};\n\t/**\n\t * Removes the given path. Can be a file or a directory.\n\t * @return The removed item,\n\t * or null if it did not exist.\n\t */\n\tFileIndex.prototype.removePath = function removePath (path$$1) {\n\t var this$1 = this;\n\t\n\t var splitPath = this._split_path(path$$1);\n\t var dirpath = splitPath[0];\n\t var itemname = splitPath[1];\n\t // Try to remove it from its parent directory first.\n\t var parent = this._index[dirpath];\n\t if (parent === undefined) {\n\t return null;\n\t }\n\t // Remove myself from my parent.\n\t var inode = parent.remItem(itemname);\n\t if (inode === null) {\n\t return null;\n\t }\n\t // If I'm a directory, remove myself from the index, and remove my children.\n\t if (isDirInode(inode)) {\n\t var children = inode.getListing();\n\t for (var i = 0, list = children; i < list.length; i += 1) {\n\t var child = list[i];\n\t\n\t this$1.removePath(path$$1 + '/' + child);\n\t }\n\t // Remove the directory from the index, unless it's the root.\n\t if (path$$1 !== '/') {\n\t delete this._index[path$$1];\n\t }\n\t }\n\t return inode;\n\t};\n\t/**\n\t * Retrieves the directory listing of the given path.\n\t * @return An array of files in the given path, or 'null' if it does not exist.\n\t */\n\tFileIndex.prototype.ls = function ls (path$$1) {\n\t var item = this._index[path$$1];\n\t if (item === undefined) {\n\t return null;\n\t }\n\t return item.getListing();\n\t};\n\t/**\n\t * Returns the inode of the given item.\n\t * @return Returns null if the item does not exist.\n\t */\n\tFileIndex.prototype.getInode = function getInode (path$$1) {\n\t var splitPath = this._split_path(path$$1);\n\t var dirpath = splitPath[0];\n\t var itemname = splitPath[1];\n\t // Retrieve from its parent directory.\n\t var parent = this._index[dirpath];\n\t if (parent === undefined) {\n\t return null;\n\t }\n\t // Root case\n\t if (dirpath === path$$1) {\n\t return parent;\n\t }\n\t return parent.getItem(itemname);\n\t};\n\t/**\n\t * Split into a (directory path, item name) pair\n\t */\n\tFileIndex.prototype._split_path = function _split_path (p) {\n\t var dirpath = path.dirname(p);\n\t var itemname = p.substr(dirpath.length + (dirpath === \"/\" ? 0 : 1));\n\t return [dirpath, itemname];\n\t};\n\t/**\n\t * Inode for a file. Stores an arbitrary (filesystem-specific) data payload.\n\t */\n\tvar FileInode = function FileInode(data) {\n\t this.data = data;\n\t};\n\tFileInode.prototype.isFile = function isFile () { return true; };\n\tFileInode.prototype.isDir = function isDir () { return false; };\n\tFileInode.prototype.getData = function getData () { return this.data; };\n\tFileInode.prototype.setData = function setData (data) { this.data = data; };\n\t/**\n\t * Inode for a directory. Currently only contains the directory listing.\n\t */\n\tvar DirInode = function DirInode(data) {\n\t if ( data === void 0 ) data = null;\n\t\n\t this.data = data;\n\t this._ls = {};\n\t};\n\tDirInode.prototype.isFile = function isFile () {\n\t return false;\n\t};\n\tDirInode.prototype.isDir = function isDir () {\n\t return true;\n\t};\n\tDirInode.prototype.getData = function getData () { return this.data; };\n\t/**\n\t * Return a Stats object for this inode.\n\t * @todo Should probably remove this at some point. This isn't the\n\t * responsibility of the FileIndex.\n\t */\n\tDirInode.prototype.getStats = function getStats () {\n\t return new Stats(FileType.DIRECTORY, 4096, 0x16D);\n\t};\n\t/**\n\t * Returns the directory listing for this directory. Paths in the directory are\n\t * relative to the directory's path.\n\t * @return The directory listing for this directory.\n\t */\n\tDirInode.prototype.getListing = function getListing () {\n\t return Object.keys(this._ls);\n\t};\n\t/**\n\t * Returns the inode for the indicated item, or null if it does not exist.\n\t * @param p Name of item in this directory.\n\t */\n\tDirInode.prototype.getItem = function getItem (p) {\n\t var item = this._ls[p];\n\t return item ? item : null;\n\t};\n\t/**\n\t * Add the given item to the directory listing. Note that the given inode is\n\t * not copied, and will be mutated by the DirInode if it is a DirInode.\n\t * @param p Item name to add to the directory listing.\n\t * @param inode The inode for the\n\t * item to add to the directory inode.\n\t * @return True if it was added, false if it already existed.\n\t */\n\tDirInode.prototype.addItem = function addItem (p, inode) {\n\t if (p in this._ls) {\n\t return false;\n\t }\n\t this._ls[p] = inode;\n\t return true;\n\t};\n\t/**\n\t * Removes the given item from the directory listing.\n\t * @param p Name of item to remove from the directory listing.\n\t * @return Returns the item\n\t * removed, or null if the item did not exist.\n\t */\n\tDirInode.prototype.remItem = function remItem (p) {\n\t var item = this._ls[p];\n\t if (item === undefined) {\n\t return null;\n\t }\n\t delete this._ls[p];\n\t return item;\n\t};\n\t/**\n\t * @hidden\n\t */\n\tfunction isFileInode(inode) {\n\t return !!inode && inode.isFile();\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction isDirInode(inode) {\n\t return !!inode && inode.isDir();\n\t}\n\t\n\t/**\n\t * Try to convert the given buffer into a string, and pass it to the callback.\n\t * Optimization that removes the needed try/catch into a helper function, as\n\t * this is an uncommon case.\n\t * @hidden\n\t */\n\tfunction tryToString(buff, encoding, cb) {\n\t try {\n\t cb(null, buff.toString(encoding));\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t}\n\t/**\n\t * A simple filesystem backed by XMLHttpRequests. You must create a directory listing using the\n\t * `make_xhrfs_index` tool provided by BrowserFS.\n\t *\n\t * If you install BrowserFS globally with `npm i -g browserfs`, you can generate a listing by\n\t * running `make_xhrfs_index` in your terminal in the directory you would like to index:\n\t *\n\t * ```\n\t * make_xhrfs_index > index.json\n\t * ```\n\t *\n\t * Listings objects look like the following:\n\t *\n\t * ```json\n\t * {\n\t * \"home\": {\n\t * \"jvilk\": {\n\t * \"someFile.txt\": null,\n\t * \"someDir\": {\n\t * // Empty directory\n\t * }\n\t * }\n\t * }\n\t * }\n\t * ```\n\t *\n\t * *This example has the folder `/home/jvilk` with subfile `someFile.txt` and subfolder `someDir`.*\n\t */\n\tvar XmlHttpRequest = (function (BaseFileSystem$$1) {\n\t function XmlHttpRequest(listingUrlOrObj, prefixUrl, deprecateMsg) {\n\t if ( prefixUrl === void 0 ) prefixUrl = '';\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t BaseFileSystem$$1.call(this);\n\t if (!listingUrlOrObj) {\n\t listingUrlOrObj = 'index.json';\n\t }\n\t // prefix_url must end in a directory separator.\n\t if (prefixUrl.length > 0 && prefixUrl.charAt(prefixUrl.length - 1) !== '/') {\n\t prefixUrl = prefixUrl + '/';\n\t }\n\t this.prefixUrl = prefixUrl;\n\t var listing = null;\n\t if (typeof (listingUrlOrObj) === \"string\") {\n\t listing = this._requestFileSync(listingUrlOrObj, 'json');\n\t if (!listing) {\n\t throw new Error(\"Unable to find listing at URL: ${listingUrlOrObj}\");\n\t }\n\t }\n\t else {\n\t listing = listingUrlOrObj;\n\t }\n\t deprecationMessage(deprecateMsg, XmlHttpRequest.Name, { index: typeof (listingUrlOrObj) === \"string\" ? listingUrlOrObj : \"file index as an object\", baseUrl: prefixUrl });\n\t this._index = FileIndex.fromListing(listing);\n\t }\n\t\n\t if ( BaseFileSystem$$1 ) XmlHttpRequest.__proto__ = BaseFileSystem$$1;\n\t XmlHttpRequest.prototype = Object.create( BaseFileSystem$$1 && BaseFileSystem$$1.prototype );\n\t XmlHttpRequest.prototype.constructor = XmlHttpRequest;\n\t /**\n\t * Construct an XmlHttpRequest file system backend with the given options.\n\t */\n\t XmlHttpRequest.Create = function Create (opts, cb) {\n\t if (opts.index === undefined) {\n\t opts.index = \"index.json\";\n\t }\n\t if (typeof (opts.index) === \"string\") {\n\t XmlHttpRequest.FromURL(opts.index, cb, opts.baseUrl, false);\n\t }\n\t else {\n\t cb(null, new XmlHttpRequest(opts.index, opts.baseUrl, false));\n\t }\n\t };\n\t XmlHttpRequest.isAvailable = function isAvailable () {\n\t return typeof (XMLHttpRequest) !== \"undefined\" && XMLHttpRequest !== null;\n\t };\n\t /**\n\t * **Deprecated. Please use XmlHttpRequest.Create() method instead to construct XmlHttpRequest objects.**\n\t *\n\t * Constructs an XmlHttpRequest object using the directory listing at the given URL.\n\t * Uses the base URL as the URL prefix for fetched files.\n\t * @param cb Called when the file system has been instantiated, or if an error occurs.\n\t */\n\t XmlHttpRequest.FromURL = function FromURL (url, cb, baseUrl, deprecateMsg) {\n\t if ( baseUrl === void 0 ) baseUrl = url.slice(0, url.lastIndexOf('/') + 1);\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t if (deprecateMsg) {\n\t console.warn((\"[XmlHttpRequest] XmlHttpRequest.FromURL() is deprecated and will be removed in the next major release. Please use 'XmlHttpRequest.Create({ index: \\\"\" + url + \"\\\", baseUrl: \\\"\" + baseUrl + \"\\\" }, cb)' instead.\"));\n\t }\n\t asyncDownloadFile(url, \"json\", function (e, data) {\n\t if (e) {\n\t cb(e);\n\t }\n\t else {\n\t cb(null, new XmlHttpRequest(data, baseUrl, false));\n\t }\n\t });\n\t };\n\t XmlHttpRequest.prototype.empty = function empty () {\n\t this._index.fileIterator(function (file) {\n\t file.fileData = null;\n\t });\n\t };\n\t XmlHttpRequest.prototype.getName = function getName () {\n\t return XmlHttpRequest.Name;\n\t };\n\t XmlHttpRequest.prototype.diskSpace = function diskSpace (path$$1, cb) {\n\t // Read-only file system. We could calculate the total space, but that's not\n\t // important right now.\n\t cb(0, 0);\n\t };\n\t XmlHttpRequest.prototype.isReadOnly = function isReadOnly () {\n\t return true;\n\t };\n\t XmlHttpRequest.prototype.supportsLinks = function supportsLinks () {\n\t return false;\n\t };\n\t XmlHttpRequest.prototype.supportsProps = function supportsProps () {\n\t return false;\n\t };\n\t XmlHttpRequest.prototype.supportsSynch = function supportsSynch () {\n\t return true;\n\t };\n\t /**\n\t * Special XHR function: Preload the given file into the index.\n\t * @param [String] path\n\t * @param [BrowserFS.Buffer] buffer\n\t */\n\t XmlHttpRequest.prototype.preloadFile = function preloadFile (path$$1, buffer$$1) {\n\t var inode = this._index.getInode(path$$1);\n\t if (isFileInode(inode)) {\n\t if (inode === null) {\n\t throw ApiError.ENOENT(path$$1);\n\t }\n\t var stats = inode.getData();\n\t stats.size = buffer$$1.length;\n\t stats.fileData = buffer$$1;\n\t }\n\t else {\n\t throw ApiError.EISDIR(path$$1);\n\t }\n\t };\n\t XmlHttpRequest.prototype.stat = function stat (path$$1, isLstat, cb) {\n\t var inode = this._index.getInode(path$$1);\n\t if (inode === null) {\n\t return cb(ApiError.ENOENT(path$$1));\n\t }\n\t var stats;\n\t if (isFileInode(inode)) {\n\t stats = inode.getData();\n\t // At this point, a non-opened file will still have default stats from the listing.\n\t if (stats.size < 0) {\n\t this._requestFileSizeAsync(path$$1, function (e, size) {\n\t if (e) {\n\t return cb(e);\n\t }\n\t stats.size = size;\n\t cb(null, stats.clone());\n\t });\n\t }\n\t else {\n\t cb(null, stats.clone());\n\t }\n\t }\n\t else if (isDirInode(inode)) {\n\t stats = inode.getStats();\n\t cb(null, stats);\n\t }\n\t else {\n\t cb(ApiError.FileError(ErrorCode.EINVAL, path$$1));\n\t }\n\t };\n\t XmlHttpRequest.prototype.statSync = function statSync (path$$1, isLstat) {\n\t var inode = this._index.getInode(path$$1);\n\t if (inode === null) {\n\t throw ApiError.ENOENT(path$$1);\n\t }\n\t var stats;\n\t if (isFileInode(inode)) {\n\t stats = inode.getData();\n\t // At this point, a non-opened file will still have default stats from the listing.\n\t if (stats.size < 0) {\n\t stats.size = this._requestFileSizeSync(path$$1);\n\t }\n\t }\n\t else if (isDirInode(inode)) {\n\t stats = inode.getStats();\n\t }\n\t else {\n\t throw ApiError.FileError(ErrorCode.EINVAL, path$$1);\n\t }\n\t return stats;\n\t };\n\t XmlHttpRequest.prototype.open = function open (path$$1, flags, mode, cb) {\n\t // INVARIANT: You can't write to files on this file system.\n\t if (flags.isWriteable()) {\n\t return cb(new ApiError(ErrorCode.EPERM, path$$1));\n\t }\n\t var self = this;\n\t // Check if the path exists, and is a file.\n\t var inode = this._index.getInode(path$$1);\n\t if (inode === null) {\n\t return cb(ApiError.ENOENT(path$$1));\n\t }\n\t if (isFileInode(inode)) {\n\t var stats = inode.getData();\n\t switch (flags.pathExistsAction()) {\n\t case ActionType.THROW_EXCEPTION:\n\t case ActionType.TRUNCATE_FILE:\n\t return cb(ApiError.EEXIST(path$$1));\n\t case ActionType.NOP:\n\t // Use existing file contents.\n\t // XXX: Uh, this maintains the previously-used flag.\n\t if (stats.fileData) {\n\t return cb(null, new NoSyncFile(self, path$$1, flags, stats.clone(), stats.fileData));\n\t }\n\t // @todo be lazier about actually requesting the file\n\t this._requestFileAsync(path$$1, 'buffer', function (err, buffer$$1) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t // we don't initially have file sizes\n\t stats.size = buffer$$1.length;\n\t stats.fileData = buffer$$1;\n\t return cb(null, new NoSyncFile(self, path$$1, flags, stats.clone(), buffer$$1));\n\t });\n\t break;\n\t default:\n\t return cb(new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.'));\n\t }\n\t }\n\t else {\n\t return cb(ApiError.EISDIR(path$$1));\n\t }\n\t };\n\t XmlHttpRequest.prototype.openSync = function openSync (path$$1, flags, mode) {\n\t // INVARIANT: You can't write to files on this file system.\n\t if (flags.isWriteable()) {\n\t throw new ApiError(ErrorCode.EPERM, path$$1);\n\t }\n\t // Check if the path exists, and is a file.\n\t var inode = this._index.getInode(path$$1);\n\t if (inode === null) {\n\t throw ApiError.ENOENT(path$$1);\n\t }\n\t if (isFileInode(inode)) {\n\t var stats = inode.getData();\n\t switch (flags.pathExistsAction()) {\n\t case ActionType.THROW_EXCEPTION:\n\t case ActionType.TRUNCATE_FILE:\n\t throw ApiError.EEXIST(path$$1);\n\t case ActionType.NOP:\n\t // Use existing file contents.\n\t // XXX: Uh, this maintains the previously-used flag.\n\t if (stats.fileData) {\n\t return new NoSyncFile(this, path$$1, flags, stats.clone(), stats.fileData);\n\t }\n\t // @todo be lazier about actually requesting the file\n\t var buffer$$1 = this._requestFileSync(path$$1, 'buffer');\n\t // we don't initially have file sizes\n\t stats.size = buffer$$1.length;\n\t stats.fileData = buffer$$1;\n\t return new NoSyncFile(this, path$$1, flags, stats.clone(), buffer$$1);\n\t default:\n\t throw new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.');\n\t }\n\t }\n\t else {\n\t throw ApiError.EISDIR(path$$1);\n\t }\n\t };\n\t XmlHttpRequest.prototype.readdir = function readdir (path$$1, cb) {\n\t try {\n\t cb(null, this.readdirSync(path$$1));\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t XmlHttpRequest.prototype.readdirSync = function readdirSync (path$$1) {\n\t // Check if it exists.\n\t var inode = this._index.getInode(path$$1);\n\t if (inode === null) {\n\t throw ApiError.ENOENT(path$$1);\n\t }\n\t else if (isDirInode(inode)) {\n\t return inode.getListing();\n\t }\n\t else {\n\t throw ApiError.ENOTDIR(path$$1);\n\t }\n\t };\n\t /**\n\t * We have the entire file as a buffer; optimize readFile.\n\t */\n\t XmlHttpRequest.prototype.readFile = function readFile (fname, encoding, flag, cb) {\n\t // Wrap cb in file closing code.\n\t var oldCb = cb;\n\t // Get file.\n\t this.open(fname, flag, 0x1a4, function (err, fd) {\n\t if (err) {\n\t return cb(err);\n\t }\n\t cb = function (err, arg) {\n\t fd.close(function (err2) {\n\t if (!err) {\n\t err = err2;\n\t }\n\t return oldCb(err, arg);\n\t });\n\t };\n\t var fdCast = fd;\n\t var fdBuff = fdCast.getBuffer();\n\t if (encoding === null) {\n\t cb(err, copyingSlice(fdBuff));\n\t }\n\t else {\n\t tryToString(fdBuff, encoding, cb);\n\t }\n\t });\n\t };\n\t /**\n\t * Specially-optimized readfile.\n\t */\n\t XmlHttpRequest.prototype.readFileSync = function readFileSync (fname, encoding, flag) {\n\t // Get file.\n\t var fd = this.openSync(fname, flag, 0x1a4);\n\t try {\n\t var fdCast = fd;\n\t var fdBuff = fdCast.getBuffer();\n\t if (encoding === null) {\n\t return copyingSlice(fdBuff);\n\t }\n\t return fdBuff.toString(encoding);\n\t }\n\t finally {\n\t fd.closeSync();\n\t }\n\t };\n\t XmlHttpRequest.prototype.getXhrPath = function getXhrPath (filePath) {\n\t if (filePath.charAt(0) === '/') {\n\t filePath = filePath.slice(1);\n\t }\n\t return this.prefixUrl + filePath;\n\t };\n\t XmlHttpRequest.prototype._requestFileAsync = function _requestFileAsync (p, type, cb) {\n\t asyncDownloadFile(this.getXhrPath(p), type, cb);\n\t };\n\t XmlHttpRequest.prototype._requestFileSync = function _requestFileSync (p, type) {\n\t return syncDownloadFile(this.getXhrPath(p), type);\n\t };\n\t /**\n\t * Only requests the HEAD content, for the file size.\n\t */\n\t XmlHttpRequest.prototype._requestFileSizeAsync = function _requestFileSizeAsync (path$$1, cb) {\n\t getFileSizeAsync(this.getXhrPath(path$$1), cb);\n\t };\n\t XmlHttpRequest.prototype._requestFileSizeSync = function _requestFileSizeSync (path$$1) {\n\t return getFileSizeSync(this.getXhrPath(path$$1));\n\t };\n\t\n\t return XmlHttpRequest;\n\t}(BaseFileSystem));\n\t\n\tXmlHttpRequest.Name = \"XmlHttpRequest\";\n\tXmlHttpRequest.Options = {\n\t index: {\n\t type: [\"string\", \"object\"],\n\t optional: true,\n\t description: \"URL to a file index as a JSON file or the file index object itself, generated with the make_xhrfs_index script. Defaults to `index.json`.\"\n\t },\n\t baseUrl: {\n\t type: \"string\",\n\t optional: true,\n\t description: \"Used as the URL prefix for fetched files. Default: Fetch files relative to the index.\"\n\t }\n\t};\n\t\n\t/**\n\t * (Nonstandard) String utility function for 8-bit ASCII with the extended\n\t * character set. Unlike the ASCII above, we do not mask the high bits.\n\t *\n\t * Placed into a separate file so it can be used with other Buffer implementations.\n\t * @see http://en.wikipedia.org/wiki/Extended_ASCII\n\t */\n\t/**\n\t * (Nonstandard) String utility function for 8-bit ASCII with the extended\n\t * character set. Unlike the ASCII above, we do not mask the high bits.\n\t *\n\t * Placed into a separate file so it can be used with other Buffer implementations.\n\t * @see http://en.wikipedia.org/wiki/Extended_ASCII\n\t */ var ExtendedASCII = function ExtendedASCII () {};\n\t\n\t ExtendedASCII.str2byte = function str2byte (str, buf) {\n\t var length = str.length > buf.length ? buf.length : str.length;\n\t for (var i = 0; i < length; i++) {\n\t var charCode = str.charCodeAt(i);\n\t if (charCode > 0x7F) {\n\t // Check if extended ASCII.\n\t var charIdx = ExtendedASCII.extendedChars.indexOf(str.charAt(i));\n\t if (charIdx > -1) {\n\t charCode = charIdx + 0x80;\n\t }\n\t // Otherwise, keep it as-is.\n\t }\n\t buf[charCode] = i;\n\t }\n\t return length;\n\t};\n\tExtendedASCII.byte2str = function byte2str (buff) {\n\t var chars = new Array(buff.length);\n\t for (var i = 0; i < buff.length; i++) {\n\t var charCode = buff[i];\n\t if (charCode > 0x7F) {\n\t chars[i] = ExtendedASCII.extendedChars[charCode - 128];\n\t }\n\t else {\n\t chars[i] = String.fromCharCode(charCode);\n\t }\n\t }\n\t return chars.join('');\n\t};\n\tExtendedASCII.byteLength = function byteLength (str) { return str.length; };\n\t\n\t ExtendedASCII.extendedChars = ['\\u00C7', '\\u00FC', '\\u00E9', '\\u00E2', '\\u00E4',\n\t '\\u00E0', '\\u00E5', '\\u00E7', '\\u00EA', '\\u00EB', '\\u00E8', '\\u00EF',\n\t '\\u00EE', '\\u00EC', '\\u00C4', '\\u00C5', '\\u00C9', '\\u00E6', '\\u00C6',\n\t '\\u00F4', '\\u00F6', '\\u00F2', '\\u00FB', '\\u00F9', '\\u00FF', '\\u00D6',\n\t '\\u00DC', '\\u00F8', '\\u00A3', '\\u00D8', '\\u00D7', '\\u0192', '\\u00E1',\n\t '\\u00ED', '\\u00F3', '\\u00FA', '\\u00F1', '\\u00D1', '\\u00AA', '\\u00BA',\n\t '\\u00BF', '\\u00AE', '\\u00AC', '\\u00BD', '\\u00BC', '\\u00A1', '\\u00AB',\n\t '\\u00BB', '_', '_', '_', '\\u00A6', '\\u00A6', '\\u00C1', '\\u00C2', '\\u00C0',\n\t '\\u00A9', '\\u00A6', '\\u00A6', '+', '+', '\\u00A2', '\\u00A5', '+', '+', '-',\n\t '-', '+', '-', '+', '\\u00E3', '\\u00C3', '+', '+', '-', '-', '\\u00A6', '-',\n\t '+', '\\u00A4', '\\u00F0', '\\u00D0', '\\u00CA', '\\u00CB', '\\u00C8', 'i',\n\t '\\u00CD', '\\u00CE', '\\u00CF', '+', '+', '_', '_', '\\u00A6', '\\u00CC', '_',\n\t '\\u00D3', '\\u00DF', '\\u00D4', '\\u00D2', '\\u00F5', '\\u00D5', '\\u00B5',\n\t '\\u00FE', '\\u00DE', '\\u00DA', '\\u00DB', '\\u00D9', '\\u00FD', '\\u00DD',\n\t '\\u00AF', '\\u00B4', '\\u00AD', '\\u00B1', '_', '\\u00BE', '\\u00B6', '\\u00A7',\n\t '\\u00F7', '\\u00B8', '\\u00B0', '\\u00A8', '\\u00B7', '\\u00B9', '\\u00B3',\n\t '\\u00B2', '_', ' '];\n\t\n\t/**\n\t * @hidden\n\t */\n\tvar inflateRaw = __webpack_require__(23).inflateRaw;\n\t/**\n\t * Maps CompressionMethod => function that decompresses.\n\t * @hidden\n\t */\n\tvar decompressionMethods = {};\n\t/**\n\t * 4.4.2.2: Indicates the compatibiltiy of a file's external attributes.\n\t */\n\tvar ExternalFileAttributeType;\n\t(function (ExternalFileAttributeType) {\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"MSDOS\"] = 0] = \"MSDOS\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"AMIGA\"] = 1] = \"AMIGA\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"OPENVMS\"] = 2] = \"OPENVMS\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"UNIX\"] = 3] = \"UNIX\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"VM_CMS\"] = 4] = \"VM_CMS\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"ATARI_ST\"] = 5] = \"ATARI_ST\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"OS2_HPFS\"] = 6] = \"OS2_HPFS\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"MAC\"] = 7] = \"MAC\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"Z_SYSTEM\"] = 8] = \"Z_SYSTEM\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"CP_M\"] = 9] = \"CP_M\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"NTFS\"] = 10] = \"NTFS\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"MVS\"] = 11] = \"MVS\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"VSE\"] = 12] = \"VSE\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"ACORN_RISC\"] = 13] = \"ACORN_RISC\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"VFAT\"] = 14] = \"VFAT\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"ALT_MVS\"] = 15] = \"ALT_MVS\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"BEOS\"] = 16] = \"BEOS\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"TANDEM\"] = 17] = \"TANDEM\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"OS_400\"] = 18] = \"OS_400\";\n\t ExternalFileAttributeType[ExternalFileAttributeType[\"OSX\"] = 19] = \"OSX\";\n\t})(ExternalFileAttributeType || (ExternalFileAttributeType = {}));\n\t/**\n\t * 4.4.5\n\t */\n\tvar CompressionMethod;\n\t(function (CompressionMethod) {\n\t CompressionMethod[CompressionMethod[\"STORED\"] = 0] = \"STORED\";\n\t CompressionMethod[CompressionMethod[\"SHRUNK\"] = 1] = \"SHRUNK\";\n\t CompressionMethod[CompressionMethod[\"REDUCED_1\"] = 2] = \"REDUCED_1\";\n\t CompressionMethod[CompressionMethod[\"REDUCED_2\"] = 3] = \"REDUCED_2\";\n\t CompressionMethod[CompressionMethod[\"REDUCED_3\"] = 4] = \"REDUCED_3\";\n\t CompressionMethod[CompressionMethod[\"REDUCED_4\"] = 5] = \"REDUCED_4\";\n\t CompressionMethod[CompressionMethod[\"IMPLODE\"] = 6] = \"IMPLODE\";\n\t CompressionMethod[CompressionMethod[\"DEFLATE\"] = 8] = \"DEFLATE\";\n\t CompressionMethod[CompressionMethod[\"DEFLATE64\"] = 9] = \"DEFLATE64\";\n\t CompressionMethod[CompressionMethod[\"TERSE_OLD\"] = 10] = \"TERSE_OLD\";\n\t CompressionMethod[CompressionMethod[\"BZIP2\"] = 12] = \"BZIP2\";\n\t CompressionMethod[CompressionMethod[\"LZMA\"] = 14] = \"LZMA\";\n\t CompressionMethod[CompressionMethod[\"TERSE_NEW\"] = 18] = \"TERSE_NEW\";\n\t CompressionMethod[CompressionMethod[\"LZ77\"] = 19] = \"LZ77\";\n\t CompressionMethod[CompressionMethod[\"WAVPACK\"] = 97] = \"WAVPACK\";\n\t CompressionMethod[CompressionMethod[\"PPMD\"] = 98] = \"PPMD\"; // PPMd version I, Rev 1\n\t})(CompressionMethod || (CompressionMethod = {}));\n\t/**\n\t * Converts the input time and date in MS-DOS format into a JavaScript Date\n\t * object.\n\t * @hidden\n\t */\n\tfunction msdos2date(time, date) {\n\t // MS-DOS Date\n\t // |0 0 0 0 0|0 0 0 0|0 0 0 0 0 0 0\n\t // D (1-31) M (1-23) Y (from 1980)\n\t var day = date & 0x1F;\n\t // JS date is 0-indexed, DOS is 1-indexed.\n\t var month = ((date >> 5) & 0xF) - 1;\n\t var year = (date >> 9) + 1980;\n\t // MS DOS Time\n\t // |0 0 0 0 0|0 0 0 0 0 0|0 0 0 0 0\n\t // Second Minute Hour\n\t var second = time & 0x1F;\n\t var minute = (time >> 5) & 0x3F;\n\t var hour = time >> 11;\n\t return new Date(year, month, day, hour, minute, second);\n\t}\n\t/**\n\t * Safely returns the string from the buffer, even if it is 0 bytes long.\n\t * (Normally, calling toString() on a buffer with start === end causes an\n\t * exception).\n\t * @hidden\n\t */\n\tfunction safeToString(buff, useUTF8, start, length) {\n\t if (length === 0) {\n\t return \"\";\n\t }\n\t else if (useUTF8) {\n\t return buff.toString('utf8', start, start + length);\n\t }\n\t else {\n\t return ExtendedASCII.byte2str(buff.slice(start, start + length));\n\t }\n\t}\n\t/*\n\t 4.3.6 Overall .ZIP file format:\n\t\n\t [local file header 1]\n\t [encryption header 1]\n\t [file data 1]\n\t [data descriptor 1]\n\t .\n\t .\n\t .\n\t [local file header n]\n\t [encryption header n]\n\t [file data n]\n\t [data descriptor n]\n\t [archive decryption header]\n\t [archive extra data record]\n\t [central directory header 1]\n\t .\n\t .\n\t .\n\t [central directory header n]\n\t [zip64 end of central directory record]\n\t [zip64 end of central directory locator]\n\t [end of central directory record]\n\t*/\n\t/**\n\t * 4.3.7 Local file header:\n\t *\n\t * local file header signature 4 bytes (0x04034b50)\n\t * version needed to extract 2 bytes\n\t * general purpose bit flag 2 bytes\n\t * compression method 2 bytes\n\t * last mod file time 2 bytes\n\t * last mod file date 2 bytes\n\t * crc-32 4 bytes\n\t * compressed size 4 bytes\n\t * uncompressed size 4 bytes\n\t * file name length 2 bytes\n\t * extra field length 2 bytes\n\t *\n\t * file name (variable size)\n\t * extra field (variable size)\n\t */\n\tvar FileHeader = function FileHeader(data) {\n\t this.data = data;\n\t if (data.readUInt32LE(0) !== 0x04034b50) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid Zip file: Local file header has invalid signature: \" + this.data.readUInt32LE(0));\n\t }\n\t };\n\t FileHeader.prototype.versionNeeded = function versionNeeded () { return this.data.readUInt16LE(4); };\n\t FileHeader.prototype.flags = function flags () { return this.data.readUInt16LE(6); };\n\t FileHeader.prototype.compressionMethod = function compressionMethod () { return this.data.readUInt16LE(8); };\n\t FileHeader.prototype.lastModFileTime = function lastModFileTime () {\n\t // Time and date is in MS-DOS format.\n\t return msdos2date(this.data.readUInt16LE(10), this.data.readUInt16LE(12));\n\t };\n\t FileHeader.prototype.rawLastModFileTime = function rawLastModFileTime () {\n\t return this.data.readUInt32LE(10);\n\t };\n\t FileHeader.prototype.crc32 = function crc32 () { return this.data.readUInt32LE(14); };\n\t /**\n\t * These two values are COMPLETELY USELESS.\n\t *\n\t * Section 4.4.9:\n\t *If bit 3 of the general purpose bit flag is set,\n\t *these fields are set to zero in the local header and the\n\t *correct values are put in the data descriptor and\n\t *in the central directory.\n\t *\n\t * So we'll just use the central directory's values.\n\t */\n\t // public compressedSize(): number { return this.data.readUInt32LE(18); }\n\t // public uncompressedSize(): number { return this.data.readUInt32LE(22); }\n\t FileHeader.prototype.fileNameLength = function fileNameLength () { return this.data.readUInt16LE(26); };\n\t FileHeader.prototype.extraFieldLength = function extraFieldLength () { return this.data.readUInt16LE(28); };\n\t FileHeader.prototype.fileName = function fileName () {\n\t return safeToString(this.data, this.useUTF8(), 30, this.fileNameLength());\n\t };\n\t FileHeader.prototype.extraField = function extraField () {\n\t var start = 30 + this.fileNameLength();\n\t return this.data.slice(start, start + this.extraFieldLength());\n\t };\n\t FileHeader.prototype.totalSize = function totalSize () { return 30 + this.fileNameLength() + this.extraFieldLength(); };\n\t FileHeader.prototype.useUTF8 = function useUTF8 () { return (this.flags() & 0x800) === 0x800; };\n\t/**\n\t * 4.3.8 File data\n\t *\n\t * Immediately following the local header for a file\n\t * SHOULD be placed the compressed or stored data for the file.\n\t * If the file is encrypted, the encryption header for the file\n\t * SHOULD be placed after the local header and before the file\n\t * data. The series of [local file header][encryption header]\n\t * [file data][data descriptor] repeats for each file in the\n\t * .ZIP archive.\n\t *\n\t * Zero-byte files, directories, and other file types that\n\t * contain no content MUST not include file data.\n\t */\n\tvar FileData = function FileData(header, record, data) {\n\t this.header = header;\n\t this.record = record;\n\t this.data = data;\n\t };\n\t FileData.prototype.decompress = function decompress () {\n\t // Check the compression\n\t var compressionMethod = this.header.compressionMethod();\n\t var fcn = decompressionMethods[compressionMethod];\n\t if (fcn) {\n\t return fcn(this.data, this.record.compressedSize(), this.record.uncompressedSize(), this.record.flag());\n\t }\n\t else {\n\t var name = CompressionMethod[compressionMethod];\n\t if (!name) {\n\t name = \"Unknown: \" + compressionMethod;\n\t }\n\t throw new ApiError(ErrorCode.EINVAL, (\"Invalid compression method on file '\" + (this.header.fileName()) + \"': \" + name));\n\t }\n\t };\n\t FileData.prototype.getHeader = function getHeader () {\n\t return this.header;\n\t };\n\t FileData.prototype.getRecord = function getRecord () {\n\t return this.record;\n\t };\n\t FileData.prototype.getRawData = function getRawData () {\n\t return this.data;\n\t };\n\t/**\n\t * 4.3.9 Data descriptor:\n\t *\n\t * crc-32 4 bytes\n\t * compressed size 4 bytes\n\t * uncompressed size 4 bytes\n\t */\n\tvar DataDescriptor = function DataDescriptor(data) {\n\t this.data = data;\n\t };\n\t DataDescriptor.prototype.crc32 = function crc32 () { return this.data.readUInt32LE(0); };\n\t DataDescriptor.prototype.compressedSize = function compressedSize () { return this.data.readUInt32LE(4); };\n\t DataDescriptor.prototype.uncompressedSize = function uncompressedSize () { return this.data.readUInt32LE(8); };\n\t/*\n\t` 4.3.10 Archive decryption header:\n\t\n\t 4.3.10.1 The Archive Decryption Header is introduced in version 6.2\n\t of the ZIP format specification. This record exists in support\n\t of the Central Directory Encryption Feature implemented as part of\n\t the Strong Encryption Specification as described in this document.\n\t When the Central Directory Structure is encrypted, this decryption\n\t header MUST precede the encrypted data segment.\n\t */\n\t/**\n\t * 4.3.11 Archive extra data record:\n\t *\n\t * archive extra data signature 4 bytes (0x08064b50)\n\t * extra field length 4 bytes\n\t * extra field data (variable size)\n\t *\n\t * 4.3.11.1 The Archive Extra Data Record is introduced in version 6.2\n\t * of the ZIP format specification. This record MAY be used in support\n\t * of the Central Directory Encryption Feature implemented as part of\n\t * the Strong Encryption Specification as described in this document.\n\t * When present, this record MUST immediately precede the central\n\t * directory data structure.\n\t */\n\tvar ArchiveExtraDataRecord = function ArchiveExtraDataRecord(data) {\n\t this.data = data;\n\t if (this.data.readUInt32LE(0) !== 0x08064b50) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid archive extra data record signature: \" + this.data.readUInt32LE(0));\n\t }\n\t };\n\t ArchiveExtraDataRecord.prototype.length = function length () { return this.data.readUInt32LE(4); };\n\t ArchiveExtraDataRecord.prototype.extraFieldData = function extraFieldData () { return this.data.slice(8, 8 + this.length()); };\n\t/**\n\t * 4.3.13 Digital signature:\n\t *\n\t * header signature 4 bytes (0x05054b50)\n\t * size of data 2 bytes\n\t * signature data (variable size)\n\t *\n\t * With the introduction of the Central Directory Encryption\n\t * feature in version 6.2 of this specification, the Central\n\t * Directory Structure MAY be stored both compressed and encrypted.\n\t * Although not required, it is assumed when encrypting the\n\t * Central Directory Structure, that it will be compressed\n\t * for greater storage efficiency. Information on the\n\t * Central Directory Encryption feature can be found in the section\n\t * describing the Strong Encryption Specification. The Digital\n\t * Signature record will be neither compressed nor encrypted.\n\t */\n\tvar DigitalSignature = function DigitalSignature(data) {\n\t this.data = data;\n\t if (this.data.readUInt32LE(0) !== 0x05054b50) {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid digital signature signature: \" + this.data.readUInt32LE(0));\n\t }\n\t };\n\t DigitalSignature.prototype.size = function size () { return this.data.readUInt16LE(4); };\n\t DigitalSignature.prototype.signatureData = function signatureData () { return this.data.slice(6, 6 + this.size()); };\n\t/**\n\t * 4.3.12 Central directory structure:\n\t *\n\t * central file header signature 4 bytes (0x02014b50)\n\t * version made by 2 bytes\n\t * version needed to extract 2 bytes\n\t * general purpose bit flag 2 bytes\n\t * compression method 2 bytes\n\t * last mod file time 2 bytes\n\t * last mod file date 2 bytes\n\t * crc-32 4 bytes\n\t * compressed size 4 bytes\n\t * uncompressed size 4 bytes\n\t * file name length 2 bytes\n\t * extra field length 2 bytes\n\t * file comment length 2 bytes\n\t * disk number start 2 bytes\n\t * internal file attributes 2 bytes\n\t * external file attributes 4 bytes\n\t * relative offset of local header 4 bytes\n\t *\n\t * file name (variable size)\n\t * extra field (variable size)\n\t * file comment (variable size)\n\t */\n\tvar CentralDirectory = function CentralDirectory(zipData, data) {\n\t this.zipData = zipData;\n\t this.data = data;\n\t // Sanity check.\n\t if (this.data.readUInt32LE(0) !== 0x02014b50) {\n\t throw new ApiError(ErrorCode.EINVAL, (\"Invalid Zip file: Central directory record has invalid signature: \" + (this.data.readUInt32LE(0))));\n\t }\n\t this._filename = this.produceFilename();\n\t };\n\t CentralDirectory.prototype.versionMadeBy = function versionMadeBy () { return this.data.readUInt16LE(4); };\n\t CentralDirectory.prototype.versionNeeded = function versionNeeded () { return this.data.readUInt16LE(6); };\n\t CentralDirectory.prototype.flag = function flag () { return this.data.readUInt16LE(8); };\n\t CentralDirectory.prototype.compressionMethod = function compressionMethod () { return this.data.readUInt16LE(10); };\n\t CentralDirectory.prototype.lastModFileTime = function lastModFileTime () {\n\t // Time and date is in MS-DOS format.\n\t return msdos2date(this.data.readUInt16LE(12), this.data.readUInt16LE(14));\n\t };\n\t CentralDirectory.prototype.rawLastModFileTime = function rawLastModFileTime () {\n\t return this.data.readUInt32LE(12);\n\t };\n\t CentralDirectory.prototype.crc32 = function crc32 () { return this.data.readUInt32LE(16); };\n\t CentralDirectory.prototype.compressedSize = function compressedSize () { return this.data.readUInt32LE(20); };\n\t CentralDirectory.prototype.uncompressedSize = function uncompressedSize () { return this.data.readUInt32LE(24); };\n\t CentralDirectory.prototype.fileNameLength = function fileNameLength () { return this.data.readUInt16LE(28); };\n\t CentralDirectory.prototype.extraFieldLength = function extraFieldLength () { return this.data.readUInt16LE(30); };\n\t CentralDirectory.prototype.fileCommentLength = function fileCommentLength () { return this.data.readUInt16LE(32); };\n\t CentralDirectory.prototype.diskNumberStart = function diskNumberStart () { return this.data.readUInt16LE(34); };\n\t CentralDirectory.prototype.internalAttributes = function internalAttributes () { return this.data.readUInt16LE(36); };\n\t CentralDirectory.prototype.externalAttributes = function externalAttributes () { return this.data.readUInt32LE(38); };\n\t CentralDirectory.prototype.headerRelativeOffset = function headerRelativeOffset () { return this.data.readUInt32LE(42); };\n\t CentralDirectory.prototype.produceFilename = function produceFilename () {\n\t /*\n\t 4.4.17.1 claims:\n\t * All slashes are forward ('/') slashes.\n\t * Filename doesn't begin with a slash.\n\t * No drive letters or any nonsense like that.\n\t * If filename is missing, the input came from standard input.\n\t \n\t Unfortunately, this isn't true in practice. Some Windows zip utilities use\n\t a backslash here, but the correct Unix-style path in file headers.\n\t \n\t To avoid seeking all over the file to recover the known-good filenames\n\t from file headers, we simply convert '/' to '\\' here.\n\t */\n\t var fileName = safeToString(this.data, this.useUTF8(), 46, this.fileNameLength());\n\t return fileName.replace(/\\\\/g, \"/\");\n\t };\n\t CentralDirectory.prototype.fileName = function fileName () {\n\t return this._filename;\n\t };\n\t CentralDirectory.prototype.rawFileName = function rawFileName () {\n\t return this.data.slice(46, 46 + this.fileNameLength());\n\t };\n\t CentralDirectory.prototype.extraField = function extraField () {\n\t var start = 44 + this.fileNameLength();\n\t return this.data.slice(start, start + this.extraFieldLength());\n\t };\n\t CentralDirectory.prototype.fileComment = function fileComment () {\n\t var start = 46 + this.fileNameLength() + this.extraFieldLength();\n\t return safeToString(this.data, this.useUTF8(), start, this.fileCommentLength());\n\t };\n\t CentralDirectory.prototype.rawFileComment = function rawFileComment () {\n\t var start = 46 + this.fileNameLength() + this.extraFieldLength();\n\t return this.data.slice(start, start + this.fileCommentLength());\n\t };\n\t CentralDirectory.prototype.totalSize = function totalSize () {\n\t return 46 + this.fileNameLength() + this.extraFieldLength() + this.fileCommentLength();\n\t };\n\t CentralDirectory.prototype.isDirectory = function isDirectory () {\n\t // NOTE: This assumes that the zip file implementation uses the lower byte\n\t // of external attributes for DOS attributes for\n\t // backwards-compatibility. This is not mandated, but appears to be\n\t // commonplace.\n\t // According to the spec, the layout of external attributes is\n\t // platform-dependent.\n\t // If that fails, we also check if the name of the file ends in '/',\n\t // which is what Java's ZipFile implementation does.\n\t var fileName = this.fileName();\n\t return (this.externalAttributes() & 0x10 ? true : false) || (fileName.charAt(fileName.length - 1) === '/');\n\t };\n\t CentralDirectory.prototype.isFile = function isFile () { return !this.isDirectory(); };\n\t CentralDirectory.prototype.useUTF8 = function useUTF8 () { return (this.flag() & 0x800) === 0x800; };\n\t CentralDirectory.prototype.isEncrypted = function isEncrypted () { return (this.flag() & 0x1) === 0x1; };\n\t CentralDirectory.prototype.getFileData = function getFileData () {\n\t // Need to grab the header before we can figure out where the actual\n\t // compressed data starts.\n\t var start = this.headerRelativeOffset();\n\t var header = new FileHeader(this.zipData.slice(start));\n\t return new FileData(header, this, this.zipData.slice(start + header.totalSize()));\n\t };\n\t CentralDirectory.prototype.getData = function getData () {\n\t return this.getFileData().decompress();\n\t };\n\t CentralDirectory.prototype.getRawData = function getRawData () {\n\t return this.getFileData().getRawData();\n\t };\n\t CentralDirectory.prototype.getStats = function getStats () {\n\t return new Stats(FileType.FILE, this.uncompressedSize(), 0x16D, new Date(), this.lastModFileTime());\n\t };\n\t/**\n\t * 4.3.16: end of central directory record\n\t * end of central dir signature 4 bytes (0x06054b50)\n\t * number of this disk 2 bytes\n\t * number of the disk with the\n\t * start of the central directory 2 bytes\n\t * total number of entries in the\n\t * central directory on this disk 2 bytes\n\t * total number of entries in\n\t * the central directory 2 bytes\n\t * size of the central directory 4 bytes\n\t * offset of start of central\n\t * directory with respect to\n\t * the starting disk number 4 bytes\n\t * .ZIP file comment length 2 bytes\n\t * .ZIP file comment (variable size)\n\t */\n\tvar EndOfCentralDirectory = function EndOfCentralDirectory(data) {\n\t this.data = data;\n\t if (this.data.readUInt32LE(0) !== 0x06054b50) {\n\t throw new ApiError(ErrorCode.EINVAL, (\"Invalid Zip file: End of central directory record has invalid signature: \" + (this.data.readUInt32LE(0))));\n\t }\n\t };\n\t EndOfCentralDirectory.prototype.diskNumber = function diskNumber () { return this.data.readUInt16LE(4); };\n\t EndOfCentralDirectory.prototype.cdDiskNumber = function cdDiskNumber () { return this.data.readUInt16LE(6); };\n\t EndOfCentralDirectory.prototype.cdDiskEntryCount = function cdDiskEntryCount () { return this.data.readUInt16LE(8); };\n\t EndOfCentralDirectory.prototype.cdTotalEntryCount = function cdTotalEntryCount () { return this.data.readUInt16LE(10); };\n\t EndOfCentralDirectory.prototype.cdSize = function cdSize () { return this.data.readUInt32LE(12); };\n\t EndOfCentralDirectory.prototype.cdOffset = function cdOffset () { return this.data.readUInt32LE(16); };\n\t EndOfCentralDirectory.prototype.cdZipCommentLength = function cdZipCommentLength () { return this.data.readUInt16LE(20); };\n\t EndOfCentralDirectory.prototype.cdZipComment = function cdZipComment () {\n\t // Assuming UTF-8. The specification doesn't specify.\n\t return safeToString(this.data, true, 22, this.cdZipCommentLength());\n\t };\n\t EndOfCentralDirectory.prototype.rawCdZipComment = function rawCdZipComment () {\n\t return this.data.slice(22, 22 + this.cdZipCommentLength());\n\t };\n\t/**\n\t * Contains the table of contents of a Zip file.\n\t */\n\tvar ZipTOC = function ZipTOC(index, directoryEntries, eocd, data) {\n\t this.index = index;\n\t this.directoryEntries = directoryEntries;\n\t this.eocd = eocd;\n\t this.data = data;\n\t };\n\t/**\n\t * Zip file-backed filesystem\n\t * Implemented according to the standard:\n\t * http://www.pkware.com/documents/casestudies/APPNOTE.TXT\n\t *\n\t * While there are a few zip libraries for JavaScript (e.g. JSZip and zip.js),\n\t * they are not a good match for BrowserFS. In particular, these libraries\n\t * perform a lot of unneeded data copying, and eagerly decompress every file\n\t * in the zip file upon loading to check the CRC32. They also eagerly decode\n\t * strings. Furthermore, these libraries duplicate functionality already present\n\t * in BrowserFS (e.g. UTF-8 decoding and binary data manipulation).\n\t *\n\t * This filesystem takes advantage of BrowserFS's Buffer implementation, which\n\t * efficiently represents the zip file in memory (in both ArrayBuffer-enabled\n\t * browsers *and* non-ArrayBuffer browsers), and which can neatly be 'sliced'\n\t * without copying data. Each struct defined in the standard is represented with\n\t * a buffer slice pointing to an offset in the zip file, and has getters for\n\t * each field. As we anticipate that this data will not be read often, we choose\n\t * not to store each struct field in the JavaScript object; instead, to reduce\n\t * memory consumption, we retrieve it directly from the binary data each time it\n\t * is requested.\n\t *\n\t * When the filesystem is instantiated, we determine the directory structure\n\t * of the zip file as quickly as possible. We lazily decompress and check the\n\t * CRC32 of files. We do not cache decompressed files; if this is a desired\n\t * feature, it is best implemented as a generic file system wrapper that can\n\t * cache data from arbitrary file systems.\n\t *\n\t * For inflation, we use `pako`'s implementation:\n\t * https://github.com/nodeca/pako\n\t *\n\t * Current limitations:\n\t * * No encryption.\n\t * * No ZIP64 support.\n\t * * Read-only.\n\t * Write support would require that we:\n\t * - Keep track of changed/new files.\n\t * - Compress changed files, and generate appropriate metadata for each.\n\t * - Update file offsets for other files in the zip file.\n\t * - Stream it out to a location.\n\t * This isn't that bad, so we might do this at a later date.\n\t */\n\tvar ZipFS = (function (SynchronousFileSystem$$1) {\n\t function ZipFS(input, name, deprecateMsg) {\n\t if ( name === void 0 ) name = '';\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t SynchronousFileSystem$$1.call(this);\n\t this.name = name;\n\t this._index = new FileIndex();\n\t this._directoryEntries = [];\n\t this._eocd = null;\n\t deprecationMessage(deprecateMsg, ZipFS.Name, { zipData: \"zip data as a Buffer\", name: name });\n\t if (input instanceof ZipTOC) {\n\t this._index = input.index;\n\t this._directoryEntries = input.directoryEntries;\n\t this._eocd = input.eocd;\n\t this.data = input.data;\n\t }\n\t else {\n\t this.data = input;\n\t this.populateIndex();\n\t }\n\t }\n\t\n\t if ( SynchronousFileSystem$$1 ) ZipFS.__proto__ = SynchronousFileSystem$$1;\n\t ZipFS.prototype = Object.create( SynchronousFileSystem$$1 && SynchronousFileSystem$$1.prototype );\n\t ZipFS.prototype.constructor = ZipFS;\n\t /**\n\t * Constructs a ZipFS instance with the given options.\n\t */\n\t ZipFS.Create = function Create (opts, cb) {\n\t try {\n\t ZipFS.computeIndex(opts.zipData, function (zipTOC) {\n\t var fs = new ZipFS(zipTOC, opts.name, false);\n\t cb(null, fs);\n\t }, false);\n\t }\n\t catch (e) {\n\t cb(e);\n\t }\n\t };\n\t ZipFS.isAvailable = function isAvailable () { return true; };\n\t ZipFS.RegisterDecompressionMethod = function RegisterDecompressionMethod (m, fcn) {\n\t decompressionMethods[m] = fcn;\n\t };\n\t /**\n\t * **Deprecated. Please use ZipFS.Create() method instead.**\n\t */\n\t ZipFS.computeIndex = function computeIndex (data, cb, deprecateMsg) {\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t // TODO: Refactor to plumb errors through. Right now, they throw.\n\t if (deprecateMsg) {\n\t console.warn(\"[ZipFS] ZipFS.computeIndex is now deprecated, and will be removed in the next major release. Please update your code to use 'ZipFS.Create({ zipData: zip file as a Buffer}, cb)' instead.\");\n\t }\n\t var index = new FileIndex();\n\t var eocd = ZipFS.getEOCD(data);\n\t if (eocd.diskNumber() !== eocd.cdDiskNumber()) {\n\t throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support spanned zip files.\");\n\t }\n\t var cdPtr = eocd.cdOffset();\n\t if (cdPtr === 0xFFFFFFFF) {\n\t throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support Zip64.\");\n\t }\n\t var cdEnd = cdPtr + eocd.cdSize();\n\t ZipFS.computeIndexResponsive(data, index, cdPtr, cdEnd, cb, [], eocd);\n\t };\n\t /**\n\t * Locates the end of central directory record at the end of the file.\n\t * Throws an exception if it cannot be found.\n\t */\n\t ZipFS.getEOCD = function getEOCD (data) {\n\t // Unfortunately, the comment is variable size and up to 64K in size.\n\t // We assume that the magic signature does not appear in the comment, and\n\t // in the bytes between the comment and the signature. Other ZIP\n\t // implementations make this same assumption, since the alternative is to\n\t // read thread every entry in the file to get to it. :(\n\t // These are *negative* offsets from the end of the file.\n\t var startOffset = 22;\n\t var endOffset = Math.min(startOffset + 0xFFFF, data.length - 1);\n\t // There's not even a byte alignment guarantee on the comment so we need to\n\t // search byte by byte. *grumble grumble*\n\t for (var i = startOffset; i < endOffset; i++) {\n\t // Magic number: EOCD Signature\n\t if (data.readUInt32LE(data.length - i) === 0x06054b50) {\n\t return new EndOfCentralDirectory(data.slice(data.length - i));\n\t }\n\t }\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid ZIP file: Could not locate End of Central Directory signature.\");\n\t };\n\t ZipFS.addToIndex = function addToIndex (cd, index) {\n\t // Paths must be absolute, yet zip file paths are always relative to the\n\t // zip root. So we append '/' and call it a day.\n\t var filename = cd.fileName();\n\t if (filename.charAt(0) === '/') {\n\t throw new Error(\"WHY IS THIS ABSOLUTE\");\n\t }\n\t // XXX: For the file index, strip the trailing '/'.\n\t if (filename.charAt(filename.length - 1) === '/') {\n\t filename = filename.substr(0, filename.length - 1);\n\t }\n\t if (cd.isDirectory()) {\n\t index.addPathFast('/' + filename, new DirInode(cd));\n\t }\n\t else {\n\t index.addPathFast('/' + filename, new FileInode(cd));\n\t }\n\t };\n\t ZipFS.computeIndexResponsive = function computeIndexResponsive (data, index, cdPtr, cdEnd, cb, cdEntries, eocd) {\n\t if (cdPtr < cdEnd) {\n\t var count = 0;\n\t while (count++ < 200 && cdPtr < cdEnd) {\n\t var cd = new CentralDirectory(data, data.slice(cdPtr));\n\t ZipFS.addToIndex(cd, index);\n\t cdPtr += cd.totalSize();\n\t cdEntries.push(cd);\n\t }\n\t setImmediate$3(function () {\n\t ZipFS.computeIndexResponsive(data, index, cdPtr, cdEnd, cb, cdEntries, eocd);\n\t });\n\t }\n\t else {\n\t cb(new ZipTOC(index, cdEntries, eocd, data));\n\t }\n\t };\n\t ZipFS.prototype.getName = function getName () {\n\t return ZipFS.Name + (this.name !== '' ? (\" \" + (this.name)) : '');\n\t };\n\t /**\n\t * Get the CentralDirectory object for the given path.\n\t */\n\t ZipFS.prototype.getCentralDirectoryEntry = function getCentralDirectoryEntry (path$$1) {\n\t var inode = this._index.getInode(path$$1);\n\t if (inode === null) {\n\t throw ApiError.ENOENT(path$$1);\n\t }\n\t if (isFileInode(inode)) {\n\t return inode.getData();\n\t }\n\t else if (isDirInode(inode)) {\n\t return inode.getData();\n\t }\n\t else {\n\t // Should never occur.\n\t throw ApiError.EPERM((\"Invalid inode: \" + inode));\n\t }\n\t };\n\t ZipFS.prototype.getCentralDirectoryEntryAt = function getCentralDirectoryEntryAt (index) {\n\t var dirEntry = this._directoryEntries[index];\n\t if (!dirEntry) {\n\t throw new RangeError((\"Invalid directory index: \" + index + \".\"));\n\t }\n\t return dirEntry;\n\t };\n\t ZipFS.prototype.getNumberOfCentralDirectoryEntries = function getNumberOfCentralDirectoryEntries () {\n\t return this._directoryEntries.length;\n\t };\n\t ZipFS.prototype.getEndOfCentralDirectory = function getEndOfCentralDirectory () {\n\t return this._eocd;\n\t };\n\t ZipFS.prototype.diskSpace = function diskSpace (path$$1, cb) {\n\t // Read-only file system.\n\t cb(this.data.length, 0);\n\t };\n\t ZipFS.prototype.isReadOnly = function isReadOnly () {\n\t return true;\n\t };\n\t ZipFS.prototype.supportsLinks = function supportsLinks () {\n\t return false;\n\t };\n\t ZipFS.prototype.supportsProps = function supportsProps () {\n\t return false;\n\t };\n\t ZipFS.prototype.supportsSynch = function supportsSynch () {\n\t return true;\n\t };\n\t ZipFS.prototype.statSync = function statSync (path$$1, isLstat) {\n\t var inode = this._index.getInode(path$$1);\n\t if (inode === null) {\n\t throw ApiError.ENOENT(path$$1);\n\t }\n\t var stats;\n\t if (isFileInode(inode)) {\n\t stats = inode.getData().getStats();\n\t }\n\t else if (isDirInode(inode)) {\n\t stats = inode.getStats();\n\t }\n\t else {\n\t throw new ApiError(ErrorCode.EINVAL, \"Invalid inode.\");\n\t }\n\t return stats;\n\t };\n\t ZipFS.prototype.openSync = function openSync (path$$1, flags, mode) {\n\t // INVARIANT: Cannot write to RO file systems.\n\t if (flags.isWriteable()) {\n\t throw new ApiError(ErrorCode.EPERM, path$$1);\n\t }\n\t // Check if the path exists, and is a file.\n\t var inode = this._index.getInode(path$$1);\n\t if (!inode) {\n\t throw ApiError.ENOENT(path$$1);\n\t }\n\t else if (isFileInode(inode)) {\n\t var cdRecord = inode.getData();\n\t var stats = cdRecord.getStats();\n\t switch (flags.pathExistsAction()) {\n\t case ActionType.THROW_EXCEPTION:\n\t case ActionType.TRUNCATE_FILE:\n\t throw ApiError.EEXIST(path$$1);\n\t case ActionType.NOP:\n\t return new NoSyncFile(this, path$$1, flags, stats, cdRecord.getData());\n\t default:\n\t throw new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.');\n\t }\n\t }\n\t else {\n\t throw ApiError.EISDIR(path$$1);\n\t }\n\t };\n\t ZipFS.prototype.readdirSync = function readdirSync (path$$1) {\n\t // Check if it exists.\n\t var inode = this._index.getInode(path$$1);\n\t if (!inode) {\n\t throw ApiError.ENOENT(path$$1);\n\t }\n\t else if (isDirInode(inode)) {\n\t return inode.getListing();\n\t }\n\t else {\n\t throw ApiError.ENOTDIR(path$$1);\n\t }\n\t };\n\t /**\n\t * Specially-optimized readfile.\n\t */\n\t ZipFS.prototype.readFileSync = function readFileSync (fname, encoding, flag) {\n\t // Get file.\n\t var fd = this.openSync(fname, flag, 0x1a4);\n\t try {\n\t var fdCast = fd;\n\t var fdBuff = fdCast.getBuffer();\n\t if (encoding === null) {\n\t return copyingSlice(fdBuff);\n\t }\n\t return fdBuff.toString(encoding);\n\t }\n\t finally {\n\t fd.closeSync();\n\t }\n\t };\n\t ZipFS.prototype.populateIndex = function populateIndex () {\n\t var this$1 = this;\n\t\n\t var eocd = this._eocd = ZipFS.getEOCD(this.data);\n\t if (eocd.diskNumber() !== eocd.cdDiskNumber()) {\n\t throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support spanned zip files.\");\n\t }\n\t var cdPtr = eocd.cdOffset();\n\t if (cdPtr === 0xFFFFFFFF) {\n\t throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support Zip64.\");\n\t }\n\t var cdEnd = cdPtr + eocd.cdSize();\n\t while (cdPtr < cdEnd) {\n\t var cd = new CentralDirectory(this$1.data, this$1.data.slice(cdPtr));\n\t cdPtr += cd.totalSize();\n\t ZipFS.addToIndex(cd, this$1._index);\n\t this$1._directoryEntries.push(cd);\n\t }\n\t };\n\t\n\t return ZipFS;\n\t}(SynchronousFileSystem));\n\t\n\tZipFS.Name = \"ZipFS\";\n\tZipFS.Options = {\n\t zipData: {\n\t type: \"object\",\n\t description: \"The zip file as a Buffer object.\",\n\t validator: bufferValidator\n\t },\n\t name: {\n\t type: \"string\",\n\t optional: true,\n\t description: \"The name of the zip file (optional).\"\n\t }\n\t};\n\tZipFS.CompressionMethod = CompressionMethod;\n\tZipFS.RegisterDecompressionMethod(CompressionMethod.DEFLATE, function (data, compressedSize, uncompressedSize) {\n\t return arrayish2Buffer(inflateRaw(data.slice(0, compressedSize), { chunkSize: uncompressedSize }));\n\t});\n\tZipFS.RegisterDecompressionMethod(CompressionMethod.STORED, function (data, compressedSize, uncompressedSize) {\n\t return copyingSlice(data, 0, uncompressedSize);\n\t});\n\t\n\t/**\n\t * @hidden\n\t */\n\tvar rockRidgeIdentifier = \"IEEE_P1282\";\n\t/**\n\t * @hidden\n\t */\n\tfunction getASCIIString(data, startIndex, length) {\n\t return data.toString('ascii', startIndex, startIndex + length).trim();\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction getJolietString(data, startIndex, length) {\n\t if (length === 1) {\n\t // Special: Root, parent, current directory are still a single byte.\n\t return String.fromCharCode(data[startIndex]);\n\t }\n\t // UTF16-BE, which isn't natively supported by NodeJS Buffers.\n\t // Length should be even, but pessimistically floor just in case.\n\t var pairs = Math.floor(length / 2);\n\t var chars = new Array(pairs);\n\t for (var i = 0; i < pairs; i++) {\n\t var pos = startIndex + (i << 1);\n\t chars[i] = String.fromCharCode(data[pos + 1] | (data[pos] << 8));\n\t }\n\t return chars.join('');\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction getDate(data, startIndex) {\n\t var year = parseInt(getASCIIString(data, startIndex, 4), 10);\n\t var mon = parseInt(getASCIIString(data, startIndex + 4, 2), 10);\n\t var day = parseInt(getASCIIString(data, startIndex + 6, 2), 10);\n\t var hour = parseInt(getASCIIString(data, startIndex + 8, 2), 10);\n\t var min = parseInt(getASCIIString(data, startIndex + 10, 2), 10);\n\t var sec = parseInt(getASCIIString(data, startIndex + 12, 2), 10);\n\t var hundrethsSec = parseInt(getASCIIString(data, startIndex + 14, 2), 10);\n\t // Last is a time-zone offset, but JavaScript dates don't support time zones well.\n\t return new Date(year, mon, day, hour, min, sec, hundrethsSec * 100);\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction getShortFormDate(data, startIndex) {\n\t var yearsSince1900 = data[startIndex];\n\t var month = data[startIndex + 1];\n\t var day = data[startIndex + 2];\n\t var hour = data[startIndex + 3];\n\t var minute = data[startIndex + 4];\n\t var second = data[startIndex + 5];\n\t // JavaScript's Date support isn't so great; ignore timezone.\n\t // const offsetFromGMT = this._data[24];\n\t return new Date(yearsSince1900, month - 1, day, hour, minute, second);\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction constructSystemUseEntry(bigData, i) {\n\t var data = bigData.slice(i);\n\t var sue = new SystemUseEntry(data);\n\t switch (sue.signatureWord()) {\n\t case 17221 /* CE */:\n\t return new CEEntry(data);\n\t case 20548 /* PD */:\n\t return new PDEntry(data);\n\t case 21328 /* SP */:\n\t return new SPEntry(data);\n\t case 21332 /* ST */:\n\t return new STEntry(data);\n\t case 17746 /* ER */:\n\t return new EREntry(data);\n\t case 17747 /* ES */:\n\t return new ESEntry(data);\n\t case 20568 /* PX */:\n\t return new PXEntry(data);\n\t case 20558 /* PN */:\n\t return new PNEntry(data);\n\t case 21324 /* SL */:\n\t return new SLEntry(data);\n\t case 20045 /* NM */:\n\t return new NMEntry(data);\n\t case 17228 /* CL */:\n\t return new CLEntry(data);\n\t case 20556 /* PL */:\n\t return new PLEntry(data);\n\t case 21061 /* RE */:\n\t return new REEntry(data);\n\t case 21574 /* TF */:\n\t return new TFEntry(data);\n\t case 21318 /* SF */:\n\t return new SFEntry(data);\n\t case 21074 /* RR */:\n\t return new RREntry(data);\n\t default:\n\t return sue;\n\t }\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction constructSystemUseEntries(data, i, len, isoData) {\n\t // If the remaining allocated space following the last recorded System Use Entry in a System\n\t // Use field or Continuation Area is less than four bytes long, it cannot contain a System\n\t // Use Entry and shall be ignored\n\t len = len - 4;\n\t var entries = new Array();\n\t while (i < len) {\n\t var entry = constructSystemUseEntry(data, i);\n\t var length = entry.length();\n\t if (length === 0) {\n\t // Invalid SU section; prevent infinite loop.\n\t return entries;\n\t }\n\t i += length;\n\t if (entry instanceof STEntry) {\n\t // ST indicates the end of entries.\n\t break;\n\t }\n\t if (entry instanceof CEEntry) {\n\t entries = entries.concat(entry.getEntries(isoData));\n\t }\n\t else {\n\t entries.push(entry);\n\t }\n\t }\n\t return entries;\n\t}\n\t/**\n\t * @hidden\n\t */\n\tvar VolumeDescriptor = function VolumeDescriptor(data) {\n\t this._data = data;\n\t};\n\tVolumeDescriptor.prototype.type = function type () {\n\t return this._data[0];\n\t};\n\tVolumeDescriptor.prototype.standardIdentifier = function standardIdentifier () {\n\t return getASCIIString(this._data, 1, 5);\n\t};\n\tVolumeDescriptor.prototype.version = function version () {\n\t return this._data[6];\n\t};\n\tVolumeDescriptor.prototype.data = function data () {\n\t return this._data.slice(7, 2048);\n\t};\n\t/**\n\t * @hidden\n\t */\n\tvar PrimaryOrSupplementaryVolumeDescriptor = (function (VolumeDescriptor) {\n\t function PrimaryOrSupplementaryVolumeDescriptor(data) {\n\t VolumeDescriptor.call(this, data);\n\t this._root = null;\n\t }\n\t\n\t if ( VolumeDescriptor ) PrimaryOrSupplementaryVolumeDescriptor.__proto__ = VolumeDescriptor;\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype = Object.create( VolumeDescriptor && VolumeDescriptor.prototype );\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.constructor = PrimaryOrSupplementaryVolumeDescriptor;\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.systemIdentifier = function systemIdentifier () {\n\t return this._getString32(8);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.volumeIdentifier = function volumeIdentifier () {\n\t return this._getString32(40);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.volumeSpaceSize = function volumeSpaceSize () {\n\t return this._data.readUInt32LE(80);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.volumeSetSize = function volumeSetSize () {\n\t return this._data.readUInt16LE(120);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.volumeSequenceNumber = function volumeSequenceNumber () {\n\t return this._data.readUInt16LE(124);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.logicalBlockSize = function logicalBlockSize () {\n\t return this._data.readUInt16LE(128);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.pathTableSize = function pathTableSize () {\n\t return this._data.readUInt32LE(132);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.locationOfTypeLPathTable = function locationOfTypeLPathTable () {\n\t return this._data.readUInt32LE(140);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.locationOfOptionalTypeLPathTable = function locationOfOptionalTypeLPathTable () {\n\t return this._data.readUInt32LE(144);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.locationOfTypeMPathTable = function locationOfTypeMPathTable () {\n\t return this._data.readUInt32BE(148);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.locationOfOptionalTypeMPathTable = function locationOfOptionalTypeMPathTable () {\n\t return this._data.readUInt32BE(152);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.rootDirectoryEntry = function rootDirectoryEntry (isoData) {\n\t if (this._root === null) {\n\t this._root = this._constructRootDirectoryRecord(this._data.slice(156));\n\t this._root.rootCheckForRockRidge(isoData);\n\t }\n\t return this._root;\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.volumeSetIdentifier = function volumeSetIdentifier () {\n\t return this._getString(190, 128);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.publisherIdentifier = function publisherIdentifier () {\n\t return this._getString(318, 128);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.dataPreparerIdentifier = function dataPreparerIdentifier () {\n\t return this._getString(446, 128);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.applicationIdentifier = function applicationIdentifier () {\n\t return this._getString(574, 128);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.copyrightFileIdentifier = function copyrightFileIdentifier () {\n\t return this._getString(702, 38);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.abstractFileIdentifier = function abstractFileIdentifier () {\n\t return this._getString(740, 36);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.bibliographicFileIdentifier = function bibliographicFileIdentifier () {\n\t return this._getString(776, 37);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.volumeCreationDate = function volumeCreationDate () {\n\t return getDate(this._data, 813);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.volumeModificationDate = function volumeModificationDate () {\n\t return getDate(this._data, 830);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.volumeExpirationDate = function volumeExpirationDate () {\n\t return getDate(this._data, 847);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.volumeEffectiveDate = function volumeEffectiveDate () {\n\t return getDate(this._data, 864);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.fileStructureVersion = function fileStructureVersion () {\n\t return this._data[881];\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.applicationUsed = function applicationUsed () {\n\t return this._data.slice(883, 883 + 512);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype.reserved = function reserved () {\n\t return this._data.slice(1395, 1395 + 653);\n\t };\n\t PrimaryOrSupplementaryVolumeDescriptor.prototype._getString32 = function _getString32 (idx) {\n\t return this._getString(idx, 32);\n\t };\n\t\n\t return PrimaryOrSupplementaryVolumeDescriptor;\n\t}(VolumeDescriptor));\n\t/**\n\t * @hidden\n\t */\n\tvar PrimaryVolumeDescriptor = (function (PrimaryOrSupplementaryVolumeDescriptor) {\n\t function PrimaryVolumeDescriptor(data) {\n\t PrimaryOrSupplementaryVolumeDescriptor.call(this, data);\n\t if (this.type() !== 1 /* PrimaryVolumeDescriptor */) {\n\t throw new ApiError(ErrorCode.EIO, \"Invalid primary volume descriptor.\");\n\t }\n\t }\n\t\n\t if ( PrimaryOrSupplementaryVolumeDescriptor ) PrimaryVolumeDescriptor.__proto__ = PrimaryOrSupplementaryVolumeDescriptor;\n\t PrimaryVolumeDescriptor.prototype = Object.create( PrimaryOrSupplementaryVolumeDescriptor && PrimaryOrSupplementaryVolumeDescriptor.prototype );\n\t PrimaryVolumeDescriptor.prototype.constructor = PrimaryVolumeDescriptor;\n\t PrimaryVolumeDescriptor.prototype.name = function name () {\n\t return \"ISO9660\";\n\t };\n\t PrimaryVolumeDescriptor.prototype._constructRootDirectoryRecord = function _constructRootDirectoryRecord (data) {\n\t return new ISODirectoryRecord(data, -1);\n\t };\n\t PrimaryVolumeDescriptor.prototype._getString = function _getString (idx, len) {\n\t return this._getString(idx, len);\n\t };\n\t\n\t return PrimaryVolumeDescriptor;\n\t}(PrimaryOrSupplementaryVolumeDescriptor));\n\t/**\n\t * @hidden\n\t */\n\tvar SupplementaryVolumeDescriptor = (function (PrimaryOrSupplementaryVolumeDescriptor) {\n\t function SupplementaryVolumeDescriptor(data) {\n\t PrimaryOrSupplementaryVolumeDescriptor.call(this, data);\n\t if (this.type() !== 2 /* SupplementaryVolumeDescriptor */) {\n\t throw new ApiError(ErrorCode.EIO, \"Invalid supplementary volume descriptor.\");\n\t }\n\t var escapeSequence = this.escapeSequence();\n\t var third = escapeSequence[2];\n\t // Third character identifies what 'level' of the UCS specification to follow.\n\t // We ignore it.\n\t if (escapeSequence[0] !== 0x25 || escapeSequence[1] !== 0x2F ||\n\t (third !== 0x40 && third !== 0x43 && third !== 0x45)) {\n\t throw new ApiError(ErrorCode.EIO, (\"Unrecognized escape sequence for SupplementaryVolumeDescriptor: \" + (escapeSequence.toString())));\n\t }\n\t }\n\t\n\t if ( PrimaryOrSupplementaryVolumeDescriptor ) SupplementaryVolumeDescriptor.__proto__ = PrimaryOrSupplementaryVolumeDescriptor;\n\t SupplementaryVolumeDescriptor.prototype = Object.create( PrimaryOrSupplementaryVolumeDescriptor && PrimaryOrSupplementaryVolumeDescriptor.prototype );\n\t SupplementaryVolumeDescriptor.prototype.constructor = SupplementaryVolumeDescriptor;\n\t SupplementaryVolumeDescriptor.prototype.name = function name () {\n\t return \"Joliet\";\n\t };\n\t SupplementaryVolumeDescriptor.prototype.escapeSequence = function escapeSequence () {\n\t return this._data.slice(88, 120);\n\t };\n\t SupplementaryVolumeDescriptor.prototype._constructRootDirectoryRecord = function _constructRootDirectoryRecord (data) {\n\t return new JolietDirectoryRecord(data, -1);\n\t };\n\t SupplementaryVolumeDescriptor.prototype._getString = function _getString (idx, len) {\n\t return getJolietString(this._data, idx, len);\n\t };\n\t\n\t return SupplementaryVolumeDescriptor;\n\t}(PrimaryOrSupplementaryVolumeDescriptor));\n\t/**\n\t * @hidden\n\t */\n\tvar DirectoryRecord = function DirectoryRecord(data, rockRidgeOffset) {\n\t this._suEntries = null;\n\t this._fileOrDir = null;\n\t this._data = data;\n\t this._rockRidgeOffset = rockRidgeOffset;\n\t};\n\tDirectoryRecord.prototype.hasRockRidge = function hasRockRidge () {\n\t return this._rockRidgeOffset > -1;\n\t};\n\tDirectoryRecord.prototype.getRockRidgeOffset = function getRockRidgeOffset () {\n\t return this._rockRidgeOffset;\n\t};\n\t/**\n\t * !!ONLY VALID ON ROOT NODE!!\n\t * Checks if Rock Ridge is enabled, and sets the offset.\n\t */\n\tDirectoryRecord.prototype.rootCheckForRockRidge = function rootCheckForRockRidge (isoData) {\n\t var dir = this.getDirectory(isoData);\n\t this._rockRidgeOffset = dir.getDotEntry(isoData)._getRockRidgeOffset(isoData);\n\t if (this._rockRidgeOffset > -1) {\n\t // Wipe out directory. Start over with RR knowledge.\n\t this._fileOrDir = null;\n\t }\n\t};\n\tDirectoryRecord.prototype.length = function length () {\n\t return this._data[0];\n\t};\n\tDirectoryRecord.prototype.extendedAttributeRecordLength = function extendedAttributeRecordLength () {\n\t return this._data[1];\n\t};\n\tDirectoryRecord.prototype.lba = function lba () {\n\t return this._data.readUInt32LE(2) * 2048;\n\t};\n\tDirectoryRecord.prototype.dataLength = function dataLength () {\n\t return this._data.readUInt32LE(10);\n\t};\n\tDirectoryRecord.prototype.recordingDate = function recordingDate () {\n\t return getShortFormDate(this._data, 18);\n\t};\n\tDirectoryRecord.prototype.fileFlags = function fileFlags () {\n\t return this._data[25];\n\t};\n\tDirectoryRecord.prototype.fileUnitSize = function fileUnitSize () {\n\t return this._data[26];\n\t};\n\tDirectoryRecord.prototype.interleaveGapSize = function interleaveGapSize () {\n\t return this._data[27];\n\t};\n\tDirectoryRecord.prototype.volumeSequenceNumber = function volumeSequenceNumber () {\n\t return this._data.readUInt16LE(28);\n\t};\n\tDirectoryRecord.prototype.identifier = function identifier () {\n\t return this._getString(33, this._data[32]);\n\t};\n\tDirectoryRecord.prototype.fileName = function fileName (isoData) {\n\t if (this.hasRockRidge()) {\n\t var fn = this._rockRidgeFilename(isoData);\n\t if (fn !== null) {\n\t return fn;\n\t }\n\t }\n\t var ident = this.identifier();\n\t if (this.isDirectory(isoData)) {\n\t return ident;\n\t }\n\t // Files:\n\t // - MUST have 0x2E (.) separating the name from the extension\n\t // - MUST have 0x3B (;) separating the file name and extension from the version\n\t // Gets expanded to two-byte char in Unicode directory records.\n\t var versionSeparator = ident.indexOf(';');\n\t if (versionSeparator === -1) {\n\t // Some Joliet filenames lack the version separator, despite the standard\n\t // specifying that it should be there.\n\t return ident;\n\t }\n\t else if (ident[versionSeparator - 1] === '.') {\n\t // Empty extension. Do not include '.' in the filename.\n\t return ident.slice(0, versionSeparator - 1);\n\t }\n\t else {\n\t // Include up to version separator.\n\t return ident.slice(0, versionSeparator);\n\t }\n\t};\n\tDirectoryRecord.prototype.isDirectory = function isDirectory (isoData) {\n\t var rv = !!(this.fileFlags() & 2 /* Directory */);\n\t // If it lacks the Directory flag, it may still be a directory if we've exceeded the directory\n\t // depth limit. Rock Ridge marks these as files and adds a special attribute.\n\t if (!rv && this.hasRockRidge()) {\n\t rv = this.getSUEntries(isoData).filter(function (e) { return e instanceof CLEntry; }).length > 0;\n\t }\n\t return rv;\n\t};\n\tDirectoryRecord.prototype.isSymlink = function isSymlink (isoData) {\n\t return this.hasRockRidge() && this.getSUEntries(isoData).filter(function (e) { return e instanceof SLEntry; }).length > 0;\n\t};\n\tDirectoryRecord.prototype.getSymlinkPath = function getSymlinkPath (isoData) {\n\t var p = \"\";\n\t var entries = this.getSUEntries(isoData);\n\t var getStr = this._getGetString();\n\t for (var i = 0, list = entries; i < list.length; i += 1) {\n\t var entry = list[i];\n\t\n\t if (entry instanceof SLEntry) {\n\t var components = entry.componentRecords();\n\t for (var i$1 = 0, list$1 = components; i$1 < list$1.length; i$1 += 1) {\n\t var component = list$1[i$1];\n\t\n\t var flags = component.flags();\n\t if (flags & 2 /* CURRENT */) {\n\t p += \"./\";\n\t }\n\t else if (flags & 4 /* PARENT */) {\n\t p += \"../\";\n\t }\n\t else if (flags & 8 /* ROOT */) {\n\t p += \"/\";\n\t }\n\t else {\n\t p += component.content(getStr);\n\t if (!(flags & 1 /* CONTINUE */)) {\n\t p += '/';\n\t }\n\t }\n\t }\n\t if (!entry.continueFlag()) {\n\t // We are done with this link.\n\t break;\n\t }\n\t }\n\t }\n\t if (p.length > 1 && p[p.length - 1] === '/') {\n\t // Trim trailing '/'.\n\t return p.slice(0, p.length - 1);\n\t }\n\t else {\n\t return p;\n\t }\n\t};\n\tDirectoryRecord.prototype.getFile = function getFile (isoData) {\n\t if (this.isDirectory(isoData)) {\n\t throw new Error(\"Tried to get a File from a directory.\");\n\t }\n\t if (this._fileOrDir === null) {\n\t this._fileOrDir = isoData.slice(this.lba(), this.lba() + this.dataLength());\n\t }\n\t return this._fileOrDir;\n\t};\n\tDirectoryRecord.prototype.getDirectory = function getDirectory (isoData) {\n\t if (!this.isDirectory(isoData)) {\n\t throw new Error(\"Tried to get a Directory from a file.\");\n\t }\n\t if (this._fileOrDir === null) {\n\t this._fileOrDir = this._constructDirectory(isoData);\n\t }\n\t return this._fileOrDir;\n\t};\n\tDirectoryRecord.prototype.getSUEntries = function getSUEntries (isoData) {\n\t if (!this._suEntries) {\n\t this._constructSUEntries(isoData);\n\t }\n\t return this._suEntries;\n\t};\n\tDirectoryRecord.prototype._rockRidgeFilename = function _rockRidgeFilename (isoData) {\n\t var nmEntries = this.getSUEntries(isoData).filter(function (e) { return e instanceof NMEntry; });\n\t if (nmEntries.length === 0 || nmEntries[0].flags() & (2 /* CURRENT */ | 4 /* PARENT */)) {\n\t return null;\n\t }\n\t var str = '';\n\t var getString = this._getGetString();\n\t for (var i = 0, list = nmEntries; i < list.length; i += 1) {\n\t var e = list[i];\n\t\n\t str += e.name(getString);\n\t if (!(e.flags() & 1 /* CONTINUE */)) {\n\t break;\n\t }\n\t }\n\t return str;\n\t};\n\tDirectoryRecord.prototype._constructSUEntries = function _constructSUEntries (isoData) {\n\t var i = 33 + this._data[32];\n\t if (i % 2 === 1) {\n\t // Skip padding field.\n\t i++;\n\t }\n\t i += this._rockRidgeOffset;\n\t this._suEntries = constructSystemUseEntries(this._data, i, this.length(), isoData);\n\t};\n\t/**\n\t * !!ONLY VALID ON FIRST ENTRY OF ROOT DIRECTORY!!\n\t * Returns -1 if rock ridge is not enabled. Otherwise, returns the offset\n\t * at which system use fields begin.\n\t */\n\tDirectoryRecord.prototype._getRockRidgeOffset = function _getRockRidgeOffset (isoData) {\n\t // In the worst case, we get some garbage SU entries.\n\t // Fudge offset to 0 before proceeding.\n\t this._rockRidgeOffset = 0;\n\t var suEntries = this.getSUEntries(isoData);\n\t if (suEntries.length > 0) {\n\t var spEntry = suEntries[0];\n\t if (spEntry instanceof SPEntry && spEntry.checkBytesPass()) {\n\t // SUSP is in use.\n\t for (var i = 1; i < suEntries.length; i++) {\n\t var entry = suEntries[i];\n\t if (entry instanceof RREntry || (entry instanceof EREntry && entry.extensionIdentifier() === rockRidgeIdentifier)) {\n\t // Rock Ridge is in use!\n\t return spEntry.bytesSkipped();\n\t }\n\t }\n\t }\n\t }\n\t // Failed.\n\t this._rockRidgeOffset = -1;\n\t return -1;\n\t};\n\t/**\n\t * @hidden\n\t */\n\tvar ISODirectoryRecord = (function (DirectoryRecord) {\n\t function ISODirectoryRecord(data, rockRidgeOffset) {\n\t DirectoryRecord.call(this, data, rockRidgeOffset);\n\t }\n\t\n\t if ( DirectoryRecord ) ISODirectoryRecord.__proto__ = DirectoryRecord;\n\t ISODirectoryRecord.prototype = Object.create( DirectoryRecord && DirectoryRecord.prototype );\n\t ISODirectoryRecord.prototype.constructor = ISODirectoryRecord;\n\t ISODirectoryRecord.prototype._getString = function _getString (i, len) {\n\t return getASCIIString(this._data, i, len);\n\t };\n\t ISODirectoryRecord.prototype._constructDirectory = function _constructDirectory (isoData) {\n\t return new ISODirectory(this, isoData);\n\t };\n\t ISODirectoryRecord.prototype._getGetString = function _getGetString () {\n\t return getASCIIString;\n\t };\n\t\n\t return ISODirectoryRecord;\n\t}(DirectoryRecord));\n\t/**\n\t * @hidden\n\t */\n\tvar JolietDirectoryRecord = (function (DirectoryRecord) {\n\t function JolietDirectoryRecord(data, rockRidgeOffset) {\n\t DirectoryRecord.call(this, data, rockRidgeOffset);\n\t }\n\t\n\t if ( DirectoryRecord ) JolietDirectoryRecord.__proto__ = DirectoryRecord;\n\t JolietDirectoryRecord.prototype = Object.create( DirectoryRecord && DirectoryRecord.prototype );\n\t JolietDirectoryRecord.prototype.constructor = JolietDirectoryRecord;\n\t JolietDirectoryRecord.prototype._getString = function _getString (i, len) {\n\t return getJolietString(this._data, i, len);\n\t };\n\t JolietDirectoryRecord.prototype._constructDirectory = function _constructDirectory (isoData) {\n\t return new JolietDirectory(this, isoData);\n\t };\n\t JolietDirectoryRecord.prototype._getGetString = function _getGetString () {\n\t return getJolietString;\n\t };\n\t\n\t return JolietDirectoryRecord;\n\t}(DirectoryRecord));\n\t/**\n\t * @hidden\n\t */\n\tvar SystemUseEntry = function SystemUseEntry(data) {\n\t this._data = data;\n\t};\n\tSystemUseEntry.prototype.signatureWord = function signatureWord () {\n\t return this._data.readUInt16BE(0);\n\t};\n\tSystemUseEntry.prototype.signatureWordString = function signatureWordString () {\n\t return getASCIIString(this._data, 0, 2);\n\t};\n\tSystemUseEntry.prototype.length = function length () {\n\t return this._data[2];\n\t};\n\tSystemUseEntry.prototype.suVersion = function suVersion () {\n\t return this._data[3];\n\t};\n\t/**\n\t * Continuation entry.\n\t * @hidden\n\t */\n\tvar CEEntry = (function (SystemUseEntry) {\n\t function CEEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t this._entries = null;\n\t }\n\t\n\t if ( SystemUseEntry ) CEEntry.__proto__ = SystemUseEntry;\n\t CEEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t CEEntry.prototype.constructor = CEEntry;\n\t /**\n\t * Logical block address of the continuation area.\n\t */\n\t CEEntry.prototype.continuationLba = function continuationLba () {\n\t return this._data.readUInt32LE(4);\n\t };\n\t /**\n\t * Offset into the logical block.\n\t */\n\t CEEntry.prototype.continuationLbaOffset = function continuationLbaOffset () {\n\t return this._data.readUInt32LE(12);\n\t };\n\t /**\n\t * Length of the continuation area.\n\t */\n\t CEEntry.prototype.continuationLength = function continuationLength () {\n\t return this._data.readUInt32LE(20);\n\t };\n\t CEEntry.prototype.getEntries = function getEntries (isoData) {\n\t if (!this._entries) {\n\t var start = this.continuationLba() * 2048 + this.continuationLbaOffset();\n\t this._entries = constructSystemUseEntries(isoData, start, this.continuationLength(), isoData);\n\t }\n\t return this._entries;\n\t };\n\t\n\t return CEEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * Padding entry.\n\t * @hidden\n\t */\n\tvar PDEntry = (function (SystemUseEntry) {\n\t function PDEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) PDEntry.__proto__ = SystemUseEntry;\n\t PDEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t PDEntry.prototype.constructor = PDEntry;\n\t\n\t return PDEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * Identifies that SUSP is in-use.\n\t * @hidden\n\t */\n\tvar SPEntry = (function (SystemUseEntry) {\n\t function SPEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) SPEntry.__proto__ = SystemUseEntry;\n\t SPEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t SPEntry.prototype.constructor = SPEntry;\n\t SPEntry.prototype.checkBytesPass = function checkBytesPass () {\n\t return this._data[4] === 0xBE && this._data[5] === 0xEF;\n\t };\n\t SPEntry.prototype.bytesSkipped = function bytesSkipped () {\n\t return this._data[6];\n\t };\n\t\n\t return SPEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * Identifies the end of the SUSP entries.\n\t * @hidden\n\t */\n\tvar STEntry = (function (SystemUseEntry) {\n\t function STEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) STEntry.__proto__ = SystemUseEntry;\n\t STEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t STEntry.prototype.constructor = STEntry;\n\t\n\t return STEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * Specifies system-specific extensions to SUSP.\n\t * @hidden\n\t */\n\tvar EREntry = (function (SystemUseEntry) {\n\t function EREntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) EREntry.__proto__ = SystemUseEntry;\n\t EREntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t EREntry.prototype.constructor = EREntry;\n\t EREntry.prototype.identifierLength = function identifierLength () {\n\t return this._data[4];\n\t };\n\t EREntry.prototype.descriptorLength = function descriptorLength () {\n\t return this._data[5];\n\t };\n\t EREntry.prototype.sourceLength = function sourceLength () {\n\t return this._data[6];\n\t };\n\t EREntry.prototype.extensionVersion = function extensionVersion () {\n\t return this._data[7];\n\t };\n\t EREntry.prototype.extensionIdentifier = function extensionIdentifier () {\n\t return getASCIIString(this._data, 8, this.identifierLength());\n\t };\n\t EREntry.prototype.extensionDescriptor = function extensionDescriptor () {\n\t return getASCIIString(this._data, 8 + this.identifierLength(), this.descriptorLength());\n\t };\n\t EREntry.prototype.extensionSource = function extensionSource () {\n\t return getASCIIString(this._data, 8 + this.identifierLength() + this.descriptorLength(), this.sourceLength());\n\t };\n\t\n\t return EREntry;\n\t}(SystemUseEntry));\n\t/**\n\t * @hidden\n\t */\n\tvar ESEntry = (function (SystemUseEntry) {\n\t function ESEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) ESEntry.__proto__ = SystemUseEntry;\n\t ESEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t ESEntry.prototype.constructor = ESEntry;\n\t ESEntry.prototype.extensionSequence = function extensionSequence () {\n\t return this._data[4];\n\t };\n\t\n\t return ESEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * RockRidge: Marks that RockRidge is in use [deprecated]\n\t * @hidden\n\t */\n\tvar RREntry = (function (SystemUseEntry) {\n\t function RREntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) RREntry.__proto__ = SystemUseEntry;\n\t RREntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t RREntry.prototype.constructor = RREntry;\n\t\n\t return RREntry;\n\t}(SystemUseEntry));\n\t/**\n\t * RockRidge: Records POSIX file attributes.\n\t * @hidden\n\t */\n\tvar PXEntry = (function (SystemUseEntry) {\n\t function PXEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) PXEntry.__proto__ = SystemUseEntry;\n\t PXEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t PXEntry.prototype.constructor = PXEntry;\n\t PXEntry.prototype.mode = function mode () {\n\t return this._data.readUInt32LE(4);\n\t };\n\t PXEntry.prototype.fileLinks = function fileLinks () {\n\t return this._data.readUInt32LE(12);\n\t };\n\t PXEntry.prototype.uid = function uid () {\n\t return this._data.readUInt32LE(20);\n\t };\n\t PXEntry.prototype.gid = function gid () {\n\t return this._data.readUInt32LE(28);\n\t };\n\t PXEntry.prototype.inode = function inode () {\n\t return this._data.readUInt32LE(36);\n\t };\n\t\n\t return PXEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * RockRidge: Records POSIX device number.\n\t * @hidden\n\t */\n\tvar PNEntry = (function (SystemUseEntry) {\n\t function PNEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) PNEntry.__proto__ = SystemUseEntry;\n\t PNEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t PNEntry.prototype.constructor = PNEntry;\n\t PNEntry.prototype.devTHigh = function devTHigh () {\n\t return this._data.readUInt32LE(4);\n\t };\n\t PNEntry.prototype.devTLow = function devTLow () {\n\t return this._data.readUInt32LE(12);\n\t };\n\t\n\t return PNEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * RockRidge: Records symbolic link\n\t * @hidden\n\t */\n\tvar SLEntry = (function (SystemUseEntry) {\n\t function SLEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) SLEntry.__proto__ = SystemUseEntry;\n\t SLEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t SLEntry.prototype.constructor = SLEntry;\n\t SLEntry.prototype.flags = function flags () {\n\t return this._data[4];\n\t };\n\t SLEntry.prototype.continueFlag = function continueFlag () {\n\t return this.flags() & 0x1;\n\t };\n\t SLEntry.prototype.componentRecords = function componentRecords () {\n\t var this$1 = this;\n\t\n\t var records = new Array();\n\t var i = 5;\n\t while (i < this.length()) {\n\t var record = new SLComponentRecord(this$1._data.slice(i));\n\t records.push(record);\n\t i += record.length();\n\t }\n\t return records;\n\t };\n\t\n\t return SLEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * @hidden\n\t */\n\tvar SLComponentRecord = function SLComponentRecord(data) {\n\t this._data = data;\n\t};\n\tSLComponentRecord.prototype.flags = function flags () {\n\t return this._data[0];\n\t};\n\tSLComponentRecord.prototype.length = function length () {\n\t return 2 + this.componentLength();\n\t};\n\tSLComponentRecord.prototype.componentLength = function componentLength () {\n\t return this._data[1];\n\t};\n\tSLComponentRecord.prototype.content = function content (getString) {\n\t return getString(this._data, 2, this.componentLength());\n\t};\n\t/**\n\t * RockRidge: Records alternate file name\n\t * @hidden\n\t */\n\tvar NMEntry = (function (SystemUseEntry) {\n\t function NMEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) NMEntry.__proto__ = SystemUseEntry;\n\t NMEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t NMEntry.prototype.constructor = NMEntry;\n\t NMEntry.prototype.flags = function flags () {\n\t return this._data[4];\n\t };\n\t NMEntry.prototype.name = function name (getString) {\n\t return getString(this._data, 5, this.length() - 5);\n\t };\n\t\n\t return NMEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * RockRidge: Records child link\n\t * @hidden\n\t */\n\tvar CLEntry = (function (SystemUseEntry) {\n\t function CLEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) CLEntry.__proto__ = SystemUseEntry;\n\t CLEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t CLEntry.prototype.constructor = CLEntry;\n\t CLEntry.prototype.childDirectoryLba = function childDirectoryLba () {\n\t return this._data.readUInt32LE(4);\n\t };\n\t\n\t return CLEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * RockRidge: Records parent link.\n\t * @hidden\n\t */\n\tvar PLEntry = (function (SystemUseEntry) {\n\t function PLEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) PLEntry.__proto__ = SystemUseEntry;\n\t PLEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t PLEntry.prototype.constructor = PLEntry;\n\t PLEntry.prototype.parentDirectoryLba = function parentDirectoryLba () {\n\t return this._data.readUInt32LE(4);\n\t };\n\t\n\t return PLEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * RockRidge: Records relocated directory.\n\t * @hidden\n\t */\n\tvar REEntry = (function (SystemUseEntry) {\n\t function REEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) REEntry.__proto__ = SystemUseEntry;\n\t REEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t REEntry.prototype.constructor = REEntry;\n\t\n\t return REEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * RockRidge: Records file timestamps\n\t * @hidden\n\t */\n\tvar TFEntry = (function (SystemUseEntry) {\n\t function TFEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) TFEntry.__proto__ = SystemUseEntry;\n\t TFEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t TFEntry.prototype.constructor = TFEntry;\n\t TFEntry.prototype.flags = function flags () {\n\t return this._data[4];\n\t };\n\t TFEntry.prototype.creation = function creation () {\n\t if (this.flags() & 1 /* CREATION */) {\n\t if (this._longFormDates()) {\n\t return getDate(this._data, 5);\n\t }\n\t else {\n\t return getShortFormDate(this._data, 5);\n\t }\n\t }\n\t else {\n\t return null;\n\t }\n\t };\n\t TFEntry.prototype.modify = function modify () {\n\t if (this.flags() & 2 /* MODIFY */) {\n\t var previousDates = (this.flags() & 1 /* CREATION */) ? 1 : 0;\n\t if (this._longFormDates) {\n\t return getDate(this._data, 5 + (previousDates * 17));\n\t }\n\t else {\n\t return getShortFormDate(this._data, 5 + (previousDates * 7));\n\t }\n\t }\n\t else {\n\t return null;\n\t }\n\t };\n\t TFEntry.prototype.access = function access () {\n\t if (this.flags() & 4 /* ACCESS */) {\n\t var previousDates = (this.flags() & 1 /* CREATION */) ? 1 : 0;\n\t previousDates += (this.flags() & 2 /* MODIFY */) ? 1 : 0;\n\t if (this._longFormDates) {\n\t return getDate(this._data, 5 + (previousDates * 17));\n\t }\n\t else {\n\t return getShortFormDate(this._data, 5 + (previousDates * 7));\n\t }\n\t }\n\t else {\n\t return null;\n\t }\n\t };\n\t TFEntry.prototype.backup = function backup () {\n\t if (this.flags() & 16 /* BACKUP */) {\n\t var previousDates = (this.flags() & 1 /* CREATION */) ? 1 : 0;\n\t previousDates += (this.flags() & 2 /* MODIFY */) ? 1 : 0;\n\t previousDates += (this.flags() & 4 /* ACCESS */) ? 1 : 0;\n\t if (this._longFormDates) {\n\t return getDate(this._data, 5 + (previousDates * 17));\n\t }\n\t else {\n\t return getShortFormDate(this._data, 5 + (previousDates * 7));\n\t }\n\t }\n\t else {\n\t return null;\n\t }\n\t };\n\t TFEntry.prototype.expiration = function expiration () {\n\t if (this.flags() & 32 /* EXPIRATION */) {\n\t var previousDates = (this.flags() & 1 /* CREATION */) ? 1 : 0;\n\t previousDates += (this.flags() & 2 /* MODIFY */) ? 1 : 0;\n\t previousDates += (this.flags() & 4 /* ACCESS */) ? 1 : 0;\n\t previousDates += (this.flags() & 16 /* BACKUP */) ? 1 : 0;\n\t if (this._longFormDates) {\n\t return getDate(this._data, 5 + (previousDates * 17));\n\t }\n\t else {\n\t return getShortFormDate(this._data, 5 + (previousDates * 7));\n\t }\n\t }\n\t else {\n\t return null;\n\t }\n\t };\n\t TFEntry.prototype.effective = function effective () {\n\t if (this.flags() & 64 /* EFFECTIVE */) {\n\t var previousDates = (this.flags() & 1 /* CREATION */) ? 1 : 0;\n\t previousDates += (this.flags() & 2 /* MODIFY */) ? 1 : 0;\n\t previousDates += (this.flags() & 4 /* ACCESS */) ? 1 : 0;\n\t previousDates += (this.flags() & 16 /* BACKUP */) ? 1 : 0;\n\t previousDates += (this.flags() & 32 /* EXPIRATION */) ? 1 : 0;\n\t if (this._longFormDates) {\n\t return getDate(this._data, 5 + (previousDates * 17));\n\t }\n\t else {\n\t return getShortFormDate(this._data, 5 + (previousDates * 7));\n\t }\n\t }\n\t else {\n\t return null;\n\t }\n\t };\n\t TFEntry.prototype._longFormDates = function _longFormDates () {\n\t return !!(this.flags() && 128 /* LONG_FORM */);\n\t };\n\t\n\t return TFEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * RockRidge: File data in sparse format.\n\t * @hidden\n\t */\n\tvar SFEntry = (function (SystemUseEntry) {\n\t function SFEntry(data) {\n\t SystemUseEntry.call(this, data);\n\t }\n\t\n\t if ( SystemUseEntry ) SFEntry.__proto__ = SystemUseEntry;\n\t SFEntry.prototype = Object.create( SystemUseEntry && SystemUseEntry.prototype );\n\t SFEntry.prototype.constructor = SFEntry;\n\t SFEntry.prototype.virtualSizeHigh = function virtualSizeHigh () {\n\t return this._data.readUInt32LE(4);\n\t };\n\t SFEntry.prototype.virtualSizeLow = function virtualSizeLow () {\n\t return this._data.readUInt32LE(12);\n\t };\n\t SFEntry.prototype.tableDepth = function tableDepth () {\n\t return this._data[20];\n\t };\n\t\n\t return SFEntry;\n\t}(SystemUseEntry));\n\t/**\n\t * @hidden\n\t */\n\tvar Directory = function Directory(record, isoData) {\n\t var this$1 = this;\n\t\n\t this._fileList = [];\n\t this._fileMap = {};\n\t this._record = record;\n\t var i = record.lba();\n\t var iLimit = i + record.dataLength();\n\t if (!(record.fileFlags() & 2 /* Directory */)) {\n\t // Must have a CL entry.\n\t var cl = record.getSUEntries(isoData).filter(function (e) { return e instanceof CLEntry; })[0];\n\t i = cl.childDirectoryLba() * 2048;\n\t iLimit = Infinity;\n\t }\n\t while (i < iLimit) {\n\t var len = isoData[i];\n\t // Zero-padding between sectors.\n\t // TODO: Could optimize this to seek to nearest-sector upon\n\t // seeing a 0.\n\t if (len === 0) {\n\t i++;\n\t continue;\n\t }\n\t var r = this$1._constructDirectoryRecord(isoData.slice(i));\n\t var fname = r.fileName(isoData);\n\t // Skip '.' and '..' entries.\n\t if (fname !== '\\u0000' && fname !== '\\u0001') {\n\t // Skip relocated entries.\n\t if (!r.hasRockRidge() || r.getSUEntries(isoData).filter(function (e) { return e instanceof REEntry; }).length === 0) {\n\t this$1._fileMap[fname] = r;\n\t this$1._fileList.push(fname);\n\t }\n\t }\n\t else if (iLimit === Infinity) {\n\t // First entry contains needed data.\n\t iLimit = i + r.dataLength();\n\t }\n\t i += r.length();\n\t }\n\t};\n\t/**\n\t * Get the record with the given name.\n\t * Returns undefined if not present.\n\t */\n\tDirectory.prototype.getRecord = function getRecord (name) {\n\t return this._fileMap[name];\n\t};\n\tDirectory.prototype.getFileList = function getFileList () {\n\t return this._fileList;\n\t};\n\tDirectory.prototype.getDotEntry = function getDotEntry (isoData) {\n\t return this._constructDirectoryRecord(isoData.slice(this._record.lba()));\n\t};\n\t/**\n\t * @hidden\n\t */\n\tvar ISODirectory = (function (Directory) {\n\t function ISODirectory(record, isoData) {\n\t Directory.call(this, record, isoData);\n\t }\n\t\n\t if ( Directory ) ISODirectory.__proto__ = Directory;\n\t ISODirectory.prototype = Object.create( Directory && Directory.prototype );\n\t ISODirectory.prototype.constructor = ISODirectory;\n\t ISODirectory.prototype._constructDirectoryRecord = function _constructDirectoryRecord (data) {\n\t return new ISODirectoryRecord(data, this._record.getRockRidgeOffset());\n\t };\n\t\n\t return ISODirectory;\n\t}(Directory));\n\t/**\n\t * @hidden\n\t */\n\tvar JolietDirectory = (function (Directory) {\n\t function JolietDirectory(record, isoData) {\n\t Directory.call(this, record, isoData);\n\t }\n\t\n\t if ( Directory ) JolietDirectory.__proto__ = Directory;\n\t JolietDirectory.prototype = Object.create( Directory && Directory.prototype );\n\t JolietDirectory.prototype.constructor = JolietDirectory;\n\t JolietDirectory.prototype._constructDirectoryRecord = function _constructDirectoryRecord (data) {\n\t return new JolietDirectoryRecord(data, this._record.getRockRidgeOffset());\n\t };\n\t\n\t return JolietDirectory;\n\t}(Directory));\n\t/**\n\t * Mounts an ISO file as a read-only file system.\n\t *\n\t * Supports:\n\t * * Vanilla ISO9660 ISOs\n\t * * Microsoft Joliet and Rock Ridge extensions to the ISO9660 standard\n\t */\n\tvar IsoFS = (function (SynchronousFileSystem$$1) {\n\t function IsoFS(data, name, deprecateMsg) {\n\t var this$1 = this;\n\t if ( name === void 0 ) name = \"\";\n\t if ( deprecateMsg === void 0 ) deprecateMsg = true;\n\t\n\t SynchronousFileSystem$$1.call(this);\n\t this._data = data;\n\t deprecationMessage(deprecateMsg, IsoFS.Name, { data: \"ISO data as a Buffer\", name: name });\n\t // Skip first 16 sectors.\n\t var vdTerminatorFound = false;\n\t var i = 16 * 2048;\n\t var candidateVDs = new Array();\n\t while (!vdTerminatorFound) {\n\t var slice = data.slice(i);\n\t var vd = new VolumeDescriptor(slice);\n\t switch (vd.type()) {\n\t case 1 /* PrimaryVolumeDescriptor */:\n\t candidateVDs.push(new PrimaryVolumeDescriptor(slice));\n\t break;\n\t case 2 /* SupplementaryVolumeDescriptor */:\n\t candidateVDs.push(new SupplementaryVolumeDescriptor(slice));\n\t break;\n\t case 255 /* VolumeDescriptorSetTerminator */:\n\t vdTerminatorFound = true;\n\t break;\n\t }\n\t i += 2048;\n\t }\n\t if (candidateVDs.length === 0) {\n\t throw new ApiError(ErrorCode.EIO, \"Unable to find a suitable volume descriptor.\");\n\t }\n\t candidateVDs.forEach(function (v) {\n\t // Take an SVD over a PVD.\n\t if (!this$1._pvd || this$1._pvd.type() !== 2 /* SupplementaryVolumeDescriptor */) {\n\t this$1._pvd = v;\n\t }\n\t });\n\t this._root = this._pvd.rootDirectoryEntry(data);\n\t this._name = name;\n\t }\n\t\n\t if ( SynchronousFileSystem$$1 ) IsoFS.__proto__ = SynchronousFileSystem$$1;\n\t IsoFS.prototype = Object.create( SynchronousFileSystem$$1 && SynchronousFileSystem$$1.prototype );\n\t IsoFS.prototype.constructor = IsoFS;\n\t /**\n\t * Creates an IsoFS instance with the given options.\n\t */\n\t IsoFS.Create = function Create (opts, cb) {\n\t var fs;\n\t var e;\n\t try {\n\t fs = new IsoFS(opts.data, opts.name, false);\n\t }\n\t catch (e) {\n\t e = e;\n\t }\n\t finally {\n\t cb(e, fs);\n\t }\n\t };\n\t IsoFS.isAvailable = function isAvailable () {\n\t return true;\n\t };\n\t IsoFS.prototype.getName = function getName () {\n\t var name = \"IsoFS\" + (this._name) + (this._pvd ? (\"-\" + (this._pvd.name())) : '');\n\t if (this._root && this._root.hasRockRidge()) {\n\t name += \"-RockRidge\";\n\t }\n\t return name;\n\t };\n\t IsoFS.prototype.diskSpace = function diskSpace (path$$1, cb) {\n\t // Read-only file system.\n\t cb(this._data.length, 0);\n\t };\n\t IsoFS.prototype.isReadOnly = function isReadOnly () {\n\t return true;\n\t };\n\t IsoFS.prototype.supportsLinks = function supportsLinks () {\n\t return false;\n\t };\n\t IsoFS.prototype.supportsProps = function supportsProps () {\n\t return false;\n\t };\n\t IsoFS.prototype.supportsSynch = function supportsSynch () {\n\t return true;\n\t };\n\t IsoFS.prototype.statSync = function statSync (p, isLstat) {\n\t var record = this._getDirectoryRecord(p);\n\t if (record === null) {\n\t throw ApiError.ENOENT(p);\n\t }\n\t return this._getStats(p, record);\n\t };\n\t IsoFS.prototype.openSync = function openSync (p, flags, mode) {\n\t // INVARIANT: Cannot write to RO file systems.\n\t if (flags.isWriteable()) {\n\t throw new ApiError(ErrorCode.EPERM, p);\n\t }\n\t // Check if the path exists, and is a file.\n\t var record = this._getDirectoryRecord(p);\n\t if (!record) {\n\t throw ApiError.ENOENT(p);\n\t }\n\t else if (record.isSymlink(this._data)) {\n\t return this.openSync(path.resolve(p, record.getSymlinkPath(this._data)), flags, mode);\n\t }\n\t else if (!record.isDirectory(this._data)) {\n\t var data = record.getFile(this._data);\n\t var stats = this._getStats(p, record);\n\t switch (flags.pathExistsAction()) {\n\t case ActionType.THROW_EXCEPTION:\n\t case ActionType.TRUNCATE_FILE:\n\t throw ApiError.EEXIST(p);\n\t case ActionType.NOP:\n\t return new NoSyncFile(this, p, flags, stats, data);\n\t default:\n\t throw new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.');\n\t }\n\t }\n\t else {\n\t throw ApiError.EISDIR(p);\n\t }\n\t };\n\t IsoFS.prototype.readdirSync = function readdirSync (path$$1) {\n\t // Check if it exists.\n\t var record = this._getDirectoryRecord(path$$1);\n\t if (!record) {\n\t throw ApiError.ENOENT(path$$1);\n\t }\n\t else if (record.isDirectory(this._data)) {\n\t return record.getDirectory(this._data).getFileList().slice(0);\n\t }\n\t else {\n\t throw ApiError.ENOTDIR(path$$1);\n\t }\n\t };\n\t /**\n\t * Specially-optimized readfile.\n\t */\n\t IsoFS.prototype.readFileSync = function readFileSync (fname, encoding, flag) {\n\t // Get file.\n\t var fd = this.openSync(fname, flag, 0x1a4);\n\t try {\n\t var fdCast = fd;\n\t var fdBuff = fdCast.getBuffer();\n\t if (encoding === null) {\n\t return copyingSlice(fdBuff);\n\t }\n\t return fdBuff.toString(encoding);\n\t }\n\t finally {\n\t fd.closeSync();\n\t }\n\t };\n\t IsoFS.prototype._getDirectoryRecord = function _getDirectoryRecord (path$$1) {\n\t var this$1 = this;\n\t\n\t // Special case.\n\t if (path$$1 === '/') {\n\t return this._root;\n\t }\n\t var components = path$$1.split('/').slice(1);\n\t var dir = this._root;\n\t for (var i = 0, list = components; i < list.length; i += 1) {\n\t var component = list[i];\n\t\n\t if (dir.isDirectory(this$1._data)) {\n\t dir = dir.getDirectory(this$1._data).getRecord(component);\n\t if (!dir) {\n\t return null;\n\t }\n\t }\n\t else {\n\t return null;\n\t }\n\t }\n\t return dir;\n\t };\n\t IsoFS.prototype._getStats = function _getStats (p, record) {\n\t if (record.isSymlink(this._data)) {\n\t var newP = path.resolve(p, record.getSymlinkPath(this._data));\n\t var dirRec = this._getDirectoryRecord(newP);\n\t if (!dirRec) {\n\t return null;\n\t }\n\t return this._getStats(newP, dirRec);\n\t }\n\t else {\n\t var len = record.dataLength();\n\t var mode = 0x16D;\n\t var date = record.recordingDate();\n\t var atime = date;\n\t var mtime = date;\n\t var ctime = date;\n\t if (record.hasRockRidge()) {\n\t var entries = record.getSUEntries(this._data);\n\t for (var i = 0, list = entries; i < list.length; i += 1) {\n\t var entry = list[i];\n\t\n\t if (entry instanceof PXEntry) {\n\t mode = entry.mode();\n\t }\n\t else if (entry instanceof TFEntry) {\n\t var flags = entry.flags();\n\t if (flags & 4 /* ACCESS */) {\n\t atime = entry.access();\n\t }\n\t if (flags & 2 /* MODIFY */) {\n\t mtime = entry.modify();\n\t }\n\t if (flags & 1 /* CREATION */) {\n\t ctime = entry.creation();\n\t }\n\t }\n\t }\n\t }\n\t // Mask out writeable flags. This is a RO file system.\n\t mode = mode & 0x16D;\n\t return new Stats(record.isDirectory(this._data) ? FileType.DIRECTORY : FileType.FILE, len, mode, atime, mtime, ctime);\n\t }\n\t };\n\t\n\t return IsoFS;\n\t}(SynchronousFileSystem));\n\t\n\tIsoFS.Name = \"IsoFS\";\n\tIsoFS.Options = {\n\t data: {\n\t type: \"object\",\n\t description: \"The ISO file in a buffer\",\n\t validator: bufferValidator\n\t }\n\t};\n\t\n\t// Monkey-patch `Create` functions to check options before file system initialization.\n\t[AsyncMirror, DropboxFileSystem, EmscriptenFileSystem, FolderAdapter, HTML5FS, InMemoryFileSystem, IndexedDBFileSystem, IsoFS, LocalStorageFileSystem, MountableFileSystem, OverlayFS, WorkerFS, XmlHttpRequest, ZipFS].forEach(function (fsType) {\n\t var create = fsType.Create;\n\t fsType.Create = function (opts, cb) {\n\t var oneArg = typeof (opts) === \"function\";\n\t var normalizedCb = oneArg ? opts : cb;\n\t var normalizedOpts = oneArg ? {} : opts;\n\t function wrappedCb(e) {\n\t if (e) {\n\t normalizedCb(e);\n\t }\n\t else {\n\t create.call(fsType, normalizedOpts, normalizedCb);\n\t }\n\t }\n\t checkOptions(fsType, normalizedOpts, wrappedCb);\n\t };\n\t});\n\t/**\n\t * @hidden\n\t */\n\tvar Backends = { AsyncMirror: AsyncMirror, Dropbox: DropboxFileSystem, Emscripten: EmscriptenFileSystem, FolderAdapter: FolderAdapter, HTML5FS: HTML5FS, InMemory: InMemoryFileSystem, IndexedDB: IndexedDBFileSystem, IsoFS: IsoFS, LocalStorage: LocalStorageFileSystem, MountableFileSystem: MountableFileSystem, OverlayFS: OverlayFS, WorkerFS: WorkerFS, XmlHttpRequest: XmlHttpRequest, ZipFS: ZipFS };\n\t\n\t/**\n\t * BrowserFS's main module. This is exposed in the browser via the BrowserFS global.\n\t * Due to limitations in typedoc, we document these functions in ./typedoc.ts.\n\t */\n\tif (process['initializeTTYs']) {\n\t process['initializeTTYs']();\n\t}\n\t/**\n\t * Installs BFSRequire as global `require`, a Node Buffer polyfill as the global `Buffer` variable,\n\t * and a Node process polyfill as the global `process` variable.\n\t */\n\tfunction install(obj) {\n\t obj.Buffer = Buffer;\n\t obj.process = process;\n\t var oldRequire = obj.require ? obj.require : null;\n\t // Monkey-patch require for Node-style code.\n\t obj.require = function (arg) {\n\t var rv = BFSRequire(arg);\n\t if (!rv) {\n\t return oldRequire.apply(null, Array.prototype.slice.call(arguments, 0));\n\t }\n\t else {\n\t return rv;\n\t }\n\t };\n\t}\n\t/**\n\t * @hidden\n\t */\n\tfunction registerFileSystem(name, fs) {\n\t Backends[name] = fs;\n\t}\n\tfunction BFSRequire(module) {\n\t switch (module) {\n\t case 'fs':\n\t return _fsMock;\n\t case 'path':\n\t return path;\n\t case 'buffer':\n\t // The 'buffer' module has 'Buffer' as a property.\n\t return buffer;\n\t case 'process':\n\t return process;\n\t case 'bfs_utils':\n\t return BFSUtils;\n\t default:\n\t return Backends[module];\n\t }\n\t}\n\t/**\n\t * Initializes BrowserFS with the given root file system.\n\t */\n\tfunction initialize(rootfs) {\n\t return _fsMock.initialize(rootfs);\n\t}\n\t/**\n\t * Creates a file system with the given configuration, and initializes BrowserFS with it.\n\t * See the FileSystemConfiguration type for more info on the configuration object.\n\t */\n\tfunction configure(config, cb) {\n\t getFileSystem(config, function (e, fs) {\n\t if (fs) {\n\t initialize(fs);\n\t cb();\n\t }\n\t else {\n\t cb(e);\n\t }\n\t });\n\t}\n\t/**\n\t * Retrieve a file system with the given configuration.\n\t * @param config A FileSystemConfiguration object. See FileSystemConfiguration for details.\n\t * @param cb Called when the file system is constructed, or when an error occurs.\n\t */\n\tfunction getFileSystem(config, cb) {\n\t var fsName = config['fs'];\n\t if (!fsName) {\n\t return cb(new ApiError(ErrorCode.EPERM, 'Missing \"fs\" property on configuration object.'));\n\t }\n\t var options = config['options'];\n\t var waitCount = 0;\n\t var called = false;\n\t function finish() {\n\t if (!called) {\n\t called = true;\n\t var fsc = Backends[fsName];\n\t if (!fsc) {\n\t cb(new ApiError(ErrorCode.EPERM, (\"File system \" + fsName + \" is not available in BrowserFS.\")));\n\t }\n\t else {\n\t fsc.Create(options, cb);\n\t }\n\t }\n\t }\n\t if (options !== null && typeof (options) === \"object\") {\n\t var finishedIterating = false;\n\t var props = Object.keys(options).filter(function (k) { return k !== 'fs'; });\n\t // Check recursively if other fields have 'fs' properties.\n\t props.forEach(function (p) {\n\t var d = options[p];\n\t if (d !== null && typeof (d) === \"object\" && d['fs']) {\n\t waitCount++;\n\t getFileSystem(d, function (e, fs) {\n\t waitCount--;\n\t if (e) {\n\t if (called) {\n\t return;\n\t }\n\t called = true;\n\t cb(e);\n\t }\n\t else {\n\t options[p] = fs;\n\t if (waitCount === 0 && finishedIterating) {\n\t finish();\n\t }\n\t }\n\t });\n\t }\n\t });\n\t finishedIterating = true;\n\t }\n\t if (waitCount === 0) {\n\t finish();\n\t }\n\t}\n\t\n\t/**\n\t * BrowserFS's main entry point.\n\t * It installs all of the needed polyfills, and requires() the main module.\n\t */\n\t// IE substr does not support negative indices\n\tif ('ab'.substr(-1) !== 'b') {\n\t String.prototype.substr = function (substr) {\n\t return function (start, length) {\n\t // did we get a negative start, calculate how much it is from the\n\t // beginning of the string\n\t if (start < 0) {\n\t start = this.length + start;\n\t }\n\t // call the original function\n\t return substr.call(this, start, length);\n\t };\n\t }(String.prototype.substr);\n\t}\n\t// Polyfill for Uint8Array.prototype.slice.\n\t// Safari and some other browsers do not define it.\n\tif (typeof (ArrayBuffer) !== 'undefined' && typeof (Uint8Array) !== 'undefined') {\n\t if (!Uint8Array.prototype['slice']) {\n\t Uint8Array.prototype.slice = function (start, end) {\n\t if ( start === void 0 ) start = 0;\n\t if ( end === void 0 ) end = this.length;\n\t\n\t var self = this;\n\t if (start < 0) {\n\t start = this.length + start;\n\t if (start < 0) {\n\t start = 0;\n\t }\n\t }\n\t if (end < 0) {\n\t end = this.length + end;\n\t if (end < 0) {\n\t end = 0;\n\t }\n\t }\n\t if (end < start) {\n\t end = start;\n\t }\n\t return new Uint8Array(self.buffer, self.byteOffset + start, end - start);\n\t };\n\t }\n\t}\n\t\n\texports.install = install;\n\texports.registerFileSystem = registerFileSystem;\n\texports.BFSRequire = BFSRequire;\n\texports.initialize = initialize;\n\texports.configure = configure;\n\texports.getFileSystem = getFileSystem;\n\texports.EmscriptenFS = BFSEmscriptenFS;\n\texports.FileSystem = Backends;\n\texports.Errors = api_error;\n\texports.setImmediate = setImmediate$3;\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7), (function() { return this; }()), __webpack_require__(41)(module), __webpack_require__(3)))\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(Buffer) {/*!\n\t * The buffer module from node.js, for the browser.\n\t *\n\t * @author Feross Aboukhadijeh \n\t * @license MIT\n\t */\n\t/* eslint-disable no-proto */\n\t\n\t'use strict'\n\t\n\tvar base64 = __webpack_require__(18)\n\tvar ieee754 = __webpack_require__(21)\n\t\n\texports.Buffer = Buffer\n\texports.SlowBuffer = SlowBuffer\n\texports.INSPECT_MAX_BYTES = 50\n\t\n\tvar K_MAX_LENGTH = 0x7fffffff\n\texports.kMaxLength = K_MAX_LENGTH\n\t\n\t/**\n\t * If `Buffer.TYPED_ARRAY_SUPPORT`:\n\t * === true Use Uint8Array implementation (fastest)\n\t * === false Print warning and recommend using `buffer` v4.x which has an Object\n\t * implementation (most compatible, even IE6)\n\t *\n\t * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n\t * Opera 11.6+, iOS 4.2+.\n\t *\n\t * We report that the browser does not support typed arrays if the are not subclassable\n\t * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n\t * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n\t * for __proto__ and has a buggy typed array implementation.\n\t */\n\tBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\t\n\tif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n\t typeof console.error === 'function') {\n\t console.error(\n\t 'This browser lacks typed array (Uint8Array) support which is required by ' +\n\t '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n\t )\n\t}\n\t\n\tfunction typedArraySupport () {\n\t // Can typed array instances can be augmented?\n\t try {\n\t var arr = new Uint8Array(1)\n\t arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n\t return arr.foo() === 42\n\t } catch (e) {\n\t return false\n\t }\n\t}\n\t\n\tfunction createBuffer (length) {\n\t if (length > K_MAX_LENGTH) {\n\t throw new RangeError('Invalid typed array length')\n\t }\n\t // Return an augmented `Uint8Array` instance\n\t var buf = new Uint8Array(length)\n\t buf.__proto__ = Buffer.prototype\n\t return buf\n\t}\n\t\n\t/**\n\t * The Buffer constructor returns instances of `Uint8Array` that have their\n\t * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n\t * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n\t * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n\t * returns a single octet.\n\t *\n\t * The `Uint8Array` prototype remains unmodified.\n\t */\n\t\n\tfunction Buffer (arg, encodingOrOffset, length) {\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(arg)\n\t }\n\t return from(arg, encodingOrOffset, length)\n\t}\n\t\n\t// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n\tif (typeof Symbol !== 'undefined' && Symbol.species &&\n\t Buffer[Symbol.species] === Buffer) {\n\t Object.defineProperty(Buffer, Symbol.species, {\n\t value: null,\n\t configurable: true,\n\t enumerable: false,\n\t writable: false\n\t })\n\t}\n\t\n\tBuffer.poolSize = 8192 // not used by this implementation\n\t\n\tfunction from (value, encodingOrOffset, length) {\n\t if (typeof value === 'number') {\n\t throw new TypeError('\"value\" argument must not be a number')\n\t }\n\t\n\t if (isArrayBuffer(value)) {\n\t return fromArrayBuffer(value, encodingOrOffset, length)\n\t }\n\t\n\t if (typeof value === 'string') {\n\t return fromString(value, encodingOrOffset)\n\t }\n\t\n\t return fromObject(value)\n\t}\n\t\n\t/**\n\t * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n\t * if value is a number.\n\t * Buffer.from(str[, encoding])\n\t * Buffer.from(array)\n\t * Buffer.from(buffer)\n\t * Buffer.from(arrayBuffer[, byteOffset[, length]])\n\t **/\n\tBuffer.from = function (value, encodingOrOffset, length) {\n\t return from(value, encodingOrOffset, length)\n\t}\n\t\n\t// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n\t// https://github.com/feross/buffer/pull/148\n\tBuffer.prototype.__proto__ = Uint8Array.prototype\n\tBuffer.__proto__ = Uint8Array\n\t\n\tfunction assertSize (size) {\n\t if (typeof size !== 'number') {\n\t throw new TypeError('\"size\" argument must be a number')\n\t } else if (size < 0) {\n\t throw new RangeError('\"size\" argument must not be negative')\n\t }\n\t}\n\t\n\tfunction alloc (size, fill, encoding) {\n\t assertSize(size)\n\t if (size <= 0) {\n\t return createBuffer(size)\n\t }\n\t if (fill !== undefined) {\n\t // Only pay attention to encoding if it's a string. This\n\t // prevents accidentally sending in a number that would\n\t // be interpretted as a start offset.\n\t return typeof encoding === 'string'\n\t ? createBuffer(size).fill(fill, encoding)\n\t : createBuffer(size).fill(fill)\n\t }\n\t return createBuffer(size)\n\t}\n\t\n\t/**\n\t * Creates a new filled Buffer instance.\n\t * alloc(size[, fill[, encoding]])\n\t **/\n\tBuffer.alloc = function (size, fill, encoding) {\n\t return alloc(size, fill, encoding)\n\t}\n\t\n\tfunction allocUnsafe (size) {\n\t assertSize(size)\n\t return createBuffer(size < 0 ? 0 : checked(size) | 0)\n\t}\n\t\n\t/**\n\t * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n\t * */\n\tBuffer.allocUnsafe = function (size) {\n\t return allocUnsafe(size)\n\t}\n\t/**\n\t * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n\t */\n\tBuffer.allocUnsafeSlow = function (size) {\n\t return allocUnsafe(size)\n\t}\n\t\n\tfunction fromString (string, encoding) {\n\t if (typeof encoding !== 'string' || encoding === '') {\n\t encoding = 'utf8'\n\t }\n\t\n\t if (!Buffer.isEncoding(encoding)) {\n\t throw new TypeError('\"encoding\" must be a valid string encoding')\n\t }\n\t\n\t var length = byteLength(string, encoding) | 0\n\t var buf = createBuffer(length)\n\t\n\t var actual = buf.write(string, encoding)\n\t\n\t if (actual !== length) {\n\t // Writing a hex string, for example, that contains invalid characters will\n\t // cause everything after the first invalid character to be ignored. (e.g.\n\t // 'abxxcd' will be treated as 'ab')\n\t buf = buf.slice(0, actual)\n\t }\n\t\n\t return buf\n\t}\n\t\n\tfunction fromArrayLike (array) {\n\t var length = array.length < 0 ? 0 : checked(array.length) | 0\n\t var buf = createBuffer(length)\n\t for (var i = 0; i < length; i += 1) {\n\t buf[i] = array[i] & 255\n\t }\n\t return buf\n\t}\n\t\n\tfunction fromArrayBuffer (array, byteOffset, length) {\n\t if (byteOffset < 0 || array.byteLength < byteOffset) {\n\t throw new RangeError('\\'offset\\' is out of bounds')\n\t }\n\t\n\t if (array.byteLength < byteOffset + (length || 0)) {\n\t throw new RangeError('\\'length\\' is out of bounds')\n\t }\n\t\n\t var buf\n\t if (byteOffset === undefined && length === undefined) {\n\t buf = new Uint8Array(array)\n\t } else if (length === undefined) {\n\t buf = new Uint8Array(array, byteOffset)\n\t } else {\n\t buf = new Uint8Array(array, byteOffset, length)\n\t }\n\t\n\t // Return an augmented `Uint8Array` instance\n\t buf.__proto__ = Buffer.prototype\n\t return buf\n\t}\n\t\n\tfunction fromObject (obj) {\n\t if (Buffer.isBuffer(obj)) {\n\t var len = checked(obj.length) | 0\n\t var buf = createBuffer(len)\n\t\n\t if (buf.length === 0) {\n\t return buf\n\t }\n\t\n\t obj.copy(buf, 0, 0, len)\n\t return buf\n\t }\n\t\n\t if (obj) {\n\t if (isArrayBufferView(obj) || 'length' in obj) {\n\t if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n\t return createBuffer(0)\n\t }\n\t return fromArrayLike(obj)\n\t }\n\t\n\t if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n\t return fromArrayLike(obj.data)\n\t }\n\t }\n\t\n\t throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n\t}\n\t\n\tfunction checked (length) {\n\t // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n\t // length is NaN (which is otherwise coerced to zero.)\n\t if (length >= K_MAX_LENGTH) {\n\t throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n\t 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n\t }\n\t return length | 0\n\t}\n\t\n\tfunction SlowBuffer (length) {\n\t if (+length != length) { // eslint-disable-line eqeqeq\n\t length = 0\n\t }\n\t return Buffer.alloc(+length)\n\t}\n\t\n\tBuffer.isBuffer = function isBuffer (b) {\n\t return b != null && b._isBuffer === true\n\t}\n\t\n\tBuffer.compare = function compare (a, b) {\n\t if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n\t throw new TypeError('Arguments must be Buffers')\n\t }\n\t\n\t if (a === b) return 0\n\t\n\t var x = a.length\n\t var y = b.length\n\t\n\t for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n\t if (a[i] !== b[i]) {\n\t x = a[i]\n\t y = b[i]\n\t break\n\t }\n\t }\n\t\n\t if (x < y) return -1\n\t if (y < x) return 1\n\t return 0\n\t}\n\t\n\tBuffer.isEncoding = function isEncoding (encoding) {\n\t switch (String(encoding).toLowerCase()) {\n\t case 'hex':\n\t case 'utf8':\n\t case 'utf-8':\n\t case 'ascii':\n\t case 'latin1':\n\t case 'binary':\n\t case 'base64':\n\t case 'ucs2':\n\t case 'ucs-2':\n\t case 'utf16le':\n\t case 'utf-16le':\n\t return true\n\t default:\n\t return false\n\t }\n\t}\n\t\n\tBuffer.concat = function concat (list, length) {\n\t if (!Array.isArray(list)) {\n\t throw new TypeError('\"list\" argument must be an Array of Buffers')\n\t }\n\t\n\t if (list.length === 0) {\n\t return Buffer.alloc(0)\n\t }\n\t\n\t var i\n\t if (length === undefined) {\n\t length = 0\n\t for (i = 0; i < list.length; ++i) {\n\t length += list[i].length\n\t }\n\t }\n\t\n\t var buffer = Buffer.allocUnsafe(length)\n\t var pos = 0\n\t for (i = 0; i < list.length; ++i) {\n\t var buf = list[i]\n\t if (!Buffer.isBuffer(buf)) {\n\t throw new TypeError('\"list\" argument must be an Array of Buffers')\n\t }\n\t buf.copy(buffer, pos)\n\t pos += buf.length\n\t }\n\t return buffer\n\t}\n\t\n\tfunction byteLength (string, encoding) {\n\t if (Buffer.isBuffer(string)) {\n\t return string.length\n\t }\n\t if (isArrayBufferView(string) || isArrayBuffer(string)) {\n\t return string.byteLength\n\t }\n\t if (typeof string !== 'string') {\n\t string = '' + string\n\t }\n\t\n\t var len = string.length\n\t if (len === 0) return 0\n\t\n\t // Use a for loop to avoid recursion\n\t var loweredCase = false\n\t for (;;) {\n\t switch (encoding) {\n\t case 'ascii':\n\t case 'latin1':\n\t case 'binary':\n\t return len\n\t case 'utf8':\n\t case 'utf-8':\n\t case undefined:\n\t return utf8ToBytes(string).length\n\t case 'ucs2':\n\t case 'ucs-2':\n\t case 'utf16le':\n\t case 'utf-16le':\n\t return len * 2\n\t case 'hex':\n\t return len >>> 1\n\t case 'base64':\n\t return base64ToBytes(string).length\n\t default:\n\t if (loweredCase) return utf8ToBytes(string).length // assume utf8\n\t encoding = ('' + encoding).toLowerCase()\n\t loweredCase = true\n\t }\n\t }\n\t}\n\tBuffer.byteLength = byteLength\n\t\n\tfunction slowToString (encoding, start, end) {\n\t var loweredCase = false\n\t\n\t // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n\t // property of a typed array.\n\t\n\t // This behaves neither like String nor Uint8Array in that we set start/end\n\t // to their upper/lower bounds if the value passed is out of range.\n\t // undefined is handled specially as per ECMA-262 6th Edition,\n\t // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n\t if (start === undefined || start < 0) {\n\t start = 0\n\t }\n\t // Return early if start > this.length. Done here to prevent potential uint32\n\t // coercion fail below.\n\t if (start > this.length) {\n\t return ''\n\t }\n\t\n\t if (end === undefined || end > this.length) {\n\t end = this.length\n\t }\n\t\n\t if (end <= 0) {\n\t return ''\n\t }\n\t\n\t // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n\t end >>>= 0\n\t start >>>= 0\n\t\n\t if (end <= start) {\n\t return ''\n\t }\n\t\n\t if (!encoding) encoding = 'utf8'\n\t\n\t while (true) {\n\t switch (encoding) {\n\t case 'hex':\n\t return hexSlice(this, start, end)\n\t\n\t case 'utf8':\n\t case 'utf-8':\n\t return utf8Slice(this, start, end)\n\t\n\t case 'ascii':\n\t return asciiSlice(this, start, end)\n\t\n\t case 'latin1':\n\t case 'binary':\n\t return latin1Slice(this, start, end)\n\t\n\t case 'base64':\n\t return base64Slice(this, start, end)\n\t\n\t case 'ucs2':\n\t case 'ucs-2':\n\t case 'utf16le':\n\t case 'utf-16le':\n\t return utf16leSlice(this, start, end)\n\t\n\t default:\n\t if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n\t encoding = (encoding + '').toLowerCase()\n\t loweredCase = true\n\t }\n\t }\n\t}\n\t\n\t// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n\t// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n\t// reliably in a browserify context because there could be multiple different\n\t// copies of the 'buffer' package in use. This method works even for Buffer\n\t// instances that were created from another copy of the `buffer` package.\n\t// See: https://github.com/feross/buffer/issues/154\n\tBuffer.prototype._isBuffer = true\n\t\n\tfunction swap (b, n, m) {\n\t var i = b[n]\n\t b[n] = b[m]\n\t b[m] = i\n\t}\n\t\n\tBuffer.prototype.swap16 = function swap16 () {\n\t var len = this.length\n\t if (len % 2 !== 0) {\n\t throw new RangeError('Buffer size must be a multiple of 16-bits')\n\t }\n\t for (var i = 0; i < len; i += 2) {\n\t swap(this, i, i + 1)\n\t }\n\t return this\n\t}\n\t\n\tBuffer.prototype.swap32 = function swap32 () {\n\t var len = this.length\n\t if (len % 4 !== 0) {\n\t throw new RangeError('Buffer size must be a multiple of 32-bits')\n\t }\n\t for (var i = 0; i < len; i += 4) {\n\t swap(this, i, i + 3)\n\t swap(this, i + 1, i + 2)\n\t }\n\t return this\n\t}\n\t\n\tBuffer.prototype.swap64 = function swap64 () {\n\t var len = this.length\n\t if (len % 8 !== 0) {\n\t throw new RangeError('Buffer size must be a multiple of 64-bits')\n\t }\n\t for (var i = 0; i < len; i += 8) {\n\t swap(this, i, i + 7)\n\t swap(this, i + 1, i + 6)\n\t swap(this, i + 2, i + 5)\n\t swap(this, i + 3, i + 4)\n\t }\n\t return this\n\t}\n\t\n\tBuffer.prototype.toString = function toString () {\n\t var length = this.length\n\t if (length === 0) return ''\n\t if (arguments.length === 0) return utf8Slice(this, 0, length)\n\t return slowToString.apply(this, arguments)\n\t}\n\t\n\tBuffer.prototype.equals = function equals (b) {\n\t if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n\t if (this === b) return true\n\t return Buffer.compare(this, b) === 0\n\t}\n\t\n\tBuffer.prototype.inspect = function inspect () {\n\t var str = ''\n\t var max = exports.INSPECT_MAX_BYTES\n\t if (this.length > 0) {\n\t str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n\t if (this.length > max) str += ' ... '\n\t }\n\t return ''\n\t}\n\t\n\tBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n\t if (!Buffer.isBuffer(target)) {\n\t throw new TypeError('Argument must be a Buffer')\n\t }\n\t\n\t if (start === undefined) {\n\t start = 0\n\t }\n\t if (end === undefined) {\n\t end = target ? target.length : 0\n\t }\n\t if (thisStart === undefined) {\n\t thisStart = 0\n\t }\n\t if (thisEnd === undefined) {\n\t thisEnd = this.length\n\t }\n\t\n\t if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n\t throw new RangeError('out of range index')\n\t }\n\t\n\t if (thisStart >= thisEnd && start >= end) {\n\t return 0\n\t }\n\t if (thisStart >= thisEnd) {\n\t return -1\n\t }\n\t if (start >= end) {\n\t return 1\n\t }\n\t\n\t start >>>= 0\n\t end >>>= 0\n\t thisStart >>>= 0\n\t thisEnd >>>= 0\n\t\n\t if (this === target) return 0\n\t\n\t var x = thisEnd - thisStart\n\t var y = end - start\n\t var len = Math.min(x, y)\n\t\n\t var thisCopy = this.slice(thisStart, thisEnd)\n\t var targetCopy = target.slice(start, end)\n\t\n\t for (var i = 0; i < len; ++i) {\n\t if (thisCopy[i] !== targetCopy[i]) {\n\t x = thisCopy[i]\n\t y = targetCopy[i]\n\t break\n\t }\n\t }\n\t\n\t if (x < y) return -1\n\t if (y < x) return 1\n\t return 0\n\t}\n\t\n\t// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n\t// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n\t//\n\t// Arguments:\n\t// - buffer - a Buffer to search\n\t// - val - a string, Buffer, or number\n\t// - byteOffset - an index into `buffer`; will be clamped to an int32\n\t// - encoding - an optional encoding, relevant is val is a string\n\t// - dir - true for indexOf, false for lastIndexOf\n\tfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n\t // Empty buffer means no match\n\t if (buffer.length === 0) return -1\n\t\n\t // Normalize byteOffset\n\t if (typeof byteOffset === 'string') {\n\t encoding = byteOffset\n\t byteOffset = 0\n\t } else if (byteOffset > 0x7fffffff) {\n\t byteOffset = 0x7fffffff\n\t } else if (byteOffset < -0x80000000) {\n\t byteOffset = -0x80000000\n\t }\n\t byteOffset = +byteOffset // Coerce to Number.\n\t if (numberIsNaN(byteOffset)) {\n\t // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n\t byteOffset = dir ? 0 : (buffer.length - 1)\n\t }\n\t\n\t // Normalize byteOffset: negative offsets start from the end of the buffer\n\t if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n\t if (byteOffset >= buffer.length) {\n\t if (dir) return -1\n\t else byteOffset = buffer.length - 1\n\t } else if (byteOffset < 0) {\n\t if (dir) byteOffset = 0\n\t else return -1\n\t }\n\t\n\t // Normalize val\n\t if (typeof val === 'string') {\n\t val = Buffer.from(val, encoding)\n\t }\n\t\n\t // Finally, search either indexOf (if dir is true) or lastIndexOf\n\t if (Buffer.isBuffer(val)) {\n\t // Special case: looking for empty string/buffer always fails\n\t if (val.length === 0) {\n\t return -1\n\t }\n\t return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n\t } else if (typeof val === 'number') {\n\t val = val & 0xFF // Search for a byte value [0-255]\n\t if (typeof Uint8Array.prototype.indexOf === 'function') {\n\t if (dir) {\n\t return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n\t } else {\n\t return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n\t }\n\t }\n\t return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n\t }\n\t\n\t throw new TypeError('val must be string, number or Buffer')\n\t}\n\t\n\tfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n\t var indexSize = 1\n\t var arrLength = arr.length\n\t var valLength = val.length\n\t\n\t if (encoding !== undefined) {\n\t encoding = String(encoding).toLowerCase()\n\t if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n\t encoding === 'utf16le' || encoding === 'utf-16le') {\n\t if (arr.length < 2 || val.length < 2) {\n\t return -1\n\t }\n\t indexSize = 2\n\t arrLength /= 2\n\t valLength /= 2\n\t byteOffset /= 2\n\t }\n\t }\n\t\n\t function read (buf, i) {\n\t if (indexSize === 1) {\n\t return buf[i]\n\t } else {\n\t return buf.readUInt16BE(i * indexSize)\n\t }\n\t }\n\t\n\t var i\n\t if (dir) {\n\t var foundIndex = -1\n\t for (i = byteOffset; i < arrLength; i++) {\n\t if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n\t if (foundIndex === -1) foundIndex = i\n\t if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n\t } else {\n\t if (foundIndex !== -1) i -= i - foundIndex\n\t foundIndex = -1\n\t }\n\t }\n\t } else {\n\t if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n\t for (i = byteOffset; i >= 0; i--) {\n\t var found = true\n\t for (var j = 0; j < valLength; j++) {\n\t if (read(arr, i + j) !== read(val, j)) {\n\t found = false\n\t break\n\t }\n\t }\n\t if (found) return i\n\t }\n\t }\n\t\n\t return -1\n\t}\n\t\n\tBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n\t return this.indexOf(val, byteOffset, encoding) !== -1\n\t}\n\t\n\tBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n\t return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n\t}\n\t\n\tBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n\t return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n\t}\n\t\n\tfunction hexWrite (buf, string, offset, length) {\n\t offset = Number(offset) || 0\n\t var remaining = buf.length - offset\n\t if (!length) {\n\t length = remaining\n\t } else {\n\t length = Number(length)\n\t if (length > remaining) {\n\t length = remaining\n\t }\n\t }\n\t\n\t // must be an even number of digits\n\t var strLen = string.length\n\t if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\t\n\t if (length > strLen / 2) {\n\t length = strLen / 2\n\t }\n\t for (var i = 0; i < length; ++i) {\n\t var parsed = parseInt(string.substr(i * 2, 2), 16)\n\t if (numberIsNaN(parsed)) return i\n\t buf[offset + i] = parsed\n\t }\n\t return i\n\t}\n\t\n\tfunction utf8Write (buf, string, offset, length) {\n\t return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n\t}\n\t\n\tfunction asciiWrite (buf, string, offset, length) {\n\t return blitBuffer(asciiToBytes(string), buf, offset, length)\n\t}\n\t\n\tfunction latin1Write (buf, string, offset, length) {\n\t return asciiWrite(buf, string, offset, length)\n\t}\n\t\n\tfunction base64Write (buf, string, offset, length) {\n\t return blitBuffer(base64ToBytes(string), buf, offset, length)\n\t}\n\t\n\tfunction ucs2Write (buf, string, offset, length) {\n\t return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n\t}\n\t\n\tBuffer.prototype.write = function write (string, offset, length, encoding) {\n\t // Buffer#write(string)\n\t if (offset === undefined) {\n\t encoding = 'utf8'\n\t length = this.length\n\t offset = 0\n\t // Buffer#write(string, encoding)\n\t } else if (length === undefined && typeof offset === 'string') {\n\t encoding = offset\n\t length = this.length\n\t offset = 0\n\t // Buffer#write(string, offset[, length][, encoding])\n\t } else if (isFinite(offset)) {\n\t offset = offset >>> 0\n\t if (isFinite(length)) {\n\t length = length >>> 0\n\t if (encoding === undefined) encoding = 'utf8'\n\t } else {\n\t encoding = length\n\t length = undefined\n\t }\n\t } else {\n\t throw new Error(\n\t 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n\t )\n\t }\n\t\n\t var remaining = this.length - offset\n\t if (length === undefined || length > remaining) length = remaining\n\t\n\t if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n\t throw new RangeError('Attempt to write outside buffer bounds')\n\t }\n\t\n\t if (!encoding) encoding = 'utf8'\n\t\n\t var loweredCase = false\n\t for (;;) {\n\t switch (encoding) {\n\t case 'hex':\n\t return hexWrite(this, string, offset, length)\n\t\n\t case 'utf8':\n\t case 'utf-8':\n\t return utf8Write(this, string, offset, length)\n\t\n\t case 'ascii':\n\t return asciiWrite(this, string, offset, length)\n\t\n\t case 'latin1':\n\t case 'binary':\n\t return latin1Write(this, string, offset, length)\n\t\n\t case 'base64':\n\t // Warning: maxLength not taken into account in base64Write\n\t return base64Write(this, string, offset, length)\n\t\n\t case 'ucs2':\n\t case 'ucs-2':\n\t case 'utf16le':\n\t case 'utf-16le':\n\t return ucs2Write(this, string, offset, length)\n\t\n\t default:\n\t if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n\t encoding = ('' + encoding).toLowerCase()\n\t loweredCase = true\n\t }\n\t }\n\t}\n\t\n\tBuffer.prototype.toJSON = function toJSON () {\n\t return {\n\t type: 'Buffer',\n\t data: Array.prototype.slice.call(this._arr || this, 0)\n\t }\n\t}\n\t\n\tfunction base64Slice (buf, start, end) {\n\t if (start === 0 && end === buf.length) {\n\t return base64.fromByteArray(buf)\n\t } else {\n\t return base64.fromByteArray(buf.slice(start, end))\n\t }\n\t}\n\t\n\tfunction utf8Slice (buf, start, end) {\n\t end = Math.min(buf.length, end)\n\t var res = []\n\t\n\t var i = start\n\t while (i < end) {\n\t var firstByte = buf[i]\n\t var codePoint = null\n\t var bytesPerSequence = (firstByte > 0xEF) ? 4\n\t : (firstByte > 0xDF) ? 3\n\t : (firstByte > 0xBF) ? 2\n\t : 1\n\t\n\t if (i + bytesPerSequence <= end) {\n\t var secondByte, thirdByte, fourthByte, tempCodePoint\n\t\n\t switch (bytesPerSequence) {\n\t case 1:\n\t if (firstByte < 0x80) {\n\t codePoint = firstByte\n\t }\n\t break\n\t case 2:\n\t secondByte = buf[i + 1]\n\t if ((secondByte & 0xC0) === 0x80) {\n\t tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n\t if (tempCodePoint > 0x7F) {\n\t codePoint = tempCodePoint\n\t }\n\t }\n\t break\n\t case 3:\n\t secondByte = buf[i + 1]\n\t thirdByte = buf[i + 2]\n\t if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n\t tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n\t if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n\t codePoint = tempCodePoint\n\t }\n\t }\n\t break\n\t case 4:\n\t secondByte = buf[i + 1]\n\t thirdByte = buf[i + 2]\n\t fourthByte = buf[i + 3]\n\t if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n\t tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n\t if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n\t codePoint = tempCodePoint\n\t }\n\t }\n\t }\n\t }\n\t\n\t if (codePoint === null) {\n\t // we did not generate a valid codePoint so insert a\n\t // replacement char (U+FFFD) and advance only 1 byte\n\t codePoint = 0xFFFD\n\t bytesPerSequence = 1\n\t } else if (codePoint > 0xFFFF) {\n\t // encode to utf16 (surrogate pair dance)\n\t codePoint -= 0x10000\n\t res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n\t codePoint = 0xDC00 | codePoint & 0x3FF\n\t }\n\t\n\t res.push(codePoint)\n\t i += bytesPerSequence\n\t }\n\t\n\t return decodeCodePointsArray(res)\n\t}\n\t\n\t// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n\t// the lowest limit is Chrome, with 0x10000 args.\n\t// We go 1 magnitude less, for safety\n\tvar MAX_ARGUMENTS_LENGTH = 0x1000\n\t\n\tfunction decodeCodePointsArray (codePoints) {\n\t var len = codePoints.length\n\t if (len <= MAX_ARGUMENTS_LENGTH) {\n\t return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n\t }\n\t\n\t // Decode in chunks to avoid \"call stack size exceeded\".\n\t var res = ''\n\t var i = 0\n\t while (i < len) {\n\t res += String.fromCharCode.apply(\n\t String,\n\t codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n\t )\n\t }\n\t return res\n\t}\n\t\n\tfunction asciiSlice (buf, start, end) {\n\t var ret = ''\n\t end = Math.min(buf.length, end)\n\t\n\t for (var i = start; i < end; ++i) {\n\t ret += String.fromCharCode(buf[i] & 0x7F)\n\t }\n\t return ret\n\t}\n\t\n\tfunction latin1Slice (buf, start, end) {\n\t var ret = ''\n\t end = Math.min(buf.length, end)\n\t\n\t for (var i = start; i < end; ++i) {\n\t ret += String.fromCharCode(buf[i])\n\t }\n\t return ret\n\t}\n\t\n\tfunction hexSlice (buf, start, end) {\n\t var len = buf.length\n\t\n\t if (!start || start < 0) start = 0\n\t if (!end || end < 0 || end > len) end = len\n\t\n\t var out = ''\n\t for (var i = start; i < end; ++i) {\n\t out += toHex(buf[i])\n\t }\n\t return out\n\t}\n\t\n\tfunction utf16leSlice (buf, start, end) {\n\t var bytes = buf.slice(start, end)\n\t var res = ''\n\t for (var i = 0; i < bytes.length; i += 2) {\n\t res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n\t }\n\t return res\n\t}\n\t\n\tBuffer.prototype.slice = function slice (start, end) {\n\t var len = this.length\n\t start = ~~start\n\t end = end === undefined ? len : ~~end\n\t\n\t if (start < 0) {\n\t start += len\n\t if (start < 0) start = 0\n\t } else if (start > len) {\n\t start = len\n\t }\n\t\n\t if (end < 0) {\n\t end += len\n\t if (end < 0) end = 0\n\t } else if (end > len) {\n\t end = len\n\t }\n\t\n\t if (end < start) end = start\n\t\n\t var newBuf = this.subarray(start, end)\n\t // Return an augmented `Uint8Array` instance\n\t newBuf.__proto__ = Buffer.prototype\n\t return newBuf\n\t}\n\t\n\t/*\n\t * Need to make sure that buffer isn't trying to write out of bounds.\n\t */\n\tfunction checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}\n\t\n\tBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n\t offset = offset >>> 0\n\t byteLength = byteLength >>> 0\n\t if (!noAssert) checkOffset(offset, byteLength, this.length)\n\t\n\t var val = this[offset]\n\t var mul = 1\n\t var i = 0\n\t while (++i < byteLength && (mul *= 0x100)) {\n\t val += this[offset + i] * mul\n\t }\n\t\n\t return val\n\t}\n\t\n\tBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n\t offset = offset >>> 0\n\t byteLength = byteLength >>> 0\n\t if (!noAssert) {\n\t checkOffset(offset, byteLength, this.length)\n\t }\n\t\n\t var val = this[offset + --byteLength]\n\t var mul = 1\n\t while (byteLength > 0 && (mul *= 0x100)) {\n\t val += this[offset + --byteLength] * mul\n\t }\n\t\n\t return val\n\t}\n\t\n\tBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 1, this.length)\n\t return this[offset]\n\t}\n\t\n\tBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 2, this.length)\n\t return this[offset] | (this[offset + 1] << 8)\n\t}\n\t\n\tBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 2, this.length)\n\t return (this[offset] << 8) | this[offset + 1]\n\t}\n\t\n\tBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t\n\t return ((this[offset]) |\n\t (this[offset + 1] << 8) |\n\t (this[offset + 2] << 16)) +\n\t (this[offset + 3] * 0x1000000)\n\t}\n\t\n\tBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t\n\t return (this[offset] * 0x1000000) +\n\t ((this[offset + 1] << 16) |\n\t (this[offset + 2] << 8) |\n\t this[offset + 3])\n\t}\n\t\n\tBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n\t offset = offset >>> 0\n\t byteLength = byteLength >>> 0\n\t if (!noAssert) checkOffset(offset, byteLength, this.length)\n\t\n\t var val = this[offset]\n\t var mul = 1\n\t var i = 0\n\t while (++i < byteLength && (mul *= 0x100)) {\n\t val += this[offset + i] * mul\n\t }\n\t mul *= 0x80\n\t\n\t if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\t\n\t return val\n\t}\n\t\n\tBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n\t offset = offset >>> 0\n\t byteLength = byteLength >>> 0\n\t if (!noAssert) checkOffset(offset, byteLength, this.length)\n\t\n\t var i = byteLength\n\t var mul = 1\n\t var val = this[offset + --i]\n\t while (i > 0 && (mul *= 0x100)) {\n\t val += this[offset + --i] * mul\n\t }\n\t mul *= 0x80\n\t\n\t if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\t\n\t return val\n\t}\n\t\n\tBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 1, this.length)\n\t if (!(this[offset] & 0x80)) return (this[offset])\n\t return ((0xff - this[offset] + 1) * -1)\n\t}\n\t\n\tBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 2, this.length)\n\t var val = this[offset] | (this[offset + 1] << 8)\n\t return (val & 0x8000) ? val | 0xFFFF0000 : val\n\t}\n\t\n\tBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 2, this.length)\n\t var val = this[offset + 1] | (this[offset] << 8)\n\t return (val & 0x8000) ? val | 0xFFFF0000 : val\n\t}\n\t\n\tBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t\n\t return (this[offset]) |\n\t (this[offset + 1] << 8) |\n\t (this[offset + 2] << 16) |\n\t (this[offset + 3] << 24)\n\t}\n\t\n\tBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t\n\t return (this[offset] << 24) |\n\t (this[offset + 1] << 16) |\n\t (this[offset + 2] << 8) |\n\t (this[offset + 3])\n\t}\n\t\n\tBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t return ieee754.read(this, offset, true, 23, 4)\n\t}\n\t\n\tBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 4, this.length)\n\t return ieee754.read(this, offset, false, 23, 4)\n\t}\n\t\n\tBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 8, this.length)\n\t return ieee754.read(this, offset, true, 52, 8)\n\t}\n\t\n\tBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n\t offset = offset >>> 0\n\t if (!noAssert) checkOffset(offset, 8, this.length)\n\t return ieee754.read(this, offset, false, 52, 8)\n\t}\n\t\n\tfunction checkInt (buf, value, offset, ext, max, min) {\n\t if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n\t if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n\t if (offset + ext > buf.length) throw new RangeError('Index out of range')\n\t}\n\t\n\tBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t byteLength = byteLength >>> 0\n\t if (!noAssert) {\n\t var maxBytes = Math.pow(2, 8 * byteLength) - 1\n\t checkInt(this, value, offset, byteLength, maxBytes, 0)\n\t }\n\t\n\t var mul = 1\n\t var i = 0\n\t this[offset] = value & 0xFF\n\t while (++i < byteLength && (mul *= 0x100)) {\n\t this[offset + i] = (value / mul) & 0xFF\n\t }\n\t\n\t return offset + byteLength\n\t}\n\t\n\tBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t byteLength = byteLength >>> 0\n\t if (!noAssert) {\n\t var maxBytes = Math.pow(2, 8 * byteLength) - 1\n\t checkInt(this, value, offset, byteLength, maxBytes, 0)\n\t }\n\t\n\t var i = byteLength - 1\n\t var mul = 1\n\t this[offset + i] = value & 0xFF\n\t while (--i >= 0 && (mul *= 0x100)) {\n\t this[offset + i] = (value / mul) & 0xFF\n\t }\n\t\n\t return offset + byteLength\n\t}\n\t\n\tBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n\t this[offset] = (value & 0xff)\n\t return offset + 1\n\t}\n\t\n\tBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n\t this[offset] = (value & 0xff)\n\t this[offset + 1] = (value >>> 8)\n\t return offset + 2\n\t}\n\t\n\tBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n\t this[offset] = (value >>> 8)\n\t this[offset + 1] = (value & 0xff)\n\t return offset + 2\n\t}\n\t\n\tBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n\t this[offset + 3] = (value >>> 24)\n\t this[offset + 2] = (value >>> 16)\n\t this[offset + 1] = (value >>> 8)\n\t this[offset] = (value & 0xff)\n\t return offset + 4\n\t}\n\t\n\tBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n\t this[offset] = (value >>> 24)\n\t this[offset + 1] = (value >>> 16)\n\t this[offset + 2] = (value >>> 8)\n\t this[offset + 3] = (value & 0xff)\n\t return offset + 4\n\t}\n\t\n\tBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) {\n\t var limit = Math.pow(2, (8 * byteLength) - 1)\n\t\n\t checkInt(this, value, offset, byteLength, limit - 1, -limit)\n\t }\n\t\n\t var i = 0\n\t var mul = 1\n\t var sub = 0\n\t this[offset] = value & 0xFF\n\t while (++i < byteLength && (mul *= 0x100)) {\n\t if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n\t sub = 1\n\t }\n\t this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n\t }\n\t\n\t return offset + byteLength\n\t}\n\t\n\tBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) {\n\t var limit = Math.pow(2, (8 * byteLength) - 1)\n\t\n\t checkInt(this, value, offset, byteLength, limit - 1, -limit)\n\t }\n\t\n\t var i = byteLength - 1\n\t var mul = 1\n\t var sub = 0\n\t this[offset + i] = value & 0xFF\n\t while (--i >= 0 && (mul *= 0x100)) {\n\t if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n\t sub = 1\n\t }\n\t this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n\t }\n\t\n\t return offset + byteLength\n\t}\n\t\n\tBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n\t if (value < 0) value = 0xff + value + 1\n\t this[offset] = (value & 0xff)\n\t return offset + 1\n\t}\n\t\n\tBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n\t this[offset] = (value & 0xff)\n\t this[offset + 1] = (value >>> 8)\n\t return offset + 2\n\t}\n\t\n\tBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n\t this[offset] = (value >>> 8)\n\t this[offset + 1] = (value & 0xff)\n\t return offset + 2\n\t}\n\t\n\tBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n\t this[offset] = (value & 0xff)\n\t this[offset + 1] = (value >>> 8)\n\t this[offset + 2] = (value >>> 16)\n\t this[offset + 3] = (value >>> 24)\n\t return offset + 4\n\t}\n\t\n\tBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n\t if (value < 0) value = 0xffffffff + value + 1\n\t this[offset] = (value >>> 24)\n\t this[offset + 1] = (value >>> 16)\n\t this[offset + 2] = (value >>> 8)\n\t this[offset + 3] = (value & 0xff)\n\t return offset + 4\n\t}\n\t\n\tfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n\t if (offset + ext > buf.length) throw new RangeError('Index out of range')\n\t if (offset < 0) throw new RangeError('Index out of range')\n\t}\n\t\n\tfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) {\n\t checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n\t }\n\t ieee754.write(buf, value, offset, littleEndian, 23, 4)\n\t return offset + 4\n\t}\n\t\n\tBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n\t return writeFloat(this, value, offset, true, noAssert)\n\t}\n\t\n\tBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n\t return writeFloat(this, value, offset, false, noAssert)\n\t}\n\t\n\tfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n\t value = +value\n\t offset = offset >>> 0\n\t if (!noAssert) {\n\t checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n\t }\n\t ieee754.write(buf, value, offset, littleEndian, 52, 8)\n\t return offset + 8\n\t}\n\t\n\tBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n\t return writeDouble(this, value, offset, true, noAssert)\n\t}\n\t\n\tBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n\t return writeDouble(this, value, offset, false, noAssert)\n\t}\n\t\n\t// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\n\tBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n\t if (!start) start = 0\n\t if (!end && end !== 0) end = this.length\n\t if (targetStart >= target.length) targetStart = target.length\n\t if (!targetStart) targetStart = 0\n\t if (end > 0 && end < start) end = start\n\t\n\t // Copy 0 bytes; we're done\n\t if (end === start) return 0\n\t if (target.length === 0 || this.length === 0) return 0\n\t\n\t // Fatal error conditions\n\t if (targetStart < 0) {\n\t throw new RangeError('targetStart out of bounds')\n\t }\n\t if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n\t if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\t\n\t // Are we oob?\n\t if (end > this.length) end = this.length\n\t if (target.length - targetStart < end - start) {\n\t end = target.length - targetStart + start\n\t }\n\t\n\t var len = end - start\n\t var i\n\t\n\t if (this === target && start < targetStart && targetStart < end) {\n\t // descending copy from end\n\t for (i = len - 1; i >= 0; --i) {\n\t target[i + targetStart] = this[i + start]\n\t }\n\t } else if (len < 1000) {\n\t // ascending copy from start\n\t for (i = 0; i < len; ++i) {\n\t target[i + targetStart] = this[i + start]\n\t }\n\t } else {\n\t Uint8Array.prototype.set.call(\n\t target,\n\t this.subarray(start, start + len),\n\t targetStart\n\t )\n\t }\n\t\n\t return len\n\t}\n\t\n\t// Usage:\n\t// buffer.fill(number[, offset[, end]])\n\t// buffer.fill(buffer[, offset[, end]])\n\t// buffer.fill(string[, offset[, end]][, encoding])\n\tBuffer.prototype.fill = function fill (val, start, end, encoding) {\n\t // Handle string cases:\n\t if (typeof val === 'string') {\n\t if (typeof start === 'string') {\n\t encoding = start\n\t start = 0\n\t end = this.length\n\t } else if (typeof end === 'string') {\n\t encoding = end\n\t end = this.length\n\t }\n\t if (val.length === 1) {\n\t var code = val.charCodeAt(0)\n\t if (code < 256) {\n\t val = code\n\t }\n\t }\n\t if (encoding !== undefined && typeof encoding !== 'string') {\n\t throw new TypeError('encoding must be a string')\n\t }\n\t if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n\t throw new TypeError('Unknown encoding: ' + encoding)\n\t }\n\t } else if (typeof val === 'number') {\n\t val = val & 255\n\t }\n\t\n\t // Invalid ranges are not set to a default, so can range check early.\n\t if (start < 0 || this.length < start || this.length < end) {\n\t throw new RangeError('Out of range index')\n\t }\n\t\n\t if (end <= start) {\n\t return this\n\t }\n\t\n\t start = start >>> 0\n\t end = end === undefined ? this.length : end >>> 0\n\t\n\t if (!val) val = 0\n\t\n\t var i\n\t if (typeof val === 'number') {\n\t for (i = start; i < end; ++i) {\n\t this[i] = val\n\t }\n\t } else {\n\t var bytes = Buffer.isBuffer(val)\n\t ? val\n\t : new Buffer(val, encoding)\n\t var len = bytes.length\n\t for (i = 0; i < end - start; ++i) {\n\t this[i + start] = bytes[i % len]\n\t }\n\t }\n\t\n\t return this\n\t}\n\t\n\t// HELPER FUNCTIONS\n\t// ================\n\t\n\tvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\t\n\tfunction base64clean (str) {\n\t // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n\t str = str.trim().replace(INVALID_BASE64_RE, '')\n\t // Node converts strings with length < 2 to ''\n\t if (str.length < 2) return ''\n\t // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n\t while (str.length % 4 !== 0) {\n\t str = str + '='\n\t }\n\t return str\n\t}\n\t\n\tfunction toHex (n) {\n\t if (n < 16) return '0' + n.toString(16)\n\t return n.toString(16)\n\t}\n\t\n\tfunction utf8ToBytes (string, units) {\n\t units = units || Infinity\n\t var codePoint\n\t var length = string.length\n\t var leadSurrogate = null\n\t var bytes = []\n\t\n\t for (var i = 0; i < length; ++i) {\n\t codePoint = string.charCodeAt(i)\n\t\n\t // is surrogate component\n\t if (codePoint > 0xD7FF && codePoint < 0xE000) {\n\t // last char was a lead\n\t if (!leadSurrogate) {\n\t // no lead yet\n\t if (codePoint > 0xDBFF) {\n\t // unexpected trail\n\t if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n\t continue\n\t } else if (i + 1 === length) {\n\t // unpaired lead\n\t if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n\t continue\n\t }\n\t\n\t // valid lead\n\t leadSurrogate = codePoint\n\t\n\t continue\n\t }\n\t\n\t // 2 leads in a row\n\t if (codePoint < 0xDC00) {\n\t if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n\t leadSurrogate = codePoint\n\t continue\n\t }\n\t\n\t // valid surrogate pair\n\t codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n\t } else if (leadSurrogate) {\n\t // valid bmp char, but last char was a lead\n\t if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n\t }\n\t\n\t leadSurrogate = null\n\t\n\t // encode utf8\n\t if (codePoint < 0x80) {\n\t if ((units -= 1) < 0) break\n\t bytes.push(codePoint)\n\t } else if (codePoint < 0x800) {\n\t if ((units -= 2) < 0) break\n\t bytes.push(\n\t codePoint >> 0x6 | 0xC0,\n\t codePoint & 0x3F | 0x80\n\t )\n\t } else if (codePoint < 0x10000) {\n\t if ((units -= 3) < 0) break\n\t bytes.push(\n\t codePoint >> 0xC | 0xE0,\n\t codePoint >> 0x6 & 0x3F | 0x80,\n\t codePoint & 0x3F | 0x80\n\t )\n\t } else if (codePoint < 0x110000) {\n\t if ((units -= 4) < 0) break\n\t bytes.push(\n\t codePoint >> 0x12 | 0xF0,\n\t codePoint >> 0xC & 0x3F | 0x80,\n\t codePoint >> 0x6 & 0x3F | 0x80,\n\t codePoint & 0x3F | 0x80\n\t )\n\t } else {\n\t throw new Error('Invalid code point')\n\t }\n\t }\n\t\n\t return bytes\n\t}\n\t\n\tfunction asciiToBytes (str) {\n\t var byteArray = []\n\t for (var i = 0; i < str.length; ++i) {\n\t // Node's code seems to be doing this and not & 0x7F..\n\t byteArray.push(str.charCodeAt(i) & 0xFF)\n\t }\n\t return byteArray\n\t}\n\t\n\tfunction utf16leToBytes (str, units) {\n\t var c, hi, lo\n\t var byteArray = []\n\t for (var i = 0; i < str.length; ++i) {\n\t if ((units -= 2) < 0) break\n\t\n\t c = str.charCodeAt(i)\n\t hi = c >> 8\n\t lo = c % 256\n\t byteArray.push(lo)\n\t byteArray.push(hi)\n\t }\n\t\n\t return byteArray\n\t}\n\t\n\tfunction base64ToBytes (str) {\n\t return base64.toByteArray(base64clean(str))\n\t}\n\t\n\tfunction blitBuffer (src, dst, offset, length) {\n\t for (var i = 0; i < length; ++i) {\n\t if ((i + offset >= dst.length) || (i >= src.length)) break\n\t dst[i + offset] = src[i]\n\t }\n\t return i\n\t}\n\t\n\t// ArrayBuffers from another context (i.e. an iframe) do not pass the `instanceof` check\n\t// but they should be treated as valid. See: https://github.com/feross/buffer/issues/166\n\tfunction isArrayBuffer (obj) {\n\t return obj instanceof ArrayBuffer ||\n\t (obj != null && obj.constructor != null && obj.constructor.name === 'ArrayBuffer' &&\n\t typeof obj.byteLength === 'number')\n\t}\n\t\n\t// Node 0.10 supports `ArrayBuffer` but lacks `ArrayBuffer.isView`\n\tfunction isArrayBufferView (obj) {\n\t return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n\t}\n\t\n\tfunction numberIsNaN (obj) {\n\t return obj !== obj // eslint-disable-line no-self-compare\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// a duplex stream is just a stream that is both readable and writable.\n\t// Since JS doesn't have multiple prototypal inheritance, this class\n\t// prototypally inherits from Readable, and then parasitically from\n\t// Writable.\n\t\n\t'use strict';\n\t\n\t/**/\n\t\n\tvar objectKeys = Object.keys || function (obj) {\n\t var keys = [];\n\t for (var key in obj) {\n\t keys.push(key);\n\t }return keys;\n\t};\n\t/**/\n\t\n\tmodule.exports = Duplex;\n\t\n\t/**/\n\tvar processNextTick = __webpack_require__(11);\n\t/**/\n\t\n\t/**/\n\tvar util = __webpack_require__(5);\n\tutil.inherits = __webpack_require__(4);\n\t/**/\n\t\n\tvar Readable = __webpack_require__(16);\n\tvar Writable = __webpack_require__(13);\n\t\n\tutil.inherits(Duplex, Readable);\n\t\n\tvar keys = objectKeys(Writable.prototype);\n\tfor (var v = 0; v < keys.length; v++) {\n\t var method = keys[v];\n\t if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n\t}\n\t\n\tfunction Duplex(options) {\n\t if (!(this instanceof Duplex)) return new Duplex(options);\n\t\n\t Readable.call(this, options);\n\t Writable.call(this, options);\n\t\n\t if (options && options.readable === false) this.readable = false;\n\t\n\t if (options && options.writable === false) this.writable = false;\n\t\n\t this.allowHalfOpen = true;\n\t if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\t\n\t this.once('end', onend);\n\t}\n\t\n\t// the no-half-open enforcer\n\tfunction onend() {\n\t // if we allow half-open state, or if the writable side ended,\n\t // then we're ok.\n\t if (this.allowHalfOpen || this._writableState.ended) return;\n\t\n\t // no more data can be written.\n\t // But allow more writes to happen in this tick.\n\t processNextTick(onEndNT, this);\n\t}\n\t\n\tfunction onEndNT(self) {\n\t self.end();\n\t}\n\t\n\tfunction forEach(xs, f) {\n\t for (var i = 0, l = xs.length; i < l; i++) {\n\t f(xs[i], i);\n\t }\n\t}\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar Process = __webpack_require__(19);\n\tvar process = new Process(), processProxy = {};\n\tfunction defineKey(key) {\n\t if (processProxy[key]) {\n\t // Probably a builtin Object property we don't care about.\n\t return;\n\t }\n\t if (typeof process[key] === 'function') {\n\t processProxy[key] = function () {\n\t return process[key].apply(process, arguments);\n\t };\n\t }\n\t else {\n\t processProxy[key] = process[key];\n\t }\n\t}\n\tfor (var key in process) {\n\t // Don't check if process.hasOwnProperty; we want to also expose objects\n\t // up the prototype hierarchy.\n\t defineKey(key);\n\t}\n\t// Special key: Ensure we update public-facing values of stdin/stdout/stderr.\n\tprocessProxy.initializeTTYs = function () {\n\t if (process.stdin === null) {\n\t process.initializeTTYs();\n\t processProxy.stdin = process.stdin;\n\t processProxy.stdout = process.stdout;\n\t processProxy.stderr = process.stderr;\n\t }\n\t};\n\tprocess.nextTick(function () {\n\t processProxy.initializeTTYs();\n\t});\n\tmodule.exports = processProxy;\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\tif (typeof Object.create === 'function') {\n\t // implementation from standard node.js 'util' module\n\t module.exports = function inherits(ctor, superCtor) {\n\t ctor.super_ = superCtor\n\t ctor.prototype = Object.create(superCtor.prototype, {\n\t constructor: {\n\t value: ctor,\n\t enumerable: false,\n\t writable: true,\n\t configurable: true\n\t }\n\t });\n\t };\n\t} else {\n\t // old school shim for old browsers\n\t module.exports = function inherits(ctor, superCtor) {\n\t ctor.super_ = superCtor\n\t var TempCtor = function () {}\n\t TempCtor.prototype = superCtor.prototype\n\t ctor.prototype = new TempCtor()\n\t ctor.prototype.constructor = ctor\n\t }\n\t}\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\t// NOTE: These type checking functions intentionally don't use `instanceof`\n\t// because it is fragile and can be easily faked with `Object.create()`.\n\t\n\tfunction isArray(arg) {\n\t if (Array.isArray) {\n\t return Array.isArray(arg);\n\t }\n\t return objectToString(arg) === '[object Array]';\n\t}\n\texports.isArray = isArray;\n\t\n\tfunction isBoolean(arg) {\n\t return typeof arg === 'boolean';\n\t}\n\texports.isBoolean = isBoolean;\n\t\n\tfunction isNull(arg) {\n\t return arg === null;\n\t}\n\texports.isNull = isNull;\n\t\n\tfunction isNullOrUndefined(arg) {\n\t return arg == null;\n\t}\n\texports.isNullOrUndefined = isNullOrUndefined;\n\t\n\tfunction isNumber(arg) {\n\t return typeof arg === 'number';\n\t}\n\texports.isNumber = isNumber;\n\t\n\tfunction isString(arg) {\n\t return typeof arg === 'string';\n\t}\n\texports.isString = isString;\n\t\n\tfunction isSymbol(arg) {\n\t return typeof arg === 'symbol';\n\t}\n\texports.isSymbol = isSymbol;\n\t\n\tfunction isUndefined(arg) {\n\t return arg === void 0;\n\t}\n\texports.isUndefined = isUndefined;\n\t\n\tfunction isRegExp(re) {\n\t return objectToString(re) === '[object RegExp]';\n\t}\n\texports.isRegExp = isRegExp;\n\t\n\tfunction isObject(arg) {\n\t return typeof arg === 'object' && arg !== null;\n\t}\n\texports.isObject = isObject;\n\t\n\tfunction isDate(d) {\n\t return objectToString(d) === '[object Date]';\n\t}\n\texports.isDate = isDate;\n\t\n\tfunction isError(e) {\n\t return (objectToString(e) === '[object Error]' || e instanceof Error);\n\t}\n\texports.isError = isError;\n\t\n\tfunction isFunction(arg) {\n\t return typeof arg === 'function';\n\t}\n\texports.isFunction = isFunction;\n\t\n\tfunction isPrimitive(arg) {\n\t return arg === null ||\n\t typeof arg === 'boolean' ||\n\t typeof arg === 'number' ||\n\t typeof arg === 'string' ||\n\t typeof arg === 'symbol' || // ES6 symbol\n\t typeof arg === 'undefined';\n\t}\n\texports.isPrimitive = isPrimitive;\n\t\n\texports.isBuffer = Buffer.isBuffer;\n\t\n\tfunction objectToString(o) {\n\t return Object.prototype.toString.call(o);\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\tfunction EventEmitter() {\n\t this._events = this._events || {};\n\t this._maxListeners = this._maxListeners || undefined;\n\t}\n\tmodule.exports = EventEmitter;\n\t\n\t// Backwards-compat with node 0.10.x\n\tEventEmitter.EventEmitter = EventEmitter;\n\t\n\tEventEmitter.prototype._events = undefined;\n\tEventEmitter.prototype._maxListeners = undefined;\n\t\n\t// By default EventEmitters will print a warning if more than 10 listeners are\n\t// added to it. This is a useful default which helps finding memory leaks.\n\tEventEmitter.defaultMaxListeners = 10;\n\t\n\t// Obviously not all Emitters should be limited to 10. This function allows\n\t// that to be increased. Set to zero for unlimited.\n\tEventEmitter.prototype.setMaxListeners = function(n) {\n\t if (!isNumber(n) || n < 0 || isNaN(n))\n\t throw TypeError('n must be a positive number');\n\t this._maxListeners = n;\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.emit = function(type) {\n\t var er, handler, len, args, i, listeners;\n\t\n\t if (!this._events)\n\t this._events = {};\n\t\n\t // If there is no 'error' event listener then throw.\n\t if (type === 'error') {\n\t if (!this._events.error ||\n\t (isObject(this._events.error) && !this._events.error.length)) {\n\t er = arguments[1];\n\t if (er instanceof Error) {\n\t throw er; // Unhandled 'error' event\n\t } else {\n\t // At least give some kind of context to the user\n\t var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n\t err.context = er;\n\t throw err;\n\t }\n\t }\n\t }\n\t\n\t handler = this._events[type];\n\t\n\t if (isUndefined(handler))\n\t return false;\n\t\n\t if (isFunction(handler)) {\n\t switch (arguments.length) {\n\t // fast cases\n\t case 1:\n\t handler.call(this);\n\t break;\n\t case 2:\n\t handler.call(this, arguments[1]);\n\t break;\n\t case 3:\n\t handler.call(this, arguments[1], arguments[2]);\n\t break;\n\t // slower\n\t default:\n\t args = Array.prototype.slice.call(arguments, 1);\n\t handler.apply(this, args);\n\t }\n\t } else if (isObject(handler)) {\n\t args = Array.prototype.slice.call(arguments, 1);\n\t listeners = handler.slice();\n\t len = listeners.length;\n\t for (i = 0; i < len; i++)\n\t listeners[i].apply(this, args);\n\t }\n\t\n\t return true;\n\t};\n\t\n\tEventEmitter.prototype.addListener = function(type, listener) {\n\t var m;\n\t\n\t if (!isFunction(listener))\n\t throw TypeError('listener must be a function');\n\t\n\t if (!this._events)\n\t this._events = {};\n\t\n\t // To avoid recursion in the case that type === \"newListener\"! Before\n\t // adding it to the listeners, first emit \"newListener\".\n\t if (this._events.newListener)\n\t this.emit('newListener', type,\n\t isFunction(listener.listener) ?\n\t listener.listener : listener);\n\t\n\t if (!this._events[type])\n\t // Optimize the case of one listener. Don't need the extra array object.\n\t this._events[type] = listener;\n\t else if (isObject(this._events[type]))\n\t // If we've already got an array, just append.\n\t this._events[type].push(listener);\n\t else\n\t // Adding the second element, need to change to array.\n\t this._events[type] = [this._events[type], listener];\n\t\n\t // Check for listener leak\n\t if (isObject(this._events[type]) && !this._events[type].warned) {\n\t if (!isUndefined(this._maxListeners)) {\n\t m = this._maxListeners;\n\t } else {\n\t m = EventEmitter.defaultMaxListeners;\n\t }\n\t\n\t if (m && m > 0 && this._events[type].length > m) {\n\t this._events[type].warned = true;\n\t console.error('(node) warning: possible EventEmitter memory ' +\n\t 'leak detected. %d listeners added. ' +\n\t 'Use emitter.setMaxListeners() to increase limit.',\n\t this._events[type].length);\n\t if (typeof console.trace === 'function') {\n\t // not supported in IE 10\n\t console.trace();\n\t }\n\t }\n\t }\n\t\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\t\n\tEventEmitter.prototype.once = function(type, listener) {\n\t if (!isFunction(listener))\n\t throw TypeError('listener must be a function');\n\t\n\t var fired = false;\n\t\n\t function g() {\n\t this.removeListener(type, g);\n\t\n\t if (!fired) {\n\t fired = true;\n\t listener.apply(this, arguments);\n\t }\n\t }\n\t\n\t g.listener = listener;\n\t this.on(type, g);\n\t\n\t return this;\n\t};\n\t\n\t// emits a 'removeListener' event iff the listener was removed\n\tEventEmitter.prototype.removeListener = function(type, listener) {\n\t var list, position, length, i;\n\t\n\t if (!isFunction(listener))\n\t throw TypeError('listener must be a function');\n\t\n\t if (!this._events || !this._events[type])\n\t return this;\n\t\n\t list = this._events[type];\n\t length = list.length;\n\t position = -1;\n\t\n\t if (list === listener ||\n\t (isFunction(list.listener) && list.listener === listener)) {\n\t delete this._events[type];\n\t if (this._events.removeListener)\n\t this.emit('removeListener', type, listener);\n\t\n\t } else if (isObject(list)) {\n\t for (i = length; i-- > 0;) {\n\t if (list[i] === listener ||\n\t (list[i].listener && list[i].listener === listener)) {\n\t position = i;\n\t break;\n\t }\n\t }\n\t\n\t if (position < 0)\n\t return this;\n\t\n\t if (list.length === 1) {\n\t list.length = 0;\n\t delete this._events[type];\n\t } else {\n\t list.splice(position, 1);\n\t }\n\t\n\t if (this._events.removeListener)\n\t this.emit('removeListener', type, listener);\n\t }\n\t\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.removeAllListeners = function(type) {\n\t var key, listeners;\n\t\n\t if (!this._events)\n\t return this;\n\t\n\t // not listening for removeListener, no need to emit\n\t if (!this._events.removeListener) {\n\t if (arguments.length === 0)\n\t this._events = {};\n\t else if (this._events[type])\n\t delete this._events[type];\n\t return this;\n\t }\n\t\n\t // emit removeListener for all listeners on all events\n\t if (arguments.length === 0) {\n\t for (key in this._events) {\n\t if (key === 'removeListener') continue;\n\t this.removeAllListeners(key);\n\t }\n\t this.removeAllListeners('removeListener');\n\t this._events = {};\n\t return this;\n\t }\n\t\n\t listeners = this._events[type];\n\t\n\t if (isFunction(listeners)) {\n\t this.removeListener(type, listeners);\n\t } else if (listeners) {\n\t // LIFO order\n\t while (listeners.length)\n\t this.removeListener(type, listeners[listeners.length - 1]);\n\t }\n\t delete this._events[type];\n\t\n\t return this;\n\t};\n\t\n\tEventEmitter.prototype.listeners = function(type) {\n\t var ret;\n\t if (!this._events || !this._events[type])\n\t ret = [];\n\t else if (isFunction(this._events[type]))\n\t ret = [this._events[type]];\n\t else\n\t ret = this._events[type].slice();\n\t return ret;\n\t};\n\t\n\tEventEmitter.prototype.listenerCount = function(type) {\n\t if (this._events) {\n\t var evlistener = this._events[type];\n\t\n\t if (isFunction(evlistener))\n\t return 1;\n\t else if (evlistener)\n\t return evlistener.length;\n\t }\n\t return 0;\n\t};\n\t\n\tEventEmitter.listenerCount = function(emitter, type) {\n\t return emitter.listenerCount(type);\n\t};\n\t\n\tfunction isFunction(arg) {\n\t return typeof arg === 'function';\n\t}\n\t\n\tfunction isNumber(arg) {\n\t return typeof arg === 'number';\n\t}\n\t\n\tfunction isObject(arg) {\n\t return typeof arg === 'object' && arg !== null;\n\t}\n\t\n\tfunction isUndefined(arg) {\n\t return arg === void 0;\n\t}\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(1).Buffer;\n\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t\n\tvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n\t (typeof Uint16Array !== 'undefined') &&\n\t (typeof Int32Array !== 'undefined');\n\t\n\t\n\texports.assign = function (obj /*from1, from2, from3, ...*/) {\n\t var sources = Array.prototype.slice.call(arguments, 1);\n\t while (sources.length) {\n\t var source = sources.shift();\n\t if (!source) { continue; }\n\t\n\t if (typeof source !== 'object') {\n\t throw new TypeError(source + 'must be non-object');\n\t }\n\t\n\t for (var p in source) {\n\t if (source.hasOwnProperty(p)) {\n\t obj[p] = source[p];\n\t }\n\t }\n\t }\n\t\n\t return obj;\n\t};\n\t\n\t\n\t// reduce buffer size, avoiding mem copy\n\texports.shrinkBuf = function (buf, size) {\n\t if (buf.length === size) { return buf; }\n\t if (buf.subarray) { return buf.subarray(0, size); }\n\t buf.length = size;\n\t return buf;\n\t};\n\t\n\t\n\tvar fnTyped = {\n\t arraySet: function (dest, src, src_offs, len, dest_offs) {\n\t if (src.subarray && dest.subarray) {\n\t dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n\t return;\n\t }\n\t // Fallback to ordinary array\n\t for (var i = 0; i < len; i++) {\n\t dest[dest_offs + i] = src[src_offs + i];\n\t }\n\t },\n\t // Join array of chunks to single array.\n\t flattenChunks: function (chunks) {\n\t var i, l, len, pos, chunk, result;\n\t\n\t // calculate data length\n\t len = 0;\n\t for (i = 0, l = chunks.length; i < l; i++) {\n\t len += chunks[i].length;\n\t }\n\t\n\t // join chunks\n\t result = new Uint8Array(len);\n\t pos = 0;\n\t for (i = 0, l = chunks.length; i < l; i++) {\n\t chunk = chunks[i];\n\t result.set(chunk, pos);\n\t pos += chunk.length;\n\t }\n\t\n\t return result;\n\t }\n\t};\n\t\n\tvar fnUntyped = {\n\t arraySet: function (dest, src, src_offs, len, dest_offs) {\n\t for (var i = 0; i < len; i++) {\n\t dest[dest_offs + i] = src[src_offs + i];\n\t }\n\t },\n\t // Join array of chunks to single array.\n\t flattenChunks: function (chunks) {\n\t return [].concat.apply([], chunks);\n\t }\n\t};\n\t\n\t\n\t// Enable/Disable typed arrays use, for testing\n\t//\n\texports.setTyped = function (on) {\n\t if (on) {\n\t exports.Buf8 = Uint8Array;\n\t exports.Buf16 = Uint16Array;\n\t exports.Buf32 = Int32Array;\n\t exports.assign(exports, fnTyped);\n\t } else {\n\t exports.Buf8 = Array;\n\t exports.Buf16 = Array;\n\t exports.Buf32 = Array;\n\t exports.assign(exports, fnUntyped);\n\t }\n\t};\n\t\n\texports.setTyped(TYPED_OK);\n\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\tmodule.exports = Stream;\n\t\n\tvar EE = __webpack_require__(6).EventEmitter;\n\tvar inherits = __webpack_require__(4);\n\t\n\tinherits(Stream, EE);\n\tStream.Readable = __webpack_require__(37);\n\tStream.Writable = __webpack_require__(39);\n\tStream.Duplex = __webpack_require__(34);\n\tStream.Transform = __webpack_require__(38);\n\tStream.PassThrough = __webpack_require__(36);\n\t\n\t// Backwards-compat with node 0.4.x\n\tStream.Stream = Stream;\n\t\n\t\n\t\n\t// old-style streams. Note that the pipe method (the only relevant\n\t// part of this class) is overridden in the Readable class.\n\t\n\tfunction Stream() {\n\t EE.call(this);\n\t}\n\t\n\tStream.prototype.pipe = function(dest, options) {\n\t var source = this;\n\t\n\t function ondata(chunk) {\n\t if (dest.writable) {\n\t if (false === dest.write(chunk) && source.pause) {\n\t source.pause();\n\t }\n\t }\n\t }\n\t\n\t source.on('data', ondata);\n\t\n\t function ondrain() {\n\t if (source.readable && source.resume) {\n\t source.resume();\n\t }\n\t }\n\t\n\t dest.on('drain', ondrain);\n\t\n\t // If the 'end' option is not supplied, dest.end() will be called when\n\t // source gets the 'end' or 'close' events. Only dest.end() once.\n\t if (!dest._isStdio && (!options || options.end !== false)) {\n\t source.on('end', onend);\n\t source.on('close', onclose);\n\t }\n\t\n\t var didOnEnd = false;\n\t function onend() {\n\t if (didOnEnd) return;\n\t didOnEnd = true;\n\t\n\t dest.end();\n\t }\n\t\n\t\n\t function onclose() {\n\t if (didOnEnd) return;\n\t didOnEnd = true;\n\t\n\t if (typeof dest.destroy === 'function') dest.destroy();\n\t }\n\t\n\t // don't leave dangling pipes when there are errors.\n\t function onerror(er) {\n\t cleanup();\n\t if (EE.listenerCount(this, 'error') === 0) {\n\t throw er; // Unhandled stream error in pipe.\n\t }\n\t }\n\t\n\t source.on('error', onerror);\n\t dest.on('error', onerror);\n\t\n\t // remove all the event listeners that were added.\n\t function cleanup() {\n\t source.removeListener('data', ondata);\n\t dest.removeListener('drain', ondrain);\n\t\n\t source.removeListener('end', onend);\n\t source.removeListener('close', onclose);\n\t\n\t source.removeListener('error', onerror);\n\t dest.removeListener('error', onerror);\n\t\n\t source.removeListener('end', cleanup);\n\t source.removeListener('close', cleanup);\n\t\n\t dest.removeListener('close', cleanup);\n\t }\n\t\n\t source.on('end', cleanup);\n\t source.on('close', cleanup);\n\t\n\t dest.on('close', cleanup);\n\t\n\t dest.emit('pipe', source);\n\t\n\t // Allow for unix-like usage: A.pipe(B).pipe(C)\n\t return dest;\n\t};\n\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tvar buffer = __webpack_require__(1);\n\tvar Buffer = buffer.Buffer;\n\tvar SlowBuffer = buffer.SlowBuffer;\n\tvar MAX_LEN = buffer.kMaxLength || 2147483647;\n\texports.alloc = function alloc(size, fill, encoding) {\n\t if (typeof Buffer.alloc === 'function') {\n\t return Buffer.alloc(size, fill, encoding);\n\t }\n\t if (typeof encoding === 'number') {\n\t throw new TypeError('encoding must not be number');\n\t }\n\t if (typeof size !== 'number') {\n\t throw new TypeError('size must be a number');\n\t }\n\t if (size > MAX_LEN) {\n\t throw new RangeError('size is too large');\n\t }\n\t var enc = encoding;\n\t var _fill = fill;\n\t if (_fill === undefined) {\n\t enc = undefined;\n\t _fill = 0;\n\t }\n\t var buf = new Buffer(size);\n\t if (typeof _fill === 'string') {\n\t var fillBuf = new Buffer(_fill, enc);\n\t var flen = fillBuf.length;\n\t var i = -1;\n\t while (++i < size) {\n\t buf[i] = fillBuf[i % flen];\n\t }\n\t } else {\n\t buf.fill(_fill);\n\t }\n\t return buf;\n\t}\n\texports.allocUnsafe = function allocUnsafe(size) {\n\t if (typeof Buffer.allocUnsafe === 'function') {\n\t return Buffer.allocUnsafe(size);\n\t }\n\t if (typeof size !== 'number') {\n\t throw new TypeError('size must be a number');\n\t }\n\t if (size > MAX_LEN) {\n\t throw new RangeError('size is too large');\n\t }\n\t return new Buffer(size);\n\t}\n\texports.from = function from(value, encodingOrOffset, length) {\n\t if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {\n\t return Buffer.from(value, encodingOrOffset, length);\n\t }\n\t if (typeof value === 'number') {\n\t throw new TypeError('\"value\" argument must not be a number');\n\t }\n\t if (typeof value === 'string') {\n\t return new Buffer(value, encodingOrOffset);\n\t }\n\t if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n\t var offset = encodingOrOffset;\n\t if (arguments.length === 1) {\n\t return new Buffer(value);\n\t }\n\t if (typeof offset === 'undefined') {\n\t offset = 0;\n\t }\n\t var len = length;\n\t if (typeof len === 'undefined') {\n\t len = value.byteLength - offset;\n\t }\n\t if (offset >= value.byteLength) {\n\t throw new RangeError('\\'offset\\' is out of bounds');\n\t }\n\t if (len > value.byteLength - offset) {\n\t throw new RangeError('\\'length\\' is out of bounds');\n\t }\n\t return new Buffer(value.slice(offset, offset + len));\n\t }\n\t if (Buffer.isBuffer(value)) {\n\t var out = new Buffer(value.length);\n\t value.copy(out, 0, 0, value.length);\n\t return out;\n\t }\n\t if (value) {\n\t if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {\n\t return new Buffer(value);\n\t }\n\t if (value.type === 'Buffer' && Array.isArray(value.data)) {\n\t return new Buffer(value.data);\n\t }\n\t }\n\t\n\t throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');\n\t}\n\texports.allocUnsafeSlow = function allocUnsafeSlow(size) {\n\t if (typeof Buffer.allocUnsafeSlow === 'function') {\n\t return Buffer.allocUnsafeSlow(size);\n\t }\n\t if (typeof size !== 'number') {\n\t throw new TypeError('size must be a number');\n\t }\n\t if (size >= MAX_LEN) {\n\t throw new RangeError('size is too large');\n\t }\n\t return new SlowBuffer(size);\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {'use strict';\n\t\n\tif (!process.version ||\n\t process.version.indexOf('v0.') === 0 ||\n\t process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n\t module.exports = nextTick;\n\t} else {\n\t module.exports = process.nextTick;\n\t}\n\t\n\tfunction nextTick(fn, arg1, arg2, arg3) {\n\t if (typeof fn !== 'function') {\n\t throw new TypeError('\"callback\" argument must be a function');\n\t }\n\t var len = arguments.length;\n\t var args, i;\n\t switch (len) {\n\t case 0:\n\t case 1:\n\t return process.nextTick(fn);\n\t case 2:\n\t return process.nextTick(function afterTickOne() {\n\t fn.call(null, arg1);\n\t });\n\t case 3:\n\t return process.nextTick(function afterTickTwo() {\n\t fn.call(null, arg1, arg2);\n\t });\n\t case 4:\n\t return process.nextTick(function afterTickThree() {\n\t fn.call(null, arg1, arg2, arg3);\n\t });\n\t default:\n\t args = new Array(len - 1);\n\t i = 0;\n\t while (i < args.length) {\n\t args[i++] = arguments[i];\n\t }\n\t return process.nextTick(function afterTick() {\n\t fn.apply(null, args);\n\t });\n\t }\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// a transform stream is a readable/writable stream where you do\n\t// something with the data. Sometimes it's called a \"filter\",\n\t// but that's not a great name for it, since that implies a thing where\n\t// some bits pass through, and others are simply ignored. (That would\n\t// be a valid example of a transform, of course.)\n\t//\n\t// While the output is causally related to the input, it's not a\n\t// necessarily symmetric or synchronous transformation. For example,\n\t// a zlib stream might take multiple plain-text writes(), and then\n\t// emit a single compressed chunk some time in the future.\n\t//\n\t// Here's how this works:\n\t//\n\t// The Transform stream has all the aspects of the readable and writable\n\t// stream classes. When you write(chunk), that calls _write(chunk,cb)\n\t// internally, and returns false if there's a lot of pending writes\n\t// buffered up. When you call read(), that calls _read(n) until\n\t// there's enough pending readable data buffered up.\n\t//\n\t// In a transform stream, the written data is placed in a buffer. When\n\t// _read(n) is called, it transforms the queued up data, calling the\n\t// buffered _write cb's as it consumes chunks. If consuming a single\n\t// written chunk would result in multiple output chunks, then the first\n\t// outputted bit calls the readcb, and subsequent chunks just go into\n\t// the read buffer, and will cause it to emit 'readable' if necessary.\n\t//\n\t// This way, back-pressure is actually determined by the reading side,\n\t// since _read has to be called to start processing a new chunk. However,\n\t// a pathological inflate type of transform can cause excessive buffering\n\t// here. For example, imagine a stream where every byte of input is\n\t// interpreted as an integer from 0-255, and then results in that many\n\t// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n\t// 1kb of data being output. In this case, you could write a very small\n\t// amount of input, and end up with a very large amount of output. In\n\t// such a pathological inflating mechanism, there'd be no way to tell\n\t// the system to stop doing the transform. A single 4MB write could\n\t// cause the system to run out of memory.\n\t//\n\t// However, even in such a pathological case, only a single written chunk\n\t// would be consumed, and then the rest would wait (un-transformed) until\n\t// the results of the previous transformed chunk were consumed.\n\t\n\t'use strict';\n\t\n\tmodule.exports = Transform;\n\t\n\tvar Duplex = __webpack_require__(2);\n\t\n\t/**/\n\tvar util = __webpack_require__(5);\n\tutil.inherits = __webpack_require__(4);\n\t/**/\n\t\n\tutil.inherits(Transform, Duplex);\n\t\n\tfunction TransformState(stream) {\n\t this.afterTransform = function (er, data) {\n\t return afterTransform(stream, er, data);\n\t };\n\t\n\t this.needTransform = false;\n\t this.transforming = false;\n\t this.writecb = null;\n\t this.writechunk = null;\n\t this.writeencoding = null;\n\t}\n\t\n\tfunction afterTransform(stream, er, data) {\n\t var ts = stream._transformState;\n\t ts.transforming = false;\n\t\n\t var cb = ts.writecb;\n\t\n\t if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));\n\t\n\t ts.writechunk = null;\n\t ts.writecb = null;\n\t\n\t if (data !== null && data !== undefined) stream.push(data);\n\t\n\t cb(er);\n\t\n\t var rs = stream._readableState;\n\t rs.reading = false;\n\t if (rs.needReadable || rs.length < rs.highWaterMark) {\n\t stream._read(rs.highWaterMark);\n\t }\n\t}\n\t\n\tfunction Transform(options) {\n\t if (!(this instanceof Transform)) return new Transform(options);\n\t\n\t Duplex.call(this, options);\n\t\n\t this._transformState = new TransformState(this);\n\t\n\t var stream = this;\n\t\n\t // start out asking for a readable event once data is transformed.\n\t this._readableState.needReadable = true;\n\t\n\t // we have implemented the _read method, and done the other things\n\t // that Readable wants before the first _read call, so unset the\n\t // sync guard flag.\n\t this._readableState.sync = false;\n\t\n\t if (options) {\n\t if (typeof options.transform === 'function') this._transform = options.transform;\n\t\n\t if (typeof options.flush === 'function') this._flush = options.flush;\n\t }\n\t\n\t // When the writable side finishes, then flush out anything remaining.\n\t this.once('prefinish', function () {\n\t if (typeof this._flush === 'function') this._flush(function (er, data) {\n\t done(stream, er, data);\n\t });else done(stream);\n\t });\n\t}\n\t\n\tTransform.prototype.push = function (chunk, encoding) {\n\t this._transformState.needTransform = false;\n\t return Duplex.prototype.push.call(this, chunk, encoding);\n\t};\n\t\n\t// This is the part where you do stuff!\n\t// override this function in implementation classes.\n\t// 'chunk' is an input chunk.\n\t//\n\t// Call `push(newChunk)` to pass along transformed output\n\t// to the readable side. You may call 'push' zero or more times.\n\t//\n\t// Call `cb(err)` when you are done with this chunk. If you pass\n\t// an error, then that'll put the hurt on the whole operation. If you\n\t// never call cb(), then you'll never get another chunk.\n\tTransform.prototype._transform = function (chunk, encoding, cb) {\n\t throw new Error('_transform() is not implemented');\n\t};\n\t\n\tTransform.prototype._write = function (chunk, encoding, cb) {\n\t var ts = this._transformState;\n\t ts.writecb = cb;\n\t ts.writechunk = chunk;\n\t ts.writeencoding = encoding;\n\t if (!ts.transforming) {\n\t var rs = this._readableState;\n\t if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n\t }\n\t};\n\t\n\t// Doesn't matter what the args are here.\n\t// _transform does all the work.\n\t// That we got here means that the readable side wants more data.\n\tTransform.prototype._read = function (n) {\n\t var ts = this._transformState;\n\t\n\t if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n\t ts.transforming = true;\n\t this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n\t } else {\n\t // mark that we need a transform, so that any data that comes in\n\t // will get processed, now that we've asked for it.\n\t ts.needTransform = true;\n\t }\n\t};\n\t\n\tfunction done(stream, er, data) {\n\t if (er) return stream.emit('error', er);\n\t\n\t if (data !== null && data !== undefined) stream.push(data);\n\t\n\t // if there's nothing in the write buffer, then that means\n\t // that nothing more will ever be provided\n\t var ws = stream._writableState;\n\t var ts = stream._transformState;\n\t\n\t if (ws.length) throw new Error('Calling transform done when ws.length != 0');\n\t\n\t if (ts.transforming) throw new Error('Calling transform done when still transforming');\n\t\n\t return stream.push(null);\n\t}\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {// A bit simpler than readable streams.\n\t// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n\t// the drain event emission and buffering.\n\t\n\t'use strict';\n\t\n\tmodule.exports = Writable;\n\t\n\t/**/\n\tvar processNextTick = __webpack_require__(11);\n\t/**/\n\t\n\t/**/\n\tvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;\n\t/**/\n\t\n\t/**/\n\tvar Duplex;\n\t/**/\n\t\n\tWritable.WritableState = WritableState;\n\t\n\t/**/\n\tvar util = __webpack_require__(5);\n\tutil.inherits = __webpack_require__(4);\n\t/**/\n\t\n\t/**/\n\tvar internalUtil = {\n\t deprecate: __webpack_require__(40)\n\t};\n\t/**/\n\t\n\t/**/\n\tvar Stream;\n\t(function () {\n\t try {\n\t Stream = __webpack_require__(9);\n\t } catch (_) {} finally {\n\t if (!Stream) Stream = __webpack_require__(6).EventEmitter;\n\t }\n\t})();\n\t/**/\n\t\n\tvar Buffer = __webpack_require__(1).Buffer;\n\t/**/\n\tvar bufferShim = __webpack_require__(10);\n\t/**/\n\t\n\tutil.inherits(Writable, Stream);\n\t\n\tfunction nop() {}\n\t\n\tfunction WriteReq(chunk, encoding, cb) {\n\t this.chunk = chunk;\n\t this.encoding = encoding;\n\t this.callback = cb;\n\t this.next = null;\n\t}\n\t\n\tfunction WritableState(options, stream) {\n\t Duplex = Duplex || __webpack_require__(2);\n\t\n\t options = options || {};\n\t\n\t // object stream flag to indicate whether or not this stream\n\t // contains buffers or objects.\n\t this.objectMode = !!options.objectMode;\n\t\n\t if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\t\n\t // the point at which write() starts returning false\n\t // Note: 0 is a valid value, means that we always return false if\n\t // the entire buffer is not flushed immediately on write()\n\t var hwm = options.highWaterMark;\n\t var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\t this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;\n\t\n\t // cast to ints.\n\t this.highWaterMark = ~~this.highWaterMark;\n\t\n\t // drain event flag.\n\t this.needDrain = false;\n\t // at the start of calling end()\n\t this.ending = false;\n\t // when end() has been called, and returned\n\t this.ended = false;\n\t // when 'finish' is emitted\n\t this.finished = false;\n\t\n\t // should we decode strings into buffers before passing to _write?\n\t // this is here so that some node-core streams can optimize string\n\t // handling at a lower level.\n\t var noDecode = options.decodeStrings === false;\n\t this.decodeStrings = !noDecode;\n\t\n\t // Crypto is kind of old and crusty. Historically, its default string\n\t // encoding is 'binary' so we have to make this configurable.\n\t // Everything else in the universe uses 'utf8', though.\n\t this.defaultEncoding = options.defaultEncoding || 'utf8';\n\t\n\t // not an actual buffer we keep track of, but a measurement\n\t // of how much we're waiting to get pushed to some underlying\n\t // socket or file.\n\t this.length = 0;\n\t\n\t // a flag to see when we're in the middle of a write.\n\t this.writing = false;\n\t\n\t // when true all writes will be buffered until .uncork() call\n\t this.corked = 0;\n\t\n\t // a flag to be able to tell if the onwrite cb is called immediately,\n\t // or on a later tick. We set this to true at first, because any\n\t // actions that shouldn't happen until \"later\" should generally also\n\t // not happen before the first write call.\n\t this.sync = true;\n\t\n\t // a flag to know if we're processing previously buffered items, which\n\t // may call the _write() callback in the same tick, so that we don't\n\t // end up in an overlapped onwrite situation.\n\t this.bufferProcessing = false;\n\t\n\t // the callback that's passed to _write(chunk,cb)\n\t this.onwrite = function (er) {\n\t onwrite(stream, er);\n\t };\n\t\n\t // the callback that the user supplies to write(chunk,encoding,cb)\n\t this.writecb = null;\n\t\n\t // the amount that is being written when _write is called.\n\t this.writelen = 0;\n\t\n\t this.bufferedRequest = null;\n\t this.lastBufferedRequest = null;\n\t\n\t // number of pending user-supplied write callbacks\n\t // this must be 0 before 'finish' can be emitted\n\t this.pendingcb = 0;\n\t\n\t // emit prefinish if the only thing we're waiting for is _write cbs\n\t // This is relevant for synchronous Transform streams\n\t this.prefinished = false;\n\t\n\t // True if the error was already emitted and should not be thrown again\n\t this.errorEmitted = false;\n\t\n\t // count buffered requests\n\t this.bufferedRequestCount = 0;\n\t\n\t // allocate the first CorkedRequest, there is always\n\t // one allocated and free to use, and we maintain at most two\n\t this.corkedRequestsFree = new CorkedRequest(this);\n\t}\n\t\n\tWritableState.prototype.getBuffer = function getBuffer() {\n\t var current = this.bufferedRequest;\n\t var out = [];\n\t while (current) {\n\t out.push(current);\n\t current = current.next;\n\t }\n\t return out;\n\t};\n\t\n\t(function () {\n\t try {\n\t Object.defineProperty(WritableState.prototype, 'buffer', {\n\t get: internalUtil.deprecate(function () {\n\t return this.getBuffer();\n\t }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')\n\t });\n\t } catch (_) {}\n\t})();\n\t\n\t// Test _writableState for inheritance to account for Duplex streams,\n\t// whose prototype chain only points to Readable.\n\tvar realHasInstance;\n\tif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n\t realHasInstance = Function.prototype[Symbol.hasInstance];\n\t Object.defineProperty(Writable, Symbol.hasInstance, {\n\t value: function (object) {\n\t if (realHasInstance.call(this, object)) return true;\n\t\n\t return object && object._writableState instanceof WritableState;\n\t }\n\t });\n\t} else {\n\t realHasInstance = function (object) {\n\t return object instanceof this;\n\t };\n\t}\n\t\n\tfunction Writable(options) {\n\t Duplex = Duplex || __webpack_require__(2);\n\t\n\t // Writable ctor is applied to Duplexes, too.\n\t // `realHasInstance` is necessary because using plain `instanceof`\n\t // would return false, as no `_writableState` property is attached.\n\t\n\t // Trying to use the custom `instanceof` for Writable here will also break the\n\t // Node.js LazyTransform implementation, which has a non-trivial getter for\n\t // `_writableState` that would lead to infinite recursion.\n\t if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n\t return new Writable(options);\n\t }\n\t\n\t this._writableState = new WritableState(options, this);\n\t\n\t // legacy.\n\t this.writable = true;\n\t\n\t if (options) {\n\t if (typeof options.write === 'function') this._write = options.write;\n\t\n\t if (typeof options.writev === 'function') this._writev = options.writev;\n\t }\n\t\n\t Stream.call(this);\n\t}\n\t\n\t// Otherwise people can pipe Writable streams, which is just wrong.\n\tWritable.prototype.pipe = function () {\n\t this.emit('error', new Error('Cannot pipe, not readable'));\n\t};\n\t\n\tfunction writeAfterEnd(stream, cb) {\n\t var er = new Error('write after end');\n\t // TODO: defer error events consistently everywhere, not just the cb\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t}\n\t\n\t// Checks that a user-supplied chunk is valid, especially for the particular\n\t// mode the stream is in. Currently this means that `null` is never accepted\n\t// and undefined/non-string values are only allowed in object mode.\n\tfunction validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t var er = false;\n\t\n\t if (chunk === null) {\n\t er = new TypeError('May not write null values to stream');\n\t } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t if (er) {\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}\n\t\n\tWritable.prototype.write = function (chunk, encoding, cb) {\n\t var state = this._writableState;\n\t var ret = false;\n\t var isBuf = Buffer.isBuffer(chunk);\n\t\n\t if (typeof encoding === 'function') {\n\t cb = encoding;\n\t encoding = null;\n\t }\n\t\n\t if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\t\n\t if (typeof cb !== 'function') cb = nop;\n\t\n\t if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n\t state.pendingcb++;\n\t ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n\t }\n\t\n\t return ret;\n\t};\n\t\n\tWritable.prototype.cork = function () {\n\t var state = this._writableState;\n\t\n\t state.corked++;\n\t};\n\t\n\tWritable.prototype.uncork = function () {\n\t var state = this._writableState;\n\t\n\t if (state.corked) {\n\t state.corked--;\n\t\n\t if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n\t }\n\t};\n\t\n\tWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n\t // node::ParseEncoding() requires lower case.\n\t if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n\t if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n\t this._writableState.defaultEncoding = encoding;\n\t return this;\n\t};\n\t\n\tfunction decodeChunk(state, chunk, encoding) {\n\t if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n\t chunk = bufferShim.from(chunk, encoding);\n\t }\n\t return chunk;\n\t}\n\t\n\t// if we're already writing something, then just put this\n\t// in the queue, and wait our turn. Otherwise, call _write\n\t// If we return false, then we need a drain event, so set that flag.\n\tfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n\t if (!isBuf) {\n\t chunk = decodeChunk(state, chunk, encoding);\n\t if (Buffer.isBuffer(chunk)) encoding = 'buffer';\n\t }\n\t var len = state.objectMode ? 1 : chunk.length;\n\t\n\t state.length += len;\n\t\n\t var ret = state.length < state.highWaterMark;\n\t // we must ensure that previous needDrain will not be reset to false.\n\t if (!ret) state.needDrain = true;\n\t\n\t if (state.writing || state.corked) {\n\t var last = state.lastBufferedRequest;\n\t state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);\n\t if (last) {\n\t last.next = state.lastBufferedRequest;\n\t } else {\n\t state.bufferedRequest = state.lastBufferedRequest;\n\t }\n\t state.bufferedRequestCount += 1;\n\t } else {\n\t doWrite(stream, state, false, len, chunk, encoding, cb);\n\t }\n\t\n\t return ret;\n\t}\n\t\n\tfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n\t state.writelen = len;\n\t state.writecb = cb;\n\t state.writing = true;\n\t state.sync = true;\n\t if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n\t state.sync = false;\n\t}\n\t\n\tfunction onwriteError(stream, state, sync, er, cb) {\n\t --state.pendingcb;\n\t if (sync) processNextTick(cb, er);else cb(er);\n\t\n\t stream._writableState.errorEmitted = true;\n\t stream.emit('error', er);\n\t}\n\t\n\tfunction onwriteStateUpdate(state) {\n\t state.writing = false;\n\t state.writecb = null;\n\t state.length -= state.writelen;\n\t state.writelen = 0;\n\t}\n\t\n\tfunction onwrite(stream, er) {\n\t var state = stream._writableState;\n\t var sync = state.sync;\n\t var cb = state.writecb;\n\t\n\t onwriteStateUpdate(state);\n\t\n\t if (er) onwriteError(stream, state, sync, er, cb);else {\n\t // Check if we're actually ready to finish, but don't emit yet\n\t var finished = needFinish(state);\n\t\n\t if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n\t clearBuffer(stream, state);\n\t }\n\t\n\t if (sync) {\n\t /**/\n\t asyncWrite(afterWrite, stream, state, finished, cb);\n\t /**/\n\t } else {\n\t afterWrite(stream, state, finished, cb);\n\t }\n\t }\n\t}\n\t\n\tfunction afterWrite(stream, state, finished, cb) {\n\t if (!finished) onwriteDrain(stream, state);\n\t state.pendingcb--;\n\t cb();\n\t finishMaybe(stream, state);\n\t}\n\t\n\t// Must force callback to be called on nextTick, so that we don't\n\t// emit 'drain' before the write() consumer gets the 'false' return\n\t// value, and has a chance to attach a 'drain' listener.\n\tfunction onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}\n\t\n\t// if there's something in the buffer waiting, then process it\n\tfunction clearBuffer(stream, state) {\n\t state.bufferProcessing = true;\n\t var entry = state.bufferedRequest;\n\t\n\t if (stream._writev && entry && entry.next) {\n\t // Fast case, write everything using _writev()\n\t var l = state.bufferedRequestCount;\n\t var buffer = new Array(l);\n\t var holder = state.corkedRequestsFree;\n\t holder.entry = entry;\n\t\n\t var count = 0;\n\t while (entry) {\n\t buffer[count] = entry;\n\t entry = entry.next;\n\t count += 1;\n\t }\n\t\n\t doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\t\n\t // doWrite is almost always async, defer these to save a bit of time\n\t // as the hot path ends with doWrite\n\t state.pendingcb++;\n\t state.lastBufferedRequest = null;\n\t if (holder.next) {\n\t state.corkedRequestsFree = holder.next;\n\t holder.next = null;\n\t } else {\n\t state.corkedRequestsFree = new CorkedRequest(state);\n\t }\n\t } else {\n\t // Slow case, write chunks one-by-one\n\t while (entry) {\n\t var chunk = entry.chunk;\n\t var encoding = entry.encoding;\n\t var cb = entry.callback;\n\t var len = state.objectMode ? 1 : chunk.length;\n\t\n\t doWrite(stream, state, false, len, chunk, encoding, cb);\n\t entry = entry.next;\n\t // if we didn't call the onwrite immediately, then\n\t // it means that we need to wait until it does.\n\t // also, that means that the chunk and cb are currently\n\t // being processed, so move the buffer counter past them.\n\t if (state.writing) {\n\t break;\n\t }\n\t }\n\t\n\t if (entry === null) state.lastBufferedRequest = null;\n\t }\n\t\n\t state.bufferedRequestCount = 0;\n\t state.bufferedRequest = entry;\n\t state.bufferProcessing = false;\n\t}\n\t\n\tWritable.prototype._write = function (chunk, encoding, cb) {\n\t cb(new Error('_write() is not implemented'));\n\t};\n\t\n\tWritable.prototype._writev = null;\n\t\n\tWritable.prototype.end = function (chunk, encoding, cb) {\n\t var state = this._writableState;\n\t\n\t if (typeof chunk === 'function') {\n\t cb = chunk;\n\t chunk = null;\n\t encoding = null;\n\t } else if (typeof encoding === 'function') {\n\t cb = encoding;\n\t encoding = null;\n\t }\n\t\n\t if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\t\n\t // .end() fully uncorks\n\t if (state.corked) {\n\t state.corked = 1;\n\t this.uncork();\n\t }\n\t\n\t // ignore unnecessary end() calls.\n\t if (!state.ending && !state.finished) endWritable(this, state, cb);\n\t};\n\t\n\tfunction needFinish(state) {\n\t return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n\t}\n\t\n\tfunction prefinish(stream, state) {\n\t if (!state.prefinished) {\n\t state.prefinished = true;\n\t stream.emit('prefinish');\n\t }\n\t}\n\t\n\tfunction finishMaybe(stream, state) {\n\t var need = needFinish(state);\n\t if (need) {\n\t if (state.pendingcb === 0) {\n\t prefinish(stream, state);\n\t state.finished = true;\n\t stream.emit('finish');\n\t } else {\n\t prefinish(stream, state);\n\t }\n\t }\n\t return need;\n\t}\n\t\n\tfunction endWritable(stream, state, cb) {\n\t state.ending = true;\n\t finishMaybe(stream, state);\n\t if (cb) {\n\t if (state.finished) processNextTick(cb);else stream.once('finish', cb);\n\t }\n\t state.ended = true;\n\t stream.writable = false;\n\t}\n\t\n\t// It seems a linked list but it is not\n\t// there will be only 2 of these for each stream\n\tfunction CorkedRequest(state) {\n\t var _this = this;\n\t\n\t this.next = null;\n\t this.entry = null;\n\t this.finish = function (err) {\n\t var entry = _this.entry;\n\t _this.entry = null;\n\t while (entry) {\n\t var cb = entry.callback;\n\t state.pendingcb--;\n\t cb(err);\n\t entry = entry.next;\n\t }\n\t if (state.corkedRequestsFree) {\n\t state.corkedRequestsFree.next = _this;\n\t } else {\n\t state.corkedRequestsFree = _this;\n\t }\n\t };\n\t}\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {\"use strict\";\n\t// Split a filename into [root, dir, basename, ext], unix version\n\t// 'root' is just a slash, or nothing.\n\tvar splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\n\tfunction posixSplitPath(filename) {\n\t var out = splitPathRe.exec(filename);\n\t out.shift();\n\t return out;\n\t}\n\t/**\n\t * Emulates Node's `path` module. This module contains utilities for handling and\n\t * transforming file paths. **All** of these methods perform only string\n\t * transformations. The file system is not consulted to check whether paths are\n\t * valid.\n\t * @see http://nodejs.org/api/path.html\n\t * @class\n\t */\n\tvar path = (function () {\n\t function path() {\n\t }\n\t /**\n\t * Normalize a string path, taking care of '..' and '.' parts.\n\t *\n\t * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.\n\t * @example Usage example\n\t * path.normalize('/foo/bar//baz/asdf/quux/..')\n\t * // returns\n\t * '/foo/bar/baz/asdf'\n\t * @param [String] p The path to normalize.\n\t * @return [String]\n\t */\n\t path.normalize = function (p) {\n\t // Special case: '' -> '.'\n\t if (p === '') {\n\t p = '.';\n\t }\n\t // It's very important to know if the path is relative or not, since it\n\t // changes how we process .. and reconstruct the split string.\n\t var absolute = p.charAt(0) === path.sep;\n\t // Remove repeated //s\n\t p = path._removeDuplicateSeps(p);\n\t // Try to remove as many '../' as possible, and remove '.' completely.\n\t var components = p.split(path.sep);\n\t var goodComponents = [];\n\t for (var idx = 0; idx < components.length; idx++) {\n\t var c = components[idx];\n\t if (c === '.') {\n\t continue;\n\t }\n\t else if (c === '..' && (absolute || (!absolute && goodComponents.length > 0 && goodComponents[0] !== '..'))) {\n\t // In the absolute case: Path is relative to root, so we may pop even if\n\t // goodComponents is empty (e.g. /../ => /)\n\t // In the relative case: We're getting rid of a directory that preceded\n\t // it (e.g. /foo/../bar -> /bar)\n\t goodComponents.pop();\n\t }\n\t else {\n\t goodComponents.push(c);\n\t }\n\t }\n\t // Add in '.' when it's a relative path with no other nonempty components.\n\t // Possible results: '.' and './' (input: [''] or [])\n\t // @todo Can probably simplify this logic.\n\t if (!absolute && goodComponents.length < 2) {\n\t switch (goodComponents.length) {\n\t case 1:\n\t if (goodComponents[0] === '') {\n\t goodComponents.unshift('.');\n\t }\n\t break;\n\t default:\n\t goodComponents.push('.');\n\t }\n\t }\n\t p = goodComponents.join(path.sep);\n\t if (absolute && p.charAt(0) !== path.sep) {\n\t p = path.sep + p;\n\t }\n\t return p;\n\t };\n\t /**\n\t * Join all arguments together and normalize the resulting path.\n\t *\n\t * Arguments must be strings.\n\t * @example Usage\n\t * path.join('/foo', 'bar', 'baz/asdf', 'quux', '..')\n\t * // returns\n\t * '/foo/bar/baz/asdf'\n\t *\n\t * path.join('foo', {}, 'bar')\n\t * // throws exception\n\t * TypeError: Arguments to path.join must be strings\n\t * @param [String,...] paths Each component of the path\n\t * @return [String]\n\t */\n\t path.join = function () {\n\t var paths = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t paths[_i - 0] = arguments[_i];\n\t }\n\t // Required: Prune any non-strings from the path. I also prune empty segments\n\t // so we can do a simple join of the array.\n\t var processed = [];\n\t for (var i = 0; i < paths.length; i++) {\n\t var segment = paths[i];\n\t if (typeof segment !== 'string') {\n\t throw new TypeError(\"Invalid argument type to path.join: \" + (typeof segment));\n\t }\n\t else if (segment !== '') {\n\t processed.push(segment);\n\t }\n\t }\n\t return path.normalize(processed.join(path.sep));\n\t };\n\t /**\n\t * Resolves to to an absolute path.\n\t *\n\t * If to isn't already absolute from arguments are prepended in right to left\n\t * order, until an absolute path is found. If after using all from paths still\n\t * no absolute path is found, the current working directory is used as well.\n\t * The resulting path is normalized, and trailing slashes are removed unless\n\t * the path gets resolved to the root directory. Non-string arguments are\n\t * ignored.\n\t *\n\t * Another way to think of it is as a sequence of cd commands in a shell.\n\t *\n\t * path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile')\n\t *\n\t * Is similar to:\n\t *\n\t * cd foo/bar\n\t * cd /tmp/file/\n\t * cd ..\n\t * cd a/../subfile\n\t * pwd\n\t *\n\t * The difference is that the different paths don't need to exist and may also\n\t * be files.\n\t * @example Usage example\n\t * path.resolve('/foo/bar', './baz')\n\t * // returns\n\t * '/foo/bar/baz'\n\t *\n\t * path.resolve('/foo/bar', '/tmp/file/')\n\t * // returns\n\t * '/tmp/file'\n\t *\n\t * path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif')\n\t * // if currently in /home/myself/node, it returns\n\t * '/home/myself/node/wwwroot/static_files/gif/image.gif'\n\t * @param [String,...] paths\n\t * @return [String]\n\t */\n\t path.resolve = function () {\n\t var paths = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t paths[_i - 0] = arguments[_i];\n\t }\n\t // Monitor for invalid paths, throw out empty paths, and look for the *last*\n\t // absolute path that we see.\n\t var processed = [];\n\t for (var i = 0; i < paths.length; i++) {\n\t var p = paths[i];\n\t if (typeof p !== 'string') {\n\t throw new TypeError(\"Invalid argument type to path.join: \" + (typeof p));\n\t }\n\t else if (p !== '') {\n\t // Remove anything that has occurred before this absolute path, as it\n\t // doesn't matter.\n\t if (p.charAt(0) === path.sep) {\n\t processed = [];\n\t }\n\t processed.push(p);\n\t }\n\t }\n\t // Special: Remove trailing slash unless it's the root\n\t var resolved = path.normalize(processed.join(path.sep));\n\t if (resolved.length > 1 && resolved.charAt(resolved.length - 1) === path.sep) {\n\t return resolved.substr(0, resolved.length - 1);\n\t }\n\t // Special: If it doesn't start with '/', it's relative and we need to append\n\t // the current directory.\n\t if (resolved.charAt(0) !== path.sep) {\n\t // Remove ./, since we're going to append the current directory.\n\t if (resolved.charAt(0) === '.' && (resolved.length === 1 || resolved.charAt(1) === path.sep)) {\n\t resolved = resolved.length === 1 ? '' : resolved.substr(2);\n\t }\n\t // Append the current directory, which *must* be an absolute path.\n\t var cwd = process.cwd();\n\t if (resolved !== '') {\n\t // cwd will never end in a /... unless it's the root.\n\t resolved = this.normalize(cwd + (cwd !== '/' ? path.sep : '') + resolved);\n\t }\n\t else {\n\t resolved = cwd;\n\t }\n\t }\n\t return resolved;\n\t };\n\t /**\n\t * Solve the relative path from from to to.\n\t *\n\t * At times we have two absolute paths, and we need to derive the relative path\n\t * from one to the other. This is actually the reverse transform of\n\t * path.resolve, which means we see that:\n\t *\n\t * path.resolve(from, path.relative(from, to)) == path.resolve(to)\n\t *\n\t * @example Usage example\n\t * path.relative('C:\\\\orandea\\\\test\\\\aaa', 'C:\\\\orandea\\\\impl\\\\bbb')\n\t * // returns\n\t * '..\\\\..\\\\impl\\\\bbb'\n\t *\n\t * path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb')\n\t * // returns\n\t * '../../impl/bbb'\n\t * @param [String] from\n\t * @param [String] to\n\t * @return [String]\n\t */\n\t path.relative = function (from, to) {\n\t var i;\n\t // Alright. Let's resolve these two to absolute paths and remove any\n\t // weirdness.\n\t from = path.resolve(from);\n\t to = path.resolve(to);\n\t var fromSegs = from.split(path.sep);\n\t var toSegs = to.split(path.sep);\n\t // Remove the first segment on both, as it's '' (both are absolute paths)\n\t toSegs.shift();\n\t fromSegs.shift();\n\t // There are two segments to this path:\n\t // * Going *up* the directory hierarchy with '..'\n\t // * Going *down* the directory hierarchy with foo/baz/bat.\n\t var upCount = 0;\n\t var downSegs = [];\n\t // Figure out how many things in 'from' are shared with 'to'.\n\t for (i = 0; i < fromSegs.length; i++) {\n\t var seg = fromSegs[i];\n\t if (seg === toSegs[i]) {\n\t continue;\n\t }\n\t // The rest of 'from', including the current element, indicates how many\n\t // directories we need to go up.\n\t upCount = fromSegs.length - i;\n\t break;\n\t }\n\t // The rest of 'to' indicates where we need to change to. We place this\n\t // outside of the loop, as toSegs.length may be greater than fromSegs.length.\n\t downSegs = toSegs.slice(i);\n\t // Special case: If 'from' is '/'\n\t if (fromSegs.length === 1 && fromSegs[0] === '') {\n\t upCount = 0;\n\t }\n\t // upCount can't be greater than the number of fromSegs\n\t // (cd .. from / is still /)\n\t if (upCount > fromSegs.length) {\n\t upCount = fromSegs.length;\n\t }\n\t // Create the final string!\n\t var rv = '';\n\t for (i = 0; i < upCount; i++) {\n\t rv += '../';\n\t }\n\t rv += downSegs.join(path.sep);\n\t // Special case: Remove trailing '/'. Happens if it's all up and no down.\n\t if (rv.length > 1 && rv.charAt(rv.length - 1) === path.sep) {\n\t rv = rv.substr(0, rv.length - 1);\n\t }\n\t return rv;\n\t };\n\t /**\n\t * Return the directory name of a path. Similar to the Unix `dirname` command.\n\t *\n\t * Note that BrowserFS does not validate if the path is actually a valid\n\t * directory.\n\t * @example Usage example\n\t * path.dirname('/foo/bar/baz/asdf/quux')\n\t * // returns\n\t * '/foo/bar/baz/asdf'\n\t * @param [String] p The path to get the directory name of.\n\t * @return [String]\n\t */\n\t path.dirname = function (p) {\n\t // We get rid of //, but we don't modify anything else (e.g. any extraneous .\n\t // and ../ are kept intact)\n\t p = path._removeDuplicateSeps(p);\n\t var absolute = p.charAt(0) === path.sep;\n\t var sections = p.split(path.sep);\n\t // Do 1 if it's /foo/bar, 2 if it's /foo/bar/\n\t if (sections.pop() === '' && sections.length > 0) {\n\t sections.pop();\n\t }\n\t // # of sections needs to be > 1 if absolute, since the first section is '' for '/'.\n\t // If not absolute, the first section is the first part of the path, and is OK\n\t // to return.\n\t if (sections.length > 1 || (sections.length === 1 && !absolute)) {\n\t return sections.join(path.sep);\n\t }\n\t else if (absolute) {\n\t return path.sep;\n\t }\n\t else {\n\t return '.';\n\t }\n\t };\n\t /**\n\t * Return the last portion of a path. Similar to the Unix basename command.\n\t * @example Usage example\n\t * path.basename('/foo/bar/baz/asdf/quux.html')\n\t * // returns\n\t * 'quux.html'\n\t *\n\t * path.basename('/foo/bar/baz/asdf/quux.html', '.html')\n\t * // returns\n\t * 'quux'\n\t * @param [String] p\n\t * @param [String?] ext\n\t * @return [String]\n\t */\n\t path.basename = function (p, ext) {\n\t if (ext === void 0) { ext = \"\"; }\n\t // Special case: Normalize will modify this to '.'\n\t if (p === '') {\n\t return p;\n\t }\n\t // Normalize the string first to remove any weirdness.\n\t p = path.normalize(p);\n\t // Get the last part of the string.\n\t var sections = p.split(path.sep);\n\t var lastPart = sections[sections.length - 1];\n\t // Special case: If it's empty, then we have a string like so: foo/\n\t // Meaning, 'foo' is guaranteed to be a directory.\n\t if (lastPart === '' && sections.length > 1) {\n\t return sections[sections.length - 2];\n\t }\n\t // Remove the extension, if need be.\n\t if (ext.length > 0) {\n\t var lastPartExt = lastPart.substr(lastPart.length - ext.length);\n\t if (lastPartExt === ext) {\n\t return lastPart.substr(0, lastPart.length - ext.length);\n\t }\n\t }\n\t return lastPart;\n\t };\n\t /**\n\t * Return the extension of the path, from the last '.' to end of string in the\n\t * last portion of the path. If there is no '.' in the last portion of the path\n\t * or the first character of it is '.', then it returns an empty string.\n\t * @example Usage example\n\t * path.extname('index.html')\n\t * // returns\n\t * '.html'\n\t *\n\t * path.extname('index.')\n\t * // returns\n\t * '.'\n\t *\n\t * path.extname('index')\n\t * // returns\n\t * ''\n\t * @param [String] p\n\t * @return [String]\n\t */\n\t path.extname = function (p) {\n\t p = path.normalize(p);\n\t var sections = p.split(path.sep);\n\t p = sections.pop();\n\t // Special case: foo/file.ext/ should return '.ext'\n\t if (p === '' && sections.length > 0) {\n\t p = sections.pop();\n\t }\n\t if (p === '..') {\n\t return '';\n\t }\n\t var i = p.lastIndexOf('.');\n\t if (i === -1 || i === 0) {\n\t return '';\n\t }\n\t return p.substr(i);\n\t };\n\t /**\n\t * Checks if the given path is an absolute path.\n\t *\n\t * Despite not being documented, this is a tested part of Node's path API.\n\t * @param [String] p\n\t * @return [Boolean] True if the path appears to be an absolute path.\n\t */\n\t path.isAbsolute = function (p) {\n\t return p.length > 0 && p.charAt(0) === path.sep;\n\t };\n\t /**\n\t * Unknown. Undocumented.\n\t */\n\t path._makeLong = function (p) {\n\t return p;\n\t };\n\t /**\n\t * Returns an object from a path string.\n\t */\n\t path.parse = function (p) {\n\t var allParts = posixSplitPath(p);\n\t return {\n\t root: allParts[0],\n\t dir: allParts[0] + allParts[1].slice(0, -1),\n\t base: allParts[2],\n\t ext: allParts[3],\n\t name: allParts[2].slice(0, allParts[2].length - allParts[3].length)\n\t };\n\t };\n\t path.format = function (pathObject) {\n\t if (pathObject === null || typeof pathObject !== 'object') {\n\t throw new TypeError(\"Parameter 'pathObject' must be an object, not \" + typeof pathObject);\n\t }\n\t var root = pathObject.root || '';\n\t if (typeof root !== 'string') {\n\t throw new TypeError(\"'pathObject.root' must be a string or undefined, not \" +\n\t typeof pathObject.root);\n\t }\n\t var dir = pathObject.dir ? pathObject.dir + path.sep : '';\n\t var base = pathObject.base || '';\n\t return dir + base;\n\t };\n\t path._removeDuplicateSeps = function (p) {\n\t p = p.replace(this._replaceRegex, this.sep);\n\t return p;\n\t };\n\t // The platform-specific file separator. BrowserFS uses `/`.\n\t path.sep = '/';\n\t path._replaceRegex = new RegExp(\"//+\", 'g');\n\t // The platform-specific path delimiter. BrowserFS uses `:`.\n\t path.delimiter = ':';\n\t path.posix = path;\n\t // XXX: Typing hack. We don't actually support win32.\n\t path.win32 = path;\n\t return path;\n\t}());\n\tvar _ = path;\n\tmodule.exports = path;\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// a passthrough stream.\n\t// basically just the most minimal sort of Transform stream.\n\t// Every written chunk gets output as-is.\n\t\n\t'use strict';\n\t\n\tmodule.exports = PassThrough;\n\t\n\tvar Transform = __webpack_require__(12);\n\t\n\t/**/\n\tvar util = __webpack_require__(5);\n\tutil.inherits = __webpack_require__(4);\n\t/**/\n\t\n\tutil.inherits(PassThrough, Transform);\n\t\n\tfunction PassThrough(options) {\n\t if (!(this instanceof PassThrough)) return new PassThrough(options);\n\t\n\t Transform.call(this, options);\n\t}\n\t\n\tPassThrough.prototype._transform = function (chunk, encoding, cb) {\n\t cb(null, chunk);\n\t};\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {'use strict';\n\t\n\tmodule.exports = Readable;\n\t\n\t/**/\n\tvar processNextTick = __webpack_require__(11);\n\t/**/\n\t\n\t/**/\n\tvar isArray = __webpack_require__(22);\n\t/**/\n\t\n\t/**/\n\tvar Duplex;\n\t/**/\n\t\n\tReadable.ReadableState = ReadableState;\n\t\n\t/**/\n\tvar EE = __webpack_require__(6).EventEmitter;\n\t\n\tvar EElistenerCount = function (emitter, type) {\n\t return emitter.listeners(type).length;\n\t};\n\t/**/\n\t\n\t/**/\n\tvar Stream;\n\t(function () {\n\t try {\n\t Stream = __webpack_require__(9);\n\t } catch (_) {} finally {\n\t if (!Stream) Stream = __webpack_require__(6).EventEmitter;\n\t }\n\t})();\n\t/**/\n\t\n\tvar Buffer = __webpack_require__(1).Buffer;\n\t/**/\n\tvar bufferShim = __webpack_require__(10);\n\t/**/\n\t\n\t/**/\n\tvar util = __webpack_require__(5);\n\tutil.inherits = __webpack_require__(4);\n\t/**/\n\t\n\t/**/\n\tvar debugUtil = __webpack_require__(42);\n\tvar debug = void 0;\n\tif (debugUtil && debugUtil.debuglog) {\n\t debug = debugUtil.debuglog('stream');\n\t} else {\n\t debug = function () {};\n\t}\n\t/**/\n\t\n\tvar BufferList = __webpack_require__(35);\n\tvar StringDecoder;\n\t\n\tutil.inherits(Readable, Stream);\n\t\n\tfunction prependListener(emitter, event, fn) {\n\t // Sadly this is not cacheable as some libraries bundle their own\n\t // event emitter implementation with them.\n\t if (typeof emitter.prependListener === 'function') {\n\t return emitter.prependListener(event, fn);\n\t } else {\n\t // This is a hack to make sure that our error handler is attached before any\n\t // userland ones. NEVER DO THIS. This is here only because this code needs\n\t // to continue to work with older versions of Node.js that do not include\n\t // the prependListener() method. The goal is to eventually remove this hack.\n\t if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n\t }\n\t}\n\t\n\tfunction ReadableState(options, stream) {\n\t Duplex = Duplex || __webpack_require__(2);\n\t\n\t options = options || {};\n\t\n\t // object stream flag. Used to make read(n) ignore n and to\n\t // make all the buffer merging and length checks go away\n\t this.objectMode = !!options.objectMode;\n\t\n\t if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\t\n\t // the point at which it stops calling _read() to fill the buffer\n\t // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n\t var hwm = options.highWaterMark;\n\t var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\t this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;\n\t\n\t // cast to ints.\n\t this.highWaterMark = ~~this.highWaterMark;\n\t\n\t // A linked list is used to store data chunks instead of an array because the\n\t // linked list can remove elements from the beginning faster than\n\t // array.shift()\n\t this.buffer = new BufferList();\n\t this.length = 0;\n\t this.pipes = null;\n\t this.pipesCount = 0;\n\t this.flowing = null;\n\t this.ended = false;\n\t this.endEmitted = false;\n\t this.reading = false;\n\t\n\t // a flag to be able to tell if the onwrite cb is called immediately,\n\t // or on a later tick. We set this to true at first, because any\n\t // actions that shouldn't happen until \"later\" should generally also\n\t // not happen before the first write call.\n\t this.sync = true;\n\t\n\t // whenever we return null, then we set a flag to say\n\t // that we're awaiting a 'readable' event emission.\n\t this.needReadable = false;\n\t this.emittedReadable = false;\n\t this.readableListening = false;\n\t this.resumeScheduled = false;\n\t\n\t // Crypto is kind of old and crusty. Historically, its default string\n\t // encoding is 'binary' so we have to make this configurable.\n\t // Everything else in the universe uses 'utf8', though.\n\t this.defaultEncoding = options.defaultEncoding || 'utf8';\n\t\n\t // when piping, we only care about 'readable' events that happen\n\t // after read()ing all the bytes and not getting any pushback.\n\t this.ranOut = false;\n\t\n\t // the number of writers that are awaiting a drain event in .pipe()s\n\t this.awaitDrain = 0;\n\t\n\t // if true, a maybeReadMore has been scheduled\n\t this.readingMore = false;\n\t\n\t this.decoder = null;\n\t this.encoding = null;\n\t if (options.encoding) {\n\t if (!StringDecoder) StringDecoder = __webpack_require__(17).StringDecoder;\n\t this.decoder = new StringDecoder(options.encoding);\n\t this.encoding = options.encoding;\n\t }\n\t}\n\t\n\tfunction Readable(options) {\n\t Duplex = Duplex || __webpack_require__(2);\n\t\n\t if (!(this instanceof Readable)) return new Readable(options);\n\t\n\t this._readableState = new ReadableState(options, this);\n\t\n\t // legacy\n\t this.readable = true;\n\t\n\t if (options && typeof options.read === 'function') this._read = options.read;\n\t\n\t Stream.call(this);\n\t}\n\t\n\t// Manually shove something into the read() buffer.\n\t// This returns true if the highWaterMark has not been hit yet,\n\t// similar to how Writable.write() returns true if you should\n\t// write() some more.\n\tReadable.prototype.push = function (chunk, encoding) {\n\t var state = this._readableState;\n\t\n\t if (!state.objectMode && typeof chunk === 'string') {\n\t encoding = encoding || state.defaultEncoding;\n\t if (encoding !== state.encoding) {\n\t chunk = bufferShim.from(chunk, encoding);\n\t encoding = '';\n\t }\n\t }\n\t\n\t return readableAddChunk(this, state, chunk, encoding, false);\n\t};\n\t\n\t// Unshift should *always* be something directly out of read()\n\tReadable.prototype.unshift = function (chunk) {\n\t var state = this._readableState;\n\t return readableAddChunk(this, state, chunk, '', true);\n\t};\n\t\n\tReadable.prototype.isPaused = function () {\n\t return this._readableState.flowing === false;\n\t};\n\t\n\tfunction readableAddChunk(stream, state, chunk, encoding, addToFront) {\n\t var er = chunkInvalid(state, chunk);\n\t if (er) {\n\t stream.emit('error', er);\n\t } else if (chunk === null) {\n\t state.reading = false;\n\t onEofChunk(stream, state);\n\t } else if (state.objectMode || chunk && chunk.length > 0) {\n\t if (state.ended && !addToFront) {\n\t var e = new Error('stream.push() after EOF');\n\t stream.emit('error', e);\n\t } else if (state.endEmitted && addToFront) {\n\t var _e = new Error('stream.unshift() after end event');\n\t stream.emit('error', _e);\n\t } else {\n\t var skipAdd;\n\t if (state.decoder && !addToFront && !encoding) {\n\t chunk = state.decoder.write(chunk);\n\t skipAdd = !state.objectMode && chunk.length === 0;\n\t }\n\t\n\t if (!addToFront) state.reading = false;\n\t\n\t // Don't add to the buffer if we've decoded to an empty string chunk and\n\t // we're not in object mode\n\t if (!skipAdd) {\n\t // if we want the data now, just emit it.\n\t if (state.flowing && state.length === 0 && !state.sync) {\n\t stream.emit('data', chunk);\n\t stream.read(0);\n\t } else {\n\t // update the buffer info.\n\t state.length += state.objectMode ? 1 : chunk.length;\n\t if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\t\n\t if (state.needReadable) emitReadable(stream);\n\t }\n\t }\n\t\n\t maybeReadMore(stream, state);\n\t }\n\t } else if (!addToFront) {\n\t state.reading = false;\n\t }\n\t\n\t return needMoreData(state);\n\t}\n\t\n\t// if it's past the high water mark, we can push in some more.\n\t// Also, if we have no data yet, we can stand some\n\t// more bytes. This is to work around cases where hwm=0,\n\t// such as the repl. Also, if the push() triggered a\n\t// readable event, and the user called read(largeNumber) such that\n\t// needReadable was set, then we ought to push more, so that another\n\t// 'readable' event will be triggered.\n\tfunction needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}\n\t\n\t// backwards compatibility.\n\tReadable.prototype.setEncoding = function (enc) {\n\t if (!StringDecoder) StringDecoder = __webpack_require__(17).StringDecoder;\n\t this._readableState.decoder = new StringDecoder(enc);\n\t this._readableState.encoding = enc;\n\t return this;\n\t};\n\t\n\t// Don't raise the hwm > 8MB\n\tvar MAX_HWM = 0x800000;\n\tfunction computeNewHighWaterMark(n) {\n\t if (n >= MAX_HWM) {\n\t n = MAX_HWM;\n\t } else {\n\t // Get the next highest power of 2 to prevent increasing hwm excessively in\n\t // tiny amounts\n\t n--;\n\t n |= n >>> 1;\n\t n |= n >>> 2;\n\t n |= n >>> 4;\n\t n |= n >>> 8;\n\t n |= n >>> 16;\n\t n++;\n\t }\n\t return n;\n\t}\n\t\n\t// This function is designed to be inlinable, so please take care when making\n\t// changes to the function body.\n\tfunction howMuchToRead(n, state) {\n\t if (n <= 0 || state.length === 0 && state.ended) return 0;\n\t if (state.objectMode) return 1;\n\t if (n !== n) {\n\t // Only flow one buffer at a time\n\t if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n\t }\n\t // If we're asking for more than the current hwm, then raise the hwm.\n\t if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n\t if (n <= state.length) return n;\n\t // Don't have enough\n\t if (!state.ended) {\n\t state.needReadable = true;\n\t return 0;\n\t }\n\t return state.length;\n\t}\n\t\n\t// you can override either this method, or the async _read(n) below.\n\tReadable.prototype.read = function (n) {\n\t debug('read', n);\n\t n = parseInt(n, 10);\n\t var state = this._readableState;\n\t var nOrig = n;\n\t\n\t if (n !== 0) state.emittedReadable = false;\n\t\n\t // if we're doing read(0) to trigger a readable event, but we\n\t // already have a bunch of data in the buffer, then just trigger\n\t // the 'readable' event and move on.\n\t if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n\t debug('read: emitReadable', state.length, state.ended);\n\t if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n\t return null;\n\t }\n\t\n\t n = howMuchToRead(n, state);\n\t\n\t // if we've ended, and we're now clear, then finish it up.\n\t if (n === 0 && state.ended) {\n\t if (state.length === 0) endReadable(this);\n\t return null;\n\t }\n\t\n\t // All the actual chunk generation logic needs to be\n\t // *below* the call to _read. The reason is that in certain\n\t // synthetic stream cases, such as passthrough streams, _read\n\t // may be a completely synchronous operation which may change\n\t // the state of the read buffer, providing enough data when\n\t // before there was *not* enough.\n\t //\n\t // So, the steps are:\n\t // 1. Figure out what the state of things will be after we do\n\t // a read from the buffer.\n\t //\n\t // 2. If that resulting state will trigger a _read, then call _read.\n\t // Note that this may be asynchronous, or synchronous. Yes, it is\n\t // deeply ugly to write APIs this way, but that still doesn't mean\n\t // that the Readable class should behave improperly, as streams are\n\t // designed to be sync/async agnostic.\n\t // Take note if the _read call is sync or async (ie, if the read call\n\t // has returned yet), so that we know whether or not it's safe to emit\n\t // 'readable' etc.\n\t //\n\t // 3. Actually pull the requested chunks out of the buffer and return.\n\t\n\t // if we need a readable event, then we need to do some reading.\n\t var doRead = state.needReadable;\n\t debug('need readable', doRead);\n\t\n\t // if we currently have less than the highWaterMark, then also read some\n\t if (state.length === 0 || state.length - n < state.highWaterMark) {\n\t doRead = true;\n\t debug('length less than watermark', doRead);\n\t }\n\t\n\t // however, if we've ended, then there's no point, and if we're already\n\t // reading, then it's unnecessary.\n\t if (state.ended || state.reading) {\n\t doRead = false;\n\t debug('reading or ended', doRead);\n\t } else if (doRead) {\n\t debug('do read');\n\t state.reading = true;\n\t state.sync = true;\n\t // if the length is currently zero, then we *need* a readable event.\n\t if (state.length === 0) state.needReadable = true;\n\t // call internal read method\n\t this._read(state.highWaterMark);\n\t state.sync = false;\n\t // If _read pushed data synchronously, then `reading` will be false,\n\t // and we need to re-evaluate how much data we can return to the user.\n\t if (!state.reading) n = howMuchToRead(nOrig, state);\n\t }\n\t\n\t var ret;\n\t if (n > 0) ret = fromList(n, state);else ret = null;\n\t\n\t if (ret === null) {\n\t state.needReadable = true;\n\t n = 0;\n\t } else {\n\t state.length -= n;\n\t }\n\t\n\t if (state.length === 0) {\n\t // If we have nothing in the buffer, then we want to know\n\t // as soon as we *do* get something into the buffer.\n\t if (!state.ended) state.needReadable = true;\n\t\n\t // If we tried to read() past the EOF, then emit end on the next tick.\n\t if (nOrig !== n && state.ended) endReadable(this);\n\t }\n\t\n\t if (ret !== null) this.emit('data', ret);\n\t\n\t return ret;\n\t};\n\t\n\tfunction chunkInvalid(state, chunk) {\n\t var er = null;\n\t if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n\t er = new TypeError('Invalid non-string/buffer chunk');\n\t }\n\t return er;\n\t}\n\t\n\tfunction onEofChunk(stream, state) {\n\t if (state.ended) return;\n\t if (state.decoder) {\n\t var chunk = state.decoder.end();\n\t if (chunk && chunk.length) {\n\t state.buffer.push(chunk);\n\t state.length += state.objectMode ? 1 : chunk.length;\n\t }\n\t }\n\t state.ended = true;\n\t\n\t // emit 'readable' now to make sure it gets picked up.\n\t emitReadable(stream);\n\t}\n\t\n\t// Don't emit readable right away in sync mode, because this can trigger\n\t// another read() call => stack overflow. This way, it might trigger\n\t// a nextTick recursion warning, but that's not so bad.\n\tfunction emitReadable(stream) {\n\t var state = stream._readableState;\n\t state.needReadable = false;\n\t if (!state.emittedReadable) {\n\t debug('emitReadable', state.flowing);\n\t state.emittedReadable = true;\n\t if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n\t }\n\t}\n\t\n\tfunction emitReadable_(stream) {\n\t debug('emit readable');\n\t stream.emit('readable');\n\t flow(stream);\n\t}\n\t\n\t// at this point, the user has presumably seen the 'readable' event,\n\t// and called read() to consume some data. that may have triggered\n\t// in turn another _read(n) call, in which case reading = true if\n\t// it's in progress.\n\t// However, if we're not ended, or reading, and the length < hwm,\n\t// then go ahead and try to read some more preemptively.\n\tfunction maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t processNextTick(maybeReadMore_, stream, state);\n\t }\n\t}\n\t\n\tfunction maybeReadMore_(stream, state) {\n\t var len = state.length;\n\t while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n\t debug('maybeReadMore read 0');\n\t stream.read(0);\n\t if (len === state.length)\n\t // didn't get any data, stop spinning.\n\t break;else len = state.length;\n\t }\n\t state.readingMore = false;\n\t}\n\t\n\t// abstract method. to be overridden in specific implementation classes.\n\t// call cb(er, data) where data is <= n in length.\n\t// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n\t// arbitrary, and perhaps not very meaningful.\n\tReadable.prototype._read = function (n) {\n\t this.emit('error', new Error('_read() is not implemented'));\n\t};\n\t\n\tReadable.prototype.pipe = function (dest, pipeOpts) {\n\t var src = this;\n\t var state = this._readableState;\n\t\n\t switch (state.pipesCount) {\n\t case 0:\n\t state.pipes = dest;\n\t break;\n\t case 1:\n\t state.pipes = [state.pipes, dest];\n\t break;\n\t default:\n\t state.pipes.push(dest);\n\t break;\n\t }\n\t state.pipesCount += 1;\n\t debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\t\n\t var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\t\n\t var endFn = doEnd ? onend : cleanup;\n\t if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);\n\t\n\t dest.on('unpipe', onunpipe);\n\t function onunpipe(readable) {\n\t debug('onunpipe');\n\t if (readable === src) {\n\t cleanup();\n\t }\n\t }\n\t\n\t function onend() {\n\t debug('onend');\n\t dest.end();\n\t }\n\t\n\t // when the dest drains, it reduces the awaitDrain counter\n\t // on the source. This would be more elegant with a .once()\n\t // handler in flow(), but adding and removing repeatedly is\n\t // too slow.\n\t var ondrain = pipeOnDrain(src);\n\t dest.on('drain', ondrain);\n\t\n\t var cleanedUp = false;\n\t function cleanup() {\n\t debug('cleanup');\n\t // cleanup event handlers once the pipe is broken\n\t dest.removeListener('close', onclose);\n\t dest.removeListener('finish', onfinish);\n\t dest.removeListener('drain', ondrain);\n\t dest.removeListener('error', onerror);\n\t dest.removeListener('unpipe', onunpipe);\n\t src.removeListener('end', onend);\n\t src.removeListener('end', cleanup);\n\t src.removeListener('data', ondata);\n\t\n\t cleanedUp = true;\n\t\n\t // if the reader is waiting for a drain event from this\n\t // specific writer, then it would cause it to never start\n\t // flowing again.\n\t // So, if this is awaiting a drain, then we just call it now.\n\t // If we don't know, then assume that we are waiting for one.\n\t if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n\t }\n\t\n\t // If the user pushes more data while we're writing to dest then we'll end up\n\t // in ondata again. However, we only want to increase awaitDrain once because\n\t // dest will only emit one 'drain' event for the multiple writes.\n\t // => Introduce a guard on increasing awaitDrain.\n\t var increasedAwaitDrain = false;\n\t src.on('data', ondata);\n\t function ondata(chunk) {\n\t debug('ondata');\n\t increasedAwaitDrain = false;\n\t var ret = dest.write(chunk);\n\t if (false === ret && !increasedAwaitDrain) {\n\t // If the user unpiped during `dest.write()`, it is possible\n\t // to get stuck in a permanently paused state if that write\n\t // also returned false.\n\t // => Check whether `dest` is still a piping destination.\n\t if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n\t debug('false write response, pause', src._readableState.awaitDrain);\n\t src._readableState.awaitDrain++;\n\t increasedAwaitDrain = true;\n\t }\n\t src.pause();\n\t }\n\t }\n\t\n\t // if the dest has an error, then stop piping into it.\n\t // however, don't suppress the throwing behavior for this.\n\t function onerror(er) {\n\t debug('onerror', er);\n\t unpipe();\n\t dest.removeListener('error', onerror);\n\t if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n\t }\n\t\n\t // Make sure our error handler is attached before userland ones.\n\t prependListener(dest, 'error', onerror);\n\t\n\t // Both close and finish should trigger unpipe, but only once.\n\t function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }\n\t dest.once('close', onclose);\n\t function onfinish() {\n\t debug('onfinish');\n\t dest.removeListener('close', onclose);\n\t unpipe();\n\t }\n\t dest.once('finish', onfinish);\n\t\n\t function unpipe() {\n\t debug('unpipe');\n\t src.unpipe(dest);\n\t }\n\t\n\t // tell the dest that it's being piped to\n\t dest.emit('pipe', src);\n\t\n\t // start the flow if it hasn't been started already.\n\t if (!state.flowing) {\n\t debug('pipe resume');\n\t src.resume();\n\t }\n\t\n\t return dest;\n\t};\n\t\n\tfunction pipeOnDrain(src) {\n\t return function () {\n\t var state = src._readableState;\n\t debug('pipeOnDrain', state.awaitDrain);\n\t if (state.awaitDrain) state.awaitDrain--;\n\t if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n\t state.flowing = true;\n\t flow(src);\n\t }\n\t };\n\t}\n\t\n\tReadable.prototype.unpipe = function (dest) {\n\t var state = this._readableState;\n\t\n\t // if we're not piping anywhere, then do nothing.\n\t if (state.pipesCount === 0) return this;\n\t\n\t // just one destination. most common case.\n\t if (state.pipesCount === 1) {\n\t // passed in one, but it's not the right one.\n\t if (dest && dest !== state.pipes) return this;\n\t\n\t if (!dest) dest = state.pipes;\n\t\n\t // got a match.\n\t state.pipes = null;\n\t state.pipesCount = 0;\n\t state.flowing = false;\n\t if (dest) dest.emit('unpipe', this);\n\t return this;\n\t }\n\t\n\t // slow case. multiple pipe destinations.\n\t\n\t if (!dest) {\n\t // remove all.\n\t var dests = state.pipes;\n\t var len = state.pipesCount;\n\t state.pipes = null;\n\t state.pipesCount = 0;\n\t state.flowing = false;\n\t\n\t for (var i = 0; i < len; i++) {\n\t dests[i].emit('unpipe', this);\n\t }return this;\n\t }\n\t\n\t // try to find the right one.\n\t var index = indexOf(state.pipes, dest);\n\t if (index === -1) return this;\n\t\n\t state.pipes.splice(index, 1);\n\t state.pipesCount -= 1;\n\t if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\t\n\t dest.emit('unpipe', this);\n\t\n\t return this;\n\t};\n\t\n\t// set up data events if they are asked for\n\t// Ensure readable listeners eventually get something\n\tReadable.prototype.on = function (ev, fn) {\n\t var res = Stream.prototype.on.call(this, ev, fn);\n\t\n\t if (ev === 'data') {\n\t // Start flowing on next tick if stream isn't explicitly paused\n\t if (this._readableState.flowing !== false) this.resume();\n\t } else if (ev === 'readable') {\n\t var state = this._readableState;\n\t if (!state.endEmitted && !state.readableListening) {\n\t state.readableListening = state.needReadable = true;\n\t state.emittedReadable = false;\n\t if (!state.reading) {\n\t processNextTick(nReadingNextTick, this);\n\t } else if (state.length) {\n\t emitReadable(this, state);\n\t }\n\t }\n\t }\n\t\n\t return res;\n\t};\n\tReadable.prototype.addListener = Readable.prototype.on;\n\t\n\tfunction nReadingNextTick(self) {\n\t debug('readable nexttick read 0');\n\t self.read(0);\n\t}\n\t\n\t// pause() and resume() are remnants of the legacy readable stream API\n\t// If the user uses them, then switch into old mode.\n\tReadable.prototype.resume = function () {\n\t var state = this._readableState;\n\t if (!state.flowing) {\n\t debug('resume');\n\t state.flowing = true;\n\t resume(this, state);\n\t }\n\t return this;\n\t};\n\t\n\tfunction resume(stream, state) {\n\t if (!state.resumeScheduled) {\n\t state.resumeScheduled = true;\n\t processNextTick(resume_, stream, state);\n\t }\n\t}\n\t\n\tfunction resume_(stream, state) {\n\t if (!state.reading) {\n\t debug('resume read 0');\n\t stream.read(0);\n\t }\n\t\n\t state.resumeScheduled = false;\n\t state.awaitDrain = 0;\n\t stream.emit('resume');\n\t flow(stream);\n\t if (state.flowing && !state.reading) stream.read(0);\n\t}\n\t\n\tReadable.prototype.pause = function () {\n\t debug('call pause flowing=%j', this._readableState.flowing);\n\t if (false !== this._readableState.flowing) {\n\t debug('pause');\n\t this._readableState.flowing = false;\n\t this.emit('pause');\n\t }\n\t return this;\n\t};\n\t\n\tfunction flow(stream) {\n\t var state = stream._readableState;\n\t debug('flow', state.flowing);\n\t while (state.flowing && stream.read() !== null) {}\n\t}\n\t\n\t// wrap an old-style stream as the async data source.\n\t// This is *not* part of the readable stream interface.\n\t// It is an ugly unfortunate mess of history.\n\tReadable.prototype.wrap = function (stream) {\n\t var state = this._readableState;\n\t var paused = false;\n\t\n\t var self = this;\n\t stream.on('end', function () {\n\t debug('wrapped end');\n\t if (state.decoder && !state.ended) {\n\t var chunk = state.decoder.end();\n\t if (chunk && chunk.length) self.push(chunk);\n\t }\n\t\n\t self.push(null);\n\t });\n\t\n\t stream.on('data', function (chunk) {\n\t debug('wrapped data');\n\t if (state.decoder) chunk = state.decoder.write(chunk);\n\t\n\t // don't skip over falsy values in objectMode\n\t if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\t\n\t var ret = self.push(chunk);\n\t if (!ret) {\n\t paused = true;\n\t stream.pause();\n\t }\n\t });\n\t\n\t // proxy all the other methods.\n\t // important when wrapping filters and duplexes.\n\t for (var i in stream) {\n\t if (this[i] === undefined && typeof stream[i] === 'function') {\n\t this[i] = function (method) {\n\t return function () {\n\t return stream[method].apply(stream, arguments);\n\t };\n\t }(i);\n\t }\n\t }\n\t\n\t // proxy certain important events.\n\t var events = ['error', 'close', 'destroy', 'pause', 'resume'];\n\t forEach(events, function (ev) {\n\t stream.on(ev, self.emit.bind(self, ev));\n\t });\n\t\n\t // when we try to consume some more bytes, simply unpause the\n\t // underlying stream.\n\t self._read = function (n) {\n\t debug('wrapped _read', n);\n\t if (paused) {\n\t paused = false;\n\t stream.resume();\n\t }\n\t };\n\t\n\t return self;\n\t};\n\t\n\t// exposed for testing purposes only.\n\tReadable._fromList = fromList;\n\t\n\t// Pluck off n bytes from an array of buffers.\n\t// Length is the combined lengths of all the buffers in the list.\n\t// This function is designed to be inlinable, so please take care when making\n\t// changes to the function body.\n\tfunction fromList(n, state) {\n\t // nothing buffered\n\t if (state.length === 0) return null;\n\t\n\t var ret;\n\t if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n\t // read it all, truncate the list\n\t if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n\t state.buffer.clear();\n\t } else {\n\t // read part of list\n\t ret = fromListPartial(n, state.buffer, state.decoder);\n\t }\n\t\n\t return ret;\n\t}\n\t\n\t// Extracts only enough buffered data to satisfy the amount requested.\n\t// This function is designed to be inlinable, so please take care when making\n\t// changes to the function body.\n\tfunction fromListPartial(n, list, hasStrings) {\n\t var ret;\n\t if (n < list.head.data.length) {\n\t // slice is the same for buffers and strings\n\t ret = list.head.data.slice(0, n);\n\t list.head.data = list.head.data.slice(n);\n\t } else if (n === list.head.data.length) {\n\t // first chunk is a perfect match\n\t ret = list.shift();\n\t } else {\n\t // result spans more than one buffer\n\t ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n\t }\n\t return ret;\n\t}\n\t\n\t// Copies a specified amount of characters from the list of buffered data\n\t// chunks.\n\t// This function is designed to be inlinable, so please take care when making\n\t// changes to the function body.\n\tfunction copyFromBufferString(n, list) {\n\t var p = list.head;\n\t var c = 1;\n\t var ret = p.data;\n\t n -= ret.length;\n\t while (p = p.next) {\n\t var str = p.data;\n\t var nb = n > str.length ? str.length : n;\n\t if (nb === str.length) ret += str;else ret += str.slice(0, n);\n\t n -= nb;\n\t if (n === 0) {\n\t if (nb === str.length) {\n\t ++c;\n\t if (p.next) list.head = p.next;else list.head = list.tail = null;\n\t } else {\n\t list.head = p;\n\t p.data = str.slice(nb);\n\t }\n\t break;\n\t }\n\t ++c;\n\t }\n\t list.length -= c;\n\t return ret;\n\t}\n\t\n\t// Copies a specified amount of bytes from the list of buffered data chunks.\n\t// This function is designed to be inlinable, so please take care when making\n\t// changes to the function body.\n\tfunction copyFromBuffer(n, list) {\n\t var ret = bufferShim.allocUnsafe(n);\n\t var p = list.head;\n\t var c = 1;\n\t p.data.copy(ret);\n\t n -= p.data.length;\n\t while (p = p.next) {\n\t var buf = p.data;\n\t var nb = n > buf.length ? buf.length : n;\n\t buf.copy(ret, ret.length - n, 0, nb);\n\t n -= nb;\n\t if (n === 0) {\n\t if (nb === buf.length) {\n\t ++c;\n\t if (p.next) list.head = p.next;else list.head = list.tail = null;\n\t } else {\n\t list.head = p;\n\t p.data = buf.slice(nb);\n\t }\n\t break;\n\t }\n\t ++c;\n\t }\n\t list.length -= c;\n\t return ret;\n\t}\n\t\n\tfunction endReadable(stream) {\n\t var state = stream._readableState;\n\t\n\t // If we get here before consuming all the bytes, then that is a\n\t // bug in node. Should never happen.\n\t if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\t\n\t if (!state.endEmitted) {\n\t state.ended = true;\n\t processNextTick(endReadableNT, state, stream);\n\t }\n\t}\n\t\n\tfunction endReadableNT(state, stream) {\n\t // Check that we didn't get one last unshift.\n\t if (!state.endEmitted && state.length === 0) {\n\t state.endEmitted = true;\n\t stream.readable = false;\n\t stream.emit('end');\n\t }\n\t}\n\t\n\tfunction forEach(xs, f) {\n\t for (var i = 0, l = xs.length; i < l; i++) {\n\t f(xs[i], i);\n\t }\n\t}\n\t\n\tfunction indexOf(xs, x) {\n\t for (var i = 0, l = xs.length; i < l; i++) {\n\t if (xs[i] === x) return i;\n\t }\n\t return -1;\n\t}\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\tvar Buffer = __webpack_require__(1).Buffer;\n\t\n\tvar isBufferEncoding = Buffer.isEncoding\n\t || function(encoding) {\n\t switch (encoding && encoding.toLowerCase()) {\n\t case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;\n\t default: return false;\n\t }\n\t }\n\t\n\t\n\tfunction assertEncoding(encoding) {\n\t if (encoding && !isBufferEncoding(encoding)) {\n\t throw new Error('Unknown encoding: ' + encoding);\n\t }\n\t}\n\t\n\t// StringDecoder provides an interface for efficiently splitting a series of\n\t// buffers into a series of JS strings without breaking apart multi-byte\n\t// characters. CESU-8 is handled as part of the UTF-8 encoding.\n\t//\n\t// @TODO Handling all encodings inside a single object makes it very difficult\n\t// to reason about this code, so it should be split up in the future.\n\t// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code\n\t// points as used by CESU-8.\n\tvar StringDecoder = exports.StringDecoder = function(encoding) {\n\t this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');\n\t assertEncoding(encoding);\n\t switch (this.encoding) {\n\t case 'utf8':\n\t // CESU-8 represents each of Surrogate Pair by 3-bytes\n\t this.surrogateSize = 3;\n\t break;\n\t case 'ucs2':\n\t case 'utf16le':\n\t // UTF-16 represents each of Surrogate Pair by 2-bytes\n\t this.surrogateSize = 2;\n\t this.detectIncompleteChar = utf16DetectIncompleteChar;\n\t break;\n\t case 'base64':\n\t // Base-64 stores 3 bytes in 4 chars, and pads the remainder.\n\t this.surrogateSize = 3;\n\t this.detectIncompleteChar = base64DetectIncompleteChar;\n\t break;\n\t default:\n\t this.write = passThroughWrite;\n\t return;\n\t }\n\t\n\t // Enough space to store all bytes of a single character. UTF-8 needs 4\n\t // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).\n\t this.charBuffer = new Buffer(6);\n\t // Number of bytes received for the current incomplete multi-byte character.\n\t this.charReceived = 0;\n\t // Number of bytes expected for the current incomplete multi-byte character.\n\t this.charLength = 0;\n\t};\n\t\n\t\n\t// write decodes the given buffer and returns it as JS string that is\n\t// guaranteed to not contain any partial multi-byte characters. Any partial\n\t// character found at the end of the buffer is buffered up, and will be\n\t// returned when calling write again with the remaining bytes.\n\t//\n\t// Note: Converting a Buffer containing an orphan surrogate to a String\n\t// currently works, but converting a String to a Buffer (via `new Buffer`, or\n\t// Buffer#write) will replace incomplete surrogates with the unicode\n\t// replacement character. See https://codereview.chromium.org/121173009/ .\n\tStringDecoder.prototype.write = function(buffer) {\n\t var charStr = '';\n\t // if our last write ended with an incomplete multibyte character\n\t while (this.charLength) {\n\t // determine how many remaining bytes this buffer has to offer for this char\n\t var available = (buffer.length >= this.charLength - this.charReceived) ?\n\t this.charLength - this.charReceived :\n\t buffer.length;\n\t\n\t // add the new bytes to the char buffer\n\t buffer.copy(this.charBuffer, this.charReceived, 0, available);\n\t this.charReceived += available;\n\t\n\t if (this.charReceived < this.charLength) {\n\t // still not enough chars in this buffer? wait for more ...\n\t return '';\n\t }\n\t\n\t // remove bytes belonging to the current character from the buffer\n\t buffer = buffer.slice(available, buffer.length);\n\t\n\t // get the character that was split\n\t charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);\n\t\n\t // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character\n\t var charCode = charStr.charCodeAt(charStr.length - 1);\n\t if (charCode >= 0xD800 && charCode <= 0xDBFF) {\n\t this.charLength += this.surrogateSize;\n\t charStr = '';\n\t continue;\n\t }\n\t this.charReceived = this.charLength = 0;\n\t\n\t // if there are no more bytes in this buffer, just emit our char\n\t if (buffer.length === 0) {\n\t return charStr;\n\t }\n\t break;\n\t }\n\t\n\t // determine and set charLength / charReceived\n\t this.detectIncompleteChar(buffer);\n\t\n\t var end = buffer.length;\n\t if (this.charLength) {\n\t // buffer the incomplete character bytes we got\n\t buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);\n\t end -= this.charReceived;\n\t }\n\t\n\t charStr += buffer.toString(this.encoding, 0, end);\n\t\n\t var end = charStr.length - 1;\n\t var charCode = charStr.charCodeAt(end);\n\t // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character\n\t if (charCode >= 0xD800 && charCode <= 0xDBFF) {\n\t var size = this.surrogateSize;\n\t this.charLength += size;\n\t this.charReceived += size;\n\t this.charBuffer.copy(this.charBuffer, size, 0, size);\n\t buffer.copy(this.charBuffer, 0, 0, size);\n\t return charStr.substring(0, end);\n\t }\n\t\n\t // or just emit the charStr\n\t return charStr;\n\t};\n\t\n\t// detectIncompleteChar determines if there is an incomplete UTF-8 character at\n\t// the end of the given buffer. If so, it sets this.charLength to the byte\n\t// length that character, and sets this.charReceived to the number of bytes\n\t// that are available for this character.\n\tStringDecoder.prototype.detectIncompleteChar = function(buffer) {\n\t // determine how many bytes we have to check at the end of this buffer\n\t var i = (buffer.length >= 3) ? 3 : buffer.length;\n\t\n\t // Figure out if one of the last i bytes of our buffer announces an\n\t // incomplete char.\n\t for (; i > 0; i--) {\n\t var c = buffer[buffer.length - i];\n\t\n\t // See http://en.wikipedia.org/wiki/UTF-8#Description\n\t\n\t // 110XXXXX\n\t if (i == 1 && c >> 5 == 0x06) {\n\t this.charLength = 2;\n\t break;\n\t }\n\t\n\t // 1110XXXX\n\t if (i <= 2 && c >> 4 == 0x0E) {\n\t this.charLength = 3;\n\t break;\n\t }\n\t\n\t // 11110XXX\n\t if (i <= 3 && c >> 3 == 0x1E) {\n\t this.charLength = 4;\n\t break;\n\t }\n\t }\n\t this.charReceived = i;\n\t};\n\t\n\tStringDecoder.prototype.end = function(buffer) {\n\t var res = '';\n\t if (buffer && buffer.length)\n\t res = this.write(buffer);\n\t\n\t if (this.charReceived) {\n\t var cr = this.charReceived;\n\t var buf = this.charBuffer;\n\t var enc = this.encoding;\n\t res += buf.slice(0, cr).toString(enc);\n\t }\n\t\n\t return res;\n\t};\n\t\n\tfunction passThroughWrite(buffer) {\n\t return buffer.toString(this.encoding);\n\t}\n\t\n\tfunction utf16DetectIncompleteChar(buffer) {\n\t this.charReceived = buffer.length % 2;\n\t this.charLength = this.charReceived ? 2 : 0;\n\t}\n\t\n\tfunction base64DetectIncompleteChar(buffer) {\n\t this.charReceived = buffer.length % 3;\n\t this.charLength = this.charReceived ? 3 : 0;\n\t}\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\t'use strict'\n\t\n\texports.byteLength = byteLength\n\texports.toByteArray = toByteArray\n\texports.fromByteArray = fromByteArray\n\t\n\tvar lookup = []\n\tvar revLookup = []\n\tvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\t\n\tvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n\tfor (var i = 0, len = code.length; i < len; ++i) {\n\t lookup[i] = code[i]\n\t revLookup[code.charCodeAt(i)] = i\n\t}\n\t\n\trevLookup['-'.charCodeAt(0)] = 62\n\trevLookup['_'.charCodeAt(0)] = 63\n\t\n\tfunction placeHoldersCount (b64) {\n\t var len = b64.length\n\t if (len % 4 > 0) {\n\t throw new Error('Invalid string. Length must be a multiple of 4')\n\t }\n\t\n\t // the number of equal signs (place holders)\n\t // if there are two placeholders, than the two characters before it\n\t // represent one byte\n\t // if there is only one, then the three characters before it represent 2 bytes\n\t // this is just a cheap hack to not do indexOf twice\n\t return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n\t}\n\t\n\tfunction byteLength (b64) {\n\t // base64 is 4/3 + up to two characters of the original data\n\t return b64.length * 3 / 4 - placeHoldersCount(b64)\n\t}\n\t\n\tfunction toByteArray (b64) {\n\t var i, j, l, tmp, placeHolders, arr\n\t var len = b64.length\n\t placeHolders = placeHoldersCount(b64)\n\t\n\t arr = new Arr(len * 3 / 4 - placeHolders)\n\t\n\t // if there are placeholders, only get up to the last complete 4 chars\n\t l = placeHolders > 0 ? len - 4 : len\n\t\n\t var L = 0\n\t\n\t for (i = 0, j = 0; i < l; i += 4, j += 3) {\n\t tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n\t arr[L++] = (tmp >> 16) & 0xFF\n\t arr[L++] = (tmp >> 8) & 0xFF\n\t arr[L++] = tmp & 0xFF\n\t }\n\t\n\t if (placeHolders === 2) {\n\t tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n\t arr[L++] = tmp & 0xFF\n\t } else if (placeHolders === 1) {\n\t tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n\t arr[L++] = (tmp >> 8) & 0xFF\n\t arr[L++] = tmp & 0xFF\n\t }\n\t\n\t return arr\n\t}\n\t\n\tfunction tripletToBase64 (num) {\n\t return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n\t}\n\t\n\tfunction encodeChunk (uint8, start, end) {\n\t var tmp\n\t var output = []\n\t for (var i = start; i < end; i += 3) {\n\t tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n\t output.push(tripletToBase64(tmp))\n\t }\n\t return output.join('')\n\t}\n\t\n\tfunction fromByteArray (uint8) {\n\t var tmp\n\t var len = uint8.length\n\t var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n\t var output = ''\n\t var parts = []\n\t var maxChunkLength = 16383 // must be multiple of 3\n\t\n\t // go through the array every three bytes, we'll deal with trailing stuff later\n\t for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n\t parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n\t }\n\t\n\t // pad the end with zeros, but make sure to not forget the extra bytes\n\t if (extraBytes === 1) {\n\t tmp = uint8[len - 1]\n\t output += lookup[tmp >> 2]\n\t output += lookup[(tmp << 4) & 0x3F]\n\t output += '=='\n\t } else if (extraBytes === 2) {\n\t tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n\t output += lookup[tmp >> 10]\n\t output += lookup[(tmp >> 4) & 0x3F]\n\t output += lookup[(tmp << 2) & 0x3F]\n\t output += '='\n\t }\n\t\n\t parts.push(output)\n\t\n\t return parts.join('')\n\t}\n\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(__dirname) {\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar events = __webpack_require__(6);\n\t// Path depends on process. Avoid a circular reference by dynamically including path when we need it.\n\tvar path = null;\n\tvar Item = (function () {\n\t function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t }\n\t Item.prototype.run = function () {\n\t this.fun.apply(null, this.array);\n\t };\n\t return Item;\n\t}());\n\t/**\n\t * Contains a queue of Items for process.nextTick.\n\t * Inspired by node-process: https://github.com/defunctzombie/node-process\n\t */\n\tvar NextTickQueue = (function () {\n\t function NextTickQueue() {\n\t this._queue = [];\n\t this._draining = false;\n\t // Used/assigned by the drainQueue function.\n\t this._currentQueue = null;\n\t this._queueIndex = -1;\n\t }\n\t NextTickQueue.prototype.push = function (item) {\n\t var _this = this;\n\t if (this._queue.push(item) === 1 && !this._draining) {\n\t setTimeout(function () { return _this._drainQueue(); }, 0);\n\t }\n\t };\n\t NextTickQueue.prototype._cleanUpNextTick = function () {\n\t this._draining = false;\n\t if (this._currentQueue && this._currentQueue.length) {\n\t this._queue = this._currentQueue.concat(this._queue);\n\t }\n\t else {\n\t this._queueIndex = -1;\n\t }\n\t if (this._queue.length) {\n\t this._drainQueue();\n\t }\n\t };\n\t NextTickQueue.prototype._drainQueue = function () {\n\t var _this = this;\n\t if (this._draining) {\n\t return;\n\t }\n\t // If an Item throws an unhandled exception, this function will clean things up.\n\t var timeout = setTimeout(function () { return _this._cleanUpNextTick(); });\n\t this._draining = true;\n\t var len = this._queue.length;\n\t while (len) {\n\t this._currentQueue = this._queue;\n\t this._queue = [];\n\t while (++this._queueIndex < len) {\n\t if (this._currentQueue) {\n\t this._currentQueue[this._queueIndex].run();\n\t }\n\t }\n\t this._queueIndex = -1;\n\t len = this._queue.length;\n\t }\n\t this._currentQueue = null;\n\t this._draining = false;\n\t clearTimeout(timeout);\n\t };\n\t return NextTickQueue;\n\t}());\n\t/**\n\t * Partial implementation of Node's `process` module.\n\t * We implement the portions that are relevant for the filesystem.\n\t * @see http://nodejs.org/api/process.html\n\t * @class\n\t */\n\tvar Process = (function (_super) {\n\t __extends(Process, _super);\n\t function Process() {\n\t _super.apply(this, arguments);\n\t this.startTime = Date.now();\n\t this._cwd = '/';\n\t /**\n\t * Returns what platform you are running on.\n\t * @return [String]\n\t */\n\t this.platform = 'browser';\n\t this.argv = [];\n\t this.execArgv = [];\n\t this.stdout = null;\n\t this.stderr = null;\n\t this.stdin = null;\n\t this.domain = null;\n\t this._queue = new NextTickQueue();\n\t this.execPath = __dirname;\n\t this.env = {};\n\t this.exitCode = 0;\n\t this._gid = 1;\n\t this._uid = 1;\n\t this.version = 'v5.0';\n\t this.versions = {\n\t http_parser: '0.0',\n\t node: '5.0',\n\t v8: '0.0',\n\t uv: '0.0',\n\t zlib: '0.0',\n\t ares: '0.0',\n\t icu: '0.0',\n\t modules: '0',\n\t openssl: '0.0'\n\t };\n\t this.config = {\n\t target_defaults: { cflags: [],\n\t default_configuration: 'Release',\n\t defines: [],\n\t include_dirs: [],\n\t libraries: [] },\n\t variables: { clang: 0,\n\t host_arch: 'x32',\n\t node_install_npm: false,\n\t node_install_waf: false,\n\t node_prefix: '',\n\t node_shared_cares: false,\n\t node_shared_http_parser: false,\n\t node_shared_libuv: false,\n\t node_shared_zlib: false,\n\t node_shared_v8: false,\n\t node_use_dtrace: false,\n\t node_use_etw: false,\n\t node_use_openssl: false,\n\t node_shared_openssl: false,\n\t strict_aliasing: false,\n\t target_arch: 'x32',\n\t v8_use_snapshot: false,\n\t v8_no_strict_aliasing: 0,\n\t visibility: '' } };\n\t this.pid = (Math.random() * 1000) | 0;\n\t this.title = 'node';\n\t this.arch = 'x32';\n\t this._mask = 18;\n\t // Undefined in main thread. Worker-only.\n\t this.connected = undefined;\n\t }\n\t /**\n\t * Changes the current working directory.\n\t *\n\t * **Note**: BrowserFS does not validate that the directory actually exists.\n\t *\n\t * @example Usage example\n\t * console.log('Starting directory: ' + process.cwd());\n\t * process.chdir('/tmp');\n\t * console.log('New directory: ' + process.cwd());\n\t * @param [String] dir The directory to change to.\n\t */\n\t Process.prototype.chdir = function (dir) {\n\t // XXX: Circular dependency hack.\n\t if (path === null) {\n\t path = __webpack_require__(14);\n\t }\n\t this._cwd = path.resolve(dir);\n\t };\n\t /**\n\t * Returns the current working directory.\n\t * @example Usage example\n\t * console.log('Current directory: ' + process.cwd());\n\t * @return [String] The current working directory.\n\t */\n\t Process.prototype.cwd = function () {\n\t return this._cwd;\n\t };\n\t /**\n\t * Number of seconds BrowserFS has been running.\n\t * @return [Number]\n\t */\n\t Process.prototype.uptime = function () {\n\t return ((Date.now() - this.startTime) / 1000) | 0;\n\t };\n\t Process.prototype.nextTick = function (fun) {\n\t var args = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t args[_i - 1] = arguments[_i];\n\t }\n\t this._queue.push(new Item(fun, args));\n\t };\n\t Process.prototype.abort = function () {\n\t this.emit('abort');\n\t };\n\t Process.prototype.exit = function (code) {\n\t this.exitCode = code;\n\t this.emit('exit', [code]);\n\t };\n\t Process.prototype.getgid = function () {\n\t return this._gid;\n\t };\n\t Process.prototype.setgid = function (gid) {\n\t if (typeof gid === 'number') {\n\t this._gid = gid;\n\t }\n\t else {\n\t this._gid = 1;\n\t }\n\t };\n\t Process.prototype.getuid = function () {\n\t return this._uid;\n\t };\n\t Process.prototype.setuid = function (uid) {\n\t if (typeof uid === 'number') {\n\t this._uid = uid;\n\t }\n\t else {\n\t this._uid = 1;\n\t }\n\t };\n\t Process.prototype.kill = function (pid, signal) {\n\t this.emit('kill', [pid, signal]);\n\t };\n\t Process.prototype.memoryUsage = function () {\n\t return { rss: 0, heapTotal: 0, heapUsed: 0 };\n\t };\n\t Process.prototype.umask = function (mask) {\n\t if (mask === void 0) { mask = this._mask; }\n\t var oldMask = this._mask;\n\t this._mask = mask;\n\t this.emit('umask', [mask]);\n\t return oldMask;\n\t };\n\t Process.prototype.hrtime = function () {\n\t var timeinfo;\n\t if (typeof performance !== 'undefined') {\n\t timeinfo = performance.now();\n\t }\n\t else if (Date['now']) {\n\t timeinfo = Date.now();\n\t }\n\t else {\n\t timeinfo = (new Date()).getTime();\n\t }\n\t var secs = (timeinfo / 1000) | 0;\n\t timeinfo -= secs * 1000;\n\t timeinfo = (timeinfo * 1000000) | 0;\n\t return [secs, timeinfo];\n\t };\n\t /**\n\t * [BFS only] Initialize the TTY devices.\n\t */\n\t Process.prototype.initializeTTYs = function () {\n\t // Guard against multiple invocations.\n\t if (this.stdout === null) {\n\t var TTY = __webpack_require__(20);\n\t this.stdout = new TTY();\n\t this.stderr = new TTY();\n\t this.stdin = new TTY();\n\t }\n\t };\n\t /**\n\t * Worker-only function; irrelevant here.\n\t */\n\t Process.prototype.disconnect = function () {\n\t };\n\t return Process;\n\t}(events.EventEmitter));\n\tmodule.exports = Process;\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, \"/\"))\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(Buffer) {\"use strict\";\n\tvar __extends = (this && this.__extends) || function (d, b) {\n\t for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n\t function __() { this.constructor = d; }\n\t d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n\t};\n\tvar stream = __webpack_require__(9);\n\tvar TTY = (function (_super) {\n\t __extends(TTY, _super);\n\t function TTY() {\n\t _super.call(this);\n\t this.isRaw = false;\n\t this.columns = 80;\n\t this.rows = 120;\n\t this.isTTY = true;\n\t this._bufferedWrites = [];\n\t this._waitingForWrites = false;\n\t }\n\t /**\n\t * Toggle raw mode.\n\t */\n\t TTY.prototype.setRawMode = function (mode) {\n\t if (this.isRaw !== mode) {\n\t this.isRaw = mode;\n\t // [BFS] TTY implementations can use this to change their event emitting\n\t // patterns.\n\t this.emit('modeChange');\n\t }\n\t };\n\t /**\n\t * [BFS] Update the number of columns available on the terminal.\n\t */\n\t TTY.prototype.changeColumns = function (columns) {\n\t if (columns !== this.columns) {\n\t this.columns = columns;\n\t // Resize event.\n\t this.emit('resize');\n\t }\n\t };\n\t /**\n\t * [BFS] Update the number of rows available on the terminal.\n\t */\n\t TTY.prototype.changeRows = function (rows) {\n\t if (rows !== this.rows) {\n\t this.rows = rows;\n\t // Resize event.\n\t this.emit('resize');\n\t }\n\t };\n\t /**\n\t * Returns 'true' if the given object is a TTY.\n\t */\n\t TTY.isatty = function (fd) {\n\t return fd && fd instanceof TTY;\n\t };\n\t TTY.prototype._write = function (chunk, encoding, cb) {\n\t var error;\n\t try {\n\t var data;\n\t if (typeof (chunk) === 'string') {\n\t data = new Buffer(chunk, encoding);\n\t }\n\t else {\n\t data = chunk;\n\t }\n\t this._bufferedWrites.push(data);\n\t if (this._waitingForWrites) {\n\t this._read(1024);\n\t }\n\t }\n\t catch (e) {\n\t error = e;\n\t }\n\t finally {\n\t cb(error);\n\t }\n\t };\n\t TTY.prototype._read = function (size) {\n\t // Size is advisory -- we can ignore it.\n\t if (this._bufferedWrites.length === 0) {\n\t this._waitingForWrites = true;\n\t }\n\t else {\n\t while (this._bufferedWrites.length > 0) {\n\t this._waitingForWrites = this.push(this._bufferedWrites.shift());\n\t if (!this._waitingForWrites) {\n\t break;\n\t }\n\t }\n\t }\n\t };\n\t return TTY;\n\t}(stream.Duplex));\n\tmodule.exports = TTY;\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\texports.read = function (buffer, offset, isLE, mLen, nBytes) {\n\t var e, m\n\t var eLen = nBytes * 8 - mLen - 1\n\t var eMax = (1 << eLen) - 1\n\t var eBias = eMax >> 1\n\t var nBits = -7\n\t var i = isLE ? (nBytes - 1) : 0\n\t var d = isLE ? -1 : 1\n\t var s = buffer[offset + i]\n\t\n\t i += d\n\t\n\t e = s & ((1 << (-nBits)) - 1)\n\t s >>= (-nBits)\n\t nBits += eLen\n\t for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\t\n\t m = e & ((1 << (-nBits)) - 1)\n\t e >>= (-nBits)\n\t nBits += mLen\n\t for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\t\n\t if (e === 0) {\n\t e = 1 - eBias\n\t } else if (e === eMax) {\n\t return m ? NaN : ((s ? -1 : 1) * Infinity)\n\t } else {\n\t m = m + Math.pow(2, mLen)\n\t e = e - eBias\n\t }\n\t return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n\t}\n\t\n\texports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n\t var e, m, c\n\t var eLen = nBytes * 8 - mLen - 1\n\t var eMax = (1 << eLen) - 1\n\t var eBias = eMax >> 1\n\t var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n\t var i = isLE ? 0 : (nBytes - 1)\n\t var d = isLE ? 1 : -1\n\t var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\t\n\t value = Math.abs(value)\n\t\n\t if (isNaN(value) || value === Infinity) {\n\t m = isNaN(value) ? 1 : 0\n\t e = eMax\n\t } else {\n\t e = Math.floor(Math.log(value) / Math.LN2)\n\t if (value * (c = Math.pow(2, -e)) < 1) {\n\t e--\n\t c *= 2\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c\n\t } else {\n\t value += rt * Math.pow(2, 1 - eBias)\n\t }\n\t if (value * c >= 2) {\n\t e++\n\t c /= 2\n\t }\n\t\n\t if (e + eBias >= eMax) {\n\t m = 0\n\t e = eMax\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * Math.pow(2, mLen)\n\t e = e + eBias\n\t } else {\n\t m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n\t e = 0\n\t }\n\t }\n\t\n\t for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\t\n\t e = (e << mLen) | m\n\t eLen += mLen\n\t for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\t\n\t buffer[offset + i - d] |= s * 128\n\t}\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\tvar toString = {}.toString;\n\t\n\tmodule.exports = Array.isArray || function (arr) {\n\t return toString.call(arr) == '[object Array]';\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t\n\tvar zlib_inflate = __webpack_require__(30);\n\tvar utils = __webpack_require__(8);\n\tvar strings = __webpack_require__(24);\n\tvar c = __webpack_require__(26);\n\tvar msg = __webpack_require__(32);\n\tvar ZStream = __webpack_require__(33);\n\tvar GZheader = __webpack_require__(28);\n\t\n\tvar toString = Object.prototype.toString;\n\t\n\t/**\n\t * class Inflate\n\t *\n\t * Generic JS-style wrapper for zlib calls. If you don't need\n\t * streaming behaviour - use more simple functions: [[inflate]]\n\t * and [[inflateRaw]].\n\t **/\n\t\n\t/* internal\n\t * inflate.chunks -> Array\n\t *\n\t * Chunks of output data, if [[Inflate#onData]] not overriden.\n\t **/\n\t\n\t/**\n\t * Inflate.result -> Uint8Array|Array|String\n\t *\n\t * Uncompressed result, generated by default [[Inflate#onData]]\n\t * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n\t * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n\t * push a chunk with explicit flush (call [[Inflate#push]] with\n\t * `Z_SYNC_FLUSH` param).\n\t **/\n\t\n\t/**\n\t * Inflate.err -> Number\n\t *\n\t * Error code after inflate finished. 0 (Z_OK) on success.\n\t * Should be checked if broken data possible.\n\t **/\n\t\n\t/**\n\t * Inflate.msg -> String\n\t *\n\t * Error message, if [[Inflate.err]] != 0\n\t **/\n\t\n\t\n\t/**\n\t * new Inflate(options)\n\t * - options (Object): zlib inflate options.\n\t *\n\t * Creates new inflator instance with specified params. Throws exception\n\t * on bad params. Supported options:\n\t *\n\t * - `windowBits`\n\t * - `dictionary`\n\t *\n\t * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n\t * for more information on these.\n\t *\n\t * Additional options, for internal needs:\n\t *\n\t * - `chunkSize` - size of generated data chunks (16K by default)\n\t * - `raw` (Boolean) - do raw inflate\n\t * - `to` (String) - if equal to 'string', then result will be converted\n\t * from utf8 to utf16 (javascript) string. When string output requested,\n\t * chunk length can differ from `chunkSize`, depending on content.\n\t *\n\t * By default, when no options set, autodetect deflate/gzip data format via\n\t * wrapper header.\n\t *\n\t * ##### Example:\n\t *\n\t * ```javascript\n\t * var pako = require('pako')\n\t * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n\t * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n\t *\n\t * var inflate = new pako.Inflate({ level: 3});\n\t *\n\t * inflate.push(chunk1, false);\n\t * inflate.push(chunk2, true); // true -> last chunk\n\t *\n\t * if (inflate.err) { throw new Error(inflate.err); }\n\t *\n\t * console.log(inflate.result);\n\t * ```\n\t **/\n\tfunction Inflate(options) {\n\t if (!(this instanceof Inflate)) return new Inflate(options);\n\t\n\t this.options = utils.assign({\n\t chunkSize: 16384,\n\t windowBits: 0,\n\t to: ''\n\t }, options || {});\n\t\n\t var opt = this.options;\n\t\n\t // Force window size for `raw` data, if not set directly,\n\t // because we have no header for autodetect.\n\t if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n\t opt.windowBits = -opt.windowBits;\n\t if (opt.windowBits === 0) { opt.windowBits = -15; }\n\t }\n\t\n\t // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n\t if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n\t !(options && options.windowBits)) {\n\t opt.windowBits += 32;\n\t }\n\t\n\t // Gzip header has no info about windows size, we can do autodetect only\n\t // for deflate. So, if window size not set, force it to max when gzip possible\n\t if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n\t // bit 3 (16) -> gzipped data\n\t // bit 4 (32) -> autodetect gzip/deflate\n\t if ((opt.windowBits & 15) === 0) {\n\t opt.windowBits |= 15;\n\t }\n\t }\n\t\n\t this.err = 0; // error code, if happens (0 = Z_OK)\n\t this.msg = ''; // error message\n\t this.ended = false; // used to avoid multiple onEnd() calls\n\t this.chunks = []; // chunks of compressed data\n\t\n\t this.strm = new ZStream();\n\t this.strm.avail_out = 0;\n\t\n\t var status = zlib_inflate.inflateInit2(\n\t this.strm,\n\t opt.windowBits\n\t );\n\t\n\t if (status !== c.Z_OK) {\n\t throw new Error(msg[status]);\n\t }\n\t\n\t this.header = new GZheader();\n\t\n\t zlib_inflate.inflateGetHeader(this.strm, this.header);\n\t}\n\t\n\t/**\n\t * Inflate#push(data[, mode]) -> Boolean\n\t * - data (Uint8Array|Array|ArrayBuffer|String): input data\n\t * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n\t * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.\n\t *\n\t * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n\t * new output chunks. Returns `true` on success. The last data block must have\n\t * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n\t * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n\t * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n\t *\n\t * On fail call [[Inflate#onEnd]] with error code and return false.\n\t *\n\t * We strongly recommend to use `Uint8Array` on input for best speed (output\n\t * format is detected automatically). Also, don't skip last param and always\n\t * use the same type in your code (boolean or number). That will improve JS speed.\n\t *\n\t * For regular `Array`-s make sure all elements are [0..255].\n\t *\n\t * ##### Example\n\t *\n\t * ```javascript\n\t * push(chunk, false); // push one of data chunks\n\t * ...\n\t * push(chunk, true); // push last chunk\n\t * ```\n\t **/\n\tInflate.prototype.push = function (data, mode) {\n\t var strm = this.strm;\n\t var chunkSize = this.options.chunkSize;\n\t var dictionary = this.options.dictionary;\n\t var status, _mode;\n\t var next_out_utf8, tail, utf8str;\n\t var dict;\n\t\n\t // Flag to properly process Z_BUF_ERROR on testing inflate call\n\t // when we check that all output data was flushed.\n\t var allowBufError = false;\n\t\n\t if (this.ended) { return false; }\n\t _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\t\n\t // Convert data if needed\n\t if (typeof data === 'string') {\n\t // Only binary strings can be decompressed on practice\n\t strm.input = strings.binstring2buf(data);\n\t } else if (toString.call(data) === '[object ArrayBuffer]') {\n\t strm.input = new Uint8Array(data);\n\t } else {\n\t strm.input = data;\n\t }\n\t\n\t strm.next_in = 0;\n\t strm.avail_in = strm.input.length;\n\t\n\t do {\n\t if (strm.avail_out === 0) {\n\t strm.output = new utils.Buf8(chunkSize);\n\t strm.next_out = 0;\n\t strm.avail_out = chunkSize;\n\t }\n\t\n\t status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\t\n\t if (status === c.Z_NEED_DICT && dictionary) {\n\t // Convert data if needed\n\t if (typeof dictionary === 'string') {\n\t dict = strings.string2buf(dictionary);\n\t } else if (toString.call(dictionary) === '[object ArrayBuffer]') {\n\t dict = new Uint8Array(dictionary);\n\t } else {\n\t dict = dictionary;\n\t }\n\t\n\t status = zlib_inflate.inflateSetDictionary(this.strm, dict);\n\t\n\t }\n\t\n\t if (status === c.Z_BUF_ERROR && allowBufError === true) {\n\t status = c.Z_OK;\n\t allowBufError = false;\n\t }\n\t\n\t if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n\t this.onEnd(status);\n\t this.ended = true;\n\t return false;\n\t }\n\t\n\t if (strm.next_out) {\n\t if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\t\n\t if (this.options.to === 'string') {\n\t\n\t next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\t\n\t tail = strm.next_out - next_out_utf8;\n\t utf8str = strings.buf2string(strm.output, next_out_utf8);\n\t\n\t // move tail\n\t strm.next_out = tail;\n\t strm.avail_out = chunkSize - tail;\n\t if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\t\n\t this.onData(utf8str);\n\t\n\t } else {\n\t this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n\t }\n\t }\n\t }\n\t\n\t // When no more input data, we should check that internal inflate buffers\n\t // are flushed. The only way to do it when avail_out = 0 - run one more\n\t // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n\t // Here we set flag to process this error properly.\n\t //\n\t // NOTE. Deflate does not return error in this case and does not needs such\n\t // logic.\n\t if (strm.avail_in === 0 && strm.avail_out === 0) {\n\t allowBufError = true;\n\t }\n\t\n\t } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\t\n\t if (status === c.Z_STREAM_END) {\n\t _mode = c.Z_FINISH;\n\t }\n\t\n\t // Finalize on the last chunk.\n\t if (_mode === c.Z_FINISH) {\n\t status = zlib_inflate.inflateEnd(this.strm);\n\t this.onEnd(status);\n\t this.ended = true;\n\t return status === c.Z_OK;\n\t }\n\t\n\t // callback interim results if Z_SYNC_FLUSH.\n\t if (_mode === c.Z_SYNC_FLUSH) {\n\t this.onEnd(c.Z_OK);\n\t strm.avail_out = 0;\n\t return true;\n\t }\n\t\n\t return true;\n\t};\n\t\n\t\n\t/**\n\t * Inflate#onData(chunk) -> Void\n\t * - chunk (Uint8Array|Array|String): ouput data. Type of array depends\n\t * on js engine support. When string output requested, each chunk\n\t * will be string.\n\t *\n\t * By default, stores data blocks in `chunks[]` property and glue\n\t * those in `onEnd`. Override this handler, if you need another behaviour.\n\t **/\n\tInflate.prototype.onData = function (chunk) {\n\t this.chunks.push(chunk);\n\t};\n\t\n\t\n\t/**\n\t * Inflate#onEnd(status) -> Void\n\t * - status (Number): inflate status. 0 (Z_OK) on success,\n\t * other if not.\n\t *\n\t * Called either after you tell inflate that the input stream is\n\t * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n\t * or if an error happened. By default - join collected chunks,\n\t * free memory and fill `results` / `err` properties.\n\t **/\n\tInflate.prototype.onEnd = function (status) {\n\t // On success - join\n\t if (status === c.Z_OK) {\n\t if (this.options.to === 'string') {\n\t // Glue & convert here, until we teach pako to send\n\t // utf8 alligned strings to onData\n\t this.result = this.chunks.join('');\n\t } else {\n\t this.result = utils.flattenChunks(this.chunks);\n\t }\n\t }\n\t this.chunks = [];\n\t this.err = status;\n\t this.msg = this.strm.msg;\n\t};\n\t\n\t\n\t/**\n\t * inflate(data[, options]) -> Uint8Array|Array|String\n\t * - data (Uint8Array|Array|String): input data to decompress.\n\t * - options (Object): zlib inflate options.\n\t *\n\t * Decompress `data` with inflate/ungzip and `options`. Autodetect\n\t * format via wrapper header by default. That's why we don't provide\n\t * separate `ungzip` method.\n\t *\n\t * Supported options are:\n\t *\n\t * - windowBits\n\t *\n\t * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n\t * for more information.\n\t *\n\t * Sugar (options):\n\t *\n\t * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n\t * negative windowBits implicitly.\n\t * - `to` (String) - if equal to 'string', then result will be converted\n\t * from utf8 to utf16 (javascript) string. When string output requested,\n\t * chunk length can differ from `chunkSize`, depending on content.\n\t *\n\t *\n\t * ##### Example:\n\t *\n\t * ```javascript\n\t * var pako = require('pako')\n\t * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n\t * , output;\n\t *\n\t * try {\n\t * output = pako.inflate(input);\n\t * } catch (err)\n\t * console.log(err);\n\t * }\n\t * ```\n\t **/\n\tfunction inflate(input, options) {\n\t var inflator = new Inflate(options);\n\t\n\t inflator.push(input, true);\n\t\n\t // That will never happens, if you don't cheat with options :)\n\t if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\t\n\t return inflator.result;\n\t}\n\t\n\t\n\t/**\n\t * inflateRaw(data[, options]) -> Uint8Array|Array|String\n\t * - data (Uint8Array|Array|String): input data to decompress.\n\t * - options (Object): zlib inflate options.\n\t *\n\t * The same as [[inflate]], but creates raw data, without wrapper\n\t * (header and adler32 crc).\n\t **/\n\tfunction inflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return inflate(input, options);\n\t}\n\t\n\t\n\t/**\n\t * ungzip(data[, options]) -> Uint8Array|Array|String\n\t * - data (Uint8Array|Array|String): input data to decompress.\n\t * - options (Object): zlib inflate options.\n\t *\n\t * Just shortcut to [[inflate]], because it autodetects format\n\t * by header.content. Done for convenience.\n\t **/\n\t\n\t\n\texports.Inflate = Inflate;\n\texports.inflate = inflate;\n\texports.inflateRaw = inflateRaw;\n\texports.ungzip = inflate;\n\n\n/***/ },\n/* 24 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// String encode/decode helpers\n\t'use strict';\n\t\n\t\n\tvar utils = __webpack_require__(8);\n\t\n\t\n\t// Quick check if we can use fast array to bin string conversion\n\t//\n\t// - apply(Array) can fail on Android 2.2\n\t// - apply(Uint8Array) can fail on iOS 5.1 Safary\n\t//\n\tvar STR_APPLY_OK = true;\n\tvar STR_APPLY_UIA_OK = true;\n\t\n\ttry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\n\ttry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\t\n\t\n\t// Table with utf8 lengths (calculated by first byte of sequence)\n\t// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n\t// because max possible codepoint is 0x10ffff\n\tvar _utf8len = new utils.Buf8(256);\n\tfor (var q = 0; q < 256; q++) {\n\t _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n\t}\n\t_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\t\n\t\n\t// convert string to array (typed, when possible)\n\texports.string2buf = function (str) {\n\t var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\t\n\t // count binary size\n\t for (m_pos = 0; m_pos < str_len; m_pos++) {\n\t c = str.charCodeAt(m_pos);\n\t if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n\t c2 = str.charCodeAt(m_pos + 1);\n\t if ((c2 & 0xfc00) === 0xdc00) {\n\t c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n\t m_pos++;\n\t }\n\t }\n\t buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n\t }\n\t\n\t // allocate buffer\n\t buf = new utils.Buf8(buf_len);\n\t\n\t // convert\n\t for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n\t c = str.charCodeAt(m_pos);\n\t if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n\t c2 = str.charCodeAt(m_pos + 1);\n\t if ((c2 & 0xfc00) === 0xdc00) {\n\t c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n\t m_pos++;\n\t }\n\t }\n\t if (c < 0x80) {\n\t /* one byte */\n\t buf[i++] = c;\n\t } else if (c < 0x800) {\n\t /* two bytes */\n\t buf[i++] = 0xC0 | (c >>> 6);\n\t buf[i++] = 0x80 | (c & 0x3f);\n\t } else if (c < 0x10000) {\n\t /* three bytes */\n\t buf[i++] = 0xE0 | (c >>> 12);\n\t buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n\t buf[i++] = 0x80 | (c & 0x3f);\n\t } else {\n\t /* four bytes */\n\t buf[i++] = 0xf0 | (c >>> 18);\n\t buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n\t buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n\t buf[i++] = 0x80 | (c & 0x3f);\n\t }\n\t }\n\t\n\t return buf;\n\t};\n\t\n\t// Helper (used in 2 places)\n\tfunction buf2binstring(buf, len) {\n\t // use fallback for big arrays to avoid stack overflow\n\t if (len < 65537) {\n\t if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n\t return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n\t }\n\t }\n\t\n\t var result = '';\n\t for (var i = 0; i < len; i++) {\n\t result += String.fromCharCode(buf[i]);\n\t }\n\t return result;\n\t}\n\t\n\t\n\t// Convert byte array to binary string\n\texports.buf2binstring = function (buf) {\n\t return buf2binstring(buf, buf.length);\n\t};\n\t\n\t\n\t// Convert binary string (typed, when possible)\n\texports.binstring2buf = function (str) {\n\t var buf = new utils.Buf8(str.length);\n\t for (var i = 0, len = buf.length; i < len; i++) {\n\t buf[i] = str.charCodeAt(i);\n\t }\n\t return buf;\n\t};\n\t\n\t\n\t// convert array to string\n\texports.buf2string = function (buf, max) {\n\t var i, out, c, c_len;\n\t var len = max || buf.length;\n\t\n\t // Reserve max possible length (2 words per char)\n\t // NB: by unknown reasons, Array is significantly faster for\n\t // String.fromCharCode.apply than Uint16Array.\n\t var utf16buf = new Array(len * 2);\n\t\n\t for (out = 0, i = 0; i < len;) {\n\t c = buf[i++];\n\t // quick process ascii\n\t if (c < 0x80) { utf16buf[out++] = c; continue; }\n\t\n\t c_len = _utf8len[c];\n\t // skip 5 & 6 byte codes\n\t if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\t\n\t // apply mask on first byte\n\t c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n\t // join the rest\n\t while (c_len > 1 && i < len) {\n\t c = (c << 6) | (buf[i++] & 0x3f);\n\t c_len--;\n\t }\n\t\n\t // terminated by end of string?\n\t if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\t\n\t if (c < 0x10000) {\n\t utf16buf[out++] = c;\n\t } else {\n\t c -= 0x10000;\n\t utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n\t utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n\t }\n\t }\n\t\n\t return buf2binstring(utf16buf, out);\n\t};\n\t\n\t\n\t// Calculate max possible position in utf8 buffer,\n\t// that will not break sequence. If that's not possible\n\t// - (very small limits) return max size as is.\n\t//\n\t// buf[] - utf8 bytes array\n\t// max - length limit (mandatory);\n\texports.utf8border = function (buf, max) {\n\t var pos;\n\t\n\t max = max || buf.length;\n\t if (max > buf.length) { max = buf.length; }\n\t\n\t // go back from last position, until start of sequence found\n\t pos = max - 1;\n\t while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\t\n\t // Fuckup - very small and broken sequence,\n\t // return max, because we should return something anyway.\n\t if (pos < 0) { return max; }\n\t\n\t // If we came to start of buffer - that means vuffer is too small,\n\t // return max too.\n\t if (pos === 0) { return max; }\n\t\n\t return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n\t};\n\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Note: adler32 takes 12% for level 0 and 2% for level 6.\n\t// It doesn't worth to make additional optimizationa as in original.\n\t// Small size is preferable.\n\t\n\tfunction adler32(adler, buf, len, pos) {\n\t var s1 = (adler & 0xffff) |0,\n\t s2 = ((adler >>> 16) & 0xffff) |0,\n\t n = 0;\n\t\n\t while (len !== 0) {\n\t // Set limit ~ twice less than 5552, to keep\n\t // s2 in 31-bits, because we force signed ints.\n\t // in other case %= will fail.\n\t n = len > 2000 ? 2000 : len;\n\t len -= n;\n\t\n\t do {\n\t s1 = (s1 + buf[pos++]) |0;\n\t s2 = (s2 + s1) |0;\n\t } while (--n);\n\t\n\t s1 %= 65521;\n\t s2 %= 65521;\n\t }\n\t\n\t return (s1 | (s2 << 16)) |0;\n\t}\n\t\n\t\n\tmodule.exports = adler32;\n\n\n/***/ },\n/* 26 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t\n\tmodule.exports = {\n\t\n\t /* Allowed flush values; see deflate() and inflate() below for details */\n\t Z_NO_FLUSH: 0,\n\t Z_PARTIAL_FLUSH: 1,\n\t Z_SYNC_FLUSH: 2,\n\t Z_FULL_FLUSH: 3,\n\t Z_FINISH: 4,\n\t Z_BLOCK: 5,\n\t Z_TREES: 6,\n\t\n\t /* Return codes for the compression/decompression functions. Negative values\n\t * are errors, positive values are used for special but normal events.\n\t */\n\t Z_OK: 0,\n\t Z_STREAM_END: 1,\n\t Z_NEED_DICT: 2,\n\t Z_ERRNO: -1,\n\t Z_STREAM_ERROR: -2,\n\t Z_DATA_ERROR: -3,\n\t //Z_MEM_ERROR: -4,\n\t Z_BUF_ERROR: -5,\n\t //Z_VERSION_ERROR: -6,\n\t\n\t /* compression levels */\n\t Z_NO_COMPRESSION: 0,\n\t Z_BEST_SPEED: 1,\n\t Z_BEST_COMPRESSION: 9,\n\t Z_DEFAULT_COMPRESSION: -1,\n\t\n\t\n\t Z_FILTERED: 1,\n\t Z_HUFFMAN_ONLY: 2,\n\t Z_RLE: 3,\n\t Z_FIXED: 4,\n\t Z_DEFAULT_STRATEGY: 0,\n\t\n\t /* Possible values of the data_type field (though see inflate()) */\n\t Z_BINARY: 0,\n\t Z_TEXT: 1,\n\t //Z_ASCII: 1, // = Z_TEXT (deprecated)\n\t Z_UNKNOWN: 2,\n\t\n\t /* The deflate compression method */\n\t Z_DEFLATED: 8\n\t //Z_NULL: null // Use -1 or null inline, depending on var type\n\t};\n\n\n/***/ },\n/* 27 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Note: we can't get significant speed boost here.\n\t// So write code to minimize size - no pregenerated tables\n\t// and array tools dependencies.\n\t\n\t\n\t// Use ordinary array, since untyped makes no boost here\n\tfunction makeTable() {\n\t var c, table = [];\n\t\n\t for (var n = 0; n < 256; n++) {\n\t c = n;\n\t for (var k = 0; k < 8; k++) {\n\t c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n\t }\n\t table[n] = c;\n\t }\n\t\n\t return table;\n\t}\n\t\n\t// Create table on load. Just 255 signed longs. Not a problem.\n\tvar crcTable = makeTable();\n\t\n\t\n\tfunction crc32(crc, buf, len, pos) {\n\t var t = crcTable,\n\t end = pos + len;\n\t\n\t crc ^= -1;\n\t\n\t for (var i = pos; i < end; i++) {\n\t crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n\t }\n\t\n\t return (crc ^ (-1)); // >>> 0;\n\t}\n\t\n\t\n\tmodule.exports = crc32;\n\n\n/***/ },\n/* 28 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t\n\tfunction GZheader() {\n\t /* true if compressed data believed to be text */\n\t this.text = 0;\n\t /* modification time */\n\t this.time = 0;\n\t /* extra flags (not used when writing a gzip file) */\n\t this.xflags = 0;\n\t /* operating system */\n\t this.os = 0;\n\t /* pointer to extra field or Z_NULL if none */\n\t this.extra = null;\n\t /* extra field length (valid if extra != Z_NULL) */\n\t this.extra_len = 0; // Actually, we don't need it in JS,\n\t // but leave for few code modifications\n\t\n\t //\n\t // Setup limits is not necessary because in js we should not preallocate memory\n\t // for inflate use constant limit in 65536 bytes\n\t //\n\t\n\t /* space at extra (only when reading header) */\n\t // this.extra_max = 0;\n\t /* pointer to zero-terminated file name or Z_NULL */\n\t this.name = '';\n\t /* space at name (only when reading header) */\n\t // this.name_max = 0;\n\t /* pointer to zero-terminated comment or Z_NULL */\n\t this.comment = '';\n\t /* space at comment (only when reading header) */\n\t // this.comm_max = 0;\n\t /* true if there was or will be a header crc */\n\t this.hcrc = 0;\n\t /* true when done reading gzip header (not used when writing a gzip file) */\n\t this.done = false;\n\t}\n\t\n\tmodule.exports = GZheader;\n\n\n/***/ },\n/* 29 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// See state defs from inflate.js\n\tvar BAD = 30; /* got a data error -- remain here until reset */\n\tvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\t\n\t/*\n\t Decode literal, length, and distance codes and write out the resulting\n\t literal and match bytes until either not enough input or output is\n\t available, an end-of-block is encountered, or a data error is encountered.\n\t When large enough input and output buffers are supplied to inflate(), for\n\t example, a 16K input buffer and a 64K output buffer, more than 95% of the\n\t inflate execution time is spent in this routine.\n\t\n\t Entry assumptions:\n\t\n\t state.mode === LEN\n\t strm.avail_in >= 6\n\t strm.avail_out >= 258\n\t start >= strm.avail_out\n\t state.bits < 8\n\t\n\t On return, state.mode is one of:\n\t\n\t LEN -- ran out of enough output space or enough available input\n\t TYPE -- reached end of block code, inflate() to interpret next block\n\t BAD -- error in block data\n\t\n\t Notes:\n\t\n\t - The maximum input bits used by a length/distance pair is 15 bits for the\n\t length code, 5 bits for the length extra, 15 bits for the distance code,\n\t and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n\t Therefore if strm.avail_in >= 6, then there is enough input to avoid\n\t checking for available input while decoding.\n\t\n\t - The maximum bytes that a single length/distance pair can output is 258\n\t bytes, which is the maximum length that can be coded. inflate_fast()\n\t requires strm.avail_out >= 258 for each loop to avoid checking for\n\t output space.\n\t */\n\tmodule.exports = function inflate_fast(strm, start) {\n\t var state;\n\t var _in; /* local strm.input */\n\t var last; /* have enough input while in < last */\n\t var _out; /* local strm.output */\n\t var beg; /* inflate()'s initial strm.output */\n\t var end; /* while out < end, enough space available */\n\t//#ifdef INFLATE_STRICT\n\t var dmax; /* maximum distance from zlib header */\n\t//#endif\n\t var wsize; /* window size or zero if not using window */\n\t var whave; /* valid bytes in the window */\n\t var wnext; /* window write index */\n\t // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n\t var s_window; /* allocated sliding window, if wsize != 0 */\n\t var hold; /* local strm.hold */\n\t var bits; /* local strm.bits */\n\t var lcode; /* local strm.lencode */\n\t var dcode; /* local strm.distcode */\n\t var lmask; /* mask for first level of length codes */\n\t var dmask; /* mask for first level of distance codes */\n\t var here; /* retrieved table entry */\n\t var op; /* code bits, operation, extra bits, or */\n\t /* window position, window bytes to copy */\n\t var len; /* match length, unused bytes */\n\t var dist; /* match distance */\n\t var from; /* where to copy match from */\n\t var from_source;\n\t\n\t\n\t var input, output; // JS specific, because we have no pointers\n\t\n\t /* copy state to local variables */\n\t state = strm.state;\n\t //here = state.here;\n\t _in = strm.next_in;\n\t input = strm.input;\n\t last = _in + (strm.avail_in - 5);\n\t _out = strm.next_out;\n\t output = strm.output;\n\t beg = _out - (start - strm.avail_out);\n\t end = _out + (strm.avail_out - 257);\n\t//#ifdef INFLATE_STRICT\n\t dmax = state.dmax;\n\t//#endif\n\t wsize = state.wsize;\n\t whave = state.whave;\n\t wnext = state.wnext;\n\t s_window = state.window;\n\t hold = state.hold;\n\t bits = state.bits;\n\t lcode = state.lencode;\n\t dcode = state.distcode;\n\t lmask = (1 << state.lenbits) - 1;\n\t dmask = (1 << state.distbits) - 1;\n\t\n\t\n\t /* decode literals and length/distances until end-of-block or not enough\n\t input data or output space */\n\t\n\t top:\n\t do {\n\t if (bits < 15) {\n\t hold += input[_in++] << bits;\n\t bits += 8;\n\t hold += input[_in++] << bits;\n\t bits += 8;\n\t }\n\t\n\t here = lcode[hold & lmask];\n\t\n\t dolen:\n\t for (;;) { // Goto emulation\n\t op = here >>> 24/*here.bits*/;\n\t hold >>>= op;\n\t bits -= op;\n\t op = (here >>> 16) & 0xff/*here.op*/;\n\t if (op === 0) { /* literal */\n\t //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n\t // \"inflate: literal '%c'\\n\" :\n\t // \"inflate: literal 0x%02x\\n\", here.val));\n\t output[_out++] = here & 0xffff/*here.val*/;\n\t }\n\t else if (op & 16) { /* length base */\n\t len = here & 0xffff/*here.val*/;\n\t op &= 15; /* number of extra bits */\n\t if (op) {\n\t if (bits < op) {\n\t hold += input[_in++] << bits;\n\t bits += 8;\n\t }\n\t len += hold & ((1 << op) - 1);\n\t hold >>>= op;\n\t bits -= op;\n\t }\n\t //Tracevv((stderr, \"inflate: length %u\\n\", len));\n\t if (bits < 15) {\n\t hold += input[_in++] << bits;\n\t bits += 8;\n\t hold += input[_in++] << bits;\n\t bits += 8;\n\t }\n\t here = dcode[hold & dmask];\n\t\n\t dodist:\n\t for (;;) { // goto emulation\n\t op = here >>> 24/*here.bits*/;\n\t hold >>>= op;\n\t bits -= op;\n\t op = (here >>> 16) & 0xff/*here.op*/;\n\t\n\t if (op & 16) { /* distance base */\n\t dist = here & 0xffff/*here.val*/;\n\t op &= 15; /* number of extra bits */\n\t if (bits < op) {\n\t hold += input[_in++] << bits;\n\t bits += 8;\n\t if (bits < op) {\n\t hold += input[_in++] << bits;\n\t bits += 8;\n\t }\n\t }\n\t dist += hold & ((1 << op) - 1);\n\t//#ifdef INFLATE_STRICT\n\t if (dist > dmax) {\n\t strm.msg = 'invalid distance too far back';\n\t state.mode = BAD;\n\t break top;\n\t }\n\t//#endif\n\t hold >>>= op;\n\t bits -= op;\n\t //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n\t op = _out - beg; /* max distance in output */\n\t if (dist > op) { /* see if copy from window */\n\t op = dist - op; /* distance back in window */\n\t if (op > whave) {\n\t if (state.sane) {\n\t strm.msg = 'invalid distance too far back';\n\t state.mode = BAD;\n\t break top;\n\t }\n\t\n\t// (!) This block is disabled in zlib defailts,\n\t// don't enable it for binary compatibility\n\t//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n\t// if (len <= op - whave) {\n\t// do {\n\t// output[_out++] = 0;\n\t// } while (--len);\n\t// continue top;\n\t// }\n\t// len -= op - whave;\n\t// do {\n\t// output[_out++] = 0;\n\t// } while (--op > whave);\n\t// if (op === 0) {\n\t// from = _out - dist;\n\t// do {\n\t// output[_out++] = output[from++];\n\t// } while (--len);\n\t// continue top;\n\t// }\n\t//#endif\n\t }\n\t from = 0; // window index\n\t from_source = s_window;\n\t if (wnext === 0) { /* very common case */\n\t from += wsize - op;\n\t if (op < len) { /* some from window */\n\t len -= op;\n\t do {\n\t output[_out++] = s_window[from++];\n\t } while (--op);\n\t from = _out - dist; /* rest from output */\n\t from_source = output;\n\t }\n\t }\n\t else if (wnext < op) { /* wrap around window */\n\t from += wsize + wnext - op;\n\t op -= wnext;\n\t if (op < len) { /* some from end of window */\n\t len -= op;\n\t do {\n\t output[_out++] = s_window[from++];\n\t } while (--op);\n\t from = 0;\n\t if (wnext < len) { /* some from start of window */\n\t op = wnext;\n\t len -= op;\n\t do {\n\t output[_out++] = s_window[from++];\n\t } while (--op);\n\t from = _out - dist; /* rest from output */\n\t from_source = output;\n\t }\n\t }\n\t }\n\t else { /* contiguous in window */\n\t from += wnext - op;\n\t if (op < len) { /* some from window */\n\t len -= op;\n\t do {\n\t output[_out++] = s_window[from++];\n\t } while (--op);\n\t from = _out - dist; /* rest from output */\n\t from_source = output;\n\t }\n\t }\n\t while (len > 2) {\n\t output[_out++] = from_source[from++];\n\t output[_out++] = from_source[from++];\n\t output[_out++] = from_source[from++];\n\t len -= 3;\n\t }\n\t if (len) {\n\t output[_out++] = from_source[from++];\n\t if (len > 1) {\n\t output[_out++] = from_source[from++];\n\t }\n\t }\n\t }\n\t else {\n\t from = _out - dist; /* copy direct from output */\n\t do { /* minimum length is three */\n\t output[_out++] = output[from++];\n\t output[_out++] = output[from++];\n\t output[_out++] = output[from++];\n\t len -= 3;\n\t } while (len > 2);\n\t if (len) {\n\t output[_out++] = output[from++];\n\t if (len > 1) {\n\t output[_out++] = output[from++];\n\t }\n\t }\n\t }\n\t }\n\t else if ((op & 64) === 0) { /* 2nd level distance code */\n\t here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n\t continue dodist;\n\t }\n\t else {\n\t strm.msg = 'invalid distance code';\n\t state.mode = BAD;\n\t break top;\n\t }\n\t\n\t break; // need to emulate goto via \"continue\"\n\t }\n\t }\n\t else if ((op & 64) === 0) { /* 2nd level length code */\n\t here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n\t continue dolen;\n\t }\n\t else if (op & 32) { /* end-of-block */\n\t //Tracevv((stderr, \"inflate: end of block\\n\"));\n\t state.mode = TYPE;\n\t break top;\n\t }\n\t else {\n\t strm.msg = 'invalid literal/length code';\n\t state.mode = BAD;\n\t break top;\n\t }\n\t\n\t break; // need to emulate goto via \"continue\"\n\t }\n\t } while (_in < last && _out < end);\n\t\n\t /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n\t len = bits >> 3;\n\t _in -= len;\n\t bits -= len << 3;\n\t hold &= (1 << bits) - 1;\n\t\n\t /* update state and return */\n\t strm.next_in = _in;\n\t strm.next_out = _out;\n\t strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n\t strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n\t state.hold = hold;\n\t state.bits = bits;\n\t return;\n\t};\n\n\n/***/ },\n/* 30 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t\n\tvar utils = __webpack_require__(8);\n\tvar adler32 = __webpack_require__(25);\n\tvar crc32 = __webpack_require__(27);\n\tvar inflate_fast = __webpack_require__(29);\n\tvar inflate_table = __webpack_require__(31);\n\t\n\tvar CODES = 0;\n\tvar LENS = 1;\n\tvar DISTS = 2;\n\t\n\t/* Public constants ==========================================================*/\n\t/* ===========================================================================*/\n\t\n\t\n\t/* Allowed flush values; see deflate() and inflate() below for details */\n\t//var Z_NO_FLUSH = 0;\n\t//var Z_PARTIAL_FLUSH = 1;\n\t//var Z_SYNC_FLUSH = 2;\n\t//var Z_FULL_FLUSH = 3;\n\tvar Z_FINISH = 4;\n\tvar Z_BLOCK = 5;\n\tvar Z_TREES = 6;\n\t\n\t\n\t/* Return codes for the compression/decompression functions. Negative values\n\t * are errors, positive values are used for special but normal events.\n\t */\n\tvar Z_OK = 0;\n\tvar Z_STREAM_END = 1;\n\tvar Z_NEED_DICT = 2;\n\t//var Z_ERRNO = -1;\n\tvar Z_STREAM_ERROR = -2;\n\tvar Z_DATA_ERROR = -3;\n\tvar Z_MEM_ERROR = -4;\n\tvar Z_BUF_ERROR = -5;\n\t//var Z_VERSION_ERROR = -6;\n\t\n\t/* The deflate compression method */\n\tvar Z_DEFLATED = 8;\n\t\n\t\n\t/* STATES ====================================================================*/\n\t/* ===========================================================================*/\n\t\n\t\n\tvar HEAD = 1; /* i: waiting for magic header */\n\tvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\n\tvar TIME = 3; /* i: waiting for modification time (gzip) */\n\tvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\n\tvar EXLEN = 5; /* i: waiting for extra length (gzip) */\n\tvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\n\tvar NAME = 7; /* i: waiting for end of file name (gzip) */\n\tvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\n\tvar HCRC = 9; /* i: waiting for header crc (gzip) */\n\tvar DICTID = 10; /* i: waiting for dictionary check value */\n\tvar DICT = 11; /* waiting for inflateSetDictionary() call */\n\tvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\tvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\n\tvar STORED = 14; /* i: waiting for stored size (length and complement) */\n\tvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\n\tvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\n\tvar TABLE = 17; /* i: waiting for dynamic block table lengths */\n\tvar LENLENS = 18; /* i: waiting for code length code lengths */\n\tvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\n\tvar LEN_ = 20; /* i: same as LEN below, but only first time in */\n\tvar LEN = 21; /* i: waiting for length/lit/eob code */\n\tvar LENEXT = 22; /* i: waiting for length extra bits */\n\tvar DIST = 23; /* i: waiting for distance code */\n\tvar DISTEXT = 24; /* i: waiting for distance extra bits */\n\tvar MATCH = 25; /* o: waiting for output space to copy string */\n\tvar LIT = 26; /* o: waiting for output space to write literal */\n\tvar CHECK = 27; /* i: waiting for 32-bit check value */\n\tvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\n\tvar DONE = 29; /* finished check, done -- remain here until reset */\n\tvar BAD = 30; /* got a data error -- remain here until reset */\n\tvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\n\tvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\t\n\t/* ===========================================================================*/\n\t\n\t\n\t\n\tvar ENOUGH_LENS = 852;\n\tvar ENOUGH_DISTS = 592;\n\t//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\t\n\tvar MAX_WBITS = 15;\n\t/* 32K LZ77 window */\n\tvar DEF_WBITS = MAX_WBITS;\n\t\n\t\n\tfunction zswap32(q) {\n\t return (((q >>> 24) & 0xff) +\n\t ((q >>> 8) & 0xff00) +\n\t ((q & 0xff00) << 8) +\n\t ((q & 0xff) << 24));\n\t}\n\t\n\t\n\tfunction InflateState() {\n\t this.mode = 0; /* current inflate mode */\n\t this.last = false; /* true if processing last block */\n\t this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n\t this.havedict = false; /* true if dictionary provided */\n\t this.flags = 0; /* gzip header method and flags (0 if zlib) */\n\t this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n\t this.check = 0; /* protected copy of check value */\n\t this.total = 0; /* protected copy of output count */\n\t // TODO: may be {}\n\t this.head = null; /* where to save gzip header information */\n\t\n\t /* sliding window */\n\t this.wbits = 0; /* log base 2 of requested window size */\n\t this.wsize = 0; /* window size or zero if not using window */\n\t this.whave = 0; /* valid bytes in the window */\n\t this.wnext = 0; /* window write index */\n\t this.window = null; /* allocated sliding window, if needed */\n\t\n\t /* bit accumulator */\n\t this.hold = 0; /* input bit accumulator */\n\t this.bits = 0; /* number of bits in \"in\" */\n\t\n\t /* for string and stored block copying */\n\t this.length = 0; /* literal or length of data to copy */\n\t this.offset = 0; /* distance back to copy string from */\n\t\n\t /* for table and code decoding */\n\t this.extra = 0; /* extra bits needed */\n\t\n\t /* fixed and dynamic code tables */\n\t this.lencode = null; /* starting table for length/literal codes */\n\t this.distcode = null; /* starting table for distance codes */\n\t this.lenbits = 0; /* index bits for lencode */\n\t this.distbits = 0; /* index bits for distcode */\n\t\n\t /* dynamic table building */\n\t this.ncode = 0; /* number of code length code lengths */\n\t this.nlen = 0; /* number of length code lengths */\n\t this.ndist = 0; /* number of distance code lengths */\n\t this.have = 0; /* number of code lengths in lens[] */\n\t this.next = null; /* next available space in codes[] */\n\t\n\t this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n\t this.work = new utils.Buf16(288); /* work area for code table building */\n\t\n\t /*\n\t because we don't have pointers in js, we use lencode and distcode directly\n\t as buffers so we don't need codes\n\t */\n\t //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n\t this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n\t this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n\t this.sane = 0; /* if false, allow invalid distance too far */\n\t this.back = 0; /* bits back of last unprocessed length/lit */\n\t this.was = 0; /* initial length of match */\n\t}\n\t\n\tfunction inflateResetKeep(strm) {\n\t var state;\n\t\n\t if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n\t state = strm.state;\n\t strm.total_in = strm.total_out = state.total = 0;\n\t strm.msg = ''; /*Z_NULL*/\n\t if (state.wrap) { /* to support ill-conceived Java test suite */\n\t strm.adler = state.wrap & 1;\n\t }\n\t state.mode = HEAD;\n\t state.last = 0;\n\t state.havedict = 0;\n\t state.dmax = 32768;\n\t state.head = null/*Z_NULL*/;\n\t state.hold = 0;\n\t state.bits = 0;\n\t //state.lencode = state.distcode = state.next = state.codes;\n\t state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n\t state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\t\n\t state.sane = 1;\n\t state.back = -1;\n\t //Tracev((stderr, \"inflate: reset\\n\"));\n\t return Z_OK;\n\t}\n\t\n\tfunction inflateReset(strm) {\n\t var state;\n\t\n\t if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n\t state = strm.state;\n\t state.wsize = 0;\n\t state.whave = 0;\n\t state.wnext = 0;\n\t return inflateResetKeep(strm);\n\t\n\t}\n\t\n\tfunction inflateReset2(strm, windowBits) {\n\t var wrap;\n\t var state;\n\t\n\t /* get the state */\n\t if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n\t state = strm.state;\n\t\n\t /* extract wrap request from windowBits parameter */\n\t if (windowBits < 0) {\n\t wrap = 0;\n\t windowBits = -windowBits;\n\t }\n\t else {\n\t wrap = (windowBits >> 4) + 1;\n\t if (windowBits < 48) {\n\t windowBits &= 15;\n\t }\n\t }\n\t\n\t /* set number of window bits, free window if different */\n\t if (windowBits && (windowBits < 8 || windowBits > 15)) {\n\t return Z_STREAM_ERROR;\n\t }\n\t if (state.window !== null && state.wbits !== windowBits) {\n\t state.window = null;\n\t }\n\t\n\t /* update state and reset the rest of it */\n\t state.wrap = wrap;\n\t state.wbits = windowBits;\n\t return inflateReset(strm);\n\t}\n\t\n\tfunction inflateInit2(strm, windowBits) {\n\t var ret;\n\t var state;\n\t\n\t if (!strm) { return Z_STREAM_ERROR; }\n\t //strm.msg = Z_NULL; /* in case we return an error */\n\t\n\t state = new InflateState();\n\t\n\t //if (state === Z_NULL) return Z_MEM_ERROR;\n\t //Tracev((stderr, \"inflate: allocated\\n\"));\n\t strm.state = state;\n\t state.window = null/*Z_NULL*/;\n\t ret = inflateReset2(strm, windowBits);\n\t if (ret !== Z_OK) {\n\t strm.state = null/*Z_NULL*/;\n\t }\n\t return ret;\n\t}\n\t\n\tfunction inflateInit(strm) {\n\t return inflateInit2(strm, DEF_WBITS);\n\t}\n\t\n\t\n\t/*\n\t Return state with length and distance decoding tables and index sizes set to\n\t fixed code decoding. Normally this returns fixed tables from inffixed.h.\n\t If BUILDFIXED is defined, then instead this routine builds the tables the\n\t first time it's called, and returns those tables the first time and\n\t thereafter. This reduces the size of the code by about 2K bytes, in\n\t exchange for a little execution time. However, BUILDFIXED should not be\n\t used for threaded applications, since the rewriting of the tables and virgin\n\t may not be thread-safe.\n\t */\n\tvar virgin = true;\n\t\n\tvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\t\n\tfunction fixedtables(state) {\n\t /* build fixed huffman tables if first call (may not be thread safe) */\n\t if (virgin) {\n\t var sym;\n\t\n\t lenfix = new utils.Buf32(512);\n\t distfix = new utils.Buf32(32);\n\t\n\t /* literal/length table */\n\t sym = 0;\n\t while (sym < 144) { state.lens[sym++] = 8; }\n\t while (sym < 256) { state.lens[sym++] = 9; }\n\t while (sym < 280) { state.lens[sym++] = 7; }\n\t while (sym < 288) { state.lens[sym++] = 8; }\n\t\n\t inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\t\n\t /* distance table */\n\t sym = 0;\n\t while (sym < 32) { state.lens[sym++] = 5; }\n\t\n\t inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\t\n\t /* do this just once */\n\t virgin = false;\n\t }\n\t\n\t state.lencode = lenfix;\n\t state.lenbits = 9;\n\t state.distcode = distfix;\n\t state.distbits = 5;\n\t}\n\t\n\t\n\t/*\n\t Update the window with the last wsize (normally 32K) bytes written before\n\t returning. If window does not exist yet, create it. This is only called\n\t when a window is already in use, or when output has been written during this\n\t inflate call, but the end of the deflate stream has not been reached yet.\n\t It is also called to create a window for dictionary data when a dictionary\n\t is loaded.\n\t\n\t Providing output buffers larger than 32K to inflate() should provide a speed\n\t advantage, since only the last 32K of output is copied to the sliding window\n\t upon return from inflate(), and since all distances after the first 32K of\n\t output will fall in the output data, making match copies simpler and faster.\n\t The advantage may be dependent on the size of the processor's data caches.\n\t */\n\tfunction updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\t\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\t\n\t state.window = new utils.Buf8(state.wsize);\n\t }\n\t\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t utils.arraySet(state.window, src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) { state.wnext = 0; }\n\t if (state.whave < state.wsize) { state.whave += dist; }\n\t }\n\t }\n\t return 0;\n\t}\n\t\n\tfunction inflate(strm, flush) {\n\t var state;\n\t var input, output; // input/output buffers\n\t var next; /* next input INDEX */\n\t var put; /* next output INDEX */\n\t var have, left; /* available input and output */\n\t var hold; /* bit buffer */\n\t var bits; /* bits in bit buffer */\n\t var _in, _out; /* save starting available input and output */\n\t var copy; /* number of stored or match bytes to copy */\n\t var from; /* where to copy match bytes from */\n\t var from_source;\n\t var here = 0; /* current decoding table entry */\n\t var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n\t //var last; /* parent table entry */\n\t var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n\t var len; /* length to copy for repeats, bits to drop */\n\t var ret; /* return code */\n\t var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n\t var opts;\n\t\n\t var n; // temporary var for NEED_BITS\n\t\n\t var order = /* permutation of code lengths */\n\t [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\t\n\t\n\t if (!strm || !strm.state || !strm.output ||\n\t (!strm.input && strm.avail_in !== 0)) {\n\t return Z_STREAM_ERROR;\n\t }\n\t\n\t state = strm.state;\n\t if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\t\n\t\n\t //--- LOAD() ---\n\t put = strm.next_out;\n\t output = strm.output;\n\t left = strm.avail_out;\n\t next = strm.next_in;\n\t input = strm.input;\n\t have = strm.avail_in;\n\t hold = state.hold;\n\t bits = state.bits;\n\t //---\n\t\n\t _in = have;\n\t _out = left;\n\t ret = Z_OK;\n\t\n\t inf_leave: // goto emulation\n\t for (;;) {\n\t switch (state.mode) {\n\t case HEAD:\n\t if (state.wrap === 0) {\n\t state.mode = TYPEDO;\n\t break;\n\t }\n\t //=== NEEDBITS(16);\n\t while (bits < 16) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n\t state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n\t //=== CRC2(state.check, hold);\n\t hbuf[0] = hold & 0xff;\n\t hbuf[1] = (hold >>> 8) & 0xff;\n\t state.check = crc32(state.check, hbuf, 2, 0);\n\t //===//\n\t\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t state.mode = FLAGS;\n\t break;\n\t }\n\t state.flags = 0; /* expect zlib header */\n\t if (state.head) {\n\t state.head.done = false;\n\t }\n\t if (!(state.wrap & 1) || /* check if zlib header allowed */\n\t (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n\t strm.msg = 'incorrect header check';\n\t state.mode = BAD;\n\t break;\n\t }\n\t if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n\t strm.msg = 'unknown compression method';\n\t state.mode = BAD;\n\t break;\n\t }\n\t //--- DROPBITS(4) ---//\n\t hold >>>= 4;\n\t bits -= 4;\n\t //---//\n\t len = (hold & 0x0f)/*BITS(4)*/ + 8;\n\t if (state.wbits === 0) {\n\t state.wbits = len;\n\t }\n\t else if (len > state.wbits) {\n\t strm.msg = 'invalid window size';\n\t state.mode = BAD;\n\t break;\n\t }\n\t state.dmax = 1 << len;\n\t //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n\t strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n\t state.mode = hold & 0x200 ? DICTID : TYPE;\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t break;\n\t case FLAGS:\n\t //=== NEEDBITS(16); */\n\t while (bits < 16) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t state.flags = hold;\n\t if ((state.flags & 0xff) !== Z_DEFLATED) {\n\t strm.msg = 'unknown compression method';\n\t state.mode = BAD;\n\t break;\n\t }\n\t if (state.flags & 0xe000) {\n\t strm.msg = 'unknown header flags set';\n\t state.mode = BAD;\n\t break;\n\t }\n\t if (state.head) {\n\t state.head.text = ((hold >> 8) & 1);\n\t }\n\t if (state.flags & 0x0200) {\n\t //=== CRC2(state.check, hold);\n\t hbuf[0] = hold & 0xff;\n\t hbuf[1] = (hold >>> 8) & 0xff;\n\t state.check = crc32(state.check, hbuf, 2, 0);\n\t //===//\n\t }\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t state.mode = TIME;\n\t /* falls through */\n\t case TIME:\n\t //=== NEEDBITS(32); */\n\t while (bits < 32) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t if (state.head) {\n\t state.head.time = hold;\n\t }\n\t if (state.flags & 0x0200) {\n\t //=== CRC4(state.check, hold)\n\t hbuf[0] = hold & 0xff;\n\t hbuf[1] = (hold >>> 8) & 0xff;\n\t hbuf[2] = (hold >>> 16) & 0xff;\n\t hbuf[3] = (hold >>> 24) & 0xff;\n\t state.check = crc32(state.check, hbuf, 4, 0);\n\t //===\n\t }\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t state.mode = OS;\n\t /* falls through */\n\t case OS:\n\t //=== NEEDBITS(16); */\n\t while (bits < 16) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t if (state.head) {\n\t state.head.xflags = (hold & 0xff);\n\t state.head.os = (hold >> 8);\n\t }\n\t if (state.flags & 0x0200) {\n\t //=== CRC2(state.check, hold);\n\t hbuf[0] = hold & 0xff;\n\t hbuf[1] = (hold >>> 8) & 0xff;\n\t state.check = crc32(state.check, hbuf, 2, 0);\n\t //===//\n\t }\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t state.mode = EXLEN;\n\t /* falls through */\n\t case EXLEN:\n\t if (state.flags & 0x0400) {\n\t //=== NEEDBITS(16); */\n\t while (bits < 16) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t state.length = hold;\n\t if (state.head) {\n\t state.head.extra_len = hold;\n\t }\n\t if (state.flags & 0x0200) {\n\t //=== CRC2(state.check, hold);\n\t hbuf[0] = hold & 0xff;\n\t hbuf[1] = (hold >>> 8) & 0xff;\n\t state.check = crc32(state.check, hbuf, 2, 0);\n\t //===//\n\t }\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t }\n\t else if (state.head) {\n\t state.head.extra = null/*Z_NULL*/;\n\t }\n\t state.mode = EXTRA;\n\t /* falls through */\n\t case EXTRA:\n\t if (state.flags & 0x0400) {\n\t copy = state.length;\n\t if (copy > have) { copy = have; }\n\t if (copy) {\n\t if (state.head) {\n\t len = state.head.extra_len - state.length;\n\t if (!state.head.extra) {\n\t // Use untyped array for more conveniend processing later\n\t state.head.extra = new Array(state.head.extra_len);\n\t }\n\t utils.arraySet(\n\t state.head.extra,\n\t input,\n\t next,\n\t // extra field is limited to 65536 bytes\n\t // - no need for additional size check\n\t copy,\n\t /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n\t len\n\t );\n\t //zmemcpy(state.head.extra + len, next,\n\t // len + copy > state.head.extra_max ?\n\t // state.head.extra_max - len : copy);\n\t }\n\t if (state.flags & 0x0200) {\n\t state.check = crc32(state.check, input, copy, next);\n\t }\n\t have -= copy;\n\t next += copy;\n\t state.length -= copy;\n\t }\n\t if (state.length) { break inf_leave; }\n\t }\n\t state.length = 0;\n\t state.mode = NAME;\n\t /* falls through */\n\t case NAME:\n\t if (state.flags & 0x0800) {\n\t if (have === 0) { break inf_leave; }\n\t copy = 0;\n\t do {\n\t // TODO: 2 or 1 bytes?\n\t len = input[next + copy++];\n\t /* use constant limit because in js we should not preallocate memory */\n\t if (state.head && len &&\n\t (state.length < 65536 /*state.head.name_max*/)) {\n\t state.head.name += String.fromCharCode(len);\n\t }\n\t } while (len && copy < have);\n\t\n\t if (state.flags & 0x0200) {\n\t state.check = crc32(state.check, input, copy, next);\n\t }\n\t have -= copy;\n\t next += copy;\n\t if (len) { break inf_leave; }\n\t }\n\t else if (state.head) {\n\t state.head.name = null;\n\t }\n\t state.length = 0;\n\t state.mode = COMMENT;\n\t /* falls through */\n\t case COMMENT:\n\t if (state.flags & 0x1000) {\n\t if (have === 0) { break inf_leave; }\n\t copy = 0;\n\t do {\n\t len = input[next + copy++];\n\t /* use constant limit because in js we should not preallocate memory */\n\t if (state.head && len &&\n\t (state.length < 65536 /*state.head.comm_max*/)) {\n\t state.head.comment += String.fromCharCode(len);\n\t }\n\t } while (len && copy < have);\n\t if (state.flags & 0x0200) {\n\t state.check = crc32(state.check, input, copy, next);\n\t }\n\t have -= copy;\n\t next += copy;\n\t if (len) { break inf_leave; }\n\t }\n\t else if (state.head) {\n\t state.head.comment = null;\n\t }\n\t state.mode = HCRC;\n\t /* falls through */\n\t case HCRC:\n\t if (state.flags & 0x0200) {\n\t //=== NEEDBITS(16); */\n\t while (bits < 16) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t if (hold !== (state.check & 0xffff)) {\n\t strm.msg = 'header crc mismatch';\n\t state.mode = BAD;\n\t break;\n\t }\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t }\n\t if (state.head) {\n\t state.head.hcrc = ((state.flags >> 9) & 1);\n\t state.head.done = true;\n\t }\n\t strm.adler = state.check = 0;\n\t state.mode = TYPE;\n\t break;\n\t case DICTID:\n\t //=== NEEDBITS(32); */\n\t while (bits < 32) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t strm.adler = state.check = zswap32(hold);\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t state.mode = DICT;\n\t /* falls through */\n\t case DICT:\n\t if (state.havedict === 0) {\n\t //--- RESTORE() ---\n\t strm.next_out = put;\n\t strm.avail_out = left;\n\t strm.next_in = next;\n\t strm.avail_in = have;\n\t state.hold = hold;\n\t state.bits = bits;\n\t //---\n\t return Z_NEED_DICT;\n\t }\n\t strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n\t state.mode = TYPE;\n\t /* falls through */\n\t case TYPE:\n\t if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n\t /* falls through */\n\t case TYPEDO:\n\t if (state.last) {\n\t //--- BYTEBITS() ---//\n\t hold >>>= bits & 7;\n\t bits -= bits & 7;\n\t //---//\n\t state.mode = CHECK;\n\t break;\n\t }\n\t //=== NEEDBITS(3); */\n\t while (bits < 3) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t state.last = (hold & 0x01)/*BITS(1)*/;\n\t //--- DROPBITS(1) ---//\n\t hold >>>= 1;\n\t bits -= 1;\n\t //---//\n\t\n\t switch ((hold & 0x03)/*BITS(2)*/) {\n\t case 0: /* stored block */\n\t //Tracev((stderr, \"inflate: stored block%s\\n\",\n\t // state.last ? \" (last)\" : \"\"));\n\t state.mode = STORED;\n\t break;\n\t case 1: /* fixed block */\n\t fixedtables(state);\n\t //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n\t // state.last ? \" (last)\" : \"\"));\n\t state.mode = LEN_; /* decode codes */\n\t if (flush === Z_TREES) {\n\t //--- DROPBITS(2) ---//\n\t hold >>>= 2;\n\t bits -= 2;\n\t //---//\n\t break inf_leave;\n\t }\n\t break;\n\t case 2: /* dynamic block */\n\t //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n\t // state.last ? \" (last)\" : \"\"));\n\t state.mode = TABLE;\n\t break;\n\t case 3:\n\t strm.msg = 'invalid block type';\n\t state.mode = BAD;\n\t }\n\t //--- DROPBITS(2) ---//\n\t hold >>>= 2;\n\t bits -= 2;\n\t //---//\n\t break;\n\t case STORED:\n\t //--- BYTEBITS() ---// /* go to byte boundary */\n\t hold >>>= bits & 7;\n\t bits -= bits & 7;\n\t //---//\n\t //=== NEEDBITS(32); */\n\t while (bits < 32) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n\t strm.msg = 'invalid stored block lengths';\n\t state.mode = BAD;\n\t break;\n\t }\n\t state.length = hold & 0xffff;\n\t //Tracev((stderr, \"inflate: stored length %u\\n\",\n\t // state.length));\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t state.mode = COPY_;\n\t if (flush === Z_TREES) { break inf_leave; }\n\t /* falls through */\n\t case COPY_:\n\t state.mode = COPY;\n\t /* falls through */\n\t case COPY:\n\t copy = state.length;\n\t if (copy) {\n\t if (copy > have) { copy = have; }\n\t if (copy > left) { copy = left; }\n\t if (copy === 0) { break inf_leave; }\n\t //--- zmemcpy(put, next, copy); ---\n\t utils.arraySet(output, input, next, copy, put);\n\t //---//\n\t have -= copy;\n\t next += copy;\n\t left -= copy;\n\t put += copy;\n\t state.length -= copy;\n\t break;\n\t }\n\t //Tracev((stderr, \"inflate: stored end\\n\"));\n\t state.mode = TYPE;\n\t break;\n\t case TABLE:\n\t //=== NEEDBITS(14); */\n\t while (bits < 14) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n\t //--- DROPBITS(5) ---//\n\t hold >>>= 5;\n\t bits -= 5;\n\t //---//\n\t state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n\t //--- DROPBITS(5) ---//\n\t hold >>>= 5;\n\t bits -= 5;\n\t //---//\n\t state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n\t //--- DROPBITS(4) ---//\n\t hold >>>= 4;\n\t bits -= 4;\n\t //---//\n\t//#ifndef PKZIP_BUG_WORKAROUND\n\t if (state.nlen > 286 || state.ndist > 30) {\n\t strm.msg = 'too many length or distance symbols';\n\t state.mode = BAD;\n\t break;\n\t }\n\t//#endif\n\t //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n\t state.have = 0;\n\t state.mode = LENLENS;\n\t /* falls through */\n\t case LENLENS:\n\t while (state.have < state.ncode) {\n\t //=== NEEDBITS(3);\n\t while (bits < 3) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n\t //--- DROPBITS(3) ---//\n\t hold >>>= 3;\n\t bits -= 3;\n\t //---//\n\t }\n\t while (state.have < 19) {\n\t state.lens[order[state.have++]] = 0;\n\t }\n\t // We have separate tables & no pointers. 2 commented lines below not needed.\n\t //state.next = state.codes;\n\t //state.lencode = state.next;\n\t // Switch to use dynamic table\n\t state.lencode = state.lendyn;\n\t state.lenbits = 7;\n\t\n\t opts = { bits: state.lenbits };\n\t ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n\t state.lenbits = opts.bits;\n\t\n\t if (ret) {\n\t strm.msg = 'invalid code lengths set';\n\t state.mode = BAD;\n\t break;\n\t }\n\t //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n\t state.have = 0;\n\t state.mode = CODELENS;\n\t /* falls through */\n\t case CODELENS:\n\t while (state.have < state.nlen + state.ndist) {\n\t for (;;) {\n\t here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n\t here_bits = here >>> 24;\n\t here_op = (here >>> 16) & 0xff;\n\t here_val = here & 0xffff;\n\t\n\t if ((here_bits) <= bits) { break; }\n\t //--- PULLBYTE() ---//\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t //---//\n\t }\n\t if (here_val < 16) {\n\t //--- DROPBITS(here.bits) ---//\n\t hold >>>= here_bits;\n\t bits -= here_bits;\n\t //---//\n\t state.lens[state.have++] = here_val;\n\t }\n\t else {\n\t if (here_val === 16) {\n\t //=== NEEDBITS(here.bits + 2);\n\t n = here_bits + 2;\n\t while (bits < n) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t //--- DROPBITS(here.bits) ---//\n\t hold >>>= here_bits;\n\t bits -= here_bits;\n\t //---//\n\t if (state.have === 0) {\n\t strm.msg = 'invalid bit length repeat';\n\t state.mode = BAD;\n\t break;\n\t }\n\t len = state.lens[state.have - 1];\n\t copy = 3 + (hold & 0x03);//BITS(2);\n\t //--- DROPBITS(2) ---//\n\t hold >>>= 2;\n\t bits -= 2;\n\t //---//\n\t }\n\t else if (here_val === 17) {\n\t //=== NEEDBITS(here.bits + 3);\n\t n = here_bits + 3;\n\t while (bits < n) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t //--- DROPBITS(here.bits) ---//\n\t hold >>>= here_bits;\n\t bits -= here_bits;\n\t //---//\n\t len = 0;\n\t copy = 3 + (hold & 0x07);//BITS(3);\n\t //--- DROPBITS(3) ---//\n\t hold >>>= 3;\n\t bits -= 3;\n\t //---//\n\t }\n\t else {\n\t //=== NEEDBITS(here.bits + 7);\n\t n = here_bits + 7;\n\t while (bits < n) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t //--- DROPBITS(here.bits) ---//\n\t hold >>>= here_bits;\n\t bits -= here_bits;\n\t //---//\n\t len = 0;\n\t copy = 11 + (hold & 0x7f);//BITS(7);\n\t //--- DROPBITS(7) ---//\n\t hold >>>= 7;\n\t bits -= 7;\n\t //---//\n\t }\n\t if (state.have + copy > state.nlen + state.ndist) {\n\t strm.msg = 'invalid bit length repeat';\n\t state.mode = BAD;\n\t break;\n\t }\n\t while (copy--) {\n\t state.lens[state.have++] = len;\n\t }\n\t }\n\t }\n\t\n\t /* handle error breaks in while */\n\t if (state.mode === BAD) { break; }\n\t\n\t /* check for end-of-block code (better have one) */\n\t if (state.lens[256] === 0) {\n\t strm.msg = 'invalid code -- missing end-of-block';\n\t state.mode = BAD;\n\t break;\n\t }\n\t\n\t /* build code tables -- note: do not change the lenbits or distbits\n\t values here (9 and 6) without reading the comments in inftrees.h\n\t concerning the ENOUGH constants, which depend on those values */\n\t state.lenbits = 9;\n\t\n\t opts = { bits: state.lenbits };\n\t ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n\t // We have separate tables & no pointers. 2 commented lines below not needed.\n\t // state.next_index = opts.table_index;\n\t state.lenbits = opts.bits;\n\t // state.lencode = state.next;\n\t\n\t if (ret) {\n\t strm.msg = 'invalid literal/lengths set';\n\t state.mode = BAD;\n\t break;\n\t }\n\t\n\t state.distbits = 6;\n\t //state.distcode.copy(state.codes);\n\t // Switch to use dynamic table\n\t state.distcode = state.distdyn;\n\t opts = { bits: state.distbits };\n\t ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n\t // We have separate tables & no pointers. 2 commented lines below not needed.\n\t // state.next_index = opts.table_index;\n\t state.distbits = opts.bits;\n\t // state.distcode = state.next;\n\t\n\t if (ret) {\n\t strm.msg = 'invalid distances set';\n\t state.mode = BAD;\n\t break;\n\t }\n\t //Tracev((stderr, 'inflate: codes ok\\n'));\n\t state.mode = LEN_;\n\t if (flush === Z_TREES) { break inf_leave; }\n\t /* falls through */\n\t case LEN_:\n\t state.mode = LEN;\n\t /* falls through */\n\t case LEN:\n\t if (have >= 6 && left >= 258) {\n\t //--- RESTORE() ---\n\t strm.next_out = put;\n\t strm.avail_out = left;\n\t strm.next_in = next;\n\t strm.avail_in = have;\n\t state.hold = hold;\n\t state.bits = bits;\n\t //---\n\t inflate_fast(strm, _out);\n\t //--- LOAD() ---\n\t put = strm.next_out;\n\t output = strm.output;\n\t left = strm.avail_out;\n\t next = strm.next_in;\n\t input = strm.input;\n\t have = strm.avail_in;\n\t hold = state.hold;\n\t bits = state.bits;\n\t //---\n\t\n\t if (state.mode === TYPE) {\n\t state.back = -1;\n\t }\n\t break;\n\t }\n\t state.back = 0;\n\t for (;;) {\n\t here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n\t here_bits = here >>> 24;\n\t here_op = (here >>> 16) & 0xff;\n\t here_val = here & 0xffff;\n\t\n\t if (here_bits <= bits) { break; }\n\t //--- PULLBYTE() ---//\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t //---//\n\t }\n\t if (here_op && (here_op & 0xf0) === 0) {\n\t last_bits = here_bits;\n\t last_op = here_op;\n\t last_val = here_val;\n\t for (;;) {\n\t here = state.lencode[last_val +\n\t ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n\t here_bits = here >>> 24;\n\t here_op = (here >>> 16) & 0xff;\n\t here_val = here & 0xffff;\n\t\n\t if ((last_bits + here_bits) <= bits) { break; }\n\t //--- PULLBYTE() ---//\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t //---//\n\t }\n\t //--- DROPBITS(last.bits) ---//\n\t hold >>>= last_bits;\n\t bits -= last_bits;\n\t //---//\n\t state.back += last_bits;\n\t }\n\t //--- DROPBITS(here.bits) ---//\n\t hold >>>= here_bits;\n\t bits -= here_bits;\n\t //---//\n\t state.back += here_bits;\n\t state.length = here_val;\n\t if (here_op === 0) {\n\t //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n\t // \"inflate: literal '%c'\\n\" :\n\t // \"inflate: literal 0x%02x\\n\", here.val));\n\t state.mode = LIT;\n\t break;\n\t }\n\t if (here_op & 32) {\n\t //Tracevv((stderr, \"inflate: end of block\\n\"));\n\t state.back = -1;\n\t state.mode = TYPE;\n\t break;\n\t }\n\t if (here_op & 64) {\n\t strm.msg = 'invalid literal/length code';\n\t state.mode = BAD;\n\t break;\n\t }\n\t state.extra = here_op & 15;\n\t state.mode = LENEXT;\n\t /* falls through */\n\t case LENEXT:\n\t if (state.extra) {\n\t //=== NEEDBITS(state.extra);\n\t n = state.extra;\n\t while (bits < n) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n\t //--- DROPBITS(state.extra) ---//\n\t hold >>>= state.extra;\n\t bits -= state.extra;\n\t //---//\n\t state.back += state.extra;\n\t }\n\t //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n\t state.was = state.length;\n\t state.mode = DIST;\n\t /* falls through */\n\t case DIST:\n\t for (;;) {\n\t here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n\t here_bits = here >>> 24;\n\t here_op = (here >>> 16) & 0xff;\n\t here_val = here & 0xffff;\n\t\n\t if ((here_bits) <= bits) { break; }\n\t //--- PULLBYTE() ---//\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t //---//\n\t }\n\t if ((here_op & 0xf0) === 0) {\n\t last_bits = here_bits;\n\t last_op = here_op;\n\t last_val = here_val;\n\t for (;;) {\n\t here = state.distcode[last_val +\n\t ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n\t here_bits = here >>> 24;\n\t here_op = (here >>> 16) & 0xff;\n\t here_val = here & 0xffff;\n\t\n\t if ((last_bits + here_bits) <= bits) { break; }\n\t //--- PULLBYTE() ---//\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t //---//\n\t }\n\t //--- DROPBITS(last.bits) ---//\n\t hold >>>= last_bits;\n\t bits -= last_bits;\n\t //---//\n\t state.back += last_bits;\n\t }\n\t //--- DROPBITS(here.bits) ---//\n\t hold >>>= here_bits;\n\t bits -= here_bits;\n\t //---//\n\t state.back += here_bits;\n\t if (here_op & 64) {\n\t strm.msg = 'invalid distance code';\n\t state.mode = BAD;\n\t break;\n\t }\n\t state.offset = here_val;\n\t state.extra = (here_op) & 15;\n\t state.mode = DISTEXT;\n\t /* falls through */\n\t case DISTEXT:\n\t if (state.extra) {\n\t //=== NEEDBITS(state.extra);\n\t n = state.extra;\n\t while (bits < n) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n\t //--- DROPBITS(state.extra) ---//\n\t hold >>>= state.extra;\n\t bits -= state.extra;\n\t //---//\n\t state.back += state.extra;\n\t }\n\t//#ifdef INFLATE_STRICT\n\t if (state.offset > state.dmax) {\n\t strm.msg = 'invalid distance too far back';\n\t state.mode = BAD;\n\t break;\n\t }\n\t//#endif\n\t //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n\t state.mode = MATCH;\n\t /* falls through */\n\t case MATCH:\n\t if (left === 0) { break inf_leave; }\n\t copy = _out - left;\n\t if (state.offset > copy) { /* copy from window */\n\t copy = state.offset - copy;\n\t if (copy > state.whave) {\n\t if (state.sane) {\n\t strm.msg = 'invalid distance too far back';\n\t state.mode = BAD;\n\t break;\n\t }\n\t// (!) This block is disabled in zlib defailts,\n\t// don't enable it for binary compatibility\n\t//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n\t// Trace((stderr, \"inflate.c too far\\n\"));\n\t// copy -= state.whave;\n\t// if (copy > state.length) { copy = state.length; }\n\t// if (copy > left) { copy = left; }\n\t// left -= copy;\n\t// state.length -= copy;\n\t// do {\n\t// output[put++] = 0;\n\t// } while (--copy);\n\t// if (state.length === 0) { state.mode = LEN; }\n\t// break;\n\t//#endif\n\t }\n\t if (copy > state.wnext) {\n\t copy -= state.wnext;\n\t from = state.wsize - copy;\n\t }\n\t else {\n\t from = state.wnext - copy;\n\t }\n\t if (copy > state.length) { copy = state.length; }\n\t from_source = state.window;\n\t }\n\t else { /* copy from output */\n\t from_source = output;\n\t from = put - state.offset;\n\t copy = state.length;\n\t }\n\t if (copy > left) { copy = left; }\n\t left -= copy;\n\t state.length -= copy;\n\t do {\n\t output[put++] = from_source[from++];\n\t } while (--copy);\n\t if (state.length === 0) { state.mode = LEN; }\n\t break;\n\t case LIT:\n\t if (left === 0) { break inf_leave; }\n\t output[put++] = state.length;\n\t left--;\n\t state.mode = LEN;\n\t break;\n\t case CHECK:\n\t if (state.wrap) {\n\t //=== NEEDBITS(32);\n\t while (bits < 32) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t // Use '|' insdead of '+' to make sure that result is signed\n\t hold |= input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t _out -= left;\n\t strm.total_out += _out;\n\t state.total += _out;\n\t if (_out) {\n\t strm.adler = state.check =\n\t /*UPDATE(state.check, put - _out, _out);*/\n\t (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\t\n\t }\n\t _out = left;\n\t // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n\t if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n\t strm.msg = 'incorrect data check';\n\t state.mode = BAD;\n\t break;\n\t }\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n\t }\n\t state.mode = LENGTH;\n\t /* falls through */\n\t case LENGTH:\n\t if (state.wrap && state.flags) {\n\t //=== NEEDBITS(32);\n\t while (bits < 32) {\n\t if (have === 0) { break inf_leave; }\n\t have--;\n\t hold += input[next++] << bits;\n\t bits += 8;\n\t }\n\t //===//\n\t if (hold !== (state.total & 0xffffffff)) {\n\t strm.msg = 'incorrect length check';\n\t state.mode = BAD;\n\t break;\n\t }\n\t //=== INITBITS();\n\t hold = 0;\n\t bits = 0;\n\t //===//\n\t //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n\t }\n\t state.mode = DONE;\n\t /* falls through */\n\t case DONE:\n\t ret = Z_STREAM_END;\n\t break inf_leave;\n\t case BAD:\n\t ret = Z_DATA_ERROR;\n\t break inf_leave;\n\t case MEM:\n\t return Z_MEM_ERROR;\n\t case SYNC:\n\t /* falls through */\n\t default:\n\t return Z_STREAM_ERROR;\n\t }\n\t }\n\t\n\t // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\t\n\t /*\n\t Return from inflate(), updating the total counts and the check value.\n\t If there was no progress during the inflate() call, return a buffer\n\t error. Call updatewindow() to create and/or update the window state.\n\t Note: a memory error from inflate() is non-recoverable.\n\t */\n\t\n\t //--- RESTORE() ---\n\t strm.next_out = put;\n\t strm.avail_out = left;\n\t strm.next_in = next;\n\t strm.avail_in = have;\n\t state.hold = hold;\n\t state.bits = bits;\n\t //---\n\t\n\t if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n\t (state.mode < CHECK || flush !== Z_FINISH))) {\n\t if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n\t state.mode = MEM;\n\t return Z_MEM_ERROR;\n\t }\n\t }\n\t _in -= strm.avail_in;\n\t _out -= strm.avail_out;\n\t strm.total_in += _in;\n\t strm.total_out += _out;\n\t state.total += _out;\n\t if (state.wrap && _out) {\n\t strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n\t (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n\t }\n\t strm.data_type = state.bits + (state.last ? 64 : 0) +\n\t (state.mode === TYPE ? 128 : 0) +\n\t (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n\t if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n\t ret = Z_BUF_ERROR;\n\t }\n\t return ret;\n\t}\n\t\n\tfunction inflateEnd(strm) {\n\t\n\t if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n\t return Z_STREAM_ERROR;\n\t }\n\t\n\t var state = strm.state;\n\t if (state.window) {\n\t state.window = null;\n\t }\n\t strm.state = null;\n\t return Z_OK;\n\t}\n\t\n\tfunction inflateGetHeader(strm, head) {\n\t var state;\n\t\n\t /* check state */\n\t if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n\t state = strm.state;\n\t if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\t\n\t /* save header structure */\n\t state.head = head;\n\t head.done = false;\n\t return Z_OK;\n\t}\n\t\n\tfunction inflateSetDictionary(strm, dictionary) {\n\t var dictLength = dictionary.length;\n\t\n\t var state;\n\t var dictid;\n\t var ret;\n\t\n\t /* check state */\n\t if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n\t state = strm.state;\n\t\n\t if (state.wrap !== 0 && state.mode !== DICT) {\n\t return Z_STREAM_ERROR;\n\t }\n\t\n\t /* check for correct dictionary identifier */\n\t if (state.mode === DICT) {\n\t dictid = 1; /* adler32(0, null, 0)*/\n\t /* dictid = adler32(dictid, dictionary, dictLength); */\n\t dictid = adler32(dictid, dictionary, dictLength, 0);\n\t if (dictid !== state.check) {\n\t return Z_DATA_ERROR;\n\t }\n\t }\n\t /* copy dictionary to window using updatewindow(), which will amend the\n\t existing dictionary if appropriate */\n\t ret = updatewindow(strm, dictionary, dictLength, dictLength);\n\t if (ret) {\n\t state.mode = MEM;\n\t return Z_MEM_ERROR;\n\t }\n\t state.havedict = 1;\n\t // Tracev((stderr, \"inflate: dictionary set\\n\"));\n\t return Z_OK;\n\t}\n\t\n\texports.inflateReset = inflateReset;\n\texports.inflateReset2 = inflateReset2;\n\texports.inflateResetKeep = inflateResetKeep;\n\texports.inflateInit = inflateInit;\n\texports.inflateInit2 = inflateInit2;\n\texports.inflate = inflate;\n\texports.inflateEnd = inflateEnd;\n\texports.inflateGetHeader = inflateGetHeader;\n\texports.inflateSetDictionary = inflateSetDictionary;\n\texports.inflateInfo = 'pako inflate (from Nodeca project)';\n\t\n\t/* Not implemented\n\texports.inflateCopy = inflateCopy;\n\texports.inflateGetDictionary = inflateGetDictionary;\n\texports.inflateMark = inflateMark;\n\texports.inflatePrime = inflatePrime;\n\texports.inflateSync = inflateSync;\n\texports.inflateSyncPoint = inflateSyncPoint;\n\texports.inflateUndermine = inflateUndermine;\n\t*/\n\n\n/***/ },\n/* 31 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t\n\tvar utils = __webpack_require__(8);\n\t\n\tvar MAXBITS = 15;\n\tvar ENOUGH_LENS = 852;\n\tvar ENOUGH_DISTS = 592;\n\t//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\t\n\tvar CODES = 0;\n\tvar LENS = 1;\n\tvar DISTS = 2;\n\t\n\tvar lbase = [ /* Length codes 257..285 base */\n\t 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n\t 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n\t];\n\t\n\tvar lext = [ /* Length codes 257..285 extra */\n\t 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n\t 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n\t];\n\t\n\tvar dbase = [ /* Distance codes 0..29 base */\n\t 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n\t 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n\t 8193, 12289, 16385, 24577, 0, 0\n\t];\n\t\n\tvar dext = [ /* Distance codes 0..29 extra */\n\t 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n\t 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n\t 28, 28, 29, 29, 64, 64\n\t];\n\t\n\tmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n\t{\n\t var bits = opts.bits;\n\t //here = opts.here; /* table entry for duplication */\n\t\n\t var len = 0; /* a code's length in bits */\n\t var sym = 0; /* index of code symbols */\n\t var min = 0, max = 0; /* minimum and maximum code lengths */\n\t var root = 0; /* number of index bits for root table */\n\t var curr = 0; /* number of index bits for current table */\n\t var drop = 0; /* code bits to drop for sub-table */\n\t var left = 0; /* number of prefix codes available */\n\t var used = 0; /* code entries in table used */\n\t var huff = 0; /* Huffman code */\n\t var incr; /* for incrementing code, index */\n\t var fill; /* index for replicating entries */\n\t var low; /* low bits for current root entry */\n\t var mask; /* mask for low root bits */\n\t var next; /* next available space in table */\n\t var base = null; /* base value table to use */\n\t var base_index = 0;\n\t// var shoextra; /* extra bits table to use */\n\t var end; /* use base and extra for symbol > end */\n\t var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n\t var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n\t var extra = null;\n\t var extra_index = 0;\n\t\n\t var here_bits, here_op, here_val;\n\t\n\t /*\n\t Process a set of code lengths to create a canonical Huffman code. The\n\t code lengths are lens[0..codes-1]. Each length corresponds to the\n\t symbols 0..codes-1. The Huffman code is generated by first sorting the\n\t symbols by length from short to long, and retaining the symbol order\n\t for codes with equal lengths. Then the code starts with all zero bits\n\t for the first code of the shortest length, and the codes are integer\n\t increments for the same length, and zeros are appended as the length\n\t increases. For the deflate format, these bits are stored backwards\n\t from their more natural integer increment ordering, and so when the\n\t decoding tables are built in the large loop below, the integer codes\n\t are incremented backwards.\n\t\n\t This routine assumes, but does not check, that all of the entries in\n\t lens[] are in the range 0..MAXBITS. The caller must assure this.\n\t 1..MAXBITS is interpreted as that code length. zero means that that\n\t symbol does not occur in this code.\n\t\n\t The codes are sorted by computing a count of codes for each length,\n\t creating from that a table of starting indices for each length in the\n\t sorted table, and then entering the symbols in order in the sorted\n\t table. The sorted table is work[], with that space being provided by\n\t the caller.\n\t\n\t The length counts are used for other purposes as well, i.e. finding\n\t the minimum and maximum length codes, determining if there are any\n\t codes at all, checking for a valid set of lengths, and looking ahead\n\t at length counts to determine sub-table sizes when building the\n\t decoding tables.\n\t */\n\t\n\t /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n\t for (len = 0; len <= MAXBITS; len++) {\n\t count[len] = 0;\n\t }\n\t for (sym = 0; sym < codes; sym++) {\n\t count[lens[lens_index + sym]]++;\n\t }\n\t\n\t /* bound code lengths, force root to be within code lengths */\n\t root = bits;\n\t for (max = MAXBITS; max >= 1; max--) {\n\t if (count[max] !== 0) { break; }\n\t }\n\t if (root > max) {\n\t root = max;\n\t }\n\t if (max === 0) { /* no symbols to code at all */\n\t //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n\t //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n\t //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n\t table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\t\n\t\n\t //table.op[opts.table_index] = 64;\n\t //table.bits[opts.table_index] = 1;\n\t //table.val[opts.table_index++] = 0;\n\t table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\t\n\t opts.bits = 1;\n\t return 0; /* no symbols, but wait for decoding to report error */\n\t }\n\t for (min = 1; min < max; min++) {\n\t if (count[min] !== 0) { break; }\n\t }\n\t if (root < min) {\n\t root = min;\n\t }\n\t\n\t /* check for an over-subscribed or incomplete set of lengths */\n\t left = 1;\n\t for (len = 1; len <= MAXBITS; len++) {\n\t left <<= 1;\n\t left -= count[len];\n\t if (left < 0) {\n\t return -1;\n\t } /* over-subscribed */\n\t }\n\t if (left > 0 && (type === CODES || max !== 1)) {\n\t return -1; /* incomplete set */\n\t }\n\t\n\t /* generate offsets into symbol table for each length for sorting */\n\t offs[1] = 0;\n\t for (len = 1; len < MAXBITS; len++) {\n\t offs[len + 1] = offs[len] + count[len];\n\t }\n\t\n\t /* sort symbols by length, by symbol order within each length */\n\t for (sym = 0; sym < codes; sym++) {\n\t if (lens[lens_index + sym] !== 0) {\n\t work[offs[lens[lens_index + sym]]++] = sym;\n\t }\n\t }\n\t\n\t /*\n\t Create and fill in decoding tables. In this loop, the table being\n\t filled is at next and has curr index bits. The code being used is huff\n\t with length len. That code is converted to an index by dropping drop\n\t bits off of the bottom. For codes where len is less than drop + curr,\n\t those top drop + curr - len bits are incremented through all values to\n\t fill the table with replicated entries.\n\t\n\t root is the number of index bits for the root table. When len exceeds\n\t root, sub-tables are created pointed to by the root entry with an index\n\t of the low root bits of huff. This is saved in low to check for when a\n\t new sub-table should be started. drop is zero when the root table is\n\t being filled, and drop is root when sub-tables are being filled.\n\t\n\t When a new sub-table is needed, it is necessary to look ahead in the\n\t code lengths to determine what size sub-table is needed. The length\n\t counts are used for this, and so count[] is decremented as codes are\n\t entered in the tables.\n\t\n\t used keeps track of how many table entries have been allocated from the\n\t provided *table space. It is checked for LENS and DIST tables against\n\t the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n\t the initial root table size constants. See the comments in inftrees.h\n\t for more information.\n\t\n\t sym increments through all symbols, and the loop terminates when\n\t all codes of length max, i.e. all codes, have been processed. This\n\t routine permits incomplete codes, so another loop after this one fills\n\t in the rest of the decoding tables with invalid code markers.\n\t */\n\t\n\t /* set up for code type */\n\t // poor man optimization - use if-else instead of switch,\n\t // to avoid deopts in old v8\n\t if (type === CODES) {\n\t base = extra = work; /* dummy value--not used */\n\t end = 19;\n\t\n\t } else if (type === LENS) {\n\t base = lbase;\n\t base_index -= 257;\n\t extra = lext;\n\t extra_index -= 257;\n\t end = 256;\n\t\n\t } else { /* DISTS */\n\t base = dbase;\n\t extra = dext;\n\t end = -1;\n\t }\n\t\n\t /* initialize opts for loop */\n\t huff = 0; /* starting code */\n\t sym = 0; /* starting code symbol */\n\t len = min; /* starting code length */\n\t next = table_index; /* current table to fill in */\n\t curr = root; /* current table index bits */\n\t drop = 0; /* current bits to drop from code for index */\n\t low = -1; /* trigger new sub-table when len > root */\n\t used = 1 << root; /* use root table entries */\n\t mask = used - 1; /* mask for comparing low */\n\t\n\t /* check available table space */\n\t if ((type === LENS && used > ENOUGH_LENS) ||\n\t (type === DISTS && used > ENOUGH_DISTS)) {\n\t return 1;\n\t }\n\t\n\t /* process all codes and make table entries */\n\t for (;;) {\n\t /* create table entry */\n\t here_bits = len - drop;\n\t if (work[sym] < end) {\n\t here_op = 0;\n\t here_val = work[sym];\n\t }\n\t else if (work[sym] > end) {\n\t here_op = extra[extra_index + work[sym]];\n\t here_val = base[base_index + work[sym]];\n\t }\n\t else {\n\t here_op = 32 + 64; /* end of block */\n\t here_val = 0;\n\t }\n\t\n\t /* replicate for those indices with low len bits equal to huff */\n\t incr = 1 << (len - drop);\n\t fill = 1 << curr;\n\t min = fill; /* save offset to next table */\n\t do {\n\t fill -= incr;\n\t table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n\t } while (fill !== 0);\n\t\n\t /* backwards increment the len-bit code huff */\n\t incr = 1 << (len - 1);\n\t while (huff & incr) {\n\t incr >>= 1;\n\t }\n\t if (incr !== 0) {\n\t huff &= incr - 1;\n\t huff += incr;\n\t } else {\n\t huff = 0;\n\t }\n\t\n\t /* go to next symbol, update count, len */\n\t sym++;\n\t if (--count[len] === 0) {\n\t if (len === max) { break; }\n\t len = lens[lens_index + work[sym]];\n\t }\n\t\n\t /* create new sub-table if needed */\n\t if (len > root && (huff & mask) !== low) {\n\t /* if first time, transition to sub-tables */\n\t if (drop === 0) {\n\t drop = root;\n\t }\n\t\n\t /* increment past last table */\n\t next += min; /* here min is 1 << curr */\n\t\n\t /* determine length of next table */\n\t curr = len - drop;\n\t left = 1 << curr;\n\t while (curr + drop < max) {\n\t left -= count[curr + drop];\n\t if (left <= 0) { break; }\n\t curr++;\n\t left <<= 1;\n\t }\n\t\n\t /* check for enough space */\n\t used += 1 << curr;\n\t if ((type === LENS && used > ENOUGH_LENS) ||\n\t (type === DISTS && used > ENOUGH_DISTS)) {\n\t return 1;\n\t }\n\t\n\t /* point entry in root table to sub-table */\n\t low = huff & mask;\n\t /*table.op[low] = curr;\n\t table.bits[low] = root;\n\t table.val[low] = next - opts.table_index;*/\n\t table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n\t }\n\t }\n\t\n\t /* fill in remaining table entry if code is incomplete (guaranteed to have\n\t at most one remaining entry, since if the code is incomplete, the\n\t maximum code length that was allowed to get this far is one bit) */\n\t if (huff !== 0) {\n\t //table.op[next + huff] = 64; /* invalid code marker */\n\t //table.bits[next + huff] = len - drop;\n\t //table.val[next + huff] = 0;\n\t table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n\t }\n\t\n\t /* set return parameters */\n\t //opts.table_index += used;\n\t opts.bits = root;\n\t return 0;\n\t};\n\n\n/***/ },\n/* 32 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t 2: 'need dictionary', /* Z_NEED_DICT 2 */\n\t 1: 'stream end', /* Z_STREAM_END 1 */\n\t 0: '', /* Z_OK 0 */\n\t '-1': 'file error', /* Z_ERRNO (-1) */\n\t '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n\t '-3': 'data error', /* Z_DATA_ERROR (-3) */\n\t '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n\t '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n\t '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n\t};\n\n\n/***/ },\n/* 33 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t\n\tfunction ZStream() {\n\t /* next input byte */\n\t this.input = null; // JS specific, because we have no pointers\n\t this.next_in = 0;\n\t /* number of bytes available at input */\n\t this.avail_in = 0;\n\t /* total number of input bytes read so far */\n\t this.total_in = 0;\n\t /* next output byte should be put there */\n\t this.output = null; // JS specific, because we have no pointers\n\t this.next_out = 0;\n\t /* remaining free space at output */\n\t this.avail_out = 0;\n\t /* total number of bytes output so far */\n\t this.total_out = 0;\n\t /* last error message, NULL if no error */\n\t this.msg = ''/*Z_NULL*/;\n\t /* not visible by applications */\n\t this.state = null;\n\t /* best guess about the data type: binary or text */\n\t this.data_type = 2/*Z_UNKNOWN*/;\n\t /* adler32 value of the uncompressed data */\n\t this.adler = 0;\n\t}\n\t\n\tmodule.exports = ZStream;\n\n\n/***/ },\n/* 34 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(2)\n\n\n/***/ },\n/* 35 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar Buffer = __webpack_require__(1).Buffer;\n\t/**/\n\tvar bufferShim = __webpack_require__(10);\n\t/**/\n\t\n\tmodule.exports = BufferList;\n\t\n\tfunction BufferList() {\n\t this.head = null;\n\t this.tail = null;\n\t this.length = 0;\n\t}\n\t\n\tBufferList.prototype.push = function (v) {\n\t var entry = { data: v, next: null };\n\t if (this.length > 0) this.tail.next = entry;else this.head = entry;\n\t this.tail = entry;\n\t ++this.length;\n\t};\n\t\n\tBufferList.prototype.unshift = function (v) {\n\t var entry = { data: v, next: this.head };\n\t if (this.length === 0) this.tail = entry;\n\t this.head = entry;\n\t ++this.length;\n\t};\n\t\n\tBufferList.prototype.shift = function () {\n\t if (this.length === 0) return;\n\t var ret = this.head.data;\n\t if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n\t --this.length;\n\t return ret;\n\t};\n\t\n\tBufferList.prototype.clear = function () {\n\t this.head = this.tail = null;\n\t this.length = 0;\n\t};\n\t\n\tBufferList.prototype.join = function (s) {\n\t if (this.length === 0) return '';\n\t var p = this.head;\n\t var ret = '' + p.data;\n\t while (p = p.next) {\n\t ret += s + p.data;\n\t }return ret;\n\t};\n\t\n\tBufferList.prototype.concat = function (n) {\n\t if (this.length === 0) return bufferShim.alloc(0);\n\t if (this.length === 1) return this.head.data;\n\t var ret = bufferShim.allocUnsafe(n >>> 0);\n\t var p = this.head;\n\t var i = 0;\n\t while (p) {\n\t p.data.copy(ret, i);\n\t i += p.data.length;\n\t p = p.next;\n\t }\n\t return ret;\n\t};\n\n/***/ },\n/* 36 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(15)\n\n\n/***/ },\n/* 37 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {var Stream = (function (){\n\t try {\n\t return __webpack_require__(9); // hack to fix a circular dependency issue when used with browserify\n\t } catch(_){}\n\t}());\n\texports = module.exports = __webpack_require__(16);\n\texports.Stream = Stream || exports;\n\texports.Readable = exports;\n\texports.Writable = __webpack_require__(13);\n\texports.Duplex = __webpack_require__(2);\n\texports.Transform = __webpack_require__(12);\n\texports.PassThrough = __webpack_require__(15);\n\t\n\tif (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) {\n\t module.exports = Stream;\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))\n\n/***/ },\n/* 38 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(12)\n\n\n/***/ },\n/* 39 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(13)\n\n\n/***/ },\n/* 40 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = deprecate;\n\t\n\t/**\n\t * Mark that a method should not be used.\n\t * Returns a modified function which warns once by default.\n\t *\n\t * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n\t *\n\t * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n\t * will throw an Error when invoked.\n\t *\n\t * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n\t * will invoke `console.trace()` instead of `console.error()`.\n\t *\n\t * @param {Function} fn - the function to deprecate\n\t * @param {String} msg - the string to print to the console when `fn` is invoked\n\t * @returns {Function} a new \"deprecated\" version of `fn`\n\t * @api public\n\t */\n\t\n\tfunction deprecate (fn, msg) {\n\t if (config('noDeprecation')) {\n\t return fn;\n\t }\n\t\n\t var warned = false;\n\t function deprecated() {\n\t if (!warned) {\n\t if (config('throwDeprecation')) {\n\t throw new Error(msg);\n\t } else if (config('traceDeprecation')) {\n\t console.trace(msg);\n\t } else {\n\t console.warn(msg);\n\t }\n\t warned = true;\n\t }\n\t return fn.apply(this, arguments);\n\t }\n\t\n\t return deprecated;\n\t}\n\t\n\t/**\n\t * Checks `localStorage` for boolean values for the given `name`.\n\t *\n\t * @param {String} name\n\t * @returns {Boolean}\n\t * @api private\n\t */\n\t\n\tfunction config (name) {\n\t // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n\t try {\n\t if (!global.localStorage) return false;\n\t } catch (_) {\n\t return false;\n\t }\n\t var val = global.localStorage[name];\n\t if (null == val) return false;\n\t return String(val).toLowerCase() === 'true';\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 41 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 42 */\n/***/ function(module, exports) {\n\n\t/* (ignored) */\n\n/***/ }\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// ../build/browserfs.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ebd3bd27baeec43b998e","import {File} from './file';\nimport {ApiError, ErrorCode} from './api_error';\nimport {FileSystem, BFSOneArgCallback, BFSCallback, BFSThreeArgCallback} from './file_system';\nimport {FileFlag} from './file_flag';\nimport * as path from 'path';\nimport Stats from './node_fs_stats';\n\n// Typing info only.\nimport * as _fs from 'fs';\n\n/**\n * Wraps a callback function. Used for unit testing. Defaults to a NOP.\n * @hidden\n */\nlet wrapCb = function(cb: T, numArgs: number): T {\n return cb;\n};\n\n/**\n * @hidden\n */\nfunction assertRoot(fs?: FileSystem | null): FileSystem {\n if (fs) {\n return fs;\n }\n throw new ApiError(ErrorCode.EIO, `Initialize BrowserFS with a file system using BrowserFS.initialize(filesystem)`);\n}\n\n/**\n * @hidden\n */\nfunction normalizeMode(mode: number | string | null | undefined, def: number): number {\n switch (typeof mode) {\n case 'number':\n // (path, flag, mode, cb?)\n return mode;\n case 'string':\n // (path, flag, modeString, cb?)\n const trueMode = parseInt( mode, 8);\n if (!isNaN(trueMode)) {\n return trueMode;\n }\n // Invalid string.\n return def;\n default:\n return def;\n }\n}\n\n/**\n * @hidden\n */\nfunction normalizeTime(time: number | Date): Date {\n if (time instanceof Date) {\n return time;\n } else if (typeof time === 'number') {\n return new Date(time * 1000);\n } else {\n throw new ApiError(ErrorCode.EINVAL, `Invalid time.`);\n }\n}\n\n/**\n * @hidden\n */\nfunction normalizePath(p: string): string {\n // Node doesn't allow null characters in paths.\n if (p.indexOf('\\u0000') >= 0) {\n throw new ApiError(ErrorCode.EINVAL, 'Path must be a string without null bytes.');\n } else if (p === '') {\n throw new ApiError(ErrorCode.EINVAL, 'Path must not be empty.');\n }\n return path.resolve(p);\n}\n\n/**\n * @hidden\n */\nfunction normalizeOptions(options: any, defEnc: string | null, defFlag: string, defMode: number | null): {encoding: string; flag: string; mode: number} {\n switch (typeof options) {\n case 'object':\n return {\n encoding: typeof options['encoding'] !== 'undefined' ? options['encoding'] : defEnc,\n flag: typeof options['flag'] !== 'undefined' ? options['flag'] : defFlag,\n mode: normalizeMode(options['mode'], defMode!)\n };\n case 'string':\n return {\n encoding: options,\n flag: defFlag,\n mode: defMode!\n };\n default:\n return {\n encoding: defEnc!,\n flag: defFlag,\n mode: defMode!\n };\n }\n}\n\n/**\n * The default callback is a NOP.\n * @hidden\n * @private\n */\nfunction nopCb() {\n // NOP.\n}\n\n/**\n * The node frontend to all filesystems.\n * This layer handles:\n *\n * * Sanity checking inputs.\n * * Normalizing paths.\n * * Resetting stack depth for asynchronous operations which may not go through\n * the browser by wrapping all input callbacks using `setImmediate`.\n * * Performing the requested operation through the filesystem or the file\n * descriptor, as appropriate.\n * * Handling optional arguments and setting default arguments.\n * @see http://nodejs.org/api/fs.html\n */\nexport default class FS {\n /* tslint:disable:variable-name */\n // Exported fs.Stats.\n public static Stats = Stats;\n /* tslint:enable:variable-name */\n\n public F_OK: number = 0;\n public R_OK: number = 4;\n public W_OK: number = 2;\n public X_OK: number = 1;\n\n private root: FileSystem | null = null;\n private fdMap: {[fd: number]: File} = {};\n private nextFd = 100;\n\n public initialize(rootFS: FileSystem): FileSystem {\n if (!( rootFS).constructor.isAvailable()) {\n throw new ApiError(ErrorCode.EINVAL, 'Tried to instantiate BrowserFS with an unavailable file system.');\n }\n return this.root = rootFS;\n }\n\n /**\n * converts Date or number to a fractional UNIX timestamp\n * Grabbed from NodeJS sources (lib/fs.js)\n */\n public _toUnixTimestamp(time: Date | number): number {\n if (typeof time === 'number') {\n return time;\n } else if (time instanceof Date) {\n return time.getTime() / 1000;\n }\n throw new Error(\"Cannot parse time: \" + time);\n }\n\n /**\n * **NONSTANDARD**: Grab the FileSystem instance that backs this API.\n * @return [BrowserFS.FileSystem | null] Returns null if the file system has\n * not been initialized.\n */\n public getRootFS(): FileSystem | null {\n if (this.root) {\n return this.root;\n } else {\n return null;\n }\n }\n\n // FILE OR DIRECTORY METHODS\n\n /**\n * Asynchronous rename. No arguments other than a possible exception are given\n * to the completion callback.\n * @param oldPath\n * @param newPath\n * @param callback\n */\n public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n assertRoot(this.root).rename(normalizePath(oldPath), normalizePath(newPath), newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous rename.\n * @param oldPath\n * @param newPath\n */\n public renameSync(oldPath: string, newPath: string): void {\n assertRoot(this.root).renameSync(normalizePath(oldPath), normalizePath(newPath));\n }\n\n /**\n * Test whether or not the given path exists by checking with the file system.\n * Then call the callback argument with either true or false.\n * @example Sample invocation\n * fs.exists('/etc/passwd', function (exists) {\n * util.debug(exists ? \"it's there\" : \"no passwd!\");\n * });\n * @param path\n * @param callback\n */\n public exists(path: string, cb: (exists: boolean) => any = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n return assertRoot(this.root).exists(normalizePath(path), newCb);\n } catch (e) {\n // Doesn't return an error. If something bad happens, we assume it just\n // doesn't exist.\n return newCb(false);\n }\n }\n\n /**\n * Test whether or not the given path exists by checking with the file system.\n * @param path\n * @return [boolean]\n */\n public existsSync(path: string): boolean {\n try {\n return assertRoot(this.root).existsSync(normalizePath(path));\n } catch (e) {\n // Doesn't return an error. If something bad happens, we assume it just\n // doesn't exist.\n return false;\n }\n }\n\n /**\n * Asynchronous `stat`.\n * @param path\n * @param callback\n */\n public stat(path: string, cb: BFSCallback = nopCb): void {\n const newCb = wrapCb(cb, 2);\n try {\n return assertRoot(this.root).stat(normalizePath(path), false, newCb);\n } catch (e) {\n return newCb(e);\n }\n }\n\n /**\n * Synchronous `stat`.\n * @param path\n * @return [BrowserFS.node.fs.Stats]\n */\n public statSync(path: string): Stats {\n return assertRoot(this.root).statSync(normalizePath(path), false);\n }\n\n /**\n * Asynchronous `lstat`.\n * `lstat()` is identical to `stat()`, except that if path is a symbolic link,\n * then the link itself is stat-ed, not the file that it refers to.\n * @param path\n * @param callback\n */\n public lstat(path: string, cb: BFSCallback = nopCb): void {\n const newCb = wrapCb(cb, 2);\n try {\n return assertRoot(this.root).stat(normalizePath(path), true, newCb);\n } catch (e) {\n return newCb(e);\n }\n }\n\n /**\n * Synchronous `lstat`.\n * `lstat()` is identical to `stat()`, except that if path is a symbolic link,\n * then the link itself is stat-ed, not the file that it refers to.\n * @param path\n * @return [BrowserFS.node.fs.Stats]\n */\n public lstatSync(path: string): Stats {\n return assertRoot(this.root).statSync(normalizePath(path), true);\n }\n\n // FILE-ONLY METHODS\n\n /**\n * Asynchronous `truncate`.\n * @param path\n * @param len\n * @param callback\n */\n public truncate(path: string, cb?: BFSOneArgCallback): void;\n public truncate(path: string, len: number, cb?: BFSOneArgCallback): void;\n public truncate(path: string, arg2: any = 0, cb: BFSOneArgCallback = nopCb): void {\n let len = 0;\n if (typeof arg2 === 'function') {\n cb = arg2;\n } else if (typeof arg2 === 'number') {\n len = arg2;\n }\n\n const newCb = wrapCb(cb, 1);\n try {\n if (len < 0) {\n throw new ApiError(ErrorCode.EINVAL);\n }\n return assertRoot(this.root).truncate(normalizePath(path), len, newCb);\n } catch (e) {\n return newCb(e);\n }\n }\n\n /**\n * Synchronous `truncate`.\n * @param path\n * @param len\n */\n public truncateSync(path: string, len: number = 0): void {\n if (len < 0) {\n throw new ApiError(ErrorCode.EINVAL);\n }\n return assertRoot(this.root).truncateSync(normalizePath(path), len);\n }\n\n /**\n * Asynchronous `unlink`.\n * @param path\n * @param callback\n */\n public unlink(path: string, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n return assertRoot(this.root).unlink(normalizePath(path), newCb);\n } catch (e) {\n return newCb(e);\n }\n }\n\n /**\n * Synchronous `unlink`.\n * @param path\n */\n public unlinkSync(path: string): void {\n return assertRoot(this.root).unlinkSync(normalizePath(path));\n }\n\n /**\n * Asynchronous file open.\n * Exclusive mode ensures that path is newly created.\n *\n * `flags` can be:\n *\n * * `'r'` - Open file for reading. An exception occurs if the file does not exist.\n * * `'r+'` - Open file for reading and writing. An exception occurs if the file does not exist.\n * * `'rs'` - Open file for reading in synchronous mode. Instructs the filesystem to not cache writes.\n * * `'rs+'` - Open file for reading and writing, and opens the file in synchronous mode.\n * * `'w'` - Open file for writing. The file is created (if it does not exist) or truncated (if it exists).\n * * `'wx'` - Like 'w' but opens the file in exclusive mode.\n * * `'w+'` - Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).\n * * `'wx+'` - Like 'w+' but opens the file in exclusive mode.\n * * `'a'` - Open file for appending. The file is created if it does not exist.\n * * `'ax'` - Like 'a' but opens the file in exclusive mode.\n * * `'a+'` - Open file for reading and appending. The file is created if it does not exist.\n * * `'ax+'` - Like 'a+' but opens the file in exclusive mode.\n *\n * @see http://www.manpagez.com/man/2/open/\n * @param path\n * @param flags\n * @param mode defaults to `0644`\n * @param callback\n */\n public open(path: string, flag: string, cb?: BFSCallback): void;\n public open(path: string, flag: string, mode: number|string, cb?: BFSCallback): void;\n public open(path: string, flag: string, arg2?: any, cb: BFSCallback = nopCb): void {\n const mode = normalizeMode(arg2, 0x1a4);\n cb = typeof arg2 === 'function' ? arg2 : cb;\n const newCb = wrapCb(cb, 2);\n try {\n assertRoot(this.root).open(normalizePath(path), FileFlag.getFileFlag(flag), mode, (e: ApiError, file?: File) => {\n if (file) {\n newCb(e, this.getFdForFile(file));\n } else {\n newCb(e);\n }\n });\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous file open.\n * @see http://www.manpagez.com/man/2/open/\n * @param path\n * @param flags\n * @param mode defaults to `0644`\n * @return [BrowserFS.File]\n */\n public openSync(path: string, flag: string, mode: number|string = 0x1a4): number {\n return this.getFdForFile(\n assertRoot(this.root).openSync(normalizePath(path), FileFlag.getFileFlag(flag), normalizeMode(mode, 0x1a4)));\n }\n\n /**\n * Asynchronously reads the entire contents of a file.\n * @example Usage example\n * fs.readFile('/etc/passwd', function (err, data) {\n * if (err) throw err;\n * console.log(data);\n * });\n * @param filename\n * @param options\n * @option options [String] encoding The string encoding for the file contents. Defaults to `null`.\n * @option options [String] flag Defaults to `'r'`.\n * @param callback If no encoding is specified, then the raw buffer is returned.\n */\n public readFile(filename: string, cb: BFSCallback): void;\n public readFile(filename: string, options: { flag?: string; }, callback: BFSCallback): void;\n public readFile(filename: string, options: { encoding: string; flag?: string; }, callback: BFSCallback): void;\n public readFile(filename: string, encoding: string, cb?: BFSCallback): void;\n public readFile(filename: string, arg2: any = {}, cb: BFSCallback = nopCb ) {\n const options = normalizeOptions(arg2, null, 'r', null);\n cb = typeof arg2 === 'function' ? arg2 : cb;\n const newCb = wrapCb(cb, 2);\n try {\n const flag = FileFlag.getFileFlag(options['flag']);\n if (!flag.isReadable()) {\n return newCb(new ApiError(ErrorCode.EINVAL, 'Flag passed to readFile must allow for reading.'));\n }\n return assertRoot(this.root).readFile(normalizePath(filename), options.encoding, flag, newCb);\n } catch (e) {\n return newCb(e);\n }\n }\n\n /**\n * Synchronously reads the entire contents of a file.\n * @param filename\n * @param options\n * @option options [String] encoding The string encoding for the file contents. Defaults to `null`.\n * @option options [String] flag Defaults to `'r'`.\n * @return [String | BrowserFS.node.Buffer]\n */\n public readFileSync(filename: string, options?: { flag?: string; }): Buffer;\n public readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;\n public readFileSync(filename: string, encoding: string): string;\n public readFileSync(filename: string, arg2: any = {}): any {\n const options = normalizeOptions(arg2, null, 'r', null);\n const flag = FileFlag.getFileFlag(options.flag);\n if (!flag.isReadable()) {\n throw new ApiError(ErrorCode.EINVAL, 'Flag passed to readFile must allow for reading.');\n }\n return assertRoot(this.root).readFileSync(normalizePath(filename), options.encoding, flag);\n }\n\n /**\n * Asynchronously writes data to a file, replacing the file if it already\n * exists.\n *\n * The encoding option is ignored if data is a buffer.\n *\n * @example Usage example\n * fs.writeFile('message.txt', 'Hello Node', function (err) {\n * if (err) throw err;\n * console.log('It\\'s saved!');\n * });\n * @param filename\n * @param data\n * @param options\n * @option options [String] encoding Defaults to `'utf8'`.\n * @option options [Number] mode Defaults to `0644`.\n * @option options [String] flag Defaults to `'w'`.\n * @param callback\n */\n public writeFile(filename: string, data: any, cb?: BFSOneArgCallback): void;\n public writeFile(filename: string, data: any, encoding?: string, cb?: BFSOneArgCallback): void;\n public writeFile(filename: string, data: any, options?: { encoding?: string; mode?: string | number; flag?: string; }, cb?: BFSOneArgCallback): void;\n public writeFile(filename: string, data: any, arg3: any = {}, cb: BFSOneArgCallback = nopCb): void {\n const options = normalizeOptions(arg3, 'utf8', 'w', 0x1a4);\n cb = typeof arg3 === 'function' ? arg3 : cb;\n const newCb = wrapCb(cb, 1);\n try {\n const flag = FileFlag.getFileFlag(options.flag);\n if (!flag.isWriteable()) {\n return newCb(new ApiError(ErrorCode.EINVAL, 'Flag passed to writeFile must allow for writing.'));\n }\n return assertRoot(this.root).writeFile(normalizePath(filename), data, options.encoding, flag, options.mode, newCb);\n } catch (e) {\n return newCb(e);\n }\n }\n\n /**\n * Synchronously writes data to a file, replacing the file if it already\n * exists.\n *\n * The encoding option is ignored if data is a buffer.\n * @param filename\n * @param data\n * @param options\n * @option options [String] encoding Defaults to `'utf8'`.\n * @option options [Number] mode Defaults to `0644`.\n * @option options [String] flag Defaults to `'w'`.\n */\n public writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number | string; flag?: string; }): void;\n public writeFileSync(filename: string, data: any, encoding?: string): void;\n public writeFileSync(filename: string, data: any, arg3?: any): void {\n const options = normalizeOptions(arg3, 'utf8', 'w', 0x1a4);\n const flag = FileFlag.getFileFlag(options.flag);\n if (!flag.isWriteable()) {\n throw new ApiError(ErrorCode.EINVAL, 'Flag passed to writeFile must allow for writing.');\n }\n return assertRoot(this.root).writeFileSync(normalizePath(filename), data, options.encoding, flag, options.mode);\n }\n\n /**\n * Asynchronously append data to a file, creating the file if it not yet\n * exists.\n *\n * @example Usage example\n * fs.appendFile('message.txt', 'data to append', function (err) {\n * if (err) throw err;\n * console.log('The \"data to append\" was appended to file!');\n * });\n * @param filename\n * @param data\n * @param options\n * @option options [String] encoding Defaults to `'utf8'`.\n * @option options [Number] mode Defaults to `0644`.\n * @option options [String] flag Defaults to `'a'`.\n * @param callback\n */\n public appendFile(filename: string, data: any, cb?: BFSOneArgCallback): void;\n public appendFile(filename: string, data: any, options?: { encoding?: string; mode?: number|string; flag?: string; }, cb?: BFSOneArgCallback): void;\n public appendFile(filename: string, data: any, encoding?: string, cb?: BFSOneArgCallback): void;\n public appendFile(filename: string, data: any, arg3?: any, cb: BFSOneArgCallback = nopCb): void {\n const options = normalizeOptions(arg3, 'utf8', 'a', 0x1a4);\n cb = typeof arg3 === 'function' ? arg3 : cb;\n const newCb = wrapCb(cb, 1);\n try {\n const flag = FileFlag.getFileFlag(options.flag);\n if (!flag.isAppendable()) {\n return newCb(new ApiError(ErrorCode.EINVAL, 'Flag passed to appendFile must allow for appending.'));\n }\n assertRoot(this.root).appendFile(normalizePath(filename), data, options.encoding, flag, options.mode, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Asynchronously append data to a file, creating the file if it not yet\n * exists.\n *\n * @example Usage example\n * fs.appendFile('message.txt', 'data to append', function (err) {\n * if (err) throw err;\n * console.log('The \"data to append\" was appended to file!');\n * });\n * @param filename\n * @param data\n * @param options\n * @option options [String] encoding Defaults to `'utf8'`.\n * @option options [Number] mode Defaults to `0644`.\n * @option options [String] flag Defaults to `'a'`.\n */\n public appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number | string; flag?: string; }): void;\n public appendFileSync(filename: string, data: any, encoding?: string): void;\n public appendFileSync(filename: string, data: any, arg3?: any): void {\n const options = normalizeOptions(arg3, 'utf8', 'a', 0x1a4);\n const flag = FileFlag.getFileFlag(options.flag);\n if (!flag.isAppendable()) {\n throw new ApiError(ErrorCode.EINVAL, 'Flag passed to appendFile must allow for appending.');\n }\n return assertRoot(this.root).appendFileSync(normalizePath(filename), data, options.encoding, flag, options.mode);\n }\n\n // FILE DESCRIPTOR METHODS\n\n /**\n * Asynchronous `fstat`.\n * `fstat()` is identical to `stat()`, except that the file to be stat-ed is\n * specified by the file descriptor `fd`.\n * @param fd\n * @param callback\n */\n public fstat(fd: number, cb: BFSCallback = nopCb): void {\n const newCb = wrapCb(cb, 2);\n try {\n const file = this.fd2file(fd);\n file.stat(newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `fstat`.\n * `fstat()` is identical to `stat()`, except that the file to be stat-ed is\n * specified by the file descriptor `fd`.\n * @param fd\n * @return [BrowserFS.node.fs.Stats]\n */\n public fstatSync(fd: number): Stats {\n return this.fd2file(fd).statSync();\n }\n\n /**\n * Asynchronous close.\n * @param fd\n * @param callback\n */\n public close(fd: number, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n this.fd2file(fd).close((e: ApiError) => {\n if (!e) {\n this.closeFd(fd);\n }\n newCb(e);\n });\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous close.\n * @param fd\n */\n public closeSync(fd: number): void {\n this.fd2file(fd).closeSync();\n this.closeFd(fd);\n }\n\n /**\n * Asynchronous ftruncate.\n * @param fd\n * @param len\n * @param callback\n */\n public ftruncate(fd: number, cb?: BFSOneArgCallback): void;\n public ftruncate(fd: number, len?: number, cb?: BFSOneArgCallback): void;\n public ftruncate(fd: number, arg2?: any, cb: BFSOneArgCallback = nopCb): void {\n const length = typeof arg2 === 'number' ? arg2 : 0;\n cb = typeof arg2 === 'function' ? arg2 : cb;\n const newCb = wrapCb(cb, 1);\n try {\n const file = this.fd2file(fd);\n if (length < 0) {\n throw new ApiError(ErrorCode.EINVAL);\n }\n file.truncate(length, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous ftruncate.\n * @param fd\n * @param len\n */\n public ftruncateSync(fd: number, len: number = 0): void {\n const file = this.fd2file(fd);\n if (len < 0) {\n throw new ApiError(ErrorCode.EINVAL);\n }\n file.truncateSync(len);\n }\n\n /**\n * Asynchronous fsync.\n * @param fd\n * @param callback\n */\n public fsync(fd: number, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n this.fd2file(fd).sync(newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous fsync.\n * @param fd\n */\n public fsyncSync(fd: number): void {\n this.fd2file(fd).syncSync();\n }\n\n /**\n * Asynchronous fdatasync.\n * @param fd\n * @param callback\n */\n public fdatasync(fd: number, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n this.fd2file(fd).datasync(newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous fdatasync.\n * @param fd\n */\n public fdatasyncSync(fd: number): void {\n this.fd2file(fd).datasyncSync();\n }\n\n /**\n * Write buffer to the file specified by `fd`.\n * Note that it is unsafe to use fs.write multiple times on the same file\n * without waiting for the callback.\n * @param fd\n * @param buffer Buffer containing the data to write to\n * the file.\n * @param offset Offset in the buffer to start reading data from.\n * @param length The amount of bytes to write to the file.\n * @param position Offset from the beginning of the file where this\n * data should be written. If position is null, the data will be written at\n * the current position.\n * @param callback The number specifies the number of bytes written into the file.\n */\n public write(fd: number, buffer: Buffer, offset: number, length: number, cb?: BFSThreeArgCallback): void;\n public write(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, cb?: BFSThreeArgCallback): void;\n public write(fd: number, data: any, cb?: BFSThreeArgCallback): void;\n public write(fd: number, data: any, position: number | null, cb?: BFSThreeArgCallback): void;\n public write(fd: number, data: any, position: number | null, encoding: string, cb?: BFSThreeArgCallback): void;\n public write(fd: number, arg2: any, arg3?: any, arg4?: any, arg5?: any, cb: BFSThreeArgCallback = nopCb): void {\n let buffer: Buffer, offset: number, length: number, position: number | null = null;\n if (typeof arg2 === 'string') {\n // Signature 1: (fd, string, [position?, [encoding?]], cb?)\n let encoding = 'utf8';\n switch (typeof arg3) {\n case 'function':\n // (fd, string, cb)\n cb = arg3;\n break;\n case 'number':\n // (fd, string, position, encoding?, cb?)\n position = arg3;\n encoding = typeof arg4 === 'string' ? arg4 : 'utf8';\n cb = typeof arg5 === 'function' ? arg5 : cb;\n break;\n default:\n // ...try to find the callback and get out of here!\n cb = typeof arg4 === 'function' ? arg4 : typeof arg5 === 'function' ? arg5 : cb;\n return cb(new ApiError(ErrorCode.EINVAL, 'Invalid arguments.'));\n }\n buffer = Buffer.from(arg2, encoding);\n offset = 0;\n length = buffer.length;\n } else {\n // Signature 2: (fd, buffer, offset, length, position?, cb?)\n buffer = arg2;\n offset = arg3;\n length = arg4;\n position = typeof arg5 === 'number' ? arg5 : null;\n cb = typeof arg5 === 'function' ? arg5 : cb;\n }\n\n const newCb = wrapCb(cb, 3);\n try {\n const file = this.fd2file(fd);\n if (position === undefined || position === null) {\n position = file.getPos()!;\n }\n file.write(buffer, offset, length, position, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Write buffer to the file specified by `fd`.\n * Note that it is unsafe to use fs.write multiple times on the same file\n * without waiting for it to return.\n * @param fd\n * @param buffer Buffer containing the data to write to\n * the file.\n * @param offset Offset in the buffer to start reading data from.\n * @param length The amount of bytes to write to the file.\n * @param position Offset from the beginning of the file where this\n * data should be written. If position is null, the data will be written at\n * the current position.\n */\n public writeSync(fd: number, buffer: Buffer, offset: number, length: number, position?: number | null): number;\n public writeSync(fd: number, data: string, position?: number | null, encoding?: string): number;\n public writeSync(fd: number, arg2: any, arg3?: any, arg4?: any, arg5?: any): number {\n let buffer: Buffer, offset: number = 0, length: number, position: number | null;\n if (typeof arg2 === 'string') {\n // Signature 1: (fd, string, [position?, [encoding?]])\n position = typeof arg3 === 'number' ? arg3 : null;\n const encoding = typeof arg4 === 'string' ? arg4 : 'utf8';\n offset = 0;\n buffer = Buffer.from(arg2, encoding);\n length = buffer.length;\n } else {\n // Signature 2: (fd, buffer, offset, length, position?)\n buffer = arg2;\n offset = arg3;\n length = arg4;\n position = typeof arg5 === 'number' ? arg5 : null;\n }\n\n const file = this.fd2file(fd);\n if (position === undefined || position === null) {\n position = file.getPos()!;\n }\n return file.writeSync(buffer, offset, length, position);\n }\n\n /**\n * Read data from the file specified by `fd`.\n * @param buffer The buffer that the data will be\n * written to.\n * @param offset The offset within the buffer where writing will\n * start.\n * @param length An integer specifying the number of bytes to read.\n * @param position An integer specifying where to begin reading from\n * in the file. If position is null, data will be read from the current file\n * position.\n * @param callback The number is the number of bytes read\n */\n public read(fd: number, length: number, position: number | null, encoding: string, cb?: BFSThreeArgCallback): void;\n public read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, cb?: BFSThreeArgCallback): void;\n public read(fd: number, arg2: any, arg3: any, arg4: any, arg5?: any, cb: BFSThreeArgCallback | BFSThreeArgCallback = nopCb): void {\n let position: number | null, offset: number, length: number, buffer: Buffer, newCb: BFSThreeArgCallback;\n if (typeof arg2 === 'number') {\n // legacy interface\n // (fd, length, position, encoding, callback)\n length = arg2;\n position = arg3;\n const encoding = arg4;\n cb = typeof arg5 === 'function' ? arg5 : cb;\n offset = 0;\n buffer = Buffer.alloc(length);\n // XXX: Inefficient.\n // Wrap the cb so we shelter upper layers of the API from these\n // shenanigans.\n newCb = wrapCb((err?: ApiError | null, bytesRead?: number, buf?: Buffer) => {\n if (err) {\n return ( cb)(err);\n }\n (> cb)(err, buf!.toString(encoding), bytesRead!);\n }, 3);\n } else {\n buffer = arg2;\n offset = arg3;\n length = arg4;\n position = arg5;\n newCb = wrapCb(> cb, 3);\n }\n\n try {\n const file = this.fd2file(fd);\n if (position === undefined || position === null) {\n position = file.getPos()!;\n }\n file.read(buffer, offset, length, position, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Read data from the file specified by `fd`.\n * @param fd\n * @param buffer The buffer that the data will be\n * written to.\n * @param offset The offset within the buffer where writing will\n * start.\n * @param length An integer specifying the number of bytes to read.\n * @param position An integer specifying where to begin reading from\n * in the file. If position is null, data will be read from the current file\n * position.\n * @return [Number]\n */\n public readSync(fd: number, length: number, position: number, encoding: string): string;\n public readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;\n public readSync(fd: number, arg2: any, arg3: any, arg4: any, arg5?: any): any {\n let shenanigans = false;\n let buffer: Buffer, offset: number, length: number, position: number, encoding: string = 'utf8';\n if (typeof arg2 === 'number') {\n length = arg2;\n position = arg3;\n encoding = arg4;\n offset = 0;\n buffer = Buffer.alloc(length);\n shenanigans = true;\n } else {\n buffer = arg2;\n offset = arg3;\n length = arg4;\n position = arg5;\n }\n const file = this.fd2file(fd);\n if (position === undefined || position === null) {\n position = file.getPos()!;\n }\n\n const rv = file.readSync(buffer, offset, length, position);\n if (!shenanigans) {\n return rv;\n } else {\n return [buffer.toString(encoding), rv];\n }\n }\n\n /**\n * Asynchronous `fchown`.\n * @param fd\n * @param uid\n * @param gid\n * @param callback\n */\n public fchown(fd: number, uid: number, gid: number, callback: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(callback, 1);\n try {\n this.fd2file(fd).chown(uid, gid, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `fchown`.\n * @param fd\n * @param uid\n * @param gid\n */\n public fchownSync(fd: number, uid: number, gid: number): void {\n this.fd2file(fd).chownSync(uid, gid);\n }\n\n /**\n * Asynchronous `fchmod`.\n * @param fd\n * @param mode\n * @param callback\n */\n public fchmod(fd: number, mode: string | number, cb: BFSOneArgCallback): void {\n const newCb = wrapCb(cb, 1);\n try {\n const numMode = typeof mode === 'string' ? parseInt(mode, 8) : mode;\n this.fd2file(fd).chmod(numMode, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `fchmod`.\n * @param fd\n * @param mode\n */\n public fchmodSync(fd: number, mode: number | string): void {\n const numMode = typeof mode === 'string' ? parseInt(mode, 8) : mode;\n this.fd2file(fd).chmodSync(numMode);\n }\n\n /**\n * Change the file timestamps of a file referenced by the supplied file\n * descriptor.\n * @param fd\n * @param atime\n * @param mtime\n * @param callback\n */\n public futimes(fd: number, atime: number | Date, mtime: number | Date, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n const file = this.fd2file(fd);\n if (typeof atime === 'number') {\n atime = new Date(atime * 1000);\n }\n if (typeof mtime === 'number') {\n mtime = new Date(mtime * 1000);\n }\n file.utimes(atime, mtime, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Change the file timestamps of a file referenced by the supplied file\n * descriptor.\n * @param fd\n * @param atime\n * @param mtime\n */\n public futimesSync(fd: number, atime: number | Date, mtime: number | Date): void {\n this.fd2file(fd).utimesSync(normalizeTime(atime), normalizeTime(mtime));\n }\n\n // DIRECTORY-ONLY METHODS\n\n /**\n * Asynchronous `rmdir`.\n * @param path\n * @param callback\n */\n public rmdir(path: string, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n path = normalizePath(path);\n assertRoot(this.root).rmdir(path, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `rmdir`.\n * @param path\n */\n public rmdirSync(path: string): void {\n path = normalizePath(path);\n return assertRoot(this.root).rmdirSync(path);\n }\n\n /**\n * Asynchronous `mkdir`.\n * @param path\n * @param mode defaults to `0777`\n * @param callback\n */\n public mkdir(path: string, mode?: any, cb: BFSOneArgCallback = nopCb): void {\n if (typeof mode === 'function') {\n cb = mode;\n mode = 0x1ff;\n }\n const newCb = wrapCb(cb, 1);\n try {\n path = normalizePath(path);\n assertRoot(this.root).mkdir(path, mode, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `mkdir`.\n * @param path\n * @param mode defaults to `0777`\n */\n public mkdirSync(path: string, mode?: number | string): void {\n assertRoot(this.root).mkdirSync(normalizePath(path), normalizeMode(mode, 0x1ff));\n }\n\n /**\n * Asynchronous `readdir`. Reads the contents of a directory.\n * The callback gets two arguments `(err, files)` where `files` is an array of\n * the names of the files in the directory excluding `'.'` and `'..'`.\n * @param path\n * @param callback\n */\n public readdir(path: string, cb: BFSCallback = nopCb): void {\n const newCb = <(err: ApiError, files?: string[]) => void> wrapCb(cb, 2);\n try {\n path = normalizePath(path);\n assertRoot(this.root).readdir(path, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `readdir`. Reads the contents of a directory.\n * @param path\n * @return [String[]]\n */\n public readdirSync(path: string): string[] {\n path = normalizePath(path);\n return assertRoot(this.root).readdirSync(path);\n }\n\n // SYMLINK METHODS\n\n /**\n * Asynchronous `link`.\n * @param srcpath\n * @param dstpath\n * @param callback\n */\n public link(srcpath: string, dstpath: string, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n srcpath = normalizePath(srcpath);\n dstpath = normalizePath(dstpath);\n assertRoot(this.root).link(srcpath, dstpath, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `link`.\n * @param srcpath\n * @param dstpath\n */\n public linkSync(srcpath: string, dstpath: string): void {\n srcpath = normalizePath(srcpath);\n dstpath = normalizePath(dstpath);\n return assertRoot(this.root).linkSync(srcpath, dstpath);\n }\n\n /**\n * Asynchronous `symlink`.\n * @param srcpath\n * @param dstpath\n * @param type can be either `'dir'` or `'file'` (default is `'file'`)\n * @param callback\n */\n public symlink(srcpath: string, dstpath: string, cb?: BFSOneArgCallback): void;\n public symlink(srcpath: string, dstpath: string, type?: string, cb?: BFSOneArgCallback): void;\n public symlink(srcpath: string, dstpath: string, arg3?: any, cb: BFSOneArgCallback = nopCb): void {\n const type = typeof arg3 === 'string' ? arg3 : 'file';\n cb = typeof arg3 === 'function' ? arg3 : cb;\n const newCb = wrapCb(cb, 1);\n try {\n if (type !== 'file' && type !== 'dir') {\n return newCb(new ApiError(ErrorCode.EINVAL, \"Invalid type: \" + type));\n }\n srcpath = normalizePath(srcpath);\n dstpath = normalizePath(dstpath);\n assertRoot(this.root).symlink(srcpath, dstpath, type, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `symlink`.\n * @param srcpath\n * @param dstpath\n * @param type can be either `'dir'` or `'file'` (default is `'file'`)\n */\n public symlinkSync(srcpath: string, dstpath: string, type?: string): void {\n if (!type) {\n type = 'file';\n } else if (type !== 'file' && type !== 'dir') {\n throw new ApiError(ErrorCode.EINVAL, \"Invalid type: \" + type);\n }\n srcpath = normalizePath(srcpath);\n dstpath = normalizePath(dstpath);\n return assertRoot(this.root).symlinkSync(srcpath, dstpath, type);\n }\n\n /**\n * Asynchronous readlink.\n * @param path\n * @param callback\n */\n public readlink(path: string, cb: BFSCallback = nopCb): void {\n const newCb = wrapCb(cb, 2);\n try {\n path = normalizePath(path);\n assertRoot(this.root).readlink(path, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous readlink.\n * @param path\n * @return [String]\n */\n public readlinkSync(path: string): string {\n path = normalizePath(path);\n return assertRoot(this.root).readlinkSync(path);\n }\n\n // PROPERTY OPERATIONS\n\n /**\n * Asynchronous `chown`.\n * @param path\n * @param uid\n * @param gid\n * @param callback\n */\n public chown(path: string, uid: number, gid: number, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n path = normalizePath(path);\n assertRoot(this.root).chown(path, false, uid, gid, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `chown`.\n * @param path\n * @param uid\n * @param gid\n */\n public chownSync(path: string, uid: number, gid: number): void {\n path = normalizePath(path);\n assertRoot(this.root).chownSync(path, false, uid, gid);\n }\n\n /**\n * Asynchronous `lchown`.\n * @param path\n * @param uid\n * @param gid\n * @param callback\n */\n public lchown(path: string, uid: number, gid: number, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n path = normalizePath(path);\n assertRoot(this.root).chown(path, true, uid, gid, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `lchown`.\n * @param path\n * @param uid\n * @param gid\n */\n public lchownSync(path: string, uid: number, gid: number): void {\n path = normalizePath(path);\n assertRoot(this.root).chownSync(path, true, uid, gid);\n }\n\n /**\n * Asynchronous `chmod`.\n * @param path\n * @param mode\n * @param callback\n */\n public chmod(path: string, mode: number | string, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n const numMode = normalizeMode(mode, -1);\n if (numMode < 0) {\n throw new ApiError(ErrorCode.EINVAL, `Invalid mode.`);\n }\n assertRoot(this.root).chmod(normalizePath(path), false, numMode, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `chmod`.\n * @param path\n * @param mode\n */\n public chmodSync(path: string, mode: string | number): void {\n const numMode = normalizeMode(mode, -1);\n if (numMode < 0) {\n throw new ApiError(ErrorCode.EINVAL, `Invalid mode.`);\n }\n path = normalizePath(path);\n assertRoot(this.root).chmodSync(path, false, numMode);\n }\n\n /**\n * Asynchronous `lchmod`.\n * @param path\n * @param mode\n * @param callback\n */\n public lchmod(path: string, mode: number | string, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n const numMode = normalizeMode(mode, -1);\n if (numMode < 0) {\n throw new ApiError(ErrorCode.EINVAL, `Invalid mode.`);\n }\n assertRoot(this.root).chmod(normalizePath(path), true, numMode, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `lchmod`.\n * @param path\n * @param mode\n */\n public lchmodSync(path: string, mode: number | string): void {\n const numMode = normalizeMode(mode, -1);\n if (numMode < 1) {\n throw new ApiError(ErrorCode.EINVAL, `Invalid mode.`);\n }\n assertRoot(this.root).chmodSync(normalizePath(path), true, numMode);\n }\n\n /**\n * Change file timestamps of the file referenced by the supplied path.\n * @param path\n * @param atime\n * @param mtime\n * @param callback\n */\n public utimes(path: string, atime: number | Date, mtime: number | Date, cb: BFSOneArgCallback = nopCb): void {\n const newCb = wrapCb(cb, 1);\n try {\n assertRoot(this.root).utimes(normalizePath(path), normalizeTime(atime), normalizeTime(mtime), newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Change file timestamps of the file referenced by the supplied path.\n * @param path\n * @param atime\n * @param mtime\n */\n public utimesSync(path: string, atime: number | Date, mtime: number | Date): void {\n assertRoot(this.root).utimesSync(normalizePath(path), normalizeTime(atime), normalizeTime(mtime));\n }\n\n /**\n * Asynchronous `realpath`. The callback gets two arguments\n * `(err, resolvedPath)`. May use `process.cwd` to resolve relative paths.\n *\n * @example Usage example\n * let cache = {'/etc':'/private/etc'};\n * fs.realpath('/etc/passwd', cache, function (err, resolvedPath) {\n * if (err) throw err;\n * console.log(resolvedPath);\n * });\n *\n * @param path\n * @param cache An object literal of mapped paths that can be used to\n * force a specific path resolution or avoid additional `fs.stat` calls for\n * known real paths.\n * @param callback\n */\n public realpath(path: string, cb?: BFSCallback): void;\n public realpath(path: string, cache: {[path: string]: string}, cb: BFSCallback): void;\n public realpath(path: string, arg2?: any, cb: BFSCallback = nopCb): void {\n const cache = typeof(arg2) === 'object' ? arg2 : {};\n cb = typeof(arg2) === 'function' ? arg2 : nopCb;\n const newCb = <(err: ApiError, resolvedPath?: string) => any> wrapCb(cb, 2);\n try {\n path = normalizePath(path);\n assertRoot(this.root).realpath(path, cache, newCb);\n } catch (e) {\n newCb(e);\n }\n }\n\n /**\n * Synchronous `realpath`.\n * @param path\n * @param cache An object literal of mapped paths that can be used to\n * force a specific path resolution or avoid additional `fs.stat` calls for\n * known real paths.\n * @return [String]\n */\n public realpathSync(path: string, cache: {[path: string]: string} = {}): string {\n path = normalizePath(path);\n return assertRoot(this.root).realpathSync(path, cache);\n }\n\n public watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void;\n public watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void;\n public watchFile(filename: string, arg2: any, listener: (curr: Stats, prev: Stats) => void = nopCb): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n\n public unwatchFile(filename: string, listener: (curr: Stats, prev: Stats) => void = nopCb): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n\n public watch(filename: string, listener?: (event: string, filename: string) => any): _fs.FSWatcher;\n public watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): _fs.FSWatcher;\n public watch(filename: string, arg2: any, listener: (event: string, filename: string) => any = nopCb): _fs.FSWatcher {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n\n public access(path: string, callback: (err: ApiError) => void): void;\n public access(path: string, mode: number, callback: (err: ApiError) => void): void;\n public access(path: string, arg2: any, cb: (e: ApiError) => void = nopCb): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n\n public accessSync(path: string, mode?: number): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n\n public createReadStream(path: string, options?: {\n flags?: string;\n encoding?: string;\n fd?: number;\n mode?: number;\n autoClose?: boolean;\n }): _fs.ReadStream {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n\n public createWriteStream(path: string, options?: {\n flags?: string;\n encoding?: string;\n fd?: number;\n mode?: number;\n }): _fs.WriteStream {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n\n /**\n * For unit testing. Passes all incoming callbacks to cbWrapper for wrapping.\n */\n public wrapCallbacks(cbWrapper: (cb: Function, args: number) => Function) {\n wrapCb = cbWrapper;\n }\n\n private getFdForFile(file: File): number {\n const fd = this.nextFd++;\n this.fdMap[fd] = file;\n return fd;\n }\n private fd2file(fd: number): File {\n const rv = this.fdMap[fd];\n if (rv) {\n return rv;\n } else {\n throw new ApiError(ErrorCode.EBADF, 'Invalid file descriptor.');\n }\n }\n private closeFd(fd: number): void {\n delete this.fdMap[fd];\n }\n}\n\nexport interface FSModule extends FS {\n /**\n * The FS constructor.\n */\n FS: typeof FS;\n /**\n * Retrieve the FS object backing the fs module.\n */\n getFSModule(): FS;\n /**\n * Set the FS object backing the fs module.\n */\n changeFSModule(newFs: FS): void;\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/FS.ts","/*\n * Levenshtein distance, from the `js-levenshtein` NPM module.\n * Copied here to avoid complexity of adding another CommonJS module dependency.\n */\n\nfunction _min(d0: number, d1: number, d2: number, bx: number, ay: number): number {\n return d0 < d1 || d2 < d1\n ? d0 > d2\n ? d2 + 1\n : d0 + 1\n : bx === ay\n ? d1\n : d1 + 1;\n}\n\n/**\n * Calculates levenshtein distance.\n * @param a\n * @param b\n */\nexport default function levenshtein(a: string, b: string): number {\n if (a === b) {\n return 0;\n }\n\n if (a.length > b.length) {\n const tmp = a;\n a = b;\n b = tmp;\n }\n\n let la = a.length;\n let lb = b.length;\n\n while (la > 0 && (a.charCodeAt(la - 1) === b.charCodeAt(lb - 1))) {\n la--;\n lb--;\n }\n\n let offset = 0;\n\n while (offset < la && (a.charCodeAt(offset) === b.charCodeAt(offset))) {\n offset++;\n }\n\n la -= offset;\n lb -= offset;\n\n if (la === 0 || lb === 1) {\n return lb;\n }\n\n const vector = new Array(la << 1);\n\n for (let y = 0; y < la; ) {\n vector[la + y] = a.charCodeAt(offset + y);\n vector[y] = ++y;\n }\n\n let x: number;\n let d0: number;\n let d1: number;\n let d2: number;\n let d3: number;\n for (x = 0; (x + 3) < lb; ) {\n const bx0 = b.charCodeAt(offset + (d0 = x));\n const bx1 = b.charCodeAt(offset + (d1 = x + 1));\n const bx2 = b.charCodeAt(offset + (d2 = x + 2));\n const bx3 = b.charCodeAt(offset + (d3 = x + 3));\n let dd = (x += 4);\n for (let y = 0; y < la; ) {\n const ay = vector[la + y];\n const dy = vector[y];\n d0 = _min(dy, d0, d1, bx0, ay);\n d1 = _min(d0, d1, d2, bx1, ay);\n d2 = _min(d1, d2, d3, bx2, ay);\n dd = _min(d2, d3, dd, bx3, ay);\n vector[y++] = dd;\n d3 = d2;\n d2 = d1;\n d1 = d0;\n d0 = dy;\n }\n }\n\n let dd: number = 0;\n for (; x < lb; ) {\n const bx0 = b.charCodeAt(offset + (d0 = x));\n dd = ++x;\n for (let y = 0; y < la; y++) {\n const dy = vector[y];\n vector[y] = dd = dy < d0 || dd < d0\n ? dy > dd ? dd + 1 : dy + 1\n : bx0 === vector[la + y]\n ? d0\n : d0 + 1;\n d0 = dy;\n }\n }\n\n return dd;\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/levenshtein.ts","/**\n * Grab bag of utility functions used across the code.\n */\nimport {FileSystem, BFSOneArgCallback, FileSystemConstructor} from './file_system';\nimport {ErrorCode, ApiError} from './api_error';\nimport levenshtein from './levenshtein';\nimport * as path from 'path';\n\nexport function deprecationMessage(print: boolean, fsName: string, opts: any): void {\n if (print) {\n console.warn(`[${fsName}] Direct file system constructor usage is deprecated for this file system, and will be removed in the next major version. Please use the '${fsName}.Create(${JSON.stringify(opts)}, callback)' method instead. See https://github.com/jvilk/BrowserFS/issues/176 for more details.`);\n }\n}\n\n/**\n * Checks for any IE version, including IE11 which removed MSIE from the\n * userAgent string.\n * @hidden\n */\nexport const isIE: boolean = typeof navigator !== \"undefined\" && !!(/(msie) ([\\w.]+)/.exec(navigator.userAgent.toLowerCase()) || navigator.userAgent.indexOf('Trident') !== -1);\n\n/**\n * Check if we're in a web worker.\n * @hidden\n */\nexport const isWebWorker: boolean = typeof window === \"undefined\";\n\n/**\n * @hidden\n */\nexport interface Arrayish {\n [idx: number]: T;\n length: number;\n}\n\n/**\n * Throws an exception. Called on code paths that should be impossible.\n * @hidden\n */\nexport function fail() {\n throw new Error(\"BFS has reached an impossible code path; please file a bug.\");\n}\n\n/**\n * Synchronous recursive makedir.\n * @hidden\n */\nexport function mkdirpSync(p: string, mode: number, fs: FileSystem): void {\n if (!fs.existsSync(p)) {\n mkdirpSync(path.dirname(p), mode, fs);\n fs.mkdirSync(p, mode);\n }\n}\n\n/**\n * Converts a buffer into an array buffer. Attempts to do so in a\n * zero-copy manner, e.g. the array references the same memory.\n * @hidden\n */\nexport function buffer2ArrayBuffer(buff: Buffer): ArrayBuffer {\n const u8 = buffer2Uint8array(buff),\n u8offset = u8.byteOffset,\n u8Len = u8.byteLength;\n if (u8offset === 0 && u8Len === u8.buffer.byteLength) {\n return u8.buffer;\n } else {\n return u8.buffer.slice(u8offset, u8offset + u8Len);\n }\n}\n\n/**\n * Converts a buffer into a Uint8Array. Attempts to do so in a\n * zero-copy manner, e.g. the array references the same memory.\n * @hidden\n */\nexport function buffer2Uint8array(buff: Buffer): Uint8Array {\n if (buff instanceof Uint8Array) {\n // BFS & Node v4.0 buffers *are* Uint8Arrays.\n return buff;\n } else {\n // Uint8Arrays can be constructed from arrayish numbers.\n // At this point, we assume this isn't a BFS array.\n return new Uint8Array(buff);\n }\n}\n\n/**\n * Converts the given arrayish object into a Buffer. Attempts to\n * be zero-copy.\n * @hidden\n */\nexport function arrayish2Buffer(arr: Arrayish): Buffer {\n if (arr instanceof Buffer) {\n return arr;\n } else if (arr instanceof Uint8Array) {\n return uint8Array2Buffer(arr);\n } else {\n return Buffer.from( arr);\n }\n}\n\n/**\n * Converts the given Uint8Array into a Buffer. Attempts to be zero-copy.\n * @hidden\n */\nexport function uint8Array2Buffer(u8: Uint8Array): Buffer {\n if (u8 instanceof Buffer) {\n return u8;\n } else if (u8.byteOffset === 0 && u8.byteLength === u8.buffer.byteLength) {\n return arrayBuffer2Buffer(u8.buffer);\n } else {\n return Buffer.from(u8.buffer, u8.byteOffset, u8.byteLength);\n }\n}\n\n/**\n * Converts the given array buffer into a Buffer. Attempts to be\n * zero-copy.\n * @hidden\n */\nexport function arrayBuffer2Buffer(ab: ArrayBuffer): Buffer {\n return Buffer.from(ab);\n}\n\n/**\n * Copies a slice of the given buffer\n * @hidden\n */\nexport function copyingSlice(buff: Buffer, start: number = 0, end = buff.length): Buffer {\n if (start < 0 || end < 0 || end > buff.length || start > end) {\n throw new TypeError(`Invalid slice bounds on buffer of length ${buff.length}: [${start}, ${end}]`);\n }\n if (buff.length === 0) {\n // Avoid s0 corner case in ArrayBuffer case.\n return emptyBuffer();\n } else {\n const u8 = buffer2Uint8array(buff),\n s0 = buff[0],\n newS0 = (s0 + 1) % 0xFF;\n\n buff[0] = newS0;\n if (u8[0] === newS0) {\n // Same memory. Revert & copy.\n u8[0] = s0;\n return uint8Array2Buffer(u8.slice(start, end));\n } else {\n // Revert.\n buff[0] = s0;\n return uint8Array2Buffer(u8.subarray(start, end));\n }\n }\n}\n\n/**\n * @hidden\n */\nlet emptyBuff: Buffer | null = null;\n/**\n * Returns an empty buffer.\n * @hidden\n */\nexport function emptyBuffer(): Buffer {\n if (emptyBuff) {\n return emptyBuff;\n }\n return emptyBuff = Buffer.alloc(0);\n}\n\n/**\n * Option validator for a Buffer file system option.\n * @hidden\n */\nexport function bufferValidator(v: object, cb: BFSOneArgCallback): void {\n if (Buffer.isBuffer(v)) {\n cb();\n } else {\n cb(new ApiError(ErrorCode.EINVAL, `option must be a Buffer.`));\n }\n}\n\n/**\n * Checks that the given options object is valid for the file system options.\n * @hidden\n */\nexport function checkOptions(fsType: FileSystemConstructor, opts: any, cb: BFSOneArgCallback): void {\n const optsInfo = fsType.Options;\n const fsName = fsType.Name;\n\n let pendingValidators = 0;\n let callbackCalled = false;\n let loopEnded = false;\n function validatorCallback(e?: ApiError): void {\n if (!callbackCalled) {\n if (e) {\n callbackCalled = true;\n cb(e);\n }\n pendingValidators--;\n if (pendingValidators === 0 && loopEnded) {\n cb();\n }\n }\n }\n\n // Check for required options.\n for (const optName in optsInfo) {\n if (optsInfo.hasOwnProperty(optName)) {\n const opt = optsInfo[optName];\n const providedValue = opts[optName];\n\n if (providedValue === undefined || providedValue === null) {\n if (!opt.optional) {\n // Required option, not provided.\n // Any incorrect options provided? Which ones are close to the provided one?\n // (edit distance 5 === close)\n const incorrectOptions = Object.keys(opts).filter((o) => !(o in optsInfo)).map((a: string) => {\n return {str: a, distance: levenshtein(optName, a)};\n }).filter((o) => o.distance < 5).sort((a, b) => a.distance - b.distance);\n // Validators may be synchronous.\n if (callbackCalled) {\n return;\n }\n callbackCalled = true;\n return cb(new ApiError(ErrorCode.EINVAL, `[${fsName}] Required option '${optName}' not provided.${incorrectOptions.length > 0 ? ` You provided unrecognized option '${incorrectOptions[0].str}'; perhaps you meant to type '${optName}'.` : ''}\\nOption description: ${opt.description}`));\n }\n // Else: Optional option, not provided. That is OK.\n } else {\n // Option provided! Check type.\n let typeMatches = false;\n if (Array.isArray(opt.type)) {\n typeMatches = opt.type.indexOf(typeof(providedValue)) !== -1;\n } else {\n typeMatches = typeof(providedValue) === opt.type;\n }\n if (!typeMatches) {\n // Validators may be synchronous.\n if (callbackCalled) {\n return;\n }\n callbackCalled = true;\n return cb(new ApiError(ErrorCode.EINVAL, `[${fsName}] Value provided for option ${optName} is not the proper type. Expected ${Array.isArray(opt.type) ? `one of {${opt.type.join(\", \")}}` : opt.type}, but received ${typeof(providedValue)}\\nOption description: ${opt.description}`));\n } else if (opt.validator) {\n pendingValidators++;\n opt.validator(providedValue, validatorCallback);\n }\n // Otherwise: All good!\n }\n }\n }\n loopEnded = true;\n if (pendingValidators === 0 && !callbackCalled) {\n cb();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/util.ts","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_apply.js","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_overRest.js","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/identity.js","import _overRest from 'lodash-es/_overRest';\nimport identity from 'lodash-es/identity';\n\n// Lodash rest function without function.toString()\n// remappings\nexport default function rest(func, start) {\n return _overRest(func, start, identity);\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/rest.js","import rest from './rest';\nimport initialParams from './initialParams';\n\nexport default function applyEach(eachfn) {\n return rest(function(fns, args) {\n var go = initialParams(function(args, callback) {\n var that = this;\n return eachfn(fns, function (fn, cb) {\n fn.apply(that, args.concat(cb));\n }, callback);\n });\n if (args.length) {\n return go.apply(this, args);\n }\n else {\n return go;\n }\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/applyEach.js","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_getRawTag.js","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_objectToString.js","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_baseGetTag.js","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/isObject.js","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/isFunction.js","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/isLength.js","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/isArrayLike.js","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nexport default noop;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/noop.js","export default function once(fn) {\n return function () {\n if (fn === null) return;\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/once.js","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_baseTimes.js","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/isObjectLike.js","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_baseIsArguments.js","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/stubFalse.js","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_isIndex.js","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_baseIsTypedArray.js","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_baseUnary.js","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_arrayLikeKeys.js","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_isPrototype.js","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_overArg.js","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_baseKeys.js","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/keys.js","import isArrayLike from 'lodash-es/isArrayLike';\nimport getIterator from './getIterator';\nimport keys from 'lodash-es/keys';\n\nfunction createArrayIterator(coll) {\n var i = -1;\n var len = coll.length;\n return function next() {\n return ++i < len ? {value: coll[i], key: i} : null;\n }\n}\n\nfunction createES2015Iterator(iterator) {\n var i = -1;\n return function next() {\n var item = iterator.next();\n if (item.done)\n return null;\n i++;\n return {value: item.value, key: i};\n }\n}\n\nfunction createObjectIterator(obj) {\n var okeys = keys(obj);\n var i = -1;\n var len = okeys.length;\n return function next() {\n var key = okeys[++i];\n return i < len ? {value: obj[key], key: key} : null;\n };\n}\n\nexport default function iterator(coll) {\n if (isArrayLike(coll)) {\n return createArrayIterator(coll);\n }\n\n var iterator = getIterator(coll);\n return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/iterator.js","export default function onlyOnce(fn) {\n return function() {\n if (fn === null) throw new Error(\"Callback was already called.\");\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/onlyOnce.js","import noop from 'lodash-es/noop';\nimport once from './once';\n\nimport iterator from './iterator';\nimport onlyOnce from './onlyOnce';\n\nimport breakLoop from './breakLoop';\n\nexport default function _eachOfLimit(limit) {\n return function (obj, iteratee, callback) {\n callback = once(callback || noop);\n if (limit <= 0 || !obj) {\n return callback(null);\n }\n var nextElem = iterator(obj);\n var done = false;\n var running = 0;\n\n function iterateeCallback(err, value) {\n running -= 1;\n if (err) {\n done = true;\n callback(err);\n }\n else if (value === breakLoop || (done && running <= 0)) {\n done = true;\n return callback(null);\n }\n else {\n replenish();\n }\n }\n\n function replenish () {\n while (running < limit && !done) {\n var elem = nextElem();\n if (elem === null) {\n done = true;\n if (running <= 0) {\n callback(null);\n }\n return;\n }\n running += 1;\n iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));\n }\n }\n\n replenish();\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/eachOfLimit.js","import _eachOfLimit from './internal/eachOfLimit';\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name eachOfLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - A function to apply to each\n * item in `coll`. The `key` is the item's key, or index in the case of an\n * array. The iteratee is passed a `callback(err)` which must be called once it\n * has completed. If no error has occurred, the callback should be run without\n * arguments or with an explicit `null` argument. Invoked with\n * (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nexport default function eachOfLimit(coll, limit, iteratee, callback) {\n _eachOfLimit(limit)(coll, iteratee, callback);\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/eachOfLimit.js","export default function doLimit(fn, limit) {\n return function (iterable, iteratee, callback) {\n return fn(iterable, limit, iteratee, callback);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/doLimit.js","import isArrayLike from 'lodash-es/isArrayLike';\n\nimport breakLoop from './internal/breakLoop';\nimport eachOfLimit from './eachOfLimit';\nimport doLimit from './internal/doLimit';\nimport noop from 'lodash-es/noop';\nimport once from './internal/once';\nimport onlyOnce from './internal/onlyOnce';\n\n// eachOf implementation optimized for array-likes\nfunction eachOfArrayLike(coll, iteratee, callback) {\n callback = once(callback || noop);\n var index = 0,\n completed = 0,\n length = coll.length;\n if (length === 0) {\n callback(null);\n }\n\n function iteratorCallback(err, value) {\n if (err) {\n callback(err);\n } else if ((++completed === length) || value === breakLoop) {\n callback(null);\n }\n }\n\n for (; index < length; index++) {\n iteratee(coll[index], index, onlyOnce(iteratorCallback));\n }\n}\n\n// a generic version of eachOf which can handle array, object, and iterator cases.\nvar eachOfGeneric = doLimit(eachOfLimit, Infinity);\n\n/**\n * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n * to the iteratee.\n *\n * @name eachOf\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEachOf\n * @category Collection\n * @see [async.each]{@link module:Collections.each}\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A function to apply to each\n * item in `coll`. The `key` is the item's key, or index in the case of an\n * array. The iteratee is passed a `callback(err)` which must be called once it\n * has completed. If no error has occurred, the callback should be run without\n * arguments or with an explicit `null` argument. Invoked with\n * (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * var obj = {dev: \"/dev.json\", test: \"/test.json\", prod: \"/prod.json\"};\n * var configs = {};\n *\n * async.forEachOf(obj, function (value, key, callback) {\n * fs.readFile(__dirname + value, \"utf8\", function (err, data) {\n * if (err) return callback(err);\n * try {\n * configs[key] = JSON.parse(data);\n * } catch (e) {\n * return callback(e);\n * }\n * callback();\n * });\n * }, function (err) {\n * if (err) console.error(err.message);\n * // configs is now a map of JSON data\n * doSomethingWith(configs);\n * });\n */\nexport default function(coll, iteratee, callback) {\n var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;\n eachOfImplementation(coll, iteratee, callback);\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/eachOf.js","import eachOf from '../eachOf';\n\nexport default function doParallel(fn) {\n return function (obj, iteratee, callback) {\n return fn(eachOf, obj, iteratee, callback);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/doParallel.js","import noop from 'lodash-es/noop';\n\nexport default function _asyncMap(eachfn, arr, iteratee, callback) {\n callback = callback || noop;\n arr = arr || [];\n var results = [];\n var counter = 0;\n\n eachfn(arr, function (value, _, callback) {\n var index = counter++;\n iteratee(value, function (err, v) {\n results[index] = v;\n callback(err);\n });\n }, function (err) {\n callback(err, results);\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/map.js","import eachOfLimit from './eachOfLimit';\n\nexport default function doParallelLimit(fn) {\n return function (obj, limit, iteratee, callback) {\n return fn(eachOfLimit(limit), obj, iteratee, callback);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/doParallelLimit.js","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_arrayEach.js","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_createBaseFor.js","'use strict';\n\nimport rest from './rest';\n\nexport var hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\nexport var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\n\nexport function fallback(fn) {\n setTimeout(fn, 0);\n}\n\nexport function wrap(defer) {\n return rest(function (fn, args) {\n defer(function () {\n fn.apply(null, args);\n });\n });\n}\n\nvar _defer;\n\nif (hasSetImmediate) {\n _defer = setImmediate;\n} else if (hasNextTick) {\n _defer = process.nextTick;\n} else {\n _defer = fallback;\n}\n\nexport default wrap(_defer);\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/setImmediate.js","import eachOfSeries from './eachOfSeries';\nimport noop from 'lodash-es/noop';\nimport once from './internal/once';\n\n/**\n * Reduces `coll` into a single value using an async `iteratee` to return each\n * successive step. `memo` is the initial state of the reduction. This function\n * only operates in series.\n *\n * For performance reasons, it may make sense to split a call to this function\n * into a parallel map, and then use the normal `Array.prototype.reduce` on the\n * results. This function is for situations where each step in the reduction\n * needs to be async; if you can get the data before reducing it, then it's\n * probably a good idea to do so.\n *\n * @name reduce\n * @static\n * @memberOf module:Collections\n * @method\n * @alias inject\n * @alias foldl\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {Function} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction. The `iteratee` is passed a\n * `callback(err, reduction)` which accepts an optional error as its first\n * argument, and the state of the reduction as the second. If an error is\n * passed to the callback, the reduction is stopped and the main `callback` is\n * immediately called with the error. Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n * @example\n *\n * async.reduce([1,2,3], 0, function(memo, item, callback) {\n * // pointless async:\n * process.nextTick(function() {\n * callback(null, memo + item)\n * });\n * }, function(err, result) {\n * // result is now equal to the last value of memo, which is 6\n * });\n */\nexport default function reduce(coll, memo, iteratee, callback) {\n callback = once(callback || noop);\n eachOfSeries(coll, function(x, i, callback) {\n iteratee(memo, x, function(err, v) {\n memo = v;\n callback(err);\n });\n }, function(err) {\n callback(err, memo);\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/reduce.js","import arrayEach from 'lodash-es/_arrayEach';\nimport rest from './rest';\n\nexport default function consoleFunc(name) {\n return rest(function (fn, args) {\n fn.apply(null, args.concat(rest(function (err, args) {\n if (typeof console === 'object') {\n if (err) {\n if (console.error) {\n console.error(err);\n }\n }\n else if (console[name]) {\n arrayEach(args, function (x) {\n console[name](x);\n });\n }\n }\n })));\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/consoleFunc.js","export default function _withoutIndex(iteratee) {\n return function (value, index, callback) {\n return iteratee(value, callback);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/withoutIndex.js","import eachOf from './eachOf';\nimport withoutIndex from './internal/withoutIndex';\n\n/**\n * Applies the function `iteratee` to each item in `coll`, in parallel.\n * The `iteratee` is called with an item from the list, and a callback for when\n * it has finished. If the `iteratee` passes an error to its `callback`, the\n * main `callback` (for the `each` function) is immediately called with the\n * error.\n *\n * Note, that since this function applies `iteratee` to each item in parallel,\n * there is no guarantee that the iteratee functions will complete in order.\n *\n * @name each\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEach\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A function to apply to each item\n * in `coll`. The iteratee is passed a `callback(err)` which must be called once\n * it has completed. If no error has occurred, the `callback` should be run\n * without arguments or with an explicit `null` argument. The array index is not\n * passed to the iteratee. Invoked with (item, callback). If you need the index,\n * use `eachOf`.\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * // assuming openFiles is an array of file names and saveFile is a function\n * // to save the modified contents of that file:\n *\n * async.each(openFiles, saveFile, function(err){\n * // if any of the saves produced an error, err would equal that error\n * });\n *\n * // assuming openFiles is an array of file names\n * async.each(openFiles, function(file, callback) {\n *\n * // Perform operation on file here.\n * console.log('Processing file ' + file);\n *\n * if( file.length > 32 ) {\n * console.log('This file name is too long');\n * callback('File name too long');\n * } else {\n * // Do work to process file here\n * console.log('File processed');\n * callback();\n * }\n * }, function(err) {\n * // if any of the file processing produced an error, err would equal that error\n * if( err ) {\n * // One of the iterations produced an error.\n * // All processing will now stop.\n * console.log('A file failed to process');\n * } else {\n * console.log('All files have been processed successfully');\n * }\n * });\n */\nexport default function eachLimit(coll, iteratee, callback) {\n eachOf(coll, withoutIndex(iteratee), callback);\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/each.js","import PreloadFile from '../generic/preload_file';\nimport {BaseFileSystem, FileSystem, BFSOneArgCallback, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {FileFlag} from '../core/file_flag';\nimport {default as Stats, FileType} from '../core/node_fs_stats';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport {File} from '../core/file';\nimport {each as asyncEach} from 'async';\nimport * as path from 'path';\nimport {arrayBuffer2Buffer, buffer2ArrayBuffer, emptyBuffer, deprecationMessage} from '../core/util';\n\n/**\n * @hidden\n */\nlet errorCodeLookup: {[dropboxErrorCode: number]: ErrorCode};\n/**\n * Lazily construct error code lookup, since DropboxJS might be loaded *after* BrowserFS (or not at all!)\n * @hidden\n */\nfunction constructErrorCodeLookup() {\n if (errorCodeLookup) {\n return;\n }\n errorCodeLookup = {};\n // This indicates a network transmission error on modern browsers. Internet Explorer might cause this code to be reported on some API server errors.\n errorCodeLookup[Dropbox.ApiError.NETWORK_ERROR] = ErrorCode.EIO;\n // This happens when the contentHash parameter passed to a Dropbox.Client#readdir or Dropbox.Client#stat matches the most recent content, so the API call response is omitted, to save bandwidth.\n // errorCodeLookup[Dropbox.ApiError.NO_CONTENT];\n // The error property on {Dropbox.ApiError#response} should indicate which input parameter is invalid and why.\n errorCodeLookup[Dropbox.ApiError.INVALID_PARAM] = ErrorCode.EINVAL;\n // The OAuth token used for the request will never become valid again, so the user should be re-authenticated.\n errorCodeLookup[Dropbox.ApiError.INVALID_TOKEN] = ErrorCode.EPERM;\n // This indicates a bug in dropbox.js and should never occur under normal circumstances.\n // ^ Actually, that's false. This occurs when you try to move folders to themselves, or move a file over another file.\n errorCodeLookup[Dropbox.ApiError.OAUTH_ERROR] = ErrorCode.EPERM;\n // This happens when trying to read from a non-existing file, readdir a non-existing directory, write a file into a non-existing directory, etc.\n errorCodeLookup[Dropbox.ApiError.NOT_FOUND] = ErrorCode.ENOENT;\n // This indicates a bug in dropbox.js and should never occur under normal circumstances.\n errorCodeLookup[Dropbox.ApiError.INVALID_METHOD] = ErrorCode.EINVAL;\n // This happens when a Dropbox.Client#readdir or Dropbox.Client#stat call would return more than a maximum amount of directory entries.\n errorCodeLookup[Dropbox.ApiError.NOT_ACCEPTABLE] = ErrorCode.EINVAL;\n // This is used by some backend methods to indicate that the client needs to download server-side changes and perform conflict resolution. Under normal usage, errors with this code should never surface to the code using dropbox.js.\n errorCodeLookup[Dropbox.ApiError.CONFLICT] = ErrorCode.EINVAL;\n // Status value indicating that the application is making too many requests.\n errorCodeLookup[Dropbox.ApiError.RATE_LIMITED] = ErrorCode.EBUSY;\n // The request should be retried after some time.\n errorCodeLookup[Dropbox.ApiError.SERVER_ERROR] = ErrorCode.EBUSY;\n // Status value indicating that the user's Dropbox is over its storage quota.\n errorCodeLookup[Dropbox.ApiError.OVER_QUOTA] = ErrorCode.ENOSPC;\n}\n\n/**\n * @hidden\n */\ninterface ICachedPathInfo {\n stat: Dropbox.File.Stat;\n}\n\n/**\n * @hidden\n */\ninterface ICachedFileInfo extends ICachedPathInfo {\n contents: ArrayBuffer;\n}\n\n/**\n * @hidden\n */\nfunction isFileInfo(cache: ICachedPathInfo): cache is ICachedFileInfo {\n return cache && cache.stat.isFile;\n}\n\n/**\n * @hidden\n */\ninterface ICachedDirInfo extends ICachedPathInfo {\n contents: string[];\n}\n\n/**\n * @hidden\n */\nfunction isDirInfo(cache: ICachedPathInfo): cache is ICachedDirInfo {\n return cache && cache.stat.isFolder;\n}\n\n/**\n * @hidden\n */\nfunction isArrayBuffer(ab: any): ab is ArrayBuffer {\n // Accept null / undefined, too.\n return ab === null || ab === undefined || (typeof(ab) === 'object' && typeof(ab['byteLength']) === 'number');\n}\n\n/**\n * Wraps a Dropbox client and caches operations.\n * @hidden\n */\nclass CachedDropboxClient {\n private _cache: {[path: string]: ICachedPathInfo} = {};\n private _client: Dropbox.Client;\n\n constructor(client: Dropbox.Client) {\n this._client = client;\n }\n\n public readdir(p: string, cb: (error: Dropbox.ApiError | null, contents?: string[]) => void): void {\n const cacheInfo = this.getCachedDirInfo(p);\n\n this._wrap((interceptCb) => {\n if (cacheInfo !== null && cacheInfo.contents) {\n this._client.readdir(p, {\n contentHash: cacheInfo.stat.contentHash\n }, interceptCb);\n } else {\n this._client.readdir(p, interceptCb);\n }\n }, (err: Dropbox.ApiError, filenames: string[], stat: Dropbox.File.Stat, folderEntries: Dropbox.File.Stat[]) => {\n if (err) {\n if (err.status === Dropbox.ApiError.NO_CONTENT && cacheInfo !== null) {\n cb(null, cacheInfo.contents.slice(0));\n } else {\n cb(err);\n }\n } else {\n this.updateCachedDirInfo(p, stat, filenames.slice(0));\n folderEntries.forEach((entry) => {\n this.updateCachedInfo(path.join(p, entry.name), entry);\n });\n cb(null, filenames);\n }\n });\n }\n\n public remove(p: string, cb: (error?: Dropbox.ApiError | null) => void): void {\n this._wrap((interceptCb) => {\n this._client.remove(p, interceptCb);\n }, (err: Dropbox.ApiError, stat?: Dropbox.File.Stat) => {\n if (!err) {\n this.updateCachedInfo(p, stat!);\n }\n cb(err);\n });\n }\n\n public move(src: string, dest: string, cb: (error?: Dropbox.ApiError) => void): void {\n this._wrap((interceptCb) => {\n this._client.move(src, dest, interceptCb);\n }, (err: Dropbox.ApiError, stat: Dropbox.File.Stat) => {\n if (!err) {\n this.deleteCachedInfo(src);\n this.updateCachedInfo(dest, stat);\n }\n cb(err);\n });\n }\n\n public stat(p: string, cb: (error: Dropbox.ApiError, stat?: Dropbox.File.Stat) => void): void {\n this._wrap((interceptCb) => {\n this._client.stat(p, interceptCb);\n }, (err: Dropbox.ApiError, stat: Dropbox.File.Stat) => {\n if (!err) {\n this.updateCachedInfo(p, stat);\n }\n cb(err, stat);\n });\n }\n\n public readFile(p: string, cb: (error: Dropbox.ApiError, file?: ArrayBuffer, stat?: Dropbox.File.Stat) => void): void {\n const cacheInfo = this.getCachedFileInfo(p);\n if (cacheInfo !== null && cacheInfo.contents !== null) {\n // Try to use cached info; issue a stat to see if contents are up-to-date.\n this.stat(p, (error, stat?) => {\n if (error) {\n cb(error);\n } else if (stat!.contentHash === cacheInfo!.stat.contentHash) {\n // No file changes.\n cb(error, cacheInfo!.contents.slice(0), cacheInfo!.stat);\n } else {\n // File changes; rerun to trigger actual readFile.\n this.readFile(p, cb);\n }\n });\n } else {\n this._wrap((interceptCb) => {\n this._client.readFile(p, { arrayBuffer: true }, interceptCb);\n }, (err: Dropbox.ApiError, contents: any, stat: Dropbox.File.Stat) => {\n if (!err) {\n this.updateCachedInfo(p, stat, contents.slice(0));\n }\n cb(err, contents, stat);\n });\n }\n }\n\n public writeFile(p: string, contents: ArrayBuffer, cb: (error: Dropbox.ApiError, stat?: Dropbox.File.Stat) => void): void {\n this._wrap((interceptCb) => {\n this._client.writeFile(p, contents, interceptCb);\n }, (err: Dropbox.ApiError, stat: Dropbox.File.Stat) => {\n if (!err) {\n this.updateCachedInfo(p, stat, contents.slice(0));\n }\n cb(err, stat);\n });\n }\n\n public mkdir(p: string, cb: (error?: Dropbox.ApiError) => void): void {\n this._wrap((interceptCb) => {\n this._client.mkdir(p, interceptCb);\n }, (err: Dropbox.ApiError, stat: Dropbox.File.Stat) => {\n if (!err) {\n this.updateCachedInfo(p, stat, []);\n }\n cb(err);\n });\n }\n\n /**\n * Wraps an operation such that we retry a failed operation 3 times.\n * Necessary to deal with Dropbox rate limiting.\n *\n * @param performOp Function that performs the operation. Will be called up to three times.\n * @param cb Called when the operation succeeds, fails in a non-temporary manner, or fails three times.\n */\n private _wrap(performOp: (interceptCb: (error: Dropbox.ApiError) => void) => void, cb: Function): void {\n let numRun = 0;\n const interceptCb = function(error: Dropbox.ApiError): void {\n // Timeout duration, in seconds.\n const timeoutDuration: number = 2;\n if (error && 3 > (++numRun)) {\n switch (error.status) {\n case Dropbox.ApiError.SERVER_ERROR:\n case Dropbox.ApiError.NETWORK_ERROR:\n case Dropbox.ApiError.RATE_LIMITED:\n setTimeout(() => {\n performOp(interceptCb);\n }, timeoutDuration * 1000);\n break;\n default:\n cb.apply(null, arguments);\n break;\n }\n } else {\n cb.apply(null, arguments);\n }\n };\n\n performOp(interceptCb);\n }\n\n private getCachedInfo(p: string): ICachedPathInfo {\n return this._cache[p.toLowerCase()];\n }\n\n private putCachedInfo(p: string, cache: ICachedPathInfo): void {\n this._cache[p.toLowerCase()] = cache;\n }\n\n private deleteCachedInfo(p: string): void {\n delete this._cache[p.toLowerCase()];\n }\n\n private getCachedDirInfo(p: string): ICachedDirInfo | null {\n const info = this.getCachedInfo(p);\n if (isDirInfo(info)) {\n return info;\n } else {\n return null;\n }\n }\n\n private getCachedFileInfo(p: string): ICachedFileInfo | null {\n const info = this.getCachedInfo(p);\n if (isFileInfo(info)) {\n return info;\n } else {\n return null;\n }\n }\n\n private updateCachedDirInfo(p: string, stat: Dropbox.File.Stat, contents: string[] | null = null): void {\n const cachedInfo = this.getCachedInfo(p);\n // Dropbox uses the *contentHash* property for directories.\n // Ignore stat objects w/o a contentHash defined; those actually exist!!!\n // (Example: readdir returns an array of stat objs; stat objs for dirs in that context have no contentHash)\n if (stat.contentHash !== null && (cachedInfo === undefined || cachedInfo.stat.contentHash !== stat.contentHash)) {\n this.putCachedInfo(p, {\n stat: stat,\n contents: contents\n });\n }\n }\n\n private updateCachedFileInfo(p: string, stat: Dropbox.File.Stat, contents: ArrayBuffer | null = null): void {\n const cachedInfo = this.getCachedInfo(p);\n // Dropbox uses the *versionTag* property for files.\n // Ignore stat objects w/o a versionTag defined.\n if (stat.versionTag !== null && (cachedInfo === undefined || cachedInfo.stat.versionTag !== stat.versionTag)) {\n this.putCachedInfo(p, {\n stat: stat,\n contents: contents\n });\n }\n }\n\n private updateCachedInfo(p: string, stat: Dropbox.File.Stat, contents: ArrayBuffer | string[] | null = null): void {\n if (stat.isFile && isArrayBuffer(contents)) {\n this.updateCachedFileInfo(p, stat, contents);\n } else if (stat.isFolder && Array.isArray(contents)) {\n this.updateCachedDirInfo(p, stat, contents);\n }\n }\n}\n\nexport class DropboxFile extends PreloadFile implements File {\n constructor(_fs: DropboxFileSystem, _path: string, _flag: FileFlag, _stat: Stats, contents?: Buffer) {\n super(_fs, _path, _flag, _stat, contents);\n }\n\n public sync(cb: BFSOneArgCallback): void {\n if (this.isDirty()) {\n const buffer = this.getBuffer(),\n arrayBuffer = buffer2ArrayBuffer(buffer);\n this._fs._writeFileStrict(this.getPath(), arrayBuffer, (e?: ApiError) => {\n if (!e) {\n this.resetDirty();\n }\n cb(e);\n });\n } else {\n cb();\n }\n }\n\n public close(cb: BFSOneArgCallback): void {\n this.sync(cb);\n }\n}\n\n/**\n * Options for the Dropbox file system.\n */\nexport interface DropboxFileSystemOptions {\n // An *authenticated* Dropbox client. Must be from the 0.10 JS SDK.\n client: Dropbox.Client;\n}\n\n/**\n * A read/write file system backed by Dropbox cloud storage.\n *\n * Uses the Dropbox V1 API.\n *\n * NOTE: You must use the v0.10 version of the [Dropbox JavaScript SDK](https://www.npmjs.com/package/dropbox).\n */\nexport default class DropboxFileSystem extends BaseFileSystem implements FileSystem {\n public static readonly Name = \"Dropbox\";\n\n public static readonly Options: FileSystemOptions = {\n client: {\n type: \"object\",\n description: \"An *authenticated* Dropbox client. Must be from the 0.10 JS SDK.\",\n validator: (opt: Dropbox.Client, cb: BFSOneArgCallback): void => {\n if (opt.isAuthenticated && opt.isAuthenticated()) {\n cb();\n } else {\n cb(new ApiError(ErrorCode.EINVAL, `'client' option must be an authenticated Dropbox client from the v0.10 JS SDK.`));\n }\n }\n }\n };\n\n /**\n * Creates a new DropboxFileSystem instance with the given options.\n * Must be given an *authenticated* DropboxJS client from the old v0.10 version of the Dropbox JS SDK.\n */\n public static Create(opts: DropboxFileSystemOptions, cb: BFSCallback): void {\n cb(null, new DropboxFileSystem(opts.client, false));\n }\n\n public static isAvailable(): boolean {\n // Checks if the Dropbox library is loaded.\n return typeof Dropbox !== 'undefined';\n }\n\n // The Dropbox client.\n private _client: CachedDropboxClient;\n\n /**\n * **Deprecated. Please use Dropbox.Create() method instead.**\n *\n * Constructs a Dropbox-backed file system using the *authenticated* DropboxJS client.\n *\n * Note that you must use the old v0.10 version of the Dropbox JavaScript SDK.\n */\n constructor(client: Dropbox.Client, deprecateMsg = true) {\n super();\n this._client = new CachedDropboxClient(client);\n deprecationMessage(deprecateMsg, DropboxFileSystem.Name, { client: \"authenticated dropbox client instance\" });\n constructErrorCodeLookup();\n }\n\n public getName(): string {\n return DropboxFileSystem.Name;\n }\n\n public isReadOnly(): boolean {\n return false;\n }\n\n // Dropbox doesn't support symlinks, properties, or synchronous calls\n\n public supportsSymlinks(): boolean {\n return false;\n }\n\n public supportsProps(): boolean {\n return false;\n }\n\n public supportsSynch(): boolean {\n return false;\n }\n\n public empty(mainCb: BFSOneArgCallback): void {\n this._client.readdir('/', (error, files) => {\n if (error) {\n mainCb(this.convert(error, '/'));\n } else {\n const deleteFile = (file: string, cb: BFSOneArgCallback) => {\n const p = path.join('/', file);\n this._client.remove(p, (err) => {\n cb(err ? this.convert(err, p) : null);\n });\n };\n const finished = (err?: ApiError) => {\n if (err) {\n mainCb(err);\n } else {\n mainCb();\n }\n };\n // XXX: typing is to get around overly-restrictive ErrorCallback typing.\n asyncEach(files!, deleteFile, finished);\n }\n });\n }\n\n public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void {\n this._client.move(oldPath, newPath, (error) => {\n if (error) {\n // the move is permitted if newPath is a file.\n // Check if this is the case, and remove if so.\n this._client.stat(newPath, (error2, stat) => {\n if (error2 || stat!.isFolder) {\n const missingPath = ( error.response).error.indexOf(oldPath) > -1 ? oldPath : newPath;\n cb(this.convert(error, missingPath));\n } else {\n // Delete file, repeat rename.\n this._client.remove(newPath, (error2) => {\n if (error2) {\n cb(this.convert(error2, newPath));\n } else {\n this.rename(oldPath, newPath, cb);\n }\n });\n }\n });\n } else {\n cb();\n }\n });\n }\n\n public stat(path: string, isLstat: boolean, cb: BFSCallback): void {\n // Ignore lstat case -- Dropbox doesn't support symlinks\n // Stat the file\n this._client.stat(path, (error, stat) => {\n if (error) {\n cb(this.convert(error, path));\n } else if (stat && stat.isRemoved) {\n // Dropbox keeps track of deleted files, so if a file has existed in the\n // past but doesn't any longer, you wont get an error\n cb(ApiError.FileError(ErrorCode.ENOENT, path));\n } else {\n const stats = new Stats(this._statType(stat!), stat!.size);\n return cb(null, stats);\n }\n });\n }\n\n public open(path: string, flags: FileFlag, mode: number, cb: BFSCallback): void {\n // Try and get the file's contents\n this._client.readFile(path, (error, content, dbStat) => {\n if (error) {\n // If the file's being opened for reading and doesn't exist, return an\n // error\n if (flags.isReadable()) {\n cb(this.convert(error, path));\n } else {\n switch (error.status) {\n // If it's being opened for writing or appending, create it so that\n // it can be written to\n case Dropbox.ApiError.NOT_FOUND:\n const ab = new ArrayBuffer(0);\n return this._writeFileStrict(path, ab, (error2: ApiError, stat?: Dropbox.File.Stat) => {\n if (error2) {\n cb(error2);\n } else {\n const file = this._makeFile(path, flags, stat!, arrayBuffer2Buffer(ab));\n cb(null, file);\n }\n });\n default:\n return cb(this.convert(error, path));\n }\n }\n } else {\n // No error\n let buffer: Buffer;\n // Dropbox.js seems to set `content` to `null` rather than to an empty\n // buffer when reading an empty file. Not sure why this is.\n if (content === null) {\n buffer = emptyBuffer();\n } else {\n buffer = arrayBuffer2Buffer(content!);\n }\n const file = this._makeFile(path, flags, dbStat!, buffer);\n return cb(null, file);\n }\n });\n }\n\n public _writeFileStrict(p: string, data: ArrayBuffer, cb: BFSCallback): void {\n const parent = path.dirname(p);\n this.stat(parent, false, (error: ApiError, stat?: Stats): void => {\n if (error) {\n cb(ApiError.FileError(ErrorCode.ENOENT, parent));\n } else {\n this._client.writeFile(p, data, (error2, stat) => {\n if (error2) {\n cb(this.convert(error2, p));\n } else {\n cb(null, stat);\n }\n });\n }\n });\n }\n\n /**\n * Private\n * Returns a BrowserFS object representing the type of a Dropbox.js stat object\n */\n public _statType(stat: Dropbox.File.Stat): FileType {\n return stat.isFile ? FileType.FILE : FileType.DIRECTORY;\n }\n\n /**\n * Private\n * Returns a BrowserFS object representing a File, created from the data\n * returned by calls to the Dropbox API.\n */\n public _makeFile(path: string, flag: FileFlag, stat: Dropbox.File.Stat, buffer: Buffer): DropboxFile {\n const type = this._statType(stat);\n const stats = new Stats(type, stat.size);\n return new DropboxFile(this, path, flag, stats, buffer);\n }\n\n /**\n * Private\n * Delete a file or directory from Dropbox\n * isFile should reflect which call was made to remove the it (`unlink` or\n * `rmdir`). If this doesn't match what's actually at `path`, an error will be\n * returned\n */\n public _remove(path: string, cb: BFSOneArgCallback, isFile: boolean): void {\n this._client.stat(path, (error, stat) => {\n if (error) {\n cb(this.convert(error, path));\n } else {\n if (stat!.isFile && !isFile) {\n cb(ApiError.FileError(ErrorCode.ENOTDIR, path));\n } else if (!stat!.isFile && isFile) {\n cb(ApiError.FileError(ErrorCode.EISDIR, path));\n } else {\n this._client.remove(path, (error) => {\n if (error) {\n cb(this.convert(error, path));\n } else {\n cb(null);\n }\n });\n }\n }\n });\n }\n\n /**\n * Delete a file\n */\n public unlink(path: string, cb: BFSOneArgCallback): void {\n this._remove(path, cb, true);\n }\n\n /**\n * Delete a directory\n */\n public rmdir(path: string, cb: BFSOneArgCallback): void {\n this._remove(path, cb, false);\n }\n\n /**\n * Create a directory\n */\n public mkdir(p: string, mode: number, cb: BFSOneArgCallback): void {\n // Dropbox.js' client.mkdir() behaves like `mkdir -p`, i.e. it creates a\n // directory and all its ancestors if they don't exist.\n // Node's fs.mkdir() behaves like `mkdir`, i.e. it throws an error if an attempt\n // is made to create a directory without a parent.\n // To handle this inconsistency, a check for the existence of `path`'s parent\n // must be performed before it is created, and an error thrown if it does\n // not exist\n const parent = path.dirname(p);\n this._client.stat(parent, (error, stat) => {\n if (error) {\n cb(this.convert(error, parent));\n } else {\n this._client.mkdir(p, (error) => {\n if (error) {\n cb(ApiError.FileError(ErrorCode.EEXIST, p));\n } else {\n cb(null);\n }\n });\n }\n });\n }\n\n /**\n * Get the names of the files in a directory\n */\n public readdir(path: string, cb: BFSCallback): void {\n this._client.readdir(path, (error, files) => {\n if (error) {\n return cb(this.convert(error));\n } else {\n return cb(null, files);\n }\n });\n }\n\n /**\n * Converts a Dropbox-JS error into a BFS error.\n */\n public convert(err: Dropbox.ApiError, path: string | null = null): ApiError {\n let errorCode = errorCodeLookup[err.status];\n if (errorCode === undefined) {\n errorCode = ErrorCode.EIO;\n }\n\n if (!path) {\n return new ApiError(errorCode);\n } else {\n return ApiError.FileError(errorCode, path);\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/Dropbox.ts","import {SynchronousFileSystem, BFSOneArgCallback, BFSCallback, BFSThreeArgCallback, FileSystemOptions} from '../core/file_system';\nimport {default as Stats, FileType} from '../core/node_fs_stats';\nimport {FileFlag} from '../core/file_flag';\nimport {BaseFile, File} from '../core/file';\nimport {uint8Array2Buffer, buffer2Uint8array} from '../core/util';\nimport {ApiError, ErrorCode, ErrorStrings} from '../core/api_error';\nimport {EmscriptenFSNode} from '../generic/emscripten_fs';\n\n/**\n * @hidden\n */\ninterface EmscriptenError {\n node: EmscriptenFSNode;\n errno: number;\n}\n\n/**\n * @hidden\n */\nfunction convertError(e: EmscriptenError, path: string = ''): ApiError {\n const errno = e.errno;\n let parent = e.node;\n const paths: string[] = [];\n while (parent) {\n paths.unshift(parent.name);\n if (parent === parent.parent) {\n break;\n }\n parent = parent.parent;\n }\n return new ApiError(errno, ErrorStrings[errno], paths.length > 0 ? '/' + paths.join('/') : path);\n}\n\nexport class EmscriptenFile extends BaseFile implements File {\n constructor(\n private _fs: EmscriptenFileSystem,\n private _FS: any,\n private _path: string,\n private _stream: any) {\n super();\n }\n public getPos(): number | undefined {\n return undefined;\n }\n public close(cb: BFSOneArgCallback): void {\n let err: ApiError | null = null;\n try {\n this.closeSync();\n } catch (e) {\n err = e;\n } finally {\n cb(err);\n }\n }\n public closeSync(): void {\n try {\n this._FS.close(this._stream);\n } catch (e) {\n throw convertError(e, this._path);\n }\n }\n public stat(cb: BFSCallback): void {\n try {\n cb(null, this.statSync());\n } catch (e) {\n cb(e);\n }\n }\n public statSync(): Stats {\n try {\n return this._fs.statSync(this._path, false);\n } catch (e) {\n throw convertError(e, this._path);\n }\n }\n public truncate(len: number, cb: BFSOneArgCallback): void {\n let err: ApiError | null = null;\n try {\n this.truncateSync(len);\n } catch (e) {\n err = e;\n } finally {\n cb(err);\n }\n }\n public truncateSync(len: number): void {\n try {\n this._FS.ftruncate(this._stream.fd, len);\n } catch (e) {\n throw convertError(e, this._path);\n }\n }\n public write(buffer: NodeBuffer, offset: number, length: number, position: number, cb: BFSThreeArgCallback): void {\n try {\n cb(null, this.writeSync(buffer, offset, length, position), buffer);\n } catch (e) {\n cb(e);\n }\n }\n public writeSync(buffer: NodeBuffer, offset: number, length: number, position: number | null): number {\n try {\n const u8 = buffer2Uint8array(buffer);\n // Emscripten is particular about what position is set to.\n const emPosition = position === null ? undefined : position;\n return this._FS.write(this._stream, u8, offset, length, emPosition);\n } catch (e) {\n throw convertError(e, this._path);\n }\n }\n public read(buffer: NodeBuffer, offset: number, length: number, position: number, cb: BFSThreeArgCallback): void {\n try {\n cb(null, this.readSync(buffer, offset, length, position), buffer);\n } catch (e) {\n cb(e);\n }\n }\n public readSync(buffer: NodeBuffer, offset: number, length: number, position: number | null): number {\n try {\n const u8 = buffer2Uint8array(buffer);\n // Emscripten is particular about what position is set to.\n const emPosition = position === null ? undefined : position;\n return this._FS.read(this._stream, u8, offset, length, emPosition);\n } catch (e) {\n throw convertError(e, this._path);\n }\n }\n public sync(cb: BFSOneArgCallback): void {\n // NOP.\n cb();\n }\n public syncSync(): void {\n // NOP.\n }\n public chown(uid: number, gid: number, cb: BFSOneArgCallback): void {\n let err: ApiError | null = null;\n try {\n this.chownSync(uid, gid);\n } catch (e) {\n err = e;\n } finally {\n cb(err);\n }\n }\n public chownSync(uid: number, gid: number): void {\n try {\n this._FS.fchown(this._stream.fd, uid, gid);\n } catch (e) {\n throw convertError(e, this._path);\n }\n }\n public chmod(mode: number, cb: BFSOneArgCallback): void {\n let err: ApiError | null = null;\n try {\n this.chmodSync(mode);\n } catch (e) {\n err = e;\n } finally {\n cb(err);\n }\n }\n public chmodSync(mode: number): void {\n try {\n this._FS.fchmod(this._stream.fd, mode);\n } catch (e) {\n throw convertError(e, this._path);\n }\n }\n public utimes(atime: Date, mtime: Date, cb: BFSOneArgCallback): void {\n let err: ApiError | null = null;\n try {\n this.utimesSync(atime, mtime);\n } catch (e) {\n err = e;\n } finally {\n cb(err);\n }\n }\n public utimesSync(atime: Date, mtime: Date): void {\n this._fs.utimesSync(this._path, atime, mtime);\n }\n}\n\n/**\n * Configuration options for Emscripten file systems.\n */\nexport interface EmscriptenFileSystemOptions {\n // The Emscripten file system to use (`FS`)\n FS: any;\n}\n\n/**\n * Mounts an Emscripten file system into the BrowserFS file system.\n */\nexport default class EmscriptenFileSystem extends SynchronousFileSystem {\n public static readonly Name = \"EmscriptenFileSystem\";\n\n public static readonly Options: FileSystemOptions = {\n FS: {\n type: \"object\",\n description: \"The Emscripten file system to use (the `FS` variable)\"\n }\n };\n\n /**\n * Create an EmscriptenFileSystem instance with the given options.\n */\n public static Create(opts: EmscriptenFileSystemOptions, cb: BFSCallback): void {\n cb(null, new EmscriptenFileSystem(opts.FS));\n }\n public static isAvailable(): boolean { return true; }\n\n private _FS: any;\n\n /**\n * Creates a BrowserFS file system for the given Emscripten file system.\n * @param _FS The Emscripten file system (`FS`).\n */\n constructor(_FS: any) {\n super();\n this._FS = _FS;\n }\n public getName(): string { return this._FS.DB_NAME(); }\n public isReadOnly(): boolean { return false; }\n public supportsLinks(): boolean { return true; }\n public supportsProps(): boolean { return true; }\n public supportsSynch(): boolean { return true; }\n\n public renameSync(oldPath: string, newPath: string): void {\n try {\n this._FS.rename(oldPath, newPath);\n } catch (e) {\n if (e.errno === ErrorCode.ENOENT) {\n throw convertError(e, this.existsSync(oldPath) ? newPath : oldPath);\n } else {\n throw convertError(e);\n }\n }\n }\n\n public statSync(p: string, isLstat: boolean): Stats {\n try {\n const stats = isLstat ? this._FS.lstat(p) : this._FS.stat(p);\n const itemType = this.modeToFileType(stats.mode);\n return new Stats(\n itemType,\n stats.size,\n stats.mode,\n stats.atime,\n stats.mtime,\n stats.ctime\n );\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public openSync(p: string, flag: FileFlag, mode: number): EmscriptenFile {\n try {\n const stream = this._FS.open(p, flag.getFlagString(), mode);\n if (this._FS.isDir(stream.node.mode)) {\n this._FS.close(stream);\n throw ApiError.EISDIR(p);\n }\n return new EmscriptenFile(this, this._FS, p, stream);\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public unlinkSync(p: string): void {\n try {\n this._FS.unlink(p);\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public rmdirSync(p: string): void {\n try {\n this._FS.rmdir(p);\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public mkdirSync(p: string, mode: number): void {\n try {\n this._FS.mkdir(p, mode);\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public readdirSync(p: string): string[] {\n try {\n // Emscripten returns items for '.' and '..'. Node does not.\n return this._FS.readdir(p).filter((p: string) => p !== '.' && p !== '..');\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public truncateSync(p: string, len: number): void {\n try {\n this._FS.truncate(p, len);\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public readFileSync(p: string, encoding: string, flag: FileFlag): any {\n try {\n const data: Uint8Array = this._FS.readFile(p, { flags: flag.getFlagString() });\n const buff = uint8Array2Buffer(data);\n if (encoding) {\n return buff.toString(encoding);\n } else {\n return buff;\n }\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public writeFileSync(p: string, data: any, encoding: string, flag: FileFlag, mode: number): void {\n try {\n if (encoding) {\n data = Buffer.from(data, encoding);\n }\n const u8 = buffer2Uint8array(data);\n this._FS.writeFile(p, u8, { flags: flag.getFlagString(), encoding: 'binary' });\n this._FS.chmod(p, mode);\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public chmodSync(p: string, isLchmod: boolean, mode: number) {\n try {\n isLchmod ? this._FS.lchmod(p, mode) : this._FS.chmod(p, mode);\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public chownSync(p: string, isLchown: boolean, uid: number, gid: number): void {\n try {\n isLchown ? this._FS.lchown(p, uid, gid) : this._FS.chown(p, uid, gid);\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public symlinkSync(srcpath: string, dstpath: string, type: string): void {\n try {\n this._FS.symlink(srcpath, dstpath);\n } catch (e) {\n throw convertError(e);\n }\n }\n\n public readlinkSync(p: string): string {\n try {\n return this._FS.readlink(p);\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n public utimesSync(p: string, atime: Date, mtime: Date): void {\n try {\n this._FS.utime(p, atime.getTime(), mtime.getTime());\n } catch (e) {\n throw convertError(e, p);\n }\n }\n\n private modeToFileType(mode: number): FileType {\n if (this._FS.isDir(mode)) {\n return FileType.DIRECTORY;\n } else if (this._FS.isFile(mode)) {\n return FileType.FILE;\n } else if (this._FS.isLink(mode)) {\n return FileType.SYMLINK;\n } else {\n throw ApiError.EPERM(`Invalid mode: ${mode}`);\n }\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/Emscripten.ts","import {BaseFileSystem, FileSystem, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport * as path from 'path';\nimport {ApiError} from '../core/api_error';\n\n/**\n * Configuration options for a FolderAdapter file system.\n */\nexport interface FolderAdapterOptions {\n // The folder to use as the root directory.\n folder: string;\n // The file system to wrap.\n wrapped: FileSystem;\n}\n\n/**\n * The FolderAdapter file system wraps a file system, and scopes all interactions to a subfolder of that file system.\n *\n * Example: Given a file system `foo` with folder `bar` and file `bar/baz`...\n *\n * ```javascript\n * BrowserFS.configure({\n * fs: \"FolderAdapter\",\n * options: {\n * folder: \"bar\",\n * wrapped: foo\n * }\n * }, function(e) {\n * var fs = BrowserFS.BFSRequire('fs');\n * fs.readdirSync('/'); // ['baz']\n * });\n * ```\n */\nexport default class FolderAdapter extends BaseFileSystem implements FileSystem {\n public static readonly Name = \"FolderAdapter\";\n\n public static readonly Options: FileSystemOptions = {\n folder: {\n type: \"string\",\n description: \"The folder to use as the root directory\"\n },\n wrapped: {\n type: \"object\",\n description: \"The file system to wrap\"\n }\n };\n\n /**\n * Creates a FolderAdapter instance with the given options.\n */\n public static Create(opts: FolderAdapterOptions, cb: BFSCallback): void {\n cb(null, new FolderAdapter(opts.folder, opts.wrapped));\n }\n public static isAvailable(): boolean {\n return true;\n }\n\n public _wrapped: FileSystem;\n public _folder: string;\n /**\n * Wraps a file system, and uses the given folder as its root.\n *\n * @param folder The folder to use as the root directory.\n * @param wrapped The file system to wrap.\n */\n constructor(folder: string, wrapped: FileSystem) {\n super();\n this._folder = folder;\n this._wrapped = wrapped;\n }\n\n /**\n * Initialize the file system. Ensures that the wrapped file system\n * has the given folder.\n */\n public initialize(cb: (e?: ApiError) => void) {\n this._wrapped.exists(this._folder, (exists: boolean) => {\n if (exists) {\n cb();\n } else if (this._wrapped.isReadOnly()) {\n cb(ApiError.ENOENT(this._folder));\n } else {\n this._wrapped.mkdir(this._folder, 0x1ff, cb);\n }\n });\n }\n\n public getName(): string { return this._wrapped.getName(); }\n public isReadOnly(): boolean { return this._wrapped.isReadOnly(); }\n public supportsProps(): boolean { return this._wrapped.supportsProps(); }\n public supportsSynch(): boolean { return this._wrapped.supportsSynch(); }\n public supportsLinks(): boolean { return false; }\n}\n\n/**\n * @hidden\n */\nfunction translateError(folder: string, e: any): any {\n if (e !== null && typeof e === 'object') {\n const err = e;\n let p = err.path;\n if (p) {\n p = '/' + path.relative(folder, p);\n err.message = err.message.replace(err.path!, p);\n err.path = p;\n }\n }\n return e;\n}\n\n/**\n * @hidden\n */\nfunction wrapCallback(folder: string, cb: any): any {\n if (typeof cb === 'function') {\n return function(err: ApiError) {\n if (arguments.length > 0) {\n arguments[0] = translateError(folder, err);\n }\n ( cb).apply(null, arguments);\n };\n } else {\n return cb;\n }\n}\n\n/**\n * @hidden\n */\nfunction wrapFunction(name: string, wrapFirst: boolean, wrapSecond: boolean): Function {\n if (name.slice(name.length - 4) !== 'Sync') {\n // Async function. Translate error in callback.\n return function(this: FolderAdapter) {\n if (arguments.length > 0) {\n if (wrapFirst) {\n arguments[0] = path.join(this._folder, arguments[0]);\n }\n if (wrapSecond) {\n arguments[1] = path.join(this._folder, arguments[1]);\n }\n arguments[arguments.length - 1] = wrapCallback(this._folder, arguments[arguments.length - 1]);\n }\n return ( this._wrapped)[name].apply(this._wrapped, arguments);\n };\n } else {\n // Sync function. Translate error in catch.\n return function(this: FolderAdapter) {\n try {\n if (wrapFirst) {\n arguments[0] = path.join(this._folder, arguments[0]);\n }\n if (wrapSecond) {\n arguments[1] = path.join(this._folder, arguments[1]);\n }\n return ( this._wrapped)[name].apply(this._wrapped, arguments);\n } catch (e) {\n throw translateError(this._folder, e);\n }\n };\n }\n}\n\n// First argument is a path.\n['diskSpace', 'stat', 'statSync', 'open', 'openSync', 'unlink', 'unlinkSync',\n 'rmdir', 'rmdirSync', 'mkdir', 'mkdirSync', 'readdir', 'readdirSync', 'exists',\n 'existsSync', 'realpath', 'realpathSync', 'truncate', 'truncateSync', 'readFile',\n 'readFileSync', 'writeFile', 'writeFileSync', 'appendFile', 'appendFileSync',\n 'chmod', 'chmodSync', 'chown', 'chownSync', 'utimes', 'utimesSync', 'readlink',\n 'readlinkSync'].forEach((name: string) => {\n ( FolderAdapter.prototype)[name] = wrapFunction(name, true, false);\n});\n\n// First and second arguments are paths.\n['rename', 'renameSync', 'link', 'linkSync', 'symlink', 'symlinkSync'].forEach((name: string) => {\n ( FolderAdapter.prototype)[name] = wrapFunction(name, true, true);\n});\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/FolderAdapter.ts","import PreloadFile from '../generic/preload_file';\nimport {BaseFileSystem, FileSystem as IFileSystem, BFSOneArgCallback, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport {FileFlag, ActionType} from '../core/file_flag';\nimport {default as Stats, FileType} from '../core/node_fs_stats';\nimport {File as IFile} from '../core/file';\nimport * as path from 'path';\nimport global from '../core/global';\nimport {each as asyncEach} from 'async';\nimport {buffer2ArrayBuffer, arrayBuffer2Buffer, deprecationMessage} from '../core/util';\n\n/**\n * @hidden\n */\nfunction isDirectoryEntry(entry: Entry): entry is DirectoryEntry {\n return entry.isDirectory;\n}\n\n/**\n * @hidden\n */\nconst _getFS: (type: number, size: number, successCallback: FileSystemCallback, errorCallback?: ErrorCallback) => void = global.webkitRequestFileSystem || global.requestFileSystem || null;\n\n/**\n * @hidden\n */\nfunction _requestQuota(type: number, size: number, success: (size: number) => void, errorCallback: ErrorCallback) {\n // We cast navigator and window to '' because everything here is\n // nonstandard functionality, despite the fact that Chrome has the only\n // implementation of the HTML5FS and is likely driving the standardization\n // process. Thus, these objects defined off of navigator and window are not\n // present in the DefinitelyTyped TypeScript typings for FileSystem.\n if (typeof ( navigator)['webkitPersistentStorage'] !== 'undefined') {\n switch (type) {\n case global.PERSISTENT:\n ( navigator).webkitPersistentStorage.requestQuota(size, success, errorCallback);\n break;\n case global.TEMPORARY:\n ( navigator).webkitTemporaryStorage.requestQuota(size, success, errorCallback);\n break;\n default:\n errorCallback(new TypeError(`Invalid storage type: ${type}`));\n break;\n }\n } else {\n ( global).webkitStorageInfo.requestQuota(type, size, success, errorCallback);\n }\n}\n\n/**\n * @hidden\n */\nfunction _toArray(list?: any[]): any[] {\n return Array.prototype.slice.call(list || [], 0);\n}\n\n/**\n * Converts the given DOMError into an appropriate ApiError.\n * @url https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n * @hidden\n */\nfunction convertError(err: DOMError, p: string, expectedDir: boolean): ApiError {\n switch (err.name) {\n /* The user agent failed to create a file or directory due to the existence of a file or\n directory with the same path. */\n case \"PathExistsError\":\n return ApiError.EEXIST(p);\n /* The operation failed because it would cause the application to exceed its storage quota. */\n case 'QuotaExceededError':\n return ApiError.FileError(ErrorCode.ENOSPC, p);\n /* A required file or directory could not be found at the time an operation was processed. */\n case 'NotFoundError':\n return ApiError.ENOENT(p);\n /* This is a security error code to be used in situations not covered by any other error codes.\n - A required file was unsafe for access within a Web application\n - Too many calls are being made on filesystem resources */\n case 'SecurityError':\n return ApiError.FileError(ErrorCode.EACCES, p);\n /* The modification requested was illegal. Examples of invalid modifications include moving a\n directory into its own child, moving a file into its parent directory without changing its name,\n or copying a directory to a path occupied by a file. */\n case 'InvalidModificationError':\n return ApiError.FileError(ErrorCode.EPERM, p);\n /* The user has attempted to look up a file or directory, but the Entry found is of the wrong type\n [e.g. is a DirectoryEntry when the user requested a FileEntry]. */\n case 'TypeMismatchError':\n return ApiError.FileError(expectedDir ? ErrorCode.ENOTDIR : ErrorCode.EISDIR, p);\n /* A path or URL supplied to the API was malformed. */\n case \"EncodingError\":\n /* An operation depended on state cached in an interface object, but that state that has changed\n since it was read from disk. */\n case \"InvalidStateError\":\n /* The user attempted to write to a file or directory which could not be modified due to the state\n of the underlying filesystem. */\n case \"NoModificationAllowedError\":\n default:\n return ApiError.FileError(ErrorCode.EINVAL, p);\n }\n}\n\n// A note about getFile and getDirectory options:\n// These methods are called at numerous places in this file, and are passed\n// some combination of these two options:\n// - create: If true, the entry will be created if it doesn't exist.\n// If false, an error will be thrown if it doesn't exist.\n// - exclusive: If true, only create the entry if it doesn't already exist,\n// and throw an error if it does.\n\nexport class HTML5FSFile extends PreloadFile implements IFile {\n private _entry: FileEntry;\n\n constructor(fs: HTML5FS, entry: FileEntry, path: string, flag: FileFlag, stat: Stats, contents?: Buffer) {\n super(fs, path, flag, stat, contents);\n this._entry = entry;\n }\n\n public sync(cb: BFSOneArgCallback): void {\n if (!this.isDirty()) {\n return cb();\n }\n\n this._entry.createWriter((writer) => {\n const buffer = this.getBuffer();\n const blob = new Blob([buffer2ArrayBuffer(buffer)]);\n const length = blob.size;\n writer.onwriteend = (err?: any) => {\n writer.onwriteend = null;\n writer.onerror = null;\n writer.truncate(length);\n this.resetDirty();\n cb();\n };\n writer.onerror = (err: any) => {\n cb(convertError(err, this.getPath(), false));\n };\n writer.write(blob);\n });\n }\n\n public close(cb: BFSOneArgCallback): void {\n this.sync(cb);\n }\n}\n\nexport interface HTML5FSOptions {\n // storage quota to request, in megabytes. Allocated value may be less.\n size?: number;\n // window.PERSISTENT or window.TEMPORARY. Defaults to PERSISTENT.\n type?: number;\n}\n\n/**\n * A read-write filesystem backed by the HTML5 FileSystem API.\n *\n * As the HTML5 FileSystem is only implemented in Blink, this interface is\n * only available in Chrome.\n */\nexport default class HTML5FS extends BaseFileSystem implements IFileSystem {\n public static readonly Name = \"HTML5FS\";\n\n public static readonly Options: FileSystemOptions = {\n size: {\n type: \"number\",\n optional: true,\n description: \"Storage quota to request, in megabytes. Allocated value may be less. Defaults to 5.\"\n },\n type: {\n type: \"number\",\n optional: true,\n description: \"window.PERSISTENT or window.TEMPORARY. Defaults to PERSISTENT.\"\n }\n };\n\n /**\n * Creates an HTML5FS instance with the given options.\n */\n public static Create(opts: HTML5FSOptions, cb: BFSCallback): void {\n const fs = new HTML5FS(opts.size, opts.type, false);\n fs.allocate((e) => e ? cb(e) : cb(null, fs), false);\n }\n public static isAvailable(): boolean {\n return !!_getFS;\n }\n\n // HTML5File reaches into HTML5FS. :/\n public fs: FileSystem;\n private size: number;\n private type: number;\n /**\n * **Deprecated. Please use HTML5FS.Create() method instead.**\n *\n * Creates a new HTML5 FileSystem-backed BrowserFS file system of the given size\n * and storage type.\n *\n * **IMPORTANT**: You must call `allocate` on the resulting object before the file system\n * can be used.\n *\n * @param size storage quota to request, in megabytes. Allocated value may be less.\n * @param type window.PERSISTENT or window.TEMPORARY. Defaults to PERSISTENT.\n */\n constructor(size: number = 5, type: number = global.PERSISTENT, deprecateMsg = true) {\n super();\n // Convert MB to bytes.\n this.size = 1024 * 1024 * size;\n this.type = type;\n deprecationMessage(deprecateMsg, HTML5FS.Name, {size: size, type: type});\n }\n\n public getName(): string {\n return HTML5FS.Name;\n }\n\n public isReadOnly(): boolean {\n return false;\n }\n\n public supportsSymlinks(): boolean {\n return false;\n }\n\n public supportsProps(): boolean {\n return false;\n }\n\n public supportsSynch(): boolean {\n return false;\n }\n\n /**\n * **Deprecated. Please use Create() method instead to create and allocate an HTML5FS.**\n *\n * Requests a storage quota from the browser to back this FS.\n * Must be called before file system can be used!\n */\n public allocate(cb: BFSOneArgCallback = () => {/*nop*/}, deprecateMsg = true): void {\n if (deprecateMsg) {\n console.warn(`[HTML5FS] HTML5FS.allocate() is deprecated and will be removed in the next major release. Please use 'HTML5FS.Create({type: ${this.type}, size: ${this.size}}, cb)' to create and allocate HTML5FS instances.`);\n }\n const success = (fs: FileSystem): void => {\n this.fs = fs;\n cb();\n };\n const error = (err: DOMException): void => {\n cb(convertError(err, \"/\", true));\n };\n if (this.type === global.PERSISTENT) {\n _requestQuota(this.type, this.size, (granted: number) => {\n _getFS(this.type, granted, success, error);\n }, error);\n } else {\n _getFS(this.type, this.size, success, error);\n }\n }\n\n /**\n * Deletes everything in the FS. Used for testing.\n * Karma clears the storage after you quit it but not between runs of the test\n * suite, and the tests expect an empty FS every time.\n */\n public empty(mainCb: BFSOneArgCallback): void {\n // Get a list of all entries in the root directory to delete them\n this._readdir('/', (err: ApiError, entries?: Entry[]): void => {\n if (err) {\n console.error('Failed to empty FS');\n mainCb(err);\n } else {\n // Called when every entry has been operated on\n const finished = (er: any): void => {\n if (err) {\n console.error(\"Failed to empty FS\");\n mainCb(err);\n } else {\n mainCb();\n }\n };\n // Removes files and recursively removes directories\n const deleteEntry = (entry: Entry, cb: (e?: any) => void): void => {\n const succ = () => {\n cb();\n };\n const error = (err: DOMException) => {\n cb(convertError(err, entry.fullPath, !entry.isDirectory));\n };\n if (isDirectoryEntry(entry)) {\n entry.removeRecursively(succ, error);\n } else {\n entry.remove(succ, error);\n }\n };\n // Loop through the entries and remove them, then call the callback\n // when they're all finished.\n asyncEach(entries!, deleteEntry, finished);\n }\n });\n }\n\n public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void {\n let semaphore: number = 2;\n let successCount: number = 0;\n const root: DirectoryEntry = this.fs.root;\n let currentPath: string = oldPath;\n const error = (err: DOMException): void => {\n if (--semaphore <= 0) {\n cb(convertError(err, currentPath, false));\n }\n };\n const success = (file: Entry): void => {\n if (++successCount === 2) {\n return cb(new ApiError(ErrorCode.EINVAL, \"Something was identified as both a file and a directory. This should never happen.\"));\n }\n\n // SPECIAL CASE: If newPath === oldPath, and the path exists, then\n // this operation trivially succeeds.\n if (oldPath === newPath) {\n return cb();\n }\n\n // Get the new parent directory.\n currentPath = path.dirname(newPath);\n root.getDirectory(currentPath, {}, (parentDir: DirectoryEntry): void => {\n currentPath = path.basename(newPath);\n file.moveTo(parentDir, currentPath, (entry: Entry): void => { cb(); }, (err: DOMException): void => {\n // SPECIAL CASE: If oldPath is a directory, and newPath is a\n // file, rename should delete the file and perform the move.\n if (file.isDirectory) {\n currentPath = newPath;\n // Unlink only works on files. Try to delete newPath.\n this.unlink(newPath, (e?): void => {\n if (e) {\n // newPath is probably a directory.\n error(err);\n } else {\n // Recur, now that newPath doesn't exist.\n this.rename(oldPath, newPath, cb);\n }\n });\n } else {\n error(err);\n }\n });\n }, error);\n };\n\n // We don't know if oldPath is a *file* or a *directory*, and there's no\n // way to stat items. So launch both requests, see which one succeeds.\n root.getFile(oldPath, {}, success, error);\n root.getDirectory(oldPath, {}, success, error);\n }\n\n public stat(path: string, isLstat: boolean, cb: BFSCallback): void {\n // Throw an error if the entry doesn't exist, because then there's nothing\n // to stat.\n const opts = {\n create: false\n };\n // Called when the path has been successfully loaded as a file.\n const loadAsFile = (entry: FileEntry): void => {\n const fileFromEntry = (file: File): void => {\n const stat = new Stats(FileType.FILE, file.size);\n cb(null, stat);\n };\n entry.file(fileFromEntry, failedToLoad);\n };\n // Called when the path has been successfully loaded as a directory.\n const loadAsDir = (dir: DirectoryEntry): void => {\n // Directory entry size can't be determined from the HTML5 FS API, and is\n // implementation-dependant anyway, so a dummy value is used.\n const size = 4096;\n const stat = new Stats(FileType.DIRECTORY, size);\n cb(null, stat);\n };\n // Called when the path couldn't be opened as a directory or a file.\n const failedToLoad = (err: DOMException): void => {\n cb(convertError(err, path, false /* Unknown / irrelevant */));\n };\n // Called when the path couldn't be opened as a file, but might still be a\n // directory.\n const failedToLoadAsFile = (): void => {\n this.fs.root.getDirectory(path, opts, loadAsDir, failedToLoad);\n };\n // No method currently exists to determine whether a path refers to a\n // directory or a file, so this implementation tries both and uses the first\n // one that succeeds.\n this.fs.root.getFile(path, opts, loadAsFile, failedToLoadAsFile);\n }\n\n public open(p: string, flags: FileFlag, mode: number, cb: BFSCallback): void {\n // XXX: err is a DOMError\n const error = (err: any): void => {\n if (err.name === 'InvalidModificationError' && flags.isExclusive()) {\n cb(ApiError.EEXIST(p));\n } else {\n cb(convertError(err, p, false));\n }\n };\n\n this.fs.root.getFile(p, {\n create: flags.pathNotExistsAction() === ActionType.CREATE_FILE,\n exclusive: flags.isExclusive()\n }, (entry: FileEntry): void => {\n // Try to fetch corresponding file.\n entry.file((file: File): void => {\n const reader = new FileReader();\n reader.onloadend = (event: Event): void => {\n const bfsFile = this._makeFile(p, entry, flags, file, reader.result);\n cb(null, bfsFile);\n };\n reader.onerror = (ev: Event) => {\n error(reader.error);\n };\n reader.readAsArrayBuffer(file);\n }, error);\n }, error);\n }\n\n public unlink(path: string, cb: BFSOneArgCallback): void {\n this._remove(path, cb, true);\n }\n\n public rmdir(path: string, cb: BFSOneArgCallback): void {\n // Check if directory is non-empty, first.\n this.readdir(path, (e, files?) => {\n if (e) {\n cb(e);\n } else if (files!.length > 0) {\n cb(ApiError.ENOTEMPTY(path));\n } else {\n this._remove(path, cb, false);\n }\n });\n }\n\n public mkdir(path: string, mode: number, cb: BFSOneArgCallback): void {\n // Create the directory, but throw an error if it already exists, as per\n // mkdir(1)\n const opts = {\n create: true,\n exclusive: true\n };\n const success = (dir: DirectoryEntry): void => {\n cb();\n };\n const error = (err: DOMException): void => {\n cb(convertError(err, path, true));\n };\n this.fs.root.getDirectory(path, opts, success, error);\n }\n\n /**\n * Map _readdir's list of `FileEntry`s to their names and return that.\n */\n public readdir(path: string, cb: BFSCallback): void {\n this._readdir(path, (e: ApiError, entries?: Entry[]): void => {\n if (entries) {\n const rv: string[] = [];\n for (const entry of entries) {\n rv.push(entry.name);\n }\n cb(null, rv);\n } else {\n return cb(e);\n }\n });\n }\n\n /**\n * Returns a BrowserFS object representing a File.\n */\n private _makeFile(path: string, entry: FileEntry, flag: FileFlag, stat: File, data: ArrayBuffer = new ArrayBuffer(0)): HTML5FSFile {\n const stats = new Stats(FileType.FILE, stat.size);\n const buffer = arrayBuffer2Buffer(data);\n return new HTML5FSFile(this, entry, path, flag, stats, buffer);\n }\n\n /**\n * Returns an array of `FileEntry`s. Used internally by empty and readdir.\n */\n private _readdir(path: string, cb: BFSCallback): void {\n const error = (err: DOMException): void => {\n cb(convertError(err, path, true));\n };\n // Grab the requested directory.\n this.fs.root.getDirectory(path, { create: false }, (dirEntry: DirectoryEntry) => {\n const reader = dirEntry.createReader();\n let entries: Entry[] = [];\n\n // Call the reader.readEntries() until no more results are returned.\n const readEntries = () => {\n reader.readEntries(((results) => {\n if (results.length) {\n entries = entries.concat(_toArray(results));\n readEntries();\n } else {\n cb(null, entries);\n }\n }), error);\n };\n readEntries();\n }, error);\n }\n\n /**\n * Delete a file or directory from the file system\n * isFile should reflect which call was made to remove the it (`unlink` or\n * `rmdir`). If this doesn't match what's actually at `path`, an error will be\n * returned\n */\n private _remove(path: string, cb: BFSOneArgCallback, isFile: boolean): void {\n const success = (entry: Entry): void => {\n const succ = () => {\n cb();\n };\n const err = (err: DOMException) => {\n cb(convertError(err, path, !isFile));\n };\n entry.remove(succ, err);\n };\n const error = (err: DOMException): void => {\n cb(convertError(err, path, !isFile));\n };\n // Deleting the entry, so don't create it\n const opts = {\n create: false\n };\n\n if (isFile) {\n this.fs.root.getFile(path, opts, success, error);\n } else {\n this.fs.root.getDirectory(path, opts, success, error);\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/HTML5FS.ts","import {BaseFileSystem, SynchronousFileSystem, BFSOneArgCallback, BFSCallback, BFSThreeArgCallback} from '../core/file_system';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport {default as Stats, FileType} from '../core/node_fs_stats';\nimport {File} from '../core/file';\nimport {FileFlag} from '../core/file_flag';\nimport * as path from 'path';\nimport Inode from '../generic/inode';\nimport PreloadFile from '../generic/preload_file';\nimport {emptyBuffer} from '../core/util';\n/**\n * @hidden\n */\nconst ROOT_NODE_ID: string = \"/\";\n/**\n * @hidden\n */\nlet emptyDirNode: Buffer | null = null;\n/**\n * Returns an empty directory node.\n * @hidden\n */\nfunction getEmptyDirNode(): Buffer {\n if (emptyDirNode) {\n return emptyDirNode;\n }\n return emptyDirNode = Buffer.from(\"{}\");\n}\n\n/**\n * Generates a random ID.\n * @hidden\n */\nfunction GenerateRandomID(): string {\n // From http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n const r = Math.random() * 16 | 0;\n const v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\n\n/**\n * Helper function. Checks if 'e' is defined. If so, it triggers the callback\n * with 'e' and returns false. Otherwise, returns true.\n * @hidden\n */\nfunction noError(e: ApiError | undefined | null, cb: (e: ApiError) => void): boolean {\n if (e) {\n cb(e);\n return false;\n }\n return true;\n}\n\n/**\n * Helper function. Checks if 'e' is defined. If so, it aborts the transaction,\n * triggers the callback with 'e', and returns false. Otherwise, returns true.\n * @hidden\n */\nfunction noErrorTx(e: ApiError | undefined | null, tx: AsyncKeyValueRWTransaction, cb: (e: ApiError) => void): boolean {\n if (e) {\n tx.abort(() => {\n cb(e);\n });\n return false;\n }\n return true;\n}\n\n/**\n * Represents a *synchronous* key-value store.\n */\nexport interface SyncKeyValueStore {\n /**\n * The name of the key-value store.\n */\n name(): string;\n /**\n * Empties the key-value store completely.\n */\n clear(): void;\n /**\n * Begins a new read-only transaction.\n */\n beginTransaction(type: \"readonly\"): SyncKeyValueROTransaction;\n /**\n * Begins a new read-write transaction.\n */\n beginTransaction(type: \"readwrite\"): SyncKeyValueRWTransaction;\n beginTransaction(type: string): SyncKeyValueROTransaction;\n}\n\n/**\n * A read-only transaction for a synchronous key value store.\n */\nexport interface SyncKeyValueROTransaction {\n /**\n * Retrieves the data at the given key. Throws an ApiError if an error occurs\n * or if the key does not exist.\n * @param key The key to look under for data.\n * @return The data stored under the key, or undefined if not present.\n */\n get(key: string): Buffer | undefined;\n}\n\n/**\n * A read-write transaction for a synchronous key value store.\n */\nexport interface SyncKeyValueRWTransaction extends SyncKeyValueROTransaction {\n /**\n * Adds the data to the store under the given key.\n * @param key The key to add the data under.\n * @param data The data to add to the store.\n * @param overwrite If 'true', overwrite any existing data. If 'false',\n * avoids storing the data if the key exists.\n * @return True if storage succeeded, false otherwise.\n */\n put(key: string, data: Buffer, overwrite: boolean): boolean;\n /**\n * Deletes the data at the given key.\n * @param key The key to delete from the store.\n */\n del(key: string): void;\n /**\n * Commits the transaction.\n */\n commit(): void;\n /**\n * Aborts and rolls back the transaction.\n */\n abort(): void;\n}\n\n/**\n * An interface for simple synchronous key-value stores that don't have special\n * support for transactions and such.\n */\nexport interface SimpleSyncStore {\n get(key: string): Buffer | undefined;\n put(key: string, data: Buffer, overwrite: boolean): boolean;\n del(key: string): void;\n}\n\n/**\n * A simple RW transaction for simple synchronous key-value stores.\n */\nexport class SimpleSyncRWTransaction implements SyncKeyValueRWTransaction {\n /**\n * Stores data in the keys we modify prior to modifying them.\n * Allows us to roll back commits.\n */\n private originalData: { [key: string]: Buffer | undefined } = {};\n /**\n * List of keys modified in this transaction, if any.\n */\n private modifiedKeys: string[] = [];\n\n constructor(private store: SimpleSyncStore) { }\n\n public get(key: string): Buffer | undefined {\n const val = this.store.get(key);\n this.stashOldValue(key, val);\n return val;\n }\n\n public put(key: string, data: Buffer, overwrite: boolean): boolean {\n this.markModified(key);\n return this.store.put(key, data, overwrite);\n }\n\n public del(key: string): void {\n this.markModified(key);\n this.store.del(key);\n }\n\n public commit(): void {/* NOP */}\n\n public abort(): void {\n // Rollback old values.\n for (const key of this.modifiedKeys) {\n const value = this.originalData[key];\n if (!value) {\n // Key didn't exist.\n this.store.del(key);\n } else {\n // Key existed. Store old value.\n this.store.put(key, value, true);\n }\n }\n }\n\n /**\n * Stashes given key value pair into `originalData` if it doesn't already\n * exist. Allows us to stash values the program is requesting anyway to\n * prevent needless `get` requests if the program modifies the data later\n * on during the transaction.\n */\n private stashOldValue(key: string, value: Buffer | undefined) {\n // Keep only the earliest value in the transaction.\n if (!this.originalData.hasOwnProperty(key)) {\n this.originalData[key] = value;\n }\n }\n\n /**\n * Marks the given key as modified, and stashes its value if it has not been\n * stashed already.\n */\n private markModified(key: string) {\n if (this.modifiedKeys.indexOf(key) === -1) {\n this.modifiedKeys.push(key);\n if (!this.originalData.hasOwnProperty(key)) {\n this.originalData[key] = this.store.get(key);\n }\n }\n }\n}\n\nexport interface SyncKeyValueFileSystemOptions {\n /**\n * The actual key-value store to read from/write to.\n */\n store: SyncKeyValueStore;\n /**\n * Should the file system support properties (mtime/atime/ctime/chmod/etc)?\n * Enabling this slightly increases the storage space per file, and adds\n * atime updates every time a file is accessed, mtime updates every time\n * a file is modified, and permission checks on every operation.\n *\n * Defaults to *false*.\n */\n // supportProps?: boolean;\n /**\n * Should the file system support links?\n */\n // supportLinks?: boolean;\n}\n\nexport class SyncKeyValueFile extends PreloadFile implements File {\n constructor(_fs: SyncKeyValueFileSystem, _path: string, _flag: FileFlag, _stat: Stats, contents?: Buffer) {\n super(_fs, _path, _flag, _stat, contents);\n }\n\n public syncSync(): void {\n if (this.isDirty()) {\n this._fs._syncSync(this.getPath(), this.getBuffer(), this.getStats());\n this.resetDirty();\n }\n }\n\n public closeSync(): void {\n this.syncSync();\n }\n}\n\n/**\n * A \"Synchronous key-value file system\". Stores data to/retrieves data from an\n * underlying key-value store.\n *\n * We use a unique ID for each node in the file system. The root node has a\n * fixed ID.\n * @todo Introduce Node ID caching.\n * @todo Check modes.\n */\nexport class SyncKeyValueFileSystem extends SynchronousFileSystem {\n public static isAvailable(): boolean { return true; }\n\n private store: SyncKeyValueStore;\n\n constructor(options: SyncKeyValueFileSystemOptions) {\n super();\n this.store = options.store;\n // INVARIANT: Ensure that the root exists.\n this.makeRootDirectory();\n }\n\n public getName(): string { return this.store.name(); }\n public isReadOnly(): boolean { return false; }\n public supportsSymlinks(): boolean { return false; }\n public supportsProps(): boolean { return false; }\n public supportsSynch(): boolean { return true; }\n\n /**\n * Delete all contents stored in the file system.\n */\n public empty(): void {\n this.store.clear();\n // INVARIANT: Root always exists.\n this.makeRootDirectory();\n }\n\n public renameSync(oldPath: string, newPath: string): void {\n const tx = this.store.beginTransaction('readwrite'),\n oldParent = path.dirname(oldPath), oldName = path.basename(oldPath),\n newParent = path.dirname(newPath), newName = path.basename(newPath),\n // Remove oldPath from parent's directory listing.\n oldDirNode = this.findINode(tx, oldParent),\n oldDirList = this.getDirListing(tx, oldParent, oldDirNode);\n\n if (!oldDirList[oldName]) {\n throw ApiError.ENOENT(oldPath);\n }\n const nodeId: string = oldDirList[oldName];\n delete oldDirList[oldName];\n\n // Invariant: Can't move a folder inside itself.\n // This funny little hack ensures that the check passes only if oldPath\n // is a subpath of newParent. We append '/' to avoid matching folders that\n // are a substring of the bottom-most folder in the path.\n if ((newParent + '/').indexOf(oldPath + '/') === 0) {\n throw new ApiError(ErrorCode.EBUSY, oldParent);\n }\n\n // Add newPath to parent's directory listing.\n let newDirNode: Inode, newDirList: typeof oldDirList;\n if (newParent === oldParent) {\n // Prevent us from re-grabbing the same directory listing, which still\n // contains oldName.\n newDirNode = oldDirNode;\n newDirList = oldDirList;\n } else {\n newDirNode = this.findINode(tx, newParent);\n newDirList = this.getDirListing(tx, newParent, newDirNode);\n }\n\n if (newDirList[newName]) {\n // If it's a file, delete it.\n const newNameNode = this.getINode(tx, newPath, newDirList[newName]);\n if (newNameNode.isFile()) {\n try {\n tx.del(newNameNode.id);\n tx.del(newDirList[newName]);\n } catch (e) {\n tx.abort();\n throw e;\n }\n } else {\n // If it's a directory, throw a permissions error.\n throw ApiError.EPERM(newPath);\n }\n }\n newDirList[newName] = nodeId;\n\n // Commit the two changed directory listings.\n try {\n tx.put(oldDirNode.id, Buffer.from(JSON.stringify(oldDirList)), true);\n tx.put(newDirNode.id, Buffer.from(JSON.stringify(newDirList)), true);\n } catch (e) {\n tx.abort();\n throw e;\n }\n\n tx.commit();\n }\n\n public statSync(p: string, isLstat: boolean): Stats {\n // Get the inode to the item, convert it into a Stats object.\n return this.findINode(this.store.beginTransaction('readonly'), p).toStats();\n }\n\n public createFileSync(p: string, flag: FileFlag, mode: number): File {\n const tx = this.store.beginTransaction('readwrite'),\n data = emptyBuffer(),\n newFile = this.commitNewFile(tx, p, FileType.FILE, mode, data);\n // Open the file.\n return new SyncKeyValueFile(this, p, flag, newFile.toStats(), data);\n }\n\n public openFileSync(p: string, flag: FileFlag): File {\n const tx = this.store.beginTransaction('readonly'),\n node = this.findINode(tx, p),\n data = tx.get(node.id);\n if (data === undefined) {\n throw ApiError.ENOENT(p);\n }\n return new SyncKeyValueFile(this, p, flag, node.toStats(), data);\n }\n\n public unlinkSync(p: string): void {\n this.removeEntry(p, false);\n }\n\n public rmdirSync(p: string): void {\n // Check first if directory is empty.\n if (this.readdirSync(p).length > 0) {\n throw ApiError.ENOTEMPTY(p);\n } else {\n this.removeEntry(p, true);\n }\n }\n\n public mkdirSync(p: string, mode: number): void {\n const tx = this.store.beginTransaction('readwrite'),\n data = Buffer.from('{}');\n this.commitNewFile(tx, p, FileType.DIRECTORY, mode, data);\n }\n\n public readdirSync(p: string): string[] {\n const tx = this.store.beginTransaction('readonly');\n return Object.keys(this.getDirListing(tx, p, this.findINode(tx, p)));\n }\n\n public _syncSync(p: string, data: Buffer, stats: Stats): void {\n // @todo Ensure mtime updates properly, and use that to determine if a data\n // update is required.\n const tx = this.store.beginTransaction('readwrite'),\n // We use the _findInode helper because we actually need the INode id.\n fileInodeId = this._findINode(tx, path.dirname(p), path.basename(p)),\n fileInode = this.getINode(tx, p, fileInodeId),\n inodeChanged = fileInode.update(stats);\n\n try {\n // Sync data.\n tx.put(fileInode.id, data, true);\n // Sync metadata.\n if (inodeChanged) {\n tx.put(fileInodeId, fileInode.toBuffer(), true);\n }\n } catch (e) {\n tx.abort();\n throw e;\n }\n tx.commit();\n }\n\n /**\n * Checks if the root directory exists. Creates it if it doesn't.\n */\n private makeRootDirectory() {\n const tx = this.store.beginTransaction('readwrite');\n if (tx.get(ROOT_NODE_ID) === undefined) {\n // Create new inode.\n const currTime = (new Date()).getTime(),\n // Mode 0666\n dirInode = new Inode(GenerateRandomID(), 4096, 511 | FileType.DIRECTORY, currTime, currTime, currTime);\n // If the root doesn't exist, the first random ID shouldn't exist,\n // either.\n tx.put(dirInode.id, getEmptyDirNode(), false);\n tx.put(ROOT_NODE_ID, dirInode.toBuffer(), false);\n tx.commit();\n }\n }\n\n /**\n * Helper function for findINode.\n * @param parent The parent directory of the file we are attempting to find.\n * @param filename The filename of the inode we are attempting to find, minus\n * the parent.\n * @return string The ID of the file's inode in the file system.\n */\n private _findINode(tx: SyncKeyValueROTransaction, parent: string, filename: string): string {\n const readDirectory = (inode: Inode): string => {\n // Get the root's directory listing.\n const dirList = this.getDirListing(tx, parent, inode);\n // Get the file's ID.\n if (dirList[filename]) {\n return dirList[filename];\n } else {\n throw ApiError.ENOENT(path.resolve(parent, filename));\n }\n };\n if (parent === '/') {\n if (filename === '') {\n // BASE CASE #1: Return the root's ID.\n return ROOT_NODE_ID;\n } else {\n // BASE CASE #2: Find the item in the root ndoe.\n return readDirectory(this.getINode(tx, parent, ROOT_NODE_ID));\n }\n } else {\n return readDirectory(this.getINode(tx, parent + path.sep + filename,\n this._findINode(tx, path.dirname(parent), path.basename(parent))));\n }\n }\n\n /**\n * Finds the Inode of the given path.\n * @param p The path to look up.\n * @return The Inode of the path p.\n * @todo memoize/cache\n */\n private findINode(tx: SyncKeyValueROTransaction, p: string): Inode {\n return this.getINode(tx, p, this._findINode(tx, path.dirname(p), path.basename(p)));\n }\n\n /**\n * Given the ID of a node, retrieves the corresponding Inode.\n * @param tx The transaction to use.\n * @param p The corresponding path to the file (used for error messages).\n * @param id The ID to look up.\n */\n private getINode(tx: SyncKeyValueROTransaction, p: string, id: string): Inode {\n const inode = tx.get(id);\n if (inode === undefined) {\n throw ApiError.ENOENT(p);\n }\n return Inode.fromBuffer(inode);\n }\n\n /**\n * Given the Inode of a directory, retrieves the corresponding directory\n * listing.\n */\n private getDirListing(tx: SyncKeyValueROTransaction, p: string, inode: Inode): { [fileName: string]: string } {\n if (!inode.isDirectory()) {\n throw ApiError.ENOTDIR(p);\n }\n const data = tx.get(inode.id);\n if (data === undefined) {\n throw ApiError.ENOENT(p);\n }\n return JSON.parse(data.toString());\n }\n\n /**\n * Creates a new node under a random ID. Retries 5 times before giving up in\n * the exceedingly unlikely chance that we try to reuse a random GUID.\n * @return The GUID that the data was stored under.\n */\n private addNewNode(tx: SyncKeyValueRWTransaction, data: Buffer): string {\n const retries = 0;\n let currId: string;\n while (retries < 5) {\n try {\n currId = GenerateRandomID();\n tx.put(currId, data, false);\n return currId;\n } catch (e) {\n // Ignore and reroll.\n }\n }\n throw new ApiError(ErrorCode.EIO, 'Unable to commit data to key-value store.');\n }\n\n /**\n * Commits a new file (well, a FILE or a DIRECTORY) to the file system with\n * the given mode.\n * Note: This will commit the transaction.\n * @param p The path to the new file.\n * @param type The type of the new file.\n * @param mode The mode to create the new file with.\n * @param data The data to store at the file's data node.\n * @return The Inode for the new file.\n */\n private commitNewFile(tx: SyncKeyValueRWTransaction, p: string, type: FileType, mode: number, data: Buffer): Inode {\n const parentDir = path.dirname(p),\n fname = path.basename(p),\n parentNode = this.findINode(tx, parentDir),\n dirListing = this.getDirListing(tx, parentDir, parentNode),\n currTime = (new Date()).getTime();\n\n // Invariant: The root always exists.\n // If we don't check this prior to taking steps below, we will create a\n // file with name '' in root should p == '/'.\n if (p === '/') {\n throw ApiError.EEXIST(p);\n }\n\n // Check if file already exists.\n if (dirListing[fname]) {\n throw ApiError.EEXIST(p);\n }\n\n let fileNode: Inode;\n try {\n // Commit data.\n const dataId = this.addNewNode(tx, data);\n fileNode = new Inode(dataId, data.length, mode | type, currTime, currTime, currTime);\n // Commit file node.\n const fileNodeId = this.addNewNode(tx, fileNode.toBuffer());\n // Update and commit parent directory listing.\n dirListing[fname] = fileNodeId;\n tx.put(parentNode.id, Buffer.from(JSON.stringify(dirListing)), true);\n } catch (e) {\n tx.abort();\n throw e;\n }\n tx.commit();\n return fileNode;\n }\n\n /**\n * Remove all traces of the given path from the file system.\n * @param p The path to remove from the file system.\n * @param isDir Does the path belong to a directory, or a file?\n * @todo Update mtime.\n */\n private removeEntry(p: string, isDir: boolean): void {\n const tx = this.store.beginTransaction('readwrite'),\n parent: string = path.dirname(p),\n parentNode = this.findINode(tx, parent),\n parentListing = this.getDirListing(tx, parent, parentNode),\n fileName: string = path.basename(p);\n\n if (!parentListing[fileName]) {\n throw ApiError.ENOENT(p);\n }\n\n // Remove from directory listing of parent.\n const fileNodeId = parentListing[fileName];\n delete parentListing[fileName];\n\n // Get file inode.\n const fileNode = this.getINode(tx, p, fileNodeId);\n if (!isDir && fileNode.isDirectory()) {\n throw ApiError.EISDIR(p);\n } else if (isDir && !fileNode.isDirectory()) {\n throw ApiError.ENOTDIR(p);\n }\n\n try {\n // Delete data.\n tx.del(fileNode.id);\n // Delete node.\n tx.del(fileNodeId);\n // Update directory listing.\n tx.put(parentNode.id, Buffer.from(JSON.stringify(parentListing)), true);\n } catch (e) {\n tx.abort();\n throw e;\n }\n // Success.\n tx.commit();\n }\n}\n\n/**\n * Represents an *asynchronous* key-value store.\n */\nexport interface AsyncKeyValueStore {\n /**\n * The name of the key-value store.\n */\n name(): string;\n /**\n * Empties the key-value store completely.\n */\n clear(cb: BFSOneArgCallback): void;\n /**\n * Begins a read-write transaction.\n */\n beginTransaction(type: 'readwrite'): AsyncKeyValueRWTransaction;\n /**\n * Begins a read-only transaction.\n */\n beginTransaction(type: 'readonly'): AsyncKeyValueROTransaction;\n beginTransaction(type: string): AsyncKeyValueROTransaction;\n}\n\n/**\n * Represents an asynchronous read-only transaction.\n */\nexport interface AsyncKeyValueROTransaction {\n /**\n * Retrieves the data at the given key.\n * @param key The key to look under for data.\n */\n get(key: string, cb: BFSCallback): void;\n}\n\n/**\n * Represents an asynchronous read-write transaction.\n */\nexport interface AsyncKeyValueRWTransaction extends AsyncKeyValueROTransaction {\n /**\n * Adds the data to the store under the given key. Overwrites any existing\n * data.\n * @param key The key to add the data under.\n * @param data The data to add to the store.\n * @param overwrite If 'true', overwrite any existing data. If 'false',\n * avoids writing the data if the key exists.\n * @param cb Triggered with an error and whether or not the value was\n * committed.\n */\n put(key: string, data: Buffer, overwrite: boolean, cb: (e: ApiError,\n committed?: boolean) => void): void;\n /**\n * Deletes the data at the given key.\n * @param key The key to delete from the store.\n */\n del(key: string, cb: BFSOneArgCallback): void;\n /**\n * Commits the transaction.\n */\n commit(cb: BFSOneArgCallback): void;\n /**\n * Aborts and rolls back the transaction.\n */\n abort(cb: BFSOneArgCallback): void;\n}\n\nexport class AsyncKeyValueFile extends PreloadFile implements File {\n constructor(_fs: AsyncKeyValueFileSystem, _path: string, _flag: FileFlag, _stat: Stats, contents?: Buffer) {\n super(_fs, _path, _flag, _stat, contents);\n }\n\n public sync(cb: BFSOneArgCallback): void {\n if (this.isDirty()) {\n this._fs._sync(this.getPath(), this.getBuffer(), this.getStats(), (e?: ApiError) => {\n if (!e) {\n this.resetDirty();\n }\n cb(e);\n });\n } else {\n cb();\n }\n }\n\n public close(cb: BFSOneArgCallback): void {\n this.sync(cb);\n }\n}\n\n/**\n * An \"Asynchronous key-value file system\". Stores data to/retrieves data from\n * an underlying asynchronous key-value store.\n */\nexport class AsyncKeyValueFileSystem extends BaseFileSystem {\n public static isAvailable(): boolean { return true; }\n\n protected store: AsyncKeyValueStore;\n\n /**\n * Initializes the file system. Typically called by subclasses' async\n * constructors.\n */\n public init(store: AsyncKeyValueStore, cb: BFSOneArgCallback) {\n this.store = store;\n // INVARIANT: Ensure that the root exists.\n this.makeRootDirectory(cb);\n }\n public getName(): string { return this.store.name(); }\n public isReadOnly(): boolean { return false; }\n public supportsSymlinks(): boolean { return false; }\n public supportsProps(): boolean { return false; }\n public supportsSynch(): boolean { return false; }\n\n /**\n * Delete all contents stored in the file system.\n */\n public empty(cb: BFSOneArgCallback): void {\n this.store.clear((e?) => {\n if (noError(e, cb)) {\n // INVARIANT: Root always exists.\n this.makeRootDirectory(cb);\n }\n });\n }\n\n public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void {\n const tx = this.store.beginTransaction('readwrite');\n const oldParent = path.dirname(oldPath), oldName = path.basename(oldPath);\n const newParent = path.dirname(newPath), newName = path.basename(newPath);\n const inodes: { [path: string]: Inode } = {};\n const lists: {\n [path: string]: { [file: string]: string }\n } = {};\n let errorOccurred: boolean = false;\n\n // Invariant: Can't move a folder inside itself.\n // This funny little hack ensures that the check passes only if oldPath\n // is a subpath of newParent. We append '/' to avoid matching folders that\n // are a substring of the bottom-most folder in the path.\n if ((newParent + '/').indexOf(oldPath + '/') === 0) {\n return cb(new ApiError(ErrorCode.EBUSY, oldParent));\n }\n\n /**\n * Responsible for Phase 2 of the rename operation: Modifying and\n * committing the directory listings. Called once we have successfully\n * retrieved both the old and new parent's inodes and listings.\n */\n const theOleSwitcharoo = (): void => {\n // Sanity check: Ensure both paths are present, and no error has occurred.\n if (errorOccurred || !lists.hasOwnProperty(oldParent) || !lists.hasOwnProperty(newParent)) {\n return;\n }\n const oldParentList = lists[oldParent], oldParentINode = inodes[oldParent],\n newParentList = lists[newParent], newParentINode = inodes[newParent];\n\n // Delete file from old parent.\n if (!oldParentList[oldName]) {\n cb(ApiError.ENOENT(oldPath));\n } else {\n const fileId = oldParentList[oldName];\n delete oldParentList[oldName];\n\n // Finishes off the renaming process by adding the file to the new\n // parent.\n const completeRename = () => {\n newParentList[newName] = fileId;\n // Commit old parent's list.\n tx.put(oldParentINode.id, Buffer.from(JSON.stringify(oldParentList)), true, (e: ApiError) => {\n if (noErrorTx(e, tx, cb)) {\n if (oldParent === newParent) {\n // DONE!\n tx.commit(cb);\n } else {\n // Commit new parent's list.\n tx.put(newParentINode.id, Buffer.from(JSON.stringify(newParentList)), true, (e: ApiError) => {\n if (noErrorTx(e, tx, cb)) {\n tx.commit(cb);\n }\n });\n }\n }\n });\n };\n\n if (newParentList[newName]) {\n // 'newPath' already exists. Check if it's a file or a directory, and\n // act accordingly.\n this.getINode(tx, newPath, newParentList[newName], (e: ApiError, inode?: Inode) => {\n if (noErrorTx(e, tx, cb)) {\n if (inode!.isFile()) {\n // Delete the file and continue.\n tx.del(inode!.id, (e?: ApiError) => {\n if (noErrorTx(e, tx, cb)) {\n tx.del(newParentList[newName], (e?: ApiError) => {\n if (noErrorTx(e, tx, cb)) {\n completeRename();\n }\n });\n }\n });\n } else {\n // Can't overwrite a directory using rename.\n tx.abort((e?) => {\n cb(ApiError.EPERM(newPath));\n });\n }\n }\n });\n } else {\n completeRename();\n }\n }\n };\n\n /**\n * Grabs a path's inode and directory listing, and shoves it into the\n * inodes and lists hashes.\n */\n const processInodeAndListings = (p: string): void => {\n this.findINodeAndDirListing(tx, p, (e?: ApiError | null, node?: Inode, dirList?: {[name: string]: string}): void => {\n if (e) {\n if (!errorOccurred) {\n errorOccurred = true;\n tx.abort(() => {\n cb(e);\n });\n }\n // If error has occurred already, just stop here.\n } else {\n inodes[p] = node!;\n lists[p] = dirList!;\n theOleSwitcharoo();\n }\n });\n };\n\n processInodeAndListings(oldParent);\n if (oldParent !== newParent) {\n processInodeAndListings(newParent);\n }\n }\n\n public stat(p: string, isLstat: boolean, cb: BFSCallback): void {\n const tx = this.store.beginTransaction('readonly');\n this.findINode(tx, p, (e: ApiError, inode?: Inode): void => {\n if (noError(e, cb)) {\n cb(null, inode!.toStats());\n }\n });\n }\n\n public createFile(p: string, flag: FileFlag, mode: number, cb: BFSCallback): void {\n const tx = this.store.beginTransaction('readwrite'),\n data = emptyBuffer();\n\n this.commitNewFile(tx, p, FileType.FILE, mode, data, (e: ApiError, newFile?: Inode): void => {\n if (noError(e, cb)) {\n cb(null, new AsyncKeyValueFile(this, p, flag, newFile!.toStats(), data));\n }\n });\n }\n\n public openFile(p: string, flag: FileFlag, cb: BFSCallback): void {\n const tx = this.store.beginTransaction('readonly');\n // Step 1: Grab the file's inode.\n this.findINode(tx, p, (e: ApiError, inode?: Inode) => {\n if (noError(e, cb)) {\n // Step 2: Grab the file's data.\n tx.get(inode!.id, (e: ApiError, data?: Buffer): void => {\n if (noError(e, cb)) {\n if (data === undefined) {\n cb(ApiError.ENOENT(p));\n } else {\n cb(null, new AsyncKeyValueFile(this, p, flag, inode!.toStats(), data));\n }\n }\n });\n }\n });\n }\n\n public unlink(p: string, cb: BFSOneArgCallback): void {\n this.removeEntry(p, false, cb);\n }\n\n public rmdir(p: string, cb: BFSOneArgCallback): void {\n // Check first if directory is empty.\n this.readdir(p, (err, files?) => {\n if (err) {\n cb(err);\n } else if (files!.length > 0) {\n cb(ApiError.ENOTEMPTY(p));\n } else {\n this.removeEntry(p, true, cb);\n }\n });\n }\n\n public mkdir(p: string, mode: number, cb: BFSOneArgCallback): void {\n const tx = this.store.beginTransaction('readwrite'),\n data = Buffer.from('{}');\n this.commitNewFile(tx, p, FileType.DIRECTORY, mode, data, cb);\n }\n\n public readdir(p: string, cb: BFSCallback): void {\n const tx = this.store.beginTransaction('readonly');\n this.findINode(tx, p, (e: ApiError, inode?: Inode) => {\n if (noError(e, cb)) {\n this.getDirListing(tx, p, inode!, (e: ApiError, dirListing?: {[name: string]: string}) => {\n if (noError(e, cb)) {\n cb(null, Object.keys(dirListing));\n }\n });\n }\n });\n }\n\n public _sync(p: string, data: Buffer, stats: Stats, cb: BFSOneArgCallback): void {\n // @todo Ensure mtime updates properly, and use that to determine if a data\n // update is required.\n const tx = this.store.beginTransaction('readwrite');\n // Step 1: Get the file node's ID.\n this._findINode(tx, path.dirname(p), path.basename(p), (e: ApiError, fileInodeId?: string): void => {\n if (noErrorTx(e, tx, cb)) {\n // Step 2: Get the file inode.\n this.getINode(tx, p, fileInodeId!, (e: ApiError, fileInode?: Inode): void => {\n if (noErrorTx(e, tx, cb)) {\n const inodeChanged: boolean = fileInode!.update(stats);\n // Step 3: Sync the data.\n tx.put(fileInode!.id, data, true, (e: ApiError): void => {\n if (noErrorTx(e, tx, cb)) {\n // Step 4: Sync the metadata (if it changed)!\n if (inodeChanged) {\n tx.put(fileInodeId!, fileInode!.toBuffer(), true, (e: ApiError): void => {\n if (noErrorTx(e, tx, cb)) {\n tx.commit(cb);\n }\n });\n } else {\n // No need to sync metadata; return.\n tx.commit(cb);\n }\n }\n });\n }\n });\n }\n });\n }\n\n /**\n * Checks if the root directory exists. Creates it if it doesn't.\n */\n private makeRootDirectory(cb: BFSOneArgCallback) {\n const tx = this.store.beginTransaction('readwrite');\n tx.get(ROOT_NODE_ID, (e: ApiError, data?: Buffer) => {\n if (e || data === undefined) {\n // Create new inode.\n const currTime = (new Date()).getTime(),\n // Mode 0666\n dirInode = new Inode(GenerateRandomID(), 4096, 511 | FileType.DIRECTORY, currTime, currTime, currTime);\n // If the root doesn't exist, the first random ID shouldn't exist,\n // either.\n tx.put(dirInode.id, getEmptyDirNode(), false, (e?: ApiError) => {\n if (noErrorTx(e, tx, cb)) {\n tx.put(ROOT_NODE_ID, dirInode.toBuffer(), false, (e?: ApiError) => {\n if (e) {\n tx.abort(() => { cb(e); });\n } else {\n tx.commit(cb);\n }\n });\n }\n });\n } else {\n // We're good.\n tx.commit(cb);\n }\n });\n }\n\n /**\n * Helper function for findINode.\n * @param parent The parent directory of the file we are attempting to find.\n * @param filename The filename of the inode we are attempting to find, minus\n * the parent.\n * @param cb Passed an error or the ID of the file's inode in the file system.\n */\n private _findINode(tx: AsyncKeyValueROTransaction, parent: string, filename: string, cb: BFSCallback): void {\n const handleDirectoryListings = (e?: ApiError | null, inode?: Inode, dirList?: {[name: string]: string}): void => {\n if (e) {\n cb(e);\n } else if (dirList![filename]) {\n cb(null, dirList![filename]);\n } else {\n cb(ApiError.ENOENT(path.resolve(parent, filename)));\n }\n };\n\n if (parent === '/') {\n if (filename === '') {\n // BASE CASE #1: Return the root's ID.\n cb(null, ROOT_NODE_ID);\n } else {\n // BASE CASE #2: Find the item in the root node.\n this.getINode(tx, parent, ROOT_NODE_ID, (e: ApiError, inode?: Inode): void => {\n if (noError(e, cb)) {\n this.getDirListing(tx, parent, inode!, (e: ApiError, dirList?: {[name: string]: string}): void => {\n // handle_directory_listings will handle e for us.\n handleDirectoryListings(e, inode, dirList);\n });\n }\n });\n }\n } else {\n // Get the parent directory's INode, and find the file in its directory\n // listing.\n this.findINodeAndDirListing(tx, parent, handleDirectoryListings);\n }\n }\n\n /**\n * Finds the Inode of the given path.\n * @param p The path to look up.\n * @param cb Passed an error or the Inode of the path p.\n * @todo memoize/cache\n */\n private findINode(tx: AsyncKeyValueROTransaction, p: string, cb: BFSCallback): void {\n this._findINode(tx, path.dirname(p), path.basename(p), (e: ApiError, id?: string): void => {\n if (noError(e, cb)) {\n this.getINode(tx, p, id!, cb);\n }\n });\n }\n\n /**\n * Given the ID of a node, retrieves the corresponding Inode.\n * @param tx The transaction to use.\n * @param p The corresponding path to the file (used for error messages).\n * @param id The ID to look up.\n * @param cb Passed an error or the inode under the given id.\n */\n private getINode(tx: AsyncKeyValueROTransaction, p: string, id: string, cb: BFSCallback): void {\n tx.get(id, (e: ApiError, data?: Buffer): void => {\n if (noError(e, cb)) {\n if (data === undefined) {\n cb(ApiError.ENOENT(p));\n } else {\n cb(null, Inode.fromBuffer(data));\n }\n }\n });\n }\n\n /**\n * Given the Inode of a directory, retrieves the corresponding directory\n * listing.\n */\n private getDirListing(tx: AsyncKeyValueROTransaction, p: string, inode: Inode, cb: BFSCallback<{ [fileName: string]: string }>): void {\n if (!inode.isDirectory()) {\n cb(ApiError.ENOTDIR(p));\n } else {\n tx.get(inode.id, (e: ApiError, data?: Buffer): void => {\n if (noError(e, cb)) {\n try {\n cb(null, JSON.parse(data!.toString()));\n } catch (e) {\n // Occurs when data is undefined, or corresponds to something other\n // than a directory listing. The latter should never occur unless\n // the file system is corrupted.\n cb(ApiError.ENOENT(p));\n }\n }\n });\n }\n }\n\n /**\n * Given a path to a directory, retrieves the corresponding INode and\n * directory listing.\n */\n private findINodeAndDirListing(tx: AsyncKeyValueROTransaction, p: string, cb: BFSThreeArgCallback): void {\n this.findINode(tx, p, (e: ApiError, inode?: Inode): void => {\n if (noError(e, cb)) {\n this.getDirListing(tx, p, inode!, (e, listing?) => {\n if (noError(e, cb)) {\n cb(null, inode!, listing!);\n }\n });\n }\n });\n }\n\n /**\n * Adds a new node under a random ID. Retries 5 times before giving up in\n * the exceedingly unlikely chance that we try to reuse a random GUID.\n * @param cb Passed an error or the GUID that the data was stored under.\n */\n private addNewNode(tx: AsyncKeyValueRWTransaction, data: Buffer, cb: BFSCallback): void {\n let retries = 0, currId: string;\n const reroll = () => {\n if (++retries === 5) {\n // Max retries hit. Return with an error.\n cb(new ApiError(ErrorCode.EIO, 'Unable to commit data to key-value store.'));\n } else {\n // Try again.\n currId = GenerateRandomID();\n tx.put(currId, data, false, (e: ApiError, committed?: boolean) => {\n if (e || !committed) {\n reroll();\n } else {\n // Successfully stored under 'currId'.\n cb(null, currId);\n }\n });\n }\n };\n reroll();\n }\n\n /**\n * Commits a new file (well, a FILE or a DIRECTORY) to the file system with\n * the given mode.\n * Note: This will commit the transaction.\n * @param p The path to the new file.\n * @param type The type of the new file.\n * @param mode The mode to create the new file with.\n * @param data The data to store at the file's data node.\n * @param cb Passed an error or the Inode for the new file.\n */\n private commitNewFile(tx: AsyncKeyValueRWTransaction, p: string, type: FileType, mode: number, data: Buffer, cb: BFSCallback): void {\n const parentDir = path.dirname(p),\n fname = path.basename(p),\n currTime = (new Date()).getTime();\n\n // Invariant: The root always exists.\n // If we don't check this prior to taking steps below, we will create a\n // file with name '' in root should p == '/'.\n if (p === '/') {\n return cb(ApiError.EEXIST(p));\n }\n\n // Let's build a pyramid of code!\n\n // Step 1: Get the parent directory's inode and directory listing\n this.findINodeAndDirListing(tx, parentDir, (e?: ApiError | null, parentNode?: Inode, dirListing?: {[name: string]: string}): void => {\n if (noErrorTx(e, tx, cb)) {\n if (dirListing![fname]) {\n // File already exists.\n tx.abort(() => {\n cb(ApiError.EEXIST(p));\n });\n } else {\n // Step 2: Commit data to store.\n this.addNewNode(tx, data, (e: ApiError, dataId?: string): void => {\n if (noErrorTx(e, tx, cb)) {\n // Step 3: Commit the file's inode to the store.\n const fileInode = new Inode(dataId!, data.length, mode | type, currTime, currTime, currTime);\n this.addNewNode(tx, fileInode.toBuffer(), (e: ApiError, fileInodeId?: string): void => {\n if (noErrorTx(e, tx, cb)) {\n // Step 4: Update parent directory's listing.\n dirListing![fname] = fileInodeId!;\n tx.put(parentNode!.id, Buffer.from(JSON.stringify(dirListing)), true, (e: ApiError): void => {\n if (noErrorTx(e, tx, cb)) {\n // Step 5: Commit and return the new inode.\n tx.commit((e?: ApiError): void => {\n if (noErrorTx(e, tx, cb)) {\n cb(null, fileInode);\n }\n });\n }\n });\n }\n });\n }\n });\n }\n }\n });\n }\n\n /**\n * Remove all traces of the given path from the file system.\n * @param p The path to remove from the file system.\n * @param isDir Does the path belong to a directory, or a file?\n * @todo Update mtime.\n */\n private removeEntry(p: string, isDir: boolean, cb: BFSOneArgCallback): void {\n const tx = this.store.beginTransaction('readwrite'),\n parent: string = path.dirname(p), fileName: string = path.basename(p);\n // Step 1: Get parent directory's node and directory listing.\n this.findINodeAndDirListing(tx, parent, (e?: ApiError | null, parentNode?: Inode, parentListing?: {[name: string]: string}): void => {\n if (noErrorTx(e, tx, cb)) {\n if (!parentListing![fileName]) {\n tx.abort(() => {\n cb(ApiError.ENOENT(p));\n });\n } else {\n // Remove from directory listing of parent.\n const fileNodeId = parentListing![fileName];\n delete parentListing![fileName];\n // Step 2: Get file inode.\n this.getINode(tx, p, fileNodeId, (e: ApiError, fileNode?: Inode): void => {\n if (noErrorTx(e, tx, cb)) {\n if (!isDir && fileNode!.isDirectory()) {\n tx.abort(() => {\n cb(ApiError.EISDIR(p));\n });\n } else if (isDir && !fileNode!.isDirectory()) {\n tx.abort(() => {\n cb(ApiError.ENOTDIR(p));\n });\n } else {\n // Step 3: Delete data.\n tx.del(fileNode!.id, (e?: ApiError): void => {\n if (noErrorTx(e, tx, cb)) {\n // Step 4: Delete node.\n tx.del(fileNodeId, (e?: ApiError): void => {\n if (noErrorTx(e, tx, cb)) {\n // Step 5: Update directory listing.\n tx.put(parentNode!.id, Buffer.from(JSON.stringify(parentListing)), true, (e: ApiError): void => {\n if (noErrorTx(e, tx, cb)) {\n tx.commit(cb);\n }\n });\n }\n });\n }\n });\n }\n }\n });\n }\n }\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/generic/key_value_filesystem.ts","import {BFSOneArgCallback, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {AsyncKeyValueROTransaction, AsyncKeyValueRWTransaction, AsyncKeyValueStore, AsyncKeyValueFileSystem} from '../generic/key_value_filesystem';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport global from '../core/global';\nimport {arrayBuffer2Buffer, buffer2ArrayBuffer, deprecationMessage} from '../core/util';\n/**\n * Get the indexedDB constructor for the current browser.\n * @hidden\n */\nconst indexedDB: IDBFactory = global.indexedDB ||\n ( global).mozIndexedDB ||\n ( global).webkitIndexedDB ||\n global.msIndexedDB;\n\n/**\n * Converts a DOMException or a DOMError from an IndexedDB event into a\n * standardized BrowserFS API error.\n * @hidden\n */\nfunction convertError(e: {name: string}, message: string = e.toString()): ApiError {\n switch (e.name) {\n case \"NotFoundError\":\n return new ApiError(ErrorCode.ENOENT, message);\n case \"QuotaExceededError\":\n return new ApiError(ErrorCode.ENOSPC, message);\n default:\n // The rest do not seem to map cleanly to standard error codes.\n return new ApiError(ErrorCode.EIO, message);\n }\n}\n\n/**\n * Produces a new onerror handler for IDB. Our errors are always fatal, so we\n * handle them generically: Call the user-supplied callback with a translated\n * version of the error, and let the error bubble up.\n * @hidden\n */\nfunction onErrorHandler(cb: (e: ApiError) => void, code: ErrorCode = ErrorCode.EIO, message: string | null = null): (e?: any) => void {\n return function(e?: any): void {\n // Prevent the error from canceling the transaction.\n e.preventDefault();\n cb(new ApiError(code, message !== null ? message : undefined));\n };\n}\n\n/**\n * @hidden\n */\nexport class IndexedDBROTransaction implements AsyncKeyValueROTransaction {\n constructor(public tx: IDBTransaction, public store: IDBObjectStore) { }\n\n public get(key: string, cb: BFSCallback): void {\n try {\n const r: IDBRequest = this.store.get(key);\n r.onerror = onErrorHandler(cb);\n r.onsuccess = (event) => {\n // IDB returns the value 'undefined' when you try to get keys that\n // don't exist. The caller expects this behavior.\n const result: any = ( event.target).result;\n if (result === undefined) {\n cb(null, result);\n } else {\n // IDB data is stored as an ArrayBuffer\n cb(null, arrayBuffer2Buffer(result));\n }\n };\n } catch (e) {\n cb(convertError(e));\n }\n }\n}\n\n/**\n * @hidden\n */\nexport class IndexedDBRWTransaction extends IndexedDBROTransaction implements AsyncKeyValueRWTransaction, AsyncKeyValueROTransaction {\n constructor(tx: IDBTransaction, store: IDBObjectStore) {\n super(tx, store);\n }\n\n public put(key: string, data: Buffer, overwrite: boolean, cb: BFSCallback): void {\n try {\n const arraybuffer = buffer2ArrayBuffer(data);\n let r: IDBRequest;\n if (overwrite) {\n r = this.store.put(arraybuffer, key);\n } else {\n // 'add' will never overwrite an existing key.\n r = this.store.add(arraybuffer, key);\n }\n // XXX: NEED TO RETURN FALSE WHEN ADD HAS A KEY CONFLICT. NO ERROR.\n r.onerror = onErrorHandler(cb);\n r.onsuccess = (event) => {\n cb(null, true);\n };\n } catch (e) {\n cb(convertError(e));\n }\n }\n\n public del(key: string, cb: BFSOneArgCallback): void {\n try {\n // NOTE: IE8 has a bug with identifiers named 'delete' unless used as a string\n // like this.\n // http://stackoverflow.com/a/26479152\n const r: IDBRequest = this.store['delete'](key);\n r.onerror = onErrorHandler(cb);\n r.onsuccess = (event) => {\n cb();\n };\n } catch (e) {\n cb(convertError(e));\n }\n }\n\n public commit(cb: BFSOneArgCallback): void {\n // Return to the event loop to commit the transaction.\n setTimeout(cb, 0);\n }\n\n public abort(cb: BFSOneArgCallback): void {\n let _e: ApiError | null = null;\n try {\n this.tx.abort();\n } catch (e) {\n _e = convertError(e);\n } finally {\n cb(_e);\n }\n }\n}\n\nexport class IndexedDBStore implements AsyncKeyValueStore {\n private db: IDBDatabase;\n\n constructor(cb: BFSCallback, private storeName: string = 'browserfs') {\n const openReq: IDBOpenDBRequest = indexedDB.open(this.storeName, 1);\n\n openReq.onupgradeneeded = (event) => {\n const db: IDBDatabase = ( event.target).result;\n // Huh. This should never happen; we're at version 1. Why does another\n // database exist?\n if (db.objectStoreNames.contains(this.storeName)) {\n db.deleteObjectStore(this.storeName);\n }\n db.createObjectStore(this.storeName);\n };\n\n openReq.onsuccess = (event) => {\n this.db = ( event.target).result;\n cb(null, this);\n };\n\n openReq.onerror = onErrorHandler(cb, ErrorCode.EACCES);\n }\n\n public name(): string {\n return IndexedDBFileSystem.Name + \" - \" + this.storeName;\n }\n\n public clear(cb: BFSOneArgCallback): void {\n try {\n const tx = this.db.transaction(this.storeName, 'readwrite'),\n objectStore = tx.objectStore(this.storeName),\n r: IDBRequest = objectStore.clear();\n r.onsuccess = (event) => {\n // Use setTimeout to commit transaction.\n setTimeout(cb, 0);\n };\n r.onerror = onErrorHandler(cb);\n } catch (e) {\n cb(convertError(e));\n }\n }\n\n public beginTransaction(type: 'readonly'): AsyncKeyValueROTransaction;\n public beginTransaction(type: 'readwrite'): AsyncKeyValueRWTransaction;\n public beginTransaction(type: string = 'readonly'): AsyncKeyValueROTransaction {\n const tx = this.db.transaction(this.storeName, type),\n objectStore = tx.objectStore(this.storeName);\n if (type === 'readwrite') {\n return new IndexedDBRWTransaction(tx, objectStore);\n } else if (type === 'readonly') {\n return new IndexedDBROTransaction(tx, objectStore);\n } else {\n throw new ApiError(ErrorCode.EINVAL, 'Invalid transaction type.');\n }\n }\n}\n\n/**\n * Configuration options for the IndexedDB file system.\n */\nexport interface IndexedDBFileSystemOptions {\n // The name of this file system. You can have multiple IndexedDB file systems operating\n // at once, but each must have a different name.\n storeName?: string;\n}\n\n/**\n * A file system that uses the IndexedDB key value file system.\n */\nexport default class IndexedDBFileSystem extends AsyncKeyValueFileSystem {\n public static readonly Name = \"IndexedDB\";\n\n public static readonly Options: FileSystemOptions = {\n storeName: {\n type: \"string\",\n optional: true,\n description: \"The name of this file system. You can have multiple IndexedDB file systems operating at once, but each must have a different name.\"\n }\n };\n\n /**\n * Constructs an IndexedDB file system with the given options.\n */\n public static Create(opts: IndexedDBFileSystemOptions, cb: BFSCallback): void {\n // tslint:disable-next-line:no-unused-new\n new IndexedDBFileSystem(cb, opts.storeName, false);\n // tslint:enable-next-line:no-unused-new\n }\n public static isAvailable(): boolean {\n // In Safari's private browsing mode, indexedDB.open returns NULL.\n // In Firefox, it throws an exception.\n // In Chrome, it \"just works\", and clears the database when you leave the page.\n // Untested: Opera, IE.\n try {\n return typeof indexedDB !== 'undefined' && null !== indexedDB.open(\"__browserfs_test__\");\n } catch (e) {\n return false;\n }\n }\n /**\n * **Deprecated. Use IndexedDB.Create() method instead.**\n *\n * Constructs an IndexedDB file system.\n * @param cb Called once the database is instantiated and ready for use.\n * Passes an error if there was an issue instantiating the database.\n * @param storeName The name of this file system. You can have\n * multiple IndexedDB file systems operating at once, but each must have\n * a different name.\n */\n constructor(cb: BFSCallback, storeName?: string, deprecateMsg: boolean = true) {\n super();\n this.store = new IndexedDBStore((e): void => {\n if (e) {\n cb(e);\n } else {\n this.init(this.store, (e?) => {\n cb(e, this);\n });\n }\n }, storeName);\n deprecationMessage(deprecateMsg, IndexedDBFileSystem.Name, {storeName: storeName});\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/IndexedDB.ts","import {FileSystem, BaseFileSystem, BFSOneArgCallback, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport InMemoryFileSystem from './InMemory';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport fs from '../core/node_fs';\nimport * as path from 'path';\nimport {mkdirpSync} from '../core/util';\n\n/**\n * Configuration options for the MountableFileSystem backend.\n */\nexport interface MountableFileSystemOptions {\n // Locations of mount points. Can be empty.\n [mountPoint: string]: FileSystem;\n}\n\n/**\n * The MountableFileSystem allows you to mount multiple backend types or\n * multiple instantiations of the same backend into a single file system tree.\n * The file systems do not need to know about each other; all interactions are\n * automatically facilitated through this interface.\n *\n * For example, if a file system is mounted at /mnt/blah, and a request came in\n * for /mnt/blah/foo.txt, the file system would see a request for /foo.txt.\n *\n * You can mount file systems when you configure the file system:\n * ```javascript\n * BrowserFS.configure({\n * fs: \"MountableFileSystem\",\n * options: {\n * '/data': { fs: 'XmlHttpRequest', options: { index: \"http://mysite.com/files/index.json\" } },\n * '/home': { fs: 'LocalStorage' }\n * }\n * }, function(e) {\n *\n * });\n * ```\n *\n * For advanced users, you can also mount file systems *after* MFS is constructed:\n * ```javascript\n * BrowserFS.FileSystem.XmlHttpRequest.Create({\n * index: \"http://mysite.com/files/index.json\"\n * }, function(e, xhrfs) {\n * BrowserFS.FileSystem.MountableFileSystem.Create({\n * '/data': xhrfs\n * }, function(e, mfs) {\n * BrowserFS.initialize(mfs);\n *\n * // Added after-the-fact...\n * BrowserFS.FileSystem.LocalStorage.Create(function(e, lsfs) {\n * mfs.mount('/home', lsfs);\n * });\n * });\n * });\n * ```\n *\n * Since MountableFileSystem simply proxies requests to mounted file systems, it supports all of the operations that the mounted file systems support.\n *\n * With no mounted file systems, `MountableFileSystem` acts as a simple `InMemory` filesystem.\n */\nexport default class MountableFileSystem extends BaseFileSystem implements FileSystem {\n public static readonly Name = \"MountableFileSystem\";\n\n public static readonly Options: FileSystemOptions = {};\n\n /**\n * Creates a MountableFileSystem instance with the given options.\n */\n public static Create(opts: MountableFileSystemOptions, cb: BFSCallback): void {\n const fs = new MountableFileSystem();\n Object.keys(opts).forEach((mountPoint) => {\n fs.mount(mountPoint, opts[mountPoint]);\n });\n cb(null, fs);\n }\n public static isAvailable(): boolean {\n return true;\n }\n\n private mntMap: {[path: string]: FileSystem};\n // Contains the list of mount points in mntMap, sorted by string length in decreasing order.\n // Ensures that we scan the most specific mount points for a match first, which lets us\n // nest mount points.\n private mountList: string[] = [];\n private rootFs: FileSystem;\n\n /**\n * Creates a new, empty MountableFileSystem.\n */\n constructor() {\n super();\n this.mntMap = {};\n // The InMemory file system serves purely to provide directory listings for\n // mounted file systems.\n this.rootFs = new InMemoryFileSystem();\n }\n\n /**\n * Mounts the file system at the given mount point.\n */\n public mount(mountPoint: string, fs: FileSystem): void {\n if (mountPoint[0] !== '/') {\n mountPoint = `/${mountPoint}`;\n }\n mountPoint = path.resolve(mountPoint);\n if (this.mntMap[mountPoint]) {\n throw new ApiError(ErrorCode.EINVAL, \"Mount point \" + mountPoint + \" is already taken.\");\n }\n mkdirpSync(mountPoint, 0x1ff, this.rootFs);\n this.mntMap[mountPoint] = fs;\n this.mountList.push(mountPoint);\n this.mountList = this.mountList.sort((a, b) => b.length - a.length);\n }\n\n public umount(mountPoint: string): void {\n if (mountPoint[0] !== '/') {\n mountPoint = `/${mountPoint}`;\n }\n mountPoint = path.resolve(mountPoint);\n if (!this.mntMap[mountPoint]) {\n throw new ApiError(ErrorCode.EINVAL, \"Mount point \" + mountPoint + \" is already unmounted.\");\n }\n delete this.mntMap[mountPoint];\n this.mountList.splice(this.mountList.indexOf(mountPoint), 1);\n\n while (mountPoint !== '/') {\n if (this.rootFs.readdirSync(mountPoint).length === 0) {\n this.rootFs.rmdirSync(mountPoint);\n mountPoint = path.dirname(mountPoint);\n } else {\n break;\n }\n }\n }\n\n /**\n * Returns the file system that the path points to.\n */\n public _getFs(path: string): {fs: FileSystem; path: string} {\n const mountList = this.mountList, len = mountList.length;\n for (let i = 0; i < len; i++) {\n const mountPoint = mountList[i];\n // We know path is normalized, so it is a substring of the mount point.\n if (mountPoint.length <= path.length && path.indexOf(mountPoint) === 0) {\n path = path.substr(mountPoint.length > 1 ? mountPoint.length : 0);\n if (path === '') {\n path = '/';\n }\n return {fs: this.mntMap[mountPoint], path: path};\n }\n }\n // Query our root file system.\n return {fs: this.rootFs, path: path};\n }\n\n // Global information methods\n\n public getName(): string {\n return MountableFileSystem.Name;\n }\n\n public diskSpace(path: string, cb: (total: number, free: number) => void): void {\n cb(0, 0);\n }\n\n public isReadOnly(): boolean {\n return false;\n }\n\n public supportsLinks(): boolean {\n // I'm not ready for cross-FS links yet.\n return false;\n }\n\n public supportsProps(): boolean {\n return false;\n }\n\n public supportsSynch(): boolean {\n return true;\n }\n\n /**\n * Fixes up error messages so they mention the mounted file location relative\n * to the MFS root, not to the particular FS's root.\n * Mutates the input error, and returns it.\n */\n public standardizeError(err: ApiError, path: string, realPath: string): ApiError {\n const index = err.message.indexOf(path);\n if (index !== -1) {\n err.message = err.message.substr(0, index) + realPath + err.message.substr(index + path.length);\n err.path = realPath;\n }\n return err;\n }\n\n // The following methods involve multiple file systems, and thus have custom\n // logic.\n // Note that we go through the Node API to use its robust default argument\n // processing.\n\n public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void {\n // Scenario 1: old and new are on same FS.\n const fs1rv = this._getFs(oldPath);\n const fs2rv = this._getFs(newPath);\n if (fs1rv.fs === fs2rv.fs) {\n return fs1rv.fs.rename(fs1rv.path, fs2rv.path, (e?: ApiError) => {\n if (e) {\n this.standardizeError(this.standardizeError(e, fs1rv.path, oldPath), fs2rv.path, newPath);\n }\n cb(e);\n });\n }\n\n // Scenario 2: Different file systems.\n // Read old file, write new file, delete old file.\n return fs.readFile(oldPath, function(err: ApiError, data?: any) {\n if (err) {\n return cb(err);\n }\n fs.writeFile(newPath, data, function(err: ApiError) {\n if (err) {\n return cb(err);\n }\n fs.unlink(oldPath, cb);\n });\n });\n }\n\n public renameSync(oldPath: string, newPath: string): void {\n // Scenario 1: old and new are on same FS.\n const fs1rv = this._getFs(oldPath);\n const fs2rv = this._getFs(newPath);\n if (fs1rv.fs === fs2rv.fs) {\n try {\n return fs1rv.fs.renameSync(fs1rv.path, fs2rv.path);\n } catch (e) {\n this.standardizeError(this.standardizeError(e, fs1rv.path, oldPath), fs2rv.path, newPath);\n throw e;\n }\n }\n // Scenario 2: Different file systems.\n const data = fs.readFileSync(oldPath);\n fs.writeFileSync(newPath, data);\n return fs.unlinkSync(oldPath);\n }\n\n public readdirSync(p: string): string[] {\n const fsInfo = this._getFs(p);\n\n // If null, rootfs did not have the directory\n // (or the target FS is the root fs).\n let rv: string[] | null = null;\n // Mount points are all defined in the root FS.\n // Ensure that we list those, too.\n if (fsInfo.fs !== this.rootFs) {\n try {\n rv = this.rootFs.readdirSync(p);\n } catch (e) {\n // Ignore.\n }\n }\n\n try {\n const rv2 = fsInfo.fs.readdirSync(fsInfo.path);\n if (rv === null) {\n return rv2;\n } else {\n // Filter out duplicates.\n return rv2.concat(rv.filter((val) => rv2.indexOf(val) === -1));\n }\n } catch (e) {\n if (rv === null) {\n throw this.standardizeError(e, fsInfo.path, p);\n } else {\n // The root FS had something.\n return rv;\n }\n }\n }\n\n public readdir(p: string, cb: BFSCallback): void {\n const fsInfo = this._getFs(p);\n fsInfo.fs.readdir(fsInfo.path, (err, files) => {\n if (fsInfo.fs !== this.rootFs) {\n try {\n const rv = this.rootFs.readdirSync(p);\n if (files) {\n // Filter out duplicates.\n files = files.concat(rv.filter((val) => files!.indexOf(val) === -1));\n } else {\n files = rv;\n }\n } catch (e) {\n // Root FS and target FS did not have directory.\n if (err) {\n return cb(this.standardizeError(err, fsInfo.path, p));\n }\n }\n } else if (err) {\n // Root FS and target FS are the same, and did not have directory.\n return cb(this.standardizeError(err, fsInfo.path, p));\n }\n\n cb(null, files);\n });\n }\n\n public rmdirSync(p: string): void {\n const fsInfo = this._getFs(p);\n if (this._containsMountPt(p)) {\n throw ApiError.ENOTEMPTY(p);\n } else {\n try {\n fsInfo.fs.rmdirSync(fsInfo.path);\n } catch (e) {\n throw this.standardizeError(e, fsInfo.path, p);\n }\n }\n }\n\n public rmdir(p: string, cb: BFSOneArgCallback): void {\n const fsInfo = this._getFs(p);\n if (this._containsMountPt(p)) {\n cb(ApiError.ENOTEMPTY(p));\n } else {\n fsInfo.fs.rmdir(fsInfo.path, (err?) => {\n cb(err ? this.standardizeError(err, fsInfo.path, p) : null);\n });\n }\n }\n\n /**\n * Returns true if the given path contains a mount point.\n */\n private _containsMountPt(p: string): boolean {\n const mountPoints = this.mountList, len = mountPoints.length;\n for (let i = 0; i < len; i++) {\n const pt = mountPoints[i];\n if (pt.length >= p.length && pt.slice(0, p.length) === p) {\n return true;\n }\n }\n return false;\n }\n}\n\n/**\n * Tricky: Define all of the functions that merely forward arguments to the\n * relevant file system, or return/throw an error.\n * Take advantage of the fact that the *first* argument is always the path, and\n * the *last* is the callback function (if async).\n * @todo Can use numArgs to make proxying more efficient.\n * @hidden\n */\nfunction defineFcn(name: string, isSync: boolean, numArgs: number): (...args: any[]) => any {\n if (isSync) {\n return function(this: MountableFileSystem, ...args: any[]) {\n const path = args[0];\n const rv = this._getFs(path);\n args[0] = rv.path;\n try {\n return ( rv.fs)[name].apply(rv.fs, args);\n } catch (e) {\n this.standardizeError(e, rv.path, path);\n throw e;\n }\n };\n } else {\n return function(this: MountableFileSystem, ...args: any[]) {\n const path = args[0];\n const rv = this._getFs(path);\n args[0] = rv.path;\n if (typeof args[args.length - 1] === 'function') {\n const cb = args[args.length - 1];\n args[args.length - 1] = (...args: any[]) => {\n if (args.length > 0 && args[0] instanceof ApiError) {\n this.standardizeError(args[0], rv.path, path);\n }\n cb.apply(null, args);\n };\n }\n return ( rv.fs)[name].apply(rv.fs, args);\n };\n }\n}\n\n/**\n * @hidden\n */\nconst fsCmdMap = [\n // 1 arg functions\n ['exists', 'unlink', 'readlink'],\n // 2 arg functions\n ['stat', 'mkdir', 'realpath', 'truncate'],\n // 3 arg functions\n ['open', 'readFile', 'chmod', 'utimes'],\n // 4 arg functions\n ['chown'],\n // 5 arg functions\n ['writeFile', 'appendFile']];\n\nfor (let i = 0; i < fsCmdMap.length; i++) {\n const cmds = fsCmdMap[i];\n for (const fnName of cmds) {\n ( MountableFileSystem.prototype)[fnName] = defineFcn(fnName, false, i + 1);\n ( MountableFileSystem.prototype)[fnName + 'Sync'] = defineFcn(fnName + 'Sync', true, i + 1);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/MountableFileSystem.ts","import {FileSystem, BaseFileSystem, BFSOneArgCallback, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport {FileFlag, ActionType} from '../core/file_flag';\nimport {File} from '../core/file';\nimport {deprecationMessage} from '../core/util';\nimport {default as Stats} from '../core/node_fs_stats';\nimport PreloadFile from '../generic/preload_file';\nimport LockedFS from '../generic/locked_fs';\nimport * as path from 'path';\n/**\n * @hidden\n */\nconst deletionLogPath = '/.deletedFiles.log';\n\n/**\n * Given a read-only mode, makes it writable.\n * @hidden\n */\nfunction makeModeWritable(mode: number): number {\n return 0o222 | mode;\n}\n\n/**\n * @hidden\n */\nfunction getFlag(f: string): FileFlag {\n return FileFlag.getFileFlag(f);\n}\n\n/**\n * Overlays a RO file to make it writable.\n */\nclass OverlayFile extends PreloadFile implements File {\n constructor(fs: UnlockedOverlayFS, path: string, flag: FileFlag, stats: Stats, data: Buffer) {\n super(fs, path, flag, stats, data);\n }\n\n public sync(cb: BFSOneArgCallback): void {\n if (!this.isDirty()) {\n cb(null);\n return;\n }\n\n this._fs._syncAsync(this, (err: ApiError) => {\n this.resetDirty();\n cb(err);\n });\n }\n\n public syncSync(): void {\n if (this.isDirty()) {\n this._fs._syncSync(this);\n this.resetDirty();\n }\n }\n\n public close(cb: BFSOneArgCallback): void {\n this.sync(cb);\n }\n\n public closeSync(): void {\n this.syncSync();\n }\n}\n\n/**\n * *INTERNAL, DO NOT USE DIRECTLY!*\n *\n * Core OverlayFS class that contains no locking whatsoever. We wrap these objects\n * in a LockedFS to prevent races.\n */\nexport class UnlockedOverlayFS extends BaseFileSystem implements FileSystem {\n public static isAvailable(): boolean {\n return true;\n }\n\n private _writable: FileSystem;\n private _readable: FileSystem;\n private _isInitialized: boolean = false;\n private _initializeCallbacks: (BFSOneArgCallback)[] = [];\n private _deletedFiles: {[path: string]: boolean} = {};\n private _deleteLog: string = '';\n // If 'true', we have scheduled a delete log update.\n private _deleteLogUpdatePending: boolean = false;\n // If 'true', a delete log update is needed after the scheduled delete log\n // update finishes.\n private _deleteLogUpdateNeeded: boolean = false;\n // If there was an error updating the delete log...\n private _deleteLogError: ApiError | null = null;\n\n constructor(writable: FileSystem, readable: FileSystem) {\n super();\n this._writable = writable;\n this._readable = readable;\n if (this._writable.isReadOnly()) {\n throw new ApiError(ErrorCode.EINVAL, \"Writable file system must be writable.\");\n }\n }\n\n public getOverlayedFileSystems(): { readable: FileSystem; writable: FileSystem; } {\n return {\n readable: this._readable,\n writable: this._writable\n };\n }\n\n public _syncAsync(file: PreloadFile, cb: BFSOneArgCallback): void {\n this.createParentDirectoriesAsync(file.getPath(), (err?: ApiError) => {\n if (err) {\n return cb(err);\n }\n this._writable.writeFile(file.getPath(), file.getBuffer(), null, getFlag('w'), file.getStats().mode, cb);\n });\n }\n\n public _syncSync(file: PreloadFile): void {\n this.createParentDirectories(file.getPath());\n this._writable.writeFileSync(file.getPath(), file.getBuffer(), null, getFlag('w'), file.getStats().mode);\n }\n\n public getName() {\n return OverlayFS.Name;\n }\n\n /**\n * Called once to load up metadata stored on the writable file system.\n */\n public initialize(cb: BFSOneArgCallback): void {\n const callbackArray = this._initializeCallbacks;\n\n const end = (e?: ApiError): void => {\n this._isInitialized = !e;\n this._initializeCallbacks = [];\n callbackArray.forEach(((cb) => cb(e)));\n };\n\n // if we're already initialized, immediately invoke the callback\n if (this._isInitialized) {\n return cb();\n }\n\n callbackArray.push(cb);\n // The first call to initialize initializes, the rest wait for it to complete.\n if (callbackArray.length !== 1) {\n return;\n }\n\n // Read deletion log, process into metadata.\n this._writable.readFile(deletionLogPath, 'utf8', getFlag('r'), (err: ApiError, data?: string) => {\n if (err) {\n // ENOENT === Newly-instantiated file system, and thus empty log.\n if (err.errno !== ErrorCode.ENOENT) {\n return end(err);\n }\n } else {\n this._deleteLog = data!;\n }\n this._reparseDeletionLog();\n end();\n });\n }\n\n public isReadOnly(): boolean { return false; }\n public supportsSynch(): boolean { return this._readable.supportsSynch() && this._writable.supportsSynch(); }\n public supportsLinks(): boolean { return false; }\n public supportsProps(): boolean { return this._readable.supportsProps() && this._writable.supportsProps(); }\n\n public getDeletionLog(): string {\n return this._deleteLog;\n }\n\n public restoreDeletionLog(log: string): void {\n this._deleteLog = log;\n this._reparseDeletionLog();\n this.updateLog('');\n }\n\n public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void {\n if (!this.checkInitAsync(cb) || this.checkPathAsync(oldPath, cb) || this.checkPathAsync(newPath, cb)) {\n return;\n }\n\n if (oldPath === deletionLogPath || newPath === deletionLogPath) {\n return cb(ApiError.EPERM('Cannot rename deletion log.'));\n }\n\n // nothing to do if paths match\n if (oldPath === newPath) {\n return cb();\n }\n\n this.stat(oldPath, false, (oldErr: ApiError, oldStats?: Stats) => {\n if (oldErr) {\n return cb(oldErr);\n }\n\n return this.stat(newPath, false, (newErr: ApiError, newStats?: Stats) => {\n const self = this;\n // precondition: both oldPath and newPath exist and are dirs.\n // decreases: |files|\n // Need to move *every file/folder* currently stored on\n // readable to its new location on writable.\n function copyDirContents(files: string[]): void {\n const file = files.shift();\n if (!file) {\n return cb();\n }\n\n const oldFile = path.resolve(oldPath, file);\n const newFile = path.resolve(newPath, file);\n\n // Recursion! Should work for any nested files / folders.\n self.rename(oldFile, newFile, (err?: ApiError) => {\n if (err) {\n return cb(err);\n }\n copyDirContents(files);\n });\n }\n\n let mode = 0o777;\n\n // from linux's rename(2) manpage: oldpath can specify a\n // directory. In this case, newpath must either not exist, or\n // it must specify an empty directory.\n if (oldStats!.isDirectory()) {\n if (newErr) {\n if (newErr.errno !== ErrorCode.ENOENT) {\n return cb(newErr);\n }\n\n return this._writable.exists(oldPath, (exists: boolean) => {\n // simple case - both old and new are on the writable layer\n if (exists) {\n return this._writable.rename(oldPath, newPath, cb);\n }\n\n this._writable.mkdir(newPath, mode, (mkdirErr?: ApiError) => {\n if (mkdirErr) {\n return cb(mkdirErr);\n }\n\n this._readable.readdir(oldPath, (err: ApiError, files?: string[]) => {\n if (err) {\n return cb();\n }\n copyDirContents(files!);\n });\n });\n });\n }\n\n mode = newStats!.mode;\n if (!newStats!.isDirectory()) {\n return cb(ApiError.ENOTDIR(newPath));\n }\n\n this.readdir(newPath, (readdirErr: ApiError, files?: string[]) => {\n if (files && files.length) {\n return cb(ApiError.ENOTEMPTY(newPath));\n }\n\n this._readable.readdir(oldPath, (err: ApiError, files?: string[]) => {\n if (err) {\n return cb();\n }\n copyDirContents(files!);\n });\n });\n }\n\n if (newStats && newStats.isDirectory()) {\n return cb(ApiError.EISDIR(newPath));\n }\n\n this.readFile(oldPath, null, getFlag('r'), (err: ApiError, data?: any) => {\n if (err) {\n return cb(err);\n }\n\n return this.writeFile(newPath, data, null, getFlag('w'), oldStats!.mode, (err: ApiError) => {\n if (err) {\n return cb(err);\n }\n return this.unlink(oldPath, cb);\n });\n });\n });\n });\n }\n\n public renameSync(oldPath: string, newPath: string): void {\n this.checkInitialized();\n this.checkPath(oldPath);\n this.checkPath(newPath);\n if (oldPath === deletionLogPath || newPath === deletionLogPath) {\n throw ApiError.EPERM('Cannot rename deletion log.');\n }\n // Write newPath using oldPath's contents, delete oldPath.\n const oldStats = this.statSync(oldPath, false);\n if (oldStats.isDirectory()) {\n // Optimization: Don't bother moving if old === new.\n if (oldPath === newPath) {\n return;\n }\n\n let mode = 0o777;\n if (this.existsSync(newPath)) {\n const stats = this.statSync(newPath, false);\n mode = stats.mode;\n if (stats.isDirectory()) {\n if (this.readdirSync(newPath).length > 0) {\n throw ApiError.ENOTEMPTY(newPath);\n }\n } else {\n throw ApiError.ENOTDIR(newPath);\n }\n }\n\n // Take care of writable first. Move any files there, or create an empty directory\n // if it doesn't exist.\n if (this._writable.existsSync(oldPath)) {\n this._writable.renameSync(oldPath, newPath);\n } else if (!this._writable.existsSync(newPath)) {\n this._writable.mkdirSync(newPath, mode);\n }\n\n // Need to move *every file/folder* currently stored on readable to its new location\n // on writable.\n if (this._readable.existsSync(oldPath)) {\n this._readable.readdirSync(oldPath).forEach((name) => {\n // Recursion! Should work for any nested files / folders.\n this.renameSync(path.resolve(oldPath, name), path.resolve(newPath, name));\n });\n }\n } else {\n if (this.existsSync(newPath) && this.statSync(newPath, false).isDirectory()) {\n throw ApiError.EISDIR(newPath);\n }\n\n this.writeFileSync(newPath,\n this.readFileSync(oldPath, null, getFlag('r')), null, getFlag('w'), oldStats.mode);\n }\n\n if (oldPath !== newPath && this.existsSync(oldPath)) {\n this.unlinkSync(oldPath);\n }\n }\n\n public stat(p: string, isLstat: boolean, cb: BFSCallback): void {\n if (!this.checkInitAsync(cb)) {\n return;\n }\n this._writable.stat(p, isLstat, (err: ApiError, stat?: Stats) => {\n if (err && err.errno === ErrorCode.ENOENT) {\n if (this._deletedFiles[p]) {\n cb(ApiError.ENOENT(p));\n }\n this._readable.stat(p, isLstat, (err: ApiError, stat?: Stats) => {\n if (stat) {\n // Make the oldStat's mode writable. Preserve the topmost\n // part of the mode, which specifies if it is a file or a\n // directory.\n stat = stat.clone();\n stat.mode = makeModeWritable(stat.mode);\n }\n cb(err, stat);\n });\n } else {\n cb(err, stat);\n }\n });\n }\n\n public statSync(p: string, isLstat: boolean): Stats {\n this.checkInitialized();\n try {\n return this._writable.statSync(p, isLstat);\n } catch (e) {\n if (this._deletedFiles[p]) {\n throw ApiError.ENOENT(p);\n }\n const oldStat = this._readable.statSync(p, isLstat).clone();\n // Make the oldStat's mode writable. Preserve the topmost part of the\n // mode, which specifies if it is a file or a directory.\n oldStat.mode = makeModeWritable(oldStat.mode);\n return oldStat;\n }\n }\n\n public open(p: string, flag: FileFlag, mode: number, cb: BFSCallback): void {\n if (!this.checkInitAsync(cb) || this.checkPathAsync(p, cb)) {\n return;\n }\n this.stat(p, false, (err: ApiError, stats?: Stats) => {\n if (stats) {\n switch (flag.pathExistsAction()) {\n case ActionType.TRUNCATE_FILE:\n return this.createParentDirectoriesAsync(p, (err?: ApiError) => {\n if (err) {\n return cb(err);\n }\n this._writable.open(p, flag, mode, cb);\n });\n case ActionType.NOP:\n return this._writable.exists(p, (exists: boolean) => {\n if (exists) {\n this._writable.open(p, flag, mode, cb);\n } else {\n // at this point we know the stats object we got is from\n // the readable FS.\n stats = stats!.clone();\n stats.mode = mode;\n this._readable.readFile(p, null, getFlag('r'), (readFileErr: ApiError, data?: any) => {\n if (readFileErr) {\n return cb(readFileErr);\n }\n if (stats!.size === -1) {\n stats!.size = data.length;\n }\n const f = new OverlayFile(this, p, flag, stats!, data);\n cb(null, f);\n });\n }\n });\n default:\n return cb(ApiError.EEXIST(p));\n }\n } else {\n switch (flag.pathNotExistsAction()) {\n case ActionType.CREATE_FILE:\n return this.createParentDirectoriesAsync(p, (err?: ApiError) => {\n if (err) {\n return cb(err);\n }\n return this._writable.open(p, flag, mode, cb);\n });\n default:\n return cb(ApiError.ENOENT(p));\n }\n }\n });\n }\n\n public openSync(p: string, flag: FileFlag, mode: number): File {\n this.checkInitialized();\n this.checkPath(p);\n if (p === deletionLogPath) {\n throw ApiError.EPERM('Cannot open deletion log.');\n }\n if (this.existsSync(p)) {\n switch (flag.pathExistsAction()) {\n case ActionType.TRUNCATE_FILE:\n this.createParentDirectories(p);\n return this._writable.openSync(p, flag, mode);\n case ActionType.NOP:\n if (this._writable.existsSync(p)) {\n return this._writable.openSync(p, flag, mode);\n } else {\n // Create an OverlayFile.\n const buf = this._readable.readFileSync(p, null, getFlag('r'));\n const stats = this._readable.statSync(p, false).clone();\n stats.mode = mode;\n return new OverlayFile(this, p, flag, stats, buf);\n }\n default:\n throw ApiError.EEXIST(p);\n }\n } else {\n switch (flag.pathNotExistsAction()) {\n case ActionType.CREATE_FILE:\n this.createParentDirectories(p);\n return this._writable.openSync(p, flag, mode);\n default:\n throw ApiError.ENOENT(p);\n }\n }\n }\n\n public unlink(p: string, cb: BFSOneArgCallback): void {\n if (!this.checkInitAsync(cb) || this.checkPathAsync(p, cb)) {\n return;\n }\n this.exists(p, (exists: boolean) => {\n if (!exists) {\n return cb(ApiError.ENOENT(p));\n }\n\n this._writable.exists(p, (writableExists: boolean) => {\n if (writableExists) {\n return this._writable.unlink(p, (err: ApiError) => {\n if (err) {\n return cb(err);\n }\n\n this.exists(p, (readableExists: boolean) => {\n if (readableExists) {\n this.deletePath(p);\n }\n cb(null);\n });\n });\n } else {\n // if this only exists on the readable FS, add it to the\n // delete map.\n this.deletePath(p);\n cb(null);\n }\n });\n });\n }\n\n public unlinkSync(p: string): void {\n this.checkInitialized();\n this.checkPath(p);\n if (this.existsSync(p)) {\n if (this._writable.existsSync(p)) {\n this._writable.unlinkSync(p);\n }\n\n // if it still exists add to the delete log\n if (this.existsSync(p)) {\n this.deletePath(p);\n }\n } else {\n throw ApiError.ENOENT(p);\n }\n }\n\n public rmdir(p: string, cb: BFSOneArgCallback): void {\n if (!this.checkInitAsync(cb)) {\n return;\n }\n\n const rmdirLower = (): void => {\n this.readdir(p, (err: ApiError, files: string[]): void => {\n if (err) {\n return cb(err);\n }\n\n if (files.length) {\n return cb(ApiError.ENOTEMPTY(p));\n }\n\n this.deletePath(p);\n cb(null);\n });\n };\n\n this.exists(p, (exists: boolean) => {\n if (!exists) {\n return cb(ApiError.ENOENT(p));\n }\n\n this._writable.exists(p, (writableExists: boolean) => {\n if (writableExists) {\n this._writable.rmdir(p, (err: ApiError) => {\n if (err) {\n return cb(err);\n }\n\n this._readable.exists(p, (readableExists: boolean) => {\n if (readableExists) {\n rmdirLower();\n } else {\n cb();\n }\n });\n });\n } else {\n rmdirLower();\n }\n });\n });\n }\n\n public rmdirSync(p: string): void {\n this.checkInitialized();\n if (this.existsSync(p)) {\n if (this._writable.existsSync(p)) {\n this._writable.rmdirSync(p);\n }\n if (this.existsSync(p)) {\n // Check if directory is empty.\n if (this.readdirSync(p).length > 0) {\n throw ApiError.ENOTEMPTY(p);\n } else {\n this.deletePath(p);\n }\n }\n } else {\n throw ApiError.ENOENT(p);\n }\n }\n\n public mkdir(p: string, mode: number, cb: BFSCallback): void {\n if (!this.checkInitAsync(cb)) {\n return;\n }\n this.exists(p, (exists: boolean) => {\n if (exists) {\n return cb(ApiError.EEXIST(p));\n }\n\n // The below will throw should any of the parent directories\n // fail to exist on _writable.\n this.createParentDirectoriesAsync(p, (err: ApiError) => {\n if (err) {\n return cb(err);\n }\n this._writable.mkdir(p, mode, cb);\n });\n });\n }\n\n public mkdirSync(p: string, mode: number): void {\n this.checkInitialized();\n if (this.existsSync(p)) {\n throw ApiError.EEXIST(p);\n } else {\n // The below will throw should any of the parent directories fail to exist\n // on _writable.\n this.createParentDirectories(p);\n this._writable.mkdirSync(p, mode);\n }\n }\n\n public readdir(p: string, cb: BFSCallback): void {\n if (!this.checkInitAsync(cb)) {\n return;\n }\n this.stat(p, false, (err: ApiError, dirStats?: Stats) => {\n if (err) {\n return cb(err);\n }\n\n if (!dirStats!.isDirectory()) {\n return cb(ApiError.ENOTDIR(p));\n }\n\n this._writable.readdir(p, (err: ApiError, wFiles: string[]) => {\n if (err && err.code !== 'ENOENT') {\n return cb(err);\n } else if (err || !wFiles) {\n wFiles = [];\n }\n\n this._readable.readdir(p, (err: ApiError, rFiles: string[]) => {\n // if the directory doesn't exist on the lower FS set rFiles\n // here to simplify the following code.\n if (err || !rFiles) {\n rFiles = [];\n }\n\n // Readdir in both, check delete log on read-only file system's files, merge, return.\n const seenMap: {[name: string]: boolean} = {};\n const filtered: string[] = wFiles.concat(rFiles.filter((fPath: string) =>\n !this._deletedFiles[`${p}/${fPath}`]\n )).filter((fPath: string) => {\n // Remove duplicates.\n const result = !seenMap[fPath];\n seenMap[fPath] = true;\n return result;\n });\n cb(null, filtered);\n });\n });\n });\n }\n\n public readdirSync(p: string): string[] {\n this.checkInitialized();\n const dirStats = this.statSync(p, false);\n if (!dirStats.isDirectory()) {\n throw ApiError.ENOTDIR(p);\n }\n\n // Readdir in both, check delete log on RO file system's listing, merge, return.\n let contents: string[] = [];\n try {\n contents = contents.concat(this._writable.readdirSync(p));\n } catch (e) {\n // NOP.\n }\n try {\n contents = contents.concat(this._readable.readdirSync(p).filter((fPath: string) =>\n !this._deletedFiles[`${p}/${fPath}`]\n ));\n } catch (e) {\n // NOP.\n }\n const seenMap: {[name: string]: boolean} = {};\n return contents.filter((fileP: string) => {\n const result = !seenMap[fileP];\n seenMap[fileP] = true;\n return result;\n });\n }\n\n public exists(p: string, cb: (exists: boolean) => void): void {\n // Cannot pass an error back to callback, so throw an exception instead\n // if not initialized.\n this.checkInitialized();\n this._writable.exists(p, (existsWritable: boolean) => {\n if (existsWritable) {\n return cb(true);\n }\n\n this._readable.exists(p, (existsReadable: boolean) => {\n cb(existsReadable && this._deletedFiles[p] !== true);\n });\n });\n }\n\n public existsSync(p: string): boolean {\n this.checkInitialized();\n return this._writable.existsSync(p) || (this._readable.existsSync(p) && this._deletedFiles[p] !== true);\n }\n\n public chmod(p: string, isLchmod: boolean, mode: number, cb: BFSOneArgCallback): void {\n if (!this.checkInitAsync(cb)) {\n return;\n }\n this.operateOnWritableAsync(p, (err?: ApiError) => {\n if (err) {\n return cb(err);\n } else {\n this._writable.chmod(p, isLchmod, mode, cb);\n }\n });\n }\n\n public chmodSync(p: string, isLchmod: boolean, mode: number): void {\n this.checkInitialized();\n this.operateOnWritable(p, () => {\n this._writable.chmodSync(p, isLchmod, mode);\n });\n }\n\n public chown(p: string, isLchmod: boolean, uid: number, gid: number, cb: BFSOneArgCallback): void {\n if (!this.checkInitAsync(cb)) {\n return;\n }\n this.operateOnWritableAsync(p, (err?: ApiError) => {\n if (err) {\n return cb(err);\n } else {\n this._writable.chown(p, isLchmod, uid, gid, cb);\n }\n });\n }\n\n public chownSync(p: string, isLchown: boolean, uid: number, gid: number): void {\n this.checkInitialized();\n this.operateOnWritable(p, () => {\n this._writable.chownSync(p, isLchown, uid, gid);\n });\n }\n\n public utimes(p: string, atime: Date, mtime: Date, cb: BFSOneArgCallback): void {\n if (!this.checkInitAsync(cb)) {\n return;\n }\n this.operateOnWritableAsync(p, (err?: ApiError) => {\n if (err) {\n return cb(err);\n } else {\n this._writable.utimes(p, atime, mtime, cb);\n }\n });\n }\n\n public utimesSync(p: string, atime: Date, mtime: Date): void {\n this.checkInitialized();\n this.operateOnWritable(p, () => {\n this._writable.utimesSync(p, atime, mtime);\n });\n }\n\n private deletePath(p: string): void {\n this._deletedFiles[p] = true;\n this.updateLog(`d${p}\\n`);\n }\n\n private updateLog(addition: string) {\n this._deleteLog += addition;\n if (this._deleteLogUpdatePending) {\n this._deleteLogUpdateNeeded = true;\n } else {\n this._deleteLogUpdatePending = true;\n this._writable.writeFile(deletionLogPath, this._deleteLog, 'utf8', FileFlag.getFileFlag('w'), 0o644, (e) => {\n this._deleteLogUpdatePending = false;\n if (e) {\n this._deleteLogError = e;\n } else if (this._deleteLogUpdateNeeded) {\n this._deleteLogUpdateNeeded = false;\n this.updateLog('');\n }\n });\n }\n }\n\n private _reparseDeletionLog(): void {\n this._deletedFiles = {};\n this._deleteLog.split('\\n').forEach((path: string) => {\n // If the log entry begins w/ 'd', it's a deletion.\n this._deletedFiles[path.slice(1)] = path.slice(0, 1) === 'd';\n });\n }\n\n private checkInitialized(): void {\n if (!this._isInitialized) {\n throw new ApiError(ErrorCode.EPERM, \"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.\");\n } else if (this._deleteLogError !== null) {\n const e = this._deleteLogError;\n this._deleteLogError = null;\n throw e;\n }\n }\n\n private checkInitAsync(cb: BFSOneArgCallback): boolean {\n if (!this._isInitialized) {\n cb(new ApiError(ErrorCode.EPERM, \"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.\"));\n return false;\n } else if (this._deleteLogError !== null) {\n const e = this._deleteLogError;\n this._deleteLogError = null;\n cb(e);\n return false;\n }\n return true;\n }\n\n private checkPath(p: string): void {\n if (p === deletionLogPath) {\n throw ApiError.EPERM(p);\n }\n }\n\n private checkPathAsync(p: string, cb: BFSOneArgCallback): boolean {\n if (p === deletionLogPath) {\n cb(ApiError.EPERM(p));\n return true;\n }\n return false;\n }\n\n private createParentDirectoriesAsync(p: string, cb: BFSOneArgCallback): void {\n let parent = path.dirname(p);\n const toCreate: string[] = [];\n const self = this;\n\n this._writable.stat(parent, false, statDone);\n function statDone(err: ApiError, stat?: Stats): void {\n if (err) {\n toCreate.push(parent);\n parent = path.dirname(parent);\n self._writable.stat(parent, false, statDone);\n } else {\n createParents();\n }\n }\n\n function createParents(): void {\n if (!toCreate.length) {\n return cb();\n }\n\n const dir = toCreate.pop();\n self._readable.stat(dir!, false, (err: ApiError, stats?: Stats) => {\n // stop if we couldn't read the dir\n if (!stats) {\n return cb();\n }\n\n self._writable.mkdir(dir!, stats.mode, (err?: ApiError) => {\n if (err) {\n return cb(err);\n }\n createParents();\n });\n });\n }\n }\n\n /**\n * With the given path, create the needed parent directories on the writable storage\n * should they not exist. Use modes from the read-only storage.\n */\n private createParentDirectories(p: string): void {\n let parent = path.dirname(p), toCreate: string[] = [];\n while (!this._writable.existsSync(parent)) {\n toCreate.push(parent);\n parent = path.dirname(parent);\n }\n toCreate = toCreate.reverse();\n\n toCreate.forEach((p: string) => {\n this._writable.mkdirSync(p, this.statSync(p, false).mode);\n });\n }\n\n /**\n * Helper function:\n * - Ensures p is on writable before proceeding. Throws an error if it doesn't exist.\n * - Calls f to perform operation on writable.\n */\n private operateOnWritable(p: string, f: () => void): void {\n if (this.existsSync(p)) {\n if (!this._writable.existsSync(p)) {\n // File is on readable storage. Copy to writable storage before\n // changing its mode.\n this.copyToWritable(p);\n }\n f();\n } else {\n throw ApiError.ENOENT(p);\n }\n }\n\n private operateOnWritableAsync(p: string, cb: BFSOneArgCallback): void {\n this.exists(p, (exists: boolean) => {\n if (!exists) {\n return cb(ApiError.ENOENT(p));\n }\n\n this._writable.exists(p, (existsWritable: boolean) => {\n if (existsWritable) {\n cb();\n } else {\n return this.copyToWritableAsync(p, cb);\n }\n });\n });\n }\n\n /**\n * Copy from readable to writable storage.\n * PRECONDITION: File does not exist on writable storage.\n */\n private copyToWritable(p: string): void {\n const pStats = this.statSync(p, false);\n if (pStats.isDirectory()) {\n this._writable.mkdirSync(p, pStats.mode);\n } else {\n this.writeFileSync(p,\n this._readable.readFileSync(p, null, getFlag('r')), null,\n getFlag('w'), this.statSync(p, false).mode);\n }\n }\n\n private copyToWritableAsync(p: string, cb: BFSOneArgCallback): void {\n this.stat(p, false, (err: ApiError, pStats?: Stats) => {\n if (err) {\n return cb(err);\n }\n\n if (pStats!.isDirectory()) {\n return this._writable.mkdir(p, pStats!.mode, cb);\n }\n\n // need to copy file.\n this._readable.readFile(p, null, getFlag('r'), (err: ApiError, data?: Buffer) => {\n if (err) {\n return cb(err);\n }\n\n this.writeFile(p, data, null, getFlag('w'), pStats!.mode, cb);\n });\n });\n }\n}\n\n/**\n * Configuration options for OverlayFS instances.\n */\nexport interface OverlayFSOptions {\n // The file system to write modified files to.\n writable: FileSystem;\n // The file system that initially populates this file system.\n readable: FileSystem;\n}\n\n/**\n * OverlayFS makes a read-only filesystem writable by storing writes on a second,\n * writable file system. Deletes are persisted via metadata stored on the writable\n * file system.\n */\nexport default class OverlayFS extends LockedFS {\n public static readonly Name = \"OverlayFS\";\n\n public static readonly Options: FileSystemOptions = {\n writable: {\n type: \"object\",\n description: \"The file system to write modified files to.\"\n },\n readable: {\n type: \"object\",\n description: \"The file system that initially populates this file system.\"\n }\n };\n\n /**\n * Constructs and initializes an OverlayFS instance with the given options.\n */\n public static Create(opts: OverlayFSOptions, cb: BFSCallback): void {\n try {\n const fs = new OverlayFS(opts.writable, opts.readable, false);\n fs.initialize((e?) => {\n cb(e, fs);\n }, false);\n } catch (e) {\n cb(e);\n }\n }\n public static isAvailable(): boolean {\n return UnlockedOverlayFS.isAvailable();\n }\n\n /**\n * **Deprecated. Please use OverlayFS.Create() method instead.**\n * @param writable The file system to write modified files to.\n * @param readable The file system that initially populates this file system.\n */\n constructor(writable: FileSystem, readable: FileSystem, deprecateMsg = true) {\n super(new UnlockedOverlayFS(writable, readable));\n deprecationMessage(deprecateMsg, OverlayFS.Name, {readable: \"readable file system\", writable: \"writable file system\"});\n }\n\n /**\n * **Deprecated. Please use OverlayFS.Create() to construct and initialize OverlayFS instances.**\n */\n public initialize(cb: BFSOneArgCallback, deprecateMsg = true): void {\n if (deprecateMsg) {\n console.warn(`[OverlayFS] OverlayFS.initialize() is deprecated and will be removed in the next major release. Please use 'OverlayFS.Create({readable: readable file system instance, writable: writable file system instance}, cb)' to create and initialize OverlayFS instances.`);\n }\n super.initialize(cb);\n }\n\n public getOverlayedFileSystems(): { readable: FileSystem; writable: FileSystem; } {\n return super.getFSUnlocked().getOverlayedFileSystems();\n }\n\n public unwrap(): UnlockedOverlayFS {\n return super.getFSUnlocked();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/OverlayFS.ts","import {BaseFileSystem, FileSystem, BFSOneArgCallback, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport {FileFlag} from '../core/file_flag';\nimport {buffer2ArrayBuffer, arrayBuffer2Buffer, emptyBuffer, deprecationMessage} from '../core/util';\nimport {File, BaseFile} from '../core/file';\nimport {default as Stats} from '../core/node_fs_stats';\nimport PreloadFile from '../generic/preload_file';\nimport global from '../core/global';\nimport fs from '../core/node_fs';\n\n/**\n * @hidden\n */\ndeclare const importScripts: Function;\n\n/**\n * @hidden\n */\ninterface IBrowserFSMessage {\n browserfsMessage: boolean;\n}\n\n/**\n * @hidden\n */\nenum SpecialArgType {\n // Callback\n CB,\n // File descriptor\n FD,\n // API error\n API_ERROR,\n // Stats object\n STATS,\n // Initial probe for file system information.\n PROBE,\n // FileFlag object.\n FILEFLAG,\n // Buffer object.\n BUFFER,\n // Generic Error object.\n ERROR\n}\n\n/**\n * @hidden\n */\ninterface ISpecialArgument {\n type: SpecialArgType;\n}\n\n/**\n * @hidden\n */\ninterface IProbeResponse extends ISpecialArgument {\n isReadOnly: boolean;\n supportsLinks: boolean;\n supportsProps: boolean;\n}\n\n/**\n * @hidden\n */\ninterface ICallbackArgument extends ISpecialArgument {\n // The callback ID.\n id: number;\n}\n\n/**\n * Converts callback arguments into ICallbackArgument objects, and back\n * again.\n * @hidden\n */\nclass CallbackArgumentConverter {\n private _callbacks: { [id: number]: Function } = {};\n private _nextId: number = 0;\n\n public toRemoteArg(cb: Function): ICallbackArgument {\n const id = this._nextId++;\n this._callbacks[id] = cb;\n return {\n type: SpecialArgType.CB,\n id: id\n };\n }\n\n public toLocalArg(id: number): Function {\n const cb = this._callbacks[id];\n delete this._callbacks[id];\n return cb;\n }\n}\n\n/**\n * @hidden\n */\ninterface IFileDescriptorArgument extends ISpecialArgument {\n // The file descriptor's id on the remote side.\n id: number;\n // The entire file's data, as an array buffer.\n data: ArrayBuffer;\n // The file's stat object, as an array buffer.\n stat: ArrayBuffer;\n // The path to the file.\n path: string;\n // The flag of the open file descriptor.\n flag: string;\n}\n\n/**\n * @hidden\n */\nclass FileDescriptorArgumentConverter {\n private _fileDescriptors: { [id: number]: File } = {};\n private _nextId: number = 0;\n\n public toRemoteArg(fd: File, p: string, flag: FileFlag, cb: BFSCallback): void {\n const id = this._nextId++;\n let data: ArrayBuffer;\n let stat: ArrayBuffer;\n this._fileDescriptors[id] = fd;\n\n // Extract needed information asynchronously.\n fd.stat((err, stats) => {\n if (err) {\n cb(err);\n } else {\n stat = bufferToTransferrableObject(stats!.toBuffer());\n // If it's a readable flag, we need to grab contents.\n if (flag.isReadable()) {\n fd.read(Buffer.alloc(stats!.size), 0, stats!.size, 0, (err?: ApiError | null, bytesRead?: number, buff?: Buffer) => {\n if (err) {\n cb(err);\n } else {\n data = bufferToTransferrableObject(buff!);\n cb(null, {\n type: SpecialArgType.FD,\n id: id,\n data: data,\n stat: stat,\n path: p,\n flag: flag.getFlagString()\n });\n }\n });\n } else {\n // File is not readable, which means writing to it will append or\n // truncate/replace existing contents. Return an empty arraybuffer.\n cb(null, {\n type: SpecialArgType.FD,\n id: id,\n data: new ArrayBuffer(0),\n stat: stat,\n path: p,\n flag: flag.getFlagString()\n });\n }\n }\n });\n }\n\n public applyFdAPIRequest(request: IAPIRequest, cb: BFSOneArgCallback): void {\n const fdArg = request.args[0];\n this._applyFdChanges(fdArg, (err, fd?) => {\n if (err) {\n cb(err);\n } else {\n // Apply method on now-changed file descriptor.\n ( fd)[request.method]((e?: ApiError) => {\n if (request.method === 'close') {\n delete this._fileDescriptors[fdArg.id];\n }\n cb(e);\n });\n }\n });\n }\n\n private _applyFdChanges(remoteFd: IFileDescriptorArgument, cb: BFSCallback): void {\n const fd = this._fileDescriptors[remoteFd.id],\n data = transferrableObjectToBuffer(remoteFd.data),\n remoteStats = Stats.fromBuffer(transferrableObjectToBuffer(remoteFd.stat));\n\n // Write data if the file is writable.\n const flag = FileFlag.getFileFlag(remoteFd.flag);\n if (flag.isWriteable()) {\n // Appendable: Write to end of file.\n // Writeable: Replace entire contents of file.\n fd.write(data, 0, data.length, flag.isAppendable() ? fd.getPos()! : 0, (e?: ApiError | null) => {\n function applyStatChanges() {\n // Check if mode changed.\n fd.stat((e, stats?) => {\n if (e) {\n cb(e);\n } else {\n if (stats!.mode !== remoteStats.mode) {\n fd.chmod(remoteStats.mode, (e: any) => {\n cb(e, fd);\n });\n } else {\n cb(e, fd);\n }\n }\n });\n }\n if (e) {\n cb(e);\n } else {\n // If writeable & not appendable, we need to ensure file contents are\n // identical to those from the remote FD. Thus, we truncate to the\n // length of the remote file.\n if (!flag.isAppendable()) {\n fd.truncate(data.length, () => {\n applyStatChanges();\n });\n } else {\n applyStatChanges();\n }\n }\n });\n } else {\n cb(null, fd);\n }\n }\n}\n\n/**\n * @hidden\n */\ninterface IAPIErrorArgument extends ISpecialArgument {\n // The error object, as an array buffer.\n errorData: ArrayBuffer;\n}\n\n/**\n * @hidden\n */\nfunction apiErrorLocal2Remote(e: ApiError): IAPIErrorArgument {\n return {\n type: SpecialArgType.API_ERROR,\n errorData: bufferToTransferrableObject(e.writeToBuffer())\n };\n}\n\n/**\n * @hidden\n */\nfunction apiErrorRemote2Local(e: IAPIErrorArgument): ApiError {\n return ApiError.fromBuffer(transferrableObjectToBuffer(e.errorData));\n}\n\n/**\n * @hidden\n */\ninterface IErrorArgument extends ISpecialArgument {\n // The name of the error (e.g. 'TypeError').\n name: string;\n // The message associated with the error.\n message: string;\n // The stack associated with the error.\n stack: string;\n}\n\n/**\n * @hidden\n */\nfunction errorLocal2Remote(e: Error): IErrorArgument {\n return {\n type: SpecialArgType.ERROR,\n name: e.name,\n message: e.message,\n stack: e.stack!\n };\n}\n\n/**\n * @hidden\n */\nfunction errorRemote2Local(e: IErrorArgument): Error {\n let cnstr: {\n new (msg: string): Error;\n } = global[e.name];\n if (typeof(cnstr) !== 'function') {\n cnstr = Error;\n }\n const err = new cnstr(e.message);\n err.stack = e.stack;\n return err;\n}\n\n/**\n * @hidden\n */\ninterface IStatsArgument extends ISpecialArgument {\n // The stats object as an array buffer.\n statsData: ArrayBuffer;\n}\n\n/**\n * @hidden\n */\nfunction statsLocal2Remote(stats: Stats): IStatsArgument {\n return {\n type: SpecialArgType.STATS,\n statsData: bufferToTransferrableObject(stats.toBuffer())\n };\n}\n\n/**\n * @hidden\n */\nfunction statsRemote2Local(stats: IStatsArgument): Stats {\n return Stats.fromBuffer(transferrableObjectToBuffer(stats.statsData));\n}\n\n/**\n * @hidden\n */\ninterface IFileFlagArgument extends ISpecialArgument {\n flagStr: string;\n}\n\n/**\n * @hidden\n */\nfunction fileFlagLocal2Remote(flag: FileFlag): IFileFlagArgument {\n return {\n type: SpecialArgType.FILEFLAG,\n flagStr: flag.getFlagString()\n };\n}\n\n/**\n * @hidden\n */\nfunction fileFlagRemote2Local(remoteFlag: IFileFlagArgument): FileFlag {\n return FileFlag.getFileFlag(remoteFlag.flagStr);\n}\n\n/**\n * @hidden\n */\ninterface IBufferArgument extends ISpecialArgument {\n data: ArrayBuffer;\n}\n\n/**\n * @hidden\n */\nfunction bufferToTransferrableObject(buff: Buffer): ArrayBuffer {\n return buffer2ArrayBuffer(buff);\n}\n\n/**\n * @hidden\n */\nfunction transferrableObjectToBuffer(buff: ArrayBuffer): Buffer {\n return arrayBuffer2Buffer(buff);\n}\n\n/**\n * @hidden\n */\nfunction bufferLocal2Remote(buff: Buffer): IBufferArgument {\n return {\n type: SpecialArgType.BUFFER,\n data: bufferToTransferrableObject(buff)\n };\n}\n\n/**\n * @hidden\n */\nfunction bufferRemote2Local(buffArg: IBufferArgument): Buffer {\n return transferrableObjectToBuffer(buffArg.data);\n}\n\n/**\n * @hidden\n */\ninterface IAPIRequest extends IBrowserFSMessage {\n method: string;\n args: Array;\n}\n\n/**\n * @hidden\n */\nfunction isAPIRequest(data: any): data is IAPIRequest {\n return data && typeof data === 'object' && data.hasOwnProperty('browserfsMessage') && data['browserfsMessage'];\n}\n\n/**\n * @hidden\n */\ninterface IAPIResponse extends IBrowserFSMessage {\n cbId: number;\n args: Array;\n}\n\n/**\n * @hidden\n */\nfunction isAPIResponse(data: any): data is IAPIResponse {\n return data && typeof data === 'object' && data.hasOwnProperty('browserfsMessage') && data['browserfsMessage'];\n}\n\n/**\n * Represents a remote file in a different worker/thread.\n */\nclass WorkerFile extends PreloadFile {\n private _remoteFdId: number;\n\n constructor(_fs: WorkerFS, _path: string, _flag: FileFlag, _stat: Stats, remoteFdId: number, contents?: Buffer) {\n super(_fs, _path, _flag, _stat, contents);\n this._remoteFdId = remoteFdId;\n }\n\n public getRemoteFdId() {\n return this._remoteFdId;\n }\n\n /**\n * @hidden\n */\n public toRemoteArg(): IFileDescriptorArgument {\n return {\n type: SpecialArgType.FD,\n id: this._remoteFdId,\n data: bufferToTransferrableObject(this.getBuffer()),\n stat: bufferToTransferrableObject(this.getStats().toBuffer()),\n path: this.getPath(),\n flag: this.getFlag().getFlagString()\n };\n }\n\n public sync(cb: BFSOneArgCallback): void {\n this._syncClose('sync', cb);\n }\n\n public close(cb: BFSOneArgCallback): void {\n this._syncClose('close', cb);\n }\n\n private _syncClose(type: string, cb: BFSOneArgCallback): void {\n if (this.isDirty()) {\n ( this._fs).syncClose(type, this, (e?: ApiError) => {\n if (!e) {\n this.resetDirty();\n }\n cb(e);\n });\n } else {\n cb();\n }\n }\n}\n\nexport interface WorkerFSOptions {\n // The target worker that you want to connect to, or the current worker if in a worker context.\n worker: Worker;\n}\n\n/**\n * WorkerFS lets you access a BrowserFS instance that is running in a different\n * JavaScript context (e.g. access BrowserFS in one of your WebWorkers, or\n * access BrowserFS running on the main page from a WebWorker).\n *\n * For example, to have a WebWorker access files in the main browser thread,\n * do the following:\n *\n * MAIN BROWSER THREAD:\n *\n * ```javascript\n * // Listen for remote file system requests.\n * BrowserFS.FileSystem.WorkerFS.attachRemoteListener(webWorkerObject);\n * ```\n *\n * WEBWORKER THREAD:\n *\n * ```javascript\n * // Set the remote file system as the root file system.\n * BrowserFS.configure({ fs: \"WorkerFS\", options: { worker: self }}, function(e) {\n * // Ready!\n * });\n * ```\n *\n * Note that synchronous operations are not permitted on the WorkerFS, regardless\n * of the configuration option of the remote FS.\n */\nexport default class WorkerFS extends BaseFileSystem implements FileSystem {\n public static readonly Name = \"WorkerFS\";\n\n public static readonly Options: FileSystemOptions = {\n worker: {\n type: \"object\",\n description: \"The target worker that you want to connect to, or the current worker if in a worker context.\",\n validator: function(v: object, cb: BFSOneArgCallback): void {\n // Check for a `postMessage` function.\n if (( v)['postMessage']) {\n cb();\n } else {\n cb(new ApiError(ErrorCode.EINVAL, `option must be a Web Worker instance.`));\n }\n }\n }\n };\n\n public static Create(opts: WorkerFSOptions, cb: BFSCallback): void {\n const fs = new WorkerFS(opts.worker, false);\n fs.initialize(() => {\n cb(null, fs);\n });\n }\n public static isAvailable(): boolean {\n return typeof(importScripts) !== 'undefined' || typeof(Worker) !== 'undefined';\n }\n\n /**\n * Attaches a listener to the remote worker for file system requests.\n */\n public static attachRemoteListener(worker: Worker) {\n const fdConverter = new FileDescriptorArgumentConverter();\n\n function argLocal2Remote(arg: any, requestArgs: any[], cb: BFSCallback): void {\n switch (typeof arg) {\n case 'object':\n if (arg instanceof Stats) {\n cb(null, statsLocal2Remote(arg));\n } else if (arg instanceof ApiError) {\n cb(null, apiErrorLocal2Remote(arg));\n } else if (arg instanceof BaseFile) {\n // Pass in p and flags from original request.\n cb(null, fdConverter.toRemoteArg( arg, requestArgs[0], requestArgs[1], cb));\n } else if (arg instanceof FileFlag) {\n cb(null, fileFlagLocal2Remote(arg));\n } else if (arg instanceof Buffer) {\n cb(null, bufferLocal2Remote(arg));\n } else if (arg instanceof Error) {\n cb(null, errorLocal2Remote(arg));\n } else {\n cb(null, arg);\n }\n break;\n default:\n cb(null, arg);\n break;\n }\n }\n\n function argRemote2Local(arg: any, fixedRequestArgs: any[]): any {\n if (!arg) {\n return arg;\n }\n switch (typeof arg) {\n case 'object':\n if (typeof arg['type'] === 'number') {\n const specialArg = arg;\n switch (specialArg.type) {\n case SpecialArgType.CB:\n const cbId = ( arg).id;\n return function() {\n let i: number;\n const fixedArgs = new Array(arguments.length);\n let message: IAPIResponse,\n countdown = arguments.length;\n\n function abortAndSendError(err: ApiError) {\n if (countdown > 0) {\n countdown = -1;\n message = {\n browserfsMessage: true,\n cbId: cbId,\n args: [apiErrorLocal2Remote(err)]\n };\n worker.postMessage(message);\n }\n }\n\n for (i = 0; i < arguments.length; i++) {\n // Capture i and argument.\n ((i: number, arg: any) => {\n argLocal2Remote(arg, fixedRequestArgs, (err, fixedArg?) => {\n fixedArgs[i] = fixedArg;\n if (err) {\n abortAndSendError(err);\n } else if (--countdown === 0) {\n message = {\n browserfsMessage: true,\n cbId: cbId,\n args: fixedArgs\n };\n worker.postMessage(message);\n }\n });\n })(i, arguments[i]);\n }\n\n if (arguments.length === 0) {\n message = {\n browserfsMessage: true,\n cbId: cbId,\n args: fixedArgs\n };\n worker.postMessage(message);\n }\n\n };\n case SpecialArgType.API_ERROR:\n return apiErrorRemote2Local( specialArg);\n case SpecialArgType.STATS:\n return statsRemote2Local( specialArg);\n case SpecialArgType.FILEFLAG:\n return fileFlagRemote2Local( specialArg);\n case SpecialArgType.BUFFER:\n return bufferRemote2Local( specialArg);\n case SpecialArgType.ERROR:\n return errorRemote2Local( specialArg);\n default:\n // No idea what this is.\n return arg;\n }\n } else {\n return arg;\n }\n default:\n return arg;\n }\n }\n\n worker.addEventListener('message', (e: MessageEvent) => {\n const request: object = e.data;\n if (isAPIRequest(request)) {\n const args = request.args,\n fixedArgs = new Array(args.length);\n\n switch (request.method) {\n case 'close':\n case 'sync':\n (() => {\n // File descriptor-relative methods.\n const remoteCb = args[1];\n fdConverter.applyFdAPIRequest(request, (err?: ApiError) => {\n // Send response.\n const response: IAPIResponse = {\n browserfsMessage: true,\n cbId: remoteCb.id,\n args: err ? [apiErrorLocal2Remote(err)] : []\n };\n worker.postMessage(response);\n });\n })();\n break;\n case 'probe':\n (() => {\n const rootFs = fs.getRootFS(),\n remoteCb = args[1],\n probeResponse: IProbeResponse = {\n type: SpecialArgType.PROBE,\n isReadOnly: rootFs.isReadOnly(),\n supportsLinks: rootFs.supportsLinks(),\n supportsProps: rootFs.supportsProps()\n },\n response: IAPIResponse = {\n browserfsMessage: true,\n cbId: remoteCb.id,\n args: [probeResponse]\n };\n\n worker.postMessage(response);\n })();\n break;\n default:\n // File system methods.\n for (let i = 0; i < args.length; i++) {\n fixedArgs[i] = argRemote2Local(args[i], fixedArgs);\n }\n const rootFS = fs.getRootFS();\n ( ( rootFS)[request.method]).apply(rootFS, fixedArgs);\n break;\n }\n }\n });\n }\n\n private _worker: Worker;\n private _callbackConverter = new CallbackArgumentConverter();\n\n private _isInitialized: boolean = false;\n private _isReadOnly: boolean = false;\n private _supportLinks: boolean = false;\n private _supportProps: boolean = false;\n\n /**\n * **Deprecated. Please use WorkerFS.Create() method instead.**\n *\n * Constructs a new WorkerFS instance that connects with BrowserFS running on\n * the specified worker.\n */\n constructor(worker: Worker, deprecateMsg = true) {\n super();\n this._worker = worker;\n deprecationMessage(deprecateMsg, WorkerFS.Name, {worker: \"Web Worker instance\"});\n this._worker.addEventListener('message', (e: MessageEvent) => {\n const resp: object = e.data;\n if (isAPIResponse(resp)) {\n let i: number;\n const args = resp.args;\n const fixedArgs = new Array(args.length);\n // Dispatch event to correct id.\n for (i = 0; i < fixedArgs.length; i++) {\n fixedArgs[i] = this._argRemote2Local(args[i]);\n }\n this._callbackConverter.toLocalArg(resp.cbId).apply(null, fixedArgs);\n }\n });\n }\n\n public getName(): string {\n return WorkerFS.Name;\n }\n\n /**\n * **Deprecated. Please use WorkerFS.Create() method to construct and initialize WorkerFS instances.**\n *\n * Called once both local and remote sides are set up.\n */\n public initialize(cb: () => void): void {\n if (!this._isInitialized) {\n const message: IAPIRequest = {\n browserfsMessage: true,\n method: 'probe',\n args: [this._argLocal2Remote(emptyBuffer()), this._callbackConverter.toRemoteArg((probeResponse: IProbeResponse) => {\n this._isInitialized = true;\n this._isReadOnly = probeResponse.isReadOnly;\n this._supportLinks = probeResponse.supportsLinks;\n this._supportProps = probeResponse.supportsProps;\n cb();\n })]\n };\n this._worker.postMessage(message);\n } else {\n cb();\n }\n }\n\n public isReadOnly(): boolean { return this._isReadOnly; }\n public supportsSynch(): boolean { return false; }\n public supportsLinks(): boolean { return this._supportLinks; }\n public supportsProps(): boolean { return this._supportProps; }\n\n public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void {\n this._rpc('rename', arguments);\n }\n public stat(p: string, isLstat: boolean, cb: BFSCallback): void {\n this._rpc('stat', arguments);\n }\n public open(p: string, flag: FileFlag, mode: number, cb: BFSCallback): void {\n this._rpc('open', arguments);\n }\n public unlink(p: string, cb: Function): void {\n this._rpc('unlink', arguments);\n }\n public rmdir(p: string, cb: Function): void {\n this._rpc('rmdir', arguments);\n }\n public mkdir(p: string, mode: number, cb: Function): void {\n this._rpc('mkdir', arguments);\n }\n public readdir(p: string, cb: BFSCallback): void {\n this._rpc('readdir', arguments);\n }\n public exists(p: string, cb: (exists: boolean) => void): void {\n this._rpc('exists', arguments);\n }\n public realpath(p: string, cache: { [path: string]: string }, cb: BFSCallback): void {\n this._rpc('realpath', arguments);\n }\n public truncate(p: string, len: number, cb: Function): void {\n this._rpc('truncate', arguments);\n }\n public readFile(fname: string, encoding: string, flag: FileFlag, cb: BFSCallback): void {\n this._rpc('readFile', arguments);\n }\n public writeFile(fname: string, data: any, encoding: string, flag: FileFlag, mode: number, cb: BFSOneArgCallback): void {\n this._rpc('writeFile', arguments);\n }\n public appendFile(fname: string, data: any, encoding: string, flag: FileFlag, mode: number, cb: BFSOneArgCallback): void {\n this._rpc('appendFile', arguments);\n }\n public chmod(p: string, isLchmod: boolean, mode: number, cb: Function): void {\n this._rpc('chmod', arguments);\n }\n public chown(p: string, isLchown: boolean, uid: number, gid: number, cb: Function): void {\n this._rpc('chown', arguments);\n }\n public utimes(p: string, atime: Date, mtime: Date, cb: Function): void {\n this._rpc('utimes', arguments);\n }\n public link(srcpath: string, dstpath: string, cb: Function): void {\n this._rpc('link', arguments);\n }\n public symlink(srcpath: string, dstpath: string, type: string, cb: Function): void {\n this._rpc('symlink', arguments);\n }\n public readlink(p: string, cb: Function): void {\n this._rpc('readlink', arguments);\n }\n\n public syncClose(method: string, fd: File, cb: BFSOneArgCallback): void {\n this._worker.postMessage( {\n browserfsMessage: true,\n method: method,\n args: [( fd).toRemoteArg(), this._callbackConverter.toRemoteArg(cb)]\n });\n }\n\n private _argRemote2Local(arg: any): any {\n if (!arg) {\n return arg;\n }\n switch (typeof arg) {\n case 'object':\n if (typeof arg['type'] === 'number') {\n const specialArg = arg;\n switch (specialArg.type) {\n case SpecialArgType.API_ERROR:\n return apiErrorRemote2Local( specialArg);\n case SpecialArgType.FD:\n const fdArg = specialArg;\n return new WorkerFile(this, fdArg.path, FileFlag.getFileFlag(fdArg.flag), Stats.fromBuffer(transferrableObjectToBuffer(fdArg.stat)), fdArg.id, transferrableObjectToBuffer(fdArg.data));\n case SpecialArgType.STATS:\n return statsRemote2Local( specialArg);\n case SpecialArgType.FILEFLAG:\n return fileFlagRemote2Local( specialArg);\n case SpecialArgType.BUFFER:\n return bufferRemote2Local( specialArg);\n case SpecialArgType.ERROR:\n return errorRemote2Local( specialArg);\n default:\n return arg;\n }\n } else {\n return arg;\n }\n default:\n return arg;\n }\n }\n\n private _rpc(methodName: string, args: IArguments) {\n const fixedArgs = new Array(args.length);\n for (let i = 0; i < args.length; i++) {\n fixedArgs[i] = this._argLocal2Remote(args[i]);\n }\n const message: IAPIRequest = {\n browserfsMessage: true,\n method: methodName,\n args: fixedArgs\n };\n this._worker.postMessage(message);\n }\n\n /**\n * Converts a local argument into a remote argument. Public so WorkerFile objects can call it.\n */\n private _argLocal2Remote(arg: any): any {\n if (!arg) {\n return arg;\n }\n switch (typeof arg) {\n case \"object\":\n if (arg instanceof Stats) {\n return statsLocal2Remote(arg);\n } else if (arg instanceof ApiError) {\n return apiErrorLocal2Remote(arg);\n } else if (arg instanceof WorkerFile) {\n return ( arg).toRemoteArg();\n } else if (arg instanceof FileFlag) {\n return fileFlagLocal2Remote(arg);\n } else if (arg instanceof Buffer) {\n return bufferLocal2Remote(arg);\n } else if (arg instanceof Error) {\n return errorLocal2Remote(arg);\n } else {\n return \"Unknown argument\";\n }\n case \"function\":\n return this._callbackConverter.toRemoteArg(arg);\n default:\n return arg;\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/WorkerFS.ts","/**\n * Contains utility methods for performing a variety of tasks with\n * XmlHttpRequest across browsers.\n */\n\nimport {isIE, emptyBuffer} from '../core/util';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport {BFSCallback} from '../core/file_system';\n\n/**\n * @hidden\n */\nfunction asyncDownloadFileModern(p: string, type: 'buffer', cb: BFSCallback): void;\nfunction asyncDownloadFileModern(p: string, type: 'json', cb: BFSCallback): void;\nfunction asyncDownloadFileModern(p: string, type: string, cb: BFSCallback): void;\nfunction asyncDownloadFileModern(p: string, type: string, cb: BFSCallback): void {\n const req = new XMLHttpRequest();\n req.open('GET', p, true);\n let jsonSupported = true;\n switch (type) {\n case 'buffer':\n req.responseType = 'arraybuffer';\n break;\n case 'json':\n // Some browsers don't support the JSON response type.\n // They either reset responseType, or throw an exception.\n // @see https://github.com/Modernizr/Modernizr/blob/master/src/testXhrType.js\n try {\n req.responseType = 'json';\n jsonSupported = req.responseType === 'json';\n } catch (e) {\n jsonSupported = false;\n }\n break;\n default:\n return cb(new ApiError(ErrorCode.EINVAL, \"Invalid download type: \" + type));\n }\n req.onreadystatechange = function(e) {\n if (req.readyState === 4) {\n if (req.status === 200) {\n switch (type) {\n case 'buffer':\n // XXX: WebKit-based browsers return *null* when XHRing an empty file.\n return cb(null, req.response ? Buffer.from(req.response) : emptyBuffer());\n case 'json':\n if (jsonSupported) {\n return cb(null, req.response);\n } else {\n return cb(null, JSON.parse(req.responseText));\n }\n }\n } else {\n return cb(new ApiError(req.status, \"XHR error.\"));\n }\n }\n };\n req.send();\n}\n\n/**\n * @hidden\n */\nfunction syncDownloadFileModern(p: string, type: 'buffer'): Buffer;\nfunction syncDownloadFileModern(p: string, type: 'json'): any;\nfunction syncDownloadFileModern(p: string, type: string): any;\nfunction syncDownloadFileModern(p: string, type: string): any {\n const req = new XMLHttpRequest();\n req.open('GET', p, false);\n\n // On most platforms, we cannot set the responseType of synchronous downloads.\n // @todo Test for this; IE10 allows this, as do older versions of Chrome/FF.\n let data: any = null;\n let err: any = null;\n // Classic hack to download binary data as a string.\n req.overrideMimeType('text/plain; charset=x-user-defined');\n req.onreadystatechange = function(e) {\n if (req.readyState === 4) {\n if (req.status === 200) {\n switch (type) {\n case 'buffer':\n // Convert the text into a buffer.\n const text = req.responseText;\n data = Buffer.alloc(text.length);\n // Throw away the upper bits of each character.\n for (let i = 0; i < text.length; i++) {\n // This will automatically throw away the upper bit of each\n // character for us.\n data[i] = text.charCodeAt(i);\n }\n return;\n case 'json':\n data = JSON.parse(req.responseText);\n return;\n }\n } else {\n err = new ApiError(req.status, \"XHR error.\");\n return;\n }\n }\n };\n req.send();\n if (err) {\n throw err;\n }\n return data;\n}\n\n/**\n * IE10 allows us to perform synchronous binary file downloads.\n * @todo Feature detect this, as older versions of FF/Chrome do too!\n * @hidden\n */\nfunction syncDownloadFileIE10(p: string, type: 'buffer'): Buffer;\nfunction syncDownloadFileIE10(p: string, type: 'json'): any;\nfunction syncDownloadFileIE10(p: string, type: string): any;\nfunction syncDownloadFileIE10(p: string, type: string): any {\n const req = new XMLHttpRequest();\n req.open('GET', p, false);\n switch (type) {\n case 'buffer':\n req.responseType = 'arraybuffer';\n break;\n case 'json':\n // IE10 does not support the JSON type.\n break;\n default:\n throw new ApiError(ErrorCode.EINVAL, \"Invalid download type: \" + type);\n }\n let data: any;\n let err: any;\n req.onreadystatechange = function(e) {\n if (req.readyState === 4) {\n if (req.status === 200) {\n switch (type) {\n case 'buffer':\n data = Buffer.from(req.response);\n break;\n case 'json':\n data = JSON.parse(req.response);\n break;\n }\n } else {\n err = new ApiError(req.status, \"XHR error.\");\n }\n }\n };\n req.send();\n if (err) {\n throw err;\n }\n return data;\n}\n\n/**\n * @hidden\n */\nfunction getFileSize(async: boolean, p: string, cb: BFSCallback): void {\n const req = new XMLHttpRequest();\n req.open('HEAD', p, async);\n req.onreadystatechange = function(e) {\n if (req.readyState === 4) {\n if (req.status === 200) {\n try {\n return cb(null, parseInt(req.getResponseHeader('Content-Length') || '-1', 10));\n } catch (e) {\n // In the event that the header isn't present or there is an error...\n return cb(new ApiError(ErrorCode.EIO, \"XHR HEAD error: Could not read content-length.\"));\n }\n } else {\n return cb(new ApiError(req.status, \"XHR HEAD error.\"));\n }\n }\n };\n req.send();\n}\n\n/**\n * Asynchronously download a file as a buffer or a JSON object.\n * Note that the third function signature with a non-specialized type is\n * invalid, but TypeScript requires it when you specialize string arguments to\n * constants.\n * @hidden\n */\nexport let asyncDownloadFile: {\n (p: string, type: 'buffer', cb: BFSCallback): void;\n (p: string, type: 'json', cb: BFSCallback): void;\n (p: string, type: string, cb: BFSCallback): void;\n} = asyncDownloadFileModern;\n\n/**\n * Synchronously download a file as a buffer or a JSON object.\n * Note that the third function signature with a non-specialized type is\n * invalid, but TypeScript requires it when you specialize string arguments to\n * constants.\n * @hidden\n */\nexport let syncDownloadFile: {\n (p: string, type: 'buffer'): Buffer;\n (p: string, type: 'json'): any;\n (p: string, type: string): any;\n} = (isIE && typeof Blob !== 'undefined') ? syncDownloadFileIE10 : syncDownloadFileModern;\n\n/**\n * Synchronously retrieves the size of the given file in bytes.\n * @hidden\n */\nexport function getFileSizeSync(p: string): number {\n let rv: number = -1;\n getFileSize(false, p, function(err: ApiError, size?: number) {\n if (err) {\n throw err;\n }\n rv = size!;\n });\n return rv;\n}\n\n/**\n * Asynchronously retrieves the size of the given file in bytes.\n * @hidden\n */\nexport function getFileSizeAsync(p: string, cb: (err: ApiError, size?: number) => void): void {\n getFileSize(true, p, cb);\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/generic/xhr.ts","import {default as Stats, FileType} from '../core/node_fs_stats';\nimport * as path from 'path';\n\n/**\n * A simple class for storing a filesystem index. Assumes that all paths passed\n * to it are *absolute* paths.\n *\n * Can be used as a partial or a full index, although care must be taken if used\n * for the former purpose, especially when directories are concerned.\n */\nexport class FileIndex {\n /**\n * Static method for constructing indices from a JSON listing.\n * @param listing Directory listing generated by tools/XHRIndexer.coffee\n * @return A new FileIndex object.\n */\n public static fromListing(listing: any): FileIndex {\n const idx = new FileIndex();\n // Add a root DirNode.\n const rootInode = new DirInode();\n idx._index['/'] = rootInode;\n const queue = [['', listing, rootInode]];\n while (queue.length > 0) {\n let inode: Inode;\n const next = queue.pop();\n const pwd = next![0];\n const tree = next![1];\n const parent = next![2];\n for (const node in tree) {\n if (tree.hasOwnProperty(node)) {\n const children = tree[node];\n const name = `${pwd}/${node}`;\n if (children) {\n idx._index[name] = inode = new DirInode();\n queue.push([name, children, inode]);\n } else {\n // This inode doesn't have correct size information, noted with -1.\n inode = new FileInode(new Stats(FileType.FILE, -1, 0x16D));\n }\n if (parent) {\n parent._ls[node] = inode;\n }\n }\n }\n }\n return idx;\n }\n\n // Maps directory paths to directory inodes, which contain files.\n private _index: {[path: string]: DirInode };\n\n /**\n * Constructs a new FileIndex.\n */\n constructor() {\n // _index is a single-level key,value store that maps *directory* paths to\n // DirInodes. File information is only contained in DirInodes themselves.\n this._index = {};\n // Create the root directory.\n this.addPath('/', new DirInode());\n }\n\n /**\n * Runs the given function over all files in the index.\n */\n public fileIterator(cb: (file: T | null) => void): void {\n for (const path in this._index) {\n if (this._index.hasOwnProperty(path)) {\n const dir = this._index[path];\n const files = dir.getListing();\n for (const file of files) {\n const item = dir.getItem(file);\n if (isFileInode(item)) {\n cb(item.getData());\n }\n }\n }\n }\n }\n\n /**\n * Adds the given absolute path to the index if it is not already in the index.\n * Creates any needed parent directories.\n * @param path The path to add to the index.\n * @param inode The inode for the\n * path to add.\n * @return 'True' if it was added or already exists, 'false' if there\n * was an issue adding it (e.g. item in path is a file, item exists but is\n * different).\n * @todo If adding fails and implicitly creates directories, we do not clean up\n * the new empty directories.\n */\n public addPath(path: string, inode: Inode): boolean {\n if (!inode) {\n throw new Error('Inode must be specified');\n }\n if (path[0] !== '/') {\n throw new Error('Path must be absolute, got: ' + path);\n }\n\n // Check if it already exists.\n if (this._index.hasOwnProperty(path)) {\n return this._index[path] === inode;\n }\n\n const splitPath = this._split_path(path);\n const dirpath = splitPath[0];\n const itemname = splitPath[1];\n // Try to add to its parent directory first.\n let parent = this._index[dirpath];\n if (parent === undefined && path !== '/') {\n // Create parent.\n parent = new DirInode();\n if (!this.addPath(dirpath, parent)) {\n return false;\n }\n }\n // Add myself to my parent.\n if (path !== '/') {\n if (!parent.addItem(itemname, inode)) {\n return false;\n }\n }\n // If I'm a directory, add myself to the index.\n if (isDirInode(inode)) {\n this._index[path] = inode;\n }\n return true;\n }\n\n /**\n * Adds the given absolute path to the index if it is not already in the index.\n * The path is added without special treatment (no joining of adjacent separators, etc).\n * Creates any needed parent directories.\n * @param path The path to add to the index.\n * @param inode The inode for the\n * path to add.\n * @return 'True' if it was added or already exists, 'false' if there\n * was an issue adding it (e.g. item in path is a file, item exists but is\n * different).\n * @todo If adding fails and implicitly creates directories, we do not clean up\n * the new empty directories.\n */\n public addPathFast(path: string, inode: Inode): boolean {\n const itemNameMark = path.lastIndexOf('/');\n const parentPath = itemNameMark === 0 ? \"/\" : path.substring(0, itemNameMark);\n const itemName = path.substring(itemNameMark + 1);\n\n // Try to add to its parent directory first.\n let parent = this._index[parentPath];\n if (parent === undefined) {\n // Create parent.\n parent = new DirInode();\n this.addPathFast(parentPath, parent);\n }\n\n if (!parent.addItem(itemName, inode)) {\n return false;\n }\n\n // If adding a directory, add to the index as well.\n if (inode.isDir()) {\n this._index[path] = > inode;\n }\n return true;\n }\n\n /**\n * Removes the given path. Can be a file or a directory.\n * @return The removed item,\n * or null if it did not exist.\n */\n public removePath(path: string): Inode | null {\n const splitPath = this._split_path(path);\n const dirpath = splitPath[0];\n const itemname = splitPath[1];\n\n // Try to remove it from its parent directory first.\n const parent = this._index[dirpath];\n if (parent === undefined) {\n return null;\n }\n // Remove myself from my parent.\n const inode = parent.remItem(itemname);\n if (inode === null) {\n return null;\n }\n // If I'm a directory, remove myself from the index, and remove my children.\n if (isDirInode(inode)) {\n const children = inode.getListing();\n for (const child of children) {\n this.removePath(path + '/' + child);\n }\n\n // Remove the directory from the index, unless it's the root.\n if (path !== '/') {\n delete this._index[path];\n }\n }\n return inode;\n }\n\n /**\n * Retrieves the directory listing of the given path.\n * @return An array of files in the given path, or 'null' if it does not exist.\n */\n public ls(path: string): string[] | null {\n const item = this._index[path];\n if (item === undefined) {\n return null;\n }\n return item.getListing();\n }\n\n /**\n * Returns the inode of the given item.\n * @return Returns null if the item does not exist.\n */\n public getInode(path: string): Inode | null {\n const splitPath = this._split_path(path);\n const dirpath = splitPath[0];\n const itemname = splitPath[1];\n // Retrieve from its parent directory.\n const parent = this._index[dirpath];\n if (parent === undefined) {\n return null;\n }\n // Root case\n if (dirpath === path) {\n return parent;\n }\n return parent.getItem(itemname);\n }\n\n /**\n * Split into a (directory path, item name) pair\n */\n private _split_path(p: string): string[] {\n const dirpath = path.dirname(p);\n const itemname = p.substr(dirpath.length + (dirpath === \"/\" ? 0 : 1));\n return [dirpath, itemname];\n }\n}\n\n/**\n * Generic interface for file/directory inodes.\n * Note that Stats objects are what we use for file inodes.\n */\nexport interface Inode {\n // Is this an inode for a file?\n isFile(): boolean;\n // Is this an inode for a directory?\n isDir(): boolean;\n}\n\n/**\n * Inode for a file. Stores an arbitrary (filesystem-specific) data payload.\n */\nexport class FileInode implements Inode {\n constructor(private data: T) { }\n public isFile(): boolean { return true; }\n public isDir(): boolean { return false; }\n public getData(): T { return this.data; }\n public setData(data: T): void { this.data = data; }\n}\n\n/**\n * Inode for a directory. Currently only contains the directory listing.\n */\nexport class DirInode implements Inode {\n private _ls: {[path: string]: Inode} = {};\n /**\n * Constructs an inode for a directory.\n */\n constructor(private data: T | null = null) {}\n public isFile(): boolean {\n return false;\n }\n public isDir(): boolean {\n return true;\n }\n public getData(): T | null { return this.data; }\n\n /**\n * Return a Stats object for this inode.\n * @todo Should probably remove this at some point. This isn't the\n * responsibility of the FileIndex.\n */\n public getStats(): Stats {\n return new Stats(FileType.DIRECTORY, 4096, 0x16D);\n }\n /**\n * Returns the directory listing for this directory. Paths in the directory are\n * relative to the directory's path.\n * @return The directory listing for this directory.\n */\n public getListing(): string[] {\n return Object.keys(this._ls);\n }\n /**\n * Returns the inode for the indicated item, or null if it does not exist.\n * @param p Name of item in this directory.\n */\n public getItem(p: string): Inode | null {\n const item = this._ls[p];\n return item ? item : null;\n }\n /**\n * Add the given item to the directory listing. Note that the given inode is\n * not copied, and will be mutated by the DirInode if it is a DirInode.\n * @param p Item name to add to the directory listing.\n * @param inode The inode for the\n * item to add to the directory inode.\n * @return True if it was added, false if it already existed.\n */\n public addItem(p: string, inode: Inode): boolean {\n if (p in this._ls) {\n return false;\n }\n this._ls[p] = inode;\n return true;\n }\n /**\n * Removes the given item from the directory listing.\n * @param p Name of item to remove from the directory listing.\n * @return Returns the item\n * removed, or null if the item did not exist.\n */\n public remItem(p: string): Inode | null {\n const item = this._ls[p];\n if (item === undefined) {\n return null;\n }\n delete this._ls[p];\n return item;\n }\n}\n\n/**\n * @hidden\n */\nexport function isFileInode(inode: Inode | null): inode is FileInode {\n return !!inode && inode.isFile();\n}\n\n/**\n * @hidden\n */\nexport function isDirInode(inode: Inode | null): inode is DirInode {\n return !!inode && inode.isDir();\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/generic/file_index.ts","import {BaseFileSystem, FileSystem, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport {FileFlag, ActionType} from '../core/file_flag';\nimport {copyingSlice, deprecationMessage} from '../core/util';\nimport {File} from '../core/file';\nimport Stats from '../core/node_fs_stats';\nimport {NoSyncFile} from '../generic/preload_file';\nimport {asyncDownloadFile, syncDownloadFile, getFileSizeAsync, getFileSizeSync} from '../generic/xhr';\nimport {FileIndex, isFileInode, isDirInode} from '../generic/file_index';\n\n/**\n * Try to convert the given buffer into a string, and pass it to the callback.\n * Optimization that removes the needed try/catch into a helper function, as\n * this is an uncommon case.\n * @hidden\n */\nfunction tryToString(buff: Buffer, encoding: string, cb: BFSCallback) {\n try {\n cb(null, buff.toString(encoding));\n } catch (e) {\n cb(e);\n }\n}\n\n/**\n * Configuration options for an XmlHttpRequest file system.\n */\nexport interface XmlHttpRequestOptions {\n // URL to a file index as a JSON file or the file index object itself, generated with the make_xhrfs_index script.\n // Defaults to `index.json`.\n index?: string | object;\n // Used as the URL prefix for fetched files.\n // Default: Fetch files relative to the index.\n baseUrl?: string;\n}\n\n/**\n * A simple filesystem backed by XMLHttpRequests. You must create a directory listing using the\n * `make_xhrfs_index` tool provided by BrowserFS.\n *\n * If you install BrowserFS globally with `npm i -g browserfs`, you can generate a listing by\n * running `make_xhrfs_index` in your terminal in the directory you would like to index:\n *\n * ```\n * make_xhrfs_index > index.json\n * ```\n *\n * Listings objects look like the following:\n *\n * ```json\n * {\n * \"home\": {\n * \"jvilk\": {\n * \"someFile.txt\": null,\n * \"someDir\": {\n * // Empty directory\n * }\n * }\n * }\n * }\n * ```\n *\n * *This example has the folder `/home/jvilk` with subfile `someFile.txt` and subfolder `someDir`.*\n */\nexport default class XmlHttpRequest extends BaseFileSystem implements FileSystem {\n public static readonly Name = \"XmlHttpRequest\";\n\n public static readonly Options: FileSystemOptions = {\n index: {\n type: [\"string\", \"object\"],\n optional: true,\n description: \"URL to a file index as a JSON file or the file index object itself, generated with the make_xhrfs_index script. Defaults to `index.json`.\"\n },\n baseUrl: {\n type: \"string\",\n optional: true,\n description: \"Used as the URL prefix for fetched files. Default: Fetch files relative to the index.\"\n }\n };\n\n /**\n * Construct an XmlHttpRequest file system backend with the given options.\n */\n public static Create(opts: XmlHttpRequestOptions, cb: BFSCallback): void {\n if (opts.index === undefined) {\n opts.index = `index.json`;\n }\n if (typeof(opts.index) === \"string\") {\n XmlHttpRequest.FromURL(opts.index, cb, opts.baseUrl, false);\n } else {\n cb(null, new XmlHttpRequest(opts.index, opts.baseUrl, false));\n }\n }\n public static isAvailable(): boolean {\n return typeof(XMLHttpRequest) !== \"undefined\" && XMLHttpRequest !== null;\n }\n /**\n * **Deprecated. Please use XmlHttpRequest.Create() method instead to construct XmlHttpRequest objects.**\n *\n * Constructs an XmlHttpRequest object using the directory listing at the given URL.\n * Uses the base URL as the URL prefix for fetched files.\n * @param cb Called when the file system has been instantiated, or if an error occurs.\n */\n public static FromURL(url: string, cb: BFSCallback, baseUrl = url.slice(0, url.lastIndexOf('/') + 1), deprecateMsg = true): void {\n if (deprecateMsg) {\n console.warn(`[XmlHttpRequest] XmlHttpRequest.FromURL() is deprecated and will be removed in the next major release. Please use 'XmlHttpRequest.Create({ index: \"${url}\", baseUrl: \"${baseUrl}\" }, cb)' instead.`);\n }\n asyncDownloadFile(url, \"json\", (e, data?) => {\n if (e) {\n cb(e);\n } else {\n cb(null, new XmlHttpRequest(data, baseUrl, false));\n }\n });\n }\n\n public readonly prefixUrl: string;\n private _index: FileIndex<{}>;\n /**\n * **Deprecated. Please use XmlHttpRequest.Create() method instead to construct XmlHttpRequest objects.**\n *\n * Constructs the file system. You must provide the directory listing as a JSON object\n * produced by the `make_xhrfs_index` script.\n *\n * **DEPRECATED:** You may pass a URL to the file index to the constructor, which will fetch the file index\n * *synchronously* and may freeze up the web page. This behavior will be removed in the next major version\n * of BrowserFS.\n *\n * @param listingUrlOrObj index object or the path to the JSON file index generated by\n * `make_xhrfs_index`.\n * @param prefixUrl URL that is prepended to any file locations in the file index. e.g. if `prefixUrl = 'data/`, and the user wants to open the file `/foo.txt`,\n * the file system will fetch file `data/foo.txt`. The browser will access the file relative to the currrent webpage\n * URL.\n */\n constructor(listingUrlOrObj: string | object, prefixUrl: string = '', deprecateMsg = true) {\n super();\n if (!listingUrlOrObj) {\n listingUrlOrObj = 'index.json';\n }\n // prefix_url must end in a directory separator.\n if (prefixUrl.length > 0 && prefixUrl.charAt(prefixUrl.length - 1) !== '/') {\n prefixUrl = prefixUrl + '/';\n }\n this.prefixUrl = prefixUrl;\n\n let listing: object | null = null;\n if (typeof(listingUrlOrObj) === \"string\") {\n listing = this._requestFileSync( listingUrlOrObj, 'json');\n if (!listing) {\n throw new Error(\"Unable to find listing at URL: ${listingUrlOrObj}\");\n }\n } else {\n listing = listingUrlOrObj;\n }\n deprecationMessage(deprecateMsg, XmlHttpRequest.Name, { index: typeof(listingUrlOrObj) === \"string\" ? listingUrlOrObj : \"file index as an object\", baseUrl: prefixUrl});\n\n this._index = FileIndex.fromListing(listing);\n }\n\n public empty(): void {\n this._index.fileIterator(function(file: Stats) {\n file.fileData = null;\n });\n }\n\n public getName(): string {\n return XmlHttpRequest.Name;\n }\n\n public diskSpace(path: string, cb: (total: number, free: number) => void): void {\n // Read-only file system. We could calculate the total space, but that's not\n // important right now.\n cb(0, 0);\n }\n\n public isReadOnly(): boolean {\n return true;\n }\n\n public supportsLinks(): boolean {\n return false;\n }\n\n public supportsProps(): boolean {\n return false;\n }\n\n public supportsSynch(): boolean {\n return true;\n }\n\n /**\n * Special XHR function: Preload the given file into the index.\n * @param [String] path\n * @param [BrowserFS.Buffer] buffer\n */\n public preloadFile(path: string, buffer: Buffer): void {\n const inode = this._index.getInode(path);\n if (isFileInode(inode)) {\n if (inode === null) {\n throw ApiError.ENOENT(path);\n }\n const stats = inode.getData();\n stats.size = buffer.length;\n stats.fileData = buffer;\n } else {\n throw ApiError.EISDIR(path);\n }\n }\n\n public stat(path: string, isLstat: boolean, cb: BFSCallback): void {\n const inode = this._index.getInode(path);\n if (inode === null) {\n return cb(ApiError.ENOENT(path));\n }\n let stats: Stats;\n if (isFileInode(inode)) {\n stats = inode.getData();\n // At this point, a non-opened file will still have default stats from the listing.\n if (stats.size < 0) {\n this._requestFileSizeAsync(path, function(e: ApiError, size?: number) {\n if (e) {\n return cb(e);\n }\n stats.size = size!;\n cb(null, stats.clone());\n });\n } else {\n cb(null, stats.clone());\n }\n } else if (isDirInode(inode)) {\n stats = inode.getStats();\n cb(null, stats);\n } else {\n cb(ApiError.FileError(ErrorCode.EINVAL, path));\n }\n }\n\n public statSync(path: string, isLstat: boolean): Stats {\n const inode = this._index.getInode(path);\n if (inode === null) {\n throw ApiError.ENOENT(path);\n }\n let stats: Stats;\n if (isFileInode(inode)) {\n stats = inode.getData();\n // At this point, a non-opened file will still have default stats from the listing.\n if (stats.size < 0) {\n stats.size = this._requestFileSizeSync(path);\n }\n } else if (isDirInode(inode)) {\n stats = inode.getStats();\n } else {\n throw ApiError.FileError(ErrorCode.EINVAL, path);\n }\n return stats;\n }\n\n public open(path: string, flags: FileFlag, mode: number, cb: BFSCallback): void {\n // INVARIANT: You can't write to files on this file system.\n if (flags.isWriteable()) {\n return cb(new ApiError(ErrorCode.EPERM, path));\n }\n const self = this;\n // Check if the path exists, and is a file.\n const inode = this._index.getInode(path);\n if (inode === null) {\n return cb(ApiError.ENOENT(path));\n }\n if (isFileInode(inode)) {\n const stats = inode.getData();\n switch (flags.pathExistsAction()) {\n case ActionType.THROW_EXCEPTION:\n case ActionType.TRUNCATE_FILE:\n return cb(ApiError.EEXIST(path));\n case ActionType.NOP:\n // Use existing file contents.\n // XXX: Uh, this maintains the previously-used flag.\n if (stats.fileData) {\n return cb(null, new NoSyncFile(self, path, flags, stats.clone(), stats.fileData));\n }\n // @todo be lazier about actually requesting the file\n this._requestFileAsync(path, 'buffer', function(err: ApiError, buffer?: Buffer) {\n if (err) {\n return cb(err);\n }\n // we don't initially have file sizes\n stats.size = buffer!.length;\n stats.fileData = buffer!;\n return cb(null, new NoSyncFile(self, path, flags, stats.clone(), buffer));\n });\n break;\n default:\n return cb(new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.'));\n }\n } else {\n return cb(ApiError.EISDIR(path));\n }\n }\n\n public openSync(path: string, flags: FileFlag, mode: number): File {\n // INVARIANT: You can't write to files on this file system.\n if (flags.isWriteable()) {\n throw new ApiError(ErrorCode.EPERM, path);\n }\n // Check if the path exists, and is a file.\n const inode = this._index.getInode(path);\n if (inode === null) {\n throw ApiError.ENOENT(path);\n }\n if (isFileInode(inode)) {\n const stats = inode.getData();\n switch (flags.pathExistsAction()) {\n case ActionType.THROW_EXCEPTION:\n case ActionType.TRUNCATE_FILE:\n throw ApiError.EEXIST(path);\n case ActionType.NOP:\n // Use existing file contents.\n // XXX: Uh, this maintains the previously-used flag.\n if (stats.fileData) {\n return new NoSyncFile(this, path, flags, stats.clone(), stats.fileData);\n }\n // @todo be lazier about actually requesting the file\n const buffer = this._requestFileSync(path, 'buffer');\n // we don't initially have file sizes\n stats.size = buffer.length;\n stats.fileData = buffer;\n return new NoSyncFile(this, path, flags, stats.clone(), buffer);\n default:\n throw new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.');\n }\n } else {\n throw ApiError.EISDIR(path);\n }\n }\n\n public readdir(path: string, cb: BFSCallback): void {\n try {\n cb(null, this.readdirSync(path));\n } catch (e) {\n cb(e);\n }\n }\n\n public readdirSync(path: string): string[] {\n // Check if it exists.\n const inode = this._index.getInode(path);\n if (inode === null) {\n throw ApiError.ENOENT(path);\n } else if (isDirInode(inode)) {\n return inode.getListing();\n } else {\n throw ApiError.ENOTDIR(path);\n }\n }\n\n /**\n * We have the entire file as a buffer; optimize readFile.\n */\n public readFile(fname: string, encoding: string, flag: FileFlag, cb: BFSCallback): void {\n // Wrap cb in file closing code.\n const oldCb = cb;\n // Get file.\n this.open(fname, flag, 0x1a4, function(err: ApiError, fd?: File) {\n if (err) {\n return cb(err);\n }\n cb = function(err: ApiError, arg?: Buffer) {\n fd!.close(function(err2: any) {\n if (!err) {\n err = err2;\n }\n return oldCb(err, arg);\n });\n };\n const fdCast = > fd;\n const fdBuff = fdCast.getBuffer();\n if (encoding === null) {\n cb(err, copyingSlice(fdBuff));\n } else {\n tryToString(fdBuff, encoding, cb);\n }\n });\n }\n\n /**\n * Specially-optimized readfile.\n */\n public readFileSync(fname: string, encoding: string, flag: FileFlag): any {\n // Get file.\n const fd = this.openSync(fname, flag, 0x1a4);\n try {\n const fdCast = > fd;\n const fdBuff = fdCast.getBuffer();\n if (encoding === null) {\n return copyingSlice(fdBuff);\n }\n return fdBuff.toString(encoding);\n } finally {\n fd.closeSync();\n }\n }\n\n private getXhrPath(filePath: string): string {\n if (filePath.charAt(0) === '/') {\n filePath = filePath.slice(1);\n }\n return this.prefixUrl + filePath;\n }\n\n /**\n * Asynchronously download the given file.\n */\n private _requestFileAsync(p: string, type: 'buffer', cb: BFSCallback): void;\n private _requestFileAsync(p: string, type: 'json', cb: BFSCallback): void;\n private _requestFileAsync(p: string, type: string, cb: BFSCallback): void;\n private _requestFileAsync(p: string, type: string, cb: BFSCallback): void {\n asyncDownloadFile(this.getXhrPath(p), type, cb);\n }\n\n /**\n * Synchronously download the given file.\n */\n private _requestFileSync(p: string, type: 'buffer'): Buffer;\n private _requestFileSync(p: string, type: 'json'): any;\n private _requestFileSync(p: string, type: string): any;\n private _requestFileSync(p: string, type: string): any {\n return syncDownloadFile(this.getXhrPath(p), type);\n }\n\n /**\n * Only requests the HEAD content, for the file size.\n */\n private _requestFileSizeAsync(path: string, cb: BFSCallback): void {\n getFileSizeAsync(this.getXhrPath(path), cb);\n }\n private _requestFileSizeSync(path: string): number {\n return getFileSizeSync(this.getXhrPath(path));\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/XmlHttpRequest.ts","import {ApiError, ErrorCode} from '../core/api_error';\nimport {default as Stats, FileType} from '../core/node_fs_stats';\nimport {SynchronousFileSystem, FileSystem, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {File} from '../core/file';\nimport {FileFlag, ActionType} from '../core/file_flag';\nimport {NoSyncFile} from '../generic/preload_file';\nimport {Arrayish, arrayish2Buffer, copyingSlice, deprecationMessage, bufferValidator} from '../core/util';\nimport ExtendedASCII from '../generic/extended_ascii';\nimport setImmediate from '../generic/setImmediate';\n/**\n * @hidden\n */\nconst inflateRaw:\n (data: Arrayish, options?: {\n chunkSize: number;\n }) => Arrayish = require('pako/lib/inflate').inflateRaw;\nimport {FileIndex, DirInode, FileInode, isDirInode, isFileInode} from '../generic/file_index';\n\n/**\n * Maps CompressionMethod => function that decompresses.\n * @hidden\n */\nconst decompressionMethods: {[method: number]: (data: Buffer, compressedSize: number, uncompressedSize: number, flags: number) => Buffer} = {};\n\n/**\n * 4.4.2.2: Indicates the compatibiltiy of a file's external attributes.\n */\nexport enum ExternalFileAttributeType {\n MSDOS = 0, AMIGA = 1, OPENVMS = 2, UNIX = 3, VM_CMS = 4, ATARI_ST = 5,\n OS2_HPFS = 6, MAC = 7, Z_SYSTEM = 8, CP_M = 9, NTFS = 10, MVS = 11, VSE = 12,\n ACORN_RISC = 13, VFAT = 14, ALT_MVS = 15, BEOS = 16, TANDEM = 17, OS_400 = 18,\n OSX = 19\n}\n\n/**\n * 4.4.5\n */\nexport enum CompressionMethod {\n STORED = 0, // The file is stored (no compression)\n SHRUNK = 1, // The file is Shrunk\n REDUCED_1 = 2, // The file is Reduced with compression factor 1\n REDUCED_2 = 3, // The file is Reduced with compression factor 2\n REDUCED_3 = 4, // The file is Reduced with compression factor 3\n REDUCED_4 = 5, // The file is Reduced with compression factor 4\n IMPLODE = 6, // The file is Imploded\n DEFLATE = 8, // The file is Deflated\n DEFLATE64 = 9, // Enhanced Deflating using Deflate64(tm)\n TERSE_OLD = 10, // PKWARE Data Compression Library Imploding (old IBM TERSE)\n BZIP2 = 12, // File is compressed using BZIP2 algorithm\n LZMA = 14, // LZMA (EFS)\n TERSE_NEW = 18, // File is compressed using IBM TERSE (new)\n LZ77 = 19, // IBM LZ77 z Architecture (PFS)\n WAVPACK = 97, // WavPack compressed data\n PPMD = 98 // PPMd version I, Rev 1\n}\n\n/**\n * Converts the input time and date in MS-DOS format into a JavaScript Date\n * object.\n * @hidden\n */\nfunction msdos2date(time: number, date: number): Date {\n // MS-DOS Date\n // |0 0 0 0 0|0 0 0 0|0 0 0 0 0 0 0\n // D (1-31) M (1-23) Y (from 1980)\n const day = date & 0x1F;\n // JS date is 0-indexed, DOS is 1-indexed.\n const month = ((date >> 5) & 0xF) - 1;\n const year = (date >> 9) + 1980;\n // MS DOS Time\n // |0 0 0 0 0|0 0 0 0 0 0|0 0 0 0 0\n // Second Minute Hour\n const second = time & 0x1F;\n const minute = (time >> 5) & 0x3F;\n const hour = time >> 11;\n return new Date(year, month, day, hour, minute, second);\n}\n\n/**\n * Safely returns the string from the buffer, even if it is 0 bytes long.\n * (Normally, calling toString() on a buffer with start === end causes an\n * exception).\n * @hidden\n */\nfunction safeToString(buff: Buffer, useUTF8: boolean, start: number, length: number): string {\n if (length === 0) {\n return \"\";\n } else if (useUTF8) {\n return buff.toString('utf8', start, start + length);\n } else {\n return ExtendedASCII.byte2str(buff.slice(start, start + length));\n }\n}\n\n/*\n 4.3.6 Overall .ZIP file format:\n\n [local file header 1]\n [encryption header 1]\n [file data 1]\n [data descriptor 1]\n .\n .\n .\n [local file header n]\n [encryption header n]\n [file data n]\n [data descriptor n]\n [archive decryption header]\n [archive extra data record]\n [central directory header 1]\n .\n .\n .\n [central directory header n]\n [zip64 end of central directory record]\n [zip64 end of central directory locator]\n [end of central directory record]\n*/\n\n/**\n * 4.3.7 Local file header:\n *\n * local file header signature 4 bytes (0x04034b50)\n * version needed to extract 2 bytes\n * general purpose bit flag 2 bytes\n * compression method 2 bytes\n * last mod file time 2 bytes\n * last mod file date 2 bytes\n * crc-32 4 bytes\n * compressed size 4 bytes\n * uncompressed size 4 bytes\n * file name length 2 bytes\n * extra field length 2 bytes\n *\n * file name (variable size)\n * extra field (variable size)\n */\nexport class FileHeader {\n constructor(private data: Buffer) {\n if (data.readUInt32LE(0) !== 0x04034b50) {\n throw new ApiError(ErrorCode.EINVAL, \"Invalid Zip file: Local file header has invalid signature: \" + this.data.readUInt32LE(0));\n }\n }\n public versionNeeded(): number { return this.data.readUInt16LE(4); }\n public flags(): number { return this.data.readUInt16LE(6); }\n public compressionMethod(): CompressionMethod { return this.data.readUInt16LE(8); }\n public lastModFileTime(): Date {\n // Time and date is in MS-DOS format.\n return msdos2date(this.data.readUInt16LE(10), this.data.readUInt16LE(12));\n }\n public rawLastModFileTime(): number {\n return this.data.readUInt32LE(10);\n }\n public crc32(): number { return this.data.readUInt32LE(14); }\n /**\n * These two values are COMPLETELY USELESS.\n *\n * Section 4.4.9:\n * If bit 3 of the general purpose bit flag is set,\n * these fields are set to zero in the local header and the\n * correct values are put in the data descriptor and\n * in the central directory.\n *\n * So we'll just use the central directory's values.\n */\n // public compressedSize(): number { return this.data.readUInt32LE(18); }\n // public uncompressedSize(): number { return this.data.readUInt32LE(22); }\n public fileNameLength(): number { return this.data.readUInt16LE(26); }\n public extraFieldLength(): number { return this.data.readUInt16LE(28); }\n public fileName(): string {\n return safeToString(this.data, this.useUTF8(), 30, this.fileNameLength());\n }\n public extraField(): Buffer {\n const start = 30 + this.fileNameLength();\n return this.data.slice(start, start + this.extraFieldLength());\n }\n public totalSize(): number { return 30 + this.fileNameLength() + this.extraFieldLength(); }\n public useUTF8(): boolean { return (this.flags() & 0x800) === 0x800; }\n}\n\n/**\n * 4.3.8 File data\n *\n * Immediately following the local header for a file\n * SHOULD be placed the compressed or stored data for the file.\n * If the file is encrypted, the encryption header for the file\n * SHOULD be placed after the local header and before the file\n * data. The series of [local file header][encryption header]\n * [file data][data descriptor] repeats for each file in the\n * .ZIP archive.\n *\n * Zero-byte files, directories, and other file types that\n * contain no content MUST not include file data.\n */\nexport class FileData {\n constructor(private header: FileHeader, private record: CentralDirectory, private data: Buffer) {}\n public decompress(): Buffer {\n // Check the compression\n const compressionMethod: CompressionMethod = this.header.compressionMethod();\n const fcn = decompressionMethods[compressionMethod];\n if (fcn) {\n return fcn(this.data, this.record.compressedSize(), this.record.uncompressedSize(), this.record.flag());\n } else {\n let name: string = CompressionMethod[compressionMethod];\n if (!name) {\n name = `Unknown: ${compressionMethod}`;\n }\n throw new ApiError(ErrorCode.EINVAL, `Invalid compression method on file '${this.header.fileName()}': ${name}`);\n }\n }\n public getHeader(): FileHeader {\n return this.header;\n }\n public getRecord(): CentralDirectory {\n return this.record;\n }\n public getRawData(): Buffer {\n return this.data;\n }\n}\n\n/**\n * 4.3.9 Data descriptor:\n *\n * crc-32 4 bytes\n * compressed size 4 bytes\n * uncompressed size 4 bytes\n */\nexport class DataDescriptor {\n constructor(private data: Buffer) {}\n public crc32(): number { return this.data.readUInt32LE(0); }\n public compressedSize(): number { return this.data.readUInt32LE(4); }\n public uncompressedSize(): number { return this.data.readUInt32LE(8); }\n}\n\n/*\n` 4.3.10 Archive decryption header:\n\n 4.3.10.1 The Archive Decryption Header is introduced in version 6.2\n of the ZIP format specification. This record exists in support\n of the Central Directory Encryption Feature implemented as part of\n the Strong Encryption Specification as described in this document.\n When the Central Directory Structure is encrypted, this decryption\n header MUST precede the encrypted data segment.\n */\n/**\n * 4.3.11 Archive extra data record:\n *\n * archive extra data signature 4 bytes (0x08064b50)\n * extra field length 4 bytes\n * extra field data (variable size)\n *\n * 4.3.11.1 The Archive Extra Data Record is introduced in version 6.2\n * of the ZIP format specification. This record MAY be used in support\n * of the Central Directory Encryption Feature implemented as part of\n * the Strong Encryption Specification as described in this document.\n * When present, this record MUST immediately precede the central\n * directory data structure.\n */\nexport class ArchiveExtraDataRecord {\n constructor(private data: Buffer) {\n if (this.data.readUInt32LE(0) !== 0x08064b50) {\n throw new ApiError(ErrorCode.EINVAL, \"Invalid archive extra data record signature: \" + this.data.readUInt32LE(0));\n }\n }\n public length(): number { return this.data.readUInt32LE(4); }\n public extraFieldData(): Buffer { return this.data.slice(8, 8 + this.length()); }\n}\n\n/**\n * 4.3.13 Digital signature:\n *\n * header signature 4 bytes (0x05054b50)\n * size of data 2 bytes\n * signature data (variable size)\n *\n * With the introduction of the Central Directory Encryption\n * feature in version 6.2 of this specification, the Central\n * Directory Structure MAY be stored both compressed and encrypted.\n * Although not required, it is assumed when encrypting the\n * Central Directory Structure, that it will be compressed\n * for greater storage efficiency. Information on the\n * Central Directory Encryption feature can be found in the section\n * describing the Strong Encryption Specification. The Digital\n * Signature record will be neither compressed nor encrypted.\n */\nexport class DigitalSignature {\n constructor(private data: Buffer) {\n if (this.data.readUInt32LE(0) !== 0x05054b50) {\n throw new ApiError(ErrorCode.EINVAL, \"Invalid digital signature signature: \" + this.data.readUInt32LE(0));\n }\n }\n public size(): number { return this.data.readUInt16LE(4); }\n public signatureData(): Buffer { return this.data.slice(6, 6 + this.size()); }\n}\n\n/**\n * 4.3.12 Central directory structure:\n *\n * central file header signature 4 bytes (0x02014b50)\n * version made by 2 bytes\n * version needed to extract 2 bytes\n * general purpose bit flag 2 bytes\n * compression method 2 bytes\n * last mod file time 2 bytes\n * last mod file date 2 bytes\n * crc-32 4 bytes\n * compressed size 4 bytes\n * uncompressed size 4 bytes\n * file name length 2 bytes\n * extra field length 2 bytes\n * file comment length 2 bytes\n * disk number start 2 bytes\n * internal file attributes 2 bytes\n * external file attributes 4 bytes\n * relative offset of local header 4 bytes\n *\n * file name (variable size)\n * extra field (variable size)\n * file comment (variable size)\n */\nexport class CentralDirectory {\n // Optimization: The filename is frequently read, so stash it here.\n private _filename: string;\n constructor(private zipData: Buffer, private data: Buffer) {\n // Sanity check.\n if (this.data.readUInt32LE(0) !== 0x02014b50) {\n throw new ApiError(ErrorCode.EINVAL, `Invalid Zip file: Central directory record has invalid signature: ${this.data.readUInt32LE(0)}`);\n }\n this._filename = this.produceFilename();\n }\n public versionMadeBy(): number { return this.data.readUInt16LE(4); }\n public versionNeeded(): number { return this.data.readUInt16LE(6); }\n public flag(): number { return this.data.readUInt16LE(8); }\n public compressionMethod(): CompressionMethod { return this.data.readUInt16LE(10); }\n public lastModFileTime(): Date {\n // Time and date is in MS-DOS format.\n return msdos2date(this.data.readUInt16LE(12), this.data.readUInt16LE(14));\n }\n public rawLastModFileTime(): number {\n return this.data.readUInt32LE(12);\n }\n public crc32(): number { return this.data.readUInt32LE(16); }\n public compressedSize(): number { return this.data.readUInt32LE(20); }\n public uncompressedSize(): number { return this.data.readUInt32LE(24); }\n public fileNameLength(): number { return this.data.readUInt16LE(28); }\n public extraFieldLength(): number { return this.data.readUInt16LE(30); }\n public fileCommentLength(): number { return this.data.readUInt16LE(32); }\n public diskNumberStart(): number { return this.data.readUInt16LE(34); }\n public internalAttributes(): number { return this.data.readUInt16LE(36); }\n public externalAttributes(): number { return this.data.readUInt32LE(38); }\n public headerRelativeOffset(): number { return this.data.readUInt32LE(42); }\n public produceFilename(): string {\n /*\n 4.4.17.1 claims:\n * All slashes are forward ('/') slashes.\n * Filename doesn't begin with a slash.\n * No drive letters or any nonsense like that.\n * If filename is missing, the input came from standard input.\n\n Unfortunately, this isn't true in practice. Some Windows zip utilities use\n a backslash here, but the correct Unix-style path in file headers.\n\n To avoid seeking all over the file to recover the known-good filenames\n from file headers, we simply convert '/' to '\\' here.\n */\n const fileName: string = safeToString(this.data, this.useUTF8(), 46, this.fileNameLength());\n return fileName.replace(/\\\\/g, \"/\");\n }\n public fileName(): string {\n return this._filename;\n }\n public rawFileName(): Buffer {\n return this.data.slice(46, 46 + this.fileNameLength());\n }\n public extraField(): Buffer {\n const start = 44 + this.fileNameLength();\n return this.data.slice(start, start + this.extraFieldLength());\n }\n public fileComment(): string {\n const start = 46 + this.fileNameLength() + this.extraFieldLength();\n return safeToString(this.data, this.useUTF8(), start, this.fileCommentLength());\n }\n public rawFileComment(): Buffer {\n const start = 46 + this.fileNameLength() + this.extraFieldLength();\n return this.data.slice(start, start + this.fileCommentLength());\n }\n public totalSize(): number {\n return 46 + this.fileNameLength() + this.extraFieldLength() + this.fileCommentLength();\n }\n public isDirectory(): boolean {\n // NOTE: This assumes that the zip file implementation uses the lower byte\n // of external attributes for DOS attributes for\n // backwards-compatibility. This is not mandated, but appears to be\n // commonplace.\n // According to the spec, the layout of external attributes is\n // platform-dependent.\n // If that fails, we also check if the name of the file ends in '/',\n // which is what Java's ZipFile implementation does.\n const fileName = this.fileName();\n return (this.externalAttributes() & 0x10 ? true : false) || (fileName.charAt(fileName.length - 1) === '/');\n }\n public isFile(): boolean { return !this.isDirectory(); }\n public useUTF8(): boolean { return (this.flag() & 0x800) === 0x800; }\n public isEncrypted(): boolean { return (this.flag() & 0x1) === 0x1; }\n public getFileData(): FileData {\n // Need to grab the header before we can figure out where the actual\n // compressed data starts.\n const start = this.headerRelativeOffset();\n const header = new FileHeader(this.zipData.slice(start));\n return new FileData(header, this, this.zipData.slice(start + header.totalSize()));\n }\n public getData(): Buffer {\n return this.getFileData().decompress();\n }\n public getRawData(): Buffer {\n return this.getFileData().getRawData();\n }\n public getStats(): Stats {\n return new Stats(FileType.FILE, this.uncompressedSize(), 0x16D, new Date(), this.lastModFileTime());\n }\n}\n\n/**\n * 4.3.16: end of central directory record\n * end of central dir signature 4 bytes (0x06054b50)\n * number of this disk 2 bytes\n * number of the disk with the\n * start of the central directory 2 bytes\n * total number of entries in the\n * central directory on this disk 2 bytes\n * total number of entries in\n * the central directory 2 bytes\n * size of the central directory 4 bytes\n * offset of start of central\n * directory with respect to\n * the starting disk number 4 bytes\n * .ZIP file comment length 2 bytes\n * .ZIP file comment (variable size)\n */\nexport class EndOfCentralDirectory {\n constructor(private data: Buffer) {\n if (this.data.readUInt32LE(0) !== 0x06054b50) {\n throw new ApiError(ErrorCode.EINVAL, `Invalid Zip file: End of central directory record has invalid signature: ${this.data.readUInt32LE(0)}`);\n }\n }\n public diskNumber(): number { return this.data.readUInt16LE(4); }\n public cdDiskNumber(): number { return this.data.readUInt16LE(6); }\n public cdDiskEntryCount(): number { return this.data.readUInt16LE(8); }\n public cdTotalEntryCount(): number { return this.data.readUInt16LE(10); }\n public cdSize(): number { return this.data.readUInt32LE(12); }\n public cdOffset(): number { return this.data.readUInt32LE(16); }\n public cdZipCommentLength(): number { return this.data.readUInt16LE(20); }\n public cdZipComment(): string {\n // Assuming UTF-8. The specification doesn't specify.\n return safeToString(this.data, true, 22, this.cdZipCommentLength());\n }\n public rawCdZipComment(): Buffer {\n return this.data.slice(22, 22 + this.cdZipCommentLength());\n }\n}\n\n/**\n * Contains the table of contents of a Zip file.\n */\nexport class ZipTOC {\n constructor(public index: FileIndex, public directoryEntries: CentralDirectory[], public eocd: EndOfCentralDirectory, public data: Buffer) {\n }\n}\n\n/**\n * Configuration options for a ZipFS file system.\n */\nexport interface ZipFSOptions {\n // The zip file as a binary buffer.\n zipData: Buffer;\n // The name of the zip file (optional).\n name?: string;\n}\n\n/**\n * Zip file-backed filesystem\n * Implemented according to the standard:\n * http://www.pkware.com/documents/casestudies/APPNOTE.TXT\n *\n * While there are a few zip libraries for JavaScript (e.g. JSZip and zip.js),\n * they are not a good match for BrowserFS. In particular, these libraries\n * perform a lot of unneeded data copying, and eagerly decompress every file\n * in the zip file upon loading to check the CRC32. They also eagerly decode\n * strings. Furthermore, these libraries duplicate functionality already present\n * in BrowserFS (e.g. UTF-8 decoding and binary data manipulation).\n *\n * This filesystem takes advantage of BrowserFS's Buffer implementation, which\n * efficiently represents the zip file in memory (in both ArrayBuffer-enabled\n * browsers *and* non-ArrayBuffer browsers), and which can neatly be 'sliced'\n * without copying data. Each struct defined in the standard is represented with\n * a buffer slice pointing to an offset in the zip file, and has getters for\n * each field. As we anticipate that this data will not be read often, we choose\n * not to store each struct field in the JavaScript object; instead, to reduce\n * memory consumption, we retrieve it directly from the binary data each time it\n * is requested.\n *\n * When the filesystem is instantiated, we determine the directory structure\n * of the zip file as quickly as possible. We lazily decompress and check the\n * CRC32 of files. We do not cache decompressed files; if this is a desired\n * feature, it is best implemented as a generic file system wrapper that can\n * cache data from arbitrary file systems.\n *\n * For inflation, we use `pako`'s implementation:\n * https://github.com/nodeca/pako\n *\n * Current limitations:\n * * No encryption.\n * * No ZIP64 support.\n * * Read-only.\n * Write support would require that we:\n * - Keep track of changed/new files.\n * - Compress changed files, and generate appropriate metadata for each.\n * - Update file offsets for other files in the zip file.\n * - Stream it out to a location.\n * This isn't that bad, so we might do this at a later date.\n */\nexport default class ZipFS extends SynchronousFileSystem implements FileSystem {\n public static readonly Name = \"ZipFS\";\n\n public static readonly Options: FileSystemOptions = {\n zipData: {\n type: \"object\",\n description: \"The zip file as a Buffer object.\",\n validator: bufferValidator\n },\n name: {\n type: \"string\",\n optional: true,\n description: \"The name of the zip file (optional).\"\n }\n };\n\n public static readonly CompressionMethod = CompressionMethod;\n\n /**\n * Constructs a ZipFS instance with the given options.\n */\n public static Create(opts: ZipFSOptions, cb: BFSCallback): void {\n try {\n ZipFS.computeIndex(opts.zipData, (zipTOC) => {\n const fs = new ZipFS(zipTOC, opts.name, false);\n cb(null, fs);\n }, false);\n } catch (e) {\n cb(e);\n }\n }\n\n public static isAvailable(): boolean { return true; }\n\n public static RegisterDecompressionMethod(m: CompressionMethod, fcn: (data: Buffer, compressedSize: number, uncompressedSize: number, flags: number) => Buffer): void {\n decompressionMethods[m] = fcn;\n }\n\n /**\n * **Deprecated. Please use ZipFS.Create() method instead.**\n */\n public static computeIndex(data: Buffer, cb: (zipTOC: ZipTOC) => void, deprecateMsg = true) {\n // TODO: Refactor to plumb errors through. Right now, they throw.\n if (deprecateMsg) {\n console.warn(`[ZipFS] ZipFS.computeIndex is now deprecated, and will be removed in the next major release. Please update your code to use 'ZipFS.Create({ zipData: zip file as a Buffer}, cb)' instead.`);\n }\n const index: FileIndex = new FileIndex();\n const eocd: EndOfCentralDirectory = ZipFS.getEOCD(data);\n if (eocd.diskNumber() !== eocd.cdDiskNumber()) {\n throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support spanned zip files.\");\n }\n\n const cdPtr = eocd.cdOffset();\n if (cdPtr === 0xFFFFFFFF) {\n throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support Zip64.\");\n }\n const cdEnd = cdPtr + eocd.cdSize();\n ZipFS.computeIndexResponsive(data, index, cdPtr, cdEnd, cb, [], eocd);\n }\n\n /**\n * Locates the end of central directory record at the end of the file.\n * Throws an exception if it cannot be found.\n */\n private static getEOCD(data: Buffer): EndOfCentralDirectory {\n // Unfortunately, the comment is variable size and up to 64K in size.\n // We assume that the magic signature does not appear in the comment, and\n // in the bytes between the comment and the signature. Other ZIP\n // implementations make this same assumption, since the alternative is to\n // read thread every entry in the file to get to it. :(\n // These are *negative* offsets from the end of the file.\n const startOffset = 22;\n const endOffset = Math.min(startOffset + 0xFFFF, data.length - 1);\n // There's not even a byte alignment guarantee on the comment so we need to\n // search byte by byte. *grumble grumble*\n for (let i = startOffset; i < endOffset; i++) {\n // Magic number: EOCD Signature\n if (data.readUInt32LE(data.length - i) === 0x06054b50) {\n return new EndOfCentralDirectory(data.slice(data.length - i));\n }\n }\n throw new ApiError(ErrorCode.EINVAL, \"Invalid ZIP file: Could not locate End of Central Directory signature.\");\n }\n\n private static addToIndex(cd: CentralDirectory, index: FileIndex) {\n // Paths must be absolute, yet zip file paths are always relative to the\n // zip root. So we append '/' and call it a day.\n let filename = cd.fileName();\n if (filename.charAt(0) === '/') {\n throw new Error(\"WHY IS THIS ABSOLUTE\");\n }\n // XXX: For the file index, strip the trailing '/'.\n if (filename.charAt(filename.length - 1) === '/') {\n filename = filename.substr(0, filename.length - 1);\n }\n\n if (cd.isDirectory()) {\n index.addPathFast('/' + filename, new DirInode(cd));\n } else {\n index.addPathFast('/' + filename, new FileInode(cd));\n }\n }\n\n private static computeIndexResponsive(data: Buffer, index: FileIndex, cdPtr: number, cdEnd: number, cb: (zipTOC: ZipTOC) => void, cdEntries: CentralDirectory[], eocd: EndOfCentralDirectory) {\n if (cdPtr < cdEnd) {\n let count = 0;\n while (count++ < 200 && cdPtr < cdEnd) {\n const cd: CentralDirectory = new CentralDirectory(data, data.slice(cdPtr));\n ZipFS.addToIndex(cd, index);\n cdPtr += cd.totalSize();\n cdEntries.push(cd);\n }\n setImmediate(() => {\n ZipFS.computeIndexResponsive(data, index, cdPtr, cdEnd, cb, cdEntries, eocd);\n });\n } else {\n cb(new ZipTOC(index, cdEntries, eocd, data));\n }\n }\n\n private _index: FileIndex = new FileIndex();\n private _directoryEntries: CentralDirectory[] = [];\n private _eocd: EndOfCentralDirectory | null = null;\n private data: Buffer;\n\n /**\n * **Deprecated. Please use ZipFS.Create() method to construct ZipFS objects.**\n */\n constructor(input: Buffer | ZipTOC, private name: string = '', deprecateMsg = true) {\n super();\n deprecationMessage(deprecateMsg, ZipFS.Name, {zipData: \"zip data as a Buffer\", name: name});\n if (input instanceof ZipTOC) {\n this._index = input.index;\n this._directoryEntries = input.directoryEntries;\n this._eocd = input.eocd;\n this.data = input.data;\n } else {\n this.data = input as Buffer;\n this.populateIndex();\n }\n }\n\n public getName(): string {\n return ZipFS.Name + (this.name !== '' ? ` ${this.name}` : '');\n }\n\n /**\n * Get the CentralDirectory object for the given path.\n */\n public getCentralDirectoryEntry(path: string): CentralDirectory {\n const inode = this._index.getInode(path);\n if (inode === null) {\n throw ApiError.ENOENT(path);\n }\n if (isFileInode(inode)) {\n return inode.getData();\n } else if (isDirInode(inode)) {\n return inode.getData()!;\n } else {\n // Should never occur.\n throw ApiError.EPERM(`Invalid inode: ${inode}`);\n }\n }\n\n public getCentralDirectoryEntryAt(index: number): CentralDirectory {\n const dirEntry = this._directoryEntries[index];\n if (!dirEntry) {\n throw new RangeError(`Invalid directory index: ${index}.`);\n }\n return dirEntry;\n }\n\n public getNumberOfCentralDirectoryEntries(): number {\n return this._directoryEntries.length;\n }\n\n public getEndOfCentralDirectory(): EndOfCentralDirectory | null {\n return this._eocd;\n }\n\n public diskSpace(path: string, cb: (total: number, free: number) => void): void {\n // Read-only file system.\n cb(this.data.length, 0);\n }\n\n public isReadOnly(): boolean {\n return true;\n }\n\n public supportsLinks(): boolean {\n return false;\n }\n\n public supportsProps(): boolean {\n return false;\n }\n\n public supportsSynch(): boolean {\n return true;\n }\n\n public statSync(path: string, isLstat: boolean): Stats {\n const inode = this._index.getInode(path);\n if (inode === null) {\n throw ApiError.ENOENT(path);\n }\n let stats: Stats;\n if (isFileInode(inode)) {\n stats = inode.getData().getStats();\n } else if (isDirInode(inode)) {\n stats = inode.getStats();\n } else {\n throw new ApiError(ErrorCode.EINVAL, \"Invalid inode.\");\n }\n return stats;\n }\n\n public openSync(path: string, flags: FileFlag, mode: number): File {\n // INVARIANT: Cannot write to RO file systems.\n if (flags.isWriteable()) {\n throw new ApiError(ErrorCode.EPERM, path);\n }\n // Check if the path exists, and is a file.\n const inode = this._index.getInode(path);\n if (!inode) {\n throw ApiError.ENOENT(path);\n } else if (isFileInode(inode)) {\n const cdRecord = inode.getData();\n const stats = cdRecord.getStats();\n switch (flags.pathExistsAction()) {\n case ActionType.THROW_EXCEPTION:\n case ActionType.TRUNCATE_FILE:\n throw ApiError.EEXIST(path);\n case ActionType.NOP:\n return new NoSyncFile(this, path, flags, stats, cdRecord.getData());\n default:\n throw new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.');\n }\n } else {\n throw ApiError.EISDIR(path);\n }\n }\n\n public readdirSync(path: string): string[] {\n // Check if it exists.\n const inode = this._index.getInode(path);\n if (!inode) {\n throw ApiError.ENOENT(path);\n } else if (isDirInode(inode)) {\n return inode.getListing();\n } else {\n throw ApiError.ENOTDIR(path);\n }\n }\n\n /**\n * Specially-optimized readfile.\n */\n public readFileSync(fname: string, encoding: string, flag: FileFlag): any {\n // Get file.\n const fd = this.openSync(fname, flag, 0x1a4);\n try {\n const fdCast = > fd;\n const fdBuff = fdCast.getBuffer();\n if (encoding === null) {\n return copyingSlice(fdBuff);\n }\n return fdBuff.toString(encoding);\n } finally {\n fd.closeSync();\n }\n }\n\n private populateIndex() {\n const eocd: EndOfCentralDirectory = this._eocd = ZipFS.getEOCD(this.data);\n if (eocd.diskNumber() !== eocd.cdDiskNumber()) {\n throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support spanned zip files.\");\n }\n\n let cdPtr = eocd.cdOffset();\n if (cdPtr === 0xFFFFFFFF) {\n throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support Zip64.\");\n }\n const cdEnd = cdPtr + eocd.cdSize();\n while (cdPtr < cdEnd) {\n const cd: CentralDirectory = new CentralDirectory(this.data, this.data.slice(cdPtr));\n cdPtr += cd.totalSize();\n ZipFS.addToIndex(cd, this._index);\n this._directoryEntries.push(cd);\n }\n }\n}\n\nZipFS.RegisterDecompressionMethod(CompressionMethod.DEFLATE, (data, compressedSize, uncompressedSize) => {\n return arrayish2Buffer(inflateRaw(\n data.slice(0, compressedSize),\n { chunkSize: uncompressedSize }\n ));\n});\n\nZipFS.RegisterDecompressionMethod(CompressionMethod.STORED, (data, compressedSize, uncompressedSize) => {\n return copyingSlice(data, 0, uncompressedSize);\n});\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/ZipFS.ts","import {ApiError, ErrorCode} from '../core/api_error';\nimport {default as Stats, FileType} from '../core/node_fs_stats';\nimport {SynchronousFileSystem, FileSystem, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {File} from '../core/file';\nimport {FileFlag, ActionType} from '../core/file_flag';\nimport {NoSyncFile} from '../generic/preload_file';\nimport {copyingSlice, deprecationMessage, bufferValidator} from '../core/util';\nimport * as path from 'path';\n\n/**\n * @hidden\n */\nconst rockRidgeIdentifier = \"IEEE_P1282\";\n/**\n * @hidden\n */\nconst enum VolumeDescriptorTypeCode {\n BootRecord = 0,\n PrimaryVolumeDescriptor = 1,\n SupplementaryVolumeDescriptor = 2,\n VolumePartitionDescriptor = 3,\n VolumeDescriptorSetTerminator = 255\n}\n\n/**\n * @hidden\n */\ntype TGetString = (d: Buffer, i: number, len: number) => string;\n\n/**\n * @hidden\n */\nfunction getASCIIString(data: Buffer, startIndex: number, length: number) {\n return data.toString('ascii', startIndex, startIndex + length).trim();\n}\n\n/**\n * @hidden\n */\nfunction getJolietString(data: Buffer, startIndex: number, length: number): string {\n if (length === 1) {\n // Special: Root, parent, current directory are still a single byte.\n return String.fromCharCode(data[startIndex]);\n }\n // UTF16-BE, which isn't natively supported by NodeJS Buffers.\n // Length should be even, but pessimistically floor just in case.\n const pairs = Math.floor(length / 2);\n const chars = new Array(pairs);\n for (let i = 0; i < pairs; i++) {\n const pos = startIndex + (i << 1);\n chars[i] = String.fromCharCode(data[pos + 1] | (data[pos] << 8));\n }\n return chars.join('');\n}\n\n/**\n * @hidden\n */\nfunction getDate(data: Buffer, startIndex: number): Date {\n const year = parseInt(getASCIIString(data, startIndex, 4), 10);\n const mon = parseInt(getASCIIString(data, startIndex + 4, 2), 10);\n const day = parseInt(getASCIIString(data, startIndex + 6, 2), 10);\n const hour = parseInt(getASCIIString(data, startIndex + 8, 2), 10);\n const min = parseInt(getASCIIString(data, startIndex + 10, 2), 10);\n const sec = parseInt(getASCIIString(data, startIndex + 12, 2), 10);\n const hundrethsSec = parseInt(getASCIIString(data, startIndex + 14, 2), 10);\n // Last is a time-zone offset, but JavaScript dates don't support time zones well.\n return new Date(year, mon, day, hour, min, sec, hundrethsSec * 100);\n}\n\n/**\n * @hidden\n */\nfunction getShortFormDate(data: Buffer, startIndex: number): Date {\n const yearsSince1900 = data[startIndex];\n const month = data[startIndex + 1];\n const day = data[startIndex + 2];\n const hour = data[startIndex + 3];\n const minute = data[startIndex + 4];\n const second = data[startIndex + 5];\n // JavaScript's Date support isn't so great; ignore timezone.\n // const offsetFromGMT = this._data[24];\n return new Date(yearsSince1900, month - 1, day, hour, minute, second);\n}\n\n/**\n * @hidden\n */\nfunction constructSystemUseEntry(bigData: Buffer, i: number): SystemUseEntry {\n const data = bigData.slice(i);\n const sue = new SystemUseEntry(data);\n switch (sue.signatureWord()) {\n case SystemUseEntrySignatures.CE:\n return new CEEntry(data);\n case SystemUseEntrySignatures.PD:\n return new PDEntry(data);\n case SystemUseEntrySignatures.SP:\n return new SPEntry(data);\n case SystemUseEntrySignatures.ST:\n return new STEntry(data);\n case SystemUseEntrySignatures.ER:\n return new EREntry(data);\n case SystemUseEntrySignatures.ES:\n return new ESEntry(data);\n case SystemUseEntrySignatures.PX:\n return new PXEntry(data);\n case SystemUseEntrySignatures.PN:\n return new PNEntry(data);\n case SystemUseEntrySignatures.SL:\n return new SLEntry(data);\n case SystemUseEntrySignatures.NM:\n return new NMEntry(data);\n case SystemUseEntrySignatures.CL:\n return new CLEntry(data);\n case SystemUseEntrySignatures.PL:\n return new PLEntry(data);\n case SystemUseEntrySignatures.RE:\n return new REEntry(data);\n case SystemUseEntrySignatures.TF:\n return new TFEntry(data);\n case SystemUseEntrySignatures.SF:\n return new SFEntry(data);\n case SystemUseEntrySignatures.RR:\n return new RREntry(data);\n default:\n return sue;\n }\n}\n\n/**\n * @hidden\n */\nfunction constructSystemUseEntries(data: Buffer, i: number, len: number, isoData: Buffer): SystemUseEntry[] {\n // If the remaining allocated space following the last recorded System Use Entry in a System\n // Use field or Continuation Area is less than four bytes long, it cannot contain a System\n // Use Entry and shall be ignored\n len = len - 4;\n let entries = new Array();\n while (i < len) {\n const entry = constructSystemUseEntry(data, i);\n const length = entry.length();\n if (length === 0) {\n // Invalid SU section; prevent infinite loop.\n return entries;\n }\n i += length;\n if (entry instanceof STEntry) {\n // ST indicates the end of entries.\n break;\n }\n if (entry instanceof CEEntry) {\n entries = entries.concat(entry.getEntries(isoData));\n } else {\n entries.push(entry);\n }\n }\n return entries;\n}\n\n/**\n * @hidden\n */\nclass VolumeDescriptor {\n protected _data: Buffer;\n constructor(data: Buffer) {\n this._data = data;\n }\n public type(): VolumeDescriptorTypeCode {\n return this._data[0];\n }\n public standardIdentifier(): string {\n return getASCIIString(this._data, 1, 5);\n }\n public version(): number {\n return this._data[6];\n }\n public data(): Buffer {\n return this._data.slice(7, 2048);\n }\n}\n\n/**\n * @hidden\n */\nabstract class PrimaryOrSupplementaryVolumeDescriptor extends VolumeDescriptor {\n private _root: DirectoryRecord | null = null;\n constructor(data: Buffer) {\n super(data);\n }\n public systemIdentifier(): string {\n return this._getString32(8);\n }\n public volumeIdentifier(): string {\n return this._getString32(40);\n }\n public volumeSpaceSize(): number {\n return this._data.readUInt32LE(80);\n }\n public volumeSetSize(): number {\n return this._data.readUInt16LE(120);\n }\n public volumeSequenceNumber(): number {\n return this._data.readUInt16LE(124);\n }\n public logicalBlockSize(): number {\n return this._data.readUInt16LE(128);\n }\n public pathTableSize(): number {\n return this._data.readUInt32LE(132);\n }\n public locationOfTypeLPathTable(): number {\n return this._data.readUInt32LE(140);\n }\n public locationOfOptionalTypeLPathTable(): number {\n return this._data.readUInt32LE(144);\n }\n public locationOfTypeMPathTable(): number {\n return this._data.readUInt32BE(148);\n }\n public locationOfOptionalTypeMPathTable(): number {\n return this._data.readUInt32BE(152);\n }\n public rootDirectoryEntry(isoData: Buffer): DirectoryRecord {\n if (this._root === null) {\n this._root = this._constructRootDirectoryRecord(this._data.slice(156));\n this._root.rootCheckForRockRidge(isoData);\n }\n return this._root;\n }\n public volumeSetIdentifier(): string {\n return this._getString(190, 128);\n }\n public publisherIdentifier(): string {\n return this._getString(318, 128);\n }\n public dataPreparerIdentifier(): string {\n return this._getString(446, 128);\n }\n public applicationIdentifier(): string {\n return this._getString(574, 128);\n }\n public copyrightFileIdentifier(): string {\n return this._getString(702, 38);\n }\n public abstractFileIdentifier(): string {\n return this._getString(740, 36);\n }\n public bibliographicFileIdentifier(): string {\n return this._getString(776, 37);\n }\n public volumeCreationDate(): Date {\n return getDate(this._data, 813);\n }\n public volumeModificationDate(): Date {\n return getDate(this._data, 830);\n }\n public volumeExpirationDate(): Date {\n return getDate(this._data, 847);\n }\n public volumeEffectiveDate(): Date {\n return getDate(this._data, 864);\n }\n public fileStructureVersion(): number {\n return this._data[881];\n }\n public applicationUsed(): Buffer {\n return this._data.slice(883, 883 + 512);\n }\n public reserved(): Buffer {\n return this._data.slice(1395, 1395 + 653);\n }\n public abstract name(): string;\n protected abstract _constructRootDirectoryRecord(data: Buffer): DirectoryRecord;\n protected abstract _getString(idx: number, len: number): string;\n protected _getString32(idx: number): string {\n return this._getString(idx, 32);\n }\n}\n\n/**\n * @hidden\n */\nclass PrimaryVolumeDescriptor extends PrimaryOrSupplementaryVolumeDescriptor {\n constructor(data: Buffer) {\n super(data);\n if (this.type() !== VolumeDescriptorTypeCode.PrimaryVolumeDescriptor) {\n throw new ApiError(ErrorCode.EIO, `Invalid primary volume descriptor.`);\n }\n }\n public name() {\n return \"ISO9660\";\n }\n protected _constructRootDirectoryRecord(data: Buffer): DirectoryRecord {\n return new ISODirectoryRecord(data, -1);\n }\n protected _getString(idx: number, len: number): string {\n return this._getString(idx, len);\n }\n}\n\n/**\n * @hidden\n */\nclass SupplementaryVolumeDescriptor extends PrimaryOrSupplementaryVolumeDescriptor {\n constructor(data: Buffer) {\n super(data);\n if (this.type() !== VolumeDescriptorTypeCode.SupplementaryVolumeDescriptor) {\n throw new ApiError(ErrorCode.EIO, `Invalid supplementary volume descriptor.`);\n }\n const escapeSequence = this.escapeSequence();\n const third = escapeSequence[2];\n // Third character identifies what 'level' of the UCS specification to follow.\n // We ignore it.\n if (escapeSequence[0] !== 0x25 || escapeSequence[1] !== 0x2F ||\n (third !== 0x40 && third !== 0x43 && third !== 0x45)) {\n throw new ApiError(ErrorCode.EIO, `Unrecognized escape sequence for SupplementaryVolumeDescriptor: ${escapeSequence.toString()}`);\n }\n }\n public name() {\n return \"Joliet\";\n }\n public escapeSequence(): Buffer {\n return this._data.slice(88, 120);\n }\n protected _constructRootDirectoryRecord(data: Buffer): DirectoryRecord {\n return new JolietDirectoryRecord(data, -1);\n }\n protected _getString(idx: number, len: number): string {\n return getJolietString(this._data, idx, len);\n }\n}\n\n/**\n * @hidden\n */\nconst enum FileFlags {\n Hidden = 1,\n Directory = 1 << 1,\n AssociatedFile = 1 << 2,\n EARContainsInfo = 1 << 3,\n EARContainsPerms = 1 << 4,\n FinalDirectoryRecordForFile = 1 << 5\n}\n\n/**\n * @hidden\n */\nabstract class DirectoryRecord {\n protected _data: Buffer;\n // Offset at which system use entries begin. Set to -1 if not enabled.\n protected _rockRidgeOffset: number;\n protected _suEntries: SystemUseEntry[] | null = null;\n private _fileOrDir: Buffer | Directory | null = null;\n constructor(data: Buffer, rockRidgeOffset: number) {\n this._data = data;\n this._rockRidgeOffset = rockRidgeOffset;\n }\n public hasRockRidge(): boolean {\n return this._rockRidgeOffset > -1;\n }\n public getRockRidgeOffset(): number {\n return this._rockRidgeOffset;\n }\n /**\n * !!ONLY VALID ON ROOT NODE!!\n * Checks if Rock Ridge is enabled, and sets the offset.\n */\n public rootCheckForRockRidge(isoData: Buffer): void {\n const dir = this.getDirectory(isoData);\n this._rockRidgeOffset = dir.getDotEntry(isoData)._getRockRidgeOffset(isoData);\n if (this._rockRidgeOffset > -1) {\n // Wipe out directory. Start over with RR knowledge.\n this._fileOrDir = null;\n }\n }\n public length(): number {\n return this._data[0];\n }\n public extendedAttributeRecordLength(): number {\n return this._data[1];\n }\n public lba(): number {\n return this._data.readUInt32LE(2) * 2048;\n }\n public dataLength(): number {\n return this._data.readUInt32LE(10);\n }\n public recordingDate(): Date {\n return getShortFormDate(this._data, 18);\n }\n public fileFlags(): number {\n return this._data[25];\n }\n public fileUnitSize(): number {\n return this._data[26];\n }\n public interleaveGapSize(): number {\n return this._data[27];\n }\n public volumeSequenceNumber(): number {\n return this._data.readUInt16LE(28);\n }\n public identifier(): string {\n return this._getString(33, this._data[32]);\n }\n public fileName(isoData: Buffer): string {\n if (this.hasRockRidge()) {\n const fn = this._rockRidgeFilename(isoData);\n if (fn !== null) {\n return fn;\n }\n }\n const ident = this.identifier();\n if (this.isDirectory(isoData)) {\n return ident;\n }\n // Files:\n // - MUST have 0x2E (.) separating the name from the extension\n // - MUST have 0x3B (;) separating the file name and extension from the version\n // Gets expanded to two-byte char in Unicode directory records.\n const versionSeparator = ident.indexOf(';');\n if (versionSeparator === -1) {\n // Some Joliet filenames lack the version separator, despite the standard\n // specifying that it should be there.\n return ident;\n } else if (ident[versionSeparator - 1] === '.') {\n // Empty extension. Do not include '.' in the filename.\n return ident.slice(0, versionSeparator - 1);\n } else {\n // Include up to version separator.\n return ident.slice(0, versionSeparator);\n }\n }\n public isDirectory(isoData: Buffer): boolean {\n let rv = !!(this.fileFlags() & FileFlags.Directory);\n // If it lacks the Directory flag, it may still be a directory if we've exceeded the directory\n // depth limit. Rock Ridge marks these as files and adds a special attribute.\n if (!rv && this.hasRockRidge()) {\n rv = this.getSUEntries(isoData).filter((e) => e instanceof CLEntry).length > 0;\n }\n return rv;\n }\n public isSymlink(isoData: Buffer): boolean {\n return this.hasRockRidge() && this.getSUEntries(isoData).filter((e) => e instanceof SLEntry).length > 0;\n }\n public getSymlinkPath(isoData: Buffer): string {\n let p = \"\";\n const entries = this.getSUEntries(isoData);\n const getStr = this._getGetString();\n for (const entry of entries) {\n if (entry instanceof SLEntry) {\n const components = entry.componentRecords();\n for (const component of components) {\n const flags = component.flags();\n if (flags & SLComponentFlags.CURRENT) {\n p += \"./\";\n } else if (flags & SLComponentFlags.PARENT) {\n p += \"../\";\n } else if (flags & SLComponentFlags.ROOT) {\n p += \"/\";\n } else {\n p += component.content(getStr);\n if (!(flags & SLComponentFlags.CONTINUE)) {\n p += '/';\n }\n }\n }\n if (!entry.continueFlag()) {\n // We are done with this link.\n break;\n }\n }\n }\n if (p.length > 1 && p[p.length - 1] === '/') {\n // Trim trailing '/'.\n return p.slice(0, p.length - 1);\n } else {\n return p;\n }\n }\n public getFile(isoData: Buffer): Buffer {\n if (this.isDirectory(isoData)) {\n throw new Error(`Tried to get a File from a directory.`);\n }\n if (this._fileOrDir === null) {\n this._fileOrDir = isoData.slice(this.lba(), this.lba() + this.dataLength());\n }\n return this._fileOrDir;\n }\n public getDirectory(isoData: Buffer): Directory {\n if (!this.isDirectory(isoData)) {\n throw new Error(`Tried to get a Directory from a file.`);\n }\n if (this._fileOrDir === null) {\n this._fileOrDir = this._constructDirectory(isoData);\n }\n return > this._fileOrDir;\n }\n public getSUEntries(isoData: Buffer): SystemUseEntry[] {\n if (!this._suEntries) {\n this._constructSUEntries(isoData);\n }\n return this._suEntries!;\n }\n protected abstract _getString(i: number, len: number): string;\n protected abstract _getGetString(): TGetString;\n protected abstract _constructDirectory(isoData: Buffer): Directory;\n protected _rockRidgeFilename(isoData: Buffer): string | null {\n const nmEntries = this.getSUEntries(isoData).filter((e) => e instanceof NMEntry);\n if (nmEntries.length === 0 || nmEntries[0].flags() & (NMFlags.CURRENT | NMFlags.PARENT)) {\n return null;\n }\n let str = '';\n const getString = this._getGetString();\n for (const e of nmEntries) {\n str += e.name(getString);\n if (!(e.flags() & NMFlags.CONTINUE)) {\n break;\n }\n }\n return str;\n }\n private _constructSUEntries(isoData: Buffer): void {\n let i = 33 + this._data[32];\n if (i % 2 === 1) {\n // Skip padding field.\n i++;\n }\n i += this._rockRidgeOffset;\n this._suEntries = constructSystemUseEntries(this._data, i, this.length(), isoData);\n }\n /**\n * !!ONLY VALID ON FIRST ENTRY OF ROOT DIRECTORY!!\n * Returns -1 if rock ridge is not enabled. Otherwise, returns the offset\n * at which system use fields begin.\n */\n private _getRockRidgeOffset(isoData: Buffer): number {\n // In the worst case, we get some garbage SU entries.\n // Fudge offset to 0 before proceeding.\n this._rockRidgeOffset = 0;\n const suEntries = this.getSUEntries(isoData);\n if (suEntries.length > 0) {\n const spEntry = suEntries[0];\n if (spEntry instanceof SPEntry && spEntry.checkBytesPass()) {\n // SUSP is in use.\n for (let i = 1; i < suEntries.length; i++) {\n const entry = suEntries[i];\n if (entry instanceof RREntry || (entry instanceof EREntry && entry.extensionIdentifier() === rockRidgeIdentifier)) {\n // Rock Ridge is in use!\n return spEntry.bytesSkipped();\n }\n }\n }\n }\n // Failed.\n this._rockRidgeOffset = -1;\n return -1;\n }\n}\n\n/**\n * @hidden\n */\nclass ISODirectoryRecord extends DirectoryRecord {\n constructor(data: Buffer, rockRidgeOffset: number) {\n super(data, rockRidgeOffset);\n }\n protected _getString(i: number, len: number): string {\n return getASCIIString(this._data, i, len);\n }\n protected _constructDirectory(isoData: Buffer): Directory {\n return new ISODirectory(this, isoData);\n }\n protected _getGetString(): TGetString {\n return getASCIIString;\n }\n}\n\n/**\n * @hidden\n */\nclass JolietDirectoryRecord extends DirectoryRecord {\n constructor(data: Buffer, rockRidgeOffset: number) {\n super(data, rockRidgeOffset);\n }\n protected _getString(i: number, len: number): string {\n return getJolietString(this._data, i, len);\n }\n protected _constructDirectory(isoData: Buffer): Directory {\n return new JolietDirectory(this, isoData);\n }\n protected _getGetString(): TGetString {\n return getJolietString;\n }\n}\n\n/**\n * @hidden\n */\nconst enum SystemUseEntrySignatures {\n CE = 0x4345,\n PD = 0x5044,\n SP = 0x5350,\n ST = 0x5354,\n ER = 0x4552,\n ES = 0x4553,\n PX = 0x5058,\n PN = 0x504E,\n SL = 0x534C,\n NM = 0x4E4D,\n CL = 0x434C,\n PL = 0x504C,\n RE = 0x5245,\n TF = 0x5446,\n SF = 0x5346,\n RR = 0x5252\n}\n\n/**\n * @hidden\n */\nclass SystemUseEntry {\n protected _data: Buffer;\n constructor(data: Buffer) {\n this._data = data;\n }\n public signatureWord(): SystemUseEntrySignatures {\n return this._data.readUInt16BE(0);\n }\n public signatureWordString(): string {\n return getASCIIString(this._data, 0, 2);\n }\n public length(): number {\n return this._data[2];\n }\n public suVersion(): number {\n return this._data[3];\n }\n}\n\n/**\n * Continuation entry.\n * @hidden\n */\nclass CEEntry extends SystemUseEntry {\n private _entries: SystemUseEntry[] | null = null;\n constructor(data: Buffer) {\n super(data);\n }\n /**\n * Logical block address of the continuation area.\n */\n public continuationLba(): number {\n return this._data.readUInt32LE(4);\n }\n /**\n * Offset into the logical block.\n */\n public continuationLbaOffset(): number {\n return this._data.readUInt32LE(12);\n }\n /**\n * Length of the continuation area.\n */\n public continuationLength(): number {\n return this._data.readUInt32LE(20);\n }\n public getEntries(isoData: Buffer): SystemUseEntry[] {\n if (!this._entries) {\n const start = this.continuationLba() * 2048 + this.continuationLbaOffset();\n this._entries = constructSystemUseEntries(isoData, start, this.continuationLength(), isoData);\n }\n return this._entries;\n }\n}\n\n/**\n * Padding entry.\n * @hidden\n */\nclass PDEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n}\n\n/**\n * Identifies that SUSP is in-use.\n * @hidden\n */\nclass SPEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public checkBytesPass(): boolean {\n return this._data[4] === 0xBE && this._data[5] === 0xEF;\n }\n public bytesSkipped(): number {\n return this._data[6];\n }\n}\n\n/**\n * Identifies the end of the SUSP entries.\n * @hidden\n */\nclass STEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n}\n\n/**\n * Specifies system-specific extensions to SUSP.\n * @hidden\n */\nclass EREntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public identifierLength(): number {\n return this._data[4];\n }\n public descriptorLength(): number {\n return this._data[5];\n }\n public sourceLength(): number {\n return this._data[6];\n }\n public extensionVersion(): number {\n return this._data[7];\n }\n public extensionIdentifier(): string {\n return getASCIIString(this._data, 8, this.identifierLength());\n }\n public extensionDescriptor(): string {\n return getASCIIString(this._data, 8 + this.identifierLength(), this.descriptorLength());\n }\n public extensionSource(): string {\n return getASCIIString(this._data, 8 + this.identifierLength() + this.descriptorLength(), this.sourceLength());\n }\n}\n\n/**\n * @hidden\n */\nclass ESEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public extensionSequence(): number {\n return this._data[4];\n }\n}\n\n/**\n * RockRidge: Marks that RockRidge is in use [deprecated]\n * @hidden\n */\nclass RREntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n}\n\n/**\n * RockRidge: Records POSIX file attributes.\n * @hidden\n */\nclass PXEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public mode(): number {\n return this._data.readUInt32LE(4);\n }\n public fileLinks(): number {\n return this._data.readUInt32LE(12);\n }\n public uid(): number {\n return this._data.readUInt32LE(20);\n }\n public gid(): number {\n return this._data.readUInt32LE(28);\n }\n public inode(): number {\n return this._data.readUInt32LE(36);\n }\n}\n\n/**\n * RockRidge: Records POSIX device number.\n * @hidden\n */\nclass PNEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public devTHigh(): number {\n return this._data.readUInt32LE(4);\n }\n public devTLow(): number {\n return this._data.readUInt32LE(12);\n }\n}\n\n/**\n * RockRidge: Records symbolic link\n * @hidden\n */\nclass SLEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public flags(): number {\n return this._data[4];\n }\n public continueFlag(): number {\n return this.flags() & 0x1;\n }\n public componentRecords(): SLComponentRecord[] {\n const records = new Array();\n let i = 5;\n while (i < this.length()) {\n const record = new SLComponentRecord(this._data.slice(i));\n records.push(record);\n i += record.length();\n }\n return records;\n }\n}\n\n/**\n * @hidden\n */\nconst enum SLComponentFlags {\n CONTINUE = 1,\n CURRENT = 1 << 1,\n PARENT = 1 << 2,\n ROOT = 1 << 3\n}\n\n/**\n * @hidden\n */\nclass SLComponentRecord {\n private _data: Buffer;\n constructor(data: Buffer) {\n this._data = data;\n }\n public flags(): SLComponentFlags {\n return this._data[0];\n }\n public length(): number {\n return 2 + this.componentLength();\n }\n public componentLength(): number {\n return this._data[1];\n }\n public content(getString: TGetString): string {\n return getString(this._data, 2, this.componentLength());\n }\n}\n\n/**\n * @hidden\n */\nconst enum NMFlags {\n CONTINUE = 1,\n CURRENT = 1 << 1,\n PARENT = 1 << 2\n}\n\n/**\n * RockRidge: Records alternate file name\n * @hidden\n */\nclass NMEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public flags(): NMFlags {\n return this._data[4];\n }\n public name(getString: TGetString): string {\n return getString(this._data, 5, this.length() - 5);\n }\n}\n\n/**\n * RockRidge: Records child link\n * @hidden\n */\nclass CLEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public childDirectoryLba(): number {\n return this._data.readUInt32LE(4);\n }\n}\n\n/**\n * RockRidge: Records parent link.\n * @hidden\n */\nclass PLEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public parentDirectoryLba(): number {\n return this._data.readUInt32LE(4);\n }\n}\n\n/**\n * RockRidge: Records relocated directory.\n * @hidden\n */\nclass REEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n}\n\n/**\n * @hidden\n */\nconst enum TFFlags {\n CREATION = 1,\n MODIFY = 1 << 1,\n ACCESS = 1 << 2,\n ATTRIBUTES = 1 << 3,\n BACKUP = 1 << 4,\n EXPIRATION = 1 << 5,\n EFFECTIVE = 1 << 6,\n LONG_FORM = 1 << 7\n}\n\n/**\n * RockRidge: Records file timestamps\n * @hidden\n */\nclass TFEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public flags(): number {\n return this._data[4];\n }\n public creation(): Date | null {\n if (this.flags() & TFFlags.CREATION) {\n if (this._longFormDates()) {\n return getDate(this._data, 5);\n } else {\n return getShortFormDate(this._data, 5);\n }\n } else {\n return null;\n }\n }\n public modify(): Date | null {\n if (this.flags() & TFFlags.MODIFY) {\n const previousDates = (this.flags() & TFFlags.CREATION) ? 1 : 0;\n if (this._longFormDates) {\n return getDate(this._data, 5 + (previousDates * 17));\n } else {\n return getShortFormDate(this._data, 5 + (previousDates * 7));\n }\n } else {\n return null;\n }\n }\n public access(): Date | null {\n if (this.flags() & TFFlags.ACCESS) {\n let previousDates = (this.flags() & TFFlags.CREATION) ? 1 : 0;\n previousDates += (this.flags() & TFFlags.MODIFY) ? 1 : 0;\n if (this._longFormDates) {\n return getDate(this._data, 5 + (previousDates * 17));\n } else {\n return getShortFormDate(this._data, 5 + (previousDates * 7));\n }\n } else {\n return null;\n }\n }\n public backup(): Date | null {\n if (this.flags() & TFFlags.BACKUP) {\n let previousDates = (this.flags() & TFFlags.CREATION) ? 1 : 0;\n previousDates += (this.flags() & TFFlags.MODIFY) ? 1 : 0;\n previousDates += (this.flags() & TFFlags.ACCESS) ? 1 : 0;\n if (this._longFormDates) {\n return getDate(this._data, 5 + (previousDates * 17));\n } else {\n return getShortFormDate(this._data, 5 + (previousDates * 7));\n }\n } else {\n return null;\n }\n }\n public expiration(): Date | null {\n if (this.flags() & TFFlags.EXPIRATION) {\n let previousDates = (this.flags() & TFFlags.CREATION) ? 1 : 0;\n previousDates += (this.flags() & TFFlags.MODIFY) ? 1 : 0;\n previousDates += (this.flags() & TFFlags.ACCESS) ? 1 : 0;\n previousDates += (this.flags() & TFFlags.BACKUP) ? 1 : 0;\n if (this._longFormDates) {\n return getDate(this._data, 5 + (previousDates * 17));\n } else {\n return getShortFormDate(this._data, 5 + (previousDates * 7));\n }\n } else {\n return null;\n }\n }\n public effective(): Date | null {\n if (this.flags() & TFFlags.EFFECTIVE) {\n let previousDates = (this.flags() & TFFlags.CREATION) ? 1 : 0;\n previousDates += (this.flags() & TFFlags.MODIFY) ? 1 : 0;\n previousDates += (this.flags() & TFFlags.ACCESS) ? 1 : 0;\n previousDates += (this.flags() & TFFlags.BACKUP) ? 1 : 0;\n previousDates += (this.flags() & TFFlags.EXPIRATION) ? 1 : 0;\n if (this._longFormDates) {\n return getDate(this._data, 5 + (previousDates * 17));\n } else {\n return getShortFormDate(this._data, 5 + (previousDates * 7));\n }\n } else {\n return null;\n }\n }\n private _longFormDates(): boolean {\n return !!(this.flags() && TFFlags.LONG_FORM);\n }\n}\n\n/**\n * RockRidge: File data in sparse format.\n * @hidden\n */\nclass SFEntry extends SystemUseEntry {\n constructor(data: Buffer) {\n super(data);\n }\n public virtualSizeHigh(): number {\n return this._data.readUInt32LE(4);\n }\n public virtualSizeLow(): number {\n return this._data.readUInt32LE(12);\n }\n public tableDepth(): number {\n return this._data[20];\n }\n}\n\n/**\n * @hidden\n */\nabstract class Directory {\n protected _record: T;\n private _fileList: string[] = [];\n private _fileMap: {[name: string]: T} = {};\n constructor(record: T, isoData: Buffer) {\n this._record = record;\n let i = record.lba();\n let iLimit = i + record.dataLength();\n if (!(record.fileFlags() & FileFlags.Directory)) {\n // Must have a CL entry.\n const cl = record.getSUEntries(isoData).filter((e) => e instanceof CLEntry)[0];\n i = cl.childDirectoryLba() * 2048;\n iLimit = Infinity;\n }\n\n while (i < iLimit) {\n const len = isoData[i];\n // Zero-padding between sectors.\n // TODO: Could optimize this to seek to nearest-sector upon\n // seeing a 0.\n if (len === 0) {\n i++;\n continue;\n }\n const r = this._constructDirectoryRecord(isoData.slice(i));\n const fname = r.fileName(isoData);\n // Skip '.' and '..' entries.\n if (fname !== '\\u0000' && fname !== '\\u0001') {\n // Skip relocated entries.\n if (!r.hasRockRidge() || r.getSUEntries(isoData).filter((e) => e instanceof REEntry).length === 0) {\n this._fileMap[fname] = r;\n this._fileList.push(fname);\n }\n } else if (iLimit === Infinity) {\n // First entry contains needed data.\n iLimit = i + r.dataLength();\n }\n i += r.length();\n }\n }\n /**\n * Get the record with the given name.\n * Returns undefined if not present.\n */\n public getRecord(name: string): DirectoryRecord {\n return this._fileMap[name];\n }\n public getFileList(): string[] {\n return this._fileList;\n }\n public getDotEntry(isoData: Buffer): T {\n return this._constructDirectoryRecord(isoData.slice(this._record.lba()));\n }\n protected abstract _constructDirectoryRecord(data: Buffer): T;\n}\n\n/**\n * @hidden\n */\nclass ISODirectory extends Directory {\n constructor(record: ISODirectoryRecord, isoData: Buffer) {\n super(record, isoData);\n }\n protected _constructDirectoryRecord(data: Buffer): ISODirectoryRecord {\n return new ISODirectoryRecord(data, this._record.getRockRidgeOffset());\n }\n}\n\n/**\n * @hidden\n */\nclass JolietDirectory extends Directory {\n constructor(record: JolietDirectoryRecord, isoData: Buffer) {\n super(record, isoData);\n }\n protected _constructDirectoryRecord(data: Buffer): JolietDirectoryRecord {\n return new JolietDirectoryRecord(data, this._record.getRockRidgeOffset());\n }\n}\n\n/**\n * Options for IsoFS file system instances.\n */\nexport interface IsoFSOptions {\n // The ISO file in a buffer.\n data: Buffer;\n // The name of the ISO (optional; used for debug messages / identification via getName()).\n name?: string;\n}\n\n/**\n * Mounts an ISO file as a read-only file system.\n *\n * Supports:\n * * Vanilla ISO9660 ISOs\n * * Microsoft Joliet and Rock Ridge extensions to the ISO9660 standard\n */\nexport default class IsoFS extends SynchronousFileSystem implements FileSystem {\n public static readonly Name = \"IsoFS\";\n\n public static readonly Options: FileSystemOptions = {\n data: {\n type: \"object\",\n description: \"The ISO file in a buffer\",\n validator: bufferValidator\n }\n };\n\n /**\n * Creates an IsoFS instance with the given options.\n */\n public static Create(opts: IsoFSOptions, cb: BFSCallback): void {\n let fs: IsoFS | undefined;\n let e: ApiError | undefined;\n try {\n fs = new IsoFS(opts.data, opts.name, false);\n } catch (e) {\n e = e;\n } finally {\n cb(e, fs);\n }\n }\n public static isAvailable(): boolean {\n return true;\n }\n\n private _data: Buffer;\n private _pvd: PrimaryOrSupplementaryVolumeDescriptor;\n private _root: DirectoryRecord;\n private _name: string;\n\n /**\n * **Deprecated. Please use IsoFS.Create() method instead.**\n *\n * Constructs a read-only file system from the given ISO.\n * @param data The ISO file in a buffer.\n * @param name The name of the ISO (optional; used for debug messages / identification via getName()).\n */\n constructor(data: Buffer, name: string = \"\", deprecateMsg = true) {\n super();\n this._data = data;\n deprecationMessage(deprecateMsg, IsoFS.Name, {data: \"ISO data as a Buffer\", name: name});\n // Skip first 16 sectors.\n let vdTerminatorFound = false;\n let i = 16 * 2048;\n const candidateVDs = new Array();\n while (!vdTerminatorFound) {\n const slice = data.slice(i);\n const vd = new VolumeDescriptor(slice);\n switch (vd.type()) {\n case VolumeDescriptorTypeCode.PrimaryVolumeDescriptor:\n candidateVDs.push(new PrimaryVolumeDescriptor(slice));\n break;\n case VolumeDescriptorTypeCode.SupplementaryVolumeDescriptor:\n candidateVDs.push(new SupplementaryVolumeDescriptor(slice));\n break;\n case VolumeDescriptorTypeCode.VolumeDescriptorSetTerminator:\n vdTerminatorFound = true;\n break;\n }\n i += 2048;\n }\n if (candidateVDs.length === 0) {\n throw new ApiError(ErrorCode.EIO, `Unable to find a suitable volume descriptor.`);\n }\n candidateVDs.forEach((v) => {\n // Take an SVD over a PVD.\n if (!this._pvd || this._pvd.type() !== VolumeDescriptorTypeCode.SupplementaryVolumeDescriptor) {\n this._pvd = v;\n }\n });\n this._root = this._pvd.rootDirectoryEntry(data);\n this._name = name;\n }\n\n public getName(): string {\n let name = `IsoFS${this._name}${this._pvd ? `-${this._pvd.name()}` : ''}`;\n if (this._root && this._root.hasRockRidge()) {\n name += `-RockRidge`;\n }\n return name;\n }\n\n public diskSpace(path: string, cb: (total: number, free: number) => void): void {\n // Read-only file system.\n cb(this._data.length, 0);\n }\n\n public isReadOnly(): boolean {\n return true;\n }\n\n public supportsLinks(): boolean {\n return false;\n }\n\n public supportsProps(): boolean {\n return false;\n }\n\n public supportsSynch(): boolean {\n return true;\n }\n\n public statSync(p: string, isLstat: boolean): Stats {\n const record = this._getDirectoryRecord(p);\n if (record === null) {\n throw ApiError.ENOENT(p);\n }\n return this._getStats(p, record)!;\n }\n\n public openSync(p: string, flags: FileFlag, mode: number): File {\n // INVARIANT: Cannot write to RO file systems.\n if (flags.isWriteable()) {\n throw new ApiError(ErrorCode.EPERM, p);\n }\n // Check if the path exists, and is a file.\n const record = this._getDirectoryRecord(p);\n if (!record) {\n throw ApiError.ENOENT(p);\n } else if (record.isSymlink(this._data)) {\n return this.openSync(path.resolve(p, record.getSymlinkPath(this._data)), flags, mode);\n } else if (!record.isDirectory(this._data)) {\n const data = record.getFile(this._data);\n const stats = this._getStats(p, record)!;\n switch (flags.pathExistsAction()) {\n case ActionType.THROW_EXCEPTION:\n case ActionType.TRUNCATE_FILE:\n throw ApiError.EEXIST(p);\n case ActionType.NOP:\n return new NoSyncFile(this, p, flags, stats, data);\n default:\n throw new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.');\n }\n } else {\n throw ApiError.EISDIR(p);\n }\n }\n\n public readdirSync(path: string): string[] {\n // Check if it exists.\n const record = this._getDirectoryRecord(path);\n if (!record) {\n throw ApiError.ENOENT(path);\n } else if (record.isDirectory(this._data)) {\n return record.getDirectory(this._data).getFileList().slice(0);\n } else {\n throw ApiError.ENOTDIR(path);\n }\n }\n\n /**\n * Specially-optimized readfile.\n */\n public readFileSync(fname: string, encoding: string, flag: FileFlag): any {\n // Get file.\n const fd = this.openSync(fname, flag, 0x1a4);\n try {\n const fdCast = > fd;\n const fdBuff = fdCast.getBuffer();\n if (encoding === null) {\n return copyingSlice(fdBuff);\n }\n return fdBuff.toString(encoding);\n } finally {\n fd.closeSync();\n }\n }\n\n private _getDirectoryRecord(path: string): DirectoryRecord | null {\n // Special case.\n if (path === '/') {\n return this._root;\n }\n const components = path.split('/').slice(1);\n let dir = this._root;\n for (const component of components) {\n if (dir.isDirectory(this._data)) {\n dir = dir.getDirectory(this._data).getRecord(component);\n if (!dir) {\n return null;\n }\n } else {\n return null;\n }\n }\n return dir;\n }\n\n private _getStats(p: string, record: DirectoryRecord): Stats | null {\n if (record.isSymlink(this._data)) {\n const newP = path.resolve(p, record.getSymlinkPath(this._data));\n const dirRec = this._getDirectoryRecord(newP);\n if (!dirRec) {\n return null;\n }\n return this._getStats(newP, dirRec);\n } else {\n const len = record.dataLength();\n let mode = 0x16D;\n const date = record.recordingDate();\n let atime = date;\n let mtime = date;\n let ctime = date;\n if (record.hasRockRidge()) {\n const entries = record.getSUEntries(this._data);\n for (const entry of entries) {\n if (entry instanceof PXEntry) {\n mode = entry.mode();\n } else if (entry instanceof TFEntry) {\n const flags = entry.flags();\n if (flags & TFFlags.ACCESS) {\n atime = entry.access()!;\n }\n if (flags & TFFlags.MODIFY) {\n mtime = entry.modify()!;\n }\n if (flags & TFFlags.CREATION) {\n ctime = entry.creation()!;\n }\n }\n }\n }\n // Mask out writeable flags. This is a RO file system.\n mode = mode & 0x16D;\n return new Stats(record.isDirectory(this._data) ? FileType.DIRECTORY : FileType.FILE, len, mode, atime, mtime, ctime);\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/IsoFS.ts","/**\n * BrowserFS's main module. This is exposed in the browser via the BrowserFS global.\n * Due to limitations in typedoc, we document these functions in ./typedoc.ts.\n */\n\nimport * as buffer from 'buffer';\nimport fs from './node_fs';\nimport * as path from 'path';\nimport {FileSystemConstructor, FileSystem, BFSOneArgCallback, BFSCallback} from './file_system';\nimport EmscriptenFS from '../generic/emscripten_fs';\nimport Backends from './backends';\nimport * as BFSUtils from './util';\nimport * as Errors from './api_error';\nimport setImmediate from '../generic/setImmediate';\n\nif (( process)['initializeTTYs']) {\n ( process)['initializeTTYs']();\n}\n\n/**\n * Installs BFSRequire as global `require`, a Node Buffer polyfill as the global `Buffer` variable,\n * and a Node process polyfill as the global `process` variable.\n */\nexport function install(obj: any) {\n obj.Buffer = Buffer;\n obj.process = process;\n const oldRequire = obj.require ? obj.require : null;\n // Monkey-patch require for Node-style code.\n obj.require = function(arg: string) {\n const rv = BFSRequire(arg);\n if (!rv) {\n return oldRequire.apply(null, Array.prototype.slice.call(arguments, 0));\n } else {\n return rv;\n }\n };\n}\n\n/**\n * @hidden\n */\nexport function registerFileSystem(name: string, fs: FileSystemConstructor) {\n ( Backends)[name] = fs;\n}\n\n/**\n * Polyfill for CommonJS `require()`. For example, can call `BFSRequire('fs')` to get a 'fs' module polyfill.\n */\nexport function BFSRequire(module: 'fs'): typeof fs;\nexport function BFSRequire(module: 'path'): typeof path;\nexport function BFSRequire(module: 'buffer'): typeof buffer;\nexport function BFSRequire(module: 'process'): typeof process;\nexport function BFSRequire(module: 'bfs_utils'): typeof BFSUtils;\nexport function BFSRequire(module: string): any;\nexport function BFSRequire(module: string): any {\n switch (module) {\n case 'fs':\n return fs;\n case 'path':\n return path;\n case 'buffer':\n // The 'buffer' module has 'Buffer' as a property.\n return buffer;\n case 'process':\n return process;\n case 'bfs_utils':\n return BFSUtils;\n default:\n return ( Backends)[module];\n }\n}\n\n/**\n * Initializes BrowserFS with the given root file system.\n */\nexport function initialize(rootfs: FileSystem) {\n return fs.initialize(rootfs);\n}\n\n/**\n * Creates a file system with the given configuration, and initializes BrowserFS with it.\n * See the FileSystemConfiguration type for more info on the configuration object.\n */\nexport function configure(config: FileSystemConfiguration, cb: BFSOneArgCallback): void {\n getFileSystem(config, (e, fs?) => {\n if (fs) {\n initialize(fs);\n cb();\n } else {\n cb(e);\n }\n });\n}\n\n/**\n * Specifies a file system backend type and its options.\n *\n * Individual options can recursively contain FileSystemConfiguration objects for\n * option values that require file systems.\n *\n * For example, to mirror Dropbox to LocalStorage with AsyncMirror, use the following\n * object:\n *\n * ```javascript\n * var config = {\n * fs: \"AsyncMirror\",\n * options: {\n * sync: {fs: \"LocalStorage\"},\n * async: {fs: \"Dropbox\", options: {client: anAuthenticatedDropboxSDKClient }}\n * }\n * };\n * ```\n *\n * The option object for each file system corresponds to that file system's option object passed to its `Create()` method.\n */\nexport interface FileSystemConfiguration {\n fs: string;\n options: any;\n}\n\n/**\n * Retrieve a file system with the given configuration.\n * @param config A FileSystemConfiguration object. See FileSystemConfiguration for details.\n * @param cb Called when the file system is constructed, or when an error occurs.\n */\nexport function getFileSystem(config: FileSystemConfiguration, cb: BFSCallback): void {\n const fsName = config['fs'];\n if (!fsName) {\n return cb(new Errors.ApiError(Errors.ErrorCode.EPERM, 'Missing \"fs\" property on configuration object.'));\n }\n const options = config['options'];\n let waitCount = 0;\n let called = false;\n function finish() {\n if (!called) {\n called = true;\n const fsc = ( Backends)[fsName];\n if (!fsc) {\n cb(new Errors.ApiError(Errors.ErrorCode.EPERM, `File system ${fsName} is not available in BrowserFS.`));\n } else {\n fsc.Create(options, cb);\n }\n }\n }\n\n if (options !== null && typeof(options) === \"object\") {\n let finishedIterating = false;\n const props = Object.keys(options).filter((k) => k !== 'fs');\n\n // Check recursively if other fields have 'fs' properties.\n props.forEach((p) => {\n const d = options[p];\n if (d !== null && typeof(d) === \"object\" && d['fs']) {\n waitCount++;\n getFileSystem(d, function(e, fs?) {\n waitCount--;\n if (e) {\n if (called) {\n return;\n }\n called = true;\n cb(e);\n } else {\n options[p] = fs;\n if (waitCount === 0 && finishedIterating) {\n finish();\n }\n }\n });\n }\n });\n finishedIterating = true;\n }\n if (waitCount === 0) {\n finish();\n }\n}\n\nexport {EmscriptenFS, Backends as FileSystem, Errors, setImmediate};\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/browserfs.ts","/**\n * Standard libc error codes. Add more to this enum and ErrorStrings as they are\n * needed.\n * @url http://www.gnu.org/software/libc/manual/html_node/Error-Codes.html\n */\nexport enum ErrorCode {\n EPERM = 1,\n ENOENT = 2,\n EIO = 5,\n EBADF = 9,\n EACCES = 13,\n EBUSY = 16,\n EEXIST = 17,\n ENOTDIR = 20,\n EISDIR = 21,\n EINVAL = 22,\n EFBIG = 27,\n ENOSPC = 28,\n EROFS = 30,\n ENOTEMPTY = 39,\n ENOTSUP = 95,\n}\n/* tslint:disable:variable-name */\n/**\n * Strings associated with each error code.\n * @hidden\n */\nexport const ErrorStrings: {[code: string]: string; [code: number]: string; } = {};\nErrorStrings[ErrorCode.EPERM] = 'Operation not permitted.';\nErrorStrings[ErrorCode.ENOENT] = 'No such file or directory.';\nErrorStrings[ErrorCode.EIO] = 'Input/output error.';\nErrorStrings[ErrorCode.EBADF] = 'Bad file descriptor.';\nErrorStrings[ErrorCode.EACCES] = 'Permission denied.';\nErrorStrings[ErrorCode.EBUSY] = 'Resource busy or locked.';\nErrorStrings[ErrorCode.EEXIST] = 'File exists.';\nErrorStrings[ErrorCode.ENOTDIR] = 'File is not a directory.';\nErrorStrings[ErrorCode.EISDIR] = 'File is a directory.';\nErrorStrings[ErrorCode.EINVAL] = 'Invalid argument.';\nErrorStrings[ErrorCode.EFBIG] = 'File is too big.';\nErrorStrings[ErrorCode.ENOSPC] = 'No space left on disk.';\nErrorStrings[ErrorCode.EROFS] = 'Cannot modify a read-only file system.';\nErrorStrings[ErrorCode.ENOTEMPTY] = 'Directory is not empty.';\nErrorStrings[ErrorCode.ENOTSUP] = 'Operation is not supported.';\n/* tslint:enable:variable-name */\n\n/**\n * Represents a BrowserFS error. Passed back to applications after a failed\n * call to the BrowserFS API.\n */\nexport class ApiError extends Error implements NodeJS.ErrnoException {\n public static fromJSON(json: any): ApiError {\n const err = new ApiError(0);\n err.errno = json.errno;\n err.code = json.code;\n err.path = json.path;\n err.stack = json.stack;\n err.message = json.message;\n return err;\n }\n\n /**\n * Creates an ApiError object from a buffer.\n */\n public static fromBuffer(buffer: Buffer, i: number = 0): ApiError {\n return ApiError.fromJSON(JSON.parse(buffer.toString('utf8', i + 4, i + 4 + buffer.readUInt32LE(i))));\n }\n\n public static FileError(code: ErrorCode, p: string): ApiError {\n return new ApiError(code, ErrorStrings[code], p);\n }\n public static ENOENT(path: string): ApiError {\n return this.FileError(ErrorCode.ENOENT, path);\n }\n\n public static EEXIST(path: string): ApiError {\n return this.FileError(ErrorCode.EEXIST, path);\n }\n\n public static EISDIR(path: string): ApiError {\n return this.FileError(ErrorCode.EISDIR, path);\n }\n\n public static ENOTDIR(path: string): ApiError {\n return this.FileError(ErrorCode.ENOTDIR, path);\n }\n\n public static EPERM(path: string): ApiError {\n return this.FileError(ErrorCode.EPERM, path);\n }\n\n public static ENOTEMPTY(path: string): ApiError {\n return this.FileError(ErrorCode.ENOTEMPTY, path);\n }\n\n public errno: ErrorCode;\n public code: string;\n public path: string | undefined;\n // Unsupported.\n public syscall: string = \"\";\n public stack: string | undefined;\n\n /**\n * Represents a BrowserFS error. Passed back to applications after a failed\n * call to the BrowserFS API.\n *\n * Error codes mirror those returned by regular Unix file operations, which is\n * what Node returns.\n * @constructor ApiError\n * @param type The type of the error.\n * @param [message] A descriptive error message.\n */\n constructor(type: ErrorCode, message: string = ErrorStrings[type], path?: string) {\n super(message);\n this.errno = type;\n this.code = ErrorCode[type];\n this.path = path;\n this.stack = new Error().stack;\n this.message = `Error: ${this.code}: ${message}${this.path ? `, '${this.path}'` : ''}`;\n }\n\n /**\n * @return A friendly error message.\n */\n public toString(): string {\n return this.message;\n }\n\n public toJSON(): any {\n return {\n errno: this.errno,\n code: this.code,\n path: this.path,\n stack: this.stack,\n message: this.message\n };\n }\n\n /**\n * Writes the API error into a buffer.\n */\n public writeToBuffer(buffer: Buffer = Buffer.alloc(this.bufferSize()), i: number = 0): Buffer {\n const bytesWritten = buffer.write(JSON.stringify(this.toJSON()), i + 4);\n buffer.writeUInt32LE(bytesWritten, i);\n return buffer;\n }\n\n /**\n * The size of the API error in buffer-form in bytes.\n */\n public bufferSize(): number {\n // 4 bytes for string length.\n return 4 + Buffer.byteLength(JSON.stringify(this.toJSON()));\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/api_error.ts","import {ErrorCode, ApiError} from './api_error';\n\nexport enum ActionType {\n // Indicates that the code should not do anything.\n NOP = 0,\n // Indicates that the code should throw an exception.\n THROW_EXCEPTION = 1,\n // Indicates that the code should truncate the file, but only if it is a file.\n TRUNCATE_FILE = 2,\n // Indicates that the code should create the file.\n CREATE_FILE = 3\n}\n\n/**\n * Represents one of the following file flags. A convenience object.\n *\n * * `'r'` - Open file for reading. An exception occurs if the file does not exist.\n * * `'r+'` - Open file for reading and writing. An exception occurs if the file does not exist.\n * * `'rs'` - Open file for reading in synchronous mode. Instructs the filesystem to not cache writes.\n * * `'rs+'` - Open file for reading and writing, and opens the file in synchronous mode.\n * * `'w'` - Open file for writing. The file is created (if it does not exist) or truncated (if it exists).\n * * `'wx'` - Like 'w' but opens the file in exclusive mode.\n * * `'w+'` - Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).\n * * `'wx+'` - Like 'w+' but opens the file in exclusive mode.\n * * `'a'` - Open file for appending. The file is created if it does not exist.\n * * `'ax'` - Like 'a' but opens the file in exclusive mode.\n * * `'a+'` - Open file for reading and appending. The file is created if it does not exist.\n * * `'ax+'` - Like 'a+' but opens the file in exclusive mode.\n *\n * Exclusive mode ensures that the file path is newly created.\n */\nexport class FileFlag {\n // Contains cached FileMode instances.\n private static flagCache: { [mode: string]: FileFlag } = {};\n // Array of valid mode strings.\n private static validFlagStrs = ['r', 'r+', 'rs', 'rs+', 'w', 'wx', 'w+', 'wx+', 'a', 'ax', 'a+', 'ax+'];\n\n /**\n * Get an object representing the given file flag.\n * @param modeStr The string representing the flag\n * @return The FileFlag object representing the flag\n * @throw when the flag string is invalid\n */\n public static getFileFlag(flagStr: string): FileFlag {\n // Check cache first.\n if (FileFlag.flagCache.hasOwnProperty(flagStr)) {\n return FileFlag.flagCache[flagStr];\n }\n return FileFlag.flagCache[flagStr] = new FileFlag(flagStr);\n }\n\n private flagStr: string;\n /**\n * This should never be called directly.\n * @param modeStr The string representing the mode\n * @throw when the mode string is invalid\n */\n constructor(flagStr: string) {\n this.flagStr = flagStr;\n if (FileFlag.validFlagStrs.indexOf(flagStr) < 0) {\n throw new ApiError(ErrorCode.EINVAL, \"Invalid flag: \" + flagStr);\n }\n }\n\n /**\n * Get the underlying flag string for this flag.\n */\n public getFlagString(): string {\n return this.flagStr;\n }\n\n /**\n * Returns true if the file is readable.\n */\n public isReadable(): boolean {\n return this.flagStr.indexOf('r') !== -1 || this.flagStr.indexOf('+') !== -1;\n }\n /**\n * Returns true if the file is writeable.\n */\n public isWriteable(): boolean {\n return this.flagStr.indexOf('w') !== -1 || this.flagStr.indexOf('a') !== -1 || this.flagStr.indexOf('+') !== -1;\n }\n /**\n * Returns true if the file mode should truncate.\n */\n public isTruncating(): boolean {\n return this.flagStr.indexOf('w') !== -1;\n }\n /**\n * Returns true if the file is appendable.\n */\n public isAppendable(): boolean {\n return this.flagStr.indexOf('a') !== -1;\n }\n /**\n * Returns true if the file is open in synchronous mode.\n */\n public isSynchronous(): boolean {\n return this.flagStr.indexOf('s') !== -1;\n }\n /**\n * Returns true if the file is open in exclusive mode.\n */\n public isExclusive(): boolean {\n return this.flagStr.indexOf('x') !== -1;\n }\n /**\n * Returns one of the static fields on this object that indicates the\n * appropriate response to the path existing.\n */\n public pathExistsAction(): ActionType {\n if (this.isExclusive()) {\n return ActionType.THROW_EXCEPTION;\n } else if (this.isTruncating()) {\n return ActionType.TRUNCATE_FILE;\n } else {\n return ActionType.NOP;\n }\n }\n /**\n * Returns one of the static fields on this object that indicates the\n * appropriate response to the path not existing.\n */\n public pathNotExistsAction(): ActionType {\n if ((this.isWriteable() || this.isAppendable()) && this.flagStr !== 'r+') {\n return ActionType.CREATE_FILE;\n } else {\n return ActionType.THROW_EXCEPTION;\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/file_flag.ts","import * as fs from 'fs';\n\n/**\n * Indicates the type of the given file. Applied to 'mode'.\n */\nexport enum FileType {\n FILE = 0x8000,\n DIRECTORY = 0x4000,\n SYMLINK = 0xA000\n}\n\n/**\n * Emulation of Node's `fs.Stats` object.\n *\n * Attribute descriptions are from `man 2 stat'\n * @see http://nodejs.org/api/fs.html#fs_class_fs_stats\n * @see http://man7.org/linux/man-pages/man2/stat.2.html\n */\nexport default class Stats implements fs.Stats {\n public static fromBuffer(buffer: Buffer): Stats {\n const size = buffer.readUInt32LE(0),\n mode = buffer.readUInt32LE(4),\n atime = buffer.readDoubleLE(8),\n mtime = buffer.readDoubleLE(16),\n ctime = buffer.readDoubleLE(24);\n\n return new Stats(mode & 0xF000, size, mode & 0xFFF, new Date(atime), new Date(mtime), new Date(ctime));\n }\n\n public blocks: number;\n public mode: number;\n /**\n * UNSUPPORTED ATTRIBUTES\n * I assume no one is going to need these details, although we could fake\n * appropriate values if need be.\n */\n // ID of device containing file\n public dev: number = 0;\n // inode number\n public ino: number = 0;\n // device ID (if special file)\n public rdev: number = 0;\n // number of hard links\n public nlink: number = 1;\n // blocksize for file system I/O\n public blksize: number = 4096;\n // @todo Maybe support these? atm, it's a one-user filesystem.\n // user ID of owner\n public uid: number = 0;\n // group ID of owner\n public gid: number = 0;\n // time file was created (currently unsupported)\n public birthtime: Date = new Date(0);\n // XXX: Some file systems stash data on stats objects.\n public fileData: Buffer | null= null;\n\n /**\n * Provides information about a particular entry in the file system.\n * @param [Number] item_type type of the item (FILE, DIRECTORY, SYMLINK, or SOCKET)\n * @param [Number] size Size of the item in bytes. For directories/symlinks,\n * this is normally the size of the struct that represents the item.\n * @param [Number] mode Unix-style file mode (e.g. 0o644)\n * @param [Date?] atime time of last access\n * @param [Date?] mtime time of last modification\n * @param [Date?] ctime time of creation\n */\n constructor(\n itemType: FileType,\n public size: number,\n mode?: number,\n public atime: Date = new Date(),\n public mtime: Date = new Date(),\n public ctime: Date = new Date()) {\n if (!mode) {\n switch (itemType) {\n case FileType.FILE:\n this.mode = 0x1a4;\n break;\n case FileType.DIRECTORY:\n default:\n this.mode = 0x1ff;\n }\n } else {\n this.mode = mode;\n }\n // number of 512B blocks allocated\n this.blocks = Math.ceil(size / 512);\n // Check if mode also includes top-most bits, which indicate the file's\n // type.\n if (this.mode < 0x1000) {\n this.mode |= itemType;\n }\n }\n\n public toBuffer(): Buffer {\n const buffer = Buffer.alloc(32);\n buffer.writeUInt32LE(this.size, 0);\n buffer.writeUInt32LE(this.mode, 4);\n buffer.writeDoubleLE(this.atime.getTime(), 8);\n buffer.writeDoubleLE(this.mtime.getTime(), 16);\n buffer.writeDoubleLE(this.ctime.getTime(), 24);\n return buffer;\n }\n\n /**\n * **Nonstandard**: Clone the stats object.\n * @return [BrowserFS.node.fs.Stats]\n */\n public clone(): Stats {\n return new Stats(this.mode & 0xF000, this.size, this.mode & 0xFFF, this.atime, this.mtime, this.ctime);\n }\n\n /**\n * @return [Boolean] True if this item is a file.\n */\n public isFile(): boolean {\n return (this.mode & 0xF000) === FileType.FILE;\n }\n\n /**\n * @return [Boolean] True if this item is a directory.\n */\n public isDirectory(): boolean {\n return (this.mode & 0xF000) === FileType.DIRECTORY;\n }\n\n /**\n * @return [Boolean] True if this item is a symbolic link (only valid through lstat)\n */\n public isSymbolicLink(): boolean {\n return (this.mode & 0xF000) === FileType.SYMLINK;\n }\n\n /**\n * Change the mode of the file. We use this helper function to prevent messing\n * up the type of the file, which is encoded in mode.\n */\n public chmod(mode: number): void {\n this.mode = (this.mode & 0xF000) | mode;\n }\n\n // We don't support the following types of files.\n\n public isSocket(): boolean {\n return false;\n }\n\n public isBlockDevice(): boolean {\n return false;\n }\n\n public isCharacterDevice(): boolean {\n return false;\n }\n\n public isFIFO(): boolean {\n return false;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/node_fs_stats.ts","import {default as FS, FSModule} from './FS';\n\n// Manually export the individual public functions of fs.\n// Required because some code will invoke functions off of the module.\n// e.g.:\n// let writeFile = fs.writeFile;\n// writeFile(...)\n\n/**\n * @hidden\n */\nlet fs: any = new FS();\n/**\n * @hidden\n */\nconst _fsMock: FSModule = {};\n/**\n * @hidden\n */\nconst fsProto = FS.prototype;\nObject.keys(fsProto).forEach((key) => {\n if (typeof fs[key] === 'function') {\n ( _fsMock)[key] = function() {\n return ( fs[key]).apply(fs, arguments);\n };\n } else {\n ( _fsMock)[key] = fs[key];\n }\n});\n\n_fsMock['changeFSModule'] = function(newFs: FS): void {\n fs = newFs;\n};\n_fsMock['getFSModule'] = function(): FS {\n return fs;\n};\n_fsMock['FS'] = FS;\n\nexport default _fsMock;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/node_fs.ts","/**\n * Defines an Emscripten file system object for use in the Emscripten virtual\n * filesystem. Allows you to use synchronous BrowserFS file systems from within\n * Emscripten.\n *\n * You can construct a BFSEmscriptenFS, mount it using its mount command,\n * and then mount it into Emscripten.\n *\n * Adapted from Emscripten's NodeFS:\n * https://raw.github.com/kripken/emscripten/master/src/library_nodefs.js\n */\nimport FS from '../core/FS';\nimport fs from '../core/node_fs';\nimport NodeStats from '../core/node_fs_stats';\nimport {uint8Array2Buffer} from '../core/util';\n\nexport interface Stats {\n dev: number;\n ino: number;\n mode: number;\n nlink: number;\n uid: number;\n gid: number;\n rdev: number;\n size: number;\n blksize: number;\n blocks: number;\n atime: Date;\n mtime: Date;\n ctime: Date;\n timestamp?: number;\n}\n\nexport interface EmscriptenFSNode {\n name: string;\n mode: number;\n parent: EmscriptenFSNode;\n mount: {opts: {root: string}};\n stream_ops: EmscriptenStreamOps;\n node_ops: EmscriptenNodeOps;\n}\n\nexport interface EmscriptenStream {\n node: EmscriptenFSNode;\n nfd: any;\n flags: string;\n position: number;\n}\n\nexport interface EmscriptenNodeOps {\n getattr(node: EmscriptenFSNode): Stats;\n setattr(node: EmscriptenFSNode, attr: Stats): void;\n lookup(parent: EmscriptenFSNode, name: string): EmscriptenFSNode;\n mknod(parent: EmscriptenFSNode, name: string, mode: number, dev: any): EmscriptenFSNode;\n rename(oldNode: EmscriptenFSNode, newDir: EmscriptenFSNode, newName: string): void;\n unlink(parent: EmscriptenFSNode, name: string): void;\n rmdir(parent: EmscriptenFSNode, name: string): void;\n readdir(node: EmscriptenFSNode): string[];\n symlink(parent: EmscriptenFSNode, newName: string, oldPath: string): void;\n readlink(node: EmscriptenFSNode): string;\n}\n\nexport interface EmscriptenStreamOps {\n open(stream: EmscriptenStream): void;\n close(stream: EmscriptenStream): void;\n read(stream: EmscriptenStream, buffer: Uint8Array, offset: number, length: number, position: number): number;\n write(stream: EmscriptenStream, buffer: Uint8Array, offset: number, length: number, position: number): number;\n llseek(stream: EmscriptenStream, offset: number, whence: number): number;\n}\n\nexport interface EmscriptenFS {\n node_ops: EmscriptenNodeOps;\n stream_ops: EmscriptenStreamOps;\n mount(mount: {opts: {root: string}}): EmscriptenFSNode;\n createNode(parent: EmscriptenFSNode, name: string, mode: number, dev?: any): EmscriptenFSNode;\n getMode(path: string): number;\n realPath(node: EmscriptenFSNode): string;\n}\n\nclass BFSEmscriptenStreamOps implements EmscriptenStreamOps {\n private FS: any;\n private PATH: any;\n private ERRNO_CODES: any;\n private nodefs: FS;\n\n constructor(private fs: BFSEmscriptenFS) {\n this.nodefs = fs.getNodeFS();\n this.FS = fs.getFS();\n this.PATH = fs.getPATH();\n this.ERRNO_CODES = fs.getERRNO_CODES();\n }\n\n public open(stream: EmscriptenStream): void {\n const path = this.fs.realPath(stream.node);\n const FS = this.FS;\n try {\n if (FS.isFile(stream.node.mode)) {\n stream.nfd = this.nodefs.openSync(path, this.fs.flagsToPermissionString(stream.flags));\n }\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n\n public close(stream: EmscriptenStream): void {\n const FS = this.FS;\n try {\n if (FS.isFile(stream.node.mode) && stream.nfd) {\n this.nodefs.closeSync(stream.nfd);\n }\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n\n public read(stream: EmscriptenStream, buffer: Uint8Array, offset: number, length: number, position: number): number {\n // Avoid copying overhead by reading directly into buffer.\n try {\n return this.nodefs.readSync(stream.nfd, uint8Array2Buffer(buffer), offset, length, position);\n } catch (e) {\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n\n public write(stream: EmscriptenStream, buffer: Uint8Array, offset: number, length: number, position: number): number {\n // Avoid copying overhead.\n try {\n return this.nodefs.writeSync(stream.nfd, uint8Array2Buffer(buffer), offset, length, position);\n } catch (e) {\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n\n public llseek(stream: EmscriptenStream, offset: number, whence: number): number {\n let position = offset;\n if (whence === 1) { // SEEK_CUR.\n position += stream.position;\n } else if (whence === 2) { // SEEK_END.\n if (this.FS.isFile(stream.node.mode)) {\n try {\n const stat = this.nodefs.fstatSync(stream.nfd);\n position += stat.size;\n } catch (e) {\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n }\n\n if (position < 0) {\n throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);\n }\n\n stream.position = position;\n return position;\n }\n}\n\nclass BFSEmscriptenNodeOps implements EmscriptenNodeOps {\n private FS: any;\n private PATH: any;\n private ERRNO_CODES: any;\n private nodefs: FS;\n\n constructor(private fs: BFSEmscriptenFS) {\n this.nodefs = fs.getNodeFS();\n this.FS = fs.getFS();\n this.PATH = fs.getPATH();\n this.ERRNO_CODES = fs.getERRNO_CODES();\n }\n\n public getattr(node: EmscriptenFSNode): Stats {\n const path = this.fs.realPath(node);\n let stat: NodeStats;\n try {\n stat = this.nodefs.lstatSync(path);\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n return {\n dev: stat.dev,\n ino: stat.ino,\n mode: stat.mode,\n nlink: stat.nlink,\n uid: stat.uid,\n gid: stat.gid,\n rdev: stat.rdev,\n size: stat.size,\n atime: stat.atime,\n mtime: stat.mtime,\n ctime: stat.ctime,\n blksize: stat.blksize,\n blocks: stat.blocks\n };\n }\n\n public setattr(node: EmscriptenFSNode, attr: Stats): void {\n const path = this.fs.realPath(node);\n try {\n if (attr.mode !== undefined) {\n this.nodefs.chmodSync(path, attr.mode);\n // update the common node structure mode as well\n node.mode = attr.mode;\n }\n if (attr.timestamp !== undefined) {\n const date = new Date(attr.timestamp);\n this.nodefs.utimesSync(path, date, date);\n }\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n // Ignore not supported errors. Emscripten does utimesSync when it\n // writes files, but never really requires the value to be set.\n if (e.code !== \"ENOTSUP\") {\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n if (attr.size !== undefined) {\n try {\n this.nodefs.truncateSync(path, attr.size);\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n }\n\n public lookup(parent: EmscriptenFSNode, name: string): EmscriptenFSNode {\n const path = this.PATH.join2(this.fs.realPath(parent), name);\n const mode = this.fs.getMode(path);\n return this.fs.createNode(parent, name, mode);\n }\n\n public mknod(parent: EmscriptenFSNode, name: string, mode: number, dev: any): EmscriptenFSNode {\n const node = this.fs.createNode(parent, name, mode, dev);\n // create the backing node for this in the fs root as well\n const path = this.fs.realPath(node);\n try {\n if (this.FS.isDir(node.mode)) {\n this.nodefs.mkdirSync(path, node.mode);\n } else {\n this.nodefs.writeFileSync(path, '', { mode: node.mode });\n }\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n return node;\n }\n\n public rename(oldNode: EmscriptenFSNode, newDir: EmscriptenFSNode, newName: string): void {\n const oldPath = this.fs.realPath(oldNode);\n const newPath = this.PATH.join2(this.fs.realPath(newDir), newName);\n try {\n this.nodefs.renameSync(oldPath, newPath);\n // This logic is missing from the original NodeFS,\n // causing Emscripten's filesystem to think that the old file still exists.\n oldNode.name = newName;\n oldNode.parent = newDir;\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n\n public unlink(parent: EmscriptenFSNode, name: string): void {\n const path = this.PATH.join2(this.fs.realPath(parent), name);\n try {\n this.nodefs.unlinkSync(path);\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n\n public rmdir(parent: EmscriptenFSNode, name: string) {\n const path = this.PATH.join2(this.fs.realPath(parent), name);\n try {\n this.nodefs.rmdirSync(path);\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n\n public readdir(node: EmscriptenFSNode): string[] {\n const path = this.fs.realPath(node);\n try {\n // Node does not list . and .. in directory listings,\n // but Emscripten expects it.\n const contents = this.nodefs.readdirSync(path);\n contents.push('.', '..');\n return contents;\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n\n public symlink(parent: EmscriptenFSNode, newName: string, oldPath: string): void {\n const newPath = this.PATH.join2(this.fs.realPath(parent), newName);\n try {\n this.nodefs.symlinkSync(oldPath, newPath);\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n\n public readlink(node: EmscriptenFSNode): string {\n const path = this.fs.realPath(node);\n try {\n return this.nodefs.readlinkSync(path);\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n }\n}\n\nexport default class BFSEmscriptenFS implements EmscriptenFS {\n // This maps the integer permission modes from http://linux.die.net/man/3/open\n // to node.js-specific file open permission strings at http://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback\n public flagsToPermissionStringMap = {\n 0/*O_RDONLY*/: 'r',\n 1/*O_WRONLY*/: 'r+',\n 2/*O_RDWR*/: 'r+',\n 64/*O_CREAT*/: 'r',\n 65/*O_WRONLY|O_CREAT*/: 'r+',\n 66/*O_RDWR|O_CREAT*/: 'r+',\n 129/*O_WRONLY|O_EXCL*/: 'rx+',\n 193/*O_WRONLY|O_CREAT|O_EXCL*/: 'rx+',\n 514/*O_RDWR|O_TRUNC*/: 'w+',\n 577/*O_WRONLY|O_CREAT|O_TRUNC*/: 'w',\n 578/*O_CREAT|O_RDWR|O_TRUNC*/: 'w+',\n 705/*O_WRONLY|O_CREAT|O_EXCL|O_TRUNC*/: 'wx',\n 706/*O_RDWR|O_CREAT|O_EXCL|O_TRUNC*/: 'wx+',\n 1024/*O_APPEND*/: 'a',\n 1025/*O_WRONLY|O_APPEND*/: 'a',\n 1026/*O_RDWR|O_APPEND*/: 'a+',\n 1089/*O_WRONLY|O_CREAT|O_APPEND*/: 'a',\n 1090/*O_RDWR|O_CREAT|O_APPEND*/: 'a+',\n 1153/*O_WRONLY|O_EXCL|O_APPEND*/: 'ax',\n 1154/*O_RDWR|O_EXCL|O_APPEND*/: 'ax+',\n 1217/*O_WRONLY|O_CREAT|O_EXCL|O_APPEND*/: 'ax',\n 1218/*O_RDWR|O_CREAT|O_EXCL|O_APPEND*/: 'ax+',\n 4096/*O_RDONLY|O_DSYNC*/: 'rs',\n 4098/*O_RDWR|O_DSYNC*/: 'rs+'\n };\n /* tslint:disable:variable-name */\n public node_ops: EmscriptenNodeOps;\n public stream_ops: EmscriptenStreamOps;\n /* tslint:enable:variable-name */\n\n private FS: any;\n private PATH: any;\n private ERRNO_CODES: any;\n private nodefs: FS;\n constructor(_FS = ( self)['FS'], _PATH = ( self)['PATH'], _ERRNO_CODES = ( self)['ERRNO_CODES'], nodefs: FS = fs) {\n this.nodefs = nodefs;\n this.FS = _FS;\n this.PATH = _PATH;\n this.ERRNO_CODES = _ERRNO_CODES;\n this.node_ops = new BFSEmscriptenNodeOps(this);\n this.stream_ops = new BFSEmscriptenStreamOps(this);\n }\n\n public mount(m: {opts: {root: string}}): EmscriptenFSNode {\n return this.createNode(null, '/', this.getMode(m.opts.root), 0);\n }\n\n public createNode(parent: EmscriptenFSNode | null, name: string, mode: number, dev?: any): EmscriptenFSNode {\n const FS = this.FS;\n if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\n throw new FS.ErrnoError(this.ERRNO_CODES.EINVAL);\n }\n const node = FS.createNode(parent, name, mode);\n node.node_ops = this.node_ops;\n node.stream_ops = this.stream_ops;\n return node;\n }\n\n public getMode(path: string): number {\n let stat: NodeStats;\n try {\n stat = this.nodefs.lstatSync(path);\n } catch (e) {\n if (!e.code) {\n throw e;\n }\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\n }\n return stat.mode;\n }\n\n public realPath(node: EmscriptenFSNode): string {\n const parts: string[] = [];\n while (node.parent !== node) {\n parts.push(node.name);\n node = node.parent;\n }\n parts.push(node.mount.opts.root);\n parts.reverse();\n return this.PATH.join.apply(null, parts);\n }\n\n public flagsToPermissionString(flags: string | number): string {\n let parsedFlags = (typeof flags === \"string\") ? parseInt(flags, 10) : flags;\n parsedFlags &= 0x1FFF;\n if (parsedFlags in this.flagsToPermissionStringMap) {\n return ( this.flagsToPermissionStringMap)[parsedFlags];\n } else {\n return flags;\n }\n }\n\n public getNodeFS() {\n return this.nodefs;\n }\n\n public getFS() {\n return this.FS;\n }\n\n public getPATH() {\n return this.PATH;\n }\n\n public getERRNO_CODES() {\n return this.ERRNO_CODES;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/generic/emscripten_fs.ts","import {ApiError, ErrorCode} from './api_error';\nimport Stats from './node_fs_stats';\nimport {File} from './file';\nimport {FileFlag, ActionType} from './file_flag';\nimport * as path from 'path';\nimport {fail} from './util';\n\nexport type BFSOneArgCallback = (e?: ApiError | null) => any;\nexport type BFSCallback = (e: ApiError | null | undefined, rv?: T) => any;\nexport type BFSThreeArgCallback =\n (e: ApiError | null | undefined, arg1?: T, arg2?: U) => any;\n\n/**\n * Interface for a filesystem. **All** BrowserFS FileSystems should implement\n * this interface.\n *\n * Below, we denote each API method as **Core**, **Supplemental**, or\n * **Optional**.\n *\n * ### Core Methods\n *\n * **Core** API methods *need* to be implemented for basic read/write\n * functionality.\n *\n * Note that read-only FileSystems can choose to not implement core methods\n * that mutate files or metadata. The default implementation will pass a\n * NOT_SUPPORTED error to the callback.\n *\n * ### Supplemental Methods\n *\n * **Supplemental** API methods do not need to be implemented by a filesystem.\n * The default implementation implements all of the supplemental API methods in\n * terms of the **core** API methods.\n *\n * Note that a file system may choose to implement supplemental methods for\n * efficiency reasons.\n *\n * The code for some supplemental methods was adapted directly from NodeJS's\n * fs.js source code.\n *\n * ### Optional Methods\n *\n * **Optional** API methods provide functionality that may not be available in\n * all filesystems. For example, all symlink/hardlink-related API methods fall\n * under this category.\n *\n * The default implementation will pass a NOT_SUPPORTED error to the callback.\n *\n * ### Argument Assumptions\n *\n * You can assume the following about arguments passed to each API method:\n *\n * * **Every path is an absolute path.** Meaning, `.`, `..`, and other items\n * are resolved into an absolute form.\n * * **All arguments are present.** Any optional arguments at the Node API level\n * have been passed in with their default values.\n * * **The callback will reset the stack depth.** When your filesystem calls the\n * callback with the requested information, it will use `setImmediate` to\n * reset the JavaScript stack depth before calling the user-supplied callback.\n */\nexport interface FileSystem {\n /**\n * **Optional**: Returns the name of the file system.\n */\n getName(): string;\n /**\n * **Optional**: Passes the following information to the callback:\n *\n * * Total number of bytes available on this file system.\n * * number of free bytes available on this file system.\n *\n * @todo This info is not available through the Node API. Perhaps we could do a\n * polyfill of diskspace.js, or add a new Node API function.\n * @param path The path to the location that is being queried. Only\n * useful for filesystems that support mount points.\n */\n diskSpace(p: string, cb: (total: number, free: number) => any): void;\n /**\n * **Core**: Is this filesystem read-only?\n * @return True if this FileSystem is inherently read-only.\n */\n isReadOnly(): boolean;\n /**\n * **Core**: Does the filesystem support optional symlink/hardlink-related\n * commands?\n * @return True if the FileSystem supports the optional\n * symlink/hardlink-related commands.\n */\n supportsLinks(): boolean;\n /**\n * **Core**: Does the filesystem support optional property-related commands?\n * @return True if the FileSystem supports the optional\n * property-related commands (permissions, utimes, etc).\n */\n supportsProps(): boolean;\n /**\n * **Core**: Does the filesystem support the optional synchronous interface?\n * @return True if the FileSystem supports synchronous operations.\n */\n supportsSynch(): boolean;\n // **CORE API METHODS**\n // File or directory operations\n /**\n * **Core**: Asynchronous rename. No arguments other than a possible exception\n * are given to the completion callback.\n */\n rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void;\n /**\n * **Core**: Synchronous rename.\n */\n renameSync(oldPath: string, newPath: string): void;\n /**\n * **Core**: Asynchronous `stat` or `lstat`.\n * @param isLstat True if this is `lstat`, false if this is regular\n * `stat`.\n */\n stat(p: string, isLstat: boolean | null, cb: BFSCallback): void;\n /**\n * **Core**: Synchronous `stat` or `lstat`.\n * @param isLstat True if this is `lstat`, false if this is regular\n * `stat`.\n */\n statSync(p: string, isLstat: boolean | null): Stats;\n // File operations\n /**\n * **Core**: Asynchronous file open.\n * @see http://www.manpagez.com/man/2/open/\n * @param flags Handles the complexity of the various file\n * modes. See its API for more details.\n * @param mode Mode to use to open the file. Can be ignored if the\n * filesystem doesn't support permissions.\n */\n open(p: string, flag: FileFlag, mode: number, cb: BFSCallback): void;\n /**\n * **Core**: Synchronous file open.\n * @see http://www.manpagez.com/man/2/open/\n * @param flags Handles the complexity of the various file\n * modes. See its API for more details.\n * @param mode Mode to use to open the file. Can be ignored if the\n * filesystem doesn't support permissions.\n */\n openSync(p: string, flag: FileFlag, mode: number): File;\n /**\n * **Core**: Asynchronous `unlink`.\n */\n unlink(p: string, cb: BFSOneArgCallback): void;\n /**\n * **Core**: Synchronous `unlink`.\n */\n unlinkSync(p: string): void;\n // Directory operations\n /**\n * **Core**: Asynchronous `rmdir`.\n */\n rmdir(p: string, cb: BFSOneArgCallback): void;\n /**\n * **Core**: Synchronous `rmdir`.\n */\n rmdirSync(p: string): void;\n /**\n * **Core**: Asynchronous `mkdir`.\n * @param mode Mode to make the directory using. Can be ignored if\n * the filesystem doesn't support permissions.\n */\n mkdir(p: string, mode: number, cb: BFSOneArgCallback): void;\n /**\n * **Core**: Synchronous `mkdir`.\n * @param mode Mode to make the directory using. Can be ignored if\n * the filesystem doesn't support permissions.\n */\n mkdirSync(p: string, mode: number): void;\n /**\n * **Core**: Asynchronous `readdir`. Reads the contents of a directory.\n *\n * The callback gets two arguments `(err, files)` where `files` is an array of\n * the names of the files in the directory excluding `'.'` and `'..'`.\n */\n readdir(p: string, cb: BFSCallback): void;\n /**\n * **Core**: Synchronous `readdir`. Reads the contents of a directory.\n */\n readdirSync(p: string): string[];\n // **SUPPLEMENTAL INTERFACE METHODS**\n // File or directory operations\n /**\n * **Supplemental**: Test whether or not the given path exists by checking with\n * the file system. Then call the callback argument with either true or false.\n */\n exists(p: string, cb: (exists: boolean) => void): void;\n /**\n * **Supplemental**: Test whether or not the given path exists by checking with\n * the file system.\n */\n existsSync(p: string): boolean;\n /**\n * **Supplemental**: Asynchronous `realpath`. The callback gets two arguments\n * `(err, resolvedPath)`.\n *\n * Note that the Node API will resolve `path` to an absolute path.\n * @param cache An object literal of mapped paths that can be used to\n * force a specific path resolution or avoid additional `fs.stat` calls for\n * known real paths. If not supplied by the user, it'll be an empty object.\n */\n realpath(p: string, cache: {[path: string]: string}, cb: BFSCallback): void;\n /**\n * **Supplemental**: Synchronous `realpath`.\n *\n * Note that the Node API will resolve `path` to an absolute path.\n * @param cache An object literal of mapped paths that can be used to\n * force a specific path resolution or avoid additional `fs.stat` calls for\n * known real paths. If not supplied by the user, it'll be an empty object.\n */\n realpathSync(p: string, cache: {[path: string]: string}): string;\n // File operations\n /**\n * **Supplemental**: Asynchronous `truncate`.\n */\n truncate(p: string, len: number, cb: BFSOneArgCallback): void;\n /**\n * **Supplemental**: Synchronous `truncate`.\n */\n truncateSync(p: string, len: number): void;\n /**\n * **Supplemental**: Asynchronously reads the entire contents of a file.\n * @param encoding If non-null, the file's contents should be decoded\n * into a string using that encoding. Otherwise, if encoding is null, fetch\n * the file's contents as a Buffer.\n * @param cb If no encoding is specified, then the raw buffer is returned.\n */\n readFile(fname: string, encoding: string | null, flag: FileFlag, cb: BFSCallback): void;\n /**\n * **Supplemental**: Synchronously reads the entire contents of a file.\n * @param encoding If non-null, the file's contents should be decoded\n * into a string using that encoding. Otherwise, if encoding is null, fetch\n * the file's contents as a Buffer.\n */\n readFileSync(fname: string, encoding: string | null, flag: FileFlag): any;\n /**\n * **Supplemental**: Asynchronously writes data to a file, replacing the file\n * if it already exists.\n *\n * The encoding option is ignored if data is a buffer.\n */\n writeFile(fname: string, data: any, encoding: string | null, flag: FileFlag, mode: number, cb: BFSOneArgCallback): void;\n /**\n * **Supplemental**: Synchronously writes data to a file, replacing the file\n * if it already exists.\n *\n * The encoding option is ignored if data is a buffer.\n */\n writeFileSync(fname: string, data: string | Buffer, encoding: string | null, flag: FileFlag, mode: number): void;\n /**\n * **Supplemental**: Asynchronously append data to a file, creating the file if\n * it not yet exists.\n */\n appendFile(fname: string, data: string | Buffer, encoding: string | null, flag: FileFlag, mode: number, cb: BFSOneArgCallback): void;\n /**\n * **Supplemental**: Synchronously append data to a file, creating the file if\n * it not yet exists.\n */\n appendFileSync(fname: string, data: string | Buffer, encoding: string | null, flag: FileFlag, mode: number): void;\n // **OPTIONAL INTERFACE METHODS**\n // Property operations\n // This isn't always possible on some filesystem types (e.g. Dropbox).\n /**\n * **Optional**: Asynchronous `chmod` or `lchmod`.\n * @param isLchmod `True` if `lchmod`, false if `chmod`. Has no\n * bearing on result if links aren't supported.\n */\n chmod(p: string, isLchmod: boolean, mode: number, cb: BFSOneArgCallback): void;\n /**\n * **Optional**: Synchronous `chmod` or `lchmod`.\n * @param isLchmod `True` if `lchmod`, false if `chmod`. Has no\n * bearing on result if links aren't supported.\n */\n chmodSync(p: string, isLchmod: boolean, mode: number): void;\n /**\n * **Optional**: Asynchronous `chown` or `lchown`.\n * @param isLchown `True` if `lchown`, false if `chown`. Has no\n * bearing on result if links aren't supported.\n */\n chown(p: string, isLchown: boolean, uid: number, gid: number, cb: BFSOneArgCallback): void;\n /**\n * **Optional**: Synchronous `chown` or `lchown`.\n * @param isLchown `True` if `lchown`, false if `chown`. Has no\n * bearing on result if links aren't supported.\n */\n chownSync(p: string, isLchown: boolean, uid: number, gid: number): void;\n /**\n * **Optional**: Change file timestamps of the file referenced by the supplied\n * path.\n */\n utimes(p: string, atime: Date, mtime: Date, cb: BFSOneArgCallback): void;\n /**\n * **Optional**: Change file timestamps of the file referenced by the supplied\n * path.\n */\n utimesSync(p: string, atime: Date, mtime: Date): void;\n // Symlink operations\n // Symlinks aren't always supported.\n /**\n * **Optional**: Asynchronous `link`.\n */\n link(srcpath: string, dstpath: string, cb: BFSOneArgCallback): void;\n /**\n * **Optional**: Synchronous `link`.\n */\n linkSync(srcpath: string, dstpath: string): void;\n /**\n * **Optional**: Asynchronous `symlink`.\n * @param type can be either `'dir'` or `'file'`\n */\n symlink(srcpath: string, dstpath: string, type: string, cb: BFSOneArgCallback): void;\n /**\n * **Optional**: Synchronous `symlink`.\n * @param type can be either `'dir'` or `'file'`\n */\n symlinkSync(srcpath: string, dstpath: string, type: string): void;\n /**\n * **Optional**: Asynchronous readlink.\n */\n readlink(p: string, cb: BFSCallback): void;\n /**\n * **Optional**: Synchronous readlink.\n */\n readlinkSync(p: string): string;\n}\n\n/**\n * Describes a file system option.\n */\nexport interface FileSystemOption {\n // The basic JavaScript type(s) for this option.\n type: string | string[];\n // Whether or not the option is optional (e.g., can be set to null or undefined).\n // Defaults to `false`.\n optional?: boolean;\n // Description of the option. Used in error messages and documentation.\n description: string;\n // A custom validation function to check if the option is valid.\n // Calls the callback with an error object on an error.\n // (Can call callback synchronously.)\n // Defaults to `(opt, cb) => cb()`.\n validator?(opt: T, cb: BFSOneArgCallback): void;\n}\n\n/**\n * Describes all of the options available in a file system.\n */\nexport interface FileSystemOptions {\n [name: string]: FileSystemOption;\n}\n\n/**\n * Contains typings for static functions on the file system constructor.\n */\nexport interface FileSystemConstructor {\n /**\n * **Core**: Name to identify this particular file system.\n */\n Name: string;\n /**\n * **Core**: Describes all of the options available for this file system.\n */\n Options: FileSystemOptions;\n /**\n * **Core**: Creates a file system of this given type with the given\n * options.\n */\n Create(options: object, cb: BFSCallback): void;\n /**\n * **Core**: Returns 'true' if this filesystem is available in the current\n * environment. For example, a `localStorage`-backed filesystem will return\n * 'false' if the browser does not support that API.\n *\n * Defaults to 'false', as the FileSystem base class isn't usable alone.\n */\n isAvailable(): boolean;\n}\n\n/**\n * Basic filesystem class. Most filesystems should extend this class, as it\n * provides default implementations for a handful of methods.\n */\nexport class BaseFileSystem {\n public supportsLinks(): boolean {\n return false;\n }\n public diskSpace(p: string, cb: (total: number, free: number) => any): void {\n cb(0, 0);\n }\n /**\n * Opens the file at path p with the given flag. The file must exist.\n * @param p The path to open.\n * @param flag The flag to use when opening the file.\n */\n public openFile(p: string, flag: FileFlag, cb: BFSCallback): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n /**\n * Create the file at path p with the given mode. Then, open it with the given\n * flag.\n */\n public createFile(p: string, flag: FileFlag, mode: number, cb: BFSCallback): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public open(p: string, flag: FileFlag, mode: number, cb: BFSCallback): void {\n const mustBeFile = (e: ApiError, stats?: Stats): void => {\n if (e) {\n // File does not exist.\n switch (flag.pathNotExistsAction()) {\n case ActionType.CREATE_FILE:\n // Ensure parent exists.\n return this.stat(path.dirname(p), false, (e: ApiError, parentStats?: Stats) => {\n if (e) {\n cb(e);\n } else if (parentStats && !parentStats.isDirectory()) {\n cb(ApiError.ENOTDIR(path.dirname(p)));\n } else {\n this.createFile(p, flag, mode, cb);\n }\n });\n case ActionType.THROW_EXCEPTION:\n return cb(ApiError.ENOENT(p));\n default:\n return cb(new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.'));\n }\n } else {\n // File exists.\n if (stats && stats.isDirectory()) {\n return cb(ApiError.EISDIR(p));\n }\n switch (flag.pathExistsAction()) {\n case ActionType.THROW_EXCEPTION:\n return cb(ApiError.EEXIST(p));\n case ActionType.TRUNCATE_FILE:\n // NOTE: In a previous implementation, we deleted the file and\n // re-created it. However, this created a race condition if another\n // asynchronous request was trying to read the file, as the file\n // would not exist for a small period of time.\n return this.openFile(p, flag, (e: ApiError, fd?: File): void => {\n if (e) {\n cb(e);\n } else if (fd) {\n fd.truncate(0, () => {\n fd.sync(() => {\n cb(null, fd);\n });\n });\n } else {\n fail();\n }\n });\n case ActionType.NOP:\n return this.openFile(p, flag, cb);\n default:\n return cb(new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.'));\n }\n }\n };\n this.stat(p, false, mustBeFile);\n }\n public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public renameSync(oldPath: string, newPath: string): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public stat(p: string, isLstat: boolean | null, cb: BFSCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public statSync(p: string, isLstat: boolean | null): Stats {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n /**\n * Opens the file at path p with the given flag. The file must exist.\n * @param p The path to open.\n * @param flag The flag to use when opening the file.\n * @return A File object corresponding to the opened file.\n */\n public openFileSync(p: string, flag: FileFlag, mode: number): File {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n /**\n * Create the file at path p with the given mode. Then, open it with the given\n * flag.\n */\n public createFileSync(p: string, flag: FileFlag, mode: number): File {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public openSync(p: string, flag: FileFlag, mode: number): File {\n // Check if the path exists, and is a file.\n let stats: Stats;\n try {\n stats = this.statSync(p, false);\n } catch (e) {\n // File does not exist.\n switch (flag.pathNotExistsAction()) {\n case ActionType.CREATE_FILE:\n // Ensure parent exists.\n const parentStats = this.statSync(path.dirname(p), false);\n if (!parentStats.isDirectory()) {\n throw ApiError.ENOTDIR(path.dirname(p));\n }\n return this.createFileSync(p, flag, mode);\n case ActionType.THROW_EXCEPTION:\n throw ApiError.ENOENT(p);\n default:\n throw new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.');\n }\n }\n\n // File exists.\n if (stats.isDirectory()) {\n throw ApiError.EISDIR(p);\n }\n switch (flag.pathExistsAction()) {\n case ActionType.THROW_EXCEPTION:\n throw ApiError.EEXIST(p);\n case ActionType.TRUNCATE_FILE:\n // Delete file.\n this.unlinkSync(p);\n // Create file. Use the same mode as the old file.\n // Node itself modifies the ctime when this occurs, so this action\n // will preserve that behavior if the underlying file system\n // supports those properties.\n return this.createFileSync(p, flag, stats.mode);\n case ActionType.NOP:\n return this.openFileSync(p, flag, mode);\n default:\n throw new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.');\n }\n }\n public unlink(p: string, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public unlinkSync(p: string): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public rmdir(p: string, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public rmdirSync(p: string): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public mkdir(p: string, mode: number, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public mkdirSync(p: string, mode: number): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public readdir(p: string, cb: BFSCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public readdirSync(p: string): string[] {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public exists(p: string, cb: (exists: boolean) => void): void {\n this.stat(p, null, function(err) {\n cb(!err);\n });\n }\n public existsSync(p: string): boolean {\n try {\n this.statSync(p, true);\n return true;\n } catch (e) {\n return false;\n }\n }\n public realpath(p: string, cache: {[path: string]: string}, cb: BFSCallback): void {\n if (this.supportsLinks()) {\n // The path could contain symlinks. Split up the path,\n // resolve any symlinks, return the resolved string.\n const splitPath = p.split(path.sep);\n // TODO: Simpler to just pass through file, find sep and such.\n for (let i = 0; i < splitPath.length; i++) {\n const addPaths = splitPath.slice(0, i + 1);\n splitPath[i] = path.join.apply(null, addPaths);\n }\n } else {\n // No symlinks. We just need to verify that it exists.\n this.exists(p, function(doesExist) {\n if (doesExist) {\n cb(null, p);\n } else {\n cb(ApiError.ENOENT(p));\n }\n });\n }\n }\n public realpathSync(p: string, cache: {[path: string]: string}): string {\n if (this.supportsLinks()) {\n // The path could contain symlinks. Split up the path,\n // resolve any symlinks, return the resolved string.\n const splitPath = p.split(path.sep);\n // TODO: Simpler to just pass through file, find sep and such.\n for (let i = 0; i < splitPath.length; i++) {\n const addPaths = splitPath.slice(0, i + 1);\n splitPath[i] = path.join.apply(path, addPaths);\n }\n return splitPath.join(path.sep);\n } else {\n // No symlinks. We just need to verify that it exists.\n if (this.existsSync(p)) {\n return p;\n } else {\n throw ApiError.ENOENT(p);\n }\n }\n }\n public truncate(p: string, len: number, cb: BFSOneArgCallback): void {\n this.open(p, FileFlag.getFileFlag('r+'), 0x1a4, (function(er: ApiError, fd?: File) {\n if (er) {\n return cb(er);\n }\n fd!.truncate(len, (function(er: any) {\n fd!.close((function(er2: any) {\n cb(er || er2);\n }));\n }));\n }));\n }\n public truncateSync(p: string, len: number): void {\n const fd = this.openSync(p, FileFlag.getFileFlag('r+'), 0x1a4);\n // Need to safely close FD, regardless of whether or not truncate succeeds.\n try {\n fd.truncateSync(len);\n } catch (e) {\n throw e;\n } finally {\n fd.closeSync();\n }\n }\n public readFile(fname: string, encoding: string | null, flag: FileFlag, cb: BFSCallback): void {\n // Wrap cb in file closing code.\n const oldCb = cb;\n // Get file.\n this.open(fname, flag, 0x1a4, (err, fd) => {\n if (err) {\n return cb(err);\n }\n cb = function(err?: ApiError | null, arg?: string | Buffer) {\n fd!.close(function(err2: any) {\n if (!err) {\n err = err2;\n }\n return oldCb(err, arg);\n });\n };\n fd!.stat((err, stat?) => {\n if (err) {\n return cb(err);\n }\n // Allocate buffer.\n const buf = Buffer.alloc(stat!.size);\n fd!.read(buf, 0, stat!.size, 0, (err?: ApiError | null) => {\n if (err) {\n return cb(err);\n } else if (encoding === null) {\n return cb(err, buf);\n }\n try {\n cb(null, buf.toString(encoding));\n } catch (e) {\n cb(e);\n }\n });\n });\n });\n }\n public readFileSync(fname: string, encoding: string | null, flag: FileFlag): any {\n // Get file.\n const fd = this.openSync(fname, flag, 0x1a4);\n try {\n const stat = fd.statSync();\n // Allocate buffer.\n const buf = Buffer.alloc(stat.size);\n fd.readSync(buf, 0, stat.size, 0);\n fd.closeSync();\n if (encoding === null) {\n return buf;\n }\n return buf.toString(encoding);\n } finally {\n fd.closeSync();\n }\n }\n public writeFile(fname: string, data: any, encoding: string | null, flag: FileFlag, mode: number, cb: BFSOneArgCallback): void {\n // Wrap cb in file closing code.\n const oldCb = cb;\n // Get file.\n this.open(fname, flag, 0x1a4, function(err: ApiError, fd?: File) {\n if (err) {\n return cb(err);\n }\n cb = function(err: ApiError) {\n fd!.close(function(err2: any) {\n oldCb(err ? err : err2);\n });\n };\n\n try {\n if (typeof data === 'string') {\n data = Buffer.from(data, encoding!);\n }\n } catch (e) {\n return cb(e);\n }\n // Write into file.\n fd!.write(data, 0, data.length, 0, cb);\n });\n }\n public writeFileSync(fname: string, data: any, encoding: string | null, flag: FileFlag, mode: number): void {\n // Get file.\n const fd = this.openSync(fname, flag, mode);\n try {\n if (typeof data === 'string') {\n data = Buffer.from(data, encoding!);\n }\n // Write into file.\n fd.writeSync(data, 0, data.length, 0);\n } finally {\n fd.closeSync();\n }\n }\n public appendFile(fname: string, data: any, encoding: string | null, flag: FileFlag, mode: number, cb: BFSOneArgCallback): void {\n // Wrap cb in file closing code.\n const oldCb = cb;\n this.open(fname, flag, mode, function(err: ApiError, fd?: File) {\n if (err) {\n return cb(err);\n }\n cb = function(err: ApiError) {\n fd!.close(function(err2: any) {\n oldCb(err ? err : err2);\n });\n };\n if (typeof data === 'string') {\n data = Buffer.from(data, encoding!);\n }\n fd!.write(data, 0, data.length, null, cb);\n });\n }\n public appendFileSync(fname: string, data: any, encoding: string | null, flag: FileFlag, mode: number): void {\n const fd = this.openSync(fname, flag, mode);\n try {\n if (typeof data === 'string') {\n data = Buffer.from(data, encoding!);\n }\n fd.writeSync(data, 0, data.length, null);\n } finally {\n fd.closeSync();\n }\n }\n public chmod(p: string, isLchmod: boolean, mode: number, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public chmodSync(p: string, isLchmod: boolean, mode: number) {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public chown(p: string, isLchown: boolean, uid: number, gid: number, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public chownSync(p: string, isLchown: boolean, uid: number, gid: number): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public utimes(p: string, atime: Date, mtime: Date, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public utimesSync(p: string, atime: Date, mtime: Date): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public link(srcpath: string, dstpath: string, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public linkSync(srcpath: string, dstpath: string): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public symlink(srcpath: string, dstpath: string, type: string, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public symlinkSync(srcpath: string, dstpath: string, type: string): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public readlink(p: string, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public readlinkSync(p: string): string {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n}\n\n/**\n * Implements the asynchronous API in terms of the synchronous API.\n * @class SynchronousFileSystem\n */\nexport class SynchronousFileSystem extends BaseFileSystem {\n public supportsSynch(): boolean {\n return true;\n }\n\n public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void {\n try {\n this.renameSync(oldPath, newPath);\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n public stat(p: string, isLstat: boolean | null, cb: BFSCallback): void {\n try {\n cb(null, this.statSync(p, isLstat));\n } catch (e) {\n cb(e);\n }\n }\n\n public open(p: string, flags: FileFlag, mode: number, cb: BFSCallback): void {\n try {\n cb(null, this.openSync(p, flags, mode));\n } catch (e) {\n cb(e);\n }\n }\n\n public unlink(p: string, cb: BFSOneArgCallback): void {\n try {\n this.unlinkSync(p);\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n public rmdir(p: string, cb: BFSOneArgCallback): void {\n try {\n this.rmdirSync(p);\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n public mkdir(p: string, mode: number, cb: BFSOneArgCallback): void {\n try {\n this.mkdirSync(p, mode);\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n public readdir(p: string, cb: BFSCallback): void {\n try {\n cb(null, this.readdirSync(p));\n } catch (e) {\n cb(e);\n }\n }\n\n public chmod(p: string, isLchmod: boolean, mode: number, cb: BFSOneArgCallback): void {\n try {\n this.chmodSync(p, isLchmod, mode);\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n public chown(p: string, isLchown: boolean, uid: number, gid: number, cb: BFSOneArgCallback): void {\n try {\n this.chownSync(p, isLchown, uid, gid);\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n public utimes(p: string, atime: Date, mtime: Date, cb: BFSOneArgCallback): void {\n try {\n this.utimesSync(p, atime, mtime);\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n public link(srcpath: string, dstpath: string, cb: BFSOneArgCallback): void {\n try {\n this.linkSync(srcpath, dstpath);\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n public symlink(srcpath: string, dstpath: string, type: string, cb: BFSOneArgCallback): void {\n try {\n this.symlinkSync(srcpath, dstpath, type);\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n public readlink(p: string, cb: BFSCallback): void {\n try {\n cb(null, this.readlinkSync(p));\n } catch (e) {\n cb(e);\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/file_system.ts","import {ApiError, ErrorCode} from './api_error';\nimport Stats from './node_fs_stats';\nimport {BFSCallback, BFSOneArgCallback, BFSThreeArgCallback} from './file_system';\n\nexport interface File {\n /**\n * **Core**: Get the current file position.\n */\n getPos(): number | undefined;\n /**\n * **Core**: Asynchronous `stat`.\n */\n stat(cb: BFSCallback): void;\n /**\n * **Core**: Synchronous `stat`.\n */\n statSync(): Stats;\n /**\n * **Core**: Asynchronous close.\n */\n close(cb: BFSOneArgCallback): void;\n /**\n * **Core**: Synchronous close.\n */\n closeSync(): void;\n /**\n * **Core**: Asynchronous truncate.\n */\n truncate(len: number, cb: BFSOneArgCallback): void;\n /**\n * **Core**: Synchronous truncate.\n */\n truncateSync(len: number): void;\n /**\n * **Core**: Asynchronous sync.\n */\n sync(cb: BFSOneArgCallback): void;\n /**\n * **Core**: Synchronous sync.\n */\n syncSync(): void;\n /**\n * **Core**: Write buffer to the file.\n * Note that it is unsafe to use fs.write multiple times on the same file\n * without waiting for the callback.\n * @param buffer Buffer containing the data to write to\n * the file.\n * @param offset Offset in the buffer to start reading data from.\n * @param length The amount of bytes to write to the file.\n * @param position Offset from the beginning of the file where this\n * data should be written. If position is null, the data will be written at\n * the current position.\n * @param cb The number specifies the number of bytes written into the file.\n */\n write(buffer: Buffer, offset: number, length: number, position: number | null, cb: BFSThreeArgCallback): void;\n /**\n * **Core**: Write buffer to the file.\n * Note that it is unsafe to use fs.writeSync multiple times on the same file\n * without waiting for it to return.\n * @param buffer Buffer containing the data to write to\n * the file.\n * @param offset Offset in the buffer to start reading data from.\n * @param length The amount of bytes to write to the file.\n * @param position Offset from the beginning of the file where this\n * data should be written. If position is null, the data will be written at\n * the current position.\n */\n writeSync(buffer: Buffer, offset: number, length: number, position: number | null): number;\n /**\n * **Core**: Read data from the file.\n * @param buffer The buffer that the data will be\n * written to.\n * @param offset The offset within the buffer where writing will\n * start.\n * @param length An integer specifying the number of bytes to read.\n * @param position An integer specifying where to begin reading from\n * in the file. If position is null, data will be read from the current file\n * position.\n * @param cb The number is the number of bytes read\n */\n read(buffer: Buffer, offset: number, length: number, position: number | null, cb: BFSThreeArgCallback): void;\n /**\n * **Core**: Read data from the file.\n * @param buffer The buffer that the data will be written to.\n * @param offset The offset within the buffer where writing will start.\n * @param length An integer specifying the number of bytes to read.\n * @param position An integer specifying where to begin reading from\n * in the file. If position is null, data will be read from the current file\n * position.\n */\n readSync(buffer: Buffer, offset: number, length: number, position: number): number;\n /**\n * **Supplementary**: Asynchronous `datasync`.\n *\n * Default implementation maps to `sync`.\n */\n datasync(cb: BFSOneArgCallback): void;\n /**\n * **Supplementary**: Synchronous `datasync`.\n *\n * Default implementation maps to `syncSync`.\n */\n datasyncSync(): void;\n /**\n * **Optional**: Asynchronous `chown`.\n */\n chown(uid: number, gid: number, cb: BFSOneArgCallback): void;\n /**\n * **Optional**: Synchronous `chown`.\n */\n chownSync(uid: number, gid: number): void;\n /**\n * **Optional**: Asynchronous `fchmod`.\n */\n chmod(mode: number, cb: BFSOneArgCallback): void;\n /**\n * **Optional**: Synchronous `fchmod`.\n */\n chmodSync(mode: number): void;\n /**\n * **Optional**: Change the file timestamps of the file.\n */\n utimes(atime: Date, mtime: Date, cb: BFSOneArgCallback): void;\n /**\n * **Optional**: Change the file timestamps of the file.\n */\n utimesSync(atime: Date, mtime: Date): void;\n}\n\n/**\n * Base class that contains shared implementations of functions for the file\n * object.\n */\nexport class BaseFile {\n public sync(cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public syncSync(): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public datasync(cb: BFSOneArgCallback): void {\n this.sync(cb);\n }\n public datasyncSync(): void {\n return this.syncSync();\n }\n public chown(uid: number, gid: number, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public chownSync(uid: number, gid: number): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public chmod(mode: number, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public chmodSync(mode: number): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n public utimes(atime: Date, mtime: Date, cb: BFSOneArgCallback): void {\n cb(new ApiError(ErrorCode.ENOTSUP));\n }\n public utimesSync(atime: Date, mtime: Date): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/file.ts","import {BaseFile, File} from '../core/file';\nimport {FileSystem, BFSOneArgCallback, BFSCallback, BFSThreeArgCallback} from '../core/file_system';\nimport Stats from '../core/node_fs_stats';\nimport {FileFlag} from '../core/file_flag';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport fs from '../core/node_fs';\nimport {emptyBuffer} from '../core/util';\n\n/**\n * An implementation of the File interface that operates on a file that is\n * completely in-memory. PreloadFiles are backed by a Buffer.\n *\n * This is also an abstract class, as it lacks an implementation of 'sync' and\n * 'close'. Each filesystem that wishes to use this file representation must\n * extend this class and implement those two methods.\n * @todo 'close' lever that disables functionality once closed.\n */\nexport default class PreloadFile extends BaseFile {\n protected _fs: T;\n private _pos: number = 0;\n private _path: string;\n private _stat: Stats;\n private _flag: FileFlag;\n private _buffer: Buffer;\n private _dirty: boolean = false;\n /**\n * Creates a file with the given path and, optionally, the given contents. Note\n * that, if contents is specified, it will be mutated by the file!\n * @param _fs The file system that created the file.\n * @param _path\n * @param _mode The mode that the file was opened using.\n * Dictates permissions and where the file pointer starts.\n * @param _stat The stats object for the given file.\n * PreloadFile will mutate this object. Note that this object must contain\n * the appropriate mode that the file was opened as.\n * @param contents A buffer containing the entire\n * contents of the file. PreloadFile will mutate this buffer. If not\n * specified, we assume it is a new file.\n */\n constructor(_fs: T, _path: string, _flag: FileFlag, _stat: Stats, contents?: Buffer) {\n super();\n this._fs = _fs;\n this._path = _path;\n this._flag = _flag;\n this._stat = _stat;\n if (contents) {\n this._buffer = contents;\n } else {\n // Empty buffer. It'll expand once we write stuff to it.\n this._buffer = emptyBuffer();\n }\n // Note: This invariant is *not* maintained once the file starts getting\n // modified.\n // Note: Only actually matters if file is readable, as writeable modes may\n // truncate/append to file.\n if (this._stat.size !== this._buffer.length && this._flag.isReadable()) {\n throw new Error(`Invalid buffer: Buffer is ${this._buffer.length} long, yet Stats object specifies that file is ${this._stat.size} long.`);\n }\n }\n\n /**\n * NONSTANDARD: Get the underlying buffer for this file. !!DO NOT MUTATE!! Will mess up dirty tracking.\n */\n public getBuffer(): Buffer {\n return this._buffer;\n }\n\n /**\n * NONSTANDARD: Get underlying stats for this file. !!DO NOT MUTATE!!\n */\n public getStats(): Stats {\n return this._stat;\n }\n\n public getFlag(): FileFlag {\n return this._flag;\n }\n\n /**\n * Get the path to this file.\n * @return [String] The path to the file.\n */\n public getPath(): string {\n return this._path;\n }\n\n /**\n * Get the current file position.\n *\n * We emulate the following bug mentioned in the Node documentation:\n * > On Linux, positional writes don't work when the file is opened in append\n * mode. The kernel ignores the position argument and always appends the data\n * to the end of the file.\n * @return [Number] The current file position.\n */\n public getPos(): number {\n if (this._flag.isAppendable()) {\n return this._stat.size;\n }\n return this._pos;\n }\n\n /**\n * Advance the current file position by the indicated number of positions.\n * @param [Number] delta\n */\n public advancePos(delta: number): number {\n return this._pos += delta;\n }\n\n /**\n * Set the file position.\n * @param [Number] newPos\n */\n public setPos(newPos: number): number {\n return this._pos = newPos;\n }\n\n /**\n * **Core**: Asynchronous sync. Must be implemented by subclasses of this\n * class.\n * @param [Function(BrowserFS.ApiError)] cb\n */\n public sync(cb: BFSOneArgCallback): void {\n try {\n this.syncSync();\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n /**\n * **Core**: Synchronous sync.\n */\n public syncSync(): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n\n /**\n * **Core**: Asynchronous close. Must be implemented by subclasses of this\n * class.\n * @param [Function(BrowserFS.ApiError)] cb\n */\n public close(cb: BFSOneArgCallback): void {\n try {\n this.closeSync();\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n /**\n * **Core**: Synchronous close.\n */\n public closeSync(): void {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n\n /**\n * Asynchronous `stat`.\n * @param [Function(BrowserFS.ApiError, BrowserFS.node.fs.Stats)] cb\n */\n public stat(cb: BFSCallback): void {\n try {\n cb(null, this._stat.clone());\n } catch (e) {\n cb(e);\n }\n }\n\n /**\n * Synchronous `stat`.\n */\n public statSync(): Stats {\n return this._stat.clone();\n }\n\n /**\n * Asynchronous truncate.\n * @param [Number] len\n * @param [Function(BrowserFS.ApiError)] cb\n */\n public truncate(len: number, cb: BFSOneArgCallback): void {\n try {\n this.truncateSync(len);\n if (this._flag.isSynchronous() && !fs.getRootFS()!.supportsSynch()) {\n this.sync(cb);\n }\n cb();\n } catch (e) {\n return cb(e);\n }\n }\n\n /**\n * Synchronous truncate.\n * @param [Number] len\n */\n public truncateSync(len: number): void {\n this._dirty = true;\n if (!this._flag.isWriteable()) {\n throw new ApiError(ErrorCode.EPERM, 'File not opened with a writeable mode.');\n }\n this._stat.mtime = new Date();\n if (len > this._buffer.length) {\n const buf = Buffer.alloc(len - this._buffer.length, 0);\n // Write will set @_stat.size for us.\n this.writeSync(buf, 0, buf.length, this._buffer.length);\n if (this._flag.isSynchronous() && fs.getRootFS()!.supportsSynch()) {\n this.syncSync();\n }\n return;\n }\n this._stat.size = len;\n // Truncate buffer to 'len'.\n const newBuff = Buffer.alloc(len);\n this._buffer.copy(newBuff, 0, 0, len);\n this._buffer = newBuff;\n if (this._flag.isSynchronous() && fs.getRootFS()!.supportsSynch()) {\n this.syncSync();\n }\n }\n\n /**\n * Write buffer to the file.\n * Note that it is unsafe to use fs.write multiple times on the same file\n * without waiting for the callback.\n * @param [BrowserFS.node.Buffer] buffer Buffer containing the data to write to\n * the file.\n * @param [Number] offset Offset in the buffer to start reading data from.\n * @param [Number] length The amount of bytes to write to the file.\n * @param [Number] position Offset from the beginning of the file where this\n * data should be written. If position is null, the data will be written at\n * the current position.\n * @param [Function(BrowserFS.ApiError, Number, BrowserFS.node.Buffer)]\n * cb The number specifies the number of bytes written into the file.\n */\n public write(buffer: Buffer, offset: number, length: number, position: number, cb: BFSThreeArgCallback): void {\n try {\n cb(null, this.writeSync(buffer, offset, length, position), buffer);\n } catch (e) {\n cb(e);\n }\n }\n\n /**\n * Write buffer to the file.\n * Note that it is unsafe to use fs.writeSync multiple times on the same file\n * without waiting for the callback.\n * @param [BrowserFS.node.Buffer] buffer Buffer containing the data to write to\n * the file.\n * @param [Number] offset Offset in the buffer to start reading data from.\n * @param [Number] length The amount of bytes to write to the file.\n * @param [Number] position Offset from the beginning of the file where this\n * data should be written. If position is null, the data will be written at\n * the current position.\n * @return [Number]\n */\n public writeSync(buffer: Buffer, offset: number, length: number, position: number): number {\n this._dirty = true;\n if (position === undefined || position === null) {\n position = this.getPos();\n }\n if (!this._flag.isWriteable()) {\n throw new ApiError(ErrorCode.EPERM, 'File not opened with a writeable mode.');\n }\n const endFp = position + length;\n if (endFp > this._stat.size) {\n this._stat.size = endFp;\n if (endFp > this._buffer.length) {\n // Extend the buffer!\n const newBuff = Buffer.alloc(endFp);\n this._buffer.copy(newBuff);\n this._buffer = newBuff;\n }\n }\n const len = buffer.copy(this._buffer, position, offset, offset + length);\n this._stat.mtime = new Date();\n if (this._flag.isSynchronous()) {\n this.syncSync();\n return len;\n }\n this.setPos(position + len);\n return len;\n }\n\n /**\n * Read data from the file.\n * @param [BrowserFS.node.Buffer] buffer The buffer that the data will be\n * written to.\n * @param [Number] offset The offset within the buffer where writing will\n * start.\n * @param [Number] length An integer specifying the number of bytes to read.\n * @param [Number] position An integer specifying where to begin reading from\n * in the file. If position is null, data will be read from the current file\n * position.\n * @param [Function(BrowserFS.ApiError, Number, BrowserFS.node.Buffer)] cb The\n * number is the number of bytes read\n */\n public read(buffer: Buffer, offset: number, length: number, position: number, cb: BFSThreeArgCallback): void {\n try {\n cb(null, this.readSync(buffer, offset, length, position), buffer);\n } catch (e) {\n cb(e);\n }\n }\n\n /**\n * Read data from the file.\n * @param [BrowserFS.node.Buffer] buffer The buffer that the data will be\n * written to.\n * @param [Number] offset The offset within the buffer where writing will\n * start.\n * @param [Number] length An integer specifying the number of bytes to read.\n * @param [Number] position An integer specifying where to begin reading from\n * in the file. If position is null, data will be read from the current file\n * position.\n * @return [Number]\n */\n public readSync(buffer: Buffer, offset: number, length: number, position: number): number {\n if (!this._flag.isReadable()) {\n throw new ApiError(ErrorCode.EPERM, 'File not opened with a readable mode.');\n }\n if (position === undefined || position === null) {\n position = this.getPos();\n }\n const endRead = position + length;\n if (endRead > this._stat.size) {\n length = this._stat.size - position;\n }\n const rv = this._buffer.copy(buffer, offset, position, position + length);\n this._stat.atime = new Date();\n this._pos = position + length;\n return rv;\n }\n\n /**\n * Asynchronous `fchmod`.\n * @param [Number|String] mode\n * @param [Function(BrowserFS.ApiError)] cb\n */\n public chmod(mode: number, cb: BFSOneArgCallback): void {\n try {\n this.chmodSync(mode);\n cb();\n } catch (e) {\n cb(e);\n }\n }\n\n /**\n * Asynchronous `fchmod`.\n * @param [Number] mode\n */\n public chmodSync(mode: number): void {\n if (!this._fs.supportsProps()) {\n throw new ApiError(ErrorCode.ENOTSUP);\n }\n this._dirty = true;\n this._stat.chmod(mode);\n this.syncSync();\n }\n\n protected isDirty(): boolean {\n return this._dirty;\n }\n\n /**\n * Resets the dirty bit. Should only be called after a sync has completed successfully.\n */\n protected resetDirty() {\n this._dirty = false;\n }\n}\n\n/**\n * File class for the InMemory and XHR file systems.\n * Doesn't sync to anything, so it works nicely for memory-only files.\n */\nexport class NoSyncFile extends PreloadFile implements File {\n constructor(_fs: T, _path: string, _flag: FileFlag, _stat: Stats, contents?: Buffer) {\n super(_fs, _path, _flag, _stat, contents);\n }\n /**\n * Asynchronous sync. Doesn't do anything, simply calls the cb.\n * @param [Function(BrowserFS.ApiError)] cb\n */\n public sync(cb: BFSOneArgCallback): void {\n cb();\n }\n /**\n * Synchronous sync. Doesn't do anything.\n */\n public syncSync(): void {\n // NOP.\n }\n /**\n * Asynchronous close. Doesn't do anything, simply calls the cb.\n * @param [Function(BrowserFS.ApiError)] cb\n */\n public close(cb: BFSOneArgCallback): void {\n cb();\n }\n /**\n * Synchronous close. Doesn't do anything.\n */\n public closeSync(): void {\n // NOP.\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/generic/preload_file.ts","import {FileSystem, SynchronousFileSystem, BFSOneArgCallback, BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport {FileFlag} from '../core/file_flag';\nimport {File} from '../core/file';\nimport Stats from '../core/node_fs_stats';\nimport PreloadFile from '../generic/preload_file';\nimport {deprecationMessage} from '../core/util';\nimport * as path from 'path';\n\n/**\n * @hidden\n */\ninterface IAsyncOperation {\n apiMethod: string;\n arguments: any[];\n}\n\n/**\n * We define our own file to interpose on syncSync() for mirroring purposes.\n */\nclass MirrorFile extends PreloadFile implements File {\n constructor(fs: AsyncMirror, path: string, flag: FileFlag, stat: Stats, data: Buffer) {\n super(fs, path, flag, stat, data);\n }\n\n public syncSync(): void {\n if (this.isDirty()) {\n this._fs._syncSync(this);\n this.resetDirty();\n }\n }\n\n public closeSync(): void {\n this.syncSync();\n }\n}\n\n/**\n * Configuration options for the AsyncMirror file system.\n */\nexport interface AsyncMirrorOptions {\n // The synchronous file system to mirror the asynchronous file system to.\n sync: FileSystem;\n // The asynchronous file system to mirror.\n async: FileSystem;\n}\n\n/**\n * AsyncMirrorFS mirrors a synchronous filesystem into an asynchronous filesystem\n * by:\n *\n * * Performing operations over the in-memory copy, while asynchronously pipelining them\n * to the backing store.\n * * During application loading, the contents of the async file system can be reloaded into\n * the synchronous store, if desired.\n *\n * The two stores will be kept in sync. The most common use-case is to pair a synchronous\n * in-memory filesystem with an asynchronous backing store.\n *\n * Example: Mirroring an IndexedDB file system to an in memory file system. Now, you can use\n * IndexedDB synchronously.\n *\n * ```javascript\n * BrowserFS.configure({\n * fs: \"AsyncMirror\",\n * options: {\n * sync: { fs: \"InMemory\" },\n * async: { fs: \"IndexedDB\" }\n * }\n * }, function(e) {\n * // BrowserFS is initialized and ready-to-use!\n * });\n * ```\n *\n * Or, alternatively:\n *\n * ```javascript\n * BrowserFS.FileSystem.IndexedDB.Create(function(e, idbfs) {\n * BrowserFS.FileSystem.InMemory.Create(function(e, inMemory) {\n * BrowserFS.FileSystem.AsyncMirror({\n * sync: inMemory, async: idbfs\n * }, function(e, mirrored) {\n * BrowserFS.initialize(mirrored);\n * });\n * });\n * });\n * ```\n */\nexport default class AsyncMirror extends SynchronousFileSystem implements FileSystem {\n public static readonly Name = \"AsyncMirror\";\n\n public static readonly Options: FileSystemOptions = {\n sync: {\n type: \"object\",\n description: \"The synchronous file system to mirror the asynchronous file system to.\"\n },\n async: {\n type: \"object\",\n description: \"The asynchronous file system to mirror.\"\n }\n };\n\n /**\n * Constructs and initializes an AsyncMirror file system with the given options.\n */\n public static Create(opts: AsyncMirrorOptions, cb: BFSCallback): void {\n try {\n const fs = new AsyncMirror(opts.sync, opts.async, false);\n fs.initialize((e?) => {\n if (e) {\n cb(e);\n } else {\n cb(null, fs);\n }\n }, false);\n } catch (e) {\n cb(e);\n }\n }\n\n public static isAvailable(): boolean {\n return true;\n }\n\n /**\n * Queue of pending asynchronous operations.\n */\n private _queue: IAsyncOperation[] = [];\n private _queueRunning: boolean = false;\n private _sync: FileSystem;\n private _async: FileSystem;\n private _isInitialized: boolean = false;\n private _initializeCallbacks: ((e?: ApiError) => void)[] = [];\n\n /**\n * **Deprecated; use AsyncMirror.Create() method instead.**\n *\n * Mirrors the synchronous file system into the asynchronous file system.\n *\n * **IMPORTANT**: You must call `initialize` on the file system before it can be used.\n * @param sync The synchronous file system to mirror the asynchronous file system to.\n * @param async The asynchronous file system to mirror.\n */\n constructor(sync: FileSystem, async: FileSystem, deprecateMsg = true) {\n super();\n this._sync = sync;\n this._async = async;\n if (!sync.supportsSynch()) {\n throw new Error(\"The first argument to AsyncMirror needs to be a synchronous file system.\");\n }\n deprecationMessage(deprecateMsg, AsyncMirror.Name, { sync: \"sync file system instance\", async: \"async file system instance\"});\n }\n\n public getName(): string {\n return AsyncMirror.Name;\n }\n\n public _syncSync(fd: PreloadFile) {\n this._sync.writeFileSync(fd.getPath(), fd.getBuffer(), null, FileFlag.getFileFlag('w'), fd.getStats().mode);\n this.enqueueOp({\n apiMethod: 'writeFile',\n arguments: [fd.getPath(), fd.getBuffer(), null, fd.getFlag(), fd.getStats().mode]\n });\n }\n\n /**\n * Called once to load up files from async storage into sync storage.\n */\n public initialize(userCb: BFSOneArgCallback, deprecateMsg = true): void {\n if (deprecateMsg) {\n console.warn(`[AsyncMirror] AsyncMirror.initialize() is deprecated and will be removed in the next major version. Please use 'AsyncMirror.Create({ sync: (sync file system instance), async: (async file system instance)}, cb)' to create and initialize AsyncMirror instances.`);\n }\n const callbacks = this._initializeCallbacks;\n\n const end = (e?: ApiError): void => {\n this._isInitialized = !e;\n this._initializeCallbacks = [];\n callbacks.forEach((cb) => cb(e));\n };\n\n if (!this._isInitialized) {\n // First call triggers initialization, the rest wait.\n if (callbacks.push(userCb) === 1) {\n const copyDirectory = (p: string, mode: number, cb: BFSOneArgCallback) => {\n if (p !== '/') {\n this._sync.mkdirSync(p, mode);\n }\n this._async.readdir(p, (err, files) => {\n let i = 0;\n // NOTE: This function must not be in a lexically nested statement,\n // such as an if or while statement. Safari refuses to run the\n // script since it is undefined behavior.\n function copyNextFile(err?: ApiError) {\n if (err) {\n cb(err);\n } else if (i < files!.length) {\n copyItem(path.join(p, files![i]), copyNextFile);\n i++;\n } else {\n cb();\n }\n }\n if (err) {\n cb(err);\n } else {\n copyNextFile();\n }\n });\n }, copyFile = (p: string, mode: number, cb: BFSOneArgCallback) => {\n this._async.readFile(p, null, FileFlag.getFileFlag('r'), (err, data) => {\n if (err) {\n cb(err);\n } else {\n try {\n this._sync.writeFileSync(p, data!, null, FileFlag.getFileFlag('w'), mode);\n } catch (e) {\n err = e;\n } finally {\n cb(err);\n }\n }\n });\n }, copyItem = (p: string, cb: BFSOneArgCallback) => {\n this._async.stat(p, false, (err, stats) => {\n if (err) {\n cb(err);\n } else if (stats!.isDirectory()) {\n copyDirectory(p, stats!.mode, cb);\n } else {\n copyFile(p, stats!.mode, cb);\n }\n });\n };\n copyDirectory('/', 0, end);\n }\n } else {\n userCb();\n }\n }\n\n public isReadOnly(): boolean { return false; }\n public supportsSynch(): boolean { return true; }\n public supportsLinks(): boolean { return false; }\n public supportsProps(): boolean { return this._sync.supportsProps() && this._async.supportsProps(); }\n\n public renameSync(oldPath: string, newPath: string): void {\n this.checkInitialized();\n this._sync.renameSync(oldPath, newPath);\n this.enqueueOp({\n apiMethod: 'rename',\n arguments: [oldPath, newPath]\n });\n }\n\n public statSync(p: string, isLstat: boolean): Stats {\n this.checkInitialized();\n return this._sync.statSync(p, isLstat);\n }\n\n public openSync(p: string, flag: FileFlag, mode: number): File {\n this.checkInitialized();\n // Sanity check: Is this open/close permitted?\n const fd = this._sync.openSync(p, flag, mode);\n fd.closeSync();\n return new MirrorFile(this, p, flag, this._sync.statSync(p, false), this._sync.readFileSync(p, null, FileFlag.getFileFlag('r')));\n }\n\n public unlinkSync(p: string): void {\n this.checkInitialized();\n this._sync.unlinkSync(p);\n this.enqueueOp({\n apiMethod: 'unlink',\n arguments: [p]\n });\n }\n\n public rmdirSync(p: string): void {\n this.checkInitialized();\n this._sync.rmdirSync(p);\n this.enqueueOp({\n apiMethod: 'rmdir',\n arguments: [p]\n });\n }\n\n public mkdirSync(p: string, mode: number): void {\n this.checkInitialized();\n this._sync.mkdirSync(p, mode);\n this.enqueueOp({\n apiMethod: 'mkdir',\n arguments: [p, mode]\n });\n }\n\n public readdirSync(p: string): string[] {\n this.checkInitialized();\n return this._sync.readdirSync(p);\n }\n\n public existsSync(p: string): boolean {\n this.checkInitialized();\n return this._sync.existsSync(p);\n }\n\n public chmodSync(p: string, isLchmod: boolean, mode: number): void {\n this.checkInitialized();\n this._sync.chmodSync(p, isLchmod, mode);\n this.enqueueOp({\n apiMethod: 'chmod',\n arguments: [p, isLchmod, mode]\n });\n }\n\n public chownSync(p: string, isLchown: boolean, uid: number, gid: number): void {\n this.checkInitialized();\n this._sync.chownSync(p, isLchown, uid, gid);\n this.enqueueOp({\n apiMethod: 'chown',\n arguments: [p, isLchown, uid, gid]\n });\n }\n\n public utimesSync(p: string, atime: Date, mtime: Date): void {\n this.checkInitialized();\n this._sync.utimesSync(p, atime, mtime);\n this.enqueueOp({\n apiMethod: 'utimes',\n arguments: [p, atime, mtime]\n });\n }\n\n private checkInitialized(): void {\n if (!this._isInitialized) {\n throw new ApiError(ErrorCode.EPERM, \"AsyncMirrorFS is not initialized. Please initialize AsyncMirrorFS using its initialize() method before using it.\");\n }\n }\n\n private enqueueOp(op: IAsyncOperation) {\n this._queue.push(op);\n if (!this._queueRunning) {\n this._queueRunning = true;\n const doNextOp = (err?: ApiError) => {\n if (err) {\n console.error(`WARNING: File system has desynchronized. Received following error: ${err}\\n$`);\n }\n if (this._queue.length > 0) {\n const op = this._queue.shift()!,\n args = op.arguments;\n args.push(doNextOp);\n ( ( this._async)[op.apiMethod]).apply(this._async, args);\n } else {\n this._queueRunning = false;\n }\n };\n doNextOp();\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/AsyncMirror.ts","import rest from './rest';\n\nexport default function (fn) {\n return rest(function (args/*..., callback*/) {\n var callback = args.pop();\n fn.call(this, args, callback);\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/initialParams.js","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_freeGlobal.js","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_root.js","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_Symbol.js","// A temporary value used to identify if the loop should be broken.\n// See #1064, #1293\nexport default {};\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/breakLoop.js","var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;\n\nexport default function (coll) {\n return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/internal/getIterator.js","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/isArguments.js","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/isArray.js","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/isBuffer.js","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_nodeUtil.js","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/isTypedArray.js","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_nativeKeys.js","import doParallel from './internal/doParallel';\nimport map from './internal/map';\n\n/**\n * Produces a new collection of values by mapping each value in `coll` through\n * the `iteratee` function. The `iteratee` is called with an item from `coll`\n * and a callback for when it has finished processing. Each of these callback\n * takes 2 arguments: an `error`, and the transformed item from `coll`. If\n * `iteratee` passes an error to its callback, the main `callback` (for the\n * `map` function) is immediately called with the error.\n *\n * Note, that since this function applies the `iteratee` to each item in\n * parallel, there is no guarantee that the `iteratee` functions will complete\n * in order. However, the results array will be in the same order as the\n * original `coll`.\n *\n * If `map` is passed an Object, the results will be an Array. The results\n * will roughly be in the order of the original Objects' keys (but this can\n * vary across JavaScript engines)\n *\n * @name map\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A function to apply to each item in `coll`.\n * The iteratee is passed a `callback(err, transformed)` which must be called\n * once it has completed with an error (which can be `null`) and a\n * transformed item. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an Array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @example\n *\n * async.map(['file1','file2','file3'], fs.stat, function(err, results) {\n * // results is now an array of stats for each file\n * });\n */\nexport default doParallel(map);\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/map.js","import applyEach from './internal/applyEach';\nimport map from './map';\n\n/**\n * Applies the provided arguments to each function in the array, calling\n * `callback` after all functions have completed. If you only provide the first\n * argument, `fns`, then it will return a function which lets you pass in the\n * arguments as if it were a single function call. If more arguments are\n * provided, `callback` is required while `args` is still optional.\n *\n * @name applyEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} fns - A collection of asynchronous functions\n * to all call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {Function} - If only the first argument, `fns`, is provided, it will\n * return a function which lets you pass in the arguments as if it were a single\n * function call. The signature is `(..args, callback)`. If invoked with any\n * arguments, `callback` is required.\n * @example\n *\n * async.applyEach([enableSearch, updateSchema], 'bucket', callback);\n *\n * // partial application example:\n * async.each(\n * buckets,\n * async.applyEach([enableSearch, updateSchema]),\n * callback\n * );\n */\nexport default applyEach(map);\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/applyEach.js","import doParallelLimit from './internal/doParallelLimit';\nimport map from './internal/map';\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.\n *\n * @name mapLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - A function to apply to each item in `coll`.\n * The iteratee is passed a `callback(err, transformed)` which must be called\n * once it has completed with an error (which can be `null`) and a transformed\n * item. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n */\nexport default doParallelLimit(map);\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/mapLimit.js","import mapLimit from './mapLimit';\nimport doLimit from './internal/doLimit';\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.\n *\n * @name mapSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A function to apply to each item in `coll`.\n * The iteratee is passed a `callback(err, transformed)` which must be called\n * once it has completed with an error (which can be `null`) and a\n * transformed item. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n */\nexport default doLimit(mapLimit, 1);\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/mapSeries.js","import applyEach from './internal/applyEach';\nimport mapSeries from './mapSeries';\n\n/**\n * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.\n *\n * @name applyEachSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.applyEach]{@link module:ControlFlow.applyEach}\n * @category Control Flow\n * @param {Array|Iterable|Object} fns - A collection of asynchronous functions to all\n * call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {Function} - If only the first argument is provided, it will return\n * a function which lets you pass in the arguments as if it were a single\n * function call.\n */\nexport default applyEach(mapSeries);\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/applyEachSeries.js","import rest from './internal/rest';\n\n/**\n * Creates a continuation function with some arguments already applied.\n *\n * Useful as a shorthand when combined with other control flow functions. Any\n * arguments passed to the returned function are added to the arguments\n * originally passed to apply.\n *\n * @name apply\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {Function} function - The function you want to eventually apply all\n * arguments to. Invokes with (arguments...).\n * @param {...*} arguments... - Any number of arguments to automatically apply\n * when the continuation is called.\n * @example\n *\n * // using apply\n * async.parallel([\n * async.apply(fs.writeFile, 'testfile1', 'test1'),\n * async.apply(fs.writeFile, 'testfile2', 'test2')\n * ]);\n *\n *\n * // the same process without using apply\n * async.parallel([\n * function(callback) {\n * fs.writeFile('testfile1', 'test1', callback);\n * },\n * function(callback) {\n * fs.writeFile('testfile2', 'test2', callback);\n * }\n * ]);\n *\n * // It's possible to pass any number of additional arguments when calling the\n * // continuation:\n *\n * node> var fn = async.apply(sys.puts, 'one');\n * node> fn('two', 'three');\n * one\n * two\n * three\n */\nexport default rest(function(fn, args) {\n return rest(function(callArgs) {\n return fn.apply(null, args.concat(callArgs));\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/apply.js","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_baseFor.js","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nexport default unicodeToArray;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_unicodeToArray.js","import eachOfLimit from './eachOfLimit';\nimport doLimit from './internal/doLimit';\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.\n *\n * @name eachOfSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A function to apply to each item in `coll`. The\n * `key` is the item's key, or index in the case of an array. The iteratee is\n * passed a `callback(err)` which must be called once it has completed. If no\n * error has occurred, the callback should be run without arguments or with an\n * explicit `null` argument. Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Invoked with (err).\n */\nexport default doLimit(eachOfLimit, 1);\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/eachOfSeries.js","import noop from 'lodash-es/noop';\nimport rest from './internal/rest';\nimport reduce from './reduce';\n\n/**\n * Version of the compose function that is more natural to read. Each function\n * consumes the return value of the previous function. It is the equivalent of\n * [compose]{@link module:ControlFlow.compose} with the arguments reversed.\n *\n * Each function is executed with the `this` binding of the composed function.\n *\n * @name seq\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.compose]{@link module:ControlFlow.compose}\n * @category Control Flow\n * @param {...Function} functions - the asynchronous functions to compose\n * @returns {Function} a function that composes the `functions` in order\n * @example\n *\n * // Requires lodash (or underscore), express3 and dresende's orm2.\n * // Part of an app, that fetches cats of the logged user.\n * // This example uses `seq` function to avoid overnesting and error\n * // handling clutter.\n * app.get('/cats', function(request, response) {\n * var User = request.models.User;\n * async.seq(\n * _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))\n * function(user, fn) {\n * user.getCats(fn); // 'getCats' has signature (callback(err, data))\n * }\n * )(req.session.user_id, function (err, cats) {\n * if (err) {\n * console.error(err);\n * response.json({ status: 'error', message: err.message });\n * } else {\n * response.json({ status: 'ok', message: 'Cats found', data: cats });\n * }\n * });\n * });\n */\nexport default rest(function seq(functions) {\n return rest(function(args) {\n var that = this;\n\n var cb = args[args.length - 1];\n if (typeof cb == 'function') {\n args.pop();\n } else {\n cb = noop;\n }\n\n reduce(functions, args, function(newargs, fn, cb) {\n fn.apply(that, newargs.concat(rest(function(err, nextargs) {\n cb(err, nextargs);\n })));\n },\n function(err, results) {\n cb.apply(that, [err].concat(results));\n });\n });\n})\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/seq.js","import seq from './seq';\nimport rest from './internal/rest';\n\n/**\n * Creates a function which is a composition of the passed asynchronous\n * functions. Each function consumes the return value of the function that\n * follows. Composing functions `f()`, `g()`, and `h()` would produce the result\n * of `f(g(h()))`, only this version uses callbacks to obtain the return values.\n *\n * Each function is executed with the `this` binding of the composed function.\n *\n * @name compose\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {...Function} functions - the asynchronous functions to compose\n * @returns {Function} an asynchronous function that is the composed\n * asynchronous `functions`\n * @example\n *\n * function add1(n, callback) {\n * setTimeout(function () {\n * callback(null, n + 1);\n * }, 10);\n * }\n *\n * function mul3(n, callback) {\n * setTimeout(function () {\n * callback(null, n * 3);\n * }, 10);\n * }\n *\n * var add1mul3 = async.compose(mul3, add1);\n * add1mul3(4, function (err, result) {\n * // result now equals 15\n * });\n */\nexport default rest(function(args) {\n return seq.apply(null, args.reverse());\n});\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/compose.js","import rest from './internal/rest';\nimport initialParams from './internal/initialParams';\n\n/**\n * Returns a function that when called, calls-back with the values provided.\n * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to\n * [`auto`]{@link module:ControlFlow.auto}.\n *\n * @name constant\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {...*} arguments... - Any number of arguments to automatically invoke\n * callback with.\n * @returns {Function} Returns a function that when invoked, automatically\n * invokes the callback with the previous given arguments.\n * @example\n *\n * async.waterfall([\n * async.constant(42),\n * function (value, next) {\n * // value === 42\n * },\n * //...\n * ], callback);\n *\n * async.waterfall([\n * async.constant(filename, \"utf8\"),\n * fs.readFile,\n * function (fileData, next) {\n * //...\n * }\n * //...\n * ], callback);\n *\n * async.auto({\n * hostname: async.constant(\"https://server.net/\"),\n * port: findFreePort,\n * launchServer: [\"hostname\", \"port\", function (options, cb) {\n * startServer(options, cb);\n * }],\n * //...\n * }, callback);\n */\nexport default rest(function(values) {\n var args = [null].concat(values);\n return initialParams(function (ignoredArgs, callback) {\n return callback.apply(this, args);\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/constant.js","import consoleFunc from './internal/consoleFunc';\n\n/**\n * Logs the result of an `async` function to the `console` using `console.dir`\n * to display the properties of the resulting object. Only works in Node.js or\n * in browsers that support `console.dir` and `console.error` (such as FF and\n * Chrome). If multiple arguments are returned from the async function,\n * `console.dir` is called on each argument in order.\n *\n * @name dir\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {Function} function - The function you want to eventually apply all\n * arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, {hello: name});\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.dir(hello, 'world');\n * {hello: 'world'}\n */\nexport default consoleFunc('dir');\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/dir.js","import consoleFunc from './internal/consoleFunc';\n\n/**\n * Logs the result of an `async` function to the `console`. Only works in\n * Node.js or in browsers that support `console.log` and `console.error` (such\n * as FF and Chrome). If multiple arguments are returned from the async\n * function, `console.log` is called on each argument in order.\n *\n * @name log\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {Function} function - The function you want to eventually apply all\n * arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n * setTimeout(function() {\n * callback(null, 'hello ' + name);\n * }, 1000);\n * };\n *\n * // in the node repl\n * node> async.log(hello, 'world');\n * 'hello world'\n */\nexport default consoleFunc('log');\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/log.js","'use strict';\n\nimport { hasNextTick, hasSetImmediate, fallback, wrap } from './internal/setImmediate';\n\n/**\n * Calls `callback` on a later loop around the event loop. In Node.js this just\n * calls `setImmediate`. In the browser it will use `setImmediate` if\n * available, otherwise `setTimeout(callback, 0)`, which means other higher\n * priority events may precede the execution of `callback`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name nextTick\n * @static\n * @memberOf module:Utils\n * @method\n * @alias setImmediate\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n * call_order.push('two');\n * // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n * // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nvar _defer;\n\nif (hasNextTick) {\n _defer = process.nextTick;\n} else if (hasSetImmediate) {\n _defer = setImmediate;\n} else {\n _defer = fallback;\n}\n\nexport default wrap(_defer);\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/async-es/nextTick.js","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nexport default baseRange;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../~/lodash-es/_baseRange.js","/**\n * Exports the global scope variable.\n * In the main browser thread, this is \"window\".\n * In a WebWorker, this is \"self\".\n * In Node, this is \"global\".\n * @hidden\n * @private\n */\ndeclare var global: any;\n/**\n * @hidden\n */\nlet toExport: any;\nif (typeof(window) !== 'undefined') {\n toExport = window;\n} else if (typeof(self) !== 'undefined') {\n toExport = self;\n} else {\n toExport = global;\n}\nexport default toExport;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/global.ts","import {default as Stats, FileType} from '../core/node_fs_stats';\n\n/**\n * Generic inode definition that can easily be serialized.\n */\nexport default class Inode {\n /**\n * Converts the buffer into an Inode.\n */\n public static fromBuffer(buffer: Buffer): Inode {\n if (buffer === undefined) {\n throw new Error(\"NO\");\n }\n return new Inode(buffer.toString('ascii', 30),\n buffer.readUInt32LE(0),\n buffer.readUInt16LE(4),\n buffer.readDoubleLE(6),\n buffer.readDoubleLE(14),\n buffer.readDoubleLE(22)\n );\n }\n\n constructor(public id: string,\n public size: number,\n public mode: number,\n public atime: number,\n public mtime: number,\n public ctime: number) { }\n\n /**\n * Handy function that converts the Inode to a Node Stats object.\n */\n public toStats(): Stats {\n return new Stats(\n (this.mode & 0xF000) === FileType.DIRECTORY ? FileType.DIRECTORY : FileType.FILE,\n this.size, this.mode, new Date(this.atime), new Date(this.mtime), new Date(this.ctime));\n }\n\n /**\n * Get the size of this Inode, in bytes.\n */\n public getSize(): number {\n // ASSUMPTION: ID is ASCII (1 byte per char).\n return 30 + this.id.length;\n }\n\n /**\n * Writes the inode into the start of the buffer.\n */\n public toBuffer(buff: Buffer = Buffer.alloc(this.getSize())): Buffer {\n buff.writeUInt32LE(this.size, 0);\n buff.writeUInt16LE(this.mode, 4);\n buff.writeDoubleLE(this.atime, 6);\n buff.writeDoubleLE(this.mtime, 14);\n buff.writeDoubleLE(this.ctime, 22);\n buff.write(this.id, 30, this.id.length, 'ascii');\n return buff;\n }\n\n /**\n * Updates the Inode using information from the stats object. Used by file\n * systems at sync time, e.g.:\n * - Program opens file and gets a File object.\n * - Program mutates file. File object is responsible for maintaining\n * metadata changes locally -- typically in a Stats object.\n * - Program closes file. File object's metadata changes are synced with the\n * file system.\n * @return True if any changes have occurred.\n */\n public update(stats: Stats): boolean {\n let hasChanged = false;\n if (this.size !== stats.size) {\n this.size = stats.size;\n hasChanged = true;\n }\n\n if (this.mode !== stats.mode) {\n this.mode = stats.mode;\n hasChanged = true;\n }\n\n const atimeMs = stats.atime.getTime();\n if (this.atime !== atimeMs) {\n this.atime = atimeMs;\n hasChanged = true;\n }\n\n const mtimeMs = stats.mtime.getTime();\n if (this.mtime !== mtimeMs) {\n this.mtime = mtimeMs;\n hasChanged = true;\n }\n\n const ctimeMs = stats.ctime.getTime();\n if (this.ctime !== ctimeMs) {\n this.ctime = ctimeMs;\n hasChanged = true;\n }\n\n return hasChanged;\n }\n\n // XXX: Copied from Stats. Should reconcile these two into something more\n // compact.\n\n /**\n * @return [Boolean] True if this item is a file.\n */\n public isFile(): boolean {\n return (this.mode & 0xF000) === FileType.FILE;\n }\n\n /**\n * @return [Boolean] True if this item is a directory.\n */\n public isDirectory(): boolean {\n return (this.mode & 0xF000) === FileType.DIRECTORY;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/generic/inode.ts","import {BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {SyncKeyValueStore, SimpleSyncStore, SimpleSyncRWTransaction, SyncKeyValueRWTransaction, SyncKeyValueFileSystem} from '../generic/key_value_filesystem';\n\n/**\n * A simple in-memory key-value store backed by a JavaScript object.\n */\nexport class InMemoryStore implements SyncKeyValueStore, SimpleSyncStore {\n private store: { [key: string]: Buffer } = {};\n\n public name() { return InMemoryFileSystem.Name; }\n public clear() { this.store = {}; }\n\n public beginTransaction(type: string): SyncKeyValueRWTransaction {\n return new SimpleSyncRWTransaction(this);\n }\n\n public get(key: string): Buffer {\n return this.store[key];\n }\n\n public put(key: string, data: Buffer, overwrite: boolean): boolean {\n if (!overwrite && this.store.hasOwnProperty(key)) {\n return false;\n }\n this.store[key] = data;\n return true;\n }\n\n public del(key: string): void {\n delete this.store[key];\n }\n}\n\n/**\n * A simple in-memory file system backed by an InMemoryStore.\n * Files are not persisted across page loads.\n */\nexport default class InMemoryFileSystem extends SyncKeyValueFileSystem {\n public static readonly Name = \"InMemory\";\n\n public static readonly Options: FileSystemOptions = {};\n\n /**\n * Creates an InMemoryFileSystem instance.\n */\n public static Create(options: any, cb: BFSCallback): void {\n cb(null, new InMemoryFileSystem());\n }\n constructor() {\n super({ store: new InMemoryStore() });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/InMemory.ts","import {BFSCallback, FileSystemOptions} from '../core/file_system';\nimport {SyncKeyValueStore, SimpleSyncStore, SyncKeyValueFileSystem, SimpleSyncRWTransaction, SyncKeyValueRWTransaction} from '../generic/key_value_filesystem';\nimport {ApiError, ErrorCode} from '../core/api_error';\nimport global from '../core/global';\n\n/**\n * Some versions of FF and all versions of IE do not support the full range of\n * 16-bit numbers encoded as characters, as they enforce UTF-16 restrictions.\n * @url http://stackoverflow.com/questions/11170716/are-there-any-characters-that-are-not-allowed-in-localstorage/11173673#11173673\n * @hidden\n */\nlet supportsBinaryString: boolean = false,\n binaryEncoding: string;\ntry {\n global.localStorage.setItem(\"__test__\", String.fromCharCode(0xD800));\n supportsBinaryString = global.localStorage.getItem(\"__test__\") === String.fromCharCode(0xD800);\n} catch (e) {\n // IE throws an exception.\n supportsBinaryString = false;\n}\nbinaryEncoding = supportsBinaryString ? 'binary_string' : 'binary_string_ie';\nif (!Buffer.isEncoding(binaryEncoding)) {\n // Fallback for non BrowserFS implementations of buffer that lack a\n // binary_string format.\n binaryEncoding = \"base64\";\n}\n\n/**\n * A synchronous key-value store backed by localStorage.\n */\nexport class LocalStorageStore implements SyncKeyValueStore, SimpleSyncStore {\n public name(): string {\n return LocalStorageFileSystem.Name;\n }\n\n public clear(): void {\n global.localStorage.clear();\n }\n\n public beginTransaction(type: string): SyncKeyValueRWTransaction {\n // No need to differentiate.\n return new SimpleSyncRWTransaction(this);\n }\n\n public get(key: string): Buffer | undefined {\n try {\n const data = global.localStorage.getItem(key);\n if (data !== null) {\n return Buffer.from(data, binaryEncoding);\n }\n } catch (e) {\n // Do nothing.\n }\n // Key doesn't exist, or a failure occurred.\n return undefined;\n }\n\n public put(key: string, data: Buffer, overwrite: boolean): boolean {\n try {\n if (!overwrite && global.localStorage.getItem(key) !== null) {\n // Don't want to overwrite the key!\n return false;\n }\n global.localStorage.setItem(key, data.toString(binaryEncoding));\n return true;\n } catch (e) {\n throw new ApiError(ErrorCode.ENOSPC, \"LocalStorage is full.\");\n }\n }\n\n public del(key: string): void {\n try {\n global.localStorage.removeItem(key);\n } catch (e) {\n throw new ApiError(ErrorCode.EIO, \"Unable to delete key \" + key + \": \" + e);\n }\n }\n}\n\n/**\n * A synchronous file system backed by localStorage. Connects our\n * LocalStorageStore to our SyncKeyValueFileSystem.\n */\nexport default class LocalStorageFileSystem extends SyncKeyValueFileSystem {\n public static readonly Name = \"LocalStorage\";\n\n public static readonly Options: FileSystemOptions = {};\n\n /**\n * Creates a LocalStorageFileSystem instance.\n */\n public static Create(options: any, cb: BFSCallback): void {\n cb(null, new LocalStorageFileSystem());\n }\n public static isAvailable(): boolean {\n return typeof global.localStorage !== 'undefined';\n }\n /**\n * Creates a new LocalStorage file system using the contents of `localStorage`.\n */\n constructor() { super({ store: new LocalStorageStore() }); }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/backend/LocalStorage.ts","import global from '../core/global';\n\n/**\n * @hidden\n */\nlet bfsSetImmediate: (cb: Function) => any;\nif (typeof(setImmediate) !== \"undefined\") {\n bfsSetImmediate = setImmediate;\n} else {\n const gScope = global;\n const timeouts: (() => void)[] = [];\n const messageName = \"zero-timeout-message\";\n const canUsePostMessage = function() {\n if (typeof gScope.importScripts !== 'undefined' || !gScope.postMessage) {\n return false;\n }\n let postMessageIsAsync = true;\n const oldOnMessage = gScope.onmessage;\n gScope.onmessage = function() {\n postMessageIsAsync = false;\n };\n gScope.postMessage('', '*');\n gScope.onmessage = oldOnMessage;\n return postMessageIsAsync;\n };\n if (canUsePostMessage()) {\n bfsSetImmediate = function(fn: () => void) {\n timeouts.push(fn);\n gScope.postMessage(messageName, \"*\");\n };\n const handleMessage = function(event: MessageEvent) {\n if (event.source === self && event.data === messageName) {\n if (event.stopPropagation) {\n event.stopPropagation();\n } else {\n event.cancelBubble = true;\n }\n if (timeouts.length > 0) {\n const fn = timeouts.shift()!;\n return fn();\n }\n }\n };\n if (gScope.addEventListener) {\n gScope.addEventListener('message', handleMessage, true);\n } else {\n gScope.attachEvent('onmessage', handleMessage);\n }\n } else if (gScope.MessageChannel) {\n // WebWorker MessageChannel\n const channel = new gScope.MessageChannel();\n channel.port1.onmessage = (event: any) => {\n if (timeouts.length > 0) {\n return timeouts.shift()!();\n }\n };\n bfsSetImmediate = (fn: () => void) => {\n timeouts.push(fn);\n channel.port2.postMessage('');\n };\n } else {\n bfsSetImmediate = function(fn: () => void) {\n return setTimeout(fn, 0);\n };\n }\n}\n\nexport default bfsSetImmediate;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/generic/setImmediate.ts","import setImmediate from '../generic/setImmediate';\n\n/**\n * Non-recursive mutex\n * @hidden\n */\nexport default class Mutex {\n private _locked: boolean = false;\n private _waiters: Function[] = [];\n\n public lock(cb: Function): void {\n if (this._locked) {\n this._waiters.push(cb);\n return;\n }\n this._locked = true;\n cb();\n }\n\n public unlock(): void {\n if (!this._locked) {\n throw new Error('unlock of a non-locked mutex');\n }\n\n const next = this._waiters.shift();\n // don't unlock - we want to queue up next for the\n // _end_ of the current task execution, but we don't\n // want it to be called inline with whatever the\n // current stack is. This way we still get the nice\n // behavior that an unlock immediately followed by a\n // lock won't cause starvation.\n if (next) {\n setImmediate(next);\n return;\n }\n\n this._locked = false;\n }\n\n public tryLock(): boolean {\n if (this._locked) {\n return false;\n }\n\n this._locked = true;\n return true;\n }\n\n public isLocked(): boolean {\n return this._locked;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/generic/mutex.ts","import Mutex from './mutex';\nimport {FileSystem, BFSOneArgCallback, BFSCallback} from '../core/file_system';\nimport {ApiError} from '../core/api_error';\nimport {FileFlag} from '../core/file_flag';\nimport {default as Stats} from '../core/node_fs_stats';\nimport {File} from '../core/file';\n\n/**\n * This class serializes access to an underlying async filesystem.\n * For example, on an OverlayFS instance with an async lower\n * directory operations like rename and rmdir may involve multiple\n * requests involving both the upper and lower filesystems -- they\n * are not executed in a single atomic step. OverlayFS uses this\n * LockedFS to avoid having to reason about the correctness of\n * multiple requests interleaving.\n */\nexport default class LockedFS implements FileSystem {\n private _fs: T;\n private _mu: Mutex;\n\n constructor(fs: T) {\n this._fs = fs;\n this._mu = new Mutex();\n }\n\n public getName(): string {\n return 'LockedFS<' + this._fs.getName() + '>';\n }\n\n public getFSUnlocked(): T {\n return this._fs;\n }\n\n public initialize(cb: BFSOneArgCallback): void {\n // FIXME: check to see if FS supports initialization\n ( this._fs).initialize(cb);\n }\n\n public diskSpace(p: string, cb: (total: number, free: number) => any): void {\n // FIXME: should this lock?\n this._fs.diskSpace(p, cb);\n }\n\n public isReadOnly(): boolean {\n return this._fs.isReadOnly();\n }\n\n public supportsLinks(): boolean {\n return this._fs.supportsLinks();\n }\n\n public supportsProps(): boolean {\n return this._fs.supportsProps();\n }\n\n public supportsSynch(): boolean {\n return this._fs.supportsSynch();\n }\n\n public rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.rename(oldPath, newPath, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public renameSync(oldPath: string, newPath: string): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.renameSync(oldPath, newPath);\n }\n\n public stat(p: string, isLstat: boolean, cb: BFSCallback): void {\n this._mu.lock(() => {\n this._fs.stat(p, isLstat, (err?: ApiError, stat?: Stats) => {\n this._mu.unlock();\n cb(err, stat);\n });\n });\n }\n\n public statSync(p: string, isLstat: boolean): Stats {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.statSync(p, isLstat);\n }\n\n public open(p: string, flag: FileFlag, mode: number, cb: BFSCallback): void {\n this._mu.lock(() => {\n this._fs.open(p, flag, mode, (err?: ApiError, fd?: File) => {\n this._mu.unlock();\n cb(err, fd);\n });\n });\n }\n\n public openSync(p: string, flag: FileFlag, mode: number): File {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.openSync(p, flag, mode);\n }\n\n public unlink(p: string, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.unlink(p, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public unlinkSync(p: string): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.unlinkSync(p);\n }\n\n public rmdir(p: string, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.rmdir(p, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public rmdirSync(p: string): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.rmdirSync(p);\n }\n\n public mkdir(p: string, mode: number, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.mkdir(p, mode, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public mkdirSync(p: string, mode: number): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.mkdirSync(p, mode);\n }\n\n public readdir(p: string, cb: BFSCallback): void {\n this._mu.lock(() => {\n this._fs.readdir(p, (err?: ApiError, files?: string[]) => {\n this._mu.unlock();\n cb(err, files);\n });\n });\n }\n\n public readdirSync(p: string): string[] {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.readdirSync(p);\n }\n\n public exists(p: string, cb: (exists: boolean) => void): void {\n this._mu.lock(() => {\n this._fs.exists(p, (exists: boolean) => {\n this._mu.unlock();\n cb(exists);\n });\n });\n }\n\n public existsSync(p: string): boolean {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.existsSync(p);\n }\n\n public realpath(p: string, cache: {[path: string]: string}, cb: BFSCallback): void {\n this._mu.lock(() => {\n this._fs.realpath(p, cache, (err?: ApiError, resolvedPath?: string) => {\n this._mu.unlock();\n cb(err, resolvedPath);\n });\n });\n }\n\n public realpathSync(p: string, cache: {[path: string]: string}): string {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.realpathSync(p, cache);\n }\n\n public truncate(p: string, len: number, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.truncate(p, len, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public truncateSync(p: string, len: number): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.truncateSync(p, len);\n }\n\n public readFile(fname: string, encoding: string, flag: FileFlag, cb: BFSCallback): void {\n this._mu.lock(() => {\n this._fs.readFile(fname, encoding, flag, (err?: ApiError, data?: any) => {\n this._mu.unlock();\n cb(err, data);\n });\n });\n }\n\n public readFileSync(fname: string, encoding: string, flag: FileFlag): any {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.readFileSync(fname, encoding, flag);\n }\n\n public writeFile(fname: string, data: any, encoding: string, flag: FileFlag, mode: number, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.writeFile(fname, data, encoding, flag, mode, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public writeFileSync(fname: string, data: any, encoding: string, flag: FileFlag, mode: number): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.writeFileSync(fname, data, encoding, flag, mode);\n }\n\n public appendFile(fname: string, data: any, encoding: string, flag: FileFlag, mode: number, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.appendFile(fname, data, encoding, flag, mode, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public appendFileSync(fname: string, data: any, encoding: string, flag: FileFlag, mode: number): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.appendFileSync(fname, data, encoding, flag, mode);\n }\n\n public chmod(p: string, isLchmod: boolean, mode: number, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.chmod(p, isLchmod, mode, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public chmodSync(p: string, isLchmod: boolean, mode: number): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.chmodSync(p, isLchmod, mode);\n }\n\n public chown(p: string, isLchown: boolean, uid: number, gid: number, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.chown(p, isLchown, uid, gid, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public chownSync(p: string, isLchown: boolean, uid: number, gid: number): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.chownSync(p, isLchown, uid, gid);\n }\n\n public utimes(p: string, atime: Date, mtime: Date, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.utimes(p, atime, mtime, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public utimesSync(p: string, atime: Date, mtime: Date): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.utimesSync(p, atime, mtime);\n }\n\n public link(srcpath: string, dstpath: string, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.link(srcpath, dstpath, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public linkSync(srcpath: string, dstpath: string): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.linkSync(srcpath, dstpath);\n }\n\n public symlink(srcpath: string, dstpath: string, type: string, cb: BFSOneArgCallback): void {\n this._mu.lock(() => {\n this._fs.symlink(srcpath, dstpath, type, (err?: ApiError) => {\n this._mu.unlock();\n cb(err);\n });\n });\n }\n\n public symlinkSync(srcpath: string, dstpath: string, type: string): void {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.symlinkSync(srcpath, dstpath, type);\n }\n\n public readlink(p: string, cb: BFSCallback): void {\n this._mu.lock(() => {\n this._fs.readlink(p, (err?: ApiError, linkString?: string) => {\n this._mu.unlock();\n cb(err, linkString);\n });\n });\n }\n\n public readlinkSync(p: string): string {\n if (this._mu.isLocked()) {\n throw new Error('invalid sync call');\n }\n return this._fs.readlinkSync(p);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/generic/locked_fs.ts","/**\n * (Nonstandard) String utility function for 8-bit ASCII with the extended\n * character set. Unlike the ASCII above, we do not mask the high bits.\n *\n * Placed into a separate file so it can be used with other Buffer implementations.\n * @see http://en.wikipedia.org/wiki/Extended_ASCII\n */\nexport default class ExtendedASCII {\n private static extendedChars = [ '\\u00C7', '\\u00FC', '\\u00E9', '\\u00E2', '\\u00E4',\n '\\u00E0', '\\u00E5', '\\u00E7', '\\u00EA', '\\u00EB', '\\u00E8', '\\u00EF',\n '\\u00EE', '\\u00EC', '\\u00C4', '\\u00C5', '\\u00C9', '\\u00E6', '\\u00C6',\n '\\u00F4', '\\u00F6', '\\u00F2', '\\u00FB', '\\u00F9', '\\u00FF', '\\u00D6',\n '\\u00DC', '\\u00F8', '\\u00A3', '\\u00D8', '\\u00D7', '\\u0192', '\\u00E1',\n '\\u00ED', '\\u00F3', '\\u00FA', '\\u00F1', '\\u00D1', '\\u00AA', '\\u00BA',\n '\\u00BF', '\\u00AE', '\\u00AC', '\\u00BD', '\\u00BC', '\\u00A1', '\\u00AB',\n '\\u00BB', '_', '_', '_', '\\u00A6', '\\u00A6', '\\u00C1', '\\u00C2', '\\u00C0',\n '\\u00A9', '\\u00A6', '\\u00A6', '+', '+', '\\u00A2', '\\u00A5', '+', '+', '-',\n '-', '+', '-', '+', '\\u00E3', '\\u00C3', '+', '+', '-', '-', '\\u00A6', '-',\n '+', '\\u00A4', '\\u00F0', '\\u00D0', '\\u00CA', '\\u00CB', '\\u00C8', 'i',\n '\\u00CD', '\\u00CE', '\\u00CF', '+', '+', '_', '_', '\\u00A6', '\\u00CC', '_',\n '\\u00D3', '\\u00DF', '\\u00D4', '\\u00D2', '\\u00F5', '\\u00D5', '\\u00B5',\n '\\u00FE', '\\u00DE', '\\u00DA', '\\u00DB', '\\u00D9', '\\u00FD', '\\u00DD',\n '\\u00AF', '\\u00B4', '\\u00AD', '\\u00B1', '_', '\\u00BE', '\\u00B6', '\\u00A7',\n '\\u00F7', '\\u00B8', '\\u00B0', '\\u00A8', '\\u00B7', '\\u00B9', '\\u00B3',\n '\\u00B2', '_', ' ' ];\n\n public static str2byte(str: string, buf: Buffer): number {\n const length = str.length > buf.length ? buf.length : str.length;\n for (let i = 0; i < length; i++) {\n let charCode = str.charCodeAt(i);\n if (charCode > 0x7F) {\n // Check if extended ASCII.\n const charIdx = ExtendedASCII.extendedChars.indexOf(str.charAt(i));\n if (charIdx > -1) {\n charCode = charIdx + 0x80;\n }\n // Otherwise, keep it as-is.\n }\n buf[charCode] = i;\n }\n return length;\n }\n\n public static byte2str(buff: Buffer): string {\n const chars = new Array(buff.length);\n for (let i = 0; i < buff.length; i++) {\n const charCode = buff[i];\n if (charCode > 0x7F) {\n chars[i] = ExtendedASCII.extendedChars[charCode - 128];\n } else {\n chars[i] = String.fromCharCode(charCode);\n }\n }\n return chars.join('');\n }\n\n public static byteLength(str: string): number { return str.length; }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/generic/extended_ascii.ts","import {FileSystemConstructor, BFSCallback, FileSystem} from './file_system';\nimport {ApiError} from './api_error';\nimport {checkOptions} from './util';\nimport AsyncMirror from '../backend/AsyncMirror';\nimport Dropbox from '../backend/Dropbox';\nimport Emscripten from '../backend/Emscripten';\nimport FolderAdapter from '../backend/FolderAdapter';\nimport HTML5FS from '../backend/HTML5FS';\nimport InMemory from '../backend/InMemory';\nimport IndexedDB from '../backend/IndexedDB';\nimport LocalStorage from '../backend/LocalStorage';\nimport MountableFileSystem from '../backend/MountableFileSystem';\nimport OverlayFS from '../backend/OverlayFS';\nimport WorkerFS from '../backend/WorkerFS';\nimport XmlHttpRequest from '../backend/XmlHttpRequest';\nimport ZipFS from '../backend/ZipFS';\nimport IsoFS from '../backend/IsoFS';\n\n// Monkey-patch `Create` functions to check options before file system initialization.\n[AsyncMirror, Dropbox, Emscripten, FolderAdapter, HTML5FS, InMemory, IndexedDB, IsoFS, LocalStorage, MountableFileSystem, OverlayFS, WorkerFS, XmlHttpRequest, ZipFS].forEach((fsType: FileSystemConstructor) => {\n const create = fsType.Create;\n fsType.Create = function(opts?: any, cb?: BFSCallback): void {\n const oneArg = typeof(opts) === \"function\";\n const normalizedCb = oneArg ? opts : cb;\n const normalizedOpts = oneArg ? {} : opts;\n\n function wrappedCb(e?: ApiError): void {\n if (e) {\n normalizedCb(e);\n } else {\n create.call(fsType, normalizedOpts, normalizedCb);\n }\n }\n\n checkOptions(fsType, normalizedOpts, wrappedCb);\n };\n});\n\n/**\n * @hidden\n */\nconst Backends = { AsyncMirror, Dropbox, Emscripten, FolderAdapter, HTML5FS, InMemory, IndexedDB, IsoFS, LocalStorage, MountableFileSystem, OverlayFS, WorkerFS, XmlHttpRequest, ZipFS };\n// Make sure all backends cast to FileSystemConstructor (for type checking)\nconst _: {[name: string]: FileSystemConstructor} = Backends;\n// tslint:disable-next-line:no-unused-expression\n_;\n// tslint:enable-next-line:no-unused-expression\nexport default Backends;\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/core/backends.ts","/**\n * BrowserFS's main entry point.\n * It installs all of the needed polyfills, and requires() the main module.\n */\n\n// IE substr does not support negative indices\nif ('ab'.substr(-1) !== 'b') {\n String.prototype.substr = function(substr: (start: number, length?: number) => string) {\n return function(this: string, start: number, length?: number): string {\n // did we get a negative start, calculate how much it is from the\n // beginning of the string\n if (start < 0) {\n start = this.length + start;\n }\n // call the original function\n return substr.call(this, start, length);\n };\n }(String.prototype.substr);\n}\n\n// Polyfill for Uint8Array.prototype.slice.\n// Safari and some other browsers do not define it.\nif (typeof(ArrayBuffer) !== 'undefined' && typeof(Uint8Array) !== 'undefined') {\n if (!Uint8Array.prototype['slice']) {\n Uint8Array.prototype.slice = function(this: Uint8Array, start: number = 0, end: number = this.length): Uint8Array {\n const self: Uint8Array = this;\n if (start < 0) {\n start = this.length + start;\n if (start < 0) {\n start = 0;\n }\n }\n if (end < 0) {\n end = this.length + end;\n if (end < 0) {\n end = 0;\n }\n }\n if (end < start) {\n end = start;\n }\n return new Uint8Array(self.buffer, self.byteOffset + start, end - start);\n };\n }\n}\n\nexport * from './core/browserfs';\n\n\n\n// WEBPACK FOOTER //\n// ../../../../src/index.ts","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('Invalid typed array length')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n buf.__proto__ = Buffer.prototype\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\n// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\nif (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true,\n enumerable: false,\n writable: false\n })\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (isArrayBuffer(value)) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n return fromObject(value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nBuffer.prototype.__proto__ = Uint8Array.prototype\nBuffer.__proto__ = Uint8Array\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n buf.__proto__ = Buffer.prototype\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj) {\n if (isArrayBufferView(obj) || 'length' in obj) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (isArrayBufferView(string) || isArrayBuffer(string)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n newBuf.__proto__ = Buffer.prototype\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : new Buffer(val, encoding)\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffers from another context (i.e. an iframe) do not pass the `instanceof` check\n// but they should be treated as valid. See: https://github.com/feross/buffer/issues/166\nfunction isArrayBuffer (obj) {\n return obj instanceof ArrayBuffer ||\n (obj != null && obj.constructor != null && obj.constructor.name === 'ArrayBuffer' &&\n typeof obj.byteLength === 'number')\n}\n\n// Node 0.10 supports `ArrayBuffer` but lacks `ArrayBuffer.isView`\nfunction isArrayBufferView (obj) {\n return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)\n}\n\nfunction numberIsNaN (obj) {\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/buffer/index.js\n// module id = 1\n// module chunks = 0","// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/**/\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/**/\n\nmodule.exports = Duplex;\n\n/**/\nvar processNextTick = require('process-nextick-args');\n/**/\n\n/**/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/**/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\nvar keys = objectKeys(Writable.prototype);\nfor (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n processNextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nfunction forEach(xs, f) {\n for (var i = 0, l = xs.length; i < l; i++) {\n f(xs[i], i);\n }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/_stream_duplex.js\n// module id = 2\n// module chunks = 0","import Process = require('./process');\nimport TTD = require('./tty');\n\nvar process = new Process(),\n processProxy: Process = {};\n\nfunction defineKey(key: string) {\n if (( processProxy)[key]) {\n // Probably a builtin Object property we don't care about.\n return;\n }\n if (typeof ( process)[key] === 'function') {\n ( processProxy)[key] = function() {\n return ( ( process)[key]).apply(process, arguments);\n };\n } else {\n ( processProxy)[key] = ( process)[key];\n }\n}\n\nfor (var key in process) {\n // Don't check if process.hasOwnProperty; we want to also expose objects\n // up the prototype hierarchy.\n defineKey(key);\n}\n\n// Special key: Ensure we update public-facing values of stdin/stdout/stderr.\nprocessProxy.initializeTTYs = function() {\n if (process.stdin === null) {\n process.initializeTTYs();\n processProxy.stdin = process.stdin;\n processProxy.stdout = process.stdout;\n processProxy.stderr = process.stderr;\n }\n};\n\nprocess.nextTick(() => {\n processProxy.initializeTTYs();\n});\n\nexport = processProxy;\n\n\n\n// WEBPACK FOOTER //\n// ../ts/index.ts","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/inherits/inherits_browser.js\n// module id = 4\n// module chunks = 0","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-util-is/lib/util.js\n// module id = 5\n// module chunks = 0","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/events/events.js\n// module id = 6\n// module chunks = 0","module.exports = require('buffer').Buffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./build/temp/library/webpack/BFSBuffer.js\n// module id = 7\n// module chunks = 0","'use strict';\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (source.hasOwnProperty(p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/utils/common.js\n// module id = 8\n// module chunks = 0","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = require('events').EventEmitter;\nvar inherits = require('inherits');\n\ninherits(Stream, EE);\nStream.Readable = require('readable-stream/readable.js');\nStream.Writable = require('readable-stream/writable.js');\nStream.Duplex = require('readable-stream/duplex.js');\nStream.Transform = require('readable-stream/transform.js');\nStream.PassThrough = require('readable-stream/passthrough.js');\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams. Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n var source = this;\n\n function ondata(chunk) {\n if (dest.writable) {\n if (false === dest.write(chunk) && source.pause) {\n source.pause();\n }\n }\n }\n\n source.on('data', ondata);\n\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume();\n }\n }\n\n dest.on('drain', ondrain);\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend);\n source.on('close', onclose);\n }\n\n var didOnEnd = false;\n function onend() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n dest.end();\n }\n\n\n function onclose() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n if (typeof dest.destroy === 'function') dest.destroy();\n }\n\n // don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }\n\n source.on('error', onerror);\n dest.on('error', onerror);\n\n // remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }\n\n source.on('end', cleanup);\n source.on('close', cleanup);\n\n dest.on('close', cleanup);\n\n dest.emit('pipe', source);\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/stream-browserify/index.js\n// module id = 9\n// module chunks = 0","'use strict';\n\nvar buffer = require('buffer');\nvar Buffer = buffer.Buffer;\nvar SlowBuffer = buffer.SlowBuffer;\nvar MAX_LEN = buffer.kMaxLength || 2147483647;\nexports.alloc = function alloc(size, fill, encoding) {\n if (typeof Buffer.alloc === 'function') {\n return Buffer.alloc(size, fill, encoding);\n }\n if (typeof encoding === 'number') {\n throw new TypeError('encoding must not be number');\n }\n if (typeof size !== 'number') {\n throw new TypeError('size must be a number');\n }\n if (size > MAX_LEN) {\n throw new RangeError('size is too large');\n }\n var enc = encoding;\n var _fill = fill;\n if (_fill === undefined) {\n enc = undefined;\n _fill = 0;\n }\n var buf = new Buffer(size);\n if (typeof _fill === 'string') {\n var fillBuf = new Buffer(_fill, enc);\n var flen = fillBuf.length;\n var i = -1;\n while (++i < size) {\n buf[i] = fillBuf[i % flen];\n }\n } else {\n buf.fill(_fill);\n }\n return buf;\n}\nexports.allocUnsafe = function allocUnsafe(size) {\n if (typeof Buffer.allocUnsafe === 'function') {\n return Buffer.allocUnsafe(size);\n }\n if (typeof size !== 'number') {\n throw new TypeError('size must be a number');\n }\n if (size > MAX_LEN) {\n throw new RangeError('size is too large');\n }\n return new Buffer(size);\n}\nexports.from = function from(value, encodingOrOffset, length) {\n if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {\n return Buffer.from(value, encodingOrOffset, length);\n }\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number');\n }\n if (typeof value === 'string') {\n return new Buffer(value, encodingOrOffset);\n }\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n var offset = encodingOrOffset;\n if (arguments.length === 1) {\n return new Buffer(value);\n }\n if (typeof offset === 'undefined') {\n offset = 0;\n }\n var len = length;\n if (typeof len === 'undefined') {\n len = value.byteLength - offset;\n }\n if (offset >= value.byteLength) {\n throw new RangeError('\\'offset\\' is out of bounds');\n }\n if (len > value.byteLength - offset) {\n throw new RangeError('\\'length\\' is out of bounds');\n }\n return new Buffer(value.slice(offset, offset + len));\n }\n if (Buffer.isBuffer(value)) {\n var out = new Buffer(value.length);\n value.copy(out, 0, 0, value.length);\n return out;\n }\n if (value) {\n if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {\n return new Buffer(value);\n }\n if (value.type === 'Buffer' && Array.isArray(value.data)) {\n return new Buffer(value.data);\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');\n}\nexports.allocUnsafeSlow = function allocUnsafeSlow(size) {\n if (typeof Buffer.allocUnsafeSlow === 'function') {\n return Buffer.allocUnsafeSlow(size);\n }\n if (typeof size !== 'number') {\n throw new TypeError('size must be a number');\n }\n if (size >= MAX_LEN) {\n throw new RangeError('size is too large');\n }\n return new SlowBuffer(size);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/buffer-shims/index.js\n// module id = 10\n// module chunks = 0","'use strict';\n\nif (!process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = nextTick;\n} else {\n module.exports = process.nextTick;\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process-nextick-args/index.js\n// module id = 11\n// module chunks = 0","// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/**/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(Transform, Duplex);\n\nfunction TransformState(stream) {\n this.afterTransform = function (er, data) {\n return afterTransform(stream, er, data);\n };\n\n this.needTransform = false;\n this.transforming = false;\n this.writecb = null;\n this.writechunk = null;\n this.writeencoding = null;\n}\n\nfunction afterTransform(stream, er, data) {\n var ts = stream._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data !== null && data !== undefined) stream.push(data);\n\n cb(er);\n\n var rs = stream._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n stream._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = new TransformState(this);\n\n var stream = this;\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.once('prefinish', function () {\n if (typeof this._flush === 'function') this._flush(function (er, data) {\n done(stream, er, data);\n });else done(stream);\n });\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data !== null && data !== undefined) stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n var ws = stream._writableState;\n var ts = stream._transformState;\n\n if (ws.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (ts.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/_stream_transform.js\n// module id = 12\n// module chunks = 0","// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\nmodule.exports = Writable;\n\n/**/\nvar processNextTick = require('process-nextick-args');\n/**/\n\n/**/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;\n/**/\n\n/**/\nvar Duplex;\n/**/\n\nWritable.WritableState = WritableState;\n\n/**/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/**/\n\n/**/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/**/\n\n/**/\nvar Stream;\n(function () {\n try {\n Stream = require('st' + 'ream');\n } catch (_) {} finally {\n if (!Stream) Stream = require('events').EventEmitter;\n }\n})();\n/**/\n\nvar Buffer = require('buffer').Buffer;\n/**/\nvar bufferShim = require('buffer-shims');\n/**/\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;\n\n // cast to ints.\n this.highWaterMark = ~~this.highWaterMark;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n processNextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = Buffer.isBuffer(chunk);\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = bufferShim.from(chunk, encoding);\n }\n return chunk;\n}\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n chunk = decodeChunk(state, chunk, encoding);\n if (Buffer.isBuffer(chunk)) encoding = 'buffer';\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n if (sync) processNextTick(cb, er);else cb(er);\n\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /**/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /**/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n while (entry) {\n buffer[count] = entry;\n entry = entry.next;\n count += 1;\n }\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequestCount = 0;\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\n\nfunction prefinish(stream, state) {\n if (!state.prefinished) {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n if (state.pendingcb === 0) {\n prefinish(stream, state);\n state.finished = true;\n stream.emit('finish');\n } else {\n prefinish(stream, state);\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) processNextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function (err) {\n var entry = _this.entry;\n _this.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = _this;\n } else {\n state.corkedRequestsFree = _this;\n }\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/_stream_writable.js\n// module id = 13\n// module chunks = 0","// Type information only.\nimport _path = require('path');\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nfunction posixSplitPath(filename: string): string[] {\n var out = splitPathRe.exec(filename);\n out.shift();\n return out;\n}\n\n/**\n * Emulates Node's `path` module. This module contains utilities for handling and\n * transforming file paths. **All** of these methods perform only string\n * transformations. The file system is not consulted to check whether paths are\n * valid.\n * @see http://nodejs.org/api/path.html\n * @class\n */\nclass path {\n /**\n * Normalize a string path, taking care of '..' and '.' parts.\n *\n * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.\n * @example Usage example\n * path.normalize('/foo/bar//baz/asdf/quux/..')\n * // returns\n * '/foo/bar/baz/asdf'\n * @param [String] p The path to normalize.\n * @return [String]\n */\n public static normalize(p: string): string {\n // Special case: '' -> '.'\n if (p === '') {\n p = '.';\n }\n // It's very important to know if the path is relative or not, since it\n // changes how we process .. and reconstruct the split string.\n var absolute = p.charAt(0) === path.sep;\n // Remove repeated //s\n p = path._removeDuplicateSeps(p);\n // Try to remove as many '../' as possible, and remove '.' completely.\n var components = p.split(path.sep);\n var goodComponents: string[] = [];\n for (var idx = 0; idx < components.length; idx++) {\n var c = components[idx];\n if (c === '.') {\n continue;\n } else if (c === '..' && (absolute || (!absolute && goodComponents.length > 0 && goodComponents[0] !== '..'))) {\n // In the absolute case: Path is relative to root, so we may pop even if\n // goodComponents is empty (e.g. /../ => /)\n // In the relative case: We're getting rid of a directory that preceded\n // it (e.g. /foo/../bar -> /bar)\n goodComponents.pop();\n } else {\n goodComponents.push(c);\n }\n }\n\n // Add in '.' when it's a relative path with no other nonempty components.\n // Possible results: '.' and './' (input: [''] or [])\n // @todo Can probably simplify this logic.\n if (!absolute && goodComponents.length < 2) {\n switch (goodComponents.length) {\n case 1:\n if (goodComponents[0] === '') {\n goodComponents.unshift('.');\n }\n break;\n default:\n goodComponents.push('.');\n }\n }\n p = goodComponents.join(path.sep);\n if (absolute && p.charAt(0) !== path.sep) {\n p = path.sep + p;\n }\n return p;\n }\n\n /**\n * Join all arguments together and normalize the resulting path.\n *\n * Arguments must be strings.\n * @example Usage\n * path.join('/foo', 'bar', 'baz/asdf', 'quux', '..')\n * // returns\n * '/foo/bar/baz/asdf'\n *\n * path.join('foo', {}, 'bar')\n * // throws exception\n * TypeError: Arguments to path.join must be strings\n * @param [String,...] paths Each component of the path\n * @return [String]\n */\n public static join(...paths: any[]): string {\n // Required: Prune any non-strings from the path. I also prune empty segments\n // so we can do a simple join of the array.\n var processed: string[] = [];\n for (var i = 0; i < paths.length; i++) {\n var segment = paths[i];\n if (typeof segment !== 'string') {\n throw new TypeError(\"Invalid argument type to path.join: \" + (typeof segment));\n } else if (segment !== '') {\n processed.push(segment);\n }\n }\n return path.normalize(processed.join(path.sep));\n }\n\n /**\n * Resolves to to an absolute path.\n *\n * If to isn't already absolute from arguments are prepended in right to left\n * order, until an absolute path is found. If after using all from paths still\n * no absolute path is found, the current working directory is used as well.\n * The resulting path is normalized, and trailing slashes are removed unless\n * the path gets resolved to the root directory. Non-string arguments are\n * ignored.\n *\n * Another way to think of it is as a sequence of cd commands in a shell.\n *\n * path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile')\n *\n * Is similar to:\n *\n * cd foo/bar\n * cd /tmp/file/\n * cd ..\n * cd a/../subfile\n * pwd\n *\n * The difference is that the different paths don't need to exist and may also\n * be files.\n * @example Usage example\n * path.resolve('/foo/bar', './baz')\n * // returns\n * '/foo/bar/baz'\n *\n * path.resolve('/foo/bar', '/tmp/file/')\n * // returns\n * '/tmp/file'\n *\n * path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif')\n * // if currently in /home/myself/node, it returns\n * '/home/myself/node/wwwroot/static_files/gif/image.gif'\n * @param [String,...] paths\n * @return [String]\n */\n public static resolve(...paths: string[]): string {\n // Monitor for invalid paths, throw out empty paths, and look for the *last*\n // absolute path that we see.\n var processed: string[] = [];\n for (var i = 0; i < paths.length; i++) {\n var p = paths[i];\n if (typeof p !== 'string') {\n throw new TypeError(\"Invalid argument type to path.join: \" + (typeof p));\n } else if (p !== '') {\n // Remove anything that has occurred before this absolute path, as it\n // doesn't matter.\n if (p.charAt(0) === path.sep) {\n processed = [];\n }\n processed.push(p);\n }\n }\n // Special: Remove trailing slash unless it's the root\n var resolved = path.normalize(processed.join(path.sep));\n if (resolved.length > 1 && resolved.charAt(resolved.length - 1) === path.sep) {\n return resolved.substr(0, resolved.length - 1);\n }\n // Special: If it doesn't start with '/', it's relative and we need to append\n // the current directory.\n if (resolved.charAt(0) !== path.sep) {\n // Remove ./, since we're going to append the current directory.\n if (resolved.charAt(0) === '.' && (resolved.length === 1 || resolved.charAt(1) === path.sep)) {\n resolved = resolved.length === 1 ? '' : resolved.substr(2);\n }\n // Append the current directory, which *must* be an absolute path.\n var cwd = process.cwd();\n if (resolved !== '') {\n // cwd will never end in a /... unless it's the root.\n resolved = this.normalize(cwd + (cwd !== '/' ? path.sep : '') + resolved);\n } else {\n resolved = cwd;\n }\n }\n return resolved;\n }\n\n /**\n * Solve the relative path from from to to.\n *\n * At times we have two absolute paths, and we need to derive the relative path\n * from one to the other. This is actually the reverse transform of\n * path.resolve, which means we see that:\n *\n * path.resolve(from, path.relative(from, to)) == path.resolve(to)\n *\n * @example Usage example\n * path.relative('C:\\\\orandea\\\\test\\\\aaa', 'C:\\\\orandea\\\\impl\\\\bbb')\n * // returns\n * '..\\\\..\\\\impl\\\\bbb'\n *\n * path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb')\n * // returns\n * '../../impl/bbb'\n * @param [String] from\n * @param [String] to\n * @return [String]\n */\n public static relative(from: string, to: string): string {\n var i: number;\n // Alright. Let's resolve these two to absolute paths and remove any\n // weirdness.\n from = path.resolve(from);\n to = path.resolve(to);\n var fromSegs = from.split(path.sep);\n var toSegs = to.split(path.sep);\n // Remove the first segment on both, as it's '' (both are absolute paths)\n toSegs.shift();\n fromSegs.shift();\n // There are two segments to this path:\n // * Going *up* the directory hierarchy with '..'\n // * Going *down* the directory hierarchy with foo/baz/bat.\n var upCount = 0;\n var downSegs: string[] = [];\n // Figure out how many things in 'from' are shared with 'to'.\n for (i = 0; i < fromSegs.length; i++) {\n var seg = fromSegs[i];\n if (seg === toSegs[i]) {\n continue;\n }\n // The rest of 'from', including the current element, indicates how many\n // directories we need to go up.\n upCount = fromSegs.length - i;\n break;\n }\n // The rest of 'to' indicates where we need to change to. We place this\n // outside of the loop, as toSegs.length may be greater than fromSegs.length.\n downSegs = toSegs.slice(i);\n // Special case: If 'from' is '/'\n if (fromSegs.length === 1 && fromSegs[0] === '') {\n upCount = 0;\n }\n // upCount can't be greater than the number of fromSegs\n // (cd .. from / is still /)\n if (upCount > fromSegs.length) {\n upCount = fromSegs.length;\n }\n // Create the final string!\n var rv = '';\n for (i = 0; i < upCount; i++) {\n rv += '../';\n }\n rv += downSegs.join(path.sep);\n // Special case: Remove trailing '/'. Happens if it's all up and no down.\n if (rv.length > 1 && rv.charAt(rv.length - 1) === path.sep) {\n rv = rv.substr(0, rv.length - 1);\n }\n return rv;\n }\n\n /**\n * Return the directory name of a path. Similar to the Unix `dirname` command.\n *\n * Note that BrowserFS does not validate if the path is actually a valid\n * directory.\n * @example Usage example\n * path.dirname('/foo/bar/baz/asdf/quux')\n * // returns\n * '/foo/bar/baz/asdf'\n * @param [String] p The path to get the directory name of.\n * @return [String]\n */\n public static dirname(p: string): string {\n // We get rid of //, but we don't modify anything else (e.g. any extraneous .\n // and ../ are kept intact)\n p = path._removeDuplicateSeps(p);\n var absolute = p.charAt(0) === path.sep;\n var sections = p.split(path.sep);\n // Do 1 if it's /foo/bar, 2 if it's /foo/bar/\n if (sections.pop() === '' && sections.length > 0) {\n sections.pop();\n }\n // # of sections needs to be > 1 if absolute, since the first section is '' for '/'.\n // If not absolute, the first section is the first part of the path, and is OK\n // to return.\n if (sections.length > 1 || (sections.length === 1 && !absolute)) {\n return sections.join(path.sep);\n } else if (absolute) {\n return path.sep;\n } else {\n return '.';\n }\n }\n\n /**\n * Return the last portion of a path. Similar to the Unix basename command.\n * @example Usage example\n * path.basename('/foo/bar/baz/asdf/quux.html')\n * // returns\n * 'quux.html'\n *\n * path.basename('/foo/bar/baz/asdf/quux.html', '.html')\n * // returns\n * 'quux'\n * @param [String] p\n * @param [String?] ext\n * @return [String]\n */\n public static basename(p: string, ext: string = \"\"): string {\n // Special case: Normalize will modify this to '.'\n if (p === '') {\n return p;\n }\n // Normalize the string first to remove any weirdness.\n p = path.normalize(p);\n // Get the last part of the string.\n var sections = p.split(path.sep);\n var lastPart = sections[sections.length - 1];\n // Special case: If it's empty, then we have a string like so: foo/\n // Meaning, 'foo' is guaranteed to be a directory.\n if (lastPart === '' && sections.length > 1) {\n return sections[sections.length - 2];\n }\n // Remove the extension, if need be.\n if (ext.length > 0) {\n var lastPartExt = lastPart.substr(lastPart.length - ext.length);\n if (lastPartExt === ext) {\n return lastPart.substr(0, lastPart.length - ext.length);\n }\n }\n return lastPart;\n }\n\n /**\n * Return the extension of the path, from the last '.' to end of string in the\n * last portion of the path. If there is no '.' in the last portion of the path\n * or the first character of it is '.', then it returns an empty string.\n * @example Usage example\n * path.extname('index.html')\n * // returns\n * '.html'\n *\n * path.extname('index.')\n * // returns\n * '.'\n *\n * path.extname('index')\n * // returns\n * ''\n * @param [String] p\n * @return [String]\n */\n public static extname(p: string): string {\n p = path.normalize(p);\n var sections = p.split(path.sep);\n p = sections.pop();\n // Special case: foo/file.ext/ should return '.ext'\n if (p === '' && sections.length > 0) {\n p = sections.pop();\n }\n if (p === '..') {\n return '';\n }\n var i = p.lastIndexOf('.');\n if (i === -1 || i === 0) {\n return '';\n }\n return p.substr(i);\n }\n\n /**\n * Checks if the given path is an absolute path.\n *\n * Despite not being documented, this is a tested part of Node's path API.\n * @param [String] p\n * @return [Boolean] True if the path appears to be an absolute path.\n */\n public static isAbsolute(p: string): boolean {\n return p.length > 0 && p.charAt(0) === path.sep;\n }\n\n /**\n * Unknown. Undocumented.\n */\n public static _makeLong(p: string): string {\n return p;\n }\n\n /**\n * Returns an object from a path string.\n */\n public static parse(p: string): _path.ParsedPath {\n var allParts = posixSplitPath(p);\n return {\n root: allParts[0],\n dir: allParts[0] + allParts[1].slice(0, -1),\n base: allParts[2],\n ext: allParts[3],\n name: allParts[2].slice(0, allParts[2].length - allParts[3].length)\n };\n }\n\n public static format(pathObject: _path.ParsedPath): string {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new TypeError(`Parameter 'pathObject' must be an object, not ${typeof pathObject}`);\n }\n\n var root = pathObject.root || '';\n\n if (typeof root !== 'string') {\n throw new TypeError(\n \"'pathObject.root' must be a string or undefined, not \" +\n typeof pathObject.root\n );\n }\n\n var dir = pathObject.dir ? pathObject.dir + path.sep : '';\n var base = pathObject.base || '';\n return dir + base;\n }\n\n // The platform-specific file separator. BrowserFS uses `/`.\n public static sep: string = '/';\n\n private static _replaceRegex = new RegExp(\"//+\", 'g');\n\n private static _removeDuplicateSeps(p: string): string {\n p = p.replace(this._replaceRegex, this.sep);\n return p;\n }\n\n // The platform-specific path delimiter. BrowserFS uses `:`.\n public static delimiter = ':';\n\n public static posix = path;\n // XXX: Typing hack. We don't actually support win32.\n public static win32 = path;\n}\n\nvar _: typeof _path = path;\n\nexport = path;\n\n\n\n// WEBPACK FOOTER //\n// ../ts/path.ts","// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/**/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/_stream_passthrough.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nmodule.exports = Readable;\n\n/**/\nvar processNextTick = require('process-nextick-args');\n/**/\n\n/**/\nvar isArray = require('isarray');\n/**/\n\n/**/\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n\n/**/\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\nvar Stream;\n(function () {\n try {\n Stream = require('st' + 'ream');\n } catch (_) {} finally {\n if (!Stream) Stream = require('events').EventEmitter;\n }\n})();\n/**/\n\nvar Buffer = require('buffer').Buffer;\n/**/\nvar bufferShim = require('buffer-shims');\n/**/\n\n/**/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/**/\n\n/**/\nvar debugUtil = require('util');\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/**/\n\nvar BufferList = require('./internal/streams/BufferList');\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') {\n return emitter.prependListener(event, fn);\n } else {\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n }\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;\n\n // cast to ints.\n this.highWaterMark = ~~this.highWaterMark;\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // when piping, we only care about 'readable' events that happen\n // after read()ing all the bytes and not getting any pushback.\n this.ranOut = false;\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options && typeof options.read === 'function') this._read = options.read;\n\n Stream.call(this);\n}\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n\n if (!state.objectMode && typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = bufferShim.from(chunk, encoding);\n encoding = '';\n }\n }\n\n return readableAddChunk(this, state, chunk, encoding, false);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n var state = this._readableState;\n return readableAddChunk(this, state, chunk, '', true);\n};\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\nfunction readableAddChunk(stream, state, chunk, encoding, addToFront) {\n var er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (state.ended && !addToFront) {\n var e = new Error('stream.push() after EOF');\n stream.emit('error', e);\n } else if (state.endEmitted && addToFront) {\n var _e = new Error('stream.unshift() after end event');\n stream.emit('error', _e);\n } else {\n var skipAdd;\n if (state.decoder && !addToFront && !encoding) {\n chunk = state.decoder.write(chunk);\n skipAdd = !state.objectMode && chunk.length === 0;\n }\n\n if (!addToFront) state.reading = false;\n\n // Don't add to the buffer if we've decoded to an empty string chunk and\n // we're not in object mode\n if (!skipAdd) {\n // if we want the data now, just emit it.\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n }\n\n maybeReadMore(stream, state);\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n\n return needMoreData(state);\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction chunkInvalid(state, chunk) {\n var er = null;\n if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : cleanup;\n if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable) {\n debug('onunpipe');\n if (readable === src) {\n cleanup();\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', cleanup);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n processNextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this, state);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n processNextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var state = this._readableState;\n var paused = false;\n\n var self = this;\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) self.push(chunk);\n }\n\n self.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = self.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n var events = ['error', 'close', 'destroy', 'pause', 'resume'];\n forEach(events, function (ev) {\n stream.on(ev, self.emit.bind(self, ev));\n });\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n self._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return self;\n};\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = bufferShim.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n processNextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction forEach(xs, f) {\n for (var i = 0, l = xs.length; i < l; i++) {\n f(xs[i], i);\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/_stream_readable.js\n// module id = 16\n// module chunks = 0","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar Buffer = require('buffer').Buffer;\n\nvar isBufferEncoding = Buffer.isEncoding\n || function(encoding) {\n switch (encoding && encoding.toLowerCase()) {\n case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;\n default: return false;\n }\n }\n\n\nfunction assertEncoding(encoding) {\n if (encoding && !isBufferEncoding(encoding)) {\n throw new Error('Unknown encoding: ' + encoding);\n }\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters. CESU-8 is handled as part of the UTF-8 encoding.\n//\n// @TODO Handling all encodings inside a single object makes it very difficult\n// to reason about this code, so it should be split up in the future.\n// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code\n// points as used by CESU-8.\nvar StringDecoder = exports.StringDecoder = function(encoding) {\n this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');\n assertEncoding(encoding);\n switch (this.encoding) {\n case 'utf8':\n // CESU-8 represents each of Surrogate Pair by 3-bytes\n this.surrogateSize = 3;\n break;\n case 'ucs2':\n case 'utf16le':\n // UTF-16 represents each of Surrogate Pair by 2-bytes\n this.surrogateSize = 2;\n this.detectIncompleteChar = utf16DetectIncompleteChar;\n break;\n case 'base64':\n // Base-64 stores 3 bytes in 4 chars, and pads the remainder.\n this.surrogateSize = 3;\n this.detectIncompleteChar = base64DetectIncompleteChar;\n break;\n default:\n this.write = passThroughWrite;\n return;\n }\n\n // Enough space to store all bytes of a single character. UTF-8 needs 4\n // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).\n this.charBuffer = new Buffer(6);\n // Number of bytes received for the current incomplete multi-byte character.\n this.charReceived = 0;\n // Number of bytes expected for the current incomplete multi-byte character.\n this.charLength = 0;\n};\n\n\n// write decodes the given buffer and returns it as JS string that is\n// guaranteed to not contain any partial multi-byte characters. Any partial\n// character found at the end of the buffer is buffered up, and will be\n// returned when calling write again with the remaining bytes.\n//\n// Note: Converting a Buffer containing an orphan surrogate to a String\n// currently works, but converting a String to a Buffer (via `new Buffer`, or\n// Buffer#write) will replace incomplete surrogates with the unicode\n// replacement character. See https://codereview.chromium.org/121173009/ .\nStringDecoder.prototype.write = function(buffer) {\n var charStr = '';\n // if our last write ended with an incomplete multibyte character\n while (this.charLength) {\n // determine how many remaining bytes this buffer has to offer for this char\n var available = (buffer.length >= this.charLength - this.charReceived) ?\n this.charLength - this.charReceived :\n buffer.length;\n\n // add the new bytes to the char buffer\n buffer.copy(this.charBuffer, this.charReceived, 0, available);\n this.charReceived += available;\n\n if (this.charReceived < this.charLength) {\n // still not enough chars in this buffer? wait for more ...\n return '';\n }\n\n // remove bytes belonging to the current character from the buffer\n buffer = buffer.slice(available, buffer.length);\n\n // get the character that was split\n charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);\n\n // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character\n var charCode = charStr.charCodeAt(charStr.length - 1);\n if (charCode >= 0xD800 && charCode <= 0xDBFF) {\n this.charLength += this.surrogateSize;\n charStr = '';\n continue;\n }\n this.charReceived = this.charLength = 0;\n\n // if there are no more bytes in this buffer, just emit our char\n if (buffer.length === 0) {\n return charStr;\n }\n break;\n }\n\n // determine and set charLength / charReceived\n this.detectIncompleteChar(buffer);\n\n var end = buffer.length;\n if (this.charLength) {\n // buffer the incomplete character bytes we got\n buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);\n end -= this.charReceived;\n }\n\n charStr += buffer.toString(this.encoding, 0, end);\n\n var end = charStr.length - 1;\n var charCode = charStr.charCodeAt(end);\n // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character\n if (charCode >= 0xD800 && charCode <= 0xDBFF) {\n var size = this.surrogateSize;\n this.charLength += size;\n this.charReceived += size;\n this.charBuffer.copy(this.charBuffer, size, 0, size);\n buffer.copy(this.charBuffer, 0, 0, size);\n return charStr.substring(0, end);\n }\n\n // or just emit the charStr\n return charStr;\n};\n\n// detectIncompleteChar determines if there is an incomplete UTF-8 character at\n// the end of the given buffer. If so, it sets this.charLength to the byte\n// length that character, and sets this.charReceived to the number of bytes\n// that are available for this character.\nStringDecoder.prototype.detectIncompleteChar = function(buffer) {\n // determine how many bytes we have to check at the end of this buffer\n var i = (buffer.length >= 3) ? 3 : buffer.length;\n\n // Figure out if one of the last i bytes of our buffer announces an\n // incomplete char.\n for (; i > 0; i--) {\n var c = buffer[buffer.length - i];\n\n // See http://en.wikipedia.org/wiki/UTF-8#Description\n\n // 110XXXXX\n if (i == 1 && c >> 5 == 0x06) {\n this.charLength = 2;\n break;\n }\n\n // 1110XXXX\n if (i <= 2 && c >> 4 == 0x0E) {\n this.charLength = 3;\n break;\n }\n\n // 11110XXX\n if (i <= 3 && c >> 3 == 0x1E) {\n this.charLength = 4;\n break;\n }\n }\n this.charReceived = i;\n};\n\nStringDecoder.prototype.end = function(buffer) {\n var res = '';\n if (buffer && buffer.length)\n res = this.write(buffer);\n\n if (this.charReceived) {\n var cr = this.charReceived;\n var buf = this.charBuffer;\n var enc = this.encoding;\n res += buf.slice(0, cr).toString(enc);\n }\n\n return res;\n};\n\nfunction passThroughWrite(buffer) {\n return buffer.toString(this.encoding);\n}\n\nfunction utf16DetectIncompleteChar(buffer) {\n this.charReceived = buffer.length % 2;\n this.charLength = this.charReceived ? 2 : 0;\n}\n\nfunction base64DetectIncompleteChar(buffer) {\n this.charReceived = buffer.length % 3;\n this.charLength = this.charReceived ? 3 : 0;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/string_decoder/index.js\n// module id = 17\n// module chunks = 0","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return b64.length * 3 / 4 - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, j, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr(len * 3 / 4 - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0, j = 0; i < l; i += 4, j += 3) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/base64-js/index.js\n// module id = 18\n// module chunks = 0","// Use path and TTY for type information only. We lazily pull them in\n// to avoid circular dependencies :(\n// (path depends on process for cwd(), TTY depends on streams which depends\n// on process.nextTick/process.stdout/stderr/stdin).\nimport _path = require('path');\nimport _TTY = require('./tty');\nimport events = require('events');\n\n// Path depends on process. Avoid a circular reference by dynamically including path when we need it.\nvar path: typeof _path = null;\n\nclass Item {\n private fun: Function;\n private array: any[];\n constructor(fun: Function, array: any[]) {\n this.fun = fun;\n this.array = array;\n }\n\n public run(): void {\n this.fun.apply(null, this.array);\n }\n}\n\n/**\n * Contains a queue of Items for process.nextTick.\n * Inspired by node-process: https://github.com/defunctzombie/node-process\n */\nclass NextTickQueue {\n private _queue: Item[] = [];\n private _draining = false;\n // Used/assigned by the drainQueue function.\n private _currentQueue: Item[] = null;\n private _queueIndex = -1;\n\n public push(item: Item): void {\n if (this._queue.push(item) === 1 && !this._draining) {\n setTimeout(() => this._drainQueue(), 0);\n }\n }\n\n private _cleanUpNextTick() {\n this._draining = false;\n if (this._currentQueue && this._currentQueue.length) {\n this._queue = this._currentQueue.concat(this._queue);\n } else {\n this._queueIndex = -1;\n }\n if (this._queue.length) {\n this._drainQueue();\n }\n }\n\n private _drainQueue() {\n if (this._draining) {\n return;\n }\n // If an Item throws an unhandled exception, this function will clean things up.\n var timeout = setTimeout(() => this._cleanUpNextTick());\n this._draining = true;\n\n var len = this._queue.length;\n while(len) {\n this._currentQueue = this._queue;\n this._queue = [];\n while (++this._queueIndex < len) {\n if (this._currentQueue) {\n this._currentQueue[this._queueIndex].run();\n }\n }\n this._queueIndex = -1;\n len = this._queue.length;\n }\n this._currentQueue = null;\n this._draining = false;\n clearTimeout(timeout);\n }\n}\n\n/**\n * Partial implementation of Node's `process` module.\n * We implement the portions that are relevant for the filesystem.\n * @see http://nodejs.org/api/process.html\n * @class\n */\nclass Process extends events.EventEmitter implements NodeJS.Process {\n private startTime = Date.now();\n\n private _cwd: string = '/';\n /**\n * Changes the current working directory.\n *\n * **Note**: BrowserFS does not validate that the directory actually exists.\n *\n * @example Usage example\n * console.log('Starting directory: ' + process.cwd());\n * process.chdir('/tmp');\n * console.log('New directory: ' + process.cwd());\n * @param [String] dir The directory to change to.\n */\n public chdir(dir: string): void {\n // XXX: Circular dependency hack.\n if (path === null) {\n path = require('path');\n }\n this._cwd = path.resolve(dir);\n }\n /**\n * Returns the current working directory.\n * @example Usage example\n * console.log('Current directory: ' + process.cwd());\n * @return [String] The current working directory.\n */\n public cwd(): string {\n return this._cwd;\n }\n /**\n * Returns what platform you are running on.\n * @return [String]\n */\n public platform: string = 'browser';\n /**\n * Number of seconds BrowserFS has been running.\n * @return [Number]\n */\n public uptime(): number {\n return ((Date.now() - this.startTime) / 1000) | 0;\n }\n\n public argv: string[] = [];\n public execArgv: string[] = [];\n public stdout: _TTY = null;\n public stderr: _TTY = null;\n public stdin: _TTY = null;\n public domain: NodeJS.Domain = null;\n\n private _queue: NextTickQueue = new NextTickQueue();\n\n public nextTick(fun: any, ...args: any[]) {\n this._queue.push(new Item(fun, args));\n }\n\n public execPath = __dirname;\n\n public abort(): void {\n this.emit('abort');\n }\n\n public env: {[name: string]: string} = {};\n public exitCode: number = 0;\n public exit(code: number): void {\n this.exitCode = code;\n this.emit('exit', [code]);\n }\n\n private _gid: number = 1;\n public getgid(): number {\n return this._gid;\n }\n public setgid(gid: number | string): void {\n if (typeof gid === 'number') {\n this._gid = gid;\n } else {\n this._gid = 1;\n }\n }\n\n private _uid: number = 1;\n public getuid(): number {\n return this._uid;\n }\n public setuid(uid: number | string): void {\n if (typeof uid === 'number') {\n this._uid = uid;\n } else {\n this._uid = 1;\n }\n }\n\n public version: string = 'v5.0';\n\n public versions = {\n http_parser: '0.0',\n node: '5.0',\n v8: '0.0',\n uv: '0.0',\n zlib: '0.0',\n ares: '0.0',\n icu: '0.0',\n modules: '0',\n openssl: '0.0'\n };\n\n public config = {\n target_defaults:\n { cflags: [],\n default_configuration: 'Release',\n defines: [],\n include_dirs: [],\n libraries: [] },\n variables:\n { clang: 0,\n host_arch: 'x32',\n node_install_npm: false,\n node_install_waf: false,\n node_prefix: '',\n node_shared_cares: false,\n node_shared_http_parser: false,\n node_shared_libuv: false,\n node_shared_zlib: false,\n node_shared_v8: false,\n node_use_dtrace: false,\n node_use_etw: false,\n node_use_openssl: false,\n node_shared_openssl: false,\n strict_aliasing: false,\n target_arch: 'x32',\n v8_use_snapshot: false,\n v8_no_strict_aliasing: 0,\n visibility: '' } };\n\n public kill(pid: number, signal?: string): void {\n this.emit('kill', [pid, signal]);\n }\n\n public pid = (Math.random()*1000)|0;\n\n public title = 'node';\n public arch = 'x32';\n public memoryUsage(): {rss: number; heapTotal: number; heapUsed: number;} {\n return { rss: 0, heapTotal: 0, heapUsed: 0 }\n }\n\n private _mask = 18;\n public umask(mask: number = this._mask): number {\n let oldMask = this._mask;\n this._mask = mask;\n this.emit('umask', [mask]);\n return oldMask;\n }\n\n public hrtime(): [number, number] {\n let timeinfo: number;\n if (typeof performance !== 'undefined') {\n timeinfo = performance.now();\n } else if (Date['now']) {\n timeinfo = Date.now();\n } else {\n timeinfo = (new Date()).getTime();\n }\n let secs = (timeinfo / 1000)|0;\n timeinfo -= secs * 1000;\n timeinfo = (timeinfo * 1000000)|0;\n return [secs, timeinfo];\n }\n\n /**\n * [BFS only] Initialize the TTY devices.\n */\n public initializeTTYs(): void {\n // Guard against multiple invocations.\n if (this.stdout === null) {\n let TTY: typeof _TTY = require('./tty');\n this.stdout = new TTY();\n this.stderr = new TTY();\n this.stdin = new TTY();\n }\n }\n\n /**\n * Worker-only function; irrelevant here.\n */\n public disconnect(): void {\n\n }\n // Undefined in main thread. Worker-only.\n public connected: boolean = undefined;\n}\n\nexport = Process;\n\n\n// WEBPACK FOOTER //\n// ../ts/process.ts","import stream = require('stream');\n\nclass TTY extends stream.Duplex {\n public isRaw: boolean = false;\n public columns: number = 80;\n public rows: number = 120;\n public isTTY: boolean = true;\n private _bufferedWrites: Buffer[] = [];\n private _waitingForWrites: boolean = false;\n\n constructor() {\n super();\n }\n\n /**\n * Toggle raw mode.\n */\n public setRawMode(mode: boolean): void {\n if (this.isRaw !== mode) {\n this.isRaw = mode;\n // [BFS] TTY implementations can use this to change their event emitting\n // patterns.\n this.emit('modeChange');\n }\n }\n\n /**\n * [BFS] Update the number of columns available on the terminal.\n */\n public changeColumns(columns: number): void {\n if (columns !== this.columns) {\n this.columns = columns;\n // Resize event.\n this.emit('resize');\n }\n }\n\n /**\n * [BFS] Update the number of rows available on the terminal.\n */\n public changeRows(rows: number): void {\n if (rows !== this.rows) {\n this.rows = rows;\n // Resize event.\n this.emit('resize');\n }\n }\n\n /**\n * Returns 'true' if the given object is a TTY.\n */\n public static isatty(fd: any): fd is TTY {\n return fd && fd instanceof TTY;\n }\n\n public _write(chunk: any, encoding: string, cb: Function): void {\n var error: any;\n try {\n var data: Buffer;\n if (typeof(chunk) === 'string') {\n data = new Buffer(chunk, encoding);\n } else {\n data = chunk;\n }\n this._bufferedWrites.push(data);\n if (this._waitingForWrites) {\n this._read(1024);\n }\n } catch (e) {\n error = e;\n } finally {\n cb(error);\n }\n }\n\n public _read(size: number): void {\n // Size is advisory -- we can ignore it.\n if (this._bufferedWrites.length === 0) {\n this._waitingForWrites = true;\n } else {\n while (this._bufferedWrites.length > 0) {\n this._waitingForWrites = this.push(this._bufferedWrites.shift());\n if (!this._waitingForWrites) {\n break;\n }\n }\n }\n }\n}\n\nexport = TTY;\n\n\n\n// WEBPACK FOOTER //\n// ../ts/tty.ts","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ieee754/index.js\n// module id = 21\n// module chunks = 0","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/isarray/index.js\n// module id = 22\n// module chunks = 0","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overriden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n var dict;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n // Convert data if needed\n if (typeof dictionary === 'string') {\n dict = strings.string2buf(dictionary);\n } else if (toString.call(dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(dictionary);\n } else {\n dict = dictionary;\n }\n\n status = zlib_inflate.inflateSetDictionary(this.strm, dict);\n\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n if (this.options.to === 'string') {\n\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n this.onData(utf8str);\n\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): ouput data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 alligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/inflate.js\n// module id = 23\n// module chunks = 0","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safary\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new utils.Buf8(256);\nfor (var q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // use fallback for big arrays to avoid stack overflow\n if (len < 65537) {\n if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Fuckup - very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means vuffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/utils/strings.js\n// module id = 24\n// module chunks = 0","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It doesn't worth to make additional optimizationa as in original.\n// Small size is preferable.\n\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/zlib/adler32.js\n// module id = 25\n// module chunks = 0","'use strict';\n\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n //Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/zlib/constants.js\n// module id = 26\n// module chunks = 0","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/zlib/crc32.js\n// module id = 27\n// module chunks = 0","'use strict';\n\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/zlib/gzheader.js\n// module id = 28\n// module chunks = 0","'use strict';\n\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/zlib/inffast.js\n// module id = 29\n// module chunks = 0","'use strict';\n\n\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more conveniend processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' insdead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/zlib/inflate.js\n// module id = 30\n// module chunks = 0","'use strict';\n\n\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/zlib/inftrees.js\n// module id = 31\n// module chunks = 0","'use strict';\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/zlib/messages.js\n// module id = 32\n// module chunks = 0","'use strict';\n\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pako/lib/zlib/zstream.js\n// module id = 33\n// module chunks = 0","module.exports = require(\"./lib/_stream_duplex.js\")\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/duplex.js\n// module id = 34\n// module chunks = 0","'use strict';\n\nvar Buffer = require('buffer').Buffer;\n/**/\nvar bufferShim = require('buffer-shims');\n/**/\n\nmodule.exports = BufferList;\n\nfunction BufferList() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n}\n\nBufferList.prototype.push = function (v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n};\n\nBufferList.prototype.unshift = function (v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n};\n\nBufferList.prototype.shift = function () {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n};\n\nBufferList.prototype.clear = function () {\n this.head = this.tail = null;\n this.length = 0;\n};\n\nBufferList.prototype.join = function (s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n};\n\nBufferList.prototype.concat = function (n) {\n if (this.length === 0) return bufferShim.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = bufferShim.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n p.data.copy(ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/internal/streams/BufferList.js\n// module id = 35\n// module chunks = 0","module.exports = require(\"./lib/_stream_passthrough.js\")\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/passthrough.js\n// module id = 36\n// module chunks = 0","var Stream = (function (){\n try {\n return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify\n } catch(_){}\n}());\nexports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = Stream || exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n\nif (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) {\n module.exports = Stream;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/readable.js\n// module id = 37\n// module chunks = 0","module.exports = require(\"./lib/_stream_transform.js\")\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/transform.js\n// module id = 38\n// module chunks = 0","module.exports = require(\"./lib/_stream_writable.js\")\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/writable.js\n// module id = 39\n// module chunks = 0","\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/util-deprecate/browser.js\n// module id = 40\n// module chunks = 0","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tmodule.children = [];\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 41\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/bundles/utils.js b/bundles/utils.js deleted file mode 100644 index 3bd2986..0000000 --- a/bundles/utils.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isWindowOrWorker = isWindowOrWorker; -exports.getBaseURL = getBaseURL; -exports.httpHeaderSafeJson = httpHeaderSafeJson; -function getSafeUnicode(c) { - var unicode = ('000' + c.charCodeAt(0).toString(16)).slice(-4); - return '\\u' + unicode; -} - -/* global WorkerGlobalScope */ -function isWindowOrWorker() { - return typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope || typeof module === 'undefined' || typeof window !== 'undefined'; -} - -function getBaseURL(host) { - return 'https://' + host + '.dropboxapi.com/2/'; -} - -// source https://www.dropboxforum.com/t5/API-support/HTTP-header-quot-Dropbox-API-Arg-quot-could-not-decode-input-as/m-p/173823/highlight/true#M6786 -function httpHeaderSafeJson(args) { - return JSON.stringify(args).replace(/[\u007f-\uffff]/g, getSafeUnicode); -} \ No newline at end of file diff --git a/how-to-test.md b/how-to-test.md deleted file mode 100644 index 52267bc..0000000 --- a/how-to-test.md +++ /dev/null @@ -1,46 +0,0 @@ -# Testing solid-rest-file - -## Requirements - - * **Time** half an hour - * **Skills** ability to use a command-line (terminal) program - * **Software** any version of nodejs - -## How to run the test - - 1. In your browser, go to [solid-rest-file](https://github.com/jeff-zucker/solid-rest-file) - - 2. Click on **clone or download** (green button in upper right) - - 3. Download the zip file (or if you know git, clone the repo and skip to step #6) - - 4. In your terminal, change to the locations of the downloaded zip - - 5. Unzip the file solid-rest-file-master.zip - - 6. Change directory into the solid-rest-file-master - - 7. Enter the command: npm install - - 8. Enter the command: node tests/all - -## How to report the results - - -Send an email to me at dubzed@gmail.com. which includes: - - * the name and version of your operating system (e.g Linux Mint 18.3, Mac, Windows) - * whether it's ok to contact you with questions - * the results of the tests as shown below - -The expected result is a long list of the word "ok". If that's what you -see, report the results as "all tests passed". Otherwise, please take a -screenshot and attach it to the email, or cut and paste the results into -the email or simply manually copy the results into the email. - -## Questions or problems? - -Go to [the Solid app-development chat room](https://gitter.im/solid/app-development) -and ping @jeff-zucker and I'll respond as soon as I can. I'm on the U.S. west coast, -so usually availble 8am to 11pm Pacific Daylight Time which is 5pm through 8am Central -European Time. diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index ac52a32..0000000 --- a/jest.config.js +++ /dev/null @@ -1,185 +0,0 @@ -// For a detailed explanation regarding each configuration property, visit: -// https://jestjs.io/docs/en/configuration.html - -module.exports = { - // All imported modules in your tests should be mocked automatically - // automock: false, - - // Stop running tests after `n` failures - // bail: 0, - - // Respect "browser" field in package.json when resolving modules - // browser: false, - - // The directory where Jest should store its cached dependency information - // cacheDirectory: "/tmp/jest_rs", - - // Automatically clear mock calls and instances between every test - // clearMocks: false, - - // Indicates whether the coverage information should be collected while executing the test - // collectCoverage: false, - - // An array of glob patterns indicating a set of files for which coverage information should be collected - // collectCoverageFrom: null, - - // The directory where Jest should output its coverage files - // coverageDirectory: null, - - // An array of regexp pattern strings used to skip coverage collection - // coveragePathIgnorePatterns: [ - // "/node_modules/" - // ], - - // A list of reporter names that Jest uses when writing coverage reports - // coverageReporters: [ - // "json", - // "text", - // "lcov", - // "clover" - // ], - - // An object that configures minimum threshold enforcement for coverage results - // coverageThreshold: null, - - // A path to a custom dependency extractor - // dependencyExtractor: null, - - // Make calling deprecated APIs throw helpful error messages - // errorOnDeprecated: false, - - // Force coverage collection from ignored files using an array of glob patterns - // forceCoverageMatch: [], - - // A path to a module which exports an async function that is triggered once before all test suites - // globalSetup: null, - - // A path to a module which exports an async function that is triggered once after all test suites - // globalTeardown: null, - - // A set of global variables that need to be available in all test environments - // globals: {}, - - // An array of directory names to be searched recursively up from the requiring module's location - // moduleDirectories: [ - // "node_modules" - // ], - - // An array of file extensions your modules use - // moduleFileExtensions: [ - // "js", - // "json", - // "jsx", - // "ts", - // "tsx", - // "node" - // ], - - // A map from regular expressions to module names that allow to stub out resources with a single module - // moduleNameMapper: {}, - - // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader - // modulePathIgnorePatterns: [], - - // Activates notifications for test results - // notify: false, - - // An enum that specifies notification mode. Requires { notify: true } - // notifyMode: "failure-change", - - // A preset that is used as a base for Jest's configuration - // preset: null, - - // Run tests from one or more projects - // projects: null, - - // Use this configuration option to add custom reporters to Jest - // reporters: undefined, - - // Automatically reset mock state between every test - // resetMocks: false, - - // Reset the module registry before running each individual test - // resetModules: false, - - // A path to a custom resolver - // resolver: null, - - // Automatically restore mock state between every test - // restoreMocks: false, - - // The root directory that Jest should scan for tests and modules within - // rootDir: null, - - // A list of paths to directories that Jest should use to search for files in - // roots: [ - // "" - // ], - - // Allows you to use a custom runner instead of Jest's default test runner - // runner: "jest-runner", - - // The paths to modules that run some code to configure or set up the testing environment before each test - // setupFiles: [], - - // A list of paths to modules that run some code to configure or set up the testing framework before each test - // setupFilesAfterEnv: [], - - // A list of paths to snapshot serializer modules Jest should use for snapshot testing - // snapshotSerializers: [], - - // The test environment that will be used for testing - testEnvironment: "node", - - // Options that will be passed to the testEnvironment - // testEnvironmentOptions: {}, - - // Adds a location field to test results - // testLocationInResults: false, - - // The glob patterns Jest uses to detect test files - // testMatch: [ - // "**/__tests__/**/*.[jt]s?(x)", - // "**/?(*.)+(spec|test).[tj]s?(x)" - // ], - - // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped - // testPathIgnorePatterns: [ - // "/node_modules/" - // ], - - // The regexp pattern or array of patterns that Jest uses to detect test files - // testRegex: [], - - // This option allows the use of a custom results processor - // testResultsProcessor: null, - - // This option allows use of a custom test runner - // testRunner: "jasmine2", - - // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href - // testURL: "http://localhost", - - // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout" - // timers: "real", - - // A map from regular expressions to paths to transformers - // transform: null, - - // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation - // transformIgnorePatterns: [ - // "/node_modules/" - // ], - - // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them - // unmockedModulePathPatterns: undefined, - - // Indicates whether each individual test should be reported during the run - // verbose: null, - - // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode - // watchPathIgnorePatterns: [], - - // Whether to use watchman for file crawling - // watchman: true, -}; diff --git a/package-lock.json b/package-lock.json index 9f321bb..cdcfa21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "solid-rest", - "version": "1.3.1", + "version": "1.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -405,11 +405,6 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" - }, "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -464,14 +459,6 @@ "private": "^0.1.8", "slash": "^1.0.0", "source-map": "^0.5.7" - }, - "dependencies": { - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true - } } }, "babel-generator": { @@ -1194,17 +1181,6 @@ "lodash": "^4.17.4", "mkdirp": "^0.5.1", "source-map-support": "^0.4.15" - }, - "dependencies": { - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "dev": true, - "requires": { - "source-map": "^0.5.6" - } - } } }, "babel-runtime": { @@ -1354,16 +1330,6 @@ "dev": true, "optional": true }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -1485,17 +1451,6 @@ "safe-buffer": "^5.2.0" }, "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1527,7 +1482,8 @@ "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true }, "buffer-xor": { "version": "1.0.3", @@ -1839,24 +1795,39 @@ "dev": true }, "concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, "requires": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", - "readable-stream": "^3.0.2", + "readable-stream": "^2.2.2", "typedarray": "^0.0.6" }, "dependencies": { "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" } } } @@ -2154,6 +2125,32 @@ "inherits": "^2.0.1", "readable-stream": "^2.0.0", "stream-shift": "^1.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "ecc-jsbn": { @@ -2224,6 +2221,30 @@ "errno": "^0.1.3", "readable-stream": "^2.0.1" } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } } } }, @@ -2511,13 +2532,6 @@ "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true - }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -2569,6 +2583,32 @@ "requires": { "inherits": "^2.0.3", "readable-stream": "^2.3.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "for-in": { @@ -2611,17 +2651,32 @@ "requires": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" - } - }, - "fs-extra": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", - "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^1.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "fs-write-stream-atomic": { @@ -2634,6 +2689,32 @@ "iferr": "^0.1.5", "imurmurhash": "^0.1.4", "readable-stream": "1 || 2" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "fs.realpath": { @@ -2723,7 +2804,8 @@ "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true }, "har-schema": { "version": "2.0.0", @@ -2814,17 +2896,6 @@ "safe-buffer": "^5.2.0" }, "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -2979,7 +3050,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "interpret": { "version": "2.2.0", @@ -3122,9 +3194,9 @@ } }, "is-negative-zero": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", - "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", "dev": true }, "is-number": { @@ -3265,29 +3337,10 @@ "dev": true }, "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - }, - "dependencies": { - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" - } - } + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true }, "jsonld": { "version": "3.2.0", @@ -3304,12 +3357,6 @@ "xmldom": "0.1.19" }, "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, "xmldom": { "version": "0.1.19", "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.19.tgz", @@ -3357,6 +3404,17 @@ "big.js": "^5.2.2", "emojis-list": "^3.0.0", "json5": "^1.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } } }, "locate-path": { @@ -3401,6 +3459,14 @@ "requires": { "pify": "^4.0.1", "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "map-cache": { @@ -3437,6 +3503,32 @@ "requires": { "errno": "^0.1.3", "readable-stream": "^2.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "merge-stream": { @@ -3546,20 +3638,6 @@ "pumpify": "^1.3.3", "stream-each": "^1.1.0", "through2": "^2.0.0" - }, - "dependencies": { - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - } } }, "mixin-deep": { @@ -3631,28 +3709,8 @@ "requires": { "queue-microtask": "^1.1.2", "readable-stream": "^3.6.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } } }, - "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", - "dev": true, - "optional": true - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -3725,6 +3783,32 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } } } }, @@ -3916,6 +4000,32 @@ "cyclist": "^1.0.1", "inherits": "^2.0.3", "readable-stream": "^2.1.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "parse-asn1": { @@ -4169,14 +4279,6 @@ "requires": { "node-forge": "^0.10.0", "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } } }, "rdflib": { @@ -4194,18 +4296,14 @@ } }, "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "readdirp": { @@ -4432,7 +4530,8 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, "safe-regex": { "version": "1.1.0", @@ -4461,9 +4560,9 @@ } }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, "serialize-javascript": { @@ -4674,21 +4773,12 @@ } }, "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "dev": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } + "source-map": "^0.5.6" } }, "source-map-url": { @@ -4761,6 +4851,32 @@ "requires": { "inherits": "~2.0.1", "readable-stream": "^2.0.2" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "stream-each": { @@ -4784,6 +4900,32 @@ "readable-stream": "^2.3.6", "to-arraybuffer": "^1.0.0", "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "stream-shift": { @@ -4813,11 +4955,20 @@ } }, "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } } }, "strip-ansi": { @@ -4875,6 +5026,16 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } } } }, @@ -4911,6 +5072,32 @@ "requires": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "timers-browserify": { @@ -5022,7 +5209,8 @@ "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true }, "typical": { "version": "5.2.0", @@ -5060,11 +5248,6 @@ "imurmurhash": "^0.1.4" } }, - "universalify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==" - }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -5171,7 +5354,8 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true }, "uuid": { "version": "8.3.1", @@ -5279,11 +5463,7 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } + "optional": true }, "glob-parent": { "version": "3.1.0", @@ -5318,6 +5498,22 @@ "binary-extensions": "^1.0.0" } }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, "readdirp": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", @@ -5329,6 +5525,16 @@ "micromatch": "^3.1.10", "readable-stream": "^2.0.2" } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } } } }, diff --git a/package.json b/package.json index 9007894..9e571bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "solid-rest", - "version": "1.3.1", + "version": "1.4.0", "author": "Jeff Zucker", "license": "MIT", "description": "treat any storage as a mini Solid server", @@ -30,15 +30,10 @@ }, "homepage": "https://github.com/jeff-zucker/solid-rest#readme", "dependencies": { - "concat-stream": "2.0.0", "cross-fetch": "3.0.6", - "fs-extra": "9.0.1", "mime-types": "2.1.27", "uuid": "8.3.1" }, - "peerDependencies": { - "browserfs": "1.4.3" - }, "devDependencies": { "babel-core": "6.26.3", "babel-preset-es2015": "6.24.1", diff --git a/src/browserFS.js b/plugins/solid-rest-bfs/browserFS.js similarity index 100% rename from src/browserFS.js rename to plugins/solid-rest-bfs/browserFS.js diff --git a/plugins/solid-rest-file/package.json b/plugins/solid-rest-file/package.json new file mode 100644 index 0000000..b9c08ad --- /dev/null +++ b/plugins/solid-rest-file/package.json @@ -0,0 +1,12 @@ +{ + "name": "solid-rest-file", + "version": "1.2.0", + "description": "", + "main": "src/index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/src/file.js b/plugins/solid-rest-file/src/index.js similarity index 91% rename from src/file.js rename to plugins/solid-rest-file/src/index.js index 42e0801..a3d1f76 100644 --- a/src/file.js +++ b/plugins/solid-rest-file/src/index.js @@ -6,7 +6,7 @@ const fs = require("fs-extra"); class SolidFileStorage { constructor() { this.prefix = "file" - this.name = "solid-rest-file-storage-1.0.0" + this.name = "solid-rest-file-1.0.0" } _makeStream(text){ @@ -32,10 +32,12 @@ class SolidFileStorage { return text(stream).then(text => JSON.parse(text)) } -async getObjectType(fn,options){ +async getObjectType(fn,request){ + request = request.request || request; + fn = fn.replace( request.protocol+'//','') let stat; try { stat = fs.lstatSync(fn); } - catch(err){ } + catch(err){} let read=true,write=true; if( stat ) { try { @@ -48,12 +50,19 @@ async getObjectType(fn,options){ catch(e){write=false} } let mode = { - read: (read), - write: (write) + read: read, + write: write, + append: write, } let type = ( stat && stat.isDirectory()) ? "Container" : "Resource"; if(!stat && fn.endsWith('/')) type = "Container" - return Promise.resolve( [type,stat,mode] ) + stat = stat ? true : false + let item = { + mode : mode, + exists : stat, + isContainer : type==="Container" ? true : false, + } + return Promise.resolve( [type,stat,mode,item] ) } async getResource(pathname,options,objectType){ @@ -171,7 +180,7 @@ postContainer(fn,options){ } async makeContainers(pathname, options){ const foldername = path.dirname(pathname) - const [type, exists] = await this.getObjectType(foldername); + const [type, exists] = await this.getObjectType(foldername,options.request); if (!exists) { try { fs.mkdirpSync(foldername); diff --git a/plugins/solid-rest-mem/package.json b/plugins/solid-rest-mem/package.json new file mode 100644 index 0000000..5e58c5f --- /dev/null +++ b/plugins/solid-rest-mem/package.json @@ -0,0 +1,12 @@ +{ + "name": "solid-rest-mem", + "version": "1.0.0", + "description": "", + "main": "src/index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "MIT" +} diff --git a/src/localStorage.js b/plugins/solid-rest-mem/src/index.js similarity index 94% rename from src/localStorage.js rename to plugins/solid-rest-mem/src/index.js index 0244612..0141b8b 100644 --- a/src/localStorage.js +++ b/plugins/solid-rest-mem/src/index.js @@ -2,10 +2,10 @@ constructor should define the pacakage's name by default this will be added to the x-powered-by header of all responses */ -class SolidLocalStorage { +class SolidMemStorage { constructor() { - this.prefix = "ls" - this.name = "solid-rest-localStorage-1.0.0" + this.prefix = "mem" + this.name = "solid-rest-mem-1.0.0" localStorage.setItem( "/", " " ); } @@ -26,7 +26,14 @@ async getObjectType(pathname,options){ if(type==="Container" && item.startsWith(pathname)){ exists=true; break } if(item === pathname){ exists=true; break } } - return [type,exists] + let mode = {read:true,write:true,append:true} + let item = { + pathname : pathname, + mode : mode, + exists : exists, + isContainer : type==="Containter", + } + return [type,exists,mode,item] } /* @@ -186,5 +193,5 @@ if(typeof window==="undefined") { removeItem : (key) => { delete localStorage[key] }, setItem : (key,val) => { localStorage[key]=val }, } - module.exports = SolidLocalStorage + module.exports = SolidMemStorage } diff --git a/src/actions.js b/src/actions.js new file mode 100644 index 0000000..c4ad3e4 --- /dev/null +++ b/src/actions.js @@ -0,0 +1,29 @@ +import u from './utils.js'; +import {containerAsturtle} from './container.js'; + +async function GET(pathname,options,storage){ + if( options.item.isContainer ){ + let files = await storage.getContainer(pathname,options) + return await containerAsturtle(pathname,options,files,storage) + } + else { + return await storage.getResource(pathname,options) + } +} + +async function DELETE(pathname,options,storage){ + const links = await u.getLinks(pathname, options,storage); + if (links.length) + links.map( async (link) => { + await storage.deleteResource(link,options) + }) + if (options.item.isContainer) + return await storage.deleteContainer(pathname,options) + else + return await storage.deleteResource(pathname,options) +} + +export default { + DELETE, + GET, +} diff --git a/src/container.js b/src/container.js new file mode 100644 index 0000000..190ec2d --- /dev/null +++ b/src/container.js @@ -0,0 +1,40 @@ +import u from './utils.js'; + +export async function containerAsturtle( pathname, options, contentsArray, storage ){ + const pathSep = u.pathSep( options.item.pathHandler ); + if(typeof storage.container2turtle != "undefined") + return storage.container2turtle(pathname,options,contentsArray) + let filenames=contentsArray.filter( item => { + if(!item.endsWith('.acl') && !item.endsWith('.meta')){ return item } + }) + + // cxRes + if ( !pathname.endsWith(pathSep) ) pathname += pathSep + // if (!pathname.endsWith("/")) pathname += "/" + + let str2 = "" + let str = "@prefix : <#>. @prefix ldp: .\n" + + "<> a ldp:BasicContainer, ldp:Container" + if(filenames.length){ + str = str + "; ldp:contains\n"; + for(var i=0;i,\n` + + let ctype = u.getContentType(u.getExtension(fn,options),'Resource') + ctype = ctype.replace(/;.*/,'') + ftype = ftype==="Container" ? "ldp:Container; a ldp:BasicContainer" : "ldp:Resource" + str2 = str2 + `<${fn}> a ${ftype}.\n` + str2 = str2 + `<${fn}> a .\n` + // str2 = str2 + `<${fn}> :type "${ctype}".\n` + } + str = str.replace(/,\n$/,"") + } + str = str + `.\n` + str2 + // str = _makeStream(str); + return ([200,str]) + } + diff --git a/src/error.js b/src/error.js new file mode 100644 index 0000000..07f2ba3 --- /dev/null +++ b/src/error.js @@ -0,0 +1,30 @@ +import u from './utils.js'; + +export function checkRestErrors( options, request, item ){ + if( !request.url) return(400); + if( request.slug.endsWith('/') ) return(400); + if( request.method==='DELETE' && item.containerNotEmpty ) return(409); + if( u.isAuxResource(options) && request.method==="POST") return(405); + const methods = { + DELETE : { mustPrexist:1, requiresWrite:1 }, + POST : { mustPrexist:1, requiresAppend:1, requiresContentType:1 }, + GET : { mustPrexist:1, requiresRead:1 }, + HEAD : { mustPrexist:1, requiresRead:1 }, + OPTIONS : { mustPrexist:1, requiresRead:1 }, + PUT : { requiresWrite:1, requiresContentType:1 }, + PATCH : { requiresWrite:1, requiresContentType:1 }, + } + const method = methods[request.method]; + if( !method ) return(409); + if( method.mustPrexist && !item.exists ) return(404); + if( (method.requiresRead && !item.mode.read) + || (method.requiresWrite && !item.mode.write ) + || (method.requiresAppend && !item.mode.append ) + ) return (401); + if( method.requiresContentType && !request.headers['content-type'] ) + return (400); + if ( (request.method==='PUT'||request.method==='PATCH') && item.isContainer ) + return(405) +} +// ENDS + diff --git a/src/item.js b/src/item.js new file mode 100644 index 0000000..46deb1e --- /dev/null +++ b/src/item.js @@ -0,0 +1,30 @@ +import Url from "url"; +import u from './utils.js'; + +export async function getItem(uri,request,storage){ + const [objectType,objectExists,mode,item] = + await storage.getObjectType(uri,request) + item.mode = item.mode ? item.mode : {read:true,append:true,write:true}; + let pathHandler,url; + if (request.protocol.startsWith('file')) { + url = Url.format(request.url) + item.rest_prefix = 'file' + // item.pathname = Url.fileURLToPath(url) + item.pathHandler = 'default' + } + else { + url = decodeURIComponent(uri) + // item.pathname = Url.parse(url).pathname + item.rest_prefix=uri.replace(request.protocol+'//','').replace(/\/.*$/,'') + item.pathHandler = 'posix' + } + item.pathname = uri.replace(request.protocol+'//','') + if( request.method==='DELETE' && item.isContainer){ + let files = await storage.getContainer(item.pathname); + files = files.filter(file => !u.isLink(file,{item:{pathHandler:item.pathHandler}})) + if (files.length) item.containerNotEmpty = true; + } + + return item; +} + diff --git a/src/request.js b/src/request.js new file mode 100644 index 0000000..e3314df --- /dev/null +++ b/src/request.js @@ -0,0 +1,44 @@ +const URL = require("url").URL; + +export function getRequest(uri,options){ + const request = normalizeRequestKeys(options) + request.headers = normalizeRequestKeys(request.headers) + request.method = normalizeRequestMethod(request.method) + request.slug = request.headers.slug || request.slug || ""; + request.body = request.body || ""; + if( !validUrl(uri) ){ + request.url = null; + } + else{ + request.url = uri; + const url = new URL(uri) + request.protocol = url.protocol + } + return request; +} + +/* lowercase all request keys e.g. Method -> method +* lowercase all request.header keys e.g. Content-Type -> content-type +*/ +function normalizeRequestKeys(opts){ + let newOpts = {}; + for(var o in opts){ + newOpts[o.toLowerCase()] = opts[o]; + } + return newOpts; +} + +const validUrl = (s) => { + try { + new URL(s); + return true; + } catch (err) { return false; } +}; + +/* uppercase all request methods e.g. get -> GET +* default method = GET +*/ +function normalizeRequestMethod(method){ + return method ? method.toUpperCase() : 'GET'; +} + diff --git a/src/response.js b/src/response.js new file mode 100644 index 0000000..bab9cc8 --- /dev/null +++ b/src/response.js @@ -0,0 +1,83 @@ + /* DEFAULT HEADER + link created using .meta and .acl appended to uri + content-type assigned by mime-types.lookup + date from nodejs Date + */ + +import u from './utils.js'; + +export default function getResponseHeader( + pathname,options,headersFromPlugin,name,item,request +){ + const fn = u.basename(pathname,item.pathHandler) + let headers = headersFromPlugin; + + headers.location = headers.url = headers.location + || request.url.href + + headers.date = headers.date + || new Date(Date.now()).toISOString() + + headers.allow = headers.allow + || createAllowHeader(options.patch,item.mode) + + let wacAllow = headers['wac-allow'] + || createWacHeader(item.mode) + if( wacAllow ) headers['wac-allow'] = wacAllow; + + headers['x-powered-by'] = headers['x-powered-by'] || + name + + options.item = item; + options.request = request; + const ext = u.getExtension(pathname,options) + + headers['content-type'] + = headers['content-type'] + || u.getContentType(ext,item.isContainer==='Container'?"Container":"Resource") + if(!headers['content-type']){ + delete headers['content-type'] + } + if(options.patch) { + headers['ms-author-via']=["SPARQL"]; + headers['accept-patch']=['application/sparql-update']; + } + headers.link = headers.link; + if( !headers.link ) { + if( ext === '.acl' ) { + headers.link = + `; rel="type"` + } + else if( ext === '.meta' ) { + headers.link = + `<${fn}.acl>; rel="acl",` + +`; rel="type"` + } + else if ( item.isContainer ) { + headers.link = + `<.meta>; rel="describedBy", <.acl>; rel="acl",` + +`; rel="type",` + +`; rel="type"` + } + else { + headers.link = + `<${fn}.meta>; rel="describedBy", <${fn}.acl>; rel="acl",` + +`; rel="type"` + } + } + return headers + } // end of getHeaders() + + function createWacHeader( mode ){ + if(!mode.read && !mode.write) return null; + if(mode.read && !mode.write) return `user="read",public="read"` + if(!mode.read && mode.write) return `user="append write control",public=""` + return `user="read write append control",public="read"` + } + + function createAllowHeader( patch, mode ){ + return 'OPTIONS,HEAD' + + (mode.read ?',GET' : '') + + (mode.write ?',POST,PUT,DELETE' : '') + + (mode.write && patch ?',PATCH' : '') + } diff --git a/src/rest.js b/src/rest.js index 5cac922..533e1f3 100644 --- a/src/rest.js +++ b/src/rest.js @@ -1,237 +1,91 @@ "use strict"; -const Url = require('url') -const libPath = require("path"); const { Response } = require('cross-fetch') -const crossFetch = require('cross-fetch') -const { v1: uuidv1 } = require('uuid') -const contentTypeLookup = require('mime-types').contentType + const RestPatch = require('./rest-patch') -const pod = require('./createServerlessPod.js') +import u from './utils.js'; +import actions from './actions.js'; +import getResponseHeader from './response.js'; +import {checkRestErrors} from './error.js'; +import {getRequest} from './request.js'; +import {getItem} from './item.js'; -const linkExt = ['.acl', '.meta'] -const linksExt = linkExt.concat('.meta.acl') -let patch; +let patch,pathname,pathSep,request,item; class SolidRest { constructor( options ) { - this.version = "1.2.9"; - let handlers; - if(typeof options === "object"){ - if( Object.keys(options)[0] === "0" ) { - handlers = options // ARRAY - options = {} - } - else { - handlers = options.handlers || null - } - } - else { - options = {} + options = options || {} + if(!options.plugin) { + console.log(`You must specify a plugin storage handler!`); + process.exit(1); } + this.storage = options.plugin; let $rdf = (options.parser) ? options.parser : (typeof window !="undefined" && window.$rdf) ? window.$rdf : (typeof global !="undefined" && global.$rdf) ? global.$rdf : null; - patch = ($rdf) ? new RestPatch($rdf) : null; - this.storageHandlers = {} - if( !handlers ) { - if( typeof window ==="undefined") { - let File = require('./file.js'); - let Mem = require('./localStorage.js'); - handlers = [ new File(), new Mem() ] - } - else { - try { - let Bfs = require('./browserFS.js'); - handlers = [ new Bfs() ] - } - catch{(e)=>{alert(e)}} - } - } - handlers.forEach( handler => { -// console.log(` -// Installing Rest Handler ${handler.name} using prefix ${handler.prefix} -// `) - this.storageHandlers[handler.prefix] = handler - }) - // return this.addFetch(auth,sessionId) -} - -/* auth can be solid-auth-cli or solid-client-authn, or (default) cross-fetch - rest attaches itself to auth's fetch such that htpp* requests are - handled by the auth's fetch and others are handled by rest -*/ -addFetch( auth,sessionId ) { - let self = this - auth = auth || crossFetch - if(typeof auth.Session === 'function'){ - auth = new auth.Session( - { - clientAuthentication : - auth.getClientAuthenticationWithDependencies({}) - }, - sessionId - ); - } - let originalFetch = auth.fetch - auth.fetch = (uri,options) => { - if(uri.startsWith('http') ){ - return originalFetch(uri,options) - } - else { - return self.fetch(uri,options) - } - } - return auth + patch = options.patch = ($rdf) ? new RestPatch($rdf) : null; } - async createServerlessPod( base ){ - console.log(`Creating pod at <${base}>`); - base = base.replace(/\/$/,''); - await this.makeResource( base,"/.acl", pod.acl_content ); - await this.makeResource( base,"/profile/card", pod.profile_content ); - await this.makeResource( base,"/settings/prefs.ttl", pod.prefs_content ); - await this.makeResource(base,"/settings/privateTypeIndex.ttl",pod.private_content ); - await this.makeResource( base,"/settings/publicTypeIndex.ttl", pod.public_content ); - await this.makeResource( base,"/private/.meta", "" ); - await this.makeResource( base,"/.well-known/.meta", "" ); - await this.makeResource( base,"/public/.meta", "" ); - await this.makeResource( base,"/inbox/.meta", "" ); - } - async makeResource( base, path, content ){ - let url = base + path - console.log ( " creating " + path ) - await this.fetch( url, { - method:"PUT", - body:content, - headers:{"content-type":"text/turtle"} - }) - } - - -storage(options){ - const prefix = (typeof options==="string") ? options : options.rest_prefix - if(!this.storageHandlers[prefix]) throw "Did not recognize prefix "+prefix - return this.storageHandlers[prefix] +async createServerlessPod ( base ){ + return u.createServerlessPod( base ); } async itemExists(pathname,options){ - return (await this.storage(options).getObjectType(pathname, options))[1] + return (await this.storage.getObjectType(pathname, options),request)[1] } - async fetch(uri, options = {}) { let self = this - options = _normalizeOptions(options) - options.headers = _normalizeOptions(options.headers) - const url = new URL(uri) - options.scheme = url.protocol - let pathname, path - /* mungedPath = USE default path() for file and posix.path for others) - */ - if (options.scheme.startsWith('file')) { - options.url = Url.format(url) - pathname = Url.fileURLToPath(options.url) - options.rest_prefix = 'file' - path = libPath - } - else { - options.url = decodeURIComponent(uri) - pathname = Url.parse(options.url).pathname - options.rest_prefix=uri.replace(options.scheme+'//','').replace(/\/.*$/,'') - path = libPath.posix - } - options.mungedPath = path || libPath - /**/ - - if(!self.storage){ - if(self.storageHandlers) { - self.storage=()=>{return self.storageHandlers[prefix]} - } - else { - self.storage=()=>{return self.storageHandlers[options.rest_prefix]} - } - } - - const [objectType,objectExists,mode] = - await self.storage(options).getObjectType(pathname,options) + request = options = getRequest(uri,options); + item = await getItem(uri,request,this.storage); + + options.request = request; + options.item = item; + if (item.isContainer && !uri.endsWith('/')) options.url = `${options.url}/` + pathname = item.pathname + pathSep = u.pathSep( item.pathHandler ); + options.url = request.url; + options.rest_prefix = item.rest_prefix; +const objectType = item.isContainer ? "Container" : "Resource"; +const objectExists = item.exists; +const mode = item.mode; options.objectType = objectType options.objectExists = objectExists options.objectMode = mode ? mode : {read:true,write:true}; - const notFoundMessage = '404 Not Found' - if (objectType === "Container" && !options.url.endsWith('/')) options.url = `${options.url}/` - const resOptions = Object.assign({}, options) - resOptions.headers = {} + const resOptions = {headers:{}}; + let restError = checkRestErrors(options,request,item); + if( restError ) return _response( null, {}, restError ); - /* GET - */ if (options.method === 'GET') { - if(!objectExists) return _response("", resOptions, 404) - if(!options.objectMode.read) return _response("", resOptions, 401) - if( objectType==="Container"){ - let contents = await self.storage(options).getContainer(pathname,options) - const [status, turtleContents, headers] = await _container2turtle(pathname,options,contents) - Object.assign(resOptions.headers, headers) - - return _response(turtleContents, resOptions, status) - } - else if( objectType==="Resource" ){ - const [status, contents, headers] = await self.storage(options).getResource(pathname,options) - Object.assign(resOptions.headers, headers) - - return _response(contents, resOptions, status) - } - } - /* HEAD & OPTIONS // TBD : Should these be the same? - */ - if (options.method === 'HEAD' || options.method === 'OPTIONS' ) { - if(!objectExists) return _response(null, resOptions, 404) - else return _response(null, resOptions, 200) + return makeResponse( resOptions, + await actions.GET(pathname,options,this.storage) + ); } - if( options.method === 'DELETE' - || options.method === 'PUT' - || options.method === 'POST' - || options.method === 'PATCH' - ){ - if(objectExists && !options.objectMode.write) - return _response("", resOptions, 401) + if (options.method === 'HEAD' || options.method === 'OPTIONS' ) { + return _response(null, resOptions, 200) } - /* DELETE - */ if( options.method==="DELETE" ){ - if(!objectExists) return _response(notFoundMessage, resOptions, 404) - if( objectType==="Container" ){ - const [status, , headers] = await _deleteContainer(pathname,options) - Object.assign(resOptions.headers, headers) - - return _response(null, resOptions, status) - } - else if (objectType === 'Resource' ) { - const [status, , headers] = await _deleteResource(pathname,options) - Object.assign(resOptions.headers, headers) - - return _response(null, resOptions, status) - } - else { - } + return makeResponse( resOptions, + await actions.DELETE(pathname,options,this.storage) + ); } + /* POST */ if( options.method==="POST"){ - if( !objectExists ) return _response(notFoundMessage, resOptions, 404) - let link = options.headers.Link || options.headers.link + let link = options.headers.link let slug = options.headers.Slug || options.headers.slug || options.slug if(slug.match(/\//)) return _response(null, resOptions, 400) if( link && link.match("Container") ) { options.resourceType="Container" - slug = await _getAvailableUrl(pathname, slug, options) // jz add - pathname = _mungePath(pathname, slug, options) - const [status, , headers] = await self.storage(options).postContainer(pathname,options) + slug = await u.getAvailableUrl(pathname, slug, options,this.storage) // jz add + pathname = u.mungePath(pathname, slug, options) + const [status, , headers] = await self.storage.postContainer(pathname,options) // Object.assign(resOptions.headers, { location: mapPathToUrl(pathname, options) + '/' }) Object.assign(resOptions.headers, { location: pathname + '/' }) Object.assign(resOptions.headers, headers) @@ -239,11 +93,10 @@ async fetch(uri, options = {}) { } else if( link && link.match("Resource")){ options.resourceType="Resource" - slug = await _getAvailableUrl(pathname, slug, options) - pathname = _mungePath(pathname, slug, options) - if (isLink(pathname, options)) return _response(null, resOptions, 405) - const [status, , headers] = await self.storage(options).putResource( pathname, options) -// Object.assign(resOptions.headers, { location: mapPathToUrl(pathname, options) }) + slug = await u.getAvailableUrl(pathname, slug, options,this.storage) + pathname = u.mungePath(pathname, slug, options) + if (u.isLink(pathname, options)) return _response(null, resOptions, 405) + const [status, , headers] = await self.storage.putResource( pathname, options) Object.assign(resOptions.headers, { location: pathname }) Object.assign(resOptions.headers, headers) return _response(null, resOptions, status) @@ -253,12 +106,11 @@ async fetch(uri, options = {}) { /* PUT */ if (options.method === 'PUT' ) { - if(objectType==="Container") return _response(null, resOptions, 409) - const [status, undefined, headers] = await self.storage(options).makeContainers(pathname,options) + const [status, undefined, headers] = await self.storage.makeContainers(pathname,options) Object.assign(resOptions.headers, headers) if(status !== 200 && status !== 201) return _response(null, resOptions, status) - const [putStatus, , putHeaders] = await self.storage(options).putResource(pathname, options) + const [putStatus, , putHeaders] = await self.storage.putResource(pathname, options) Object.assign(resOptions.headers, putHeaders) // Note: The headers from makeContainers are also returned here @@ -273,14 +125,14 @@ async fetch(uri, options = {}) { return _response( null, resOptions, 405); } - // check pathname and 'text/turtle'. TODO see if NSS allows other RDF - if(objectType==="Container") return _response(null, resOptions, 409) + // check pathname and 'text/turtle'. TODO see if NSS allows other RD + let content = '' if (objectExists) { - const [status, contents, headers] = await self.storage(options).getResource(pathname,options) + const [status, contents, headers] = await self.storage.getResource(pathname,options) content = typeof contents === 'string' ? contents : contents.toString() } - const contentType = _getContentType(_getExtension(pathname, options)) + const contentType = u.getContentType(u.getExtension(pathname, options)) if (contentType !== 'text/turtle') return _response('500 '+ pathname + ' is not a "text/turtle" file', resOptions, 500) // patch content @@ -293,12 +145,12 @@ async fetch(uri, options = {}) { // PUT content to file if (!objectExists) { - const [status, undefined, headers] = await self.storage(options).makeContainers(pathname,options) + const [status, undefined, headers] = await self.storage.makeContainers(pathname,options) // TODO add patchHeaders('MS-Author-Via', 'SPARQL') Object.assign(resOptions.headers, headers) if(status !== 200 && status !== 201) return _response(null, resOptions, status) } - const [putStatus, , putHeaders] = await self.storage(options).putResource(pathname, options) + const [putStatus, , putHeaders] = await self.storage.putResource(pathname, options) //Object.assign(resOptions.headers, putHeaders) // Note: The headers from makeContainers are also returned here @@ -309,237 +161,40 @@ async fetch(uri, options = {}) { return _response(null, resOptions, 405) } - /** - * @param {RequestInfo} body - * @param {RequestInit} options - * @param {Number} status - Overrules options.status - */ - function _response(body, options, status = options.status) { - options.status = status - // if (body) options.statusText = body - options.headers = Object.assign(_getHeaders(pathname, options), options.headers) - return new Response(body, options) - } - - async function _container2turtle( pathname, options, contentsArray ){ - if(typeof self.storage(options).container2turtle != "undefined") - return self.storage(options).container2turtle(pathname,options,contentsArray) - let filenames=contentsArray.filter( item => { - if(!item.endsWith('.acl') && !item.endsWith('.meta')){ return item } - }) - - // cxRes - if ( !pathname.endsWith(options.mungedPath.sep) ) pathname += options.mungedPath.sep - // if (!pathname.endsWith("/")) pathname += "/" - - let str2 = "" - let str = "@prefix : <#>. @prefix ldp: .\n" - + "<> a ldp:BasicContainer, ldp:Container" - if(filenames.length){ - str = str + "; ldp:contains\n"; - for(var i=0;i,\n` - - let ctype = _getContentType(_getExtension(fn,options),'Resource') - ctype = ctype.replace(/;.*/,'') - ftype = ftype==="Container" ? "ldp:Container; a ldp:BasicContainer" : "ldp:Resource" - str2 = str2 + `<${fn}> a ${ftype}.\n` - str2 = str2 + `<${fn}> a .\n` - // str2 = str2 + `<${fn}> :type "${ctype}".\n` - } - str = str.replace(/,\n$/,"") - } - str = str + `.\n` + str2 - // str = _makeStream(str); - return ([200,str]) + function makeResponse(resOptions,response){ + // combine the standard headers with ones returned from the action if any + // respons = [status,body,headers] + Object.assign(resOptions.headers, response[2]) + return _response( response[1], resOptions, response[0] ); } - /* treats filename ".acl" and ".meta" as extensions - */ - function _getExtension(pathname,options) { - let ext = ( options.mungedPath.basename(pathname).startsWith('.') ) - ? options.mungedPath.basename(pathname) - : options.mungedPath.extname(pathname) - return ext - } - function _getContentType(ext,type) { - if( !ext - || ext==='.ttl' - || ext==='.acl' - || ext==='.meta' - || type==="Container" - ) { - return 'text/turtle' - } - else { - let ctype = contentTypeLookup(ext) - return( ctype ? ctype : 'text/turtle' ) + /** + * @param {RequestInfo} body + * @param {RequestInit} options + * @param {Number} status - Overrules options.status + */ + function _response(body, options, status = options.status) { + options.status = status; + let headersFromPlugin = + typeof self.storage.getHeaders != "undefined" + ? self.storage.getHeaders(pathname,options,item,request) + : {} + let name = self.storage.name + options.headers = Object.assign( + getResponseHeader( + pathname,options,headersFromPlugin,name,item,request + ), + options.headers + ) + return new Response(body, options) } - } - function isLink(pathname,options) { - return linkExt.find(ext => _getExtension(pathname,options) === ext) - } - - /* DEFAULT HEADER - link created using .meta and .acl appended to uri - content-type assigned by mime-types.lookup - date from nodejs Date - */ - function _getHeaders(pathname,options){ - - const fn = options.mungedPath.basename(pathname) - let headers = (typeof self.storage(options).getHeaders != "undefined") - ? self.storage(options).getHeaders(pathname,options) - : {} - - headers.location = headers.url = headers.location - || options.url - - headers.date = headers.date - || new Date(Date.now()).toISOString() - headers.allow = headers.allow - || _createAllowHeader(patch,options.objectMode) - let wacAllow = headers['wac-allow'] - || _createWacHeader(options.objectMode) - if( wacAllow ) headers['wac-allow'] = wacAllow; - - headers['x-powered-by'] = headers['x-powered-by'] || - self.storage(options).name - - const ext = _getExtension(pathname,options) - - headers['content-type'] - = headers['content-type'] - || _getContentType(ext,options.objectType) - if(!headers['content-type']){ - delete headers['content-type'] - } - if(patch) { - headers['ms-author-via']=["SPARQL"]; - headers['accept-patch']=['application/sparql-update']; - } - headers.link = headers.link; - if( !headers.link ) { - if( ext === '.acl' ) { - headers.link = - `; rel="type"` - } - else if( ext === '.meta' ) { - headers.link = - `<${fn}.acl>; rel="acl",` - +`; rel="type"` - } - else if (options.objectType==='Container') { - headers.link = - `<.meta>; rel="describedBy", <.acl>; rel="acl",` - +`; rel="type",` - +`; rel="type"` - } - else { - headers.link = - `<${fn}.meta>; rel="describedBy", <${fn}.acl>; rel="acl",` - +`; rel="type"` - } - } - return headers - } // end of getHeaders() - function _createWacHeader( mode ){ - if(!mode.read && !mode.write) return null; - if(mode.read && !mode.write) return `user="read",public="read"` - if(!mode.read && mode.write) return `user="append write control",public=""` - return `user="read write append control",public="read"` - } - function _createAllowHeader( patch, mode ){ - return 'OPTIONS,HEAD' - + (mode.read ?',GET' : '') - + (mode.write ?',POST,PUT,DELETE' : '') - + (mode.write && patch ?',PATCH' : '') - } - -async function _deleteContainer(pathname,options){ - let files = await self.storage(options).getContainer(pathname, options) - files = files.filter(file => !isLink(file,options)) // linkExt.find(ext => _getExtension(file,options) === ext)) - if (files.length) return [409] - const links = await getLinks(pathname, options) - if (links.length) links.map(async link => await self.storage(options).deleteResource(link,options)) - return await self.storage(options).deleteContainer(pathname,options) -} - -/* - _deleteResource(pathname,options) - * deletes a resource with links -*/ -async function _deleteResource(pathname,options){ - const links = await getLinks(pathname, options) - if (links.length) links.map(async link => await self.storage(options).deleteResource(link,options)) - return await self.storage(options).deleteResource(pathname,options) -} - -/** - * getLinks for item - * @param {*} pathname - * @param {*} options - */ -async function getLinks (pathname, options) { - let linksExists = linksExt.filter(async ext => await self.storage(options).getObjectType(pathname + ext)[1]) - const links = linksExists.map( ext => pathname + ext) - return links -} - -async function _getAvailableUrl (pathname, slug = uuidv1(), options) { - let requestUrl = _mungePath(pathname, slug, options) - if(options.resourceType==='Container' && !requestUrl.endsWith(options.mungedPath.sep)) requestUrl = requestUrl + options.mungedPath.sep - let urlExists = (await self.storage(options).getObjectType(requestUrl, options))[1] - if (urlExists) { slug = `${uuidv1()}-${slug}` } - return slug -} - -function _mungePath(pathname, slug, options) { - pathname = options.mungedPath.join(pathname, slug); - if (pathname.includes('\\')) pathname = pathname.replace(/\\/g, '/'); - return pathname; -} - -/** Normalize content-type/Content-type and method/Method - */ -function _normalizeOptions(opts){ - let newOpts = {}; - for(var o in opts){ - newOpts[o.toLowerCase()] = opts[o]; - } - newOpts.method = newOpts.method ? newOpts.method.toUpperCase() : 'GET'; - return newOpts; -} - - } // end of fetch() + } // end of fetch() } // end of SolidRest() module.exports = exports = SolidRest module.exports.SolidRest = SolidRest -/* END */ - - -/* -required - getObjectType - getResouce - getContainer - putResource - postResource - postContainer - deleteResource - deleteContainer - makeContainers -optional - getHeaders - text - json -*/ +// THE END diff --git a/src/utils.js b/src/utils.js new file mode 100644 index 0000000..174fd1a --- /dev/null +++ b/src/utils.js @@ -0,0 +1,130 @@ +import libPath from "path"; +import {contentType as contentTypeLookup} from 'mime-types' +const { v1: uuidv1 } = require('uuid') +import pod from './createServerlessPod.js'; + +const linkExt = ['.acl', '.meta'] +const linksExt = linkExt.concat('.meta.acl') + + async function createServerlessPod( base ){ + console.log(`Creating pod at <${base}>`); + base = base.replace(/\/$/,''); + await _makeResource( base,"/.acl", pod.acl_content ); + await _makeResource( base,"/profile/card", pod.profile_content ); + await _makeResource( base,"/settings/prefs.ttl", pod.prefs_content ); + await _makeResource(base,"/settings/privateTypeIndex.ttl",pod.private_content ); + await _.makeResource( base,"/settings/publicTypeIndex.ttl", pod.public_content ); + await _.makeResource( base,"/private/.meta", "" ); + await _.makeResource( base,"/.well-known/.meta", "" ); + await _.makeResource( base,"/public/.meta", "" ); + await _.makeResource( base,"/inbox/.meta", "" ); + } + async function _makeResource( base, path, content ){ + let url = base + path + console.log ( " creating " + path ) + await this.fetch( url, { + method:"PUT", + body:content, + headers:{"content-type":"text/turtle"} + }) + } + +function pathSep(type){ + if(type==='posix') return libPath.posix.sep + else return libPath.sep +} +function basename(path,type){ + if(type==='posix') return libPath.posix.basename(path); + else return libPath.basename(path); +} + +function mungePath(pathname, slug, options) { + pathname = options.item.pathHandler==='posix' + ? libPath.posix.join(pathname, slug) + : libPath.join(pathname, slug); + if (pathname.includes('\\')) pathname = pathname.replace(/\\/g, '/'); + return pathname; +} + + /* treats filename ".acl" and ".meta" as extensions + */ + function getExtension(pathname,options) { + let ext = ( basename(pathname,options.item.pathHandler).startsWith('.') ) + ? basename(pathname,options.item.pathHandler) + : options.item.pathHandler==='posix' + ? libPath.posix.extname(pathname) + : libPath.extname(pathname) + return ext + } + + function getContentType(ext,type) { + if( !ext + || ext==='.ttl' + || ext==='.acl' + || ext==='.meta' + || type==="Container" + ) { + return 'text/turtle' + } + else { + let ctype = contentTypeLookup(ext) + return( ctype ? ctype : 'text/turtle' ) + } + } + + function isAuxResource(o) { + return linkExt.find(ext => + getExtension( o.item.pathname,o ) === ext + ) + } + async function getAuxResources (pathname, options,storage) { + let linksExists = linksExt.filter(async ext => + await storage.getObjectType(pathname + ext,options.request)[1] + ) + const links = linksExists.map( ext => pathname + ext) + return links || []; + } + +// TBD : remove getLinks and isLink, replace in code with isAuxResource, etc. + + function isLink(pathname,options) { + return linkExt.find(ext => getExtension(pathname,options) === ext) + } + +/** + * getLinks for item + * @param {*} pathname + * @param {*} options + */ +async function getLinks (pathname, options,storage) { + let linksExists = linksExt.filter(async ext => + await storage.getObjectType(pathname + ext,options.request)[1] + ) + const links = linksExists.map( ext => pathname + ext) + return links +} + + +/* getAvailableUrl - generate random prefix for POST file names +*/ +async function getAvailableUrl (pathname, slug = uuidv1(), options,storage) { + let requestUrl = mungePath(pathname, slug, options) + if(options.resourceType==='Container' && !requestUrl.endsWith(pathSep(options.item.pathHandler))) requestUrl = requestUrl + pathSep(options.item.pathHandler) + let urlExists = (await storage.getObjectType(requestUrl, options,options.request))[1] + if (urlExists) { slug = `${uuidv1()}-${slug}` } + return slug +} + +export default { + createServerlessPod, + mungePath, + getExtension, + getContentType, + isAuxResource, isLink, + getAuxResources, getLinks, + getAvailableUrl, + linkExt, + linksExt, + pathSep, + basename, +} diff --git a/tests/all.js b/tests/all.js index e2bfb81..382835e 100644 --- a/tests/all.js +++ b/tests/all.js @@ -5,33 +5,46 @@ // //const SolidNodeClient = require('../').SolidNodeClient //const client = new SolidNodeClient() -const SolidRest = require('../') - // global.$rdf = require('rdflib') // const client = new SolidRest() const $rdf = require('rdflib'); -const client = new SolidRest({ parser:$rdf }) + +const SolidRest = require('../') +const SolidRestFile = require('../plugins/solid-rest-file'); +const SolidRestMem = require('../plugins/solid-rest-mem'); + +function getRestClient(protocol,parser){ + const plugin = protocol.startsWith('file') ? new SolidRestFile() + : protocol.startsWith('mem') ? new SolidRestMem() + : protocol.startsWith('ssh') ? new SolidRestSsh() : null; + return new SolidRest({ + plugin : plugin, + parser : parser, + }); +} +let client; /** Silence rdflib chatty information about patch * Send console.log() to a logfile * Send console.error(), console.warn() and untrapped errors to screen */ +/* const fs = require('fs'); const logfile = `${process.cwd()}/log.txt`; console.log = function(msg) { fs.appendFileSync(logfile,msg.toString()) } process.on('uncaughtException', function(err) { console.error((err && err.stack) ? err.stack : err); }); - +*/ const libUrl = require('url') let [tests,fails,passes,res] = [0,0,0] let allfails = 0 async function main(){ - await run("app:") await run("file:") +// await run("mem:") // await run("https:") if(allfails>0){ process.exit(1) @@ -43,9 +56,10 @@ async function main(){ main() async function getConfig(scheme){ + client = getRestClient(scheme,$rdf); let host = scheme; - if(scheme==="app:"){ - scheme = "app://ls" // = protocol + if(scheme==="mem:"){ + scheme = "mem://" // = protocol host = scheme; } @@ -203,8 +217,8 @@ async function run(scheme){ let res let res1 - if(scheme==="app:") cfg.base += "/" - try {res=await PUT(cfg.dummy)}catch{} + if(scheme==="mem:") cfg.base += "/" + try {res=await PUT(cfg.dummy)}catch(e){console.log(e)} console.warn(`\nTesting ${cfg.base} ...`) @@ -247,7 +261,7 @@ async function run(scheme){ /** PUT */ res = await PUT( cfg.folder1 ) - ok( "409 put container (method not allowed)", res.status==409,res) + ok( "405 put container (method not allowed)", res.status==405,res) res = await PUT( cfg.file1,cfg.text ) ok( "201 put resource", res.status==201,res)