summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-06-02 16:31:24 +0200
committerRaindropsSys <contact@minteck.org>2023-06-02 16:31:24 +0200
commitb2dbefbab8a693ab301619389f718623f5176899 (patch)
tree1aebf395edc477375247e61dcc9fa0bccfc10828
parent16c315ca4791538bc6d21626183cff3a648ddb2d (diff)
downloaddelta-b2dbefbab8a693ab301619389f718623f5176899.tar.gz
delta-b2dbefbab8a693ab301619389f718623f5176899.tar.bz2
delta-b2dbefbab8a693ab301619389f718623f5176899.zip
Updated 12 files and added 277 files (automated)
-rw-r--r--.idea/delta.iml4
-rw-r--r--.idea/jsLibraryMappings.xml1
-rw-r--r--_articles/index.php5
-rw-r--r--_gallery/index.php5
-rw-r--r--_icons/index.php4
-rw-r--r--_people/index.php5
-rw-r--r--admin/requests/index.php12
-rw-r--r--equestriadev.svg223
-rw-r--r--includes/PHPMailer/LICENSE2
-rw-r--r--includes/functions.php6
-rw-r--r--includes/translation.php67
-rw-r--r--includes/translator/html.js64
-rw-r--r--includes/translator/index.js115
-rw-r--r--includes/translator/node_modules/.package-lock.json402
-rw-r--r--includes/translator/node_modules/@sindresorhus/is/dist/index.d.ts132
-rw-r--r--includes/translator/node_modules/@sindresorhus/is/dist/index.js245
-rw-r--r--includes/translator/node_modules/@sindresorhus/is/dist/index.js.map1
-rw-r--r--includes/translator/node_modules/@sindresorhus/is/license9
-rw-r--r--includes/translator/node_modules/@sindresorhus/is/package.json63
-rw-r--r--includes/translator/node_modules/@sindresorhus/is/readme.md451
-rwxr-xr-xincludes/translator/node_modules/@szmarczak/http-timer/LICENSE21
-rwxr-xr-xincludes/translator/node_modules/@szmarczak/http-timer/README.md70
-rwxr-xr-xincludes/translator/node_modules/@szmarczak/http-timer/package.json47
-rwxr-xr-xincludes/translator/node_modules/@szmarczak/http-timer/source/index.js99
-rw-r--r--includes/translator/node_modules/cacheable-request/LICENSE21
-rw-r--r--includes/translator/node_modules/cacheable-request/README.md206
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js52
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/get-stream/index.d.ts108
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/get-stream/index.js60
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/get-stream/license9
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/get-stream/package.json50
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/get-stream/readme.md124
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/index.d.ts16
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/index.js10
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/license9
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/package.json38
-rw-r--r--includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/readme.md32
-rw-r--r--includes/translator/node_modules/cacheable-request/package.json56
-rw-r--r--includes/translator/node_modules/cacheable-request/src/index.js251
-rw-r--r--includes/translator/node_modules/clone-response/LICENSE21
-rw-r--r--includes/translator/node_modules/clone-response/README.md62
-rw-r--r--includes/translator/node_modules/clone-response/package.json41
-rw-r--r--includes/translator/node_modules/clone-response/src/index.js17
-rw-r--r--includes/translator/node_modules/configstore/index.js106
-rw-r--r--includes/translator/node_modules/configstore/license25
-rw-r--r--includes/translator/node_modules/configstore/package.json47
-rw-r--r--includes/translator/node_modules/configstore/readme.md132
-rw-r--r--includes/translator/node_modules/crypto-random-string/index.js10
-rw-r--r--includes/translator/node_modules/crypto-random-string/license21
-rw-r--r--includes/translator/node_modules/crypto-random-string/package.json43
-rw-r--r--includes/translator/node_modules/crypto-random-string/readme.md49
-rw-r--r--includes/translator/node_modules/decompress-response/index.js29
-rw-r--r--includes/translator/node_modules/decompress-response/license21
-rw-r--r--includes/translator/node_modules/decompress-response/package.json53
-rw-r--r--includes/translator/node_modules/decompress-response/readme.md31
-rw-r--r--includes/translator/node_modules/defer-to-connect/LICENSE21
-rw-r--r--includes/translator/node_modules/defer-to-connect/README.md38
-rw-r--r--includes/translator/node_modules/defer-to-connect/dist/index.d.ts10
-rw-r--r--includes/translator/node_modules/defer-to-connect/dist/index.js45
-rw-r--r--includes/translator/node_modules/defer-to-connect/package.json74
-rw-r--r--includes/translator/node_modules/dot-prop/index.js141
-rw-r--r--includes/translator/node_modules/dot-prop/license21
-rw-r--r--includes/translator/node_modules/dot-prop/package.json48
-rw-r--r--includes/translator/node_modules/dot-prop/readme.md105
-rw-r--r--includes/translator/node_modules/duplexer3/index.js76
-rw-r--r--includes/translator/node_modules/duplexer3/license10
-rw-r--r--includes/translator/node_modules/duplexer3/package.json27
-rw-r--r--includes/translator/node_modules/duplexer3/readme.md99
-rw-r--r--includes/translator/node_modules/end-of-stream/LICENSE21
-rw-r--r--includes/translator/node_modules/end-of-stream/README.md54
-rw-r--r--includes/translator/node_modules/end-of-stream/index.js94
-rw-r--r--includes/translator/node_modules/end-of-stream/package.json37
-rw-r--r--includes/translator/node_modules/get-stream/buffer-stream.js51
-rw-r--r--includes/translator/node_modules/get-stream/index.js50
-rw-r--r--includes/translator/node_modules/get-stream/license9
-rw-r--r--includes/translator/node_modules/get-stream/package.json46
-rw-r--r--includes/translator/node_modules/get-stream/readme.md123
-rw-r--r--includes/translator/node_modules/got/license9
-rw-r--r--includes/translator/node_modules/got/package.json74
-rw-r--r--includes/translator/node_modules/got/readme.md1237
-rw-r--r--includes/translator/node_modules/got/source/as-promise.js108
-rw-r--r--includes/translator/node_modules/got/source/as-stream.js93
-rw-r--r--includes/translator/node_modules/got/source/create.js79
-rw-r--r--includes/translator/node_modules/got/source/errors.js107
-rw-r--r--includes/translator/node_modules/got/source/get-response.js31
-rw-r--r--includes/translator/node_modules/got/source/index.js60
-rw-r--r--includes/translator/node_modules/got/source/known-hook-events.js10
-rw-r--r--includes/translator/node_modules/got/source/merge.js73
-rw-r--r--includes/translator/node_modules/got/source/normalize-arguments.js265
-rw-r--r--includes/translator/node_modules/got/source/progress.js96
-rw-r--r--includes/translator/node_modules/got/source/request-as-event-emitter.js312
-rw-r--r--includes/translator/node_modules/got/source/utils/deep-freeze.js12
-rw-r--r--includes/translator/node_modules/got/source/utils/get-body-size.js32
-rw-r--r--includes/translator/node_modules/got/source/utils/is-form-data.js4
-rw-r--r--includes/translator/node_modules/got/source/utils/timed-out.js160
-rw-r--r--includes/translator/node_modules/got/source/utils/url-to-options.js25
-rw-r--r--includes/translator/node_modules/graceful-fs/LICENSE15
-rw-r--r--includes/translator/node_modules/graceful-fs/README.md143
-rw-r--r--includes/translator/node_modules/graceful-fs/clone.js23
-rw-r--r--includes/translator/node_modules/graceful-fs/graceful-fs.js448
-rw-r--r--includes/translator/node_modules/graceful-fs/legacy-streams.js118
-rw-r--r--includes/translator/node_modules/graceful-fs/package.json53
-rw-r--r--includes/translator/node_modules/graceful-fs/polyfills.js355
-rw-r--r--includes/translator/node_modules/http-cache-semantics/LICENSE9
-rw-r--r--includes/translator/node_modules/http-cache-semantics/README.md203
-rw-r--r--includes/translator/node_modules/http-cache-semantics/index.js674
-rw-r--r--includes/translator/node_modules/http-cache-semantics/package.json18
-rw-r--r--includes/translator/node_modules/imurmurhash/README.md122
-rw-r--r--includes/translator/node_modules/imurmurhash/imurmurhash.js138
-rw-r--r--includes/translator/node_modules/imurmurhash/imurmurhash.min.js12
-rw-r--r--includes/translator/node_modules/imurmurhash/package.json40
-rw-r--r--includes/translator/node_modules/is-obj/index.js5
-rw-r--r--includes/translator/node_modules/is-obj/license21
-rw-r--r--includes/translator/node_modules/is-obj/package.json33
-rw-r--r--includes/translator/node_modules/is-obj/readme.md34
-rw-r--r--includes/translator/node_modules/json-buffer/.npmignore3
-rw-r--r--includes/translator/node_modules/json-buffer/.travis.yml3
-rw-r--r--includes/translator/node_modules/json-buffer/LICENSE22
-rw-r--r--includes/translator/node_modules/json-buffer/README.md24
-rw-r--r--includes/translator/node_modules/json-buffer/index.js58
-rw-r--r--includes/translator/node_modules/json-buffer/package.json34
-rw-r--r--includes/translator/node_modules/json-buffer/test/index.js63
-rw-r--r--includes/translator/node_modules/keyv/LICENSE21
-rw-r--r--includes/translator/node_modules/keyv/README.md276
-rw-r--r--includes/translator/node_modules/keyv/package.json49
-rw-r--r--includes/translator/node_modules/keyv/src/index.js103
-rw-r--r--includes/translator/node_modules/lowercase-keys/index.js11
-rw-r--r--includes/translator/node_modules/lowercase-keys/license21
-rw-r--r--includes/translator/node_modules/lowercase-keys/package.json35
-rw-r--r--includes/translator/node_modules/lowercase-keys/readme.md33
-rw-r--r--includes/translator/node_modules/make-dir/index.js85
-rw-r--r--includes/translator/node_modules/make-dir/license9
-rw-r--r--includes/translator/node_modules/make-dir/package.json54
-rw-r--r--includes/translator/node_modules/make-dir/readme.md116
-rw-r--r--includes/translator/node_modules/mimic-response/index.js32
-rw-r--r--includes/translator/node_modules/mimic-response/license9
-rw-r--r--includes/translator/node_modules/mimic-response/package.json37
-rw-r--r--includes/translator/node_modules/mimic-response/readme.md54
-rw-r--r--includes/translator/node_modules/normalize-url/index.d.ts216
-rw-r--r--includes/translator/node_modules/normalize-url/index.js221
-rw-r--r--includes/translator/node_modules/normalize-url/license9
-rw-r--r--includes/translator/node_modules/normalize-url/package.json44
-rw-r--r--includes/translator/node_modules/normalize-url/readme.md232
-rw-r--r--includes/translator/node_modules/once/LICENSE15
-rw-r--r--includes/translator/node_modules/once/README.md79
-rw-r--r--includes/translator/node_modules/once/once.js42
-rw-r--r--includes/translator/node_modules/once/package.json33
-rw-r--r--includes/translator/node_modules/p-cancelable/index.d.ts168
-rw-r--r--includes/translator/node_modules/p-cancelable/index.js103
-rw-r--r--includes/translator/node_modules/p-cancelable/license9
-rw-r--r--includes/translator/node_modules/p-cancelable/package.json49
-rw-r--r--includes/translator/node_modules/p-cancelable/readme.md155
-rw-r--r--includes/translator/node_modules/pify/index.js84
-rw-r--r--includes/translator/node_modules/pify/license9
-rw-r--r--includes/translator/node_modules/pify/package.json51
-rw-r--r--includes/translator/node_modules/pify/readme.md131
-rw-r--r--includes/translator/node_modules/prepend-http/index.js15
-rw-r--r--includes/translator/node_modules/prepend-http/license9
-rw-r--r--includes/translator/node_modules/prepend-http/package.json35
-rw-r--r--includes/translator/node_modules/prepend-http/readme.md56
-rw-r--r--includes/translator/node_modules/proxy-check/README.md21
-rw-r--r--includes/translator/node_modules/proxy-check/index.js87
-rw-r--r--includes/translator/node_modules/proxy-check/package.json22
-rw-r--r--includes/translator/node_modules/pump/.travis.yml5
-rw-r--r--includes/translator/node_modules/pump/LICENSE21
-rw-r--r--includes/translator/node_modules/pump/README.md65
-rw-r--r--includes/translator/node_modules/pump/index.js82
-rw-r--r--includes/translator/node_modules/pump/package.json24
-rw-r--r--includes/translator/node_modules/pump/test-browser.js66
-rw-r--r--includes/translator/node_modules/pump/test-node.js53
-rw-r--r--includes/translator/node_modules/responselike/LICENSE19
-rw-r--r--includes/translator/node_modules/responselike/README.md77
-rw-r--r--includes/translator/node_modules/responselike/package.json38
-rw-r--r--includes/translator/node_modules/responselike/src/index.js34
-rw-r--r--includes/translator/node_modules/sax/LICENSE41
-rw-r--r--includes/translator/node_modules/sax/README.md225
-rw-r--r--includes/translator/node_modules/sax/lib/sax.js1565
-rw-r--r--includes/translator/node_modules/sax/package.json25
-rw-r--r--includes/translator/node_modules/signal-exit/LICENSE.txt16
-rw-r--r--includes/translator/node_modules/signal-exit/README.md39
-rw-r--r--includes/translator/node_modules/signal-exit/index.js202
-rw-r--r--includes/translator/node_modules/signal-exit/package.json38
-rw-r--r--includes/translator/node_modules/signal-exit/signals.js53
-rw-r--r--includes/translator/node_modules/to-readable-stream/index.js11
-rw-r--r--includes/translator/node_modules/to-readable-stream/license9
-rw-r--r--includes/translator/node_modules/to-readable-stream/package.json40
-rw-r--r--includes/translator/node_modules/to-readable-stream/readme.md42
-rwxr-xr-xincludes/translator/node_modules/translatte/LICENSE.txt21
-rwxr-xr-xincludes/translator/node_modules/translatte/README.md200
-rwxr-xr-xincludes/translator/node_modules/translatte/index.js406
-rwxr-xr-xincludes/translator/node_modules/translatte/languages.js187
-rwxr-xr-xincludes/translator/node_modules/translatte/logo.pngbin0 -> 23775 bytes
-rwxr-xr-xincludes/translator/node_modules/translatte/package.json47
-rwxr-xr-xincludes/translator/node_modules/translatte/token.js120
-rwxr-xr-xincludes/translator/node_modules/translatte/translatte_lg.pngbin0 -> 449434 bytes
-rwxr-xr-xincludes/translator/node_modules/translatte/translatte_md.pngbin0 -> 141215 bytes
-rw-r--r--includes/translator/node_modules/tunnel/.idea/encodings.xml6
-rw-r--r--includes/translator/node_modules/tunnel/.idea/modules.xml8
-rw-r--r--includes/translator/node_modules/tunnel/.idea/node-tunnel.iml12
-rw-r--r--includes/translator/node_modules/tunnel/.idea/vcs.xml6
-rw-r--r--includes/translator/node_modules/tunnel/.idea/workspace.xml797
-rw-r--r--includes/translator/node_modules/tunnel/.travis.yml6
-rw-r--r--includes/translator/node_modules/tunnel/CHANGELOG.md22
-rw-r--r--includes/translator/node_modules/tunnel/LICENSE21
-rw-r--r--includes/translator/node_modules/tunnel/README.md185
-rw-r--r--includes/translator/node_modules/tunnel/index.js1
-rw-r--r--includes/translator/node_modules/tunnel/lib/tunnel.js264
-rw-r--r--includes/translator/node_modules/tunnel/package.json34
-rw-r--r--includes/translator/node_modules/unique-string/index.js4
-rw-r--r--includes/translator/node_modules/unique-string/license21
-rw-r--r--includes/translator/node_modules/unique-string/package.json44
-rw-r--r--includes/translator/node_modules/unique-string/readme.md32
-rw-r--r--includes/translator/node_modules/url-parse-lax/index.js12
-rw-r--r--includes/translator/node_modules/url-parse-lax/license9
-rw-r--r--includes/translator/node_modules/url-parse-lax/package.json42
-rw-r--r--includes/translator/node_modules/url-parse-lax/readme.md127
-rw-r--r--includes/translator/node_modules/wrappy/LICENSE15
-rw-r--r--includes/translator/node_modules/wrappy/README.md36
-rw-r--r--includes/translator/node_modules/wrappy/package.json29
-rw-r--r--includes/translator/node_modules/wrappy/wrappy.js33
-rw-r--r--includes/translator/node_modules/write-file-atomic/CHANGELOG.md25
-rw-r--r--includes/translator/node_modules/write-file-atomic/LICENSE6
-rw-r--r--includes/translator/node_modules/write-file-atomic/README.md56
-rw-r--r--includes/translator/node_modules/write-file-atomic/index.js238
-rw-r--r--includes/translator/node_modules/write-file-atomic/package.json41
-rw-r--r--includes/translator/node_modules/xdg-basedir/index.js28
-rw-r--r--includes/translator/node_modules/xdg-basedir/license21
-rw-r--r--includes/translator/node_modules/xdg-basedir/package.json40
-rw-r--r--includes/translator/node_modules/xdg-basedir/readme.md60
-rw-r--r--includes/translator/node_modules/xml2js/LICENSE19
-rw-r--r--includes/translator/node_modules/xml2js/README.md507
-rw-r--r--includes/translator/node_modules/xml2js/lib/bom.js12
-rw-r--r--includes/translator/node_modules/xml2js/lib/builder.js127
-rw-r--r--includes/translator/node_modules/xml2js/lib/defaults.js72
-rw-r--r--includes/translator/node_modules/xml2js/lib/parser.js396
-rw-r--r--includes/translator/node_modules/xml2js/lib/processors.js34
-rw-r--r--includes/translator/node_modules/xml2js/lib/xml2js.js39
-rw-r--r--includes/translator/node_modules/xml2js/package.json93
-rw-r--r--includes/translator/node_modules/xmlbuilder/CHANGELOG.md470
-rw-r--r--includes/translator/node_modules/xmlbuilder/LICENSE21
-rw-r--r--includes/translator/node_modules/xmlbuilder/README.md86
-rw-r--r--includes/translator/node_modules/xmlbuilder/appveyor.yml20
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/Derivation.js10
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/DocumentPosition.js12
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/NodeType.js23
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/OperationType.js11
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/Utility.js83
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/WriterState.js10
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLAttribute.js108
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLCData.js36
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLCharacterData.js79
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLComment.js36
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js64
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js16
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDOMImplementation.js32
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDOMStringList.js28
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDTDAttList.js55
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDTDElement.js38
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDTDEntity.js97
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDTDNotation.js52
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDeclaration.js43
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDocType.js186
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDocument.js242
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDocumentCB.js528
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDocumentFragment.js24
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLDummy.js31
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLElement.js298
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js58
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLNode.js785
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLNodeFilter.js48
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLNodeList.js28
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js49
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLRaw.js35
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLStreamWriter.js176
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLStringWriter.js35
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLStringifier.js240
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLText.js69
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLTypeInfo.js21
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLUserDataHandler.js16
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/XMLWriterBase.js428
-rw-r--r--includes/translator/node_modules/xmlbuilder/lib/index.js65
-rw-r--r--includes/translator/node_modules/xmlbuilder/package.json39
-rw-r--r--includes/translator/node_modules/xmlbuilder/typings/index.d.ts153
-rw-r--r--includes/translator/package-lock.json408
-rw-r--r--includes/translator/package.json6
-rw-r--r--includes/translator/translate.js35
-rw-r--r--lang/en.json20
-rw-r--r--lang/fr.json13
-rw-r--r--login/index.php121
289 files changed, 26152 insertions, 87 deletions
diff --git a/.idea/delta.iml b/.idea/delta.iml
index 71e3dd1..2b05ffd 100644
--- a/.idea/delta.iml
+++ b/.idea/delta.iml
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
- <content url="file://$MODULE_DIR$" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/includes/recaptcha/src" isTestSource="false" />
+ </content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="api" level="application" />
diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml
index 21ec924..d23208f 100644
--- a/.idea/jsLibraryMappings.xml
+++ b/.idea/jsLibraryMappings.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
- <file url="PROJECT" libraries="{api}" />
<includedPredefinedLibrary name="Node.js Core" />
</component>
</project> \ No newline at end of file
diff --git a/_articles/index.php b/_articles/index.php
index 21b760b..89ad0b3 100644
--- a/_articles/index.php
+++ b/_articles/index.php
@@ -29,6 +29,7 @@ if (isset($id)) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/translation.php";
if (!isset($id)):
?>
@@ -53,11 +54,13 @@ if (!isset($id)):
<span id="btn-area" class="btn-group"><a style="height: 38px;" href="/request/?type=rename&id=<?= $id ?>" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_articles_rename") ?>" data-bs-toggle="tooltip"><img src="/icons/rename.svg" style="width: 24px;"></a><a style="height: 38px;" href="/edit/<?= $id ?>" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_people_edit") ?>" data-bs-toggle="tooltip"><img src="/icons/edit.svg" style="width: 24px;"></a><a style="height: 38px;" onclick="copy('<?= uuidToId($id) ?>', true)" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_shortener_copy") ?>" data-bs-toggle="tooltip"><img src="/icons/copy.svg" style="width: 24px;"></a></span>
</h1>
+ <?php showTranslationBox($id); ?>
+
<div>
<div>
<?php if (isset($data["contents"]) && trim($data["contents"] !== "")): ?>
<div>
- <?= doLinking($data["contents"]) ?>
+ <?= doLinking(getTranslation($id, "contents")) ?>
</div>
<small class="print-ignore text-muted"><?= isset($data["update_user"]) ? str_replace("%2", "<a class='update-user' href='/profile/" . $data["update_user"] . "'>" . resolveUser($data["update_user"]) . "</a>", str_replace("%1", timeAgo($data["update"]), l("lang_time_update_user"))) : str_replace("%1", timeAgo($data["update"]), l("lang_time_update")) ?></small>
<?php else: ?>
diff --git a/_gallery/index.php b/_gallery/index.php
index 450928d..3b303d8 100644
--- a/_gallery/index.php
+++ b/_gallery/index.php
@@ -29,6 +29,7 @@ if (isset($id)) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/translation.php";
if (!isset($id)):
?>
@@ -53,12 +54,14 @@ if (!isset($id)):
<span id="btn-area" class="btn-group"><a style="height: 38px;" href="/upload/<?= $id ?>" class="btn btn-outline-primary btn-with-img" title="<?= l("lang_gallery_upload") ?>" data-bs-toggle="tooltip"><img src="/icons/upload.svg?p" style="width: 24px;"></a><a style="height: 38px;" href="/request/?type=rename&id=<?= $id ?>" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_articles_rename") ?>" data-bs-toggle="tooltip"><img src="/icons/rename.svg" style="width: 24px;"></a><a style="height: 38px;" href="/edit/<?= $id ?>" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_people_edit") ?>" data-bs-toggle="tooltip"><img src="/icons/edit.svg" style="width: 24px;"></a><a style="height: 38px;" onclick="copy('<?= uuidToId($id) ?>', true)" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_shortener_copy") ?>" data-bs-toggle="tooltip"><img src="/icons/copy.svg" style="width: 24px;"></a></span>
</h1>
+ <?php showTranslationBox($id); ?>
+
<div>
<div>
<?php if (isset($data["images"]) && count($data["images"]) > 0): ?>
<?php if (isset($data["contents"]) && trim($data["contents"] !== "")): ?>
<div>
- <?= doLinking($data["contents"]) ?>
+ <?= doLinking(getTranslation($id, "contents")) ?>
</div>
<small class="print-ignore text-muted"><?= isset($data["update_user"]) ? str_replace("%2", "<a class='update-user' href='/profile/" . $data["update_user"] . "'>" . resolveUser($data["update_user"]) . "</a>", str_replace("%1", timeAgo($data["update"]), l("lang_time_update_user"))) : str_replace("%1", timeAgo($data["update"]), l("lang_time_update")) ?></small>
<?php endif;
diff --git a/_icons/index.php b/_icons/index.php
index 1449557..b8e6235 100644
--- a/_icons/index.php
+++ b/_icons/index.php
@@ -1,6 +1,8 @@
<?php
-$data = []; $api = true; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
+if (!isset($_GET["o"])) {
+ $data = []; $api = true; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
+}
$palettes = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/themes.json"), true);
diff --git a/_people/index.php b/_people/index.php
index 38713d4..1e63670 100644
--- a/_people/index.php
+++ b/_people/index.php
@@ -30,6 +30,7 @@ if (isset($id)) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/translation.php";
if (!isset($id)):
?>
@@ -54,11 +55,13 @@ if (!isset($id)):
<span id="btn-area" class="btn-group"><a style="height: 38px;" href="/edit/<?= $id ?>" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_people_edit") ?>" data-bs-toggle="tooltip"><img src="/icons/edit.svg" style="width: 24px;"></a><a style="height: 38px;" onclick="copy('<?= uuidToId($id) ?>', true)" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_shortener_copy") ?>" data-bs-toggle="tooltip"><img src="/icons/copy.svg" style="width: 24px;"></a></span>
</h1>
+ <?php showTranslationBox($id); ?>
+
<div style="display: grid; grid-template-columns: 1fr 400px; grid-gap: 20px;" id="infobox">
<div>
<?php if (isset($data["contents"]) && trim($data["contents"] !== "")): ?>
<div>
- <?= doLinking($data["contents"]) ?>
+ <?= doLinking(getTranslation($id, "contents")) ?>
</div>
<small class="print-ignore text-muted"><?= isset($data["update_user"]) ? str_replace("%2", "<a class='update-user' href='/profile/" . $data["update_user"] . "'>" . resolveUser($data["update_user"]) . "</a>", str_replace("%1", timeAgo($data["update"]), l("lang_time_update_user"))) : str_replace("%1", timeAgo($data["update"]), l("lang_time_update")) ?></small>
<?php else: ?>
diff --git a/admin/requests/index.php b/admin/requests/index.php
index 5e136f0..0cf38b7 100644
--- a/admin/requests/index.php
+++ b/admin/requests/index.php
@@ -70,15 +70,15 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
<div class="list-group-item" style="margin-top: 10px;">
<p>
- <b>ID:</b> <?= $request["_id"] ?><br>
- <b>Publish date:</b> <?= date('r', strtotime($request["date"])) ?><br>
- <b>User:</b> <?php $adata = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")), true); ?> <?= isset($adata["nick_name"]) && trim($adata["nick_name"]) !== "" ? $adata["nick_name"] : $adata["first_name"] . " " . $adata["last_name"] ?> (<?= $request["author"] ?>)<br>
- <b>Target:</b> <?= isset($request["id"]) && trim($request["id"]) !== "" && $request["id"] !== $request["author"] ? getNameFromId($request["id"]) . " (" . $request["id"] . ")" : "<span class='text-muted'>Not applicable</span>" ?><br>
- <b>Summary:</b> <?= isset($request["summary"]) && trim($request["summary"]) !== "" ? strip_tags($request["summary"]) : "<span class='text-muted'>Not applicable</span>" ?>
+ <b><?= l("lang_admin_requests_view_0") ?></b> <?= $request["_id"] ?><br>
+ <b><?= l("lang_admin_requests_view_1") ?></b> <?= date('r', strtotime($request["date"])) ?><br>
+ <b><?= l("lang_admin_requests_view_2") ?></b> <?php $adata = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $request["author"] . ".json")), true); ?> <?= isset($adata["nick_name"]) && trim($adata["nick_name"]) !== "" ? $adata["nick_name"] : $adata["first_name"] . " " . $adata["last_name"] ?> (<?= $request["author"] ?>)<br>
+ <b><?= l("lang_admin_requests_view_3") ?></b> <?= isset($request["id"]) && trim($request["id"]) !== "" && $request["id"] !== $request["author"] ? getNameFromId($request["id"]) . " (" . $request["id"] . ")" : "<span class='text-muted'>" . l("lang_admin_requests_view_5") . "</span>" ?><br>
+ <b><?= l("lang_admin_requests_view_4") ?></b> <?= isset($request["summary"]) && trim($request["summary"]) !== "" ? strip_tags($request["summary"]) : "<span class='text-muted'>" . l("lang_admin_requests_view_5") . "</span>" ?>
</p>
<details style="margin-bottom: 1rem;">
- <summary>View full request object</summary>
+ <summary><?= l("lang_admin_requests_full") ?></summary>
<pre style="margin-bottom: 0;"><?= str_replace(">", "&gt;", str_replace("<", "&lt;", json_encode($request, JSON_PRETTY_PRINT))) ?></pre>
</details>
diff --git a/equestriadev.svg b/equestriadev.svg
new file mode 100644
index 0000000..f3cd498
--- /dev/null
+++ b/equestriadev.svg
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 268 136" style="enable-background:new 0 0 268 136;" xml:space="preserve">
+<style type="text/css">
+ .st0{opacity:0;fill:#FFFFFF;}
+ .st1{fill:#618CC7;}
+ .st2{opacity:0;}
+ .st3{fill:#FFFFFF;}
+ .st4{fill:url(#path4837_00000166650153113165948570000009148538672395535259_);}
+ .st5{fill:#8F65D0;}
+</style>
+ <rect class="st0" width="268" height="136"/>
+ <g>
+ <path class="st1" d="M139.1,90c-1.4,0-2.5-0.4-3.3-1.2c-0.8-0.8-1.2-1.9-1.2-3.2c0-1.4,0.4-2.5,1.2-3.3c0.8-0.8,1.9-1.2,3.3-1.2
+ c1.4,0,2.5,0.4,3.3,1.2c0.8,0.8,1.2,1.9,1.2,3.3c0,1.3-0.4,2.4-1.2,3.2C141.6,89.6,140.5,90,139.1,90z"/>
+ <path class="st1" d="M169.8,90c-3,0-5.3-1-7.2-3c-1.8-2-2.7-4.7-2.7-8v-8.7c0-3.4,0.9-6.1,2.7-8.1c1.8-2,4.2-3,7.2-3
+ c2.4,0,4.4,0.7,5.9,2c1.5,1.3,2.2,3.1,2.2,5.3l-1-1.1h1.1l-0.1-6.8v-8.6h4.9v39.4h-4.9v-5.7h-1l1-1.1c0,2.3-0.7,4.1-2.2,5.4
+ C174.2,89.4,172.3,90,169.8,90z M171.4,85.8c2,0,3.6-0.6,4.8-1.9c1.2-1.3,1.7-3,1.7-5.2v-8.1c0-2.2-0.6-4-1.7-5.2
+ c-1.2-1.3-2.7-1.9-4.8-1.9c-2.1,0-3.7,0.6-4.9,1.8c-1.2,1.2-1.8,3-1.8,5.3v8.1c0,2.3,0.6,4.1,1.8,5.3
+ C167.8,85.2,169.4,85.8,171.4,85.8z"/>
+ <path class="st1" d="M204,90c-2.3,0-4.4-0.5-6.1-1.4c-1.7-0.9-3.1-2.3-4.1-4c-1-1.7-1.4-3.7-1.4-6v-8.1c0-2.3,0.5-4.3,1.4-6
+ c1-1.7,2.3-3,4.1-3.9c1.7-0.9,3.8-1.4,6.1-1.4c2.3,0,4.4,0.5,6.1,1.4c1.7,0.9,3.1,2.3,4.1,3.9c1,1.7,1.4,3.7,1.4,6v5.2h-18.5v2.9
+ c0,2.3,0.6,4.1,1.8,5.4c1.2,1.2,2.9,1.9,5.1,1.9c1.9,0,3.4-0.3,4.5-1c1.2-0.7,1.9-1.7,2.1-3h4.9c-0.3,2.5-1.5,4.5-3.6,5.9
+ C209.7,89.3,207.1,90,204,90z M210.8,72.6v-2c0-2.3-0.6-4.1-1.8-5.4c-1.2-1.3-2.9-1.9-5.1-1.9c-2.2,0-3.9,0.6-5.1,1.9
+ c-1.2,1.3-1.8,3.1-1.8,5.4v1.6h14.1L210.8,72.6z"/>
+ <path class="st1" d="M233.1,89.5l-9.9-29.7h5l6.6,20c0.4,1.2,0.8,2.3,1.1,3.4c0.3,1.1,0.6,2,0.7,2.6c0.2-0.6,0.4-1.5,0.8-2.6
+ c0.3-1.1,0.7-2.2,1-3.4l6.4-20h4.9l-9.9,29.7H233.1z"/>
+</g>
+ <g>
+ <g class="st2">
+ <rect x="13" y="3.1" class="st3" width="127.9" height="127.9"/>
+ <path d="M140.9,3.1v127.9H13.1V3.1H140.9 M141,3H13v128h128V3L141,3z"/>
+ </g>
+ <g>
+
+ <linearGradient id="path4837_00000052073709690196091730000014251582116659255426_" gradientUnits="userSpaceOnUse" x1="-1256.2603" y1="-2776.9675" x2="-1178.5172" y2="-2703.2024" gradientTransform="matrix(0.75 0 0 0.75 994.4073 2142.3418)">
+ <stop offset="0" style="stop-color:#D6ACF9"/>
+ <stop offset="1" style="stop-color:#9FE3F0"/>
+ </linearGradient>
+
+ <path id="path4837_00000110442023762890412830000002005018766219440575_" style="fill:url(#path4837_00000052073709690196091730000014251582116659255426_);" d="
+ M29.4,6.5c-1,0-0.6,2.6,2.1,9.6c6.1,15.5,16.9,29.2,31.2,35.7c-12.7-4-18.4-9.2-25.6-13.6c-5.2-3.1-12.8-9.1-17.6-13.8
+ c-7.3-7.2-7.1-1.9-4.6,4.2c4,9.7,14.5,16.6,22.3,21.2C25.9,46.3,13,32.7,13.5,37.4c0.3,2.9,4.5,9,11.1,14.5
+ c4.4,3.7,9.8,7,15.4,8.8C28.4,58,21,51.7,19.8,52c-2,0.5-1.8,2.7,1.9,7.5c5.9,7.8,13,11.7,22.4,13c-4.9-0.1-8.9-0.9-11.7-1.5
+ c-10.7-2.5-2.8,3.3,0.4,5.6c3.3,2.4,7.4,4.2,11.6,5.3c5,1.4,9.7,2.4,14.3,2.7c-8.3,0.6-18.2-0.3-19.1,1.2c-1.2,2,4.1,4.4,11.2,5.7
+ c3.9,0.7,6,0.9,11.1,0.5c-5.7,1-8.4,2-8.9,2.8c-1.7,2.4,11.4,4.7,20.9,1.4C70,97.9,68.9,99,70,99.2c0.9,0.2,2.8-0.8,7.2-1.7
+ c-11.6,4.6-3,5.7,3.4,4.1c-6.5,3.4,2,3.9,5.5,3.9c-4.2,1-7,1.6-8.3,2.5c-3.5,2.5,3.8,4.3,11.9,2.3c-9.4,3.8-8.8,4.8-2.1,6.6
+ c3.6,1,7,0.3,10.2-0.1c-6.1,1.6,2.5,2.1,4.6,1.3c-3.4,1.9-8.4,1.1-8.9,2c-0.6,1.4,3.5,3.1,9,3.1c-4.7,1.7,3.7,2.3,5.5,2.1
+ c-6,2.9,2.5,3.1,9.3,1.6c4.1-0.9,8.1-2.3,9.5-3.6c10.3-0.4,13.9-15.9,14.1-16.3c0.1-0.5-5.8-2.6-11.2-5.1
+ c-4.5-2.1-9.1-5.4-12.5-8.4l-14.1-17.4c-3.1-4.8-6-9.8-8.9-14.7c-2.8-4.7-4.9-4.3-5.2-3.1c-4-3.8-11.1-6-19.6-11
+ c-6.3-3.8-13.1-9.5-20.7-18C43.1,22.5,31.9,6.5,29.4,6.5z"/>
+ <path id="path4797_00000153665292169574654090000009610625505638070163_" class="st5" d="M137.4,104.4c-2.1-0.9-4.8-1.7-7.5-3
+ c-5.4-2.5-11-6.8-14.4-10.2C107,82.4,101,71.7,94.7,61c-1.7-2.9-3.1-3.9-4.3-4.1c-0.6-0.1-1.1,0.2-1.3,0.6
+ c-0.1,0.1-0.1,0.3-0.2,0.4c-1.2-1-3-2.2-5-3.2c-2.4-1.2-4.9-2.2-6.6-1.9c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0.1-0.1,0.2-0.1,0.2
+ c0,0.1,0,0.2,0.1,0.2c0.1,0.1,0.1,0.2,0.2,0.3c0.2,0.2,0.5,0.6,0.9,0.9c0.4,0.4,1,0.8,1.7,1.3c-3.2-0.8-5.9-1.1-8.1-1.1
+ c-2.7,0-4.6,0.4-5.6,1.2c-0.1,0.1-0.2,0.2-0.2,0.4c0,0.2,0,0.3,0.1,0.4c0.1,0.2,0.3,0.4,0.6,0.5c0.5,0.3,1.4,0.7,2.5,1.1
+ c1.4,0.5,3.2,1.1,5.4,1.7c-0.3,0-0.6,0-0.9,0c-1.2,0.1-2,0.3-2.4,0.7c-0.2,0.2-0.4,0.5-0.3,0.8c0,0.3,0.2,0.6,0.3,0.8
+ c0.4,0.5,1,0.9,1.9,1.3c2.3,1,5.8,1.9,8.3,2.5c-1.4,0.2-2.3,0.5-2.9,0.7c-0.5,0.2-0.8,0.4-0.9,0.8c0,0.2,0,0.4,0.1,0.6
+ c0.1,0.2,0.2,0.3,0.4,0.4c0.6,0.5,1.7,0.9,3,1.3c1.7,0.5,3.7,0.9,5.6,1.1c-0.9,0.2-1.6,0.4-2.1,0.6c-0.5,0.2-0.8,0.4-1,0.7
+ c-0.2,0.3-0.1,0.8,0.1,1.1c0.4,0.6,1.1,1,1.9,1.1c0.8,0.1,1.6,0.1,2.4,0c1.7-0.3,3.4-0.9,4.3-1.6c0.6-0.4,1.1-1,1.4-1.6
+ c-0.6,0.3-1.2,0.6-1.8,1c-1.7,1.2-2.5,2.4-2.6,3.5c0,0.4,0,0.8,0.3,1.1s0.6,0.5,1,0.5c0.5,0.1,1.1-0.1,1.8-0.4
+ c-0.2,0.4-0.3,0.8-0.3,1.1c0,0.3,0,0.6,0.2,0.9c0.2,0.2,0.4,0.4,0.7,0.5c0.5,0.1,1.2,0,1.9-0.4c0.5-0.2,1-0.5,1.5-0.9
+ c-0.1,0.5,0,1.1,0,1.7c0.1,1,0.2,2.1,0.5,2.9c0.1,0.4,0.3,0.7,0.5,0.9c0.1,0.1,0.2,0.2,0.4,0.3c0.2,0,0.4,0,0.5-0.1
+ c0.3-0.2,0.4-0.5,0.6-0.9c0.4,2.5,1.5,5.1,2.4,6.9c0.3,0.6,0.6,1.1,0.9,1.5c0.3,0.4,0.5,0.6,0.9,0.8c0.2,0,0.4,0,0.6-0.1
+ c0,0,0.1-0.1,0.1-0.1c0.2,0.6,0.5,1.2,0.9,1.7c0.4,0.5,0.8,0.9,1.4,1.1c0.2,0.1,0.5,0.1,0.8,0.1c-0.3,0.3-0.5,0.5-0.7,0.8
+ c-0.2,0.2-0.3,0.4-0.5,0.7c-0.1,0.2-0.2,0.5-0.1,0.7c0.1,0.2,0.3,0.4,0.6,0.5c0.3,0.1,0.6,0.1,1,0.1c0.5,0,1.1-0.1,1.9-0.2
+ c-0.1,0.1-0.2,0.2-0.3,0.3c-0.4,0.3-0.6,0.6-0.7,0.9c0,0.2,0,0.3,0,0.5c0.1,0.1,0.2,0.2,0.3,0.3c0.2,0.1,0.5,0.2,0.8,0.3
+ c0.5,0.2,1.2,0.2,1.9,0.3c-0.1,0.2-0.2,0.5-0.2,0.7c0,0.4,0.2,0.9,0.4,1.2c0.6,0.7,1.6,1.3,2.8,1.8c1.2,0.5,2.5,0.9,3.7,1.1
+ c1.2,0.2,2.2,0.3,2.9,0.1c0.4-0.1,0.8-0.4,1-0.8c-0.4,0-0.8,0.1-1.2,0.1c-1.3,0.2-2.1,0.5-2.7,0.9c-0.3,0.2-0.4,0.5-0.5,0.8
+ c0,0.3,0,0.6,0.2,0.8c0.3,0.5,0.9,0.8,1.6,1.1c0.6,0.2,1.4,0.4,2.2,0.4c-0.1,0.3-0.1,0.5-0.1,0.8c0,0.4,0.2,0.7,0.5,0.9
+ c0.5,0.4,1.2,0.4,2,0.4c0.8-0.1,1.6-0.2,2.4-0.4c0.1,0,0.2,0,0.4-0.1c-0.4,0.3-0.7,0.6-0.8,0.9c-0.2,0.3-0.2,0.5-0.1,0.8
+ c0.1,0.3,0.3,0.4,0.6,0.5c0.5,0.2,1.2,0.2,2,0c0.4-0.1,0.9-0.2,1.3-0.3c-0.1,0.1-0.1,0.2-0.1,0.3c-0.2,0.5-0.1,1,0.2,1.3
+ c0.6,0.7,1.7,0.9,2.9,0.8l-0.4-0.3l0,0c0.1,0.5,0.2,1,0.5,1.4c0.2,0.3,0.6,0.6,0.9,0.7c0.7,0.2,1.5,0.2,1.9,0.1
+ c0.5-0.1,0.7-0.1,0.7-0.1s-0.3,0-0.7-0.1c-0.4,0-1.1-0.1-1.7-0.4c-0.2-0.1-0.4-0.3-0.6-0.6c-0.2-0.3-0.3-0.7-0.3-1.2
+ c0,0,0,0,0-0.3c-0.1,0-0.2,0-0.3,0c-1.1,0.1-2.1-0.2-2.4-0.6c-0.2-0.2-0.2-0.3-0.1-0.6c0.1-0.3,0.4-0.6,1-1.1l2.2-1.6l-2.5,1
+ c-0.9,0.4-1.8,0.6-2.6,0.7c-0.7,0.1-1.3,0.1-1.6,0c-0.1,0-0.1-0.1-0.1-0.1c0,0,0-0.1,0.1-0.2c0.2-0.3,0.8-0.9,1.8-1.5
+ c0.3-0.2,0.5-0.3,0.8-0.5c-0.3-0.1-0.6-0.2-1-0.2c-0.5,0-1.2,0.1-1.9,0.3c-0.8,0.2-1.6,0.3-2.3,0.4c-0.7,0.1-1.3,0-1.5-0.2
+ c-0.1-0.1-0.2-0.2-0.2-0.4c0-0.2,0-0.5,0.2-0.9c0.1-0.2,0.1-0.3,0.2-0.5c-0.2,0-0.4,0-0.6,0c-0.9,0-1.8-0.2-2.4-0.4
+ c-0.7-0.2-1.1-0.6-1.3-0.8c-0.1-0.1-0.1-0.2-0.1-0.3c0-0.1,0.1-0.2,0.2-0.3c0.3-0.3,1.1-0.6,2.3-0.7l-0.2-0.7
+ c-0.4,0.1-1.4,0.1-2.5-0.1c-1.1-0.2-2.4-0.6-3.5-1c-1.1-0.5-2-1.1-2.5-1.6c-0.2-0.3-0.3-0.5-0.3-0.8c0-0.2,0.1-0.5,0.5-0.8
+ c0.2-0.2,0.4-0.4,0.7-0.5c-0.3,0-0.6-0.1-0.9-0.1c-0.8-0.1-1.8-0.2-2.4-0.3c-0.3-0.1-0.5-0.2-0.6-0.2c0,0-0.1,0,0,0c0,0,0,0.1,0,0
+ c0,0,0.1-0.2,0.5-0.5s0.9-0.7,1.6-1.2c0.6-0.4,1.1-0.8,1.7-1.1c-0.7,0.2-1.3,0.3-2,0.5c-1.6,0.3-2.7,0.5-3.4,0.5
+ c-0.4,0-0.6,0-0.7,0s-0.1-0.1-0.1,0c0,0,0,0,0-0.1c0.1-0.1,0.2-0.3,0.4-0.5c0.3-0.4,0.9-0.9,1.5-1.5l1.3-1.2l-1.7,0.6
+ c-0.6,0.2-1.1,0.2-1.5,0.1c-0.4-0.1-0.8-0.4-1.1-0.8c-0.6-0.8-1.1-2.1-1.4-3.4l-1.6-6l0.9,6.1c0.1,0.7,0.1,1.2,0.1,1.5
+ c0,0.1-0.1,0.1,0,0.1c0,0,0.1,0,0.1,0c0,0-0.3-0.2-0.5-0.5c-0.3-0.3-0.6-0.8-0.9-1.4c-1.2-2.2-2.6-6-2.6-8.8l0-4.8l-0.7,4.8
+ c-0.1,0.9-0.3,1.5-0.4,2c-0.1,0.4-0.3,0.6-0.3,0.6c0,0,0,0,0.1,0c0,0,0,0,0,0c-0.1-0.1-0.2-0.4-0.3-0.7c-0.2-0.7-0.4-1.7-0.5-2.7
+ c-0.1-1,0-2,0.2-2.5l0.5-1.4l-1.1,1c-0.7,0.7-1.4,1.2-2.1,1.5c-0.6,0.3-1.2,0.4-1.4,0.3c-0.1,0-0.2-0.1-0.2-0.1
+ c0-0.1-0.1-0.2-0.1-0.4c0-0.4,0.3-1.2,1-2.1l1.3-1.9L93,75.8c-1.1,0.9-2.1,1.2-2.6,1.1c-0.3,0-0.4-0.1-0.5-0.3
+ c-0.1-0.1-0.2-0.3-0.1-0.6c0.1-0.7,0.7-1.9,2.3-3l-0.4-0.6c-0.8,0.6-2.4,1.2-4,1.5c-0.8,0.1-1.6,0.1-2.2,0
+ c-0.6-0.1-1.1-0.4-1.4-0.8c-0.2-0.2-0.1-0.3-0.1-0.3c0-0.1,0.3-0.3,0.7-0.4c0.9-0.3,2.4-0.7,4.7-1.2l4.7-1l-4.8,0.3
+ c-2,0.1-5.6-0.4-8.1-1.2c-1.3-0.4-2.3-0.8-2.8-1.2c-0.1-0.1-0.2-0.2-0.2-0.2c0,0,0,0,0,0c0,0,0.1-0.2,0.5-0.3
+ c0.7-0.3,2.2-0.6,4.7-1c1.2-0.2,2.4-0.3,3.6-0.4c-1.2,0-2.4-0.1-3.6-0.3c-2-0.4-7.1-1.6-10.1-2.9c-0.8-0.3-1.3-0.7-1.6-1.1
+ c-0.1-0.2-0.2-0.3-0.2-0.4s0-0.1,0.1-0.2c0.2-0.2,0.9-0.4,2-0.5c1.1-0.1,2.8,0,4.9,0.3l7.2,1l-7-1.7c-3.9-1-7.2-2-9.3-2.8
+ c-1.1-0.4-1.9-0.8-2.3-1.1c-0.2-0.1-0.4-0.3-0.4-0.3c0,0,0,0,0,0.1c0,0,0,0.1,0,0.1c0.7-0.6,2.5-1,5.2-1c2.6,0,6.1,0.5,10.3,1.7
+ l3.1,0.9l-2.8-1.6c-1.6-0.9-2.8-1.8-3.6-2.5c-0.4-0.4-0.7-0.7-0.9-0.8c-0.1-0.1-0.1-0.2-0.1-0.2c0,0,0,0,0,0.1c0,0,0,0.1-0.1,0.2
+ c-0.1,0.1-0.2,0.1-0.2,0.1l0,0l0,0c1.4-0.2,3.9,0.6,6.2,1.8c2.3,1.2,4.5,2.7,5.5,3.7l1.2,1.2l-0.6-1.6c-0.1-0.3-0.1-0.5,0-0.7
+ c0.1-0.2,0.3-0.3,0.7-0.3c0.7,0.1,2.1,0.9,3.7,3.7c6.3,10.7,12.4,21.5,21,30.3c3.4,3.5,9.1,7.8,14.6,10.4c2.7,1.3,5.4,2.2,7.5,3
+ c1.1,0.5,2.9,1.6,3.7,1.8C141.6,107,138.8,105,137.4,104.4z"/>
+ <path id="path4807_00000100341264234404668750000007897268705833958553_" class="st5" d="M88.4,58.8c1,1.1,1.8,2,2.5,2.9
+ c0.6,0.8,0.9,1.5,0.9,1.5s-0.2-0.7-0.6-1.7c-0.5-1-1.2-2.1-2.3-3.2c-2.4-2.5-5.7-4.6-9.6-6.6c-2.9-1.4-6.1-3-9.5-5
+ c-6.3-3.8-13-9.5-20.6-17.9C45.1,24.2,38.4,15,33.8,9.9c-1.1-1.3-2.1-2.3-2.9-2.9c-0.4-0.3-0.8-0.5-1.1-0.7
+ c-0.2-0.1-0.3-0.1-0.5-0.1c-0.2,0-0.4,0.1-0.5,0.3c-0.2,0.3-0.3,0.7-0.3,1.1c0,0.5,0.1,1.1,0.3,1.9c0.4,1.6,1.1,3.8,2.3,6.8
+ c5.5,14,14.8,26.5,27.1,33.7C50,46.6,43.6,41.7,37.4,38c-5.1-3.1-12.8-9.1-17.5-13.8c-1.8-1.8-3.2-2.9-4.3-3.3
+ c-0.5-0.2-1-0.3-1.4-0.2s-0.7,0.4-0.9,0.8c-0.3,0.7-0.3,1.8,0,3.1s0.8,2.8,1.4,4.3c3.5,8.4,11.6,14.6,18.8,19.1
+ c-4.4-2.1-8.8-5.2-12.3-7.7c-2.3-1.6-4.2-3-5.6-3.7c-0.7-0.3-1.2-0.6-1.7-0.4c-0.3,0.1-0.5,0.2-0.6,0.5c-0.1,0.2-0.1,0.5-0.1,0.9
+ c0.1,1.6,1.3,3.8,3.2,6.5c1.9,2.6,4.6,5.5,7.9,8.3c2.7,2.2,5.7,4.3,8.9,6.1c-2.7-1.1-5.1-2.3-7-3.3c-1.7-0.9-3.1-1.8-4.1-2.4
+ c-0.5-0.3-1-0.5-1.3-0.7c-0.4-0.2-0.6-0.3-1-0.2c-0.6,0.1-1,0.4-1.3,0.9c-0.3,0.4-0.3,1-0.1,1.7c0.3,1.3,1.3,3.1,3.2,5.5
+ c4.8,6.3,10.4,10.1,17.3,12c-2.4-0.3-4.5-0.7-6.1-1.1c-2.7-0.6-4.2-0.8-5.1-0.5c-0.2,0.1-0.4,0.2-0.5,0.3
+ c-0.1,0.2-0.2,0.4-0.2,0.6c0,0.4,0.2,0.8,0.5,1.1c1.1,1.5,3.9,3.5,5.5,4.7c3.3,2.4,7.5,4.2,11.7,5.3c3.4,0.9,6.7,1.7,9.9,2.2
+ c-2.7,0.1-5.4,0-7.8,0.1c-1.8,0-3.4,0.1-4.6,0.2c-0.6,0.1-1.1,0.2-1.5,0.3c-0.4,0.1-0.7,0.3-0.9,0.6c-0.2,0.3-0.3,0.7-0.2,1
+ c0.1,0.3,0.2,0.7,0.5,1c0.5,0.6,1.3,1.1,2.4,1.7c2.1,1,5.2,2,8.8,2.6c2.5,0.5,4.3,0.7,6.7,0.7c-0.8,0.2-1.4,0.4-2,0.6
+ c-1.5,0.5-2.3,0.9-2.7,1.5l0,0l0,0c-0.1,0.2-0.2,0.5-0.2,0.7c0,0.2,0.1,0.5,0.3,0.7c0.3,0.4,0.8,0.7,1.5,1c1.4,0.5,3.4,1,5.8,1.2
+ c4.8,0.4,11-0.1,15.9-2.3c1.2-0.5,2.3-1.2,3.3-1.9c-1.2,0.4-2.4,0.8-3.6,1.3c-2.9,1.1-4.8,2-5.8,2.7c-0.5,0.3-0.8,0.6-1,1
+ c-0.1,0.2,0,0.5,0.1,0.6s0.3,0.2,0.5,0.2l0,0l0,0c0.6,0.1,1.3-0.1,2.5-0.5c0.4-0.1,0.8-0.2,1.2-0.4c-0.9,0.5-1.6,0.9-2,1.4
+ c-0.4,0.4-0.6,0.8-0.6,1.2c0.1,0.4,0.4,0.7,0.9,0.9c0.9,0.4,2.2,0.5,3.8,0.4c1,0,2-0.1,3-0.3c-0.1,0-0.1,0.1-0.2,0.1
+ c-0.4,0.4-0.7,0.7-0.7,1.1c0,0.4,0.2,0.8,0.5,1s0.7,0.4,1.2,0.6c1.1,0.3,2.5,0.5,3.9,0.6c-2.7,0.6-4.6,1.1-5.7,1.9
+ c-0.5,0.3-0.8,0.7-1,1c-0.2,0.4-0.1,0.8,0.1,1.1c0.4,0.7,1.3,1,2.6,1.3c1.8,0.4,4.3,0.5,7.1,0.1c-0.9,0.4-1.6,0.7-2.2,1.1
+ c-1.2,0.7-1.9,1.2-2,1.9c-0.1,0.4,0.1,0.7,0.3,1c0.2,0.3,0.6,0.5,1,0.7c0.9,0.4,2.2,0.8,3.8,1.3c2.8,0.7,5.4,0.6,7.9,0.2
+ c0,0.1-0.1,0.2-0.1,0.3c0,0.2,0.1,0.4,0.2,0.5c0.1,0.1,0.2,0.2,0.4,0.2c0.3,0.1,0.7,0.2,1.1,0.2c0.6,0.1,1.3,0.1,2.1,0.1
+ c-0.8,0.1-1.5,0.2-2.2,0.3c-0.9,0.1-1.6,0.1-2.2,0.2c-0.3,0-0.6,0.1-0.8,0.2c-0.2,0.1-0.4,0.2-0.6,0.5c-0.1,0.3-0.1,0.5,0,0.8
+ c0.1,0.3,0.3,0.5,0.5,0.7c0.4,0.4,1.1,0.8,2,1.1c1.4,0.5,3.3,0.9,5.5,1c0,0,0,0,0,0c-0.1,0.1-0.3,0.2-0.3,0.4
+ c-0.1,0.2,0,0.4,0,0.5c0.2,0.3,0.4,0.4,0.8,0.6c0.3,0.1,0.7,0.2,1.2,0.3c1.2,0.2,2.6,0.3,3.8,0.4c-0.3,0.2-0.5,0.4-0.6,0.6
+ c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.2,0.5,0.4,0.6c0.4,0.3,0.9,0.4,1.7,0.5c0.7,0.1,1.6,0.1,2.6,0.1c2.5-0.1,4.9-0.4,7.2-1l0,0
+ c2.3-0.5,4.1-1.1,5.8-1.8l0,0c2.5-1,3.6-2.1,3.6-2.1s-1.2,1-3.7,1.9l0,0c-1.7,0.6-3.5,1-5.8,1.5l0,0c-2.2,0.4-4.6,0.8-7.1,0.8
+ c-1,0-1.8,0-2.5-0.1c-0.7-0.1-1.1-0.2-1.3-0.4c-0.1-0.1-0.1-0.1-0.1-0.1c0,0,0-0.1,0.1-0.2c0.2-0.2,0.8-0.6,1.7-1.1l2-0.9
+ l-2.2,0.3c-0.8,0.1-3.4,0-5.1-0.3c-0.4-0.1-0.8-0.2-1-0.3c-0.3-0.1-0.4-0.2-0.4-0.2c0,0,0,0.1,0,0.1c0,0,0,0,0.1-0.1
+ c0.2-0.1,0.5-0.3,1.1-0.5l1.8-0.7l-2,0c-2.7,0-5.1-0.4-6.7-1c-0.8-0.3-1.4-0.6-1.7-0.9c-0.2-0.1-0.3-0.3-0.3-0.4s0-0.2,0-0.3
+ c0,0,0,0,0.2-0.1c0.1-0.1,0.4-0.1,0.6-0.1c0.6-0.1,1.3-0.1,2.2-0.2c1.8-0.1,3.9-0.4,5.7-1.4l3.9-2.2l-4.2,1.6
+ c-0.5,0.2-1.4,0.3-2.4,0.4c-1,0-2.1,0-2.9-0.1c-0.4,0-0.7-0.1-0.9-0.2c-0.1,0-0.2-0.1-0.2-0.1c0,0,0,0,0,0.1c0,0.1,0,0.1,0,0
+ s0.1-0.1,0.3-0.2c0.3-0.1,0.8-0.3,1.6-0.5l5.7-1.5l-5.9,0.8c-3.2,0.5-6.6,1.1-10.1,0.1c-1.6-0.4-2.9-0.8-3.7-1.2
+ c-0.4-0.2-0.7-0.4-0.8-0.5s-0.2-0.2-0.1-0.4c0-0.2,0.5-0.8,1.7-1.4c1.1-0.6,2.9-1.4,5.2-2.3l4.8-1.9l-5,1.2c-4,1-7.8,1-10.2,0.5
+ c-1.2-0.2-1.9-0.7-2.1-1c-0.1-0.2-0.1-0.3,0-0.5c0.1-0.2,0.3-0.5,0.7-0.8c1.1-0.8,3.9-1.4,8.1-2.4c1.4-0.3,2.9-0.7,4.3-1
+ c-1.4,0.2-2.9,0.3-4.4,0.3c-1.7,0-4.8-0.1-6.4-0.7c-0.4-0.1-0.7-0.3-0.9-0.4c-0.2-0.1-0.2-0.2-0.2-0.4c0-0.1,0.1-0.4,0.5-0.7
+ c0.4-0.3,0.9-0.7,1.7-1.1l2.7-1.4l-2.9,0.7c-1.6,0.4-3.3,0.6-4.8,0.7s-2.8-0.1-3.4-0.4c-0.3-0.1-0.4-0.3-0.4-0.4
+ c0-0.1,0-0.3,0.4-0.6c0.6-0.6,2.3-1.6,5.2-2.7c1.2-0.5,2.3-0.9,3.5-1.2c-1.2,0.1-2.5,0.3-3.7,0.6c-2.2,0.4-3.8,0.9-4.9,1.2
+ c-1.1,0.3-1.8,0.5-2.1,0.4c-0.1,0-0.2-0.1-0.2-0.1s0,0.1,0,0.1c0,0,0.2-0.3,0.7-0.6c0.9-0.6,2.8-1.5,5.6-2.6L76,95.1
+ c-4.7,2.1-10.8,2.6-15.5,2.3c-2.3-0.2-4.3-0.6-5.6-1.1c-0.6-0.3-1.1-0.5-1.3-0.8c-0.1-0.1-0.1-0.2-0.1-0.3c0-0.1,0-0.1,0.1-0.2
+ c0.2-0.3,0.9-0.7,2.3-1.2c1.4-0.5,3.5-1,6.4-1.5l7.4-1.3l-7.5,0.6c-5.1,0.4-7.2,0.2-11-0.5c-3.5-0.6-6.6-1.6-8.6-2.5
+ c-1-0.5-1.8-1-2.1-1.5c-0.2-0.2-0.3-0.4-0.3-0.6c0-0.2,0-0.3,0.1-0.5c0,0,0.2-0.2,0.5-0.3c0.3-0.1,0.8-0.2,1.4-0.3
+ c1.1-0.1,2.7-0.2,4.5-0.2c3.6,0,8.2,0,12.3-0.3c2.1-0.1,4.1-0.4,6.2-0.7c-2.1,0.2-4.1,0.2-6.2,0c-4.6-0.3-9.3-1.3-14.3-2.7
+ c-4.2-1.1-8.3-2.9-11.5-5.2c-1.6-1.2-4.4-3.2-5.3-4.5c-0.2-0.3-0.3-0.6-0.3-0.7c0-0.1,0-0.1,0-0.1c0,0,0.1-0.1,0.2-0.1
+ c0.5-0.2,2.1-0.1,4.7,0.5c2.8,0.7,6.7,1.4,11.7,1.5c2.5,0.1,5,0,7.4-0.3c-2.5,0-4.9-0.1-7.4-0.4c-9.3-1.3-16.3-5.2-22.2-12.8
+ c-1.8-2.4-2.8-4.1-3.1-5.3c-0.1-0.6-0.1-0.9,0.1-1.2c0.1-0.2,0.4-0.4,0.9-0.5c0,0,0.2,0,0.5,0.2c0.3,0.1,0.7,0.4,1.3,0.7
+ c1,0.6,2.4,1.4,4.2,2.4c3.5,1.9,8.2,4.2,14,5.6l9,2.2L40,60.4c-5.5-1.8-10.8-5.1-15.2-8.8c-3.3-2.7-5.9-5.6-7.8-8.2
+ c-1.9-2.6-3-4.8-3.1-6.1c0-0.3,0-0.4,0-0.5c0-0.1,0-0.1,0.1-0.1c0.1,0,0.6,0.1,1.3,0.4c1.3,0.6,3.2,2,5.5,3.6
+ c4.6,3.3,10.7,7.6,16.5,9.4c0.8,0.2,1.7,0.5,2.5,0.6c-0.7-0.4-1.5-0.8-2.2-1.3c-7.8-4.5-18.2-11.4-22.1-21c-0.6-1.5-1.1-3-1.4-4.2
+ c-0.3-1.2-0.3-2.2-0.1-2.6c0.1-0.2,0.2-0.3,0.4-0.4c0.2,0,0.5,0,0.9,0.2c0.9,0.4,2.2,1.4,4,3.2c4.8,4.7,12.5,10.7,17.7,13.9
+ C44.2,42.9,52,49,62.7,52.2c1.7,0.5,3.4,0.9,5.1,1.2c-1.6-0.5-3.3-1.2-4.8-1.9C48.7,45,38,31.4,31.9,16c-1.2-3-1.9-5.2-2.3-6.7
+ c-0.2-0.8-0.3-1.3-0.3-1.7s0.1-0.6,0.1-0.7c0,0,0,0,0,0c0,0,0.1,0,0.2,0c0.2,0.1,0.5,0.3,0.9,0.5c0.7,0.6,1.7,1.6,2.8,2.9
+ c4.5,5.1,11.2,14.3,15.3,18.9c7.6,8.5,14.4,14.3,20.7,18.1c3.5,2.1,6.7,3.7,9.5,5.1C82.8,54.3,86,56.4,88.4,58.8L88.4,58.8z"/>
+ <path id="path4814_00000008846658947637959000000002656766840971361432_" class="st5" d="M59.9,54.7c0.2,0,0.4,0,0.6,0
+ c1.2,0.1,2.4,0.2,3.3,0.2s1.5,0.1,1.5,0.1s-0.6-0.2-1.4-0.4c-0.9-0.2-2.1-0.5-3.3-0.6c-0.2,0-0.4,0-0.7,0c-0.4,0-0.8,0-1,0.3
+ c-0.1,0.1-0.1,0.4-0.1,0.5s0.1,0.3,0.3,0.5c0.2,0.2,0.4,0.4,0.7,0.7c-1.4-0.5-2.5-0.9-3.3-1c-0.7-0.1-1.3-0.2-1.7-0.1
+ c-0.4,0.1-0.8,0.2-1,0.6c-0.1,0.3-0.1,0.8,0.1,1.2c0.2,0.4,0.5,0.9,1.1,1.4c0.7,0.7,1.8,1.5,3.3,2.4c-1-0.2-1.9-0.5-2.7-0.9
+ c-2.4-1.1-4.1-1.6-5.1-1.5c-0.5,0-1,0.2-1.3,0.5c-0.3,0.3-0.3,0.8-0.3,1.2c0.1,0.9,0.7,1.9,1.5,3c0.8,1.1,1.9,2.3,3,3.3
+ c3,2.8,6.7,4.6,10.2,5.9c-2.4-0.5-4.9-1.1-7.7-1.2c-0.7,0-1.2,0-1.7,0.2c-0.4,0.2-0.8,0.4-1,0.8c-0.4,0.7-0.1,1.5,0.5,2.4
+ c1.2,1.7,3.7,3.6,6.9,4.8c5.6,2.1,9.1,2.5,12.9,2.6c-1.9,0.2-3.4,0.3-4.7,0.4c-1.1,0.1-2,0.1-2.7,0.3c-0.7,0.1-1.2,0.3-1.5,0.7
+ c-0.2,0.3-0.3,0.8-0.1,1.1c0.1,0.4,0.4,0.7,0.8,1c0.7,0.6,1.8,1.1,3.2,1.6c2.3,0.7,5.2,1.2,7.9,1.1c-0.4,0.2-0.7,0.5-0.9,0.7
+ c-0.5,0.5-0.7,1-0.5,1.5c0.2,0.5,0.7,0.8,1.2,1c0.6,0.2,1.3,0.3,2.1,0.4c3.3,0.2,8.3-0.7,10.7-3.4c0.5-0.5,0.8-1.1,1.1-1.7
+ c-0.5,0.4-1.1,0.8-1.6,1.2c-1.1,0.9-1.7,1.6-2,2.2c-0.1,0.3-0.2,0.6-0.2,0.9c0.1,0.3,0.3,0.5,0.5,0.6c0.5,0.2,1.1,0.2,1.8,0.1
+ c-0.5,0.4-1,0.8-1.4,1.1c-0.9,0.8-1.4,1.4-1.5,2.1c0,0.3,0.1,0.7,0.4,0.9c0.3,0.2,0.7,0.3,1.2,0.4c0.5,0.1,1.2,0.1,2,0.1
+ c-1.3,0.6-2.1,1.1-2.6,1.6c-0.4,0.4-0.5,0.8-0.4,1.3c0.1,0.4,0.5,0.7,0.9,0.9c0.9,0.4,2.2,0.7,3.8,0.7c1,0,2,0,3.1-0.1
+ c-0.2,0.1-0.5,0.3-0.7,0.4c-0.3,0.2-0.6,0.4-0.8,0.7c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.2,0.5,0.4,0.7c0.2,0.1,0.5,0.2,0.9,0.2
+ c0.1,0,0.3,0,0.4,0c-0.5,0.3-1,0.5-1.3,0.8c-0.4,0.3-0.7,0.6-0.9,0.9c-0.2,0.3-0.2,0.7,0,1c0.2,0.3,0.5,0.5,0.8,0.7
+ c0.4,0.2,0.9,0.3,1.5,0.5c0.9,0.2,2,0.4,3.5,0.5c-0.2,0.1-0.4,0.2-0.5,0.3c-0.5,0.3-0.8,0.6-0.9,1c-0.1,0.4,0.1,0.8,0.4,1.1
+ c0.3,0.3,0.7,0.6,1.2,0.8c2.6,1.3,4.1,1.9,8.3,1.9c-0.1,0.1-0.2,0.1-0.3,0.2c-0.6,0.3-0.9,0.7-1,1.1c-0.1,0.4,0.2,0.9,0.5,1.1
+ c0.4,0.3,0.8,0.5,1.4,0.8c1.8,0.7,4.5,1.2,6.4,1.4c-0.2,0.1-0.5,0.3-0.6,0.4c-0.4,0.4-0.7,0.8-0.7,1.2c0,0.4,0.3,0.8,0.6,1.1
+ s0.8,0.5,1.4,0.8c1.8,0.7,4.4,1,6.6,0.8c0,0.1-0.1,0.1-0.1,0.2c-0.1,0.2,0,0.4,0.1,0.5c0.2,0.3,0.5,0.4,0.9,0.5
+ c0.4,0.1,0.8,0.1,1.4,0.1c2.1,0,4.1-0.3,5.7-0.7c1.1-0.3,1.9-0.5,2.6-0.9c1.1-0.5,1.6-1.1,1.6-1.1s-0.5,0.5-1.6,0.9
+ c-0.8,0.2-1.6,0.4-2.6,0.6c-1.7,0.3-3.6,0.5-5.6,0.5c-0.5,0-1,0-1.3-0.1c-0.3-0.1-0.5-0.2-0.4-0.2c0,0,0,0.1,0,0.1s0-0.1,0.1-0.1
+ c0.2-0.2,0.6-0.4,1.2-0.7l4.4-2l-4.7,1.4c-2.3,0.7-5.9,0.4-8-0.4c-0.5-0.2-0.9-0.4-1.2-0.6s-0.4-0.4-0.4-0.6
+ c0-0.2,0.1-0.4,0.4-0.7c0.3-0.3,0.9-0.6,1.8-0.9l1.8-0.7h-1.9c-1.7,0-5.5-0.6-7.6-1.4c-0.5-0.2-1-0.4-1.2-0.7
+ c-0.3-0.2-0.3-0.3-0.3-0.4c0-0.1,0.2-0.3,0.7-0.6c0.5-0.3,1.3-0.6,2.4-0.9l3.1-0.8l-3.2,0.1c-5.9,0.3-7.3-0.2-10.3-1.8
+ c-0.4-0.2-0.8-0.5-1-0.7c-0.2-0.2-0.2-0.3-0.2-0.5c0-0.1,0.2-0.3,0.6-0.6c0.4-0.2,1-0.5,1.8-0.7c0.8-0.2,1.6-0.4,2.4-0.5
+ c-0.8,0-1.7-0.1-2.5-0.2c-2.1-0.2-3.8-0.4-4.9-0.7c-0.6-0.1-1-0.3-1.3-0.4c-0.3-0.1-0.5-0.3-0.5-0.4c0-0.1-0.1-0.1,0-0.3
+ c0.1-0.2,0.3-0.4,0.7-0.6c0.7-0.5,2-1.1,3.7-1.9l4.4-1.9l-4.6,1.2c-1.4,0.4-2.4,0.5-3,0.5c-0.3,0-0.5-0.1-0.6-0.1s0,0,0,0
+ c0,0,0-0.1,0.2-0.3c0.1-0.2,0.4-0.3,0.6-0.6c0.6-0.4,1.4-0.9,2.6-1.4l3.1-1.3l-3.3,0.7c-1.8,0.4-3.6,0.5-5.1,0.5
+ c-1.6,0-2.9-0.3-3.5-0.6c-0.3-0.2-0.5-0.4-0.5-0.5s0-0.3,0.3-0.6c0.5-0.6,2-1.4,4.6-2.4l3.1-1.1L91.6,95c-2,0.3-3.5,0.3-4.3,0.2
+ c-0.4-0.1-0.7-0.2-0.9-0.3c-0.1-0.1-0.2-0.1-0.1-0.3c0-0.3,0.4-0.9,1.2-1.6s2-1.6,3.5-2.6l5.5-3.7l-5.9,3.1
+ c-0.8,0.4-1.6,0.7-2.3,0.9c-0.7,0.1-1.2,0.1-1.4,0c-0.1,0-0.1-0.1-0.1-0.1c0-0.1,0-0.2,0.1-0.4c0.2-0.4,0.8-1.1,1.9-2l-0.5-0.5
+ c-2.1,2.4-7,3.4-10.1,3.1c-0.8-0.1-1.5-0.2-2-0.4c-0.5-0.2-0.8-0.4-0.8-0.6c-0.1-0.2,0-0.4,0.3-0.8s1.1-0.9,2.1-1.4l2-1l-2.2,0.3
+ c-3.1,0.5-6.7,0-9.3-0.9c-1.3-0.4-2.4-1-3-1.5c-0.3-0.3-0.5-0.5-0.6-0.7s-0.1-0.3,0.1-0.5c0.1-0.1,0.4-0.3,1-0.4
+ c0.6-0.1,1.5-0.2,2.6-0.2c2.2-0.1,5.3-0.3,9.2-1.1c1-0.2,2-0.4,3-0.7c-1,0-2,0-3.1,0c-5.9,0-9.5,0.3-17.1-2.6
+ c-3-1.1-5.5-3-6.5-4.5c-0.5-0.7-0.6-1.3-0.4-1.7c0.1-0.2,0.2-0.3,0.6-0.4c0.3-0.1,0.8-0.2,1.4-0.1c4.4,0.2,7.8,1.5,11.9,1.8
+ c0.9,0.1,1.9,0.1,2.8,0.1c-0.9-0.3-1.8-0.5-2.7-0.8c-4.3-1.3-9.8-3.3-13.9-7.1c-1.1-1-2.1-2.2-2.9-3.2c-0.8-1.1-1.3-2.1-1.4-2.7
+ c0-0.3,0-0.5,0.1-0.6c0.1-0.1,0.3-0.2,0.7-0.2c0.8,0,2.4,0.4,4.8,1.5c1.6,0.7,3.5,1,5.4,1.5l3.1,0.8l-2.9-1.4
+ c-2.7-1.4-4.5-2.6-5.4-3.5c-0.5-0.5-0.8-0.9-0.9-1.2c-0.1-0.3-0.1-0.5-0.1-0.6l0,0l0,0c0-0.1,0.1-0.1,0.4-0.2c0.3,0,0.8,0,1.5,0.1
+ c1.3,0.3,3.3,1,6.1,2.2l3.9,1.8l-3.6-2.4c-1.7-1.1-2.7-1.9-3-2.3c-0.1-0.1-0.1-0.2-0.1-0.2c0,0,0,0.1,0,0.1
+ C59.4,54.8,59.5,54.7,59.9,54.7L59.9,54.7z"/>
+ </g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+ <g>
+</g>
+</svg>
diff --git a/includes/PHPMailer/LICENSE b/includes/PHPMailer/LICENSE
index f166cc5..cc8ff70 100644
--- a/includes/PHPMailer/LICENSE
+++ b/includes/PHPMailer/LICENSE
@@ -34,7 +34,7 @@ these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
+rights. These restrictions html to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
diff --git a/includes/functions.php b/includes/functions.php
index 5129837..d741da6 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -302,7 +302,7 @@ function listArticles() {
?>
<div class="list-group">
<?php foreach ($articles as $person): ?>
- <a href="/articles/<?= explode(".", $person)[0] ?>" class="list-group-item-ellipsis list-group-item list-group-item-action <?= $_SERVER['REQUEST_URI'] === "/articles/" . explode(".", $person)[0] ? "list-group-item-primary" : "" ?>"><?= getNameFromId(explode(".", $person)[0]) ?></a>
+ <a href="/articles/<?= explode(".", $person)[0] ?>" class="list-group-item-ellipsis list-group-item list-group-item-action <?= explode("&", explode("?", $_SERVER['REQUEST_URI'])[0])[0] === "/articles/" . explode(".", $person)[0] ? "list-group-item-primary" : "" ?>"><?= getNameFromId(explode(".", $person)[0]) ?></a>
<?php endforeach; ?>
</div>
<?php }
@@ -318,7 +318,7 @@ function listAlbums() {
?>
<div class="list-group">
<?php foreach ($articles as $person): $data = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gallery/" . $person)), true); ?>
- <a href="/gallery/<?= explode(".", $person)[0] ?>" class="list-group-item-ellipsis list-group-item list-group-item-action <?= $_SERVER['REQUEST_URI'] === "/gallery/" . explode(".", $person)[0] ? "list-group-item-primary" : "" ?>"><?= getNameFromId(explode(".", $person)[0]) ?></a>
+ <a href="/gallery/<?= explode(".", $person)[0] ?>" class="list-group-item-ellipsis list-group-item list-group-item-action <?= explode("&", explode("?", $_SERVER['REQUEST_URI'])[0])[0] === "/gallery/" . explode(".", $person)[0] ? "list-group-item-primary" : "" ?>"><?= getNameFromId(explode(".", $person)[0]) ?></a>
<?php endforeach; ?>
</div>
<?php }
@@ -340,7 +340,7 @@ function listPeople() {
?>
<div class="list-group">
<?php foreach ($articles as $person): $data = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $person)), true); ?>
- <a href="/people/<?= explode(".", $person)[0] ?>" class="list-group-item-ellipsis list-group-item list-group-item-action <?= $_SERVER['REQUEST_URI'] === "/people/" . explode(".", $person)[0] ? "list-group-item-primary" : "" ?>"><?= $data["first_name"] . " " . $data["last_name"] ?></a>
+ <a href="/people/<?= explode(".", $person)[0] ?>" class="list-group-item-ellipsis list-group-item list-group-item-action <?= explode("&", explode("?", $_SERVER['REQUEST_URI'])[0])[0] === "/people/" . explode(".", $person)[0] ? "list-group-item-primary" : "" ?>"><?= $data["first_name"] . " " . $data["last_name"] ?></a>
<?php endforeach; ?>
</div>
<?php }
diff --git a/includes/translation.php b/includes/translation.php
new file mode 100644
index 0000000..4e005c5
--- /dev/null
+++ b/includes/translation.php
@@ -0,0 +1,67 @@
+<?php
+
+function showTranslationBox($id): void {
+ $data = json_decode(file_get_contents(getFileFromId($id)), true);
+ if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/translations")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/translations");
+
+ if ($data["language"] === l("lang__name") || !isset($data["contents"]) || $data["contents"] === "") return;
+
+ $hasTranslation = false;
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/translations/" . $id . ".json")) {
+ $translationData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/translations/" . $id . ".json"), true);
+
+ if (md5(file_get_contents(getFileFromId($id))) === $translationData["md5"]) {
+ if (isset($translationData["translations"][l("lang__name")])) {
+ $hasTranslation = true;
+ }
+ }
+ }
+
+ if ($hasTranslation && isset($translationData)) { ?>
+ <?php if (isset($_GET["t-orig"])): ?>
+ <div class="alert alert-secondary">
+ <?= str_replace("%2", locale_get_display_language(l("lang__name"), l("lang__name")), str_replace("%1", locale_get_display_language($data["language"], l("lang__name")), l("lang_translation_available"))) ?> · <a href="<?= explode("&", explode("?", $_SERVER['REQUEST_URI'])[0])[0] ?>"><?= l("lang_translation_translated") ?></a>
+ </div>
+ <?php else: ?>
+ <div class="alert alert-secondary">
+ <?= str_replace("%3", timeAgo($translationData["date"] / 1000), str_replace("%2", locale_get_display_language(l("lang__name"), l("lang__name")), str_replace("%1", locale_get_display_language($data["language"], l("lang__name")), l("lang_translation_notice")))) ?> · <a href="<?= $_SERVER['REQUEST_URI'] ?>?t-orig"><?= l("lang_translation_original") ?></a>
+ </div>
+ <?php endif; ?>
+ <?php } else { ?>
+ <div class="alert alert-secondary">
+ <?= str_replace("%2", locale_get_display_language(l("lang__name"), l("lang__name")), str_replace("%1", locale_get_display_language($data["language"], l("lang__name")), l("lang_translation_none"))) ?>
+ </div>
+ <?php }
+}
+
+function getTranslation($id, $key) {
+ $data = json_decode(file_get_contents(getFileFromId($id)), true);
+ if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/translations")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/translations");
+
+ if ($data["language"] === l("lang__name") || !isset($data["contents"]) || $data["contents"] === "") {
+ return $data[$key];
+ }
+
+ $hasTranslation = false;
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/translations/" . $id . ".json")) {
+ $translationData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/translations/" . $id . ".json"), true);
+
+ if (md5(file_get_contents(getFileFromId($id))) === $translationData["md5"]) {
+ if (isset($translationData["translations"][l("lang__name")])) {
+ $hasTranslation = true;
+ }
+ }
+ }
+
+ if (isset($_GET["t-orig"])) {
+ $hasTranslation = false;
+ }
+
+ if ($hasTranslation && isset($translationData) && isset($translationData["translations"][l("lang__name")][$key])) {
+ return $translationData["translations"][l("lang__name")][$key];
+ } else {
+ return $data[$key];
+ }
+} \ No newline at end of file
diff --git a/includes/translator/html.js b/includes/translator/html.js
new file mode 100644
index 0000000..9b31594
--- /dev/null
+++ b/includes/translator/html.js
@@ -0,0 +1,64 @@
+const xml2js = require('xml2js');
+
+async function translate(text) {
+ console.log(text);
+ return await require('./translate.js')(text, language, translateTo);
+}
+
+async function replace(item) {
+ if (item instanceof Array) {
+ let list = [];
+
+ for (let i of item) {
+ if (typeof i === "string") {
+ list.push(await translate(i));
+ } else if (typeof i === "object") {
+ list.push(dict_reverse(await replace(i)));
+ } else {
+ list.push(i);
+ }
+ }
+
+ return list;
+ } else if (typeof item === "object") {
+ if (item["_"]) {
+ item["_"] = await translate(item["_"]);
+ }
+
+ for (let key of Object.keys(item)) {
+ if (key === "_" || key === "$") continue;
+ item[key] = await replace(item[key]);
+ }
+
+ return item;
+ } else {
+ return item;
+ }
+}
+
+function dict_reverse(obj) {
+ new_obj= {}
+ rev_obj = Object.keys(obj).reverse();
+ rev_obj.forEach(function(i) {
+ new_obj[i] = obj[i];
+ })
+ return new_obj;
+}
+
+module.exports = async (str, source, target) => {
+ global.language = source;
+ global.translateTo = target;
+ global.parsed = await xml2js.parseStringPromise(str, {
+ preserveChildrenOrder: true,
+ tagNameProcessors: [
+ (name) => {
+ return name + "---" + require('crypto').randomBytes(4).toString("hex");
+ }
+ ]
+ });
+
+ await replace(parsed);
+
+ const builder = new xml2js.Builder({ headless: true });
+ return builder.buildObject(parsed);
+} \ No newline at end of file
diff --git a/includes/translator/index.js b/includes/translator/index.js
new file mode 100644
index 0000000..2663010
--- /dev/null
+++ b/includes/translator/index.js
@@ -0,0 +1,115 @@
+const fs = require('fs');
+const crypto = require('crypto');
+
+if (!fs.existsSync("../data/translations")) fs.mkdirSync("../data/translations");
+
+let articles = fs.readdirSync("../data/articles");
+let albums = fs.readdirSync("../data/gallery");
+let people = fs.readdirSync("../data/people");
+let profiles = fs.readdirSync("../data/profiles");
+
+(async () => {
+ for (let article of articles) {
+ let data = JSON.parse(fs.readFileSync("../data/articles/" + article).toString());
+ let text = data['contents'];
+
+ let res = {
+ md5: crypto.createHash("md5").update(fs.readFileSync("../data/articles/" + article).toString()).digest("hex"),
+ date: new Date().getTime(),
+ translations: {}
+ }
+
+ if (text && text.trim() !== "") {
+ res["translations"][data['language'] === "en" ? "fr" : "en"] = {};
+ res["translations"][data['language'] === "en" ? "fr" : "en"]["contents"] = (await require('./html')("<div>" + text.replace(/<(img|col|br)( ([^>]*)|)>/gm, "<$1$2 />").replace(/&(?![a-z]+;)/gm, "&amp;") + "</div>", data['language'], data['language'] === "en" ? "fr" : "en")).replace(/<([^-]+)---[a-f\d]{8}(( [^>]+)|)>/gm, "<$1$2>");
+ }
+
+ fs.writeFileSync("../data/translations/" + article, JSON.stringify(res));
+ }
+
+ for (let article of albums) {
+ let data = JSON.parse(fs.readFileSync("../data/albums/" + article).toString());
+ let text = data['contents'];
+
+ let res = {
+ md5: crypto.createHash("md5").update(fs.readFileSync("../data/albums/" + article).toString()).digest("hex"),
+ date: new Date().getTime(),
+ translations: {}
+ }
+
+ if (text && text.trim() !== "") {
+ res["translations"][data['language'] === "en" ? "fr" : "en"] = {};
+ res["translations"][data['language'] === "en" ? "fr" : "en"]["contents"] = (await require('./html')("<div>" + text.replace(/<(img|col|br)( ([^>]*)|)>/gm, "<$1$2 />").replace(/&(?![a-z]+;)/gm, "&amp;") + "</div>", data['language'], data['language'] === "en" ? "fr" : "en")).replace(/<([^-]+)---[a-f\d]{8}(( [^>]+)|)>/gm, "<$1$2>");
+ }
+
+ fs.writeFileSync("../data/translations/" + article, JSON.stringify(res));
+ }
+
+ for (let article of profiles) {
+ let data = JSON.parse(fs.readFileSync("../data/profiles/" + article).toString());
+ let text = data['contents'];
+
+ let res = {
+ md5: crypto.createHash("md5").update(fs.readFileSync("../data/profiles/" + article).toString()).digest("hex"),
+ date: new Date().getTime(),
+ translations: {}
+ }
+
+ if (text && text.trim() !== "") {
+ res["translations"][data['language'] === "en" ? "fr" : "en"] = {};
+ res["translations"][data['language'] === "en" ? "fr" : "en"]["contents"] = (await require('./html')("<div>" + text.replace(/<(img|col|br)( ([^>]*)|)>/gm, "<$1$2 />").replace(/&(?![a-z]+;)/gm, "&amp;") + "</div>", data['language'], data['language'] === "en" ? "fr" : "en")).replace(/<([^-]+)---[a-f\d]{8}(( [^>]+)|)>/gm, "<$1$2>");
+ }
+
+ fs.writeFileSync("../data/translations/" + article, JSON.stringify(res));
+ }
+
+ for (let article of people) {
+ let data = JSON.parse(fs.readFileSync("../data/people/" + article).toString());
+
+ let res = {
+ md5: crypto.createHash("md5").update(fs.readFileSync("../data/people/" + article).toString()).digest("hex"),
+ date: new Date().getTime(),
+ translations: {}
+ }
+
+ if (data['contents'] && data['contents'].trim() !== "") {
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]) res["translations"][data['language'] === "en" ? "fr" : "en"] = {};
+ res["translations"][data['language'] === "en" ? "fr" : "en"]["contents"] = (await require('./html')("<div>" + data['contents'].replace(/<(img|col|br)( ([^>]*)|)>/gm, "<$1$2 />").replace(/&(?![a-z]+;)/gm, "&amp;") + "</div>", data['language'], data['language'] === "en" ? "fr" : "en")).replace(/<([^-]+)---[a-f\d]{8}(( [^>]+)|)>/gm, "<$1$2>");
+ }
+
+ if (data['diplomas'] && data['diplomas'].length > 0) {
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]) res["translations"][data['language'] === "en" ? "fr" : "en"] = {};
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]['diplomas']) res["translations"][data['language'] === "en" ? "fr" : "en"]['diplomas'] = [];
+
+ for (let diploma of data['diplomas']) {
+ res["translations"][data['language'] === "en" ? "fr" : "en"]["diplomas"].push(await require('./translate')(diploma, data['language'], data['language'] === "en" ? "fr" : "en"));
+ }
+ }
+
+ if (data['jobs'] && data['jobs']['current'] && data['jobs']['current'].trim() !== "") {
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]) res["translations"][data['language'] === "en" ? "fr" : "en"] = {};
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]['jobs']) res["translations"][data['language'] === "en" ? "fr" : "en"]['jobs'] = {};
+ res["translations"][data['language'] === "en" ? "fr" : "en"]["jobs"]["current"] = await require('./translate')(data['jobs']['current'], data['language'], data['language'] === "en" ? "fr" : "en");
+ }
+
+ if (data['jobs'] && data['jobs']['position'] && data['jobs']['position'].trim() !== "") {
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]) res["translations"][data['language'] === "en" ? "fr" : "en"] = {};
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]['jobs']) res["translations"][data['language'] === "en" ? "fr" : "en"]['jobs'] = {};
+ res["translations"][data['language'] === "en" ? "fr" : "en"]["jobs"]["position"] = await require('./translate')(data['jobs']['position'], data['language'], data['language'] === "en" ? "fr" : "en");
+ }
+
+ if (data['jobs'] && data['jobs']['place'] && data['jobs']['place'].trim() !== "") {
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]) res["translations"][data['language'] === "en" ? "fr" : "en"] = {};
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]['jobs']) res["translations"][data['language'] === "en" ? "fr" : "en"]['jobs'] = {};
+ res["translations"][data['language'] === "en" ? "fr" : "en"]["jobs"]["place"] = await require('./translate')(data['jobs']['place'], data['language'], data['language'] === "en" ? "fr" : "en");
+ }
+
+ if (data['jobs'] && data['jobs']['next'] && data['jobs']['next'].trim() !== "") {
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]) res["translations"][data['language'] === "en" ? "fr" : "en"] = {};
+ if (!res["translations"][data['language'] === "en" ? "fr" : "en"]['jobs']) res["translations"][data['language'] === "en" ? "fr" : "en"]['jobs'] = {};
+ res["translations"][data['language'] === "en" ? "fr" : "en"]["jobs"]["next"] = await require('./translate')(data['jobs']['next'], data['language'], data['language'] === "en" ? "fr" : "en");
+ }
+
+ fs.writeFileSync("../data/translations/" + article, JSON.stringify(res));
+ }
+})() \ No newline at end of file
diff --git a/includes/translator/node_modules/.package-lock.json b/includes/translator/node_modules/.package-lock.json
new file mode 100644
index 0000000..af3a13d
--- /dev/null
+++ b/includes/translator/node_modules/.package-lock.json
@@ -0,0 +1,402 @@
+{
+ "name": "translator",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "node_modules/@sindresorhus/is": {
+ "version": "0.14.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
+ "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@szmarczak/http-timer": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz",
+ "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==",
+ "dependencies": {
+ "defer-to-connect": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/cacheable-request": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz",
+ "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==",
+ "dependencies": {
+ "clone-response": "^1.0.2",
+ "get-stream": "^5.1.0",
+ "http-cache-semantics": "^4.0.0",
+ "keyv": "^3.0.0",
+ "lowercase-keys": "^2.0.0",
+ "normalize-url": "^4.1.0",
+ "responselike": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cacheable-request/node_modules/get-stream": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
+ "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
+ "dependencies": {
+ "pump": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cacheable-request/node_modules/lowercase-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
+ "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/clone-response": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz",
+ "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==",
+ "dependencies": {
+ "mimic-response": "^1.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/configstore": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/configstore/-/configstore-4.0.0.tgz",
+ "integrity": "sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ==",
+ "dependencies": {
+ "dot-prop": "^4.1.0",
+ "graceful-fs": "^4.1.2",
+ "make-dir": "^1.0.0",
+ "unique-string": "^1.0.0",
+ "write-file-atomic": "^2.0.0",
+ "xdg-basedir": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/crypto-random-string": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz",
+ "integrity": "sha512-GsVpkFPlycH7/fRR7Dhcmnoii54gV1nz7y4CWyeFS14N+JVBBhY+r8amRHE4BwSYal7BPTDp8isvAlCxyFt3Hg==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/decompress-response": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz",
+ "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==",
+ "dependencies": {
+ "mimic-response": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/defer-to-connect": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz",
+ "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ=="
+ },
+ "node_modules/dot-prop": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz",
+ "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==",
+ "dependencies": {
+ "is-obj": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/duplexer3": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz",
+ "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA=="
+ },
+ "node_modules/end-of-stream": {
+ "version": "1.4.4",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
+ "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
+ "dependencies": {
+ "once": "^1.4.0"
+ }
+ },
+ "node_modules/get-stream": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+ "dependencies": {
+ "pump": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/got": {
+ "version": "9.6.0",
+ "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz",
+ "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==",
+ "dependencies": {
+ "@sindresorhus/is": "^0.14.0",
+ "@szmarczak/http-timer": "^1.1.2",
+ "cacheable-request": "^6.0.0",
+ "decompress-response": "^3.3.0",
+ "duplexer3": "^0.1.4",
+ "get-stream": "^4.1.0",
+ "lowercase-keys": "^1.0.1",
+ "mimic-response": "^1.0.1",
+ "p-cancelable": "^1.0.0",
+ "to-readable-stream": "^1.0.0",
+ "url-parse-lax": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
+ },
+ "node_modules/http-cache-semantics": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz",
+ "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ=="
+ },
+ "node_modules/imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
+ "engines": {
+ "node": ">=0.8.19"
+ }
+ },
+ "node_modules/is-obj": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
+ "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/json-buffer": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
+ "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ=="
+ },
+ "node_modules/keyv": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz",
+ "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==",
+ "dependencies": {
+ "json-buffer": "3.0.0"
+ }
+ },
+ "node_modules/lowercase-keys": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
+ "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/make-dir": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
+ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
+ "dependencies": {
+ "pify": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/mimic-response": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
+ "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/normalize-url": {
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz",
+ "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/p-cancelable": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz",
+ "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/prepend-http": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
+ "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/proxy-check": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/proxy-check/-/proxy-check-1.0.8.tgz",
+ "integrity": "sha512-gooLamKpgl6wi3tJuVpDC7KL3+xSwstUIatyrknMSLaznc+n/cpEiO2HwIAcU30VLExafchmzTpFOgHr8of0wA=="
+ },
+ "node_modules/pump": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+ "dependencies": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
+ "node_modules/responselike": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz",
+ "integrity": "sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==",
+ "dependencies": {
+ "lowercase-keys": "^1.0.0"
+ }
+ },
+ "node_modules/sax": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
+ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
+ },
+ "node_modules/signal-exit": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
+ },
+ "node_modules/to-readable-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz",
+ "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/translatte": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/translatte/-/translatte-3.0.1.tgz",
+ "integrity": "sha512-OP41nm4dS1ctRmDDXfgJGK7tAtq2yJe0QCOaRBQjBM+kS4ak4dhWrbL8Mf8p7TFzWJAdV+TLZ1oiYEW3gpWGJg==",
+ "dependencies": {
+ "configstore": "4.0.0",
+ "got": "9.6.0",
+ "proxy-check": "1.0.8",
+ "tunnel": "0.0.6"
+ }
+ },
+ "node_modules/tunnel": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
+ "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
+ "engines": {
+ "node": ">=0.6.11 <=0.7.0 || >=0.7.3"
+ }
+ },
+ "node_modules/unique-string": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz",
+ "integrity": "sha512-ODgiYu03y5g76A1I9Gt0/chLCzQjvzDy7DsZGsLOE/1MrF6wriEskSncj1+/C58Xk/kPZDppSctDybCwOSaGAg==",
+ "dependencies": {
+ "crypto-random-string": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/url-parse-lax": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz",
+ "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==",
+ "dependencies": {
+ "prepend-http": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
+ },
+ "node_modules/write-file-atomic": {
+ "version": "2.4.3",
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz",
+ "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==",
+ "dependencies": {
+ "graceful-fs": "^4.1.11",
+ "imurmurhash": "^0.1.4",
+ "signal-exit": "^3.0.2"
+ }
+ },
+ "node_modules/xdg-basedir": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz",
+ "integrity": "sha512-1Dly4xqlulvPD3fZUQJLY+FUIeqN3N2MM3uqe4rCJftAvOjFa3jFGfctOgluGx4ahPbUCsZkmJILiP0Vi4T6lQ==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/xml2js": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.0.tgz",
+ "integrity": "sha512-eLTh0kA8uHceqesPqSE+VvO1CDDJWMwlQfB6LuN6T8w6MaDJ8Txm8P7s5cHD0miF0V+GGTZrDQfxPZQVsur33w==",
+ "dependencies": {
+ "sax": ">=0.6.0",
+ "xmlbuilder": "~11.0.0"
+ },
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/xmlbuilder": {
+ "version": "11.0.1",
+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
+ "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
+ "engines": {
+ "node": ">=4.0"
+ }
+ }
+ }
+}
diff --git a/includes/translator/node_modules/@sindresorhus/is/dist/index.d.ts b/includes/translator/node_modules/@sindresorhus/is/dist/index.d.ts
new file mode 100644
index 0000000..e94d30b
--- /dev/null
+++ b/includes/translator/node_modules/@sindresorhus/is/dist/index.d.ts
@@ -0,0 +1,132 @@
+/// <reference types="node" />
+/// <reference lib="es2016" />
+/// <reference lib="es2017.sharedmemory" />
+/// <reference lib="esnext.asynciterable" />
+/// <reference lib="dom" />
+declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
+declare type Primitive = null | undefined | string | number | boolean | Symbol;
+export interface ArrayLike {
+ length: number;
+}
+export interface Class<T = unknown> {
+ new (...args: any[]): T;
+}
+declare type DomElement = object & {
+ nodeType: 1;
+ nodeName: string;
+};
+declare type NodeStream = object & {
+ pipe: Function;
+};
+export declare const enum TypeName {
+ null = "null",
+ boolean = "boolean",
+ undefined = "undefined",
+ string = "string",
+ number = "number",
+ symbol = "symbol",
+ Function = "Function",
+ GeneratorFunction = "GeneratorFunction",
+ AsyncFunction = "AsyncFunction",
+ Observable = "Observable",
+ Array = "Array",
+ Buffer = "Buffer",
+ Object = "Object",
+ RegExp = "RegExp",
+ Date = "Date",
+ Error = "Error",
+ Map = "Map",
+ Set = "Set",
+ WeakMap = "WeakMap",
+ WeakSet = "WeakSet",
+ Int8Array = "Int8Array",
+ Uint8Array = "Uint8Array",
+ Uint8ClampedArray = "Uint8ClampedArray",
+ Int16Array = "Int16Array",
+ Uint16Array = "Uint16Array",
+ Int32Array = "Int32Array",
+ Uint32Array = "Uint32Array",
+ Float32Array = "Float32Array",
+ Float64Array = "Float64Array",
+ ArrayBuffer = "ArrayBuffer",
+ SharedArrayBuffer = "SharedArrayBuffer",
+ DataView = "DataView",
+ Promise = "Promise",
+ URL = "URL"
+}
+declare function is(value: unknown): TypeName;
+declare namespace is {
+ const undefined: (value: unknown) => value is undefined;
+ const string: (value: unknown) => value is string;
+ const number: (value: unknown) => value is number;
+ const function_: (value: unknown) => value is Function;
+ const null_: (value: unknown) => value is null;
+ const class_: (value: unknown) => value is Class<unknown>;
+ const boolean: (value: unknown) => value is boolean;
+ const symbol: (value: unknown) => value is Symbol;
+ const numericString: (value: unknown) => boolean;
+ const array: (arg: any) => arg is any[];
+ const buffer: (input: unknown) => input is Buffer;
+ const nullOrUndefined: (value: unknown) => value is null | undefined;
+ const object: (value: unknown) => value is object;
+ const iterable: (value: unknown) => value is IterableIterator<unknown>;
+ const asyncIterable: (value: unknown) => value is AsyncIterableIterator<unknown>;
+ const generator: (value: unknown) => value is Generator;
+ const nativePromise: (value: unknown) => value is Promise<unknown>;
+ const promise: (value: unknown) => value is Promise<unknown>;
+ const generatorFunction: (value: unknown) => value is GeneratorFunction;
+ const asyncFunction: (value: unknown) => value is Function;
+ const boundFunction: (value: unknown) => value is Function;
+ const regExp: (value: unknown) => value is RegExp;
+ const date: (value: unknown) => value is Date;
+ const error: (value: unknown) => value is Error;
+ const map: (value: unknown) => value is Map<unknown, unknown>;
+ const set: (value: unknown) => value is Set<unknown>;
+ const weakMap: (value: unknown) => value is WeakMap<object, unknown>;
+ const weakSet: (value: unknown) => value is WeakSet<object>;
+ const int8Array: (value: unknown) => value is Int8Array;
+ const uint8Array: (value: unknown) => value is Uint8Array;
+ const uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray;
+ const int16Array: (value: unknown) => value is Int16Array;
+ const uint16Array: (value: unknown) => value is Uint16Array;
+ const int32Array: (value: unknown) => value is Int32Array;
+ const uint32Array: (value: unknown) => value is Uint32Array;
+ const float32Array: (value: unknown) => value is Float32Array;
+ const float64Array: (value: unknown) => value is Float64Array;
+ const arrayBuffer: (value: unknown) => value is ArrayBuffer;
+ const sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer;
+ const dataView: (value: unknown) => value is DataView;
+ const directInstanceOf: <T>(instance: unknown, klass: Class<T>) => instance is T;
+ const urlInstance: (value: unknown) => value is URL;
+ const urlString: (value: unknown) => boolean;
+ const truthy: (value: unknown) => boolean;
+ const falsy: (value: unknown) => boolean;
+ const nan: (value: unknown) => boolean;
+ const primitive: (value: unknown) => value is Primitive;
+ const integer: (value: unknown) => value is number;
+ const safeInteger: (value: unknown) => value is number;
+ const plainObject: (value: unknown) => boolean;
+ const typedArray: (value: unknown) => value is TypedArray;
+ const arrayLike: (value: unknown) => value is ArrayLike;
+ const inRange: (value: number, range: number | number[]) => boolean;
+ const domElement: (value: unknown) => value is DomElement;
+ const observable: (value: unknown) => boolean;
+ const nodeStream: (value: unknown) => value is NodeStream;
+ const infinite: (value: unknown) => boolean;
+ const even: (value: number) => boolean;
+ const odd: (value: number) => boolean;
+ const emptyArray: (value: unknown) => boolean;
+ const nonEmptyArray: (value: unknown) => boolean;
+ const emptyString: (value: unknown) => boolean;
+ const nonEmptyString: (value: unknown) => boolean;
+ const emptyStringOrWhitespace: (value: unknown) => boolean;
+ const emptyObject: (value: unknown) => boolean;
+ const nonEmptyObject: (value: unknown) => boolean;
+ const emptySet: (value: unknown) => boolean;
+ const nonEmptySet: (value: unknown) => boolean;
+ const emptyMap: (value: unknown) => boolean;
+ const nonEmptyMap: (value: unknown) => boolean;
+ const any: (predicate: unknown, ...values: unknown[]) => boolean;
+ const all: (predicate: unknown, ...values: unknown[]) => boolean;
+}
+export default is;
diff --git a/includes/translator/node_modules/@sindresorhus/is/dist/index.js b/includes/translator/node_modules/@sindresorhus/is/dist/index.js
new file mode 100644
index 0000000..3cbafae
--- /dev/null
+++ b/includes/translator/node_modules/@sindresorhus/is/dist/index.js
@@ -0,0 +1,245 @@
+"use strict";
+/// <reference lib="es2016"/>
+/// <reference lib="es2017.sharedmemory"/>
+/// <reference lib="esnext.asynciterable"/>
+/// <reference lib="dom"/>
+Object.defineProperty(exports, "__esModule", { value: true });
+// TODO: Use the `URL` global when targeting Node.js 10
+// tslint:disable-next-line
+const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;
+const toString = Object.prototype.toString;
+const isOfType = (type) => (value) => typeof value === type;
+const isBuffer = (input) => !is.nullOrUndefined(input) && !is.nullOrUndefined(input.constructor) && is.function_(input.constructor.isBuffer) && input.constructor.isBuffer(input);
+const getObjectType = (value) => {
+ const objectName = toString.call(value).slice(8, -1);
+ if (objectName) {
+ return objectName;
+ }
+ return null;
+};
+const isObjectOfType = (type) => (value) => getObjectType(value) === type;
+function is(value) {
+ switch (value) {
+ case null:
+ return "null" /* null */;
+ case true:
+ case false:
+ return "boolean" /* boolean */;
+ default:
+ }
+ switch (typeof value) {
+ case 'undefined':
+ return "undefined" /* undefined */;
+ case 'string':
+ return "string" /* string */;
+ case 'number':
+ return "number" /* number */;
+ case 'symbol':
+ return "symbol" /* symbol */;
+ default:
+ }
+ if (is.function_(value)) {
+ return "Function" /* Function */;
+ }
+ if (is.observable(value)) {
+ return "Observable" /* Observable */;
+ }
+ if (Array.isArray(value)) {
+ return "Array" /* Array */;
+ }
+ if (isBuffer(value)) {
+ return "Buffer" /* Buffer */;
+ }
+ const tagType = getObjectType(value);
+ if (tagType) {
+ return tagType;
+ }
+ if (value instanceof String || value instanceof Boolean || value instanceof Number) {
+ throw new TypeError('Please don\'t use object wrappers for primitive types');
+ }
+ return "Object" /* Object */;
+}
+(function (is) {
+ // tslint:disable-next-line:strict-type-predicates
+ const isObject = (value) => typeof value === 'object';
+ // tslint:disable:variable-name
+ is.undefined = isOfType('undefined');
+ is.string = isOfType('string');
+ is.number = isOfType('number');
+ is.function_ = isOfType('function');
+ // tslint:disable-next-line:strict-type-predicates
+ is.null_ = (value) => value === null;
+ is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
+ is.boolean = (value) => value === true || value === false;
+ is.symbol = isOfType('symbol');
+ // tslint:enable:variable-name
+ is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value));
+ is.array = Array.isArray;
+ is.buffer = isBuffer;
+ is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
+ is.object = (value) => !is.nullOrUndefined(value) && (is.function_(value) || isObject(value));
+ is.iterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.iterator]);
+ is.asyncIterable = (value) => !is.nullOrUndefined(value) && is.function_(value[Symbol.asyncIterator]);
+ is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw);
+ is.nativePromise = (value) => isObjectOfType("Promise" /* Promise */)(value);
+ const hasPromiseAPI = (value) => !is.null_(value) &&
+ isObject(value) &&
+ is.function_(value.then) &&
+ is.function_(value.catch);
+ is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
+ is.generatorFunction = isObjectOfType("GeneratorFunction" /* GeneratorFunction */);
+ is.asyncFunction = isObjectOfType("AsyncFunction" /* AsyncFunction */);
+ is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');
+ is.regExp = isObjectOfType("RegExp" /* RegExp */);
+ is.date = isObjectOfType("Date" /* Date */);
+ is.error = isObjectOfType("Error" /* Error */);
+ is.map = (value) => isObjectOfType("Map" /* Map */)(value);
+ is.set = (value) => isObjectOfType("Set" /* Set */)(value);
+ is.weakMap = (value) => isObjectOfType("WeakMap" /* WeakMap */)(value);
+ is.weakSet = (value) => isObjectOfType("WeakSet" /* WeakSet */)(value);
+ is.int8Array = isObjectOfType("Int8Array" /* Int8Array */);
+ is.uint8Array = isObjectOfType("Uint8Array" /* Uint8Array */);
+ is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray" /* Uint8ClampedArray */);
+ is.int16Array = isObjectOfType("Int16Array" /* Int16Array */);
+ is.uint16Array = isObjectOfType("Uint16Array" /* Uint16Array */);
+ is.int32Array = isObjectOfType("Int32Array" /* Int32Array */);
+ is.uint32Array = isObjectOfType("Uint32Array" /* Uint32Array */);
+ is.float32Array = isObjectOfType("Float32Array" /* Float32Array */);
+ is.float64Array = isObjectOfType("Float64Array" /* Float64Array */);
+ is.arrayBuffer = isObjectOfType("ArrayBuffer" /* ArrayBuffer */);
+ is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer" /* SharedArrayBuffer */);
+ is.dataView = isObjectOfType("DataView" /* DataView */);
+ is.directInstanceOf = (instance, klass) => Object.getPrototypeOf(instance) === klass.prototype;
+ is.urlInstance = (value) => isObjectOfType("URL" /* URL */)(value);
+ is.urlString = (value) => {
+ if (!is.string(value)) {
+ return false;
+ }
+ try {
+ new URLGlobal(value); // tslint:disable-line no-unused-expression
+ return true;
+ }
+ catch (_a) {
+ return false;
+ }
+ };
+ is.truthy = (value) => Boolean(value);
+ is.falsy = (value) => !value;
+ is.nan = (value) => Number.isNaN(value);
+ const primitiveTypes = new Set([
+ 'undefined',
+ 'string',
+ 'number',
+ 'boolean',
+ 'symbol'
+ ]);
+ is.primitive = (value) => is.null_(value) || primitiveTypes.has(typeof value);
+ is.integer = (value) => Number.isInteger(value);
+ is.safeInteger = (value) => Number.isSafeInteger(value);
+ is.plainObject = (value) => {
+ // From: https://github.com/sindresorhus/is-plain-obj/blob/master/index.js
+ let prototype;
+ return getObjectType(value) === "Object" /* Object */ &&
+ (prototype = Object.getPrototypeOf(value), prototype === null || // tslint:disable-line:ban-comma-operator
+ prototype === Object.getPrototypeOf({}));
+ };
+ const typedArrayTypes = new Set([
+ "Int8Array" /* Int8Array */,
+ "Uint8Array" /* Uint8Array */,
+ "Uint8ClampedArray" /* Uint8ClampedArray */,
+ "Int16Array" /* Int16Array */,
+ "Uint16Array" /* Uint16Array */,
+ "Int32Array" /* Int32Array */,
+ "Uint32Array" /* Uint32Array */,
+ "Float32Array" /* Float32Array */,
+ "Float64Array" /* Float64Array */
+ ]);
+ is.typedArray = (value) => {
+ const objectType = getObjectType(value);
+ if (objectType === null) {
+ return false;
+ }
+ return typedArrayTypes.has(objectType);
+ };
+ const isValidLength = (value) => is.safeInteger(value) && value > -1;
+ is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);
+ is.inRange = (value, range) => {
+ if (is.number(range)) {
+ return value >= Math.min(0, range) && value <= Math.max(range, 0);
+ }
+ if (is.array(range) && range.length === 2) {
+ return value >= Math.min(...range) && value <= Math.max(...range);
+ }
+ throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);
+ };
+ const NODE_TYPE_ELEMENT = 1;
+ const DOM_PROPERTIES_TO_CHECK = [
+ 'innerHTML',
+ 'ownerDocument',
+ 'style',
+ 'attributes',
+ 'nodeValue'
+ ];
+ is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) &&
+ !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value);
+ is.observable = (value) => {
+ if (!value) {
+ return false;
+ }
+ if (value[Symbol.observable] && value === value[Symbol.observable]()) {
+ return true;
+ }
+ if (value['@@observable'] && value === value['@@observable']()) {
+ return true;
+ }
+ return false;
+ };
+ is.nodeStream = (value) => !is.nullOrUndefined(value) && isObject(value) && is.function_(value.pipe) && !is.observable(value);
+ is.infinite = (value) => value === Infinity || value === -Infinity;
+ const isAbsoluteMod2 = (rem) => (value) => is.integer(value) && Math.abs(value % 2) === rem;
+ is.even = isAbsoluteMod2(0);
+ is.odd = isAbsoluteMod2(1);
+ const isWhiteSpaceString = (value) => is.string(value) && /\S/.test(value) === false;
+ is.emptyArray = (value) => is.array(value) && value.length === 0;
+ is.nonEmptyArray = (value) => is.array(value) && value.length > 0;
+ is.emptyString = (value) => is.string(value) && value.length === 0;
+ is.nonEmptyString = (value) => is.string(value) && value.length > 0;
+ is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);
+ is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;
+ is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;
+ is.emptySet = (value) => is.set(value) && value.size === 0;
+ is.nonEmptySet = (value) => is.set(value) && value.size > 0;
+ is.emptyMap = (value) => is.map(value) && value.size === 0;
+ is.nonEmptyMap = (value) => is.map(value) && value.size > 0;
+ const predicateOnArray = (method, predicate, values) => {
+ if (is.function_(predicate) === false) {
+ throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);
+ }
+ if (values.length === 0) {
+ throw new TypeError('Invalid number of values');
+ }
+ return method.call(values, predicate);
+ };
+ // tslint:disable variable-name
+ is.any = (predicate, ...values) => predicateOnArray(Array.prototype.some, predicate, values);
+ is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values);
+ // tslint:enable variable-name
+})(is || (is = {}));
+// Some few keywords are reserved, but we'll populate them for Node.js users
+// See https://github.com/Microsoft/TypeScript/issues/2536
+Object.defineProperties(is, {
+ class: {
+ value: is.class_
+ },
+ function: {
+ value: is.function_
+ },
+ null: {
+ value: is.null_
+ }
+});
+exports.default = is;
+// For CommonJS default export support
+module.exports = is;
+module.exports.default = is;
+//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/includes/translator/node_modules/@sindresorhus/is/dist/index.js.map b/includes/translator/node_modules/@sindresorhus/is/dist/index.js.map
new file mode 100644
index 0000000..cd827fc
--- /dev/null
+++ b/includes/translator/node_modules/@sindresorhus/is/dist/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,0CAA0C;AAC1C,2CAA2C;AAC3C,0BAA0B;;AAE1B,uDAAuD;AACvD,2BAA2B;AAC3B,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AAqDxE,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;AAC3C,MAAM,QAAQ,GAAG,CAAI,IAAY,EAAE,EAAE,CAAC,CAAC,KAAc,EAAc,EAAE,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC;AAC5F,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,eAAe,CAAE,KAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,SAAS,CAAE,KAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAK,KAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAEhP,MAAM,aAAa,GAAG,CAAC,KAAc,EAAmB,EAAE;IACzD,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAErD,IAAI,UAAU,EAAE;QACf,OAAO,UAAsB,CAAC;KAC9B;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAI,IAAc,EAAE,EAAE,CAAC,CAAC,KAAc,EAAc,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;AAE5G,SAAS,EAAE,CAAC,KAAc;IACzB,QAAQ,KAAK,EAAE;QACd,KAAK,IAAI;YACR,yBAAqB;QACtB,KAAK,IAAI,CAAC;QACV,KAAK,KAAK;YACT,+BAAwB;QACzB,QAAQ;KACR;IAED,QAAQ,OAAO,KAAK,EAAE;QACrB,KAAK,WAAW;YACf,mCAA0B;QAC3B,KAAK,QAAQ;YACZ,6BAAuB;QACxB,KAAK,QAAQ;YACZ,6BAAuB;QACxB,KAAK,QAAQ;YACZ,6BAAuB;QACxB,QAAQ;KACR;IAED,IAAI,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QACxB,iCAAyB;KACzB;IAED,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QACzB,qCAA2B;KAC3B;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,2BAAsB;KACtB;IAED,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;QACpB,6BAAuB;KACvB;IAED,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,OAAO,EAAE;QACZ,OAAO,OAAO,CAAC;KACf;IAED,IAAI,KAAK,YAAY,MAAM,IAAI,KAAK,YAAY,OAAO,IAAI,KAAK,YAAY,MAAM,EAAE;QACnF,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAC;KAC7E;IAED,6BAAuB;AACxB,CAAC;AAED,WAAU,EAAE;IACX,kDAAkD;IAClD,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC;IAEhF,+BAA+B;IAClB,YAAS,GAAG,QAAQ,CAAY,WAAW,CAAC,CAAC;IAC7C,SAAM,GAAG,QAAQ,CAAS,QAAQ,CAAC,CAAC;IACpC,SAAM,GAAG,QAAQ,CAAS,QAAQ,CAAC,CAAC;IACpC,YAAS,GAAG,QAAQ,CAAW,UAAU,CAAC,CAAC;IACxD,kDAAkD;IACrC,QAAK,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC;IAC1D,SAAM,GAAG,CAAC,KAAc,EAAkB,EAAE,CAAC,GAAA,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvG,UAAO,GAAG,CAAC,KAAc,EAAoB,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC;IAClF,SAAM,GAAG,QAAQ,CAAS,QAAQ,CAAC,CAAC;IACjD,8BAA8B;IAEjB,gBAAa,GAAG,CAAC,KAAc,EAAW,EAAE,CACxD,GAAA,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAEtD,QAAK,GAAG,KAAK,CAAC,OAAO,CAAC;IACtB,SAAM,GAAG,QAAQ,CAAC;IAElB,kBAAe,GAAG,CAAC,KAAc,EAA6B,EAAE,CAAC,GAAA,KAAK,CAAC,KAAK,CAAC,IAAI,GAAA,SAAS,CAAC,KAAK,CAAC,CAAC;IAClG,SAAM,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,CAAC,GAAA,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,GAAA,SAAS,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/G,WAAQ,GAAG,CAAC,KAAc,EAAsC,EAAE,CAAC,CAAC,GAAA,eAAe,CAAC,KAAK,CAAC,IAAI,GAAA,SAAS,CAAE,KAAmC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/J,gBAAa,GAAG,CAAC,KAAc,EAA2C,EAAE,CAAC,CAAC,GAAA,eAAe,CAAC,KAAK,CAAC,IAAI,GAAA,SAAS,CAAE,KAAwC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;IACnL,YAAS,GAAG,CAAC,KAAc,EAAsB,EAAE,CAAC,GAAA,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAA,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAA,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEvH,gBAAa,GAAG,CAAC,KAAc,EAA6B,EAAE,CAC1E,cAAc,yBAAoC,CAAC,KAAK,CAAC,CAAC;IAE3D,MAAM,aAAa,GAAG,CAAC,KAAc,EAA6B,EAAE,CACnE,CAAC,GAAA,KAAK,CAAC,KAAK,CAAC;QACb,QAAQ,CAAC,KAAK,CAAY;QAC1B,GAAA,SAAS,CAAE,KAA0B,CAAC,IAAI,CAAC;QAC3C,GAAA,SAAS,CAAE,KAA0B,CAAC,KAAK,CAAC,CAAC;IAEjC,UAAO,GAAG,CAAC,KAAc,EAA6B,EAAE,CAAC,GAAA,aAAa,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;IAEtG,oBAAiB,GAAG,cAAc,6CAA+C,CAAC;IAClF,gBAAa,GAAG,cAAc,qCAAkC,CAAC;IACjE,gBAAa,GAAG,CAAC,KAAc,EAAqB,EAAE,CAAC,GAAA,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAE9G,SAAM,GAAG,cAAc,uBAAyB,CAAC;IACjD,OAAI,GAAG,cAAc,mBAAqB,CAAC;IAC3C,QAAK,GAAG,cAAc,qBAAuB,CAAC;IAC9C,MAAG,GAAG,CAAC,KAAc,EAAkC,EAAE,CAAC,cAAc,iBAAqC,CAAC,KAAK,CAAC,CAAC;IACrH,MAAG,GAAG,CAAC,KAAc,EAAyB,EAAE,CAAC,cAAc,iBAA4B,CAAC,KAAK,CAAC,CAAC;IACnG,UAAO,GAAG,CAAC,KAAc,EAAqC,EAAE,CAAC,cAAc,yBAA4C,CAAC,KAAK,CAAC,CAAC;IACnI,UAAO,GAAG,CAAC,KAAc,EAA4B,EAAE,CAAC,cAAc,yBAAmC,CAAC,KAAK,CAAC,CAAC;IAEjH,YAAS,GAAG,cAAc,6BAA+B,CAAC;IAC1D,aAAU,GAAG,cAAc,+BAAiC,CAAC;IAC7D,oBAAiB,GAAG,cAAc,6CAA+C,CAAC;IAClF,aAAU,GAAG,cAAc,+BAAiC,CAAC;IAC7D,cAAW,GAAG,cAAc,iCAAmC,CAAC;IAChE,aAAU,GAAG,cAAc,+BAAiC,CAAC;IAC7D,cAAW,GAAG,cAAc,iCAAmC,CAAC;IAChE,eAAY,GAAG,cAAc,mCAAqC,CAAC;IACnE,eAAY,GAAG,cAAc,mCAAqC,CAAC;IAEnE,cAAW,GAAG,cAAc,iCAAmC,CAAC;IAChE,oBAAiB,GAAG,cAAc,6CAA+C,CAAC;IAClF,WAAQ,GAAG,cAAc,2BAA6B,CAAC;IAEvD,mBAAgB,GAAG,CAAI,QAAiB,EAAE,KAAe,EAAiB,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACjI,cAAW,GAAG,CAAC,KAAc,EAAgB,EAAE,CAAC,cAAc,iBAAmB,CAAC,KAAK,CAAC,CAAC;IAEzF,YAAS,GAAG,CAAC,KAAc,EAAE,EAAE;QAC3C,IAAI,CAAC,GAAA,MAAM,CAAC,KAAK,CAAC,EAAE;YACnB,OAAO,KAAK,CAAC;SACb;QAED,IAAI;YACH,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,2CAA2C;YACjE,OAAO,IAAI,CAAC;SACZ;QAAC,WAAM;YACP,OAAO,KAAK,CAAC;SACb;IACF,CAAC,CAAC;IAEW,SAAM,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5C,QAAK,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC;IAEnC,MAAG,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,KAAe,CAAC,CAAC;IAErE,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;QAC9B,WAAW;QACX,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,QAAQ;KACR,CAAC,CAAC;IAEU,YAAS,GAAG,CAAC,KAAc,EAAsB,EAAE,CAAC,GAAA,KAAK,CAAC,KAAK,CAAC,IAAI,cAAc,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC;IAErG,UAAO,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,KAAe,CAAC,CAAC;IACjF,cAAW,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAe,CAAC,CAAC;IAEzF,cAAW,GAAG,CAAC,KAAc,EAAE,EAAE;QAC7C,0EAA0E;QAC1E,IAAI,SAAS,CAAC;QAEd,OAAO,aAAa,CAAC,KAAK,CAAC,0BAAoB;YAC9C,CAAC,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,SAAS,KAAK,IAAI,IAAI,yCAAyC;gBACzG,SAAS,KAAK,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;;;;;;;;;;KAU/B,CAAC,CAAC;IACU,aAAU,GAAG,CAAC,KAAc,EAAuB,EAAE;QACjE,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAExC,IAAI,UAAU,KAAK,IAAI,EAAE;YACxB,OAAO,KAAK,CAAC;SACb;QAED,OAAO,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;IAC9D,YAAS,GAAG,CAAC,KAAc,EAAsB,EAAE,CAAC,CAAC,GAAA,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,GAAA,SAAS,CAAC,KAAK,CAAC,IAAI,aAAa,CAAE,KAAmB,CAAC,MAAM,CAAC,CAAC;IAE/I,UAAO,GAAG,CAAC,KAAa,EAAE,KAAwB,EAAE,EAAE;QAClE,IAAI,GAAA,MAAM,CAAC,KAAK,CAAC,EAAE;YAClB,OAAO,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAClE;QAED,IAAI,GAAA,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACvC,OAAO,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;SAClE;QAED,MAAM,IAAI,SAAS,CAAC,kBAAkB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,CAAC;IAC5B,MAAM,uBAAuB,GAAG;QAC/B,WAAW;QACX,eAAe;QACf,OAAO;QACP,YAAY;QACZ,WAAW;KACX,CAAC;IAEW,aAAU,GAAG,CAAC,KAAc,EAAuB,EAAE,CAAC,GAAA,MAAM,CAAC,KAAK,CAAC,IAAK,KAAoB,CAAC,QAAQ,KAAK,iBAAiB,IAAI,GAAA,MAAM,CAAE,KAAoB,CAAC,QAAQ,CAAC;QACjL,CAAC,GAAA,WAAW,CAAC,KAAK,CAAC,IAAI,uBAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,IAAK,KAAoB,CAAC,CAAC;IAExF,aAAU,GAAG,CAAC,KAAc,EAAE,EAAE;QAC5C,IAAI,CAAC,KAAK,EAAE;YACX,OAAO,KAAK,CAAC;SACb;QAED,IAAK,KAAa,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,KAAK,KAAM,KAAa,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE;YACvF,OAAO,IAAI,CAAC;SACZ;QAED,IAAK,KAAa,CAAC,cAAc,CAAC,IAAI,KAAK,KAAM,KAAa,CAAC,cAAc,CAAC,EAAE,EAAE;YACjF,OAAO,IAAI,CAAC;SACZ;QAED,OAAO,KAAK,CAAC;IACd,CAAC,CAAC;IAEW,aAAU,GAAG,CAAC,KAAc,EAAuB,EAAE,CAAC,CAAC,GAAA,eAAe,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAY,IAAI,GAAA,SAAS,CAAE,KAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAA,UAAU,CAAC,KAAK,CAAC,CAAC;IAE3K,WAAQ,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,CAAC,QAAQ,CAAC;IAEtF,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,GAAA,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;IAC5F,OAAI,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IACzB,MAAG,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAErC,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;IAE9E,aAAU,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;IACpE,gBAAa,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAErE,cAAW,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;IACtE,iBAAc,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACvE,0BAAuB,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,WAAW,CAAC,KAAK,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAE9F,cAAW,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAA,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAA,GAAG,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IACjH,iBAAc,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAA,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAA,GAAG,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAElH,WAAQ,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;IAC9D,cAAW,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;IAE/D,WAAQ,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;IAC9D,cAAW,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,GAAA,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;IAG5E,MAAM,gBAAgB,GAAG,CAAC,MAAmB,EAAE,SAAkB,EAAE,MAAiB,EAAE,EAAE;QACvF,IAAI,GAAA,SAAS,CAAC,SAAS,CAAC,KAAK,KAAK,EAAE;YACnC,MAAM,IAAI,SAAS,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;SACvE;QAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACxB,MAAM,IAAI,SAAS,CAAC,0BAA0B,CAAC,CAAC;SAChD;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,SAAgB,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF,+BAA+B;IAClB,MAAG,GAAG,CAAC,SAAkB,EAAE,GAAG,MAAiB,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC9G,MAAG,GAAG,CAAC,SAAkB,EAAE,GAAG,MAAiB,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5H,8BAA8B;AAC/B,CAAC,EAvNS,EAAE,KAAF,EAAE,QAuNX;AAED,4EAA4E;AAC5E,0DAA0D;AAC1D,MAAM,CAAC,gBAAgB,CAAC,EAAE,EAAE;IAC3B,KAAK,EAAE;QACN,KAAK,EAAE,EAAE,CAAC,MAAM;KAChB;IACD,QAAQ,EAAE;QACT,KAAK,EAAE,EAAE,CAAC,SAAS;KACnB;IACD,IAAI,EAAE;QACL,KAAK,EAAE,EAAE,CAAC,KAAK;KACf;CACD,CAAC,CAAC;AAEH,kBAAe,EAAE,CAAC;AAElB,sCAAsC;AACtC,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;AACpB,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC"} \ No newline at end of file
diff --git a/includes/translator/node_modules/@sindresorhus/is/license b/includes/translator/node_modules/@sindresorhus/is/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/@sindresorhus/is/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/@sindresorhus/is/package.json b/includes/translator/node_modules/@sindresorhus/is/package.json
new file mode 100644
index 0000000..bf0d9fe
--- /dev/null
+++ b/includes/translator/node_modules/@sindresorhus/is/package.json
@@ -0,0 +1,63 @@
+{
+ "name": "@sindresorhus/is",
+ "version": "0.14.0",
+ "description": "Type check values: `is.string('🦄') //=> true`",
+ "license": "MIT",
+ "repository": "sindresorhus/is",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "main": "dist/index.js",
+ "engines": {
+ "node": ">=6"
+ },
+ "scripts": {
+ "lint": "tslint --format stylish --project .",
+ "build": "del dist && tsc",
+ "test": "npm run lint && npm run build && ava dist/tests",
+ "prepublish": "npm run build && del dist/tests"
+ },
+ "files": [
+ "dist"
+ ],
+ "keywords": [
+ "type",
+ "types",
+ "is",
+ "check",
+ "checking",
+ "validate",
+ "validation",
+ "utility",
+ "util",
+ "typeof",
+ "instanceof",
+ "object",
+ "assert",
+ "assertion",
+ "test",
+ "kind",
+ "primitive",
+ "verify",
+ "compare"
+ ],
+ "devDependencies": {
+ "@sindresorhus/tsconfig": "^0.1.0",
+ "@types/jsdom": "^11.12.0",
+ "@types/node": "^10.12.10",
+ "@types/tempy": "^0.2.0",
+ "@types/zen-observable": "^0.8.0",
+ "ava": "^0.25.0",
+ "del-cli": "^1.1.0",
+ "jsdom": "^11.6.2",
+ "rxjs": "^6.3.3",
+ "tempy": "^0.2.1",
+ "tslint": "^5.9.1",
+ "tslint-xo": "^0.10.0",
+ "typescript": "^3.2.1",
+ "zen-observable": "^0.8.8"
+ },
+ "types": "dist/index.d.ts"
+}
diff --git a/includes/translator/node_modules/@sindresorhus/is/readme.md b/includes/translator/node_modules/@sindresorhus/is/readme.md
new file mode 100644
index 0000000..97c023b
--- /dev/null
+++ b/includes/translator/node_modules/@sindresorhus/is/readme.md
@@ -0,0 +1,451 @@
+# is [![Build Status](https://travis-ci.org/sindresorhus/is.svg?branch=master)](https://travis-ci.org/sindresorhus/is)
+
+> Type check values: `is.string('🦄') //=> true`
+
+<img src="header.gif" width="182" align="right">
+
+
+## Install
+
+```
+$ npm install @sindresorhus/is
+```
+
+
+## Usage
+
+```js
+const is = require('@sindresorhus/is');
+
+is('🦄');
+//=> 'string'
+
+is(new Map());
+//=> 'Map'
+
+is.number(6);
+//=> true
+```
+
+When using `is` together with TypeScript, [type guards](http://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types) are being used to infer the correct type inside if-else statements.
+
+```ts
+import is from '@sindresorhus/is';
+
+const padLeft = (value: string, padding: string | number) => {
+ if (is.number(padding)) {
+ // `padding` is typed as `number`
+ return Array(padding + 1).join(' ') + value;
+ }
+
+ if (is.string(padding)) {
+ // `padding` is typed as `string`
+ return padding + value;
+ }
+
+ throw new TypeError(`Expected 'padding' to be of type 'string' or 'number', got '${is(padding)}'.`);
+}
+
+padLeft('🦄', 3);
+//=> ' 🦄'
+
+padLeft('🦄', '🌈');
+//=> '🌈🦄'
+```
+
+
+## API
+
+### is(value)
+
+Returns the type of `value`.
+
+Primitives are lowercase and object types are camelcase.
+
+Example:
+
+- `'undefined'`
+- `'null'`
+- `'string'`
+- `'symbol'`
+- `'Array'`
+- `'Function'`
+- `'Object'`
+
+Note: It will throw an error if you try to feed it object-wrapped primitives, as that's a bad practice. For example `new String('foo')`.
+
+### is.{method}
+
+All the below methods accept a value and returns a boolean for whether the value is of the desired type.
+
+#### Primitives
+
+##### .undefined(value)
+##### .null(value)
+##### .string(value)
+##### .number(value)
+##### .boolean(value)
+##### .symbol(value)
+
+#### Built-in types
+
+##### .array(value)
+##### .function(value)
+##### .buffer(value)
+##### .object(value)
+
+Keep in mind that [functions are objects too](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions).
+
+##### .numericString(value)
+
+Returns `true` for a string that represents a number. For example, `'42'` and `'-8'`.
+
+Note: `'NaN'` returns `false`, but `'Infinity'` and `'-Infinity'` return `true`.
+
+##### .regExp(value)
+##### .date(value)
+##### .error(value)
+##### .nativePromise(value)
+##### .promise(value)
+
+Returns `true` for any object with a `.then()` and `.catch()` method. Prefer this one over `.nativePromise()` as you usually want to allow userland promise implementations too.
+
+##### .generator(value)
+
+Returns `true` for any object that implements its own `.next()` and `.throw()` methods and has a function definition for `Symbol.iterator`.
+
+##### .generatorFunction(value)
+
+##### .asyncFunction(value)
+
+Returns `true` for any `async` function that can be called with the `await` operator.
+
+```js
+is.asyncFunction(async () => {});
+// => true
+
+is.asyncFunction(() => {});
+// => false
+```
+
+##### .boundFunction(value)
+
+Returns `true` for any `bound` function.
+
+```js
+is.boundFunction(() => {});
+// => true
+
+is.boundFunction(function () {}.bind(null));
+// => true
+
+is.boundFunction(function () {});
+// => false
+```
+
+##### .map(value)
+##### .set(value)
+##### .weakMap(value)
+##### .weakSet(value)
+
+#### Typed arrays
+
+##### .int8Array(value)
+##### .uint8Array(value)
+##### .uint8ClampedArray(value)
+##### .int16Array(value)
+##### .uint16Array(value)
+##### .int32Array(value)
+##### .uint32Array(value)
+##### .float32Array(value)
+##### .float64Array(value)
+
+#### Structured data
+
+##### .arrayBuffer(value)
+##### .sharedArrayBuffer(value)
+##### .dataView(value)
+
+#### Emptiness
+
+##### .emptyString(value)
+
+Returns `true` if the value is a `string` and the `.length` is 0.
+
+##### .nonEmptyString(value)
+
+Returns `true` if the value is a `string` and the `.length` is more than 0.
+
+##### .emptyStringOrWhitespace(value)
+
+Returns `true` if `is.emptyString(value)` or if it's a `string` that is all whitespace.
+
+##### .emptyArray(value)
+
+Returns `true` if the value is an `Array` and the `.length` is 0.
+
+##### .nonEmptyArray(value)
+
+Returns `true` if the value is an `Array` and the `.length` is more than 0.
+
+##### .emptyObject(value)
+
+Returns `true` if the value is an `Object` and `Object.keys(value).length` is 0.
+
+Please note that `Object.keys` returns only own enumerable properties. Hence something like this can happen:
+
+```js
+const object1 = {};
+
+Object.defineProperty(object1, 'property1', {
+ value: 42,
+ writable: true,
+ enumerable: false,
+ configurable: true
+});
+
+is.emptyObject(object1);
+// => true
+```
+
+##### .nonEmptyObject(value)
+
+Returns `true` if the value is an `Object` and `Object.keys(value).length` is more than 0.
+
+##### .emptySet(value)
+
+Returns `true` if the value is a `Set` and the `.size` is 0.
+
+##### .nonEmptySet(Value)
+
+Returns `true` if the value is a `Set` and the `.size` is more than 0.
+
+##### .emptyMap(value)
+
+Returns `true` if the value is a `Map` and the `.size` is 0.
+
+##### .nonEmptyMap(value)
+
+Returns `true` if the value is a `Map` and the `.size` is more than 0.
+
+#### Miscellaneous
+
+##### .directInstanceOf(value, class)
+
+Returns `true` if `value` is a direct instance of `class`.
+
+```js
+is.directInstanceOf(new Error(), Error);
+//=> true
+
+class UnicornError extends Error {}
+
+is.directInstanceOf(new UnicornError(), Error);
+//=> false
+```
+
+##### .urlInstance(value)
+
+Returns `true` if `value` is an instance of the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL).
+
+```js
+const url = new URL('https://example.com');
+
+is.urlInstance(url);
+//=> true
+```
+
+### .url(value)
+
+Returns `true` if `value` is a URL string.
+
+Note: this only does basic checking using the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL) constructor.
+
+```js
+const url = 'https://example.com';
+
+is.url(url);
+//=> true
+
+is.url(new URL(url));
+//=> false
+```
+
+##### .truthy(value)
+
+Returns `true` for all values that evaluate to true in a boolean context:
+
+```js
+is.truthy('🦄');
+//=> true
+
+is.truthy(undefined);
+//=> false
+```
+
+##### .falsy(value)
+
+Returns `true` if `value` is one of: `false`, `0`, `''`, `null`, `undefined`, `NaN`.
+
+##### .nan(value)
+##### .nullOrUndefined(value)
+##### .primitive(value)
+
+JavaScript primitives are as follows: `null`, `undefined`, `string`, `number`, `boolean`, `symbol`.
+
+##### .integer(value)
+
+##### .safeInteger(value)
+
+Returns `true` if `value` is a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger).
+
+##### .plainObject(value)
+
+An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.
+
+##### .iterable(value)
+##### .asyncIterable(value)
+##### .class(value)
+
+Returns `true` for instances created by a class.
+
+##### .typedArray(value)
+
+##### .arrayLike(value)
+
+A `value` is array-like if it is not a function and has a `value.length` that is a safe integer greater than or equal to 0.
+
+```js
+is.arrayLike(document.forms);
+//=> true
+
+function foo() {
+ is.arrayLike(arguments);
+ //=> true
+}
+foo();
+```
+
+##### .inRange(value, range)
+
+Check if `value` (number) is in the given `range`. The range is an array of two values, lower bound and upper bound, in no specific order.
+
+```js
+is.inRange(3, [0, 5]);
+is.inRange(3, [5, 0]);
+is.inRange(0, [-2, 2]);
+```
+
+##### .inRange(value, upperBound)
+
+Check if `value` (number) is in the range of `0` to `upperBound`.
+
+```js
+is.inRange(3, 10);
+```
+
+##### .domElement(value)
+
+Returns `true` if `value` is a DOM Element.
+
+##### .nodeStream(value)
+
+Returns `true` if `value` is a Node.js [stream](https://nodejs.org/api/stream.html).
+
+```js
+const fs = require('fs');
+
+is.nodeStream(fs.createReadStream('unicorn.png'));
+//=> true
+```
+
+##### .observable(value)
+
+Returns `true` if `value` is an `Observable`.
+
+```js
+const {Observable} = require('rxjs');
+
+is.observable(new Observable());
+//=> true
+```
+
+##### .infinite(value)
+
+Check if `value` is `Infinity` or `-Infinity`.
+
+##### .even(value)
+
+Returns `true` if `value` is an even integer.
+
+##### .odd(value)
+
+Returns `true` if `value` is an odd integer.
+
+##### .any(predicate, ...values)
+
+Returns `true` if **any** of the input `values` returns true in the `predicate`:
+
+```js
+is.any(is.string, {}, true, '🦄');
+//=> true
+
+is.any(is.boolean, 'unicorns', [], new Map());
+//=> false
+```
+
+##### .all(predicate, ...values)
+
+Returns `true` if **all** of the input `values` returns true in the `predicate`:
+
+```js
+is.all(is.object, {}, new Map(), new Set());
+//=> true
+
+is.all(is.string, '🦄', [], 'unicorns');
+//=> false
+```
+
+
+## FAQ
+
+### Why yet another type checking module?
+
+There are hundreds of type checking modules on npm, unfortunately, I couldn't find any that fit my needs:
+
+- Includes both type methods and ability to get the type
+- Types of primitives returned as lowercase and object types as camelcase
+- Covers all built-ins
+- Unsurprising behavior
+- Well-maintained
+- Comprehensive test suite
+
+For the ones I found, pick 3 of these.
+
+The most common mistakes I noticed in these modules was using `instanceof` for type checking, forgetting that functions are objects, and omitting `symbol` as a primitive.
+
+
+## Related
+
+- [ow](https://github.com/sindresorhus/ow) - Function argument validation for humans
+- [is-stream](https://github.com/sindresorhus/is-stream) - Check if something is a Node.js stream
+- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable
+- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array
+- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address
+- [is-array-sorted](https://github.com/sindresorhus/is-array-sorted) - Check if an Array is sorted
+- [is-error-constructor](https://github.com/sindresorhus/is-error-constructor) - Check if a value is an error constructor
+- [is-empty-iterable](https://github.com/sindresorhus/is-empty-iterable) - Check if an Iterable is empty
+- [is-blob](https://github.com/sindresorhus/is-blob) - Check if a value is a Blob - File-like object of immutable, raw data
+- [has-emoji](https://github.com/sindresorhus/has-emoji) - Check whether a string has any emoji
+
+
+## Created by
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Giora Guttsait](https://github.com/gioragutt)
+- [Brandon Smith](https://github.com/brandon93s)
+
+
+## License
+
+MIT
diff --git a/includes/translator/node_modules/@szmarczak/http-timer/LICENSE b/includes/translator/node_modules/@szmarczak/http-timer/LICENSE
new file mode 100755
index 0000000..15ad2e8
--- /dev/null
+++ b/includes/translator/node_modules/@szmarczak/http-timer/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Szymon Marczak
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/includes/translator/node_modules/@szmarczak/http-timer/README.md b/includes/translator/node_modules/@szmarczak/http-timer/README.md
new file mode 100755
index 0000000..13279ed
--- /dev/null
+++ b/includes/translator/node_modules/@szmarczak/http-timer/README.md
@@ -0,0 +1,70 @@
+# http-timer
+> Timings for HTTP requests
+
+[![Build Status](https://travis-ci.org/szmarczak/http-timer.svg?branch=master)](https://travis-ci.org/szmarczak/http-timer)
+[![Coverage Status](https://coveralls.io/repos/github/szmarczak/http-timer/badge.svg?branch=master)](https://coveralls.io/github/szmarczak/http-timer?branch=master)
+[![install size](https://packagephobia.now.sh/badge?p=@szmarczak/http-timer)](https://packagephobia.now.sh/result?p=@szmarczak/http-timer)
+
+Inspired by the [`request` package](https://github.com/request/request).
+
+## Usage
+```js
+'use strict';
+const https = require('https');
+const timer = require('@szmarczak/http-timer');
+
+const request = https.get('https://httpbin.org/anything');
+const timings = timer(request);
+
+request.on('response', response => {
+ response.on('data', () => {}); // Consume the data somehow
+ response.on('end', () => {
+ console.log(timings);
+ });
+});
+
+// { start: 1535708511443,
+// socket: 1535708511444,
+// lookup: 1535708511444,
+// connect: 1535708511582,
+// upload: 1535708511887,
+// response: 1535708512037,
+// end: 1535708512040,
+// phases:
+// { wait: 1,
+// dns: 0,
+// tcp: 138,
+// request: 305,
+// firstByte: 150,
+// download: 3,
+// total: 597 } }
+```
+
+## API
+
+### timer(request)
+
+Returns: `Object`
+
+- `start` - Time when the request started.
+- `socket` - Time when a socket was assigned to the request.
+- `lookup` - Time when the DNS lookup finished.
+- `connect` - Time when the socket successfully connected.
+- `upload` - Time when the request finished uploading.
+- `response` - Time when the request fired the `response` event.
+- `end` - Time when the response fired the `end` event.
+- `error` - Time when the request fired the `error` event.
+- `phases`
+ - `wait` - `timings.socket - timings.start`
+ - `dns` - `timings.lookup - timings.socket`
+ - `tcp` - `timings.connect - timings.lookup`
+ - `request` - `timings.upload - timings.connect`
+ - `firstByte` - `timings.response - timings.upload`
+ - `download` - `timings.end - timings.response`
+ - `total` - `timings.end - timings.start` or `timings.error - timings.start`
+
+**Note**: The time is a `number` representing the milliseconds elapsed since the UNIX epoch.
+
+## License
+
+MIT
diff --git a/includes/translator/node_modules/@szmarczak/http-timer/package.json b/includes/translator/node_modules/@szmarczak/http-timer/package.json
new file mode 100755
index 0000000..9346648
--- /dev/null
+++ b/includes/translator/node_modules/@szmarczak/http-timer/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "@szmarczak/http-timer",
+ "version": "1.1.2",
+ "description": "Timings for HTTP requests",
+ "main": "source",
+ "engines": {
+ "node": ">=6"
+ },
+ "scripts": {
+ "test": "xo && nyc ava",
+ "coveralls": "nyc report --reporter=text-lcov | coveralls"
+ },
+ "files": [
+ "source"
+ ],
+ "keywords": [
+ "http",
+ "https",
+ "timer",
+ "timings"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/szmarczak/http-timer.git"
+ },
+ "author": "Szymon Marczak",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/szmarczak/http-timer/issues"
+ },
+ "homepage": "https://github.com/szmarczak/http-timer#readme",
+ "xo": {
+ "rules": {
+ "unicorn/filename-case": "camelCase"
+ }
+ },
+ "devDependencies": {
+ "ava": "^0.25.0",
+ "coveralls": "^3.0.2",
+ "p-event": "^2.1.0",
+ "nyc": "^12.0.2",
+ "xo": "^0.22.0"
+ },
+ "dependencies": {
+ "defer-to-connect": "^1.0.1"
+ }
+}
diff --git a/includes/translator/node_modules/@szmarczak/http-timer/source/index.js b/includes/translator/node_modules/@szmarczak/http-timer/source/index.js
new file mode 100755
index 0000000..e294580
--- /dev/null
+++ b/includes/translator/node_modules/@szmarczak/http-timer/source/index.js
@@ -0,0 +1,99 @@
+'use strict';
+const deferToConnect = require('defer-to-connect');
+
+module.exports = request => {
+ const timings = {
+ start: Date.now(),
+ socket: null,
+ lookup: null,
+ connect: null,
+ upload: null,
+ response: null,
+ end: null,
+ error: null,
+ phases: {
+ wait: null,
+ dns: null,
+ tcp: null,
+ request: null,
+ firstByte: null,
+ download: null,
+ total: null
+ }
+ };
+
+ const handleError = origin => {
+ const emit = origin.emit.bind(origin);
+ origin.emit = (event, ...args) => {
+ // Catches the `error` event
+ if (event === 'error') {
+ timings.error = Date.now();
+ timings.phases.total = timings.error - timings.start;
+
+ origin.emit = emit;
+ }
+
+ // Saves the original behavior
+ return emit(event, ...args);
+ };
+ };
+
+ let uploadFinished = false;
+ const onUpload = () => {
+ timings.upload = Date.now();
+ timings.phases.request = timings.upload - timings.connect;
+ };
+
+ handleError(request);
+
+ request.once('socket', socket => {
+ timings.socket = Date.now();
+ timings.phases.wait = timings.socket - timings.start;
+
+ const lookupListener = () => {
+ timings.lookup = Date.now();
+ timings.phases.dns = timings.lookup - timings.socket;
+ };
+
+ socket.once('lookup', lookupListener);
+
+ deferToConnect(socket, () => {
+ timings.connect = Date.now();
+
+ if (timings.lookup === null) {
+ socket.removeListener('lookup', lookupListener);
+ timings.lookup = timings.connect;
+ timings.phases.dns = timings.lookup - timings.socket;
+ }
+
+ timings.phases.tcp = timings.connect - timings.lookup;
+
+ if (uploadFinished && !timings.upload) {
+ onUpload();
+ }
+ });
+ });
+
+ request.once('finish', () => {
+ uploadFinished = true;
+
+ if (timings.connect) {
+ onUpload();
+ }
+ });
+
+ request.once('response', response => {
+ timings.response = Date.now();
+ timings.phases.firstByte = timings.response - timings.upload;
+
+ handleError(response);
+
+ response.once('end', () => {
+ timings.end = Date.now();
+ timings.phases.download = timings.end - timings.response;
+ timings.phases.total = timings.end - timings.start;
+ });
+ });
+
+ return timings;
+};
diff --git a/includes/translator/node_modules/cacheable-request/LICENSE b/includes/translator/node_modules/cacheable-request/LICENSE
new file mode 100644
index 0000000..f27ee9b
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Luke Childs
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/includes/translator/node_modules/cacheable-request/README.md b/includes/translator/node_modules/cacheable-request/README.md
new file mode 100644
index 0000000..725e7e0
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/README.md
@@ -0,0 +1,206 @@
+# cacheable-request
+
+> Wrap native HTTP requests with RFC compliant cache support
+
+[![Build Status](https://travis-ci.org/lukechilds/cacheable-request.svg?branch=master)](https://travis-ci.org/lukechilds/cacheable-request)
+[![Coverage Status](https://coveralls.io/repos/github/lukechilds/cacheable-request/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/cacheable-request?branch=master)
+[![npm](https://img.shields.io/npm/dm/cacheable-request.svg)](https://www.npmjs.com/package/cacheable-request)
+[![npm](https://img.shields.io/npm/v/cacheable-request.svg)](https://www.npmjs.com/package/cacheable-request)
+
+[RFC 7234](http://httpwg.org/specs/rfc7234.html) compliant HTTP caching for native Node.js HTTP/HTTPS requests. Caching works out of the box in memory or is easily pluggable with a wide range of storage adapters.
+
+**Note:** This is a low level wrapper around the core HTTP modules, it's not a high level request library.
+
+## Features
+
+- Only stores cacheable responses as defined by RFC 7234
+- Fresh cache entries are served directly from cache
+- Stale cache entries are revalidated with `If-None-Match`/`If-Modified-Since` headers
+- 304 responses from revalidation requests use cached body
+- Updates `Age` header on cached responses
+- Can completely bypass cache on a per request basis
+- In memory cache by default
+- Official support for Redis, MongoDB, SQLite, PostgreSQL and MySQL storage adapters
+- Easily plug in your own or third-party storage adapters
+- If DB connection fails, cache is automatically bypassed ([disabled by default](#optsautomaticfailover))
+- Adds cache support to any existing HTTP code with minimal changes
+- Uses [http-cache-semantics](https://github.com/pornel/http-cache-semantics) internally for HTTP RFC 7234 compliance
+
+## Install
+
+```shell
+npm install cacheable-request
+```
+
+## Usage
+
+```js
+const http = require('http');
+const CacheableRequest = require('cacheable-request');
+
+// Then instead of
+const req = http.request('http://example.com', cb);
+req.end();
+
+// You can do
+const cacheableRequest = new CacheableRequest(http.request);
+const cacheReq = cacheableRequest('http://example.com', cb);
+cacheReq.on('request', req => req.end());
+// Future requests to 'example.com' will be returned from cache if still valid
+
+// You pass in any other http.request API compatible method to be wrapped with cache support:
+const cacheableRequest = new CacheableRequest(https.request);
+const cacheableRequest = new CacheableRequest(electron.net);
+```
+
+## Storage Adapters
+
+`cacheable-request` uses [Keyv](https://github.com/lukechilds/keyv) to support a wide range of storage adapters.
+
+For example, to use Redis as a cache backend, you just need to install the official Redis Keyv storage adapter:
+
+```
+npm install @keyv/redis
+```
+
+And then you can pass `CacheableRequest` your connection string:
+
+```js
+const cacheableRequest = new CacheableRequest(http.request, 'redis://user:pass@localhost:6379');
+```
+
+[View all official Keyv storage adapters.](https://github.com/lukechilds/keyv#official-storage-adapters)
+
+Keyv also supports anything that follows the Map API so it's easy to write your own storage adapter or use a third-party solution.
+
+e.g The following are all valid storage adapters
+
+```js
+const storageAdapter = new Map();
+// or
+const storageAdapter = require('./my-storage-adapter');
+// or
+const QuickLRU = require('quick-lru');
+const storageAdapter = new QuickLRU({ maxSize: 1000 });
+
+const cacheableRequest = new CacheableRequest(http.request, storageAdapter);
+```
+
+View the [Keyv docs](https://github.com/lukechilds/keyv) for more information on how to use storage adapters.
+
+## API
+
+### new cacheableRequest(request, [storageAdapter])
+
+Returns the provided request function wrapped with cache support.
+
+#### request
+
+Type: `function`
+
+Request function to wrap with cache support. Should be [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) or a similar API compatible request function.
+
+#### storageAdapter
+
+Type: `Keyv storage adapter`<br>
+Default: `new Map()`
+
+A [Keyv](https://github.com/lukechilds/keyv) storage adapter instance, or connection string if using with an official Keyv storage adapter.
+
+### Instance
+
+#### cacheableRequest(opts, [cb])
+
+Returns an event emitter.
+
+##### opts
+
+Type: `object`, `string`
+
+- Any of the default request functions options.
+- Any [`http-cache-semantics`](https://github.com/kornelski/http-cache-semantics#constructor-options) options.
+- Any of the following:
+
+###### opts.cache
+
+Type: `boolean`<br>
+Default: `true`
+
+If the cache should be used. Setting this to false will completely bypass the cache for the current request.
+
+###### opts.strictTtl
+
+Type: `boolean`<br>
+Default: `false`
+
+If set to `true` once a cached resource has expired it is deleted and will have to be re-requested.
+
+If set to `false` (default), after a cached resource's TTL expires it is kept in the cache and will be revalidated on the next request with `If-None-Match`/`If-Modified-Since` headers.
+
+###### opts.maxTtl
+
+Type: `number`<br>
+Default: `undefined`
+
+Limits TTL. The `number` represents milliseconds.
+
+###### opts.automaticFailover
+
+Type: `boolean`<br>
+Default: `false`
+
+When set to `true`, if the DB connection fails we will automatically fallback to a network request. DB errors will still be emitted to notify you of the problem even though the request callback may succeed.
+
+###### opts.forceRefresh
+
+Type: `boolean`<br>
+Default: `false`
+
+Forces refreshing the cache. If the response could be retrieved from the cache, it will perform a new request and override the cache instead.
+
+##### cb
+
+Type: `function`
+
+The callback function which will receive the response as an argument.
+
+The response can be either a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage) or a [responselike object](https://github.com/lukechilds/responselike). The response will also have a `fromCache` property set with a boolean value.
+
+##### .on('request', request)
+
+`request` event to get the request object of the request.
+
+**Note:** This event will only fire if an HTTP request is actually made, not when a response is retrieved from cache. However, you should always handle the `request` event to end the request and handle any potential request errors.
+
+##### .on('response', response)
+
+`response` event to get the response object from the HTTP request or cache.
+
+##### .on('error', error)
+
+`error` event emitted in case of an error with the cache.
+
+Errors emitted here will be an instance of `CacheableRequest.RequestError` or `CacheableRequest.CacheError`. You will only ever receive a `RequestError` if the request function throws (normally caused by invalid user input). Normal request errors should be handled inside the `request` event.
+
+To properly handle all error scenarios you should use the following pattern:
+
+```js
+cacheableRequest('example.com', cb)
+ .on('error', err => {
+ if (err instanceof CacheableRequest.CacheError) {
+ handleCacheError(err); // Cache error
+ } else if (err instanceof CacheableRequest.RequestError) {
+ handleRequestError(err); // Request function thrown
+ }
+ })
+ .on('request', req => {
+ req.on('error', handleRequestError); // Request error emitted
+ req.end();
+ });
+```
+
+**Note:** Database connection errors are emitted here, however `cacheable-request` will attempt to re-request the resource and bypass the cache on a connection error. Therefore a database connection error doesn't necessarily mean the request won't be fulfilled.
+
+## License
+
+MIT © Luke Childs
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js
new file mode 100644
index 0000000..2dd7574
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js
@@ -0,0 +1,52 @@
+'use strict';
+const {PassThrough: PassThroughStream} = require('stream');
+
+module.exports = options => {
+ options = {...options};
+
+ const {array} = options;
+ let {encoding} = options;
+ const isBuffer = encoding === 'buffer';
+ let objectMode = false;
+
+ if (array) {
+ objectMode = !(encoding || isBuffer);
+ } else {
+ encoding = encoding || 'utf8';
+ }
+
+ if (isBuffer) {
+ encoding = null;
+ }
+
+ const stream = new PassThroughStream({objectMode});
+
+ if (encoding) {
+ stream.setEncoding(encoding);
+ }
+
+ let length = 0;
+ const chunks = [];
+
+ stream.on('data', chunk => {
+ chunks.push(chunk);
+
+ if (objectMode) {
+ length = chunks.length;
+ } else {
+ length += chunk.length;
+ }
+ });
+
+ stream.getBufferedValue = () => {
+ if (array) {
+ return chunks;
+ }
+
+ return isBuffer ? Buffer.concat(chunks, length) : chunks.join('');
+ };
+
+ stream.getBufferedLength = () => length;
+
+ return stream;
+};
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/get-stream/index.d.ts b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/index.d.ts
new file mode 100644
index 0000000..7b98134
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/index.d.ts
@@ -0,0 +1,108 @@
+/// <reference types="node"/>
+import {Stream} from 'stream';
+
+declare class MaxBufferErrorClass extends Error {
+ readonly name: 'MaxBufferError';
+ constructor();
+}
+
+declare namespace getStream {
+ interface Options {
+ /**
+ Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `MaxBufferError` error.
+
+ @default Infinity
+ */
+ readonly maxBuffer?: number;
+ }
+
+ interface OptionsWithEncoding<EncodingType = BufferEncoding> extends Options {
+ /**
+ [Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream.
+
+ @default 'utf8'
+ */
+ readonly encoding?: EncodingType;
+ }
+
+ type MaxBufferError = MaxBufferErrorClass;
+}
+
+declare const getStream: {
+ /**
+ Get the `stream` as a string.
+
+ @returns A promise that resolves when the end event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode.
+
+ @example
+ ```
+ import * as fs from 'fs';
+ import getStream = require('get-stream');
+
+ (async () => {
+ const stream = fs.createReadStream('unicorn.txt');
+
+ console.log(await getStream(stream));
+ // ,,))))))));,
+ // __)))))))))))))),
+ // \|/ -\(((((''''((((((((.
+ // -*-==//////(('' . `)))))),
+ // /|\ ))| o ;-. '((((( ,(,
+ // ( `| / ) ;))))' ,_))^;(~
+ // | | | ,))((((_ _____------~~~-. %,;(;(>';'~
+ // o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~
+ // ; ''''```` `: `:::|\,__,%% );`'; ~
+ // | _ ) / `:|`----' `-'
+ // ______/\/~ | / /
+ // /~;;.____/;;' / ___--,-( `;;;/
+ // / // _;______;'------~~~~~ /;;/\ /
+ // // | | / ; \;;,\
+ // (<_ | ; /',/-----' _>
+ // \_| ||_ //~;~~~~~~~~~
+ // `\_| (,~~
+ // \~\
+ // ~~
+ })();
+ ```
+ */
+ (stream: Stream, options?: getStream.OptionsWithEncoding): Promise<string>;
+
+ /**
+ Get the `stream` as a buffer.
+
+ It honors the `maxBuffer` option as above, but it refers to byte length rather than string length.
+ */
+ buffer(
+ stream: Stream,
+ options?: getStream.OptionsWithEncoding
+ ): Promise<Buffer>;
+
+ /**
+ Get the `stream` as an array of values.
+
+ It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen:
+
+ - When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes).
+ - When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array.
+ - When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array.
+ */
+ array<StreamObjectModeType>(
+ stream: Stream,
+ options?: getStream.Options
+ ): Promise<StreamObjectModeType[]>;
+ array(
+ stream: Stream,
+ options: getStream.OptionsWithEncoding<'buffer'>
+ ): Promise<Buffer[]>;
+ array(
+ stream: Stream,
+ options: getStream.OptionsWithEncoding<BufferEncoding>
+ ): Promise<string[]>;
+
+ MaxBufferError: typeof MaxBufferErrorClass;
+
+ // TODO: Remove this for the next major release
+ default: typeof getStream;
+};
+
+export = getStream;
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/get-stream/index.js b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/index.js
new file mode 100644
index 0000000..71f3991
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/index.js
@@ -0,0 +1,60 @@
+'use strict';
+const {constants: BufferConstants} = require('buffer');
+const pump = require('pump');
+const bufferStream = require('./buffer-stream');
+
+class MaxBufferError extends Error {
+ constructor() {
+ super('maxBuffer exceeded');
+ this.name = 'MaxBufferError';
+ }
+}
+
+async function getStream(inputStream, options) {
+ if (!inputStream) {
+ return Promise.reject(new Error('Expected a stream'));
+ }
+
+ options = {
+ maxBuffer: Infinity,
+ ...options
+ };
+
+ const {maxBuffer} = options;
+
+ let stream;
+ await new Promise((resolve, reject) => {
+ const rejectPromise = error => {
+ // Don't retrieve an oversized buffer.
+ if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
+ error.bufferedData = stream.getBufferedValue();
+ }
+
+ reject(error);
+ };
+
+ stream = pump(inputStream, bufferStream(options), error => {
+ if (error) {
+ rejectPromise(error);
+ return;
+ }
+
+ resolve();
+ });
+
+ stream.on('data', () => {
+ if (stream.getBufferedLength() > maxBuffer) {
+ rejectPromise(new MaxBufferError());
+ }
+ });
+ });
+
+ return stream.getBufferedValue();
+}
+
+module.exports = getStream;
+// TODO: Remove this for the next major release
+module.exports.default = getStream;
+module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});
+module.exports.array = (stream, options) => getStream(stream, {...options, array: true});
+module.exports.MaxBufferError = MaxBufferError;
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/get-stream/license b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/license
new file mode 100644
index 0000000..fa7ceba
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/get-stream/package.json b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/package.json
new file mode 100644
index 0000000..e2f1687
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/package.json
@@ -0,0 +1,50 @@
+{
+ "name": "get-stream",
+ "version": "5.2.0",
+ "description": "Get a stream as a string, buffer, or array",
+ "license": "MIT",
+ "repository": "sindresorhus/get-stream",
+ "funding": "https://github.com/sponsors/sindresorhus",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "https://sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts",
+ "buffer-stream.js"
+ ],
+ "keywords": [
+ "get",
+ "stream",
+ "promise",
+ "concat",
+ "string",
+ "text",
+ "buffer",
+ "read",
+ "data",
+ "consume",
+ "readable",
+ "readablestream",
+ "array",
+ "object"
+ ],
+ "dependencies": {
+ "pump": "^3.0.0"
+ },
+ "devDependencies": {
+ "@types/node": "^12.0.7",
+ "ava": "^2.0.0",
+ "into-stream": "^5.0.0",
+ "tsd": "^0.7.2",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/get-stream/readme.md b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/readme.md
new file mode 100644
index 0000000..7d7565d
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/get-stream/readme.md
@@ -0,0 +1,124 @@
+# get-stream [![Build Status](https://travis-ci.com/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.com/github/sindresorhus/get-stream)
+
+> Get a stream as a string, buffer, or array
+
+## Install
+
+```
+$ npm install get-stream
+```
+
+## Usage
+
+```js
+const fs = require('fs');
+const getStream = require('get-stream');
+
+(async () => {
+ const stream = fs.createReadStream('unicorn.txt');
+
+ console.log(await getStream(stream));
+ /*
+ ,,))))))));,
+ __)))))))))))))),
+ \|/ -\(((((''''((((((((.
+ -*-==//////(('' . `)))))),
+ /|\ ))| o ;-. '((((( ,(,
+ ( `| / ) ;))))' ,_))^;(~
+ | | | ,))((((_ _____------~~~-. %,;(;(>';'~
+ o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~
+ ; ''''```` `: `:::|\,__,%% );`'; ~
+ | _ ) / `:|`----' `-'
+ ______/\/~ | / /
+ /~;;.____/;;' / ___--,-( `;;;/
+ / // _;______;'------~~~~~ /;;/\ /
+ // | | / ; \;;,\
+ (<_ | ; /',/-----' _>
+ \_| ||_ //~;~~~~~~~~~
+ `\_| (,~~
+ \~\
+ ~~
+ */
+})();
+```
+
+## API
+
+The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode.
+
+### getStream(stream, options?)
+
+Get the `stream` as a string.
+
+#### options
+
+Type: `object`
+
+##### encoding
+
+Type: `string`\
+Default: `'utf8'`
+
+[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream.
+
+##### maxBuffer
+
+Type: `number`\
+Default: `Infinity`
+
+Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `getStream.MaxBufferError` error.
+
+### getStream.buffer(stream, options?)
+
+Get the `stream` as a buffer.
+
+It honors the `maxBuffer` option as above, but it refers to byte length rather than string length.
+
+### getStream.array(stream, options?)
+
+Get the `stream` as an array of values.
+
+It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen:
+
+- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes).
+
+- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array.
+
+- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array.
+
+## Errors
+
+If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error.
+
+```js
+(async () => {
+ try {
+ await getStream(streamThatErrorsAtTheEnd('unicorn'));
+ } catch (error) {
+ console.log(error.bufferedData);
+ //=> 'unicorn'
+ }
+})()
+```
+
+## FAQ
+
+### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)?
+
+This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package.
+
+## Related
+
+- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer
+
+---
+
+<div align="center">
+ <b>
+ <a href="https://tidelift.com/subscription/pkg/npm-get-stream?utm_source=npm-get-stream&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
+ </b>
+ <br>
+ <sub>
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
+ </sub>
+</div>
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/index.d.ts b/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/index.d.ts
new file mode 100644
index 0000000..dc90a75
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/index.d.ts
@@ -0,0 +1,16 @@
+/**
+Lowercase the keys of an object.
+
+@returns A new object with the keys lowercased.
+
+@example
+```
+import lowercaseKeys = require('lowercase-keys');
+
+lowercaseKeys({FOO: true, bAr: false});
+//=> {foo: true, bar: false}
+```
+*/
+declare function lowercaseKeys<T extends unknown>(object: {[key: string]: T}): {[key: string]: T};
+
+export = lowercaseKeys;
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/index.js b/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/index.js
new file mode 100644
index 0000000..357fb8f
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/index.js
@@ -0,0 +1,10 @@
+'use strict';
+module.exports = object => {
+ const result = {};
+
+ for (const [key, value] of Object.entries(object)) {
+ result[key.toLowerCase()] = value;
+ }
+
+ return result;
+};
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/license b/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/package.json b/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/package.json
new file mode 100644
index 0000000..c11d813
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "lowercase-keys",
+ "version": "2.0.0",
+ "description": "Lowercase the keys of an object",
+ "license": "MIT",
+ "repository": "sindresorhus/lowercase-keys",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "object",
+ "assign",
+ "extend",
+ "properties",
+ "lowercase",
+ "lower-case",
+ "case",
+ "keys",
+ "key"
+ ],
+ "devDependencies": {
+ "ava": "^1.4.1",
+ "tsd": "^0.7.2",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/readme.md b/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/readme.md
new file mode 100644
index 0000000..b1ed061
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/node_modules/lowercase-keys/readme.md
@@ -0,0 +1,32 @@
+# lowercase-keys [![Build Status](https://travis-ci.org/sindresorhus/lowercase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/lowercase-keys)
+
+> Lowercase the keys of an object
+
+
+## Install
+
+```
+$ npm install lowercase-keys
+```
+
+
+## Usage
+
+```js
+const lowercaseKeys = require('lowercase-keys');
+
+lowercaseKeys({FOO: true, bAr: false});
+//=> {foo: true, bar: false}
+```
+
+
+## API
+
+### lowercaseKeys(object)
+
+Returns a new object with the keys lowercased.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/cacheable-request/package.json b/includes/translator/node_modules/cacheable-request/package.json
new file mode 100644
index 0000000..7734e03
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/package.json
@@ -0,0 +1,56 @@
+{
+ "name": "cacheable-request",
+ "version": "6.1.0",
+ "description": "Wrap native HTTP requests with RFC compliant cache support",
+ "license": "MIT",
+ "repository": "lukechilds/cacheable-request",
+ "author": "Luke Childs <lukechilds123@gmail.com> (http://lukechilds.co.uk)",
+ "main": "src/index.js",
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && nyc ava",
+ "coverage": "nyc report --reporter=text-lcov | coveralls"
+ },
+ "files": [
+ "src"
+ ],
+ "keywords": [
+ "HTTP",
+ "HTTPS",
+ "cache",
+ "caching",
+ "layer",
+ "cacheable",
+ "RFC 7234",
+ "RFC",
+ "7234",
+ "compliant"
+ ],
+ "dependencies": {
+ "clone-response": "^1.0.2",
+ "get-stream": "^5.1.0",
+ "http-cache-semantics": "^4.0.0",
+ "keyv": "^3.0.0",
+ "lowercase-keys": "^2.0.0",
+ "normalize-url": "^4.1.0",
+ "responselike": "^1.0.2"
+ },
+ "devDependencies": {
+ "@keyv/sqlite": "^2.0.0",
+ "ava": "^1.1.0",
+ "coveralls": "^3.0.0",
+ "create-test-server": "3.0.0",
+ "delay": "^4.0.0",
+ "eslint-config-xo-lukechilds": "^1.0.0",
+ "nyc": "^14.1.1",
+ "pify": "^4.0.0",
+ "sqlite3": "^4.0.2",
+ "this": "^1.0.2",
+ "xo": "^0.23.0"
+ },
+ "xo": {
+ "extends": "xo-lukechilds"
+ }
+}
diff --git a/includes/translator/node_modules/cacheable-request/src/index.js b/includes/translator/node_modules/cacheable-request/src/index.js
new file mode 100644
index 0000000..3fcea3f
--- /dev/null
+++ b/includes/translator/node_modules/cacheable-request/src/index.js
@@ -0,0 +1,251 @@
+'use strict';
+
+const EventEmitter = require('events');
+const urlLib = require('url');
+const normalizeUrl = require('normalize-url');
+const getStream = require('get-stream');
+const CachePolicy = require('http-cache-semantics');
+const Response = require('responselike');
+const lowercaseKeys = require('lowercase-keys');
+const cloneResponse = require('clone-response');
+const Keyv = require('keyv');
+
+class CacheableRequest {
+ constructor(request, cacheAdapter) {
+ if (typeof request !== 'function') {
+ throw new TypeError('Parameter `request` must be a function');
+ }
+
+ this.cache = new Keyv({
+ uri: typeof cacheAdapter === 'string' && cacheAdapter,
+ store: typeof cacheAdapter !== 'string' && cacheAdapter,
+ namespace: 'cacheable-request'
+ });
+
+ return this.createCacheableRequest(request);
+ }
+
+ createCacheableRequest(request) {
+ return (opts, cb) => {
+ let url;
+ if (typeof opts === 'string') {
+ url = normalizeUrlObject(urlLib.parse(opts));
+ opts = {};
+ } else if (opts instanceof urlLib.URL) {
+ url = normalizeUrlObject(urlLib.parse(opts.toString()));
+ opts = {};
+ } else {
+ const [pathname, ...searchParts] = (opts.path || '').split('?');
+ const search = searchParts.length > 0 ?
+ `?${searchParts.join('?')}` :
+ '';
+ url = normalizeUrlObject({ ...opts, pathname, search });
+ }
+
+ opts = {
+ headers: {},
+ method: 'GET',
+ cache: true,
+ strictTtl: false,
+ automaticFailover: false,
+ ...opts,
+ ...urlObjectToRequestOptions(url)
+ };
+ opts.headers = lowercaseKeys(opts.headers);
+
+ const ee = new EventEmitter();
+ const normalizedUrlString = normalizeUrl(
+ urlLib.format(url),
+ {
+ stripWWW: false,
+ removeTrailingSlash: false,
+ stripAuthentication: false
+ }
+ );
+ const key = `${opts.method}:${normalizedUrlString}`;
+ let revalidate = false;
+ let madeRequest = false;
+
+ const makeRequest = opts => {
+ madeRequest = true;
+ let requestErrored = false;
+ let requestErrorCallback;
+
+ const requestErrorPromise = new Promise(resolve => {
+ requestErrorCallback = () => {
+ if (!requestErrored) {
+ requestErrored = true;
+ resolve();
+ }
+ };
+ });
+
+ const handler = response => {
+ if (revalidate && !opts.forceRefresh) {
+ response.status = response.statusCode;
+ const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response);
+ if (!revalidatedPolicy.modified) {
+ const headers = revalidatedPolicy.policy.responseHeaders();
+ response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url);
+ response.cachePolicy = revalidatedPolicy.policy;
+ response.fromCache = true;
+ }
+ }
+
+ if (!response.fromCache) {
+ response.cachePolicy = new CachePolicy(opts, response, opts);
+ response.fromCache = false;
+ }
+
+ let clonedResponse;
+ if (opts.cache && response.cachePolicy.storable()) {
+ clonedResponse = cloneResponse(response);
+
+ (async () => {
+ try {
+ const bodyPromise = getStream.buffer(response);
+
+ await Promise.race([
+ requestErrorPromise,
+ new Promise(resolve => response.once('end', resolve))
+ ]);
+
+ if (requestErrored) {
+ return;
+ }
+
+ const body = await bodyPromise;
+
+ const value = {
+ cachePolicy: response.cachePolicy.toObject(),
+ url: response.url,
+ statusCode: response.fromCache ? revalidate.statusCode : response.statusCode,
+ body
+ };
+
+ let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined;
+ if (opts.maxTtl) {
+ ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl;
+ }
+
+ await this.cache.set(key, value, ttl);
+ } catch (error) {
+ ee.emit('error', new CacheableRequest.CacheError(error));
+ }
+ })();
+ } else if (opts.cache && revalidate) {
+ (async () => {
+ try {
+ await this.cache.delete(key);
+ } catch (error) {
+ ee.emit('error', new CacheableRequest.CacheError(error));
+ }
+ })();
+ }
+
+ ee.emit('response', clonedResponse || response);
+ if (typeof cb === 'function') {
+ cb(clonedResponse || response);
+ }
+ };
+
+ try {
+ const req = request(opts, handler);
+ req.once('error', requestErrorCallback);
+ req.once('abort', requestErrorCallback);
+ ee.emit('request', req);
+ } catch (error) {
+ ee.emit('error', new CacheableRequest.RequestError(error));
+ }
+ };
+
+ (async () => {
+ const get = async opts => {
+ await Promise.resolve();
+
+ const cacheEntry = opts.cache ? await this.cache.get(key) : undefined;
+ if (typeof cacheEntry === 'undefined') {
+ return makeRequest(opts);
+ }
+
+ const policy = CachePolicy.fromObject(cacheEntry.cachePolicy);
+ if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) {
+ const headers = policy.responseHeaders();
+ const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url);
+ response.cachePolicy = policy;
+ response.fromCache = true;
+
+ ee.emit('response', response);
+ if (typeof cb === 'function') {
+ cb(response);
+ }
+ } else {
+ revalidate = cacheEntry;
+ opts.headers = policy.revalidationHeaders(opts);
+ makeRequest(opts);
+ }
+ };
+
+ const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error));
+ this.cache.once('error', errorHandler);
+ ee.on('response', () => this.cache.removeListener('error', errorHandler));
+
+ try {
+ await get(opts);
+ } catch (error) {
+ if (opts.automaticFailover && !madeRequest) {
+ makeRequest(opts);
+ }
+
+ ee.emit('error', new CacheableRequest.CacheError(error));
+ }
+ })();
+
+ return ee;
+ };
+ }
+}
+
+function urlObjectToRequestOptions(url) {
+ const options = { ...url };
+ options.path = `${url.pathname || '/'}${url.search || ''}`;
+ delete options.pathname;
+ delete options.search;
+ return options;
+}
+
+function normalizeUrlObject(url) {
+ // If url was parsed by url.parse or new URL:
+ // - hostname will be set
+ // - host will be hostname[:port]
+ // - port will be set if it was explicit in the parsed string
+ // Otherwise, url was from request options:
+ // - hostname or host may be set
+ // - host shall not have port encoded
+ return {
+ protocol: url.protocol,
+ auth: url.auth,
+ hostname: url.hostname || url.host || 'localhost',
+ port: url.port,
+ pathname: url.pathname,
+ search: url.search
+ };
+}
+
+CacheableRequest.RequestError = class extends Error {
+ constructor(error) {
+ super(error.message);
+ this.name = 'RequestError';
+ Object.assign(this, error);
+ }
+};
+
+CacheableRequest.CacheError = class extends Error {
+ constructor(error) {
+ super(error.message);
+ this.name = 'CacheError';
+ Object.assign(this, error);
+ }
+};
+
+module.exports = CacheableRequest;
diff --git a/includes/translator/node_modules/clone-response/LICENSE b/includes/translator/node_modules/clone-response/LICENSE
new file mode 100644
index 0000000..f27ee9b
--- /dev/null
+++ b/includes/translator/node_modules/clone-response/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Luke Childs
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/includes/translator/node_modules/clone-response/README.md b/includes/translator/node_modules/clone-response/README.md
new file mode 100644
index 0000000..d037cfe
--- /dev/null
+++ b/includes/translator/node_modules/clone-response/README.md
@@ -0,0 +1,62 @@
+# clone-response
+
+> Clone a Node.js HTTP response stream
+
+[![Build Status](https://travis-ci.org/lukechilds/clone-response.svg?branch=master)](https://travis-ci.org/lukechilds/clone-response)
+[![Coverage Status](https://coveralls.io/repos/github/lukechilds/clone-response/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/clone-response?branch=master)
+[![npm](https://img.shields.io/npm/dm/clone-response.svg)](https://www.npmjs.com/package/clone-response)
+[![npm](https://img.shields.io/npm/v/clone-response.svg)](https://www.npmjs.com/package/clone-response)
+
+Returns a new stream and copies over all properties and methods from the original response giving you a complete duplicate.
+
+This is useful in situations where you need to consume the response stream but also want to pass an unconsumed stream somewhere else to be consumed later.
+
+## Install
+
+```shell
+npm install --save clone-response
+```
+
+## Usage
+
+```js
+const http = require('http');
+const cloneResponse = require('clone-response');
+
+http.get('http://example.com', response => {
+ const clonedResponse = cloneResponse(response);
+ response.pipe(process.stdout);
+
+ setImmediate(() => {
+ // The response stream has already been consumed by the time this executes,
+ // however the cloned response stream is still available.
+ doSomethingWithResponse(clonedResponse);
+ });
+});
+```
+
+Please bear in mind that the process of cloning a stream consumes it. However, you can consume a stream multiple times in the same tick, therefore allowing you to create multiple clones. e.g:
+
+```js
+const clone1 = cloneResponse(response);
+const clone2 = cloneResponse(response);
+// response can still be consumed in this tick but cannot be consumed if passed
+// into any async callbacks. clone1 and clone2 can be passed around and be
+// consumed in the future.
+```
+
+## API
+
+### cloneResponse(response)
+
+Returns a clone of the passed in response.
+
+#### response
+
+Type: `stream`
+
+A [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage) to clone.
+
+## License
+
+MIT © Luke Childs
diff --git a/includes/translator/node_modules/clone-response/package.json b/includes/translator/node_modules/clone-response/package.json
new file mode 100644
index 0000000..a4a0810
--- /dev/null
+++ b/includes/translator/node_modules/clone-response/package.json
@@ -0,0 +1,41 @@
+{
+ "name": "clone-response",
+ "version": "1.0.3",
+ "description": "Clone a Node.js HTTP response stream",
+ "main": "src/index.js",
+ "scripts": {
+ "test": "xo && nyc ava",
+ "coverage": "nyc report --reporter=text-lcov | coveralls"
+ },
+ "funding": "https://github.com/sponsors/sindresorhus",
+ "xo": {
+ "extends": "xo-lukechilds"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/clone-response.git"
+ },
+ "keywords": [
+ "clone",
+ "duplicate",
+ "copy",
+ "response",
+ "HTTP",
+ "stream"
+ ],
+ "author": "Luke Childs <lukechilds123@gmail.com> (http://lukechilds.co.uk)",
+ "license": "MIT",
+ "dependencies": {
+ "mimic-response": "^1.0.0"
+ },
+ "devDependencies": {
+ "ava": "^0.22.0",
+ "coveralls": "^2.13.1",
+ "create-test-server": "^2.0.1",
+ "eslint-config-xo-lukechilds": "^1.0.0",
+ "get-stream": "^3.0.0",
+ "nyc": "^11.0.2",
+ "pify": "^3.0.0",
+ "xo": "^0.19.0"
+ }
+}
diff --git a/includes/translator/node_modules/clone-response/src/index.js b/includes/translator/node_modules/clone-response/src/index.js
new file mode 100644
index 0000000..0285dff
--- /dev/null
+++ b/includes/translator/node_modules/clone-response/src/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+const PassThrough = require('stream').PassThrough;
+const mimicResponse = require('mimic-response');
+
+const cloneResponse = response => {
+ if (!(response && response.pipe)) {
+ throw new TypeError('Parameter `response` must be a response stream.');
+ }
+
+ const clone = new PassThrough();
+ mimicResponse(response, clone);
+
+ return response.pipe(clone);
+};
+
+module.exports = cloneResponse;
diff --git a/includes/translator/node_modules/configstore/index.js b/includes/translator/node_modules/configstore/index.js
new file mode 100644
index 0000000..cd8f19f
--- /dev/null
+++ b/includes/translator/node_modules/configstore/index.js
@@ -0,0 +1,106 @@
+'use strict';
+const path = require('path');
+const os = require('os');
+const fs = require('graceful-fs');
+const makeDir = require('make-dir');
+const xdgBasedir = require('xdg-basedir');
+const writeFileAtomic = require('write-file-atomic');
+const dotProp = require('dot-prop');
+const uniqueString = require('unique-string');
+
+const configDir = xdgBasedir.config || path.join(os.tmpdir(), uniqueString());
+const permissionError = 'You don\'t have access to this file.';
+const makeDirOptions = {mode: 0o0700};
+const writeFileOptions = {mode: 0o0600};
+
+class Configstore {
+ constructor(id, defaults, options = {}) {
+ const pathPrefix = options.globalConfigPath ?
+ path.join(id, 'config.json') :
+ path.join('configstore', `${id}.json`);
+
+ this.path = options.configPath || path.join(configDir, pathPrefix);
+
+ if (defaults) {
+ this.all = Object.assign({}, defaults, this.all);
+ }
+ }
+
+ get all() {
+ try {
+ return JSON.parse(fs.readFileSync(this.path, 'utf8'));
+ } catch (error) {
+ // Create directory if it doesn't exist
+ if (error.code === 'ENOENT') {
+ return {};
+ }
+
+ // Improve the message of permission errors
+ if (error.code === 'EACCES') {
+ error.message = `${error.message}\n${permissionError}\n`;
+ }
+
+ // Empty the file if it encounters invalid JSON
+ if (error.name === 'SyntaxError') {
+ writeFileAtomic.sync(this.path, '', writeFileOptions);
+ return {};
+ }
+
+ throw error;
+ }
+ }
+
+ set all(value) {
+ try {
+ // Make sure the folder exists as it could have been deleted in the meantime
+ makeDir.sync(path.dirname(this.path), makeDirOptions);
+
+ writeFileAtomic.sync(this.path, JSON.stringify(value, null, '\t'), writeFileOptions);
+ } catch (error) {
+ // Improve the message of permission errors
+ if (error.code === 'EACCES') {
+ error.message = `${error.message}\n${permissionError}\n`;
+ }
+
+ throw error;
+ }
+ }
+
+ get size() {
+ return Object.keys(this.all || {}).length;
+ }
+
+ get(key) {
+ return dotProp.get(this.all, key);
+ }
+
+ set(key, value) {
+ const config = this.all;
+
+ if (arguments.length === 1) {
+ for (const k of Object.keys(key)) {
+ dotProp.set(config, k, key[k]);
+ }
+ } else {
+ dotProp.set(config, key, value);
+ }
+
+ this.all = config;
+ }
+
+ has(key) {
+ return dotProp.has(this.all, key);
+ }
+
+ delete(key) {
+ const config = this.all;
+ dotProp.delete(config, key);
+ this.all = config;
+ }
+
+ clear() {
+ this.all = {};
+ }
+}
+
+module.exports = Configstore;
diff --git a/includes/translator/node_modules/configstore/license b/includes/translator/node_modules/configstore/license
new file mode 100644
index 0000000..1043c8b
--- /dev/null
+++ b/includes/translator/node_modules/configstore/license
@@ -0,0 +1,25 @@
+BSD 2-Clause License
+
+Copyright (c) Google
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/includes/translator/node_modules/configstore/package.json b/includes/translator/node_modules/configstore/package.json
new file mode 100644
index 0000000..d14913f
--- /dev/null
+++ b/includes/translator/node_modules/configstore/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "configstore",
+ "version": "4.0.0",
+ "description": "Easily load and save config without having to think about where and how",
+ "license": "BSD-2-Clause",
+ "repository": "yeoman/configstore",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "config",
+ "store",
+ "storage",
+ "conf",
+ "configuration",
+ "settings",
+ "preferences",
+ "json",
+ "data",
+ "persist",
+ "persistent",
+ "save"
+ ],
+ "dependencies": {
+ "dot-prop": "^4.1.0",
+ "graceful-fs": "^4.1.2",
+ "make-dir": "^1.0.0",
+ "unique-string": "^1.0.0",
+ "write-file-atomic": "^2.0.0",
+ "xdg-basedir": "^3.0.0"
+ },
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ }
+}
diff --git a/includes/translator/node_modules/configstore/readme.md b/includes/translator/node_modules/configstore/readme.md
new file mode 100644
index 0000000..797d6a0
--- /dev/null
+++ b/includes/translator/node_modules/configstore/readme.md
@@ -0,0 +1,132 @@
+# configstore [![Build Status](https://travis-ci.org/yeoman/configstore.svg?branch=master)](https://travis-ci.org/yeoman/configstore)
+
+> Easily load and persist config without having to think about where and how
+
+Config is stored in a JSON file located in `$XDG_CONFIG_HOME` or `~/.config`.<br>
+Example: `~/.config/configstore/some-id.json`
+
+*If you need this for Electron, check out [`electron-store`](https://github.com/sindresorhus/electron-store) instead.*
+
+
+## Install
+
+```
+$ npm install configstore
+```
+
+
+## Usage
+
+```js
+const Configstore = require('configstore');
+const pkg = require('./package.json');
+
+// create a Configstore instance with an unique ID e.g.
+// Package name and optionally some default values
+const conf = new Configstore(pkg.name, {foo: 'bar'});
+
+console.log(conf.get('foo'));
+//=> 'bar'
+
+conf.set('awesome', true);
+console.log(conf.get('awesome'));
+//=> true
+
+// Use dot-notation to access nested properties
+conf.set('bar.baz', true);
+console.log(conf.get('bar'));
+//=> {baz: true}
+
+conf.delete('awesome');
+console.log(conf.get('awesome'));
+//=> undefined
+```
+
+
+## API
+
+### Configstore(packageName, [defaults], [options])
+
+Returns a new instance.
+
+#### packageName
+
+Type: `string`
+
+Name of your package.
+
+#### defaults
+
+Type: `Object`
+
+Default config.
+
+#### options
+
+##### globalConfigPath
+
+Type: `boolean`<br>
+Default: `false`
+
+Store the config at `$CONFIG/package-name/config.json` instead of the default `$CONFIG/configstore/package-name.json`. This is not recommended as you might end up conflicting with other tools, rendering the "without having to think" idea moot.
+
+##### configPath
+
+Type: `string`<br>
+Default: Automatic
+
+**Please don't use this option unless absolutely necessary and you know what you're doing.**
+
+Set the path of the config file. Overrides the `packageName` and `globalConfigPath` options.
+
+### Instance
+
+You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.
+
+### .set(key, value)
+
+Set an item.
+
+### .set(object)
+
+Set multiple items at once.
+
+### .get(key)
+
+Get an item.
+
+### .has(key)
+
+Check if an item exists.
+
+### .delete(key)
+
+Delete an item.
+
+### .clear()
+
+Delete all items.
+
+### .size
+
+Get the item count.
+
+### .path
+
+Get the path to the config file. Can be used to show the user where the config file is located or even better open it for them.
+
+### .all
+
+Get all the config as an object or replace the current config with an object:
+
+```js
+conf.all = {
+ hello: 'world'
+};
+```
+
+
+## License
+
+[BSD license](http://opensource.org/licenses/bsd-license.php)<br>
+Copyright Google
diff --git a/includes/translator/node_modules/crypto-random-string/index.js b/includes/translator/node_modules/crypto-random-string/index.js
new file mode 100644
index 0000000..ceaf65b
--- /dev/null
+++ b/includes/translator/node_modules/crypto-random-string/index.js
@@ -0,0 +1,10 @@
+'use strict';
+const crypto = require('crypto');
+
+module.exports = len => {
+ if (!Number.isFinite(len)) {
+ throw new TypeError('Expected a finite number');
+ }
+
+ return crypto.randomBytes(Math.ceil(len / 2)).toString('hex').slice(0, len);
+};
diff --git a/includes/translator/node_modules/crypto-random-string/license b/includes/translator/node_modules/crypto-random-string/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/includes/translator/node_modules/crypto-random-string/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/includes/translator/node_modules/crypto-random-string/package.json b/includes/translator/node_modules/crypto-random-string/package.json
new file mode 100644
index 0000000..d70c1f0
--- /dev/null
+++ b/includes/translator/node_modules/crypto-random-string/package.json
@@ -0,0 +1,43 @@
+{
+ "name": "crypto-random-string",
+ "version": "1.0.0",
+ "description": "Generate a cryptographically strong random string",
+ "license": "MIT",
+ "repository": "sindresorhus/crypto-random-string",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "random",
+ "string",
+ "str",
+ "rand",
+ "text",
+ "id",
+ "identifier",
+ "slug",
+ "salt",
+ "crypto",
+ "strong",
+ "secure",
+ "hex"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "xo": {
+ "esnext": true
+ }
+}
diff --git a/includes/translator/node_modules/crypto-random-string/readme.md b/includes/translator/node_modules/crypto-random-string/readme.md
new file mode 100644
index 0000000..dab5a2e
--- /dev/null
+++ b/includes/translator/node_modules/crypto-random-string/readme.md
@@ -0,0 +1,49 @@
+# crypto-random-string [![Build Status](https://travis-ci.org/sindresorhus/crypto-random-string.svg?branch=master)](https://travis-ci.org/sindresorhus/crypto-random-string)
+
+> Generate a [cryptographically strong](https://en.m.wikipedia.org/wiki/Strong_cryptography) random string
+
+Can be useful for creating an identifier, slug, salt, fixture, etc.
+
+
+## Install
+
+```
+$ npm install --save crypto-random-string
+```
+
+
+## Usage
+
+```js
+const cryptoRandomString = require('crypto-random-string');
+
+cryptoRandomString(10);
+//=> '2cf05d94db'
+```
+
+
+## API
+
+### cryptoRandomString(length)
+
+#### length
+
+Type: `number`
+
+Length of the returned string.
+
+
+## Related
+
+- [random-int](https://github.com/sindresorhus/random-int) - Generate a random integer
+- [random-float](https://github.com/sindresorhus/random-float) - Generate a random float
+- [random-item](https://github.com/sindresorhus/random-item) - Get a random item from an array
+- [random-boolean](https://github.com/arthurvr/random-boolean) - Get a random boolean
+- [random-obj-key](https://github.com/sindresorhus/random-obj-key) - Get a random key from an object
+- [random-obj-prop](https://github.com/sindresorhus/random-obj-prop) - Get a random property from an object
+- [unique-random](https://github.com/sindresorhus/unique-random) - Generate random numbers that are consecutively unique
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/decompress-response/index.js b/includes/translator/node_modules/decompress-response/index.js
new file mode 100644
index 0000000..d8acd4a
--- /dev/null
+++ b/includes/translator/node_modules/decompress-response/index.js
@@ -0,0 +1,29 @@
+'use strict';
+const PassThrough = require('stream').PassThrough;
+const zlib = require('zlib');
+const mimicResponse = require('mimic-response');
+
+module.exports = response => {
+ // TODO: Use Array#includes when targeting Node.js 6
+ if (['gzip', 'deflate'].indexOf(response.headers['content-encoding']) === -1) {
+ return response;
+ }
+
+ const unzip = zlib.createUnzip();
+ const stream = new PassThrough();
+
+ mimicResponse(response, stream);
+
+ unzip.on('error', err => {
+ if (err.code === 'Z_BUF_ERROR') {
+ stream.end();
+ return;
+ }
+
+ stream.emit('error', err);
+ });
+
+ response.pipe(unzip).pipe(stream);
+
+ return stream;
+};
diff --git a/includes/translator/node_modules/decompress-response/license b/includes/translator/node_modules/decompress-response/license
new file mode 100644
index 0000000..32a16ce
--- /dev/null
+++ b/includes/translator/node_modules/decompress-response/license
@@ -0,0 +1,21 @@
+`The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/includes/translator/node_modules/decompress-response/package.json b/includes/translator/node_modules/decompress-response/package.json
new file mode 100644
index 0000000..3574dc2
--- /dev/null
+++ b/includes/translator/node_modules/decompress-response/package.json
@@ -0,0 +1,53 @@
+{
+ "name": "decompress-response",
+ "version": "3.3.0",
+ "description": "Decompress a HTTP response if needed",
+ "license": "MIT",
+ "repository": "sindresorhus/decompress-response",
+ "maintainers": [
+ {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ {
+ "name": "Vsevolod Strukchinsky",
+ "email": "floatdrop@gmail.com",
+ "url": "github.com/floatdrop"
+ }
+ ],
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "decompress",
+ "response",
+ "http",
+ "https",
+ "zlib",
+ "gzip",
+ "zip",
+ "deflate",
+ "unzip",
+ "ungzip",
+ "incoming",
+ "message",
+ "stream",
+ "compressed"
+ ],
+ "dependencies": {
+ "mimic-response": "^1.0.0"
+ },
+ "devDependencies": {
+ "ava": "*",
+ "get-stream": "^3.0.0",
+ "pify": "^3.0.0",
+ "xo": "*"
+ }
+}
diff --git a/includes/translator/node_modules/decompress-response/readme.md b/includes/translator/node_modules/decompress-response/readme.md
new file mode 100644
index 0000000..1b98767
--- /dev/null
+++ b/includes/translator/node_modules/decompress-response/readme.md
@@ -0,0 +1,31 @@
+# decompress-response [![Build Status](https://travis-ci.org/sindresorhus/decompress-response.svg?branch=master)](https://travis-ci.org/sindresorhus/decompress-response)
+
+> Decompress a HTTP response if needed
+
+Decompresses the [response](https://nodejs.org/api/http.html#http_class_http_incomingmessage) from [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) if it's gzipped or deflated, otherwise just passes it through.
+
+Used by [`got`](https://github.com/sindresorhus/got).
+
+
+## Install
+
+```
+$ npm install decompress-response
+```
+
+
+## Usage
+
+```js
+const http = require('http');
+const decompressResponse = require('decompress-response');
+
+http.get('http://sindresorhus.com', response => {
+ response = decompressResponse(response);
+});
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/defer-to-connect/LICENSE b/includes/translator/node_modules/defer-to-connect/LICENSE
new file mode 100644
index 0000000..15ad2e8
--- /dev/null
+++ b/includes/translator/node_modules/defer-to-connect/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Szymon Marczak
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/includes/translator/node_modules/defer-to-connect/README.md b/includes/translator/node_modules/defer-to-connect/README.md
new file mode 100644
index 0000000..4dd36c2
--- /dev/null
+++ b/includes/translator/node_modules/defer-to-connect/README.md
@@ -0,0 +1,38 @@
+# defer-to-connect
+
+> The safe way to handle the `connect` socket event
+
+[![Coverage Status](https://coveralls.io/repos/github/szmarczak/defer-to-connect/badge.svg?branch=master)](https://coveralls.io/github/szmarczak/defer-to-connect?branch=master)
+
+Once you receive the socket, it may be already connected (or disconnected).<br>
+To avoid checking that, use `defer-to-connect`. It'll do that for you.
+
+## Usage
+
+```js
+const deferToConnect = require('defer-to-connect');
+
+deferToConnect(socket, () => {
+ console.log('Connected!');
+});
+```
+
+## API
+
+### deferToConnect(socket, connectListener)
+
+Calls `connectListener()` when connected.
+
+### deferToConnect(socket, listeners)
+
+#### listeners
+
+An object representing `connect`, `secureConnect` and `close` properties.
+
+Calls `connect()` when the socket is connected.<br>
+Calls `secureConnect()` when the socket is securely connected.<br>
+Calls `close()` when the socket is destroyed.
+
+## License
+
+MIT
diff --git a/includes/translator/node_modules/defer-to-connect/dist/index.d.ts b/includes/translator/node_modules/defer-to-connect/dist/index.d.ts
new file mode 100644
index 0000000..323bd12
--- /dev/null
+++ b/includes/translator/node_modules/defer-to-connect/dist/index.d.ts
@@ -0,0 +1,10 @@
+/// <reference types="node" />
+import { Socket } from 'net';
+import { TLSSocket } from 'tls';
+interface Listeners {
+ connect?: () => void;
+ secureConnect?: () => void;
+ close?: (hadError: boolean) => void;
+}
+declare const deferToConnect: (socket: Socket | TLSSocket, fn: Listeners | (() => void)) => void;
+export default deferToConnect;
diff --git a/includes/translator/node_modules/defer-to-connect/dist/index.js b/includes/translator/node_modules/defer-to-connect/dist/index.js
new file mode 100644
index 0000000..aaf1cf5
--- /dev/null
+++ b/includes/translator/node_modules/defer-to-connect/dist/index.js
@@ -0,0 +1,45 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const tls_1 = require("tls");
+const deferToConnect = (socket, fn) => {
+ let listeners;
+ if (typeof fn === 'function') {
+ const connect = fn;
+ listeners = { connect };
+ }
+ else {
+ listeners = fn;
+ }
+ const hasConnectListener = typeof listeners.connect === 'function';
+ const hasSecureConnectListener = typeof listeners.secureConnect === 'function';
+ const hasCloseListener = typeof listeners.close === 'function';
+ const onConnect = () => {
+ if (hasConnectListener) {
+ listeners.connect();
+ }
+ if (socket instanceof tls_1.TLSSocket && hasSecureConnectListener) {
+ if (socket.authorized) {
+ listeners.secureConnect();
+ }
+ else if (!socket.authorizationError) {
+ socket.once('secureConnect', listeners.secureConnect);
+ }
+ }
+ if (hasCloseListener) {
+ socket.once('close', listeners.close);
+ }
+ };
+ if (socket.writable && !socket.connecting) {
+ onConnect();
+ }
+ else if (socket.connecting) {
+ socket.once('connect', onConnect);
+ }
+ else if (socket.destroyed && hasCloseListener) {
+ listeners.close(socket._hadError);
+ }
+};
+exports.default = deferToConnect;
+// For CommonJS default export support
+module.exports = deferToConnect;
+module.exports.default = deferToConnect;
diff --git a/includes/translator/node_modules/defer-to-connect/package.json b/includes/translator/node_modules/defer-to-connect/package.json
new file mode 100644
index 0000000..34a1170
--- /dev/null
+++ b/includes/translator/node_modules/defer-to-connect/package.json
@@ -0,0 +1,74 @@
+{
+ "name": "defer-to-connect",
+ "version": "1.1.3",
+ "description": "The safe way to handle the `connect` socket event",
+ "main": "dist",
+ "files": [
+ "dist"
+ ],
+ "scripts": {
+ "build": "del-cli dist && tsc",
+ "prepublishOnly": "npm run build",
+ "test": "xo && nyc ava",
+ "coveralls": "nyc report --reporter=text-lcov | coveralls"
+ },
+ "keywords": [
+ "socket",
+ "connect",
+ "event"
+ ],
+ "author": "Szymon Marczak",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/szmarczak/defer-to-connect.git"
+ },
+ "bugs": {
+ "url": "https://github.com/szmarczak/defer-to-connect/issues"
+ },
+ "homepage": "https://github.com/szmarczak/defer-to-connect#readme",
+ "xo": {
+ "extends": "xo-typescript",
+ "extensions": [
+ "ts"
+ ],
+ "rules": {
+ "ava/no-ignored-test-files": "off"
+ }
+ },
+ "devDependencies": {
+ "@sindresorhus/tsconfig": "^0.5.0",
+ "@types/node": "^12.12.4",
+ "@typescript-eslint/eslint-plugin": "^1.11.0",
+ "@typescript-eslint/parser": "^1.11.0",
+ "ava": "^2.1.0",
+ "coveralls": "^3.0.7",
+ "create-cert": "^1.0.6",
+ "del-cli": "^3.0.0",
+ "eslint-config-xo-typescript": "^0.15.0",
+ "nyc": "^14.0.0",
+ "p-event": "^4.1.0",
+ "ts-node": "^8.1.0",
+ "typescript": "^3.6.4",
+ "xo": "^0.25.3"
+ },
+ "nyc": {
+ "extension": [
+ ".ts"
+ ]
+ },
+ "ava": {
+ "babel": false,
+ "compileEnhancements": false,
+ "extensions": [
+ "ts"
+ ],
+ "require": [
+ "ts-node/register"
+ ],
+ "files": [
+ "!dist/tests/test.d.ts"
+ ]
+ },
+ "types": "dist"
+}
diff --git a/includes/translator/node_modules/dot-prop/index.js b/includes/translator/node_modules/dot-prop/index.js
new file mode 100644
index 0000000..189831c
--- /dev/null
+++ b/includes/translator/node_modules/dot-prop/index.js
@@ -0,0 +1,141 @@
+'use strict';
+const isObj = require('is-obj');
+
+const disallowedKeys = [
+ '__proto__',
+ 'prototype',
+ 'constructor'
+];
+
+const isValidPath = pathSegments => !pathSegments.some(segment => disallowedKeys.includes(segment));
+
+function getPathSegments(path) {
+ const pathArr = path.split('.');
+ const parts = [];
+
+ for (let i = 0; i < pathArr.length; i++) {
+ let p = pathArr[i];
+
+ while (p[p.length - 1] === '\\' && pathArr[i + 1] !== undefined) {
+ p = p.slice(0, -1) + '.';
+ p += pathArr[++i];
+ }
+
+ parts.push(p);
+ }
+
+ if (!isValidPath(parts)) {
+ return [];
+ }
+
+ return parts;
+}
+
+module.exports = {
+ get(obj, path, value) {
+ if (!isObj(obj) || typeof path !== 'string') {
+ return value === undefined ? obj : value;
+ }
+
+ const pathArr = getPathSegments(path);
+ if (pathArr.length === 0) {
+ return;
+ }
+
+ for (let i = 0; i < pathArr.length; i++) {
+ if (!Object.prototype.propertyIsEnumerable.call(obj, pathArr[i])) {
+ return value;
+ }
+
+ obj = obj[pathArr[i]];
+
+ if (obj === undefined || obj === null) {
+ // `obj` is either `undefined` or `null` so we want to stop the loop, and
+ // if this is not the last bit of the path, and
+ // if it did't return `undefined`
+ // it would return `null` if `obj` is `null`
+ // but we want `get({foo: null}, 'foo.bar')` to equal `undefined`, or the supplied value, not `null`
+ if (i !== pathArr.length - 1) {
+ return value;
+ }
+
+ break;
+ }
+ }
+
+ return obj;
+ },
+
+ set(obj, path, value) {
+ if (!isObj(obj) || typeof path !== 'string') {
+ return obj;
+ }
+
+ const root = obj;
+ const pathArr = getPathSegments(path);
+ if (pathArr.length === 0) {
+ return;
+ }
+
+ for (let i = 0; i < pathArr.length; i++) {
+ const p = pathArr[i];
+
+ if (!isObj(obj[p])) {
+ obj[p] = {};
+ }
+
+ if (i === pathArr.length - 1) {
+ obj[p] = value;
+ }
+
+ obj = obj[p];
+ }
+
+ return root;
+ },
+
+ delete(obj, path) {
+ if (!isObj(obj) || typeof path !== 'string') {
+ return;
+ }
+
+ const pathArr = getPathSegments(path);
+
+ for (let i = 0; i < pathArr.length; i++) {
+ const p = pathArr[i];
+
+ if (i === pathArr.length - 1) {
+ delete obj[p];
+ return;
+ }
+
+ obj = obj[p];
+
+ if (!isObj(obj)) {
+ return;
+ }
+ }
+ },
+
+ has(obj, path) {
+ if (!isObj(obj) || typeof path !== 'string') {
+ return false;
+ }
+
+ const pathArr = getPathSegments(path);
+
+ for (let i = 0; i < pathArr.length; i++) {
+ if (isObj(obj)) {
+ if (!(pathArr[i] in obj)) {
+ return false;
+ }
+
+ obj = obj[pathArr[i]];
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+ }
+};
diff --git a/includes/translator/node_modules/dot-prop/license b/includes/translator/node_modules/dot-prop/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/includes/translator/node_modules/dot-prop/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/includes/translator/node_modules/dot-prop/package.json b/includes/translator/node_modules/dot-prop/package.json
new file mode 100644
index 0000000..c9b0f58
--- /dev/null
+++ b/includes/translator/node_modules/dot-prop/package.json
@@ -0,0 +1,48 @@
+{
+ "name": "dot-prop",
+ "version": "4.2.1",
+ "description": "Get, set, or delete a property from a nested object using a dot path",
+ "license": "MIT",
+ "repository": "sindresorhus/dot-prop",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava",
+ "bench": "matcha bench.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "obj",
+ "object",
+ "prop",
+ "property",
+ "dot",
+ "path",
+ "get",
+ "set",
+ "delete",
+ "del",
+ "access",
+ "notation",
+ "dotty"
+ ],
+ "dependencies": {
+ "is-obj": "^1.0.0"
+ },
+ "devDependencies": {
+ "ava": "1.4.1",
+ "matcha": "^0.7.0",
+ "xo": "0.24.0"
+ },
+ "xo": {
+ "esnext": true
+ }
+}
diff --git a/includes/translator/node_modules/dot-prop/readme.md b/includes/translator/node_modules/dot-prop/readme.md
new file mode 100644
index 0000000..0e18f78
--- /dev/null
+++ b/includes/translator/node_modules/dot-prop/readme.md
@@ -0,0 +1,105 @@
+# dot-prop [![Build Status](https://travis-ci.org/sindresorhus/dot-prop.svg?branch=master)](https://travis-ci.org/sindresorhus/dot-prop)
+
+> Get, set, or delete a property from a nested object using a dot path
+
+
+## Install
+
+```
+$ npm install --save dot-prop
+```
+
+
+## Usage
+
+```js
+const dotProp = require('dot-prop');
+
+// getter
+dotProp.get({foo: {bar: 'unicorn'}}, 'foo.bar');
+//=> 'unicorn'
+
+dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep');
+//=> undefined
+
+dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep', 'default value');
+//=> 'default value'
+
+dotProp.get({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot');
+//=> 'unicorn'
+
+// setter
+const obj = {foo: {bar: 'a'}};
+dotProp.set(obj, 'foo.bar', 'b');
+console.log(obj);
+//=> {foo: {bar: 'b'}}
+
+const foo = dotProp.set({}, 'foo.bar', 'c');
+console.log(foo);
+//=> {foo: {bar: 'c'}}
+
+dotProp.set(obj, 'foo.baz', 'x');
+console.log(obj);
+//=> {foo: {bar: 'b', baz: 'x'}}
+
+// has
+dotProp.has({foo: {bar: 'unicorn'}}, 'foo.bar');
+//=> true
+
+// deleter
+const obj = {foo: {bar: 'a'}};
+dotProp.delete(obj, 'foo.bar');
+console.log(obj);
+//=> {foo: {}}
+
+obj.foo.bar = {x: 'y', y: 'x'};
+dotProp.delete(obj, 'foo.bar.x');
+console.log(obj);
+//=> {foo: {bar: {y: 'x'}}}
+```
+
+
+## API
+
+### get(obj, path, [defaultValue])
+
+### set(obj, path, value)
+
+Returns the object.
+
+### has(obj, path)
+
+### delete(obj, path)
+
+#### obj
+
+Type: `Object`
+
+Object to get, set, or delete the `path` value.
+
+#### path
+
+Type: `string`
+
+Path of the property in the object, using `.` to separate each nested key.
+
+Use `\\.` if you have a `.` in the key.
+
+The following path components are invalid and results in `undefined` being returned: `__proto__`, `prototype`, `constructor`.
+
+#### value
+
+Type: `any`
+
+Value to set at `path`.
+
+#### defaultValue
+
+Type: `any`
+
+Default value.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/duplexer3/index.js b/includes/translator/node_modules/duplexer3/index.js
new file mode 100644
index 0000000..1339ffc
--- /dev/null
+++ b/includes/translator/node_modules/duplexer3/index.js
@@ -0,0 +1,76 @@
+"use strict";
+
+var stream = require("stream");
+
+function DuplexWrapper(options, writable, readable) {
+ if (typeof readable === "undefined") {
+ readable = writable;
+ writable = options;
+ options = null;
+ }
+
+ stream.Duplex.call(this, options);
+
+ if (typeof readable.read !== "function") {
+ readable = (new stream.Readable(options)).wrap(readable);
+ }
+
+ this._writable = writable;
+ this._readable = readable;
+ this._waiting = false;
+
+ var self = this;
+
+ writable.once("finish", function() {
+ self.end();
+ });
+
+ this.once("finish", function() {
+ writable.end();
+ });
+
+ readable.on("readable", function() {
+ if (self._waiting) {
+ self._waiting = false;
+ self._read();
+ }
+ });
+
+ readable.once("end", function() {
+ self.push(null);
+ });
+
+ if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) {
+ writable.on("error", function(err) {
+ self.emit("error", err);
+ });
+
+ readable.on("error", function(err) {
+ self.emit("error", err);
+ });
+ }
+}
+
+DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}});
+
+DuplexWrapper.prototype._write = function _write(input, encoding, done) {
+ this._writable.write(input, encoding, done);
+};
+
+DuplexWrapper.prototype._read = function _read() {
+ var buf;
+ var reads = 0;
+ while ((buf = this._readable.read()) !== null) {
+ this.push(buf);
+ reads++;
+ }
+ if (reads === 0) {
+ this._waiting = true;
+ }
+};
+
+module.exports = function duplex2(options, writable, readable) {
+ return new DuplexWrapper(options, writable, readable);
+};
+
+module.exports.DuplexWrapper = DuplexWrapper;
diff --git a/includes/translator/node_modules/duplexer3/license b/includes/translator/node_modules/duplexer3/license
new file mode 100644
index 0000000..8e11ab3
--- /dev/null
+++ b/includes/translator/node_modules/duplexer3/license
@@ -0,0 +1,10 @@
+Copyright (c) 2022, Sindre Sorhus.
+Copyright (c) 2020, Vsevolod Strukchinsky.
+Copyright (c) 2013, Deoxxa Development.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/includes/translator/node_modules/duplexer3/package.json b/includes/translator/node_modules/duplexer3/package.json
new file mode 100644
index 0000000..704307c
--- /dev/null
+++ b/includes/translator/node_modules/duplexer3/package.json
@@ -0,0 +1,27 @@
+{
+ "name": "duplexer3",
+ "version": "0.1.5",
+ "description": "Like duplexer but using streams3",
+ "engine": {
+ "node": ">=4"
+ },
+ "files": [
+ "index.js"
+ ],
+ "scripts": {
+ "test": "mocha -R tap"
+ },
+ "repository": "sindresorhus/duplexer3",
+ "keywords": [
+ "duplex",
+ "duplexer",
+ "stream",
+ "stream3",
+ "join",
+ "combine"
+ ],
+ "license": "BSD-3-Clause",
+ "devDependencies": {
+ "mocha": "^2.2.5"
+ }
+}
diff --git a/includes/translator/node_modules/duplexer3/readme.md b/includes/translator/node_modules/duplexer3/readme.md
new file mode 100644
index 0000000..f9e87eb
--- /dev/null
+++ b/includes/translator/node_modules/duplexer3/readme.md
@@ -0,0 +1,99 @@
+# duplexer3
+
+Like [`duplexer2`](https://github.com/deoxxa/duplexer2) but using Streams3 without readable-stream dependency
+
+```js
+var stream = require("stream");
+var duplexer3 = require("duplexer3");
+
+var writable = new stream.Writable({objectMode: true}),
+ readable = new stream.Readable({objectMode: true});
+
+writable._write = function _write(input, encoding, done) {
+ if (readable.push(input)) {
+ return done();
+ } else {
+ readable.once("drain", done);
+ }
+};
+
+readable._read = function _read(n) {
+ // no-op
+};
+
+// simulate the readable thing closing after a bit
+writable.once("finish", function() {
+ setTimeout(function() {
+ readable.push(null);
+ }, 500);
+});
+
+var duplex = duplexer3(writable, readable);
+
+duplex.on("data", function(e) {
+ console.log("got data", JSON.stringify(e));
+});
+
+duplex.on("finish", function() {
+ console.log("got finish event");
+});
+
+duplex.on("end", function() {
+ console.log("got end event");
+});
+
+duplex.write("oh, hi there", function() {
+ console.log("finished writing");
+});
+
+duplex.end(function() {
+ console.log("finished ending");
+});
+```
+
+```
+got data "oh, hi there"
+finished writing
+got finish event
+finished ending
+got end event
+```
+
+## Overview
+
+This is a reimplementation of [duplexer](https://www.npmjs.com/package/duplexer) using the
+Streams3 API which is standard in Node as of v4. Everything largely
+works the same.
+
+## Install
+
+```sh
+npm install duplexer3
+```
+
+## API
+
+### duplexer3
+
+Creates a new `DuplexWrapper` object, which is the actual class that implements
+most of the fun stuff. All that fun stuff is hidden. DON'T LOOK.
+
+```js
+duplexer3([options], writable, readable)
+```
+
+```js
+const duplex = duplexer3(new stream.Writable(), new stream.Readable());
+```
+
+Arguments
+
+* __options__ - an object specifying the regular `stream.Duplex` options, as
+ well as the properties described below.
+* __writable__ - a writable stream
+* __readable__ - a readable stream
+
+Options
+
+* __bubbleErrors__ - a boolean value that specifies whether to bubble errors
+ from the underlying readable/writable streams. Default is `true`.
diff --git a/includes/translator/node_modules/end-of-stream/LICENSE b/includes/translator/node_modules/end-of-stream/LICENSE
new file mode 100644
index 0000000..757562e
--- /dev/null
+++ b/includes/translator/node_modules/end-of-stream/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE. \ No newline at end of file
diff --git a/includes/translator/node_modules/end-of-stream/README.md b/includes/translator/node_modules/end-of-stream/README.md
new file mode 100644
index 0000000..857b14b
--- /dev/null
+++ b/includes/translator/node_modules/end-of-stream/README.md
@@ -0,0 +1,54 @@
+# end-of-stream
+
+A node module that calls a callback when a readable/writable/duplex stream has completed or failed.
+
+ npm install end-of-stream
+
+[![Build status](https://travis-ci.org/mafintosh/end-of-stream.svg?branch=master)](https://travis-ci.org/mafintosh/end-of-stream)
+
+## Usage
+
+Simply pass a stream and a callback to the `eos`.
+Both legacy streams, streams2 and stream3 are supported.
+
+``` js
+var eos = require('end-of-stream');
+
+eos(readableStream, function(err) {
+ // this will be set to the stream instance
+ if (err) return console.log('stream had an error or closed early');
+ console.log('stream has ended', this === readableStream);
+});
+
+eos(writableStream, function(err) {
+ if (err) return console.log('stream had an error or closed early');
+ console.log('stream has finished', this === writableStream);
+});
+
+eos(duplexStream, function(err) {
+ if (err) return console.log('stream had an error or closed early');
+ console.log('stream has ended and finished', this === duplexStream);
+});
+
+eos(duplexStream, {readable:false}, function(err) {
+ if (err) return console.log('stream had an error or closed early');
+ console.log('stream has finished but might still be readable');
+});
+
+eos(duplexStream, {writable:false}, function(err) {
+ if (err) return console.log('stream had an error or closed early');
+ console.log('stream has ended but might still be writable');
+});
+
+eos(readableStream, {error:false}, function(err) {
+ // do not treat emit('error', err) as a end-of-stream
+});
+```
+
+## License
+
+MIT
+
+## Related
+
+`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.
diff --git a/includes/translator/node_modules/end-of-stream/index.js b/includes/translator/node_modules/end-of-stream/index.js
new file mode 100644
index 0000000..c77f0d5
--- /dev/null
+++ b/includes/translator/node_modules/end-of-stream/index.js
@@ -0,0 +1,94 @@
+var once = require('once');
+
+var noop = function() {};
+
+var isRequest = function(stream) {
+ return stream.setHeader && typeof stream.abort === 'function';
+};
+
+var isChildProcess = function(stream) {
+ return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
+};
+
+var eos = function(stream, opts, callback) {
+ if (typeof opts === 'function') return eos(stream, null, opts);
+ if (!opts) opts = {};
+
+ callback = once(callback || noop);
+
+ var ws = stream._writableState;
+ var rs = stream._readableState;
+ var readable = opts.readable || (opts.readable !== false && stream.readable);
+ var writable = opts.writable || (opts.writable !== false && stream.writable);
+ var cancelled = false;
+
+ var onlegacyfinish = function() {
+ if (!stream.writable) onfinish();
+ };
+
+ var onfinish = function() {
+ writable = false;
+ if (!readable) callback.call(stream);
+ };
+
+ var onend = function() {
+ readable = false;
+ if (!writable) callback.call(stream);
+ };
+
+ var onexit = function(exitCode) {
+ callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
+ };
+
+ var onerror = function(err) {
+ callback.call(stream, err);
+ };
+
+ var onclose = function() {
+ process.nextTick(onclosenexttick);
+ };
+
+ var onclosenexttick = function() {
+ if (cancelled) return;
+ if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
+ if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
+ };
+
+ var onrequest = function() {
+ stream.req.on('finish', onfinish);
+ };
+
+ if (isRequest(stream)) {
+ stream.on('complete', onfinish);
+ stream.on('abort', onclose);
+ if (stream.req) onrequest();
+ else stream.on('request', onrequest);
+ } else if (writable && !ws) { // legacy streams
+ stream.on('end', onlegacyfinish);
+ stream.on('close', onlegacyfinish);
+ }
+
+ if (isChildProcess(stream)) stream.on('exit', onexit);
+
+ stream.on('end', onend);
+ stream.on('finish', onfinish);
+ if (opts.error !== false) stream.on('error', onerror);
+ stream.on('close', onclose);
+
+ return function() {
+ cancelled = true;
+ stream.removeListener('complete', onfinish);
+ stream.removeListener('abort', onclose);
+ stream.removeListener('request', onrequest);
+ if (stream.req) stream.req.removeListener('finish', onfinish);
+ stream.removeListener('end', onlegacyfinish);
+ stream.removeListener('close', onlegacyfinish);
+ stream.removeListener('finish', onfinish);
+ stream.removeListener('exit', onexit);
+ stream.removeListener('end', onend);
+ stream.removeListener('error', onerror);
+ stream.removeListener('close', onclose);
+ };
+};
+
+module.exports = eos;
diff --git a/includes/translator/node_modules/end-of-stream/package.json b/includes/translator/node_modules/end-of-stream/package.json
new file mode 100644
index 0000000..b75bbf0
--- /dev/null
+++ b/includes/translator/node_modules/end-of-stream/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "end-of-stream",
+ "version": "1.4.4",
+ "description": "Call a callback when a readable/writable/duplex stream has completed or failed.",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mafintosh/end-of-stream.git"
+ },
+ "dependencies": {
+ "once": "^1.4.0"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "stream",
+ "streams",
+ "callback",
+ "finish",
+ "close",
+ "end",
+ "wait"
+ ],
+ "bugs": {
+ "url": "https://github.com/mafintosh/end-of-stream/issues"
+ },
+ "homepage": "https://github.com/mafintosh/end-of-stream",
+ "main": "index.js",
+ "author": "Mathias Buus <mathiasbuus@gmail.com>",
+ "license": "MIT",
+ "devDependencies": {
+ "tape": "^4.11.0"
+ }
+}
diff --git a/includes/translator/node_modules/get-stream/buffer-stream.js b/includes/translator/node_modules/get-stream/buffer-stream.js
new file mode 100644
index 0000000..4121c8e
--- /dev/null
+++ b/includes/translator/node_modules/get-stream/buffer-stream.js
@@ -0,0 +1,51 @@
+'use strict';
+const {PassThrough} = require('stream');
+
+module.exports = options => {
+ options = Object.assign({}, options);
+
+ const {array} = options;
+ let {encoding} = options;
+ const buffer = encoding === 'buffer';
+ let objectMode = false;
+
+ if (array) {
+ objectMode = !(encoding || buffer);
+ } else {
+ encoding = encoding || 'utf8';
+ }
+
+ if (buffer) {
+ encoding = null;
+ }
+
+ let len = 0;
+ const ret = [];
+ const stream = new PassThrough({objectMode});
+
+ if (encoding) {
+ stream.setEncoding(encoding);
+ }
+
+ stream.on('data', chunk => {
+ ret.push(chunk);
+
+ if (objectMode) {
+ len = ret.length;
+ } else {
+ len += chunk.length;
+ }
+ });
+
+ stream.getBufferedValue = () => {
+ if (array) {
+ return ret;
+ }
+
+ return buffer ? Buffer.concat(ret, len) : ret.join('');
+ };
+
+ stream.getBufferedLength = () => len;
+
+ return stream;
+};
diff --git a/includes/translator/node_modules/get-stream/index.js b/includes/translator/node_modules/get-stream/index.js
new file mode 100644
index 0000000..7e5584a
--- /dev/null
+++ b/includes/translator/node_modules/get-stream/index.js
@@ -0,0 +1,50 @@
+'use strict';
+const pump = require('pump');
+const bufferStream = require('./buffer-stream');
+
+class MaxBufferError extends Error {
+ constructor() {
+ super('maxBuffer exceeded');
+ this.name = 'MaxBufferError';
+ }
+}
+
+function getStream(inputStream, options) {
+ if (!inputStream) {
+ return Promise.reject(new Error('Expected a stream'));
+ }
+
+ options = Object.assign({maxBuffer: Infinity}, options);
+
+ const {maxBuffer} = options;
+
+ let stream;
+ return new Promise((resolve, reject) => {
+ const rejectPromise = error => {
+ if (error) { // A null check
+ error.bufferedData = stream.getBufferedValue();
+ }
+ reject(error);
+ };
+
+ stream = pump(inputStream, bufferStream(options), error => {
+ if (error) {
+ rejectPromise(error);
+ return;
+ }
+
+ resolve();
+ });
+
+ stream.on('data', () => {
+ if (stream.getBufferedLength() > maxBuffer) {
+ rejectPromise(new MaxBufferError());
+ }
+ });
+ }).then(() => stream.getBufferedValue());
+}
+
+module.exports = getStream;
+module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
+module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
+module.exports.MaxBufferError = MaxBufferError;
diff --git a/includes/translator/node_modules/get-stream/license b/includes/translator/node_modules/get-stream/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/get-stream/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/get-stream/package.json b/includes/translator/node_modules/get-stream/package.json
new file mode 100644
index 0000000..619651c
--- /dev/null
+++ b/includes/translator/node_modules/get-stream/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "get-stream",
+ "version": "4.1.0",
+ "description": "Get a stream as a string, buffer, or array",
+ "license": "MIT",
+ "repository": "sindresorhus/get-stream",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js",
+ "buffer-stream.js"
+ ],
+ "keywords": [
+ "get",
+ "stream",
+ "promise",
+ "concat",
+ "string",
+ "text",
+ "buffer",
+ "read",
+ "data",
+ "consume",
+ "readable",
+ "readablestream",
+ "array",
+ "object"
+ ],
+ "dependencies": {
+ "pump": "^3.0.0"
+ },
+ "devDependencies": {
+ "ava": "*",
+ "into-stream": "^3.0.0",
+ "xo": "*"
+ }
+}
diff --git a/includes/translator/node_modules/get-stream/readme.md b/includes/translator/node_modules/get-stream/readme.md
new file mode 100644
index 0000000..b87a4d3
--- /dev/null
+++ b/includes/translator/node_modules/get-stream/readme.md
@@ -0,0 +1,123 @@
+# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream)
+
+> Get a stream as a string, buffer, or array
+
+
+## Install
+
+```
+$ npm install get-stream
+```
+
+
+## Usage
+
+```js
+const fs = require('fs');
+const getStream = require('get-stream');
+
+(async () => {
+ const stream = fs.createReadStream('unicorn.txt');
+
+ console.log(await getStream(stream));
+ /*
+ ,,))))))));,
+ __)))))))))))))),
+ \|/ -\(((((''''((((((((.
+ -*-==//////(('' . `)))))),
+ /|\ ))| o ;-. '((((( ,(,
+ ( `| / ) ;))))' ,_))^;(~
+ | | | ,))((((_ _____------~~~-. %,;(;(>';'~
+ o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~
+ ; ''''```` `: `:::|\,__,%% );`'; ~
+ | _ ) / `:|`----' `-'
+ ______/\/~ | / /
+ /~;;.____/;;' / ___--,-( `;;;/
+ / // _;______;'------~~~~~ /;;/\ /
+ // | | / ; \;;,\
+ (<_ | ; /',/-----' _>
+ \_| ||_ //~;~~~~~~~~~
+ `\_| (,~~
+ \~\
+ ~~
+ */
+})();
+```
+
+
+## API
+
+The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode.
+
+### getStream(stream, [options])
+
+Get the `stream` as a string.
+
+#### options
+
+Type: `Object`
+
+##### encoding
+
+Type: `string`<br>
+Default: `utf8`
+
+[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream.
+
+##### maxBuffer
+
+Type: `number`<br>
+Default: `Infinity`
+
+Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `getStream.MaxBufferError` error.
+
+### getStream.buffer(stream, [options])
+
+Get the `stream` as a buffer.
+
+It honors the `maxBuffer` option as above, but it refers to byte length rather than string length.
+
+### getStream.array(stream, [options])
+
+Get the `stream` as an array of values.
+
+It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen:
+
+- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes).
+
+- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array.
+
+- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array.
+
+
+## Errors
+
+If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error.
+
+```js
+(async () => {
+ try {
+ await getStream(streamThatErrorsAtTheEnd('unicorn'));
+ } catch (error) {
+ console.log(error.bufferedData);
+ //=> 'unicorn'
+ }
+})()
+```
+
+
+## FAQ
+
+### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)?
+
+This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package.
+
+
+## Related
+
+- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/got/license b/includes/translator/node_modules/got/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/got/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/got/package.json b/includes/translator/node_modules/got/package.json
new file mode 100644
index 0000000..f2bef85
--- /dev/null
+++ b/includes/translator/node_modules/got/package.json
@@ -0,0 +1,74 @@
+{
+ "name": "got",
+ "version": "9.6.0",
+ "description": "Simplified HTTP requests",
+ "license": "MIT",
+ "repository": "sindresorhus/got",
+ "main": "source",
+ "engines": {
+ "node": ">=8.6"
+ },
+ "scripts": {
+ "test": "xo && nyc ava",
+ "release": "np"
+ },
+ "files": [
+ "source"
+ ],
+ "keywords": [
+ "http",
+ "https",
+ "get",
+ "got",
+ "url",
+ "uri",
+ "request",
+ "util",
+ "utility",
+ "simple",
+ "curl",
+ "wget",
+ "fetch",
+ "net",
+ "network",
+ "electron"
+ ],
+ "dependencies": {
+ "@sindresorhus/is": "^0.14.0",
+ "@szmarczak/http-timer": "^1.1.2",
+ "cacheable-request": "^6.0.0",
+ "decompress-response": "^3.3.0",
+ "duplexer3": "^0.1.4",
+ "get-stream": "^4.1.0",
+ "lowercase-keys": "^1.0.1",
+ "mimic-response": "^1.0.1",
+ "p-cancelable": "^1.0.0",
+ "to-readable-stream": "^1.0.0",
+ "url-parse-lax": "^3.0.0"
+ },
+ "devDependencies": {
+ "ava": "^1.1.0",
+ "coveralls": "^3.0.0",
+ "delay": "^4.1.0",
+ "form-data": "^2.3.3",
+ "get-port": "^4.0.0",
+ "np": "^3.1.0",
+ "nyc": "^13.1.0",
+ "p-event": "^2.1.0",
+ "pem": "^1.13.2",
+ "proxyquire": "^2.0.1",
+ "sinon": "^7.2.2",
+ "slow-stream": "0.0.4",
+ "tempfile": "^2.0.0",
+ "tempy": "^0.2.1",
+ "tough-cookie": "^3.0.0",
+ "xo": "^0.24.0"
+ },
+ "ava": {
+ "concurrency": 4
+ },
+ "browser": {
+ "decompress-response": false,
+ "electron": false
+ }
+}
diff --git a/includes/translator/node_modules/got/readme.md b/includes/translator/node_modules/got/readme.md
new file mode 100644
index 0000000..37132ab
--- /dev/null
+++ b/includes/translator/node_modules/got/readme.md
@@ -0,0 +1,1237 @@
+<div align="center">
+ <br>
+ <br>
+ <img width="360" src="media/logo.svg" alt="Got">
+ <br>
+ <br>
+ <br>
+ <p align="center">Huge thanks to <a href="https://moxy.studio"><img src="https://sindresorhus.com/assets/thanks/moxy-logo.svg" width="150"></a> for sponsoring me!
+ </p>
+ <br>
+ <br>
+</div>
+
+> Simplified HTTP requests
+
+[![Build Status: Linux](https://travis-ci.org/sindresorhus/got.svg?branch=master)](https://travis-ci.org/sindresorhus/got) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/got/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/got?branch=master) [![Downloads](https://img.shields.io/npm/dm/got.svg)](https://npmjs.com/got) [![Install size](https://packagephobia.now.sh/badge?p=got)](https://packagephobia.now.sh/result?p=got)
+
+Got is a human-friendly and powerful HTTP request library.
+
+It was created because the popular [`request`](https://github.com/request/request) package is bloated: [![Install size](https://packagephobia.now.sh/badge?p=request)](https://packagephobia.now.sh/result?p=request)
+
+Got is for Node.js. For browsers, we recommend [Ky](https://github.com/sindresorhus/ky).
+
+
+## Highlights
+
+- [Promise & stream API](#api)
+- [Request cancelation](#aborting-the-request)
+- [RFC compliant caching](#cache-adapters)
+- [Follows redirects](#followredirect)
+- [Retries on failure](#retry)
+- [Progress events](#onuploadprogress-progress)
+- [Handles gzip/deflate](#decompress)
+- [Timeout handling](#timeout)
+- [Errors with metadata](#errors)
+- [JSON mode](#json)
+- [WHATWG URL support](#url)
+- [Hooks](#hooks)
+- [Instances with custom defaults](#instances)
+- [Composable](advanced-creation.md#merging-instances)
+- [Electron support](#useelectronnet)
+- [Used by ~2000 packages and ~500K repos](https://github.com/sindresorhus/got/network/dependents)
+- Actively maintained
+
+[Moving from Request?](migration-guides.md)
+
+[See how Got compares to other HTTP libraries](#comparison)
+
+## Install
+
+```
+$ npm install got
+```
+
+<a href="https://www.patreon.com/sindresorhus">
+ <img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
+</a>
+
+
+## Usage
+
+```js
+const got = require('got');
+
+(async () => {
+ try {
+ const response = await got('sindresorhus.com');
+ console.log(response.body);
+ //=> '<!doctype html> ...'
+ } catch (error) {
+ console.log(error.response.body);
+ //=> 'Internal server error ...'
+ }
+})();
+```
+
+###### Streams
+
+```js
+const fs = require('fs');
+const got = require('got');
+
+got.stream('sindresorhus.com').pipe(fs.createWriteStream('index.html'));
+
+// For POST, PUT, and PATCH methods `got.stream` returns a `stream.Writable`
+fs.createReadStream('index.html').pipe(got.stream.post('sindresorhus.com'));
+```
+
+
+### API
+
+It's a `GET` request by default, but can be changed by using different methods or in the `options`.
+
+#### got(url, [options])
+
+Returns a Promise for a [`response` object](#response) or a [stream](#streams-1) if `options.stream` is set to true.
+
+##### url
+
+Type: `string` `Object`
+
+The URL to request, as a string, a [`https.request` options object](https://nodejs.org/api/https.html#https_https_request_options_callback), or a [WHATWG `URL`](https://nodejs.org/api/url.html#url_class_url).
+
+Properties from `options` will override properties in the parsed `url`.
+
+If no protocol is specified, it will default to `https`.
+
+##### options
+
+Type: `Object`
+
+Any of the [`https.request`](https://nodejs.org/api/https.html#https_https_request_options_callback) options.
+
+###### baseUrl
+
+Type: `string` `Object`
+
+When specified, `url` will be prepended by `baseUrl`.<br>
+If you specify an absolute URL, it will skip the `baseUrl`.
+
+Very useful when used with `got.extend()` to create niche-specific Got instances.
+
+Can be a string or a [WHATWG `URL`](https://nodejs.org/api/url.html#url_class_url).
+
+Slash at the end of `baseUrl` and at the beginning of the `url` argument is optional:
+
+```js
+await got('hello', {baseUrl: 'https://example.com/v1'});
+//=> 'https://example.com/v1/hello'
+
+await got('/hello', {baseUrl: 'https://example.com/v1/'});
+//=> 'https://example.com/v1/hello'
+
+await got('/hello', {baseUrl: 'https://example.com/v1'});
+//=> 'https://example.com/v1/hello'
+```
+
+###### headers
+
+Type: `Object`<br>
+Default: `{}`
+
+Request headers.
+
+Existing headers will be overwritten. Headers set to `null` will be omitted.
+
+###### stream
+
+Type: `boolean`<br>
+Default: `false`
+
+Returns a `Stream` instead of a `Promise`. This is equivalent to calling `got.stream(url, [options])`.
+
+###### body
+
+Type: `string` `Buffer` `stream.Readable` [`form-data` instance](https://github.com/form-data/form-data)
+
+**Note:** If you provide this option, `got.stream()` will be read-only.
+
+The body that will be sent with a `POST` request.
+
+If present in `options` and `options.method` is not set, `options.method` will be set to `POST`.
+
+The `content-length` header will be automatically set if `body` is a `string` / `Buffer` / `fs.createReadStream` instance / [`form-data` instance](https://github.com/form-data/form-data), and `content-length` and `transfer-encoding` are not manually set in `options.headers`.
+
+###### cookieJar
+
+Type: [`tough.CookieJar` instance](https://github.com/salesforce/tough-cookie#cookiejar)
+
+**Note:** If you provide this option, `options.headers.cookie` will be overridden.
+
+Cookie support. You don't have to care about parsing or how to store them. [Example.](#cookies)
+
+###### encoding
+
+Type: `string` `null`<br>
+Default: `'utf8'`
+
+[Encoding](https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings) to be used on `setEncoding` of the response data. If `null`, the body is returned as a [`Buffer`](https://nodejs.org/api/buffer.html) (binary data).
+
+###### form
+
+Type: `boolean`<br>
+Default: `false`
+
+**Note:** If you provide this option, `got.stream()` will be read-only.
+**Note:** `body` must be a plain object. It will be converted to a query string using [`(new URLSearchParams(object)).toString()`](https://nodejs.org/api/url.html#url_constructor_new_urlsearchparams_obj).
+
+If set to `true` and `Content-Type` header is not set, it will be set to `application/x-www-form-urlencoded`.
+
+###### json
+
+Type: `boolean`<br>
+Default: `false`
+
+**Note:** If you use `got.stream()`, this option will be ignored.
+**Note:** `body` must be a plain object or array and will be stringified.
+
+If set to `true` and `Content-Type` header is not set, it will be set to `application/json`.
+
+Parse response body with `JSON.parse` and set `accept` header to `application/json`. If used in conjunction with the `form` option, the `body` will the stringified as querystring and the response parsed as JSON.
+
+###### query
+
+Type: `string` `Object<string, string|number>` [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams)
+
+Query string that will be added to the request URL. This will override the query string in `url`.
+
+If you need to pass in an array, you can do it using a `URLSearchParams` instance:
+
+```js
+const got = require('got');
+
+const query = new URLSearchParams([['key', 'a'], ['key', 'b']]);
+
+got('https://example.com', {query});
+
+console.log(query.toString());
+//=> 'key=a&key=b'
+```
+
+And if you need a different array format, you could use the [`query-string`](https://github.com/sindresorhus/query-string) package:
+
+```js
+const got = require('got');
+const queryString = require('query-string');
+
+const query = queryString.stringify({key: ['a', 'b']}, {arrayFormat: 'bracket'});
+
+got('https://example.com', {query});
+
+console.log(query);
+//=> 'key[]=a&key[]=b'
+```
+
+###### timeout
+
+Type: `number` `Object`
+
+Milliseconds to wait for the server to end the response before aborting the request with [`got.TimeoutError`](#gottimeouterror) error (a.k.a. `request` property). By default, there's no timeout.
+
+This also accepts an `object` with the following fields to constrain the duration of each phase of the request lifecycle:
+
+- `lookup` starts when a socket is assigned and ends when the hostname has been resolved. Does not apply when using a Unix domain socket.
+- `connect` starts when `lookup` completes (or when the socket is assigned if lookup does not apply to the request) and ends when the socket is connected.
+- `secureConnect` starts when `connect` completes and ends when the handshaking process completes (HTTPS only).
+- `socket` starts when the socket is connected. See [request.setTimeout](https://nodejs.org/api/http.html#http_request_settimeout_timeout_callback).
+- `response` starts when the request has been written to the socket and ends when the response headers are received.
+- `send` starts when the socket is connected and ends with the request has been written to the socket.
+- `request` starts when the request is initiated and ends when the response's end event fires.
+
+###### retry
+
+Type: `number` `Object`<br>
+Default:
+- retries: `2`
+- methods: `GET` `PUT` `HEAD` `DELETE` `OPTIONS` `TRACE`
+- statusCodes: [`408`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) [`413`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413) [`429`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) [`500`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) [`502`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) [`503`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) [`504`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504)
+- maxRetryAfter: `undefined`
+- errorCodes: `ETIMEDOUT` `ECONNRESET` `EADDRINUSE` `ECONNREFUSED` `EPIPE` `ENOTFOUND` `ENETUNREACH` `EAI_AGAIN`
+
+An object representing `retries`, `methods`, `statusCodes`, `maxRetryAfter` and `errorCodes` fields for the time until retry, allowed methods, allowed status codes, maximum [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time and allowed error codes.
+
+If `maxRetryAfter` is set to `undefined`, it will use `options.timeout`.<br>
+If [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header is greater than `maxRetryAfter`, it will cancel the request.
+
+Delays between retries counts with function `1000 * Math.pow(2, retry) + Math.random() * 100`, where `retry` is attempt number (starts from 1).
+
+The `retries` property can be a `number` or a `function` with `retry` and `error` arguments. The function must return a delay in milliseconds (`0` return value cancels retry).
+
+By default, it retries *only* on the specified methods, status codes, and on these network errors:
+- `ETIMEDOUT`: One of the [timeout](#timeout) limits were reached.
+- `ECONNRESET`: Connection was forcibly closed by a peer.
+- `EADDRINUSE`: Could not bind to any free port.
+- `ECONNREFUSED`: Connection was refused by the server.
+- `EPIPE`: The remote side of the stream being written has been closed.
+- `ENOTFOUND`: Couldn't resolve the hostname to an IP address.
+- `ENETUNREACH`: No internet connection.
+- `EAI_AGAIN`: DNS lookup timed out.
+
+###### followRedirect
+
+Type: `boolean`<br>
+Default: `true`
+
+Defines if redirect responses should be followed automatically.
+
+Note that if a `303` is sent by the server in response to any request type (`POST`, `DELETE`, etc.), Got will automatically request the resource pointed to in the location header via `GET`. This is in accordance with [the spec](https://tools.ietf.org/html/rfc7231#section-6.4.4).
+
+###### decompress
+
+Type: `boolean`<br>
+Default: `true`
+
+Decompress the response automatically. This will set the `accept-encoding` header to `gzip, deflate` unless you set it yourself.
+
+If this is disabled, a compressed response is returned as a `Buffer`. This may be useful if you want to handle decompression yourself or stream the raw compressed data.
+
+###### cache
+
+Type: `Object`<br>
+Default: `false`
+
+[Cache adapter instance](#cache-adapters) for storing cached data.
+
+###### request
+
+Type: `Function`<br>
+Default: `http.request` `https.request` *(depending on the protocol)*
+
+Custom request function. The main purpose of this is to [support HTTP2 using a wrapper](#experimental-http2-support).
+
+###### useElectronNet
+
+Type: `boolean`<br>
+Default: `false`
+
+When used in Electron, Got will use [`electron.net`](https://electronjs.org/docs/api/net/) instead of the Node.js `http` module. According to the Electron docs, it should be fully compatible, but it's not entirely. See [#443](https://github.com/sindresorhus/got/issues/443) and [#461](https://github.com/sindresorhus/got/issues/461).
+
+###### throwHttpErrors
+
+Type: `boolean`<br>
+Default: `true`
+
+Determines if a `got.HTTPError` is thrown for error responses (non-2xx status codes).
+
+If this is disabled, requests that encounter an error status code will be resolved with the `response` instead of throwing. This may be useful if you are checking for resource availability and are expecting error responses.
+
+###### agent
+
+Same as the [`agent` option](https://nodejs.org/api/http.html#http_http_request_url_options_callback) for `http.request`, but with an extra feature:
+
+If you require different agents for different protocols, you can pass a map of agents to the `agent` option. This is necessary because a request to one protocol might redirect to another. In such a scenario, Got will switch over to the right protocol agent for you.
+
+```js
+const got = require('got');
+const HttpAgent = require('agentkeepalive');
+const {HttpsAgent} = HttpAgent;
+
+got('sindresorhus.com', {
+ agent: {
+ http: new HttpAgent(),
+ https: new HttpsAgent()
+ }
+});
+```
+
+###### hooks
+
+Type: `Object<string, Function[]>`
+
+Hooks allow modifications during the request lifecycle. Hook functions may be async and are run serially.
+
+###### hooks.init
+
+Type: `Function[]`<br>
+Default: `[]`
+
+Called with plain [request options](#options), right before their normalization. This is especially useful in conjunction with [`got.extend()`](#instances) and [`got.create()`](advanced-creation.md) when the input needs custom handling.
+
+See the [Request migration guide](migration-guides.md#breaking-changes) for an example.
+
+**Note**: This hook must be synchronous!
+
+###### hooks.beforeRequest
+
+Type: `Function[]`<br>
+Default: `[]`
+
+Called with [normalized](source/normalize-arguments.js) [request options](#options). Got will make no further changes to the request before it is sent. This is especially useful in conjunction with [`got.extend()`](#instances) and [`got.create()`](advanced-creation.md) when you want to create an API client that, for example, uses HMAC-signing.
+
+See the [AWS section](#aws) for an example.
+
+**Note:** If you modify the `body` you will need to modify the `content-length` header too, because it has already been computed and assigned.
+
+###### hooks.beforeRedirect
+
+Type: `Function[]`<br>
+Default: `[]`
+
+Called with [normalized](source/normalize-arguments.js) [request options](#options). Got will make no further changes to the request. This is especially useful when you want to avoid dead sites. Example:
+
+```js
+const got = require('got');
+
+got('example.com', {
+ hooks: {
+ beforeRedirect: [
+ options => {
+ if (options.hostname === 'deadSite') {
+ options.hostname = 'fallbackSite';
+ }
+ }
+ ]
+ }
+});
+```
+
+###### hooks.beforeRetry
+
+Type: `Function[]`<br>
+Default: `[]`
+
+Called with [normalized](source/normalize-arguments.js) [request options](#options), the error and the retry count. Got will make no further changes to the request. This is especially useful when some extra work is required before the next try. Example:
+
+```js
+const got = require('got');
+
+got('example.com', {
+ hooks: {
+ beforeRetry: [
+ (options, error, retryCount) => {
+ if (error.statusCode === 413) { // Payload too large
+ options.body = getNewBody();
+ }
+ }
+ ]
+ }
+});
+```
+
+###### hooks.afterResponse
+
+Type: `Function[]`<br>
+Default: `[]`
+
+Called with [response object](#response) and a retry function.
+
+Each function should return the response. This is especially useful when you want to refresh an access token. Example:
+
+```js
+const got = require('got');
+
+const instance = got.extend({
+ hooks: {
+ afterResponse: [
+ (response, retryWithMergedOptions) => {
+ if (response.statusCode === 401) { // Unauthorized
+ const updatedOptions = {
+ headers: {
+ token: getNewToken() // Refresh the access token
+ }
+ };
+
+ // Save for further requests
+ instance.defaults.options = got.mergeOptions(instance.defaults.options, updatedOptions);
+
+ // Make a new retry
+ return retryWithMergedOptions(updatedOptions);
+ }
+
+ // No changes otherwise
+ return response;
+ }
+ ]
+ },
+ mutableDefaults: true
+});
+```
+
+###### hooks.beforeError
+
+Type: `Function[]`<br>
+Default: `[]`
+
+Called with an `Error` instance. The error is passed to the hook right before it's thrown. This is especially useful when you want to have more detailed errors.
+
+**Note**: Errors thrown while normalizing input options are thrown directly and not part of this hook.
+
+```js
+const got = require('got');
+
+got('api.github.com/some-endpoint', {
+ hooks: {
+ onError: [
+ error => {
+ const {response} = error;
+ if (response && response.body) {
+ error.name = 'GitHubError';
+ error.message = `${response.body.message} (${error.statusCode})`;
+ }
+
+ return error;
+ }
+ ]
+ }
+});
+```
+
+#### Response
+
+The response object will typically be a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage), however, if returned from the cache it will be a [response-like object](https://github.com/lukechilds/responselike) which behaves in the same way.
+
+##### request
+
+Type: `Object`
+
+**Note:** This is not a [http.ClientRequest](https://nodejs.org/api/http.html#http_class_http_clientrequest).
+
+- `gotOptions` - The options that were set on this request.
+
+##### body
+
+Type: `string` `Object` *(depending on `options.json`)*
+
+The result of the request.
+
+##### url
+
+Type: `string`
+
+The request URL or the final URL after redirects.
+
+##### requestUrl
+
+Type: `string`
+
+The original request URL.
+
+##### timings
+
+Type: `Object`
+
+The object contains the following properties:
+
+- `start` - Time when the request started.
+- `socket` - Time when a socket was assigned to the request.
+- `lookup` - Time when the DNS lookup finished.
+- `connect` - Time when the socket successfully connected.
+- `upload` - Time when the request finished uploading.
+- `response` - Time when the request fired the `response` event.
+- `end` - Time when the response fired the `end` event.
+- `error` - Time when the request fired the `error` event.
+- `phases`
+ - `wait` - `timings.socket - timings.start`
+ - `dns` - `timings.lookup - timings.socket`
+ - `tcp` - `timings.connect - timings.lookup`
+ - `request` - `timings.upload - timings.connect`
+ - `firstByte` - `timings.response - timings.upload`
+ - `download` - `timings.end - timings.response`
+ - `total` - `timings.end - timings.start` or `timings.error - timings.start`
+
+**Note:** The time is a `number` representing the milliseconds elapsed since the UNIX epoch.
+
+##### fromCache
+
+Type: `boolean`
+
+Whether the response was retrieved from the cache.
+
+##### redirectUrls
+
+Type: `Array`
+
+The redirect URLs.
+
+##### retryCount
+
+Type: `number`
+
+The number of times the request was retried.
+
+#### Streams
+
+**Note:** Progress events, redirect events and request/response events can also be used with promises.
+
+#### got.stream(url, [options])
+
+Sets `options.stream` to `true`.
+
+Returns a [duplex stream](https://nodejs.org/api/stream.html#stream_class_stream_duplex) with additional events:
+
+##### .on('request', request)
+
+`request` event to get the request object of the request.
+
+**Tip:** You can use `request` event to abort request:
+
+```js
+got.stream('github.com')
+ .on('request', request => setTimeout(() => request.abort(), 50));
+```
+
+##### .on('response', response)
+
+The `response` event to get the response object of the final request.
+
+##### .on('redirect', response, nextOptions)
+
+The `redirect` event to get the response object of a redirect. The second argument is options for the next request to the redirect location.
+
+##### .on('uploadProgress', progress)
+##### .on('downloadProgress', progress)
+
+Progress events for uploading (sending a request) and downloading (receiving a response). The `progress` argument is an object like:
+
+```js
+{
+ percent: 0.1,
+ transferred: 1024,
+ total: 10240
+}
+```
+
+If it's not possible to retrieve the body size (can happen when streaming), `total` will be `null`.
+
+```js
+(async () => {
+ const response = await got('sindresorhus.com')
+ .on('downloadProgress', progress => {
+ // Report download progress
+ })
+ .on('uploadProgress', progress => {
+ // Report upload progress
+ });
+
+ console.log(response);
+})();
+```
+
+##### .on('error', error, body, response)
+
+The `error` event emitted in case of a protocol error (like `ENOTFOUND` etc.) or status error (4xx or 5xx). The second argument is the body of the server response in case of status error. The third argument is a response object.
+
+#### got.get(url, [options])
+#### got.post(url, [options])
+#### got.put(url, [options])
+#### got.patch(url, [options])
+#### got.head(url, [options])
+#### got.delete(url, [options])
+
+Sets `options.method` to the method name and makes a request.
+
+### Instances
+
+#### got.extend([options])
+
+Configure a new `got` instance with default `options`. The `options` are merged with the parent instance's `defaults.options` using [`got.mergeOptions`](#gotmergeoptionsparentoptions-newoptions). You can access the resolved options with the `.defaults` property on the instance.
+
+```js
+const client = got.extend({
+ baseUrl: 'https://example.com',
+ headers: {
+ 'x-unicorn': 'rainbow'
+ }
+});
+
+client.get('/demo');
+
+/* HTTP Request =>
+ * GET /demo HTTP/1.1
+ * Host: example.com
+ * x-unicorn: rainbow
+ */
+```
+
+```js
+(async () => {
+ const client = got.extend({
+ baseUrl: 'httpbin.org',
+ headers: {
+ 'x-foo': 'bar'
+ }
+ });
+ const {headers} = (await client.get('/headers', {json: true})).body;
+ //=> headers['x-foo'] === 'bar'
+
+ const jsonClient = client.extend({
+ json: true,
+ headers: {
+ 'x-baz': 'qux'
+ }
+ });
+ const {headers: headers2} = (await jsonClient.get('/headers')).body;
+ //=> headers2['x-foo'] === 'bar'
+ //=> headers2['x-baz'] === 'qux'
+})();
+```
+
+**Tip:** Need more control over the behavior of Got? Check out the [`got.create()`](advanced-creation.md).
+
+#### got.mergeOptions(parentOptions, newOptions)
+
+Extends parent options. Avoid using [object spread](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#Spread_in_object_literals) as it doesn't work recursively:
+
+```js
+const a = {headers: {cat: 'meow', wolf: ['bark', 'wrrr']}};
+const b = {headers: {cow: 'moo', wolf: ['auuu']}};
+
+{...a, ...b} // => {headers: {cow: 'moo', wolf: ['auuu']}}
+got.mergeOptions(a, b) // => {headers: {cat: 'meow', cow: 'moo', wolf: ['auuu']}}
+```
+
+Options are deeply merged to a new object. The value of each key is determined as follows:
+
+- If the new property is set to `undefined`, it keeps the old one.
+- If the parent property is an instance of `URL` and the new value is a `string` or `URL`, a new URL instance is created: [`new URL(new, parent)`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#Syntax).
+- If the new property is a plain `Object`:
+ - If the parent property is a plain `Object` too, both values are merged recursively into a new `Object`.
+ - Otherwise, only the new value is deeply cloned.
+- If the new property is an `Array`, it overwrites the old one with a deep clone of the new property.
+- Otherwise, the new value is assigned to the key.
+
+#### got.defaults
+
+Type: `Object`
+
+The default Got options.
+
+## Errors
+
+Each error contains `host`, `hostname`, `method`, `path`, `protocol`, `url` and `gotOptions` properties to make debugging easier.
+
+In Promise mode, the `response` is attached to the error.
+
+#### got.CacheError
+
+When a cache method fails, for example, if the database goes down or there's a filesystem error.
+
+#### got.RequestError
+
+When a request fails. Contains a `code` property with error class code, like `ECONNREFUSED`.
+
+#### got.ReadError
+
+When reading from response stream fails.
+
+#### got.ParseError
+
+When `json` option is enabled, server response code is 2xx, and `JSON.parse` fails. Includes `statusCode` and `statusMessage` properties.
+
+#### got.HTTPError
+
+When the server response code is not 2xx. Includes `body`, `statusCode`, `statusMessage`, and `redirectUrls` properties.
+
+#### got.MaxRedirectsError
+
+When the server redirects you more than ten times. Includes a `statusCode`, `statusMessage`, and `redirectUrls` property which is an array of the URLs Got was redirected to before giving up.
+
+#### got.UnsupportedProtocolError
+
+When given an unsupported protocol.
+
+#### got.CancelError
+
+When the request is aborted with `.cancel()`.
+
+#### got.TimeoutError
+
+When the request is aborted due to a [timeout](#timeout). Includes an `event` property.
+
+## Aborting the request
+
+The promise returned by Got has a [`.cancel()`](https://github.com/sindresorhus/p-cancelable) method which when called, aborts the request.
+
+```js
+(async () => {
+ const request = got(url, options);
+
+ // …
+
+ // In another part of the code
+ if (something) {
+ request.cancel();
+ }
+
+ // …
+
+ try {
+ await request;
+ } catch (error) {
+ if (request.isCanceled) { // Or `error instanceof got.CancelError`
+ // Handle cancelation
+ }
+
+ // Handle other errors
+ }
+})();
+```
+
+<a name="cache-adapters"></a>
+## Cache
+
+Got implements [RFC 7234](http://httpwg.org/specs/rfc7234.html) compliant HTTP caching which works out of the box in-memory and is easily pluggable with a wide range of storage adapters. Fresh cache entries are served directly from the cache, and stale cache entries are revalidated with `If-None-Match`/`If-Modified-Since` headers. You can read more about the underlying cache behavior in the [`cacheable-request` documentation](https://github.com/lukechilds/cacheable-request).
+
+You can use the JavaScript `Map` type as an in-memory cache:
+
+```js
+const got = require('got');
+const map = new Map();
+
+(async () => {
+ let response = await got('sindresorhus.com', {cache: map});
+ console.log(response.fromCache);
+ //=> false
+
+ response = await got('sindresorhus.com', {cache: map});
+ console.log(response.fromCache);
+ //=> true
+})();
+```
+
+Got uses [Keyv](https://github.com/lukechilds/keyv) internally to support a wide range of storage adapters. For something more scalable you could use an [official Keyv storage adapter](https://github.com/lukechilds/keyv#official-storage-adapters):
+
+```
+$ npm install @keyv/redis
+```
+
+```js
+const got = require('got');
+const KeyvRedis = require('@keyv/redis');
+
+const redis = new KeyvRedis('redis://user:pass@localhost:6379');
+
+got('sindresorhus.com', {cache: redis});
+```
+
+Got supports anything that follows the Map API, so it's easy to write your own storage adapter or use a third-party solution.
+
+For example, the following are all valid storage adapters:
+
+```js
+const storageAdapter = new Map();
+// Or
+const storageAdapter = require('./my-storage-adapter');
+// Or
+const QuickLRU = require('quick-lru');
+const storageAdapter = new QuickLRU({maxSize: 1000});
+
+got('sindresorhus.com', {cache: storageAdapter});
+```
+
+View the [Keyv docs](https://github.com/lukechilds/keyv) for more information on how to use storage adapters.
+
+
+## Proxies
+
+You can use the [`tunnel`](https://github.com/koichik/node-tunnel) package with the `agent` option to work with proxies:
+
+```js
+const got = require('got');
+const tunnel = require('tunnel');
+
+got('sindresorhus.com', {
+ agent: tunnel.httpOverHttp({
+ proxy: {
+ host: 'localhost'
+ }
+ })
+});
+```
+
+Check out [`global-tunnel`](https://github.com/np-maintain/global-tunnel) if you want to configure proxy support for all HTTP/HTTPS traffic in your app.
+
+
+## Cookies
+
+You can use the [`tough-cookie`](https://github.com/salesforce/tough-cookie) package:
+
+```js
+const got = require('got');
+const {CookieJar} = require('tough-cookie');
+
+const cookieJar = new CookieJar();
+cookieJar.setCookie('foo=bar', 'https://www.google.com');
+
+got('google.com', {cookieJar});
+```
+
+
+## Form data
+
+You can use the [`form-data`](https://github.com/form-data/form-data) package to create POST request with form data:
+
+```js
+const fs = require('fs');
+const got = require('got');
+const FormData = require('form-data');
+const form = new FormData();
+
+form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
+
+got.post('google.com', {
+ body: form
+});
+```
+
+
+## OAuth
+
+You can use the [`oauth-1.0a`](https://github.com/ddo/oauth-1.0a) package to create a signed OAuth request:
+
+```js
+const got = require('got');
+const crypto = require('crypto');
+const OAuth = require('oauth-1.0a');
+
+const oauth = OAuth({
+ consumer: {
+ key: process.env.CONSUMER_KEY,
+ secret: process.env.CONSUMER_SECRET
+ },
+ signature_method: 'HMAC-SHA1',
+ hash_function: (baseString, key) => crypto.createHmac('sha1', key).update(baseString).digest('base64')
+});
+
+const token = {
+ key: process.env.ACCESS_TOKEN,
+ secret: process.env.ACCESS_TOKEN_SECRET
+};
+
+const url = 'https://api.twitter.com/1.1/statuses/home_timeline.json';
+
+got(url, {
+ headers: oauth.toHeader(oauth.authorize({url, method: 'GET'}, token)),
+ json: true
+});
+```
+
+
+## Unix Domain Sockets
+
+Requests can also be sent via [unix domain sockets](http://serverfault.com/questions/124517/whats-the-difference-between-unix-socket-and-tcp-ip-socket). Use the following URL scheme: `PROTOCOL://unix:SOCKET:PATH`.
+
+- `PROTOCOL` - `http` or `https` *(optional)*
+- `SOCKET` - Absolute path to a unix domain socket, for example: `/var/run/docker.sock`
+- `PATH` - Request path, for example: `/v2/keys`
+
+```js
+got('http://unix:/var/run/docker.sock:/containers/json');
+
+// Or without protocol (HTTP by default)
+got('unix:/var/run/docker.sock:/containers/json');
+```
+
+
+## AWS
+
+Requests to AWS services need to have their headers signed. This can be accomplished by using the [`aws4`](https://www.npmjs.com/package/aws4) package. This is an example for querying an ["API Gateway"](https://docs.aws.amazon.com/apigateway/api-reference/signing-requests/) with a signed request.
+
+```js
+const AWS = require('aws-sdk');
+const aws4 = require('aws4');
+const got = require('got');
+
+const chain = new AWS.CredentialProviderChain();
+
+// Create a Got instance to use relative paths and signed requests
+const awsClient = got.extend({
+ baseUrl: 'https://<api-id>.execute-api.<api-region>.amazonaws.com/<stage>/',
+ hooks: {
+ beforeRequest: [
+ async options => {
+ const credentials = await chain.resolvePromise();
+ aws4.sign(options, credentials);
+ }
+ ]
+ }
+});
+
+const response = await awsClient('endpoint/path', {
+ // Request-specific options
+});
+```
+
+
+## Testing
+
+You can test your requests by using the [`nock`](https://github.com/node-nock/nock) package to mock an endpoint:
+
+```js
+const got = require('got');
+const nock = require('nock');
+
+nock('https://sindresorhus.com')
+ .get('/')
+ .reply(200, 'Hello world!');
+
+(async () => {
+ const response = await got('sindresorhus.com');
+ console.log(response.body);
+ //=> 'Hello world!'
+})();
+```
+
+If you need real integration tests you can use [`create-test-server`](https://github.com/lukechilds/create-test-server):
+
+```js
+const got = require('got');
+const createTestServer = require('create-test-server');
+
+(async () => {
+ const server = await createTestServer();
+ server.get('/', 'Hello world!');
+
+ const response = await got(server.url);
+ console.log(response.body);
+ //=> 'Hello world!'
+
+ await server.close();
+})();
+```
+
+
+## Tips
+
+### User Agent
+
+It's a good idea to set the `'user-agent'` header so the provider can more easily see how their resource is used. By default, it's the URL to this repo. You can omit this header by setting it to `null`.
+
+```js
+const got = require('got');
+const pkg = require('./package.json');
+
+got('sindresorhus.com', {
+ headers: {
+ 'user-agent': `my-package/${pkg.version} (https://github.com/username/my-package)`
+ }
+});
+
+got('sindresorhus.com', {
+ headers: {
+ 'user-agent': null
+ }
+});
+```
+
+### 304 Responses
+
+Bear in mind; if you send an `if-modified-since` header and receive a `304 Not Modified` response, the body will be empty. It's your responsibility to cache and retrieve the body contents.
+
+### Custom endpoints
+
+Use `got.extend()` to make it nicer to work with REST APIs. Especially if you use the `baseUrl` option.
+
+**Note:** Not to be confused with [`got.create()`](advanced-creation.md), which has no defaults.
+
+```js
+const got = require('got');
+const pkg = require('./package.json');
+
+const custom = got.extend({
+ baseUrl: 'example.com',
+ json: true,
+ headers: {
+ 'user-agent': `my-package/${pkg.version} (https://github.com/username/my-package)`
+ }
+});
+
+// Use `custom` exactly how you use `got`
+(async () => {
+ const list = await custom('/v1/users/list');
+})();
+```
+
+**Tip:** Need to merge some instances into a single one? Check out [`got.mergeInstances()`](advanced-creation.md#merging-instances).
+
+### Experimental HTTP2 support
+
+Got provides an experimental support for HTTP2 using the [`http2-wrapper`](https://github.com/szmarczak/http2-wrapper) package:
+
+```js
+const got = require('got');
+const {request} = require('http2-wrapper');
+
+const h2got = got.extend({request});
+
+(async () => {
+ const {body} = await h2got('https://nghttp2.org/httpbin/headers');
+ console.log(body);
+})();
+```
+
+## Comparison
+
+| | `got` | [`request`][r0] | [`node-fetch`][n0] | [`axios`][a0] | [`superagent`][s0] |
+|-----------------------|:--------------:|:---------------:|:------------------:|:---------------:|:--------------------:|
+| HTTP/2 support | ❔ | ✖ | ✖ | ✖ | ✔\*\* |
+| Browser support | ✖ | ✖ | ✔\* | ✔ | ✔ |
+| Electron support | ✔ | ✖ | ✖ | ✖ | ✖ |
+| Promise API | ✔ | ✔ | ✔ | ✔ | ✔ |
+| Stream API | ✔ | ✔ | Node.js only | ✖ | ✔ |
+| Request cancelation | ✔ | ✖ | ✔ | ✔ | ✔ |
+| RFC compliant caching | ✔ | ✖ | ✖ | ✖ | ✖ |
+| Cookies (out-of-box) | ✔ | ✔ | ✖ | ✖ | ✖ |
+| Follows redirects | ✔ | ✔ | ✔ | ✔ | ✔ |
+| Retries on failure | ✔ | ✖ | ✖ | ✖ | ✔ |
+| Progress events | ✔ | ✖ | ✖ | Browser only | ✔ |
+| Handles gzip/deflate | ✔ | ✔ | ✔ | ✔ | ✔ |
+| Advanced timeouts | ✔ | ✖ | ✖ | ✖ | ✖ |
+| Timings | ✔ | ✔ | ✖ | ✖ | ✖ |
+| Errors with metadata | ✔ | ✖ | ✖ | ✔ | ✖ |
+| JSON mode | ✔ | ✔ | ✖ | ✔ | ✔ |
+| Custom defaults | ✔ | ✔ | ✖ | ✔ | ✖ |
+| Composable | ✔ | ✖ | ✖ | ✖ | ✔ |
+| Hooks | ✔ | ✖ | ✖ | ✔ | ✖ |
+| Issues open | [![][gio]][g1] | [![][rio]][r1] | [![][nio]][n1] | [![][aio]][a1] | [![][sio]][s1] |
+| Issues closed | [![][gic]][g2] | [![][ric]][r2] | [![][nic]][n2] | [![][aic]][a2] | [![][sic]][s2] |
+| Downloads | [![][gd]][g3] | [![][rd]][r3] | [![][nd]][n3] | [![][ad]][a3] | [![][sd]][s3] |
+| Coverage | [![][gc]][g4] | [![][rc]][r4] | [![][nc]][n4] | [![][ac]][a4] | unknown |
+| Build | [![][gb]][g5] | [![][rb]][r5] | [![][nb]][n5] | [![][ab]][a5] | [![][sb]][s5] |
+| Bugs | [![][gbg]][g6] | [![][rbg]][r6] | [![][nbg]][n6] | [![][abg]][a6] | [![][sbg]][s6] |
+| Dependents | [![][gdp]][g7] | [![][rdp]][r7] | [![][ndp]][n7] | [![][adp]][a7] | [![][sdp]][s7] |
+| Install size | [![][gis]][g8] | [![][ris]][r8] | [![][nis]][n8] | [![][ais]][a8] | [![][sis]][s8] |
+
+\* It's almost API compatible with the browser `fetch` API.<br>
+\*\* Need to switch the protocol manually.<br>
+❔ Experimental support.
+
+<!-- GITHUB -->
+[r0]: https://github.com/request/request
+[n0]: https://github.com/bitinn/node-fetch
+[a0]: https://github.com/axios/axios
+[s0]: https://github.com/visionmedia/superagent
+
+<!-- ISSUES OPEN -->
+[gio]: https://badgen.net/github/open-issues/sindresorhus/got?label
+[rio]: https://badgen.net/github/open-issues/request/request?label
+[nio]: https://badgen.net/github/open-issues/bitinn/node-fetch?label
+[aio]: https://badgen.net/github/open-issues/axios/axios?label
+[sio]: https://badgen.net/github/open-issues/visionmedia/superagent?label
+
+[g1]: https://github.com/sindresorhus/got/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
+[r1]: https://github.com/request/request/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
+[n1]: https://github.com/bitinn/node-fetch/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
+[a1]: https://github.com/axios/axios/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
+[s1]: https://github.com/visionmedia/superagent/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
+
+<!-- ISSUES CLOSED -->
+[gic]: https://badgen.net/github/closed-issues/sindresorhus/got?label
+[ric]: https://badgen.net/github/closed-issues/request/request?label
+[nic]: https://badgen.net/github/closed-issues/bitinn/node-fetch?label
+[aic]: https://badgen.net/github/closed-issues/axios/axios?label
+[sic]: https://badgen.net/github/closed-issues/visionmedia/superagent?label
+
+[g2]: https://github.com/sindresorhus/got/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
+[r2]: https://github.com/request/request/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
+[n2]: https://github.com/bitinn/node-fetch/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
+[a2]: https://github.com/axios/axios/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
+[s2]: https://github.com/visionmedia/superagent/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
+
+<!-- DOWNLOADS -->
+[gd]: https://badgen.net/npm/dm/got?label
+[rd]: https://badgen.net/npm/dm/request?label
+[nd]: https://badgen.net/npm/dm/node-fetch?label
+[ad]: https://badgen.net/npm/dm/axios?label
+[sd]: https://badgen.net/npm/dm/superagent?label
+
+[g3]: https://www.npmjs.com/package/got
+[r3]: https://www.npmjs.com/package/request
+[n3]: https://www.npmjs.com/package/node-fetch
+[a3]: https://www.npmjs.com/package/axios
+[s3]: https://www.npmjs.com/package/superagent
+
+<!-- COVERAGE -->
+[gc]: https://badgen.net/coveralls/c/github/sindresorhus/got?label
+[rc]: https://badgen.net/coveralls/c/github/request/request?label
+[nc]: https://badgen.net/coveralls/c/github/bitinn/node-fetch?label
+[ac]: https://badgen.net/coveralls/c/github/mzabriskie/axios?label
+
+[g4]: https://coveralls.io/github/sindresorhus/got
+[r4]: https://coveralls.io/github/request/request
+[n4]: https://coveralls.io/github/bitinn/node-fetch
+[a4]: https://coveralls.io/github/mzabriskie/axios
+
+<!-- BUILD -->
+[gb]: https://badgen.net/travis/sindresorhus/got?label
+[rb]: https://badgen.net/travis/request/request?label
+[nb]: https://badgen.net/travis/bitinn/node-fetch?label
+[ab]: https://badgen.net/travis/axios/axios?label
+[sb]: https://badgen.net/travis/visionmedia/superagent?label
+
+[g5]: https://travis-ci.org/sindresorhus/got
+[r5]: https://travis-ci.org/request/request
+[n5]: https://travis-ci.org/bitinn/node-fetch
+[a5]: https://travis-ci.org/axios/axios
+[s5]: https://travis-ci.org/visionmedia/superagent
+
+<!-- BUGS -->
+[gbg]: https://badgen.net/github/label-issues/sindresorhus/got/bug/open?label
+[rbg]: https://badgen.net/github/label-issues/request/request/Needs%20investigation/open?label
+[nbg]: https://badgen.net/github/label-issues/bitinn/node-fetch/bug/open?label
+[abg]: https://badgen.net/github/label-issues/axios/axios/bug/open?label
+[sbg]: https://badgen.net/github/label-issues/visionmedia/superagent/Bug/open?label
+
+[g6]: https://github.com/sindresorhus/got/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug
+[r6]: https://github.com/request/request/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A"Needs+investigation"
+[n6]: https://github.com/bitinn/node-fetch/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug
+[a6]: https://github.com/axios/axios/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug
+[s6]: https://github.com/visionmedia/superagent/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3ABug
+
+<!-- DEPENDENTS -->
+[gdp]: https://badgen.net/npm/dependents/got?label
+[rdp]: https://badgen.net/npm/dependents/request?label
+[ndp]: https://badgen.net/npm/dependents/node-fetch?label
+[adp]: https://badgen.net/npm/dependents/axios?label
+[sdp]: https://badgen.net/npm/dependents/superagent?label
+
+[g7]: https://www.npmjs.com/package/got?activeTab=dependents
+[r7]: https://www.npmjs.com/package/request?activeTab=dependents
+[n7]: https://www.npmjs.com/package/node-fetch?activeTab=dependents
+[a7]: https://www.npmjs.com/package/axios?activeTab=dependents
+[s7]: https://www.npmjs.com/package/visionmedia?activeTab=dependents
+
+<!-- INSTALL SIZE -->
+[gis]: https://badgen.net/packagephobia/install/got?label
+[ris]: https://badgen.net/packagephobia/install/request?label
+[nis]: https://badgen.net/packagephobia/install/node-fetch?label
+[ais]: https://badgen.net/packagephobia/install/axios?label
+[sis]: https://badgen.net/packagephobia/install/superagent?label
+
+[g8]: https://packagephobia.now.sh/result?p=got
+[r8]: https://packagephobia.now.sh/result?p=request
+[n8]: https://packagephobia.now.sh/result?p=node-fetch
+[a8]: https://packagephobia.now.sh/result?p=axios
+[s8]: https://packagephobia.now.sh/result?p=superagent
+
+
+## Related
+
+- [gh-got](https://github.com/sindresorhus/gh-got) - Got convenience wrapper to interact with the GitHub API
+- [gl-got](https://github.com/singapore/gl-got) - Got convenience wrapper to interact with the GitLab API
+- [travis-got](https://github.com/samverschueren/travis-got) - Got convenience wrapper to interact with the Travis API
+- [graphql-got](https://github.com/kevva/graphql-got) - Got convenience wrapper to interact with GraphQL
+- [GotQL](https://github.com/khaosdoctor/gotql) - Got convenience wrapper to interact with GraphQL using JSON-parsed queries instead of strings
+
+
+## Maintainers
+
+[![Sindre Sorhus](https://github.com/sindresorhus.png?size=100)](https://sindresorhus.com) | [![Vsevolod Strukchinsky](https://github.com/floatdrop.png?size=100)](https://github.com/floatdrop) | [![Alexander Tesfamichael](https://github.com/AlexTes.png?size=100)](https://github.com/AlexTes) | [![Luke Childs](https://github.com/lukechilds.png?size=100)](https://github.com/lukechilds) | [![Szymon Marczak](https://github.com/szmarczak.png?size=100)](https://github.com/szmarczak) | [![Brandon Smith](https://github.com/brandon93s.png?size=100)](https://github.com/brandon93s)
+---|---|---|---|---|---
+[Sindre Sorhus](https://sindresorhus.com) | [Vsevolod Strukchinsky](https://github.com/floatdrop) | [Alexander Tesfamichael](https://alextes.me) | [Luke Childs](https://github.com/lukechilds) | [Szymon Marczak](https://github.com/szmarczak) | [Brandon Smith](https://github.com/brandon93s)
+
+
+## License
+
+MIT
diff --git a/includes/translator/node_modules/got/source/as-promise.js b/includes/translator/node_modules/got/source/as-promise.js
new file mode 100644
index 0000000..c502325
--- /dev/null
+++ b/includes/translator/node_modules/got/source/as-promise.js
@@ -0,0 +1,108 @@
+'use strict';
+const EventEmitter = require('events');
+const getStream = require('get-stream');
+const is = require('@sindresorhus/is');
+const PCancelable = require('p-cancelable');
+const requestAsEventEmitter = require('./request-as-event-emitter');
+const {HTTPError, ParseError, ReadError} = require('./errors');
+const {options: mergeOptions} = require('./merge');
+const {reNormalize} = require('./normalize-arguments');
+
+const asPromise = options => {
+ const proxy = new EventEmitter();
+
+ const promise = new PCancelable((resolve, reject, onCancel) => {
+ const emitter = requestAsEventEmitter(options);
+
+ onCancel(emitter.abort);
+
+ emitter.on('response', async response => {
+ proxy.emit('response', response);
+
+ const stream = is.null(options.encoding) ? getStream.buffer(response) : getStream(response, options);
+
+ let data;
+ try {
+ data = await stream;
+ } catch (error) {
+ reject(new ReadError(error, options));
+ return;
+ }
+
+ const limitStatusCode = options.followRedirect ? 299 : 399;
+
+ response.body = data;
+
+ try {
+ for (const [index, hook] of Object.entries(options.hooks.afterResponse)) {
+ // eslint-disable-next-line no-await-in-loop
+ response = await hook(response, updatedOptions => {
+ updatedOptions = reNormalize(mergeOptions(options, {
+ ...updatedOptions,
+ retry: 0,
+ throwHttpErrors: false
+ }));
+
+ // Remove any further hooks for that request, because we we'll call them anyway.
+ // The loop continues. We don't want duplicates (asPromise recursion).
+ updatedOptions.hooks.afterResponse = options.hooks.afterResponse.slice(0, index);
+
+ return asPromise(updatedOptions);
+ });
+ }
+ } catch (error) {
+ reject(error);
+ return;
+ }
+
+ const {statusCode} = response;
+
+ if (options.json && response.body) {
+ try {
+ response.body = JSON.parse(response.body);
+ } catch (error) {
+ if (statusCode >= 200 && statusCode < 300) {
+ const parseError = new ParseError(error, statusCode, options, data);
+ Object.defineProperty(parseError, 'response', {value: response});
+ reject(parseError);
+ return;
+ }
+ }
+ }
+
+ if (statusCode !== 304 && (statusCode < 200 || statusCode > limitStatusCode)) {
+ const error = new HTTPError(response, options);
+ Object.defineProperty(error, 'response', {value: response});
+ if (emitter.retry(error) === false) {
+ if (options.throwHttpErrors) {
+ reject(error);
+ return;
+ }
+
+ resolve(response);
+ }
+
+ return;
+ }
+
+ resolve(response);
+ });
+
+ emitter.once('error', reject);
+ [
+ 'request',
+ 'redirect',
+ 'uploadProgress',
+ 'downloadProgress'
+ ].forEach(event => emitter.on(event, (...args) => proxy.emit(event, ...args)));
+ });
+
+ promise.on = (name, fn) => {
+ proxy.on(name, fn);
+ return promise;
+ };
+
+ return promise;
+};
+
+module.exports = asPromise;
diff --git a/includes/translator/node_modules/got/source/as-stream.js b/includes/translator/node_modules/got/source/as-stream.js
new file mode 100644
index 0000000..98c5342
--- /dev/null
+++ b/includes/translator/node_modules/got/source/as-stream.js
@@ -0,0 +1,93 @@
+'use strict';
+const {PassThrough} = require('stream');
+const duplexer3 = require('duplexer3');
+const requestAsEventEmitter = require('./request-as-event-emitter');
+const {HTTPError, ReadError} = require('./errors');
+
+module.exports = options => {
+ const input = new PassThrough();
+ const output = new PassThrough();
+ const proxy = duplexer3(input, output);
+ const piped = new Set();
+ let isFinished = false;
+
+ options.retry.retries = () => 0;
+
+ if (options.body) {
+ proxy.write = () => {
+ throw new Error('Got\'s stream is not writable when the `body` option is used');
+ };
+ }
+
+ const emitter = requestAsEventEmitter(options, input);
+
+ // Cancels the request
+ proxy._destroy = emitter.abort;
+
+ emitter.on('response', response => {
+ const {statusCode} = response;
+
+ response.on('error', error => {
+ proxy.emit('error', new ReadError(error, options));
+ });
+
+ if (options.throwHttpErrors && statusCode !== 304 && (statusCode < 200 || statusCode > 299)) {
+ proxy.emit('error', new HTTPError(response, options), null, response);
+ return;
+ }
+
+ isFinished = true;
+
+ response.pipe(output);
+
+ for (const destination of piped) {
+ if (destination.headersSent) {
+ continue;
+ }
+
+ for (const [key, value] of Object.entries(response.headers)) {
+ // Got gives *decompressed* data. Overriding `content-encoding` header would result in an error.
+ // It's not possible to decompress already decompressed data, is it?
+ const allowed = options.decompress ? key !== 'content-encoding' : true;
+ if (allowed) {
+ destination.setHeader(key, value);
+ }
+ }
+
+ destination.statusCode = response.statusCode;
+ }
+
+ proxy.emit('response', response);
+ });
+
+ [
+ 'error',
+ 'request',
+ 'redirect',
+ 'uploadProgress',
+ 'downloadProgress'
+ ].forEach(event => emitter.on(event, (...args) => proxy.emit(event, ...args)));
+
+ const pipe = proxy.pipe.bind(proxy);
+ const unpipe = proxy.unpipe.bind(proxy);
+ proxy.pipe = (destination, options) => {
+ if (isFinished) {
+ throw new Error('Failed to pipe. The response has been emitted already.');
+ }
+
+ const result = pipe(destination, options);
+
+ if (Reflect.has(destination, 'setHeader')) {
+ piped.add(destination);
+ }
+
+ return result;
+ };
+
+ proxy.unpipe = stream => {
+ piped.delete(stream);
+ return unpipe(stream);
+ };
+
+ return proxy;
+};
diff --git a/includes/translator/node_modules/got/source/create.js b/includes/translator/node_modules/got/source/create.js
new file mode 100644
index 0000000..b78c51f
--- /dev/null
+++ b/includes/translator/node_modules/got/source/create.js
@@ -0,0 +1,79 @@
+'use strict';
+const errors = require('./errors');
+const asStream = require('./as-stream');
+const asPromise = require('./as-promise');
+const normalizeArguments = require('./normalize-arguments');
+const merge = require('./merge');
+const deepFreeze = require('./utils/deep-freeze');
+
+const getPromiseOrStream = options => options.stream ? asStream(options) : asPromise(options);
+
+const aliases = [
+ 'get',
+ 'post',
+ 'put',
+ 'patch',
+ 'head',
+ 'delete'
+];
+
+const create = defaults => {
+ defaults = merge({}, defaults);
+ normalizeArguments.preNormalize(defaults.options);
+
+ if (!defaults.handler) {
+ // This can't be getPromiseOrStream, because when merging
+ // the chain would stop at this point and no further handlers would be called.
+ defaults.handler = (options, next) => next(options);
+ }
+
+ function got(url, options) {
+ try {
+ return defaults.handler(normalizeArguments(url, options, defaults), getPromiseOrStream);
+ } catch (error) {
+ if (options && options.stream) {
+ throw error;
+ } else {
+ return Promise.reject(error);
+ }
+ }
+ }
+
+ got.create = create;
+ got.extend = options => {
+ let mutableDefaults;
+ if (options && Reflect.has(options, 'mutableDefaults')) {
+ mutableDefaults = options.mutableDefaults;
+ delete options.mutableDefaults;
+ } else {
+ mutableDefaults = defaults.mutableDefaults;
+ }
+
+ return create({
+ options: merge.options(defaults.options, options),
+ handler: defaults.handler,
+ mutableDefaults
+ });
+ };
+
+ got.mergeInstances = (...args) => create(merge.instances(args));
+
+ got.stream = (url, options) => got(url, {...options, stream: true});
+
+ for (const method of aliases) {
+ got[method] = (url, options) => got(url, {...options, method});
+ got.stream[method] = (url, options) => got.stream(url, {...options, method});
+ }
+
+ Object.assign(got, {...errors, mergeOptions: merge.options});
+ Object.defineProperty(got, 'defaults', {
+ value: defaults.mutableDefaults ? defaults : deepFreeze(defaults),
+ writable: defaults.mutableDefaults,
+ configurable: defaults.mutableDefaults,
+ enumerable: true
+ });
+
+ return got;
+};
+
+module.exports = create;
diff --git a/includes/translator/node_modules/got/source/errors.js b/includes/translator/node_modules/got/source/errors.js
new file mode 100644
index 0000000..b6cbadc
--- /dev/null
+++ b/includes/translator/node_modules/got/source/errors.js
@@ -0,0 +1,107 @@
+'use strict';
+const urlLib = require('url');
+const http = require('http');
+const PCancelable = require('p-cancelable');
+const is = require('@sindresorhus/is');
+
+class GotError extends Error {
+ constructor(message, error, options) {
+ super(message);
+ Error.captureStackTrace(this, this.constructor);
+ this.name = 'GotError';
+
+ if (!is.undefined(error.code)) {
+ this.code = error.code;
+ }
+
+ Object.assign(this, {
+ host: options.host,
+ hostname: options.hostname,
+ method: options.method,
+ path: options.path,
+ socketPath: options.socketPath,
+ protocol: options.protocol,
+ url: options.href,
+ gotOptions: options
+ });
+ }
+}
+
+module.exports.GotError = GotError;
+
+module.exports.CacheError = class extends GotError {
+ constructor(error, options) {
+ super(error.message, error, options);
+ this.name = 'CacheError';
+ }
+};
+
+module.exports.RequestError = class extends GotError {
+ constructor(error, options) {
+ super(error.message, error, options);
+ this.name = 'RequestError';
+ }
+};
+
+module.exports.ReadError = class extends GotError {
+ constructor(error, options) {
+ super(error.message, error, options);
+ this.name = 'ReadError';
+ }
+};
+
+module.exports.ParseError = class extends GotError {
+ constructor(error, statusCode, options, data) {
+ super(`${error.message} in "${urlLib.format(options)}": \n${data.slice(0, 77)}...`, error, options);
+ this.name = 'ParseError';
+ this.statusCode = statusCode;
+ this.statusMessage = http.STATUS_CODES[this.statusCode];
+ }
+};
+
+module.exports.HTTPError = class extends GotError {
+ constructor(response, options) {
+ const {statusCode} = response;
+ let {statusMessage} = response;
+
+ if (statusMessage) {
+ statusMessage = statusMessage.replace(/\r?\n/g, ' ').trim();
+ } else {
+ statusMessage = http.STATUS_CODES[statusCode];
+ }
+
+ super(`Response code ${statusCode} (${statusMessage})`, {}, options);
+ this.name = 'HTTPError';
+ this.statusCode = statusCode;
+ this.statusMessage = statusMessage;
+ this.headers = response.headers;
+ this.body = response.body;
+ }
+};
+
+module.exports.MaxRedirectsError = class extends GotError {
+ constructor(statusCode, redirectUrls, options) {
+ super('Redirected 10 times. Aborting.', {}, options);
+ this.name = 'MaxRedirectsError';
+ this.statusCode = statusCode;
+ this.statusMessage = http.STATUS_CODES[this.statusCode];
+ this.redirectUrls = redirectUrls;
+ }
+};
+
+module.exports.UnsupportedProtocolError = class extends GotError {
+ constructor(options) {
+ super(`Unsupported protocol "${options.protocol}"`, {}, options);
+ this.name = 'UnsupportedProtocolError';
+ }
+};
+
+module.exports.TimeoutError = class extends GotError {
+ constructor(error, options) {
+ super(error.message, {code: 'ETIMEDOUT'}, options);
+ this.name = 'TimeoutError';
+ this.event = error.event;
+ }
+};
+
+module.exports.CancelError = PCancelable.CancelError;
diff --git a/includes/translator/node_modules/got/source/get-response.js b/includes/translator/node_modules/got/source/get-response.js
new file mode 100644
index 0000000..18453c2
--- /dev/null
+++ b/includes/translator/node_modules/got/source/get-response.js
@@ -0,0 +1,31 @@
+'use strict';
+const decompressResponse = require('decompress-response');
+const is = require('@sindresorhus/is');
+const mimicResponse = require('mimic-response');
+const progress = require('./progress');
+
+module.exports = (response, options, emitter) => {
+ const downloadBodySize = Number(response.headers['content-length']) || null;
+
+ const progressStream = progress.download(response, emitter, downloadBodySize);
+
+ mimicResponse(response, progressStream);
+
+ const newResponse = options.decompress === true &&
+ is.function(decompressResponse) &&
+ options.method !== 'HEAD' ? decompressResponse(progressStream) : progressStream;
+
+ if (!options.decompress && ['gzip', 'deflate'].includes(response.headers['content-encoding'])) {
+ options.encoding = null;
+ }
+
+ emitter.emit('response', newResponse);
+
+ emitter.emit('downloadProgress', {
+ percent: 0,
+ transferred: 0,
+ total: downloadBodySize
+ });
+
+ response.pipe(progressStream);
+};
diff --git a/includes/translator/node_modules/got/source/index.js b/includes/translator/node_modules/got/source/index.js
new file mode 100644
index 0000000..cbf7c37
--- /dev/null
+++ b/includes/translator/node_modules/got/source/index.js
@@ -0,0 +1,60 @@
+'use strict';
+const pkg = require('../package.json');
+const create = require('./create');
+
+const defaults = {
+ options: {
+ retry: {
+ retries: 2,
+ methods: [
+ 'GET',
+ 'PUT',
+ 'HEAD',
+ 'DELETE',
+ 'OPTIONS',
+ 'TRACE'
+ ],
+ statusCodes: [
+ 408,
+ 413,
+ 429,
+ 500,
+ 502,
+ 503,
+ 504
+ ],
+ errorCodes: [
+ 'ETIMEDOUT',
+ 'ECONNRESET',
+ 'EADDRINUSE',
+ 'ECONNREFUSED',
+ 'EPIPE',
+ 'ENOTFOUND',
+ 'ENETUNREACH',
+ 'EAI_AGAIN'
+ ]
+ },
+ headers: {
+ 'user-agent': `${pkg.name}/${pkg.version} (https://github.com/sindresorhus/got)`
+ },
+ hooks: {
+ beforeRequest: [],
+ beforeRedirect: [],
+ beforeRetry: [],
+ afterResponse: []
+ },
+ decompress: true,
+ throwHttpErrors: true,
+ followRedirect: true,
+ stream: false,
+ form: false,
+ json: false,
+ cache: false,
+ useElectronNet: false
+ },
+ mutableDefaults: false
+};
+
+const got = create(defaults);
+
+module.exports = got;
diff --git a/includes/translator/node_modules/got/source/known-hook-events.js b/includes/translator/node_modules/got/source/known-hook-events.js
new file mode 100644
index 0000000..cd245e1
--- /dev/null
+++ b/includes/translator/node_modules/got/source/known-hook-events.js
@@ -0,0 +1,10 @@
+'use strict';
+
+module.exports = [
+ 'beforeError',
+ 'init',
+ 'beforeRequest',
+ 'beforeRedirect',
+ 'beforeRetry',
+ 'afterResponse'
+];
diff --git a/includes/translator/node_modules/got/source/merge.js b/includes/translator/node_modules/got/source/merge.js
new file mode 100644
index 0000000..900f09a
--- /dev/null
+++ b/includes/translator/node_modules/got/source/merge.js
@@ -0,0 +1,73 @@
+'use strict';
+const {URL} = require('url');
+const is = require('@sindresorhus/is');
+const knownHookEvents = require('./known-hook-events');
+
+const merge = (target, ...sources) => {
+ for (const source of sources) {
+ for (const [key, sourceValue] of Object.entries(source)) {
+ if (is.undefined(sourceValue)) {
+ continue;
+ }
+
+ const targetValue = target[key];
+ if (is.urlInstance(targetValue) && (is.urlInstance(sourceValue) || is.string(sourceValue))) {
+ target[key] = new URL(sourceValue, targetValue);
+ } else if (is.plainObject(sourceValue)) {
+ if (is.plainObject(targetValue)) {
+ target[key] = merge({}, targetValue, sourceValue);
+ } else {
+ target[key] = merge({}, sourceValue);
+ }
+ } else if (is.array(sourceValue)) {
+ target[key] = merge([], sourceValue);
+ } else {
+ target[key] = sourceValue;
+ }
+ }
+ }
+
+ return target;
+};
+
+const mergeOptions = (...sources) => {
+ sources = sources.map(source => source || {});
+ const merged = merge({}, ...sources);
+
+ const hooks = {};
+ for (const hook of knownHookEvents) {
+ hooks[hook] = [];
+ }
+
+ for (const source of sources) {
+ if (source.hooks) {
+ for (const hook of knownHookEvents) {
+ hooks[hook] = hooks[hook].concat(source.hooks[hook]);
+ }
+ }
+ }
+
+ merged.hooks = hooks;
+
+ return merged;
+};
+
+const mergeInstances = (instances, methods) => {
+ const handlers = instances.map(instance => instance.defaults.handler);
+ const size = instances.length - 1;
+
+ return {
+ methods,
+ options: mergeOptions(...instances.map(instance => instance.defaults.options)),
+ handler: (options, next) => {
+ let iteration = -1;
+ const iterate = options => handlers[++iteration](options, iteration === size ? next : iterate);
+
+ return iterate(options);
+ }
+ };
+};
+
+module.exports = merge;
+module.exports.options = mergeOptions;
+module.exports.instances = mergeInstances;
diff --git a/includes/translator/node_modules/got/source/normalize-arguments.js b/includes/translator/node_modules/got/source/normalize-arguments.js
new file mode 100644
index 0000000..665cbce
--- /dev/null
+++ b/includes/translator/node_modules/got/source/normalize-arguments.js
@@ -0,0 +1,265 @@
+'use strict';
+const {URL, URLSearchParams} = require('url'); // TODO: Use the `URL` global when targeting Node.js 10
+const urlLib = require('url');
+const is = require('@sindresorhus/is');
+const urlParseLax = require('url-parse-lax');
+const lowercaseKeys = require('lowercase-keys');
+const urlToOptions = require('./utils/url-to-options');
+const isFormData = require('./utils/is-form-data');
+const merge = require('./merge');
+const knownHookEvents = require('./known-hook-events');
+
+const retryAfterStatusCodes = new Set([413, 429, 503]);
+
+// `preNormalize` handles static options (e.g. headers).
+// For example, when you create a custom instance and make a request
+// with no static changes, they won't be normalized again.
+//
+// `normalize` operates on dynamic options - they cannot be saved.
+// For example, `body` is everytime different per request.
+// When it's done normalizing the new options, it performs merge()
+// on the prenormalized options and the normalized ones.
+
+const preNormalize = (options, defaults) => {
+ if (is.nullOrUndefined(options.headers)) {
+ options.headers = {};
+ } else {
+ options.headers = lowercaseKeys(options.headers);
+ }
+
+ if (options.baseUrl && !options.baseUrl.toString().endsWith('/')) {
+ options.baseUrl += '/';
+ }
+
+ if (options.stream) {
+ options.json = false;
+ }
+
+ if (is.nullOrUndefined(options.hooks)) {
+ options.hooks = {};
+ } else if (!is.object(options.hooks)) {
+ throw new TypeError(`Parameter \`hooks\` must be an object, not ${is(options.hooks)}`);
+ }
+
+ for (const event of knownHookEvents) {
+ if (is.nullOrUndefined(options.hooks[event])) {
+ if (defaults) {
+ options.hooks[event] = [...defaults.hooks[event]];
+ } else {
+ options.hooks[event] = [];
+ }
+ }
+ }
+
+ if (is.number(options.timeout)) {
+ options.gotTimeout = {request: options.timeout};
+ } else if (is.object(options.timeout)) {
+ options.gotTimeout = options.timeout;
+ }
+
+ delete options.timeout;
+
+ const {retry} = options;
+ options.retry = {
+ retries: 0,
+ methods: [],
+ statusCodes: [],
+ errorCodes: []
+ };
+
+ if (is.nonEmptyObject(defaults) && retry !== false) {
+ options.retry = {...defaults.retry};
+ }
+
+ if (retry !== false) {
+ if (is.number(retry)) {
+ options.retry.retries = retry;
+ } else {
+ options.retry = {...options.retry, ...retry};
+ }
+ }
+
+ if (options.gotTimeout) {
+ options.retry.maxRetryAfter = Math.min(...[options.gotTimeout.request, options.gotTimeout.connection].filter(n => !is.nullOrUndefined(n)));
+ }
+
+ if (is.array(options.retry.methods)) {
+ options.retry.methods = new Set(options.retry.methods.map(method => method.toUpperCase()));
+ }
+
+ if (is.array(options.retry.statusCodes)) {
+ options.retry.statusCodes = new Set(options.retry.statusCodes);
+ }
+
+ if (is.array(options.retry.errorCodes)) {
+ options.retry.errorCodes = new Set(options.retry.errorCodes);
+ }
+
+ return options;
+};
+
+const normalize = (url, options, defaults) => {
+ if (is.plainObject(url)) {
+ options = {...url, ...options};
+ url = options.url || {};
+ delete options.url;
+ }
+
+ if (defaults) {
+ options = merge({}, defaults.options, options ? preNormalize(options, defaults.options) : {});
+ } else {
+ options = merge({}, preNormalize(options));
+ }
+
+ if (!is.string(url) && !is.object(url)) {
+ throw new TypeError(`Parameter \`url\` must be a string or object, not ${is(url)}`);
+ }
+
+ if (is.string(url)) {
+ if (options.baseUrl) {
+ if (url.toString().startsWith('/')) {
+ url = url.toString().slice(1);
+ }
+
+ url = urlToOptions(new URL(url, options.baseUrl));
+ } else {
+ url = url.replace(/^unix:/, 'http://$&');
+ url = urlParseLax(url);
+ }
+ } else if (is(url) === 'URL') {
+ url = urlToOptions(url);
+ }
+
+ // Override both null/undefined with default protocol
+ options = merge({path: ''}, url, {protocol: url.protocol || 'https:'}, options);
+
+ for (const hook of options.hooks.init) {
+ const called = hook(options);
+
+ if (is.promise(called)) {
+ throw new TypeError('The `init` hook must be a synchronous function');
+ }
+ }
+
+ const {baseUrl} = options;
+ Object.defineProperty(options, 'baseUrl', {
+ set: () => {
+ throw new Error('Failed to set baseUrl. Options are normalized already.');
+ },
+ get: () => baseUrl
+ });
+
+ const {query} = options;
+ if (is.nonEmptyString(query) || is.nonEmptyObject(query) || query instanceof URLSearchParams) {
+ if (!is.string(query)) {
+ options.query = (new URLSearchParams(query)).toString();
+ }
+
+ options.path = `${options.path.split('?')[0]}?${options.query}`;
+ delete options.query;
+ }
+
+ if (options.hostname === 'unix') {
+ const matches = /(.+?):(.+)/.exec(options.path);
+
+ if (matches) {
+ const [, socketPath, path] = matches;
+ options = {
+ ...options,
+ socketPath,
+ path,
+ host: null
+ };
+ }
+ }
+
+ const {headers} = options;
+ for (const [key, value] of Object.entries(headers)) {
+ if (is.nullOrUndefined(value)) {
+ delete headers[key];
+ }
+ }
+
+ if (options.json && is.undefined(headers.accept)) {
+ headers.accept = 'application/json';
+ }
+
+ if (options.decompress && is.undefined(headers['accept-encoding'])) {
+ headers['accept-encoding'] = 'gzip, deflate';
+ }
+
+ const {body} = options;
+ if (is.nullOrUndefined(body)) {
+ options.method = options.method ? options.method.toUpperCase() : 'GET';
+ } else {
+ const isObject = is.object(body) && !is.buffer(body) && !is.nodeStream(body);
+ if (!is.nodeStream(body) && !is.string(body) && !is.buffer(body) && !(options.form || options.json)) {
+ throw new TypeError('The `body` option must be a stream.Readable, string or Buffer');
+ }
+
+ if (options.json && !(isObject || is.array(body))) {
+ throw new TypeError('The `body` option must be an Object or Array when the `json` option is used');
+ }
+
+ if (options.form && !isObject) {
+ throw new TypeError('The `body` option must be an Object when the `form` option is used');
+ }
+
+ if (isFormData(body)) {
+ // Special case for https://github.com/form-data/form-data
+ headers['content-type'] = headers['content-type'] || `multipart/form-data; boundary=${body.getBoundary()}`;
+ } else if (options.form) {
+ headers['content-type'] = headers['content-type'] || 'application/x-www-form-urlencoded';
+ options.body = (new URLSearchParams(body)).toString();
+ } else if (options.json) {
+ headers['content-type'] = headers['content-type'] || 'application/json';
+ options.body = JSON.stringify(body);
+ }
+
+ options.method = options.method ? options.method.toUpperCase() : 'POST';
+ }
+
+ if (!is.function(options.retry.retries)) {
+ const {retries} = options.retry;
+
+ options.retry.retries = (iteration, error) => {
+ if (iteration > retries) {
+ return 0;
+ }
+
+ if ((!error || !options.retry.errorCodes.has(error.code)) && (!options.retry.methods.has(error.method) || !options.retry.statusCodes.has(error.statusCode))) {
+ return 0;
+ }
+
+ if (Reflect.has(error, 'headers') && Reflect.has(error.headers, 'retry-after') && retryAfterStatusCodes.has(error.statusCode)) {
+ let after = Number(error.headers['retry-after']);
+ if (is.nan(after)) {
+ after = Date.parse(error.headers['retry-after']) - Date.now();
+ } else {
+ after *= 1000;
+ }
+
+ if (after > options.retry.maxRetryAfter) {
+ return 0;
+ }
+
+ return after;
+ }
+
+ if (error.statusCode === 413) {
+ return 0;
+ }
+
+ const noise = Math.random() * 100;
+ return ((2 ** (iteration - 1)) * 1000) + noise;
+ };
+ }
+
+ return options;
+};
+
+const reNormalize = options => normalize(urlLib.format(options), options);
+
+module.exports = normalize;
+module.exports.preNormalize = preNormalize;
+module.exports.reNormalize = reNormalize;
diff --git a/includes/translator/node_modules/got/source/progress.js b/includes/translator/node_modules/got/source/progress.js
new file mode 100644
index 0000000..666abcf
--- /dev/null
+++ b/includes/translator/node_modules/got/source/progress.js
@@ -0,0 +1,96 @@
+'use strict';
+const {Transform} = require('stream');
+
+module.exports = {
+ download(response, emitter, downloadBodySize) {
+ let downloaded = 0;
+
+ return new Transform({
+ transform(chunk, encoding, callback) {
+ downloaded += chunk.length;
+
+ const percent = downloadBodySize ? downloaded / downloadBodySize : 0;
+
+ // Let `flush()` be responsible for emitting the last event
+ if (percent < 1) {
+ emitter.emit('downloadProgress', {
+ percent,
+ transferred: downloaded,
+ total: downloadBodySize
+ });
+ }
+
+ callback(null, chunk);
+ },
+
+ flush(callback) {
+ emitter.emit('downloadProgress', {
+ percent: 1,
+ transferred: downloaded,
+ total: downloadBodySize
+ });
+
+ callback();
+ }
+ });
+ },
+
+ upload(request, emitter, uploadBodySize) {
+ const uploadEventFrequency = 150;
+ let uploaded = 0;
+ let progressInterval;
+
+ emitter.emit('uploadProgress', {
+ percent: 0,
+ transferred: 0,
+ total: uploadBodySize
+ });
+
+ request.once('error', () => {
+ clearInterval(progressInterval);
+ });
+
+ request.once('response', () => {
+ clearInterval(progressInterval);
+
+ emitter.emit('uploadProgress', {
+ percent: 1,
+ transferred: uploaded,
+ total: uploadBodySize
+ });
+ });
+
+ request.once('socket', socket => {
+ const onSocketConnect = () => {
+ progressInterval = setInterval(() => {
+ const lastUploaded = uploaded;
+ /* istanbul ignore next: see #490 (occurs randomly!) */
+ const headersSize = request._header ? Buffer.byteLength(request._header) : 0;
+ uploaded = socket.bytesWritten - headersSize;
+
+ // Don't emit events with unchanged progress and
+ // prevent last event from being emitted, because
+ // it's emitted when `response` is emitted
+ if (uploaded === lastUploaded || uploaded === uploadBodySize) {
+ return;
+ }
+
+ emitter.emit('uploadProgress', {
+ percent: uploadBodySize ? uploaded / uploadBodySize : 0,
+ transferred: uploaded,
+ total: uploadBodySize
+ });
+ }, uploadEventFrequency);
+ };
+
+ /* istanbul ignore next: hard to test */
+ if (socket.connecting) {
+ socket.once('connect', onSocketConnect);
+ } else if (socket.writable) {
+ // The socket is being reused from pool,
+ // so the connect event will not be emitted
+ onSocketConnect();
+ }
+ });
+ }
+};
diff --git a/includes/translator/node_modules/got/source/request-as-event-emitter.js b/includes/translator/node_modules/got/source/request-as-event-emitter.js
new file mode 100644
index 0000000..79586af
--- /dev/null
+++ b/includes/translator/node_modules/got/source/request-as-event-emitter.js
@@ -0,0 +1,312 @@
+'use strict';
+const {URL} = require('url'); // TODO: Use the `URL` global when targeting Node.js 10
+const util = require('util');
+const EventEmitter = require('events');
+const http = require('http');
+const https = require('https');
+const urlLib = require('url');
+const CacheableRequest = require('cacheable-request');
+const toReadableStream = require('to-readable-stream');
+const is = require('@sindresorhus/is');
+const timer = require('@szmarczak/http-timer');
+const timedOut = require('./utils/timed-out');
+const getBodySize = require('./utils/get-body-size');
+const getResponse = require('./get-response');
+const progress = require('./progress');
+const {CacheError, UnsupportedProtocolError, MaxRedirectsError, RequestError, TimeoutError} = require('./errors');
+const urlToOptions = require('./utils/url-to-options');
+
+const getMethodRedirectCodes = new Set([300, 301, 302, 303, 304, 305, 307, 308]);
+const allMethodRedirectCodes = new Set([300, 303, 307, 308]);
+
+module.exports = (options, input) => {
+ const emitter = new EventEmitter();
+ const redirects = [];
+ let currentRequest;
+ let requestUrl;
+ let redirectString;
+ let uploadBodySize;
+ let retryCount = 0;
+ let shouldAbort = false;
+
+ const setCookie = options.cookieJar ? util.promisify(options.cookieJar.setCookie.bind(options.cookieJar)) : null;
+ const getCookieString = options.cookieJar ? util.promisify(options.cookieJar.getCookieString.bind(options.cookieJar)) : null;
+ const agents = is.object(options.agent) ? options.agent : null;
+
+ const emitError = async error => {
+ try {
+ for (const hook of options.hooks.beforeError) {
+ // eslint-disable-next-line no-await-in-loop
+ error = await hook(error);
+ }
+
+ emitter.emit('error', error);
+ } catch (error2) {
+ emitter.emit('error', error2);
+ }
+ };
+
+ const get = async options => {
+ const currentUrl = redirectString || requestUrl;
+
+ if (options.protocol !== 'http:' && options.protocol !== 'https:') {
+ throw new UnsupportedProtocolError(options);
+ }
+
+ decodeURI(currentUrl);
+
+ let fn;
+ if (is.function(options.request)) {
+ fn = {request: options.request};
+ } else {
+ fn = options.protocol === 'https:' ? https : http;
+ }
+
+ if (agents) {
+ const protocolName = options.protocol === 'https:' ? 'https' : 'http';
+ options.agent = agents[protocolName] || options.agent;
+ }
+
+ /* istanbul ignore next: electron.net is broken */
+ if (options.useElectronNet && process.versions.electron) {
+ const r = ({x: require})['yx'.slice(1)]; // Trick webpack
+ const electron = r('electron');
+ fn = electron.net || electron.remote.net;
+ }
+
+ if (options.cookieJar) {
+ const cookieString = await getCookieString(currentUrl, {});
+
+ if (is.nonEmptyString(cookieString)) {
+ options.headers.cookie = cookieString;
+ }
+ }
+
+ let timings;
+ const handleResponse = async response => {
+ try {
+ /* istanbul ignore next: fixes https://github.com/electron/electron/blob/cbb460d47628a7a146adf4419ed48550a98b2923/lib/browser/api/net.js#L59-L65 */
+ if (options.useElectronNet) {
+ response = new Proxy(response, {
+ get: (target, name) => {
+ if (name === 'trailers' || name === 'rawTrailers') {
+ return [];
+ }
+
+ const value = target[name];
+ return is.function(value) ? value.bind(target) : value;
+ }
+ });
+ }
+
+ const {statusCode} = response;
+ response.url = currentUrl;
+ response.requestUrl = requestUrl;
+ response.retryCount = retryCount;
+ response.timings = timings;
+ response.redirectUrls = redirects;
+ response.request = {
+ gotOptions: options
+ };
+
+ const rawCookies = response.headers['set-cookie'];
+ if (options.cookieJar && rawCookies) {
+ await Promise.all(rawCookies.map(rawCookie => setCookie(rawCookie, response.url)));
+ }
+
+ if (options.followRedirect && 'location' in response.headers) {
+ if (allMethodRedirectCodes.has(statusCode) || (getMethodRedirectCodes.has(statusCode) && (options.method === 'GET' || options.method === 'HEAD'))) {
+ response.resume(); // We're being redirected, we don't care about the response.
+
+ if (statusCode === 303) {
+ // Server responded with "see other", indicating that the resource exists at another location,
+ // and the client should request it from that location via GET or HEAD.
+ options.method = 'GET';
+ }
+
+ if (redirects.length >= 10) {
+ throw new MaxRedirectsError(statusCode, redirects, options);
+ }
+
+ // Handles invalid URLs. See https://github.com/sindresorhus/got/issues/604
+ const redirectBuffer = Buffer.from(response.headers.location, 'binary').toString();
+ const redirectURL = new URL(redirectBuffer, currentUrl);
+ redirectString = redirectURL.toString();
+
+ redirects.push(redirectString);
+
+ const redirectOptions = {
+ ...options,
+ ...urlToOptions(redirectURL)
+ };
+
+ for (const hook of options.hooks.beforeRedirect) {
+ // eslint-disable-next-line no-await-in-loop
+ await hook(redirectOptions);
+ }
+
+ emitter.emit('redirect', response, redirectOptions);
+
+ await get(redirectOptions);
+ return;
+ }
+ }
+
+ getResponse(response, options, emitter);
+ } catch (error) {
+ emitError(error);
+ }
+ };
+
+ const handleRequest = request => {
+ if (shouldAbort) {
+ request.once('error', () => {});
+ request.abort();
+ return;
+ }
+
+ currentRequest = request;
+
+ request.once('error', error => {
+ if (request.aborted) {
+ return;
+ }
+
+ if (error instanceof timedOut.TimeoutError) {
+ error = new TimeoutError(error, options);
+ } else {
+ error = new RequestError(error, options);
+ }
+
+ if (emitter.retry(error) === false) {
+ emitError(error);
+ }
+ });
+
+ timings = timer(request);
+
+ progress.upload(request, emitter, uploadBodySize);
+
+ if (options.gotTimeout) {
+ timedOut(request, options.gotTimeout, options);
+ }
+
+ emitter.emit('request', request);
+
+ const uploadComplete = () => {
+ request.emit('upload-complete');
+ };
+
+ try {
+ if (is.nodeStream(options.body)) {
+ options.body.once('end', uploadComplete);
+ options.body.pipe(request);
+ options.body = undefined;
+ } else if (options.body) {
+ request.end(options.body, uploadComplete);
+ } else if (input && (options.method === 'POST' || options.method === 'PUT' || options.method === 'PATCH')) {
+ input.once('end', uploadComplete);
+ input.pipe(request);
+ } else {
+ request.end(uploadComplete);
+ }
+ } catch (error) {
+ emitError(new RequestError(error, options));
+ }
+ };
+
+ if (options.cache) {
+ const cacheableRequest = new CacheableRequest(fn.request, options.cache);
+ const cacheRequest = cacheableRequest(options, handleResponse);
+
+ cacheRequest.once('error', error => {
+ if (error instanceof CacheableRequest.RequestError) {
+ emitError(new RequestError(error, options));
+ } else {
+ emitError(new CacheError(error, options));
+ }
+ });
+
+ cacheRequest.once('request', handleRequest);
+ } else {
+ // Catches errors thrown by calling fn.request(...)
+ try {
+ handleRequest(fn.request(options, handleResponse));
+ } catch (error) {
+ emitError(new RequestError(error, options));
+ }
+ }
+ };
+
+ emitter.retry = error => {
+ let backoff;
+
+ try {
+ backoff = options.retry.retries(++retryCount, error);
+ } catch (error2) {
+ emitError(error2);
+ return;
+ }
+
+ if (backoff) {
+ const retry = async options => {
+ try {
+ for (const hook of options.hooks.beforeRetry) {
+ // eslint-disable-next-line no-await-in-loop
+ await hook(options, error, retryCount);
+ }
+
+ await get(options);
+ } catch (error) {
+ emitError(error);
+ }
+ };
+
+ setTimeout(retry, backoff, {...options, forceRefresh: true});
+ return true;
+ }
+
+ return false;
+ };
+
+ emitter.abort = () => {
+ if (currentRequest) {
+ currentRequest.once('error', () => {});
+ currentRequest.abort();
+ } else {
+ shouldAbort = true;
+ }
+ };
+
+ setImmediate(async () => {
+ try {
+ // Convert buffer to stream to receive upload progress events (#322)
+ const {body} = options;
+ if (is.buffer(body)) {
+ options.body = toReadableStream(body);
+ uploadBodySize = body.length;
+ } else {
+ uploadBodySize = await getBodySize(options);
+ }
+
+ if (is.undefined(options.headers['content-length']) && is.undefined(options.headers['transfer-encoding'])) {
+ if ((uploadBodySize > 0 || options.method === 'PUT') && !is.null(uploadBodySize)) {
+ options.headers['content-length'] = uploadBodySize;
+ }
+ }
+
+ for (const hook of options.hooks.beforeRequest) {
+ // eslint-disable-next-line no-await-in-loop
+ await hook(options);
+ }
+
+ requestUrl = options.href || (new URL(options.path, urlLib.format(options))).toString();
+
+ await get(options);
+ } catch (error) {
+ emitError(error);
+ }
+ });
+
+ return emitter;
+};
diff --git a/includes/translator/node_modules/got/source/utils/deep-freeze.js b/includes/translator/node_modules/got/source/utils/deep-freeze.js
new file mode 100644
index 0000000..5052b71
--- /dev/null
+++ b/includes/translator/node_modules/got/source/utils/deep-freeze.js
@@ -0,0 +1,12 @@
+'use strict';
+const is = require('@sindresorhus/is');
+
+module.exports = function deepFreeze(object) {
+ for (const [key, value] of Object.entries(object)) {
+ if (is.plainObject(value) || is.array(value)) {
+ deepFreeze(object[key]);
+ }
+ }
+
+ return Object.freeze(object);
+};
diff --git a/includes/translator/node_modules/got/source/utils/get-body-size.js b/includes/translator/node_modules/got/source/utils/get-body-size.js
new file mode 100644
index 0000000..0df5af2
--- /dev/null
+++ b/includes/translator/node_modules/got/source/utils/get-body-size.js
@@ -0,0 +1,32 @@
+'use strict';
+const fs = require('fs');
+const util = require('util');
+const is = require('@sindresorhus/is');
+const isFormData = require('./is-form-data');
+
+module.exports = async options => {
+ const {body} = options;
+
+ if (options.headers['content-length']) {
+ return Number(options.headers['content-length']);
+ }
+
+ if (!body && !options.stream) {
+ return 0;
+ }
+
+ if (is.string(body)) {
+ return Buffer.byteLength(body);
+ }
+
+ if (isFormData(body)) {
+ return util.promisify(body.getLength.bind(body))();
+ }
+
+ if (body instanceof fs.ReadStream) {
+ const {size} = await util.promisify(fs.stat)(body.path);
+ return size;
+ }
+
+ return null;
+};
diff --git a/includes/translator/node_modules/got/source/utils/is-form-data.js b/includes/translator/node_modules/got/source/utils/is-form-data.js
new file mode 100644
index 0000000..0033618
--- /dev/null
+++ b/includes/translator/node_modules/got/source/utils/is-form-data.js
@@ -0,0 +1,4 @@
+'use strict';
+const is = require('@sindresorhus/is');
+
+module.exports = body => is.nodeStream(body) && is.function(body.getBoundary);
diff --git a/includes/translator/node_modules/got/source/utils/timed-out.js b/includes/translator/node_modules/got/source/utils/timed-out.js
new file mode 100644
index 0000000..33611a7
--- /dev/null
+++ b/includes/translator/node_modules/got/source/utils/timed-out.js
@@ -0,0 +1,160 @@
+'use strict';
+const net = require('net');
+
+class TimeoutError extends Error {
+ constructor(threshold, event) {
+ super(`Timeout awaiting '${event}' for ${threshold}ms`);
+ this.name = 'TimeoutError';
+ this.code = 'ETIMEDOUT';
+ this.event = event;
+ }
+}
+
+const reentry = Symbol('reentry');
+
+const noop = () => {};
+
+module.exports = (request, delays, options) => {
+ /* istanbul ignore next: this makes sure timed-out isn't called twice */
+ if (request[reentry]) {
+ return;
+ }
+
+ request[reentry] = true;
+
+ let stopNewTimeouts = false;
+
+ const addTimeout = (delay, callback, ...args) => {
+ // An error had been thrown before. Going further would result in uncaught errors.
+ // See https://github.com/sindresorhus/got/issues/631#issuecomment-435675051
+ if (stopNewTimeouts) {
+ return noop;
+ }
+
+ // Event loop order is timers, poll, immediates.
+ // The timed event may emit during the current tick poll phase, so
+ // defer calling the handler until the poll phase completes.
+ let immediate;
+ const timeout = setTimeout(() => {
+ immediate = setImmediate(callback, delay, ...args);
+ /* istanbul ignore next: added in node v9.7.0 */
+ if (immediate.unref) {
+ immediate.unref();
+ }
+ }, delay);
+
+ /* istanbul ignore next: in order to support electron renderer */
+ if (timeout.unref) {
+ timeout.unref();
+ }
+
+ const cancel = () => {
+ clearTimeout(timeout);
+ clearImmediate(immediate);
+ };
+
+ cancelers.push(cancel);
+
+ return cancel;
+ };
+
+ const {host, hostname} = options;
+ const timeoutHandler = (delay, event) => {
+ request.emit('error', new TimeoutError(delay, event));
+ request.once('error', () => {}); // Ignore the `socket hung up` error made by request.abort()
+
+ request.abort();
+ };
+
+ const cancelers = [];
+ const cancelTimeouts = () => {
+ stopNewTimeouts = true;
+ cancelers.forEach(cancelTimeout => cancelTimeout());
+ };
+
+ request.once('error', cancelTimeouts);
+ request.once('response', response => {
+ response.once('end', cancelTimeouts);
+ });
+
+ if (delays.request !== undefined) {
+ addTimeout(delays.request, timeoutHandler, 'request');
+ }
+
+ if (delays.socket !== undefined) {
+ const socketTimeoutHandler = () => {
+ timeoutHandler(delays.socket, 'socket');
+ };
+
+ request.setTimeout(delays.socket, socketTimeoutHandler);
+
+ // `request.setTimeout(0)` causes a memory leak.
+ // We can just remove the listener and forget about the timer - it's unreffed.
+ // See https://github.com/sindresorhus/got/issues/690
+ cancelers.push(() => request.removeListener('timeout', socketTimeoutHandler));
+ }
+
+ if (delays.lookup !== undefined && !request.socketPath && !net.isIP(hostname || host)) {
+ request.once('socket', socket => {
+ /* istanbul ignore next: hard to test */
+ if (socket.connecting) {
+ const cancelTimeout = addTimeout(delays.lookup, timeoutHandler, 'lookup');
+ socket.once('lookup', cancelTimeout);
+ }
+ });
+ }
+
+ if (delays.connect !== undefined) {
+ request.once('socket', socket => {
+ /* istanbul ignore next: hard to test */
+ if (socket.connecting) {
+ const timeConnect = () => addTimeout(delays.connect, timeoutHandler, 'connect');
+
+ if (request.socketPath || net.isIP(hostname || host)) {
+ socket.once('connect', timeConnect());
+ } else {
+ socket.once('lookup', error => {
+ if (error === null) {
+ socket.once('connect', timeConnect());
+ }
+ });
+ }
+ }
+ });
+ }
+
+ if (delays.secureConnect !== undefined && options.protocol === 'https:') {
+ request.once('socket', socket => {
+ /* istanbul ignore next: hard to test */
+ if (socket.connecting) {
+ socket.once('connect', () => {
+ const cancelTimeout = addTimeout(delays.secureConnect, timeoutHandler, 'secureConnect');
+ socket.once('secureConnect', cancelTimeout);
+ });
+ }
+ });
+ }
+
+ if (delays.send !== undefined) {
+ request.once('socket', socket => {
+ const timeRequest = () => addTimeout(delays.send, timeoutHandler, 'send');
+ /* istanbul ignore next: hard to test */
+ if (socket.connecting) {
+ socket.once('connect', () => {
+ request.once('upload-complete', timeRequest());
+ });
+ } else {
+ request.once('upload-complete', timeRequest());
+ }
+ });
+ }
+
+ if (delays.response !== undefined) {
+ request.once('upload-complete', () => {
+ const cancelTimeout = addTimeout(delays.response, timeoutHandler, 'response');
+ request.once('response', cancelTimeout);
+ });
+ }
+};
+
+module.exports.TimeoutError = TimeoutError;
diff --git a/includes/translator/node_modules/got/source/utils/url-to-options.js b/includes/translator/node_modules/got/source/utils/url-to-options.js
new file mode 100644
index 0000000..848ef30
--- /dev/null
+++ b/includes/translator/node_modules/got/source/utils/url-to-options.js
@@ -0,0 +1,25 @@
+'use strict';
+const is = require('@sindresorhus/is');
+
+module.exports = url => {
+ const options = {
+ protocol: url.protocol,
+ hostname: url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,
+ hash: url.hash,
+ search: url.search,
+ pathname: url.pathname,
+ href: url.href
+ };
+
+ if (is.string(url.port) && url.port.length > 0) {
+ options.port = Number(url.port);
+ }
+
+ if (url.username || url.password) {
+ options.auth = `${url.username}:${url.password}`;
+ }
+
+ options.path = is.null(url.search) ? url.pathname : `${url.pathname}${url.search}`;
+
+ return options;
+};
diff --git a/includes/translator/node_modules/graceful-fs/LICENSE b/includes/translator/node_modules/graceful-fs/LICENSE
new file mode 100644
index 0000000..e906a25
--- /dev/null
+++ b/includes/translator/node_modules/graceful-fs/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/includes/translator/node_modules/graceful-fs/README.md b/includes/translator/node_modules/graceful-fs/README.md
new file mode 100644
index 0000000..82d6e4d
--- /dev/null
+++ b/includes/translator/node_modules/graceful-fs/README.md
@@ -0,0 +1,143 @@
+# graceful-fs
+
+graceful-fs functions as a drop-in replacement for the fs module,
+making various improvements.
+
+The improvements are meant to normalize behavior across different
+platforms and environments, and to make filesystem access more
+resilient to errors.
+
+## Improvements over [fs module](https://nodejs.org/api/fs.html)
+
+* Queues up `open` and `readdir` calls, and retries them once
+ something closes if there is an EMFILE error from too many file
+ descriptors.
+* fixes `lchmod` for Node versions prior to 0.6.2.
+* implements `fs.lutimes` if possible. Otherwise it becomes a noop.
+* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
+ `lchown` if the user isn't root.
+* makes `lchmod` and `lchown` become noops, if not available.
+* retries reading a file if `read` results in EAGAIN error.
+
+On Windows, it retries renaming a file for up to one second if `EACCESS`
+or `EPERM` error occurs, likely because antivirus software has locked
+the directory.
+
+## USAGE
+
+```javascript
+// use just like fs
+var fs = require('graceful-fs')
+
+// now go and do stuff with it...
+fs.readFile('some-file-or-whatever', (err, data) => {
+ // Do stuff here.
+})
+```
+
+## Sync methods
+
+This module cannot intercept or handle `EMFILE` or `ENFILE` errors from sync
+methods. If you use sync methods which open file descriptors then you are
+responsible for dealing with any errors.
+
+This is a known limitation, not a bug.
+
+## Global Patching
+
+If you want to patch the global fs module (or any other fs-like
+module) you can do this:
+
+```javascript
+// Make sure to read the caveat below.
+var realFs = require('fs')
+var gracefulFs = require('graceful-fs')
+gracefulFs.gracefulify(realFs)
+```
+
+This should only ever be done at the top-level application layer, in
+order to delay on EMFILE errors from any fs-using dependencies. You
+should **not** do this in a library, because it can cause unexpected
+delays in other parts of the program.
+
+## Changes
+
+This module is fairly stable at this point, and used by a lot of
+things. That being said, because it implements a subtle behavior
+change in a core part of the node API, even modest changes can be
+extremely breaking, and the versioning is thus biased towards
+bumping the major when in doubt.
+
+The main change between major versions has been switching between
+providing a fully-patched `fs` module vs monkey-patching the node core
+builtin, and the approach by which a non-monkey-patched `fs` was
+created.
+
+The goal is to trade `EMFILE` errors for slower fs operations. So, if
+you try to open a zillion files, rather than crashing, `open`
+operations will be queued up and wait for something else to `close`.
+
+There are advantages to each approach. Monkey-patching the fs means
+that no `EMFILE` errors can possibly occur anywhere in your
+application, because everything is using the same core `fs` module,
+which is patched. However, it can also obviously cause undesirable
+side-effects, especially if the module is loaded multiple times.
+
+Implementing a separate-but-identical patched `fs` module is more
+surgical (and doesn't run the risk of patching multiple times), but
+also imposes the challenge of keeping in sync with the core module.
+
+The current approach loads the `fs` module, and then creates a
+lookalike object that has all the same methods, except a few that are
+patched. It is safe to use in all versions of Node from 0.8 through
+7.0.
+
+### v4
+
+* Do not monkey-patch the fs module. This module may now be used as a
+ drop-in dep, and users can opt into monkey-patching the fs builtin
+ if their app requires it.
+
+### v3
+
+* Monkey-patch fs, because the eval approach no longer works on recent
+ node.
+* fixed possible type-error throw if rename fails on windows
+* verify that we *never* get EMFILE errors
+* Ignore ENOSYS from chmod/chown
+* clarify that graceful-fs must be used as a drop-in
+
+### v2.1.0
+
+* Use eval rather than monkey-patching fs.
+* readdir: Always sort the results
+* win32: requeue a file if error has an OK status
+
+### v2.0
+
+* A return to monkey patching
+* wrap process.cwd
+
+### v1.1
+
+* wrap readFile
+* Wrap fs.writeFile.
+* readdir protection
+* Don't clobber the fs builtin
+* Handle fs.read EAGAIN errors by trying again
+* Expose the curOpen counter
+* No-op lchown/lchmod if not implemented
+* fs.rename patch only for win32
+* Patch fs.rename to handle AV software on Windows
+* Close #4 Chown should not fail on einval or eperm if non-root
+* Fix isaacs/fstream#1 Only wrap fs one time
+* Fix #3 Start at 1024 max files, then back off on EMFILE
+* lutimes that doens't blow up on Linux
+* A full on-rewrite using a queue instead of just swallowing the EMFILE error
+* Wrap Read/Write streams as well
+
+### 1.0
+
+* Update engines for node 0.6
+* Be lstat-graceful on Windows
+* first
diff --git a/includes/translator/node_modules/graceful-fs/clone.js b/includes/translator/node_modules/graceful-fs/clone.js
new file mode 100644
index 0000000..dff3cc8
--- /dev/null
+++ b/includes/translator/node_modules/graceful-fs/clone.js
@@ -0,0 +1,23 @@
+'use strict'
+
+module.exports = clone
+
+var getPrototypeOf = Object.getPrototypeOf || function (obj) {
+ return obj.__proto__
+}
+
+function clone (obj) {
+ if (obj === null || typeof obj !== 'object')
+ return obj
+
+ if (obj instanceof Object)
+ var copy = { __proto__: getPrototypeOf(obj) }
+ else
+ var copy = Object.create(null)
+
+ Object.getOwnPropertyNames(obj).forEach(function (key) {
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
+ })
+
+ return copy
+}
diff --git a/includes/translator/node_modules/graceful-fs/graceful-fs.js b/includes/translator/node_modules/graceful-fs/graceful-fs.js
new file mode 100644
index 0000000..8d5b89e
--- /dev/null
+++ b/includes/translator/node_modules/graceful-fs/graceful-fs.js
@@ -0,0 +1,448 @@
+var fs = require('fs')
+var polyfills = require('./polyfills.js')
+var legacy = require('./legacy-streams.js')
+var clone = require('./clone.js')
+
+var util = require('util')
+
+/* istanbul ignore next - node 0.x polyfill */
+var gracefulQueue
+var previousSymbol
+
+/* istanbul ignore else - node 0.x polyfill */
+if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
+ gracefulQueue = Symbol.for('graceful-fs.queue')
+ // This is used in testing by future versions
+ previousSymbol = Symbol.for('graceful-fs.previous')
+} else {
+ gracefulQueue = '___graceful-fs.queue'
+ previousSymbol = '___graceful-fs.previous'
+}
+
+function noop () {}
+
+function publishQueue(context, queue) {
+ Object.defineProperty(context, gracefulQueue, {
+ get: function() {
+ return queue
+ }
+ })
+}
+
+var debug = noop
+if (util.debuglog)
+ debug = util.debuglog('gfs4')
+else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
+ debug = function() {
+ var m = util.format.apply(util, arguments)
+ m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
+ console.error(m)
+ }
+
+// Once time initialization
+if (!fs[gracefulQueue]) {
+ // This queue can be shared by multiple loaded instances
+ var queue = global[gracefulQueue] || []
+ publishQueue(fs, queue)
+
+ // Patch fs.close/closeSync to shared queue version, because we need
+ // to retry() whenever a close happens *anywhere* in the program.
+ // This is essential when multiple graceful-fs instances are
+ // in play at the same time.
+ fs.close = (function (fs$close) {
+ function close (fd, cb) {
+ return fs$close.call(fs, fd, function (err) {
+ // This function uses the graceful-fs shared queue
+ if (!err) {
+ resetQueue()
+ }
+
+ if (typeof cb === 'function')
+ cb.apply(this, arguments)
+ })
+ }
+
+ Object.defineProperty(close, previousSymbol, {
+ value: fs$close
+ })
+ return close
+ })(fs.close)
+
+ fs.closeSync = (function (fs$closeSync) {
+ function closeSync (fd) {
+ // This function uses the graceful-fs shared queue
+ fs$closeSync.apply(fs, arguments)
+ resetQueue()
+ }
+
+ Object.defineProperty(closeSync, previousSymbol, {
+ value: fs$closeSync
+ })
+ return closeSync
+ })(fs.closeSync)
+
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
+ process.on('exit', function() {
+ debug(fs[gracefulQueue])
+ require('assert').equal(fs[gracefulQueue].length, 0)
+ })
+ }
+}
+
+if (!global[gracefulQueue]) {
+ publishQueue(global, fs[gracefulQueue]);
+}
+
+module.exports = patch(clone(fs))
+if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
+ module.exports = patch(fs)
+ fs.__patched = true;
+}
+
+function patch (fs) {
+ // Everything that references the open() function needs to be in here
+ polyfills(fs)
+ fs.gracefulify = patch
+
+ fs.createReadStream = createReadStream
+ fs.createWriteStream = createWriteStream
+ var fs$readFile = fs.readFile
+ fs.readFile = readFile
+ function readFile (path, options, cb) {
+ if (typeof options === 'function')
+ cb = options, options = null
+
+ return go$readFile(path, options, cb)
+
+ function go$readFile (path, options, cb, startTime) {
+ return fs$readFile(path, options, function (err) {
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
+ enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])
+ else {
+ if (typeof cb === 'function')
+ cb.apply(this, arguments)
+ }
+ })
+ }
+ }
+
+ var fs$writeFile = fs.writeFile
+ fs.writeFile = writeFile
+ function writeFile (path, data, options, cb) {
+ if (typeof options === 'function')
+ cb = options, options = null
+
+ return go$writeFile(path, data, options, cb)
+
+ function go$writeFile (path, data, options, cb, startTime) {
+ return fs$writeFile(path, data, options, function (err) {
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
+ enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
+ else {
+ if (typeof cb === 'function')
+ cb.apply(this, arguments)
+ }
+ })
+ }
+ }
+
+ var fs$appendFile = fs.appendFile
+ if (fs$appendFile)
+ fs.appendFile = appendFile
+ function appendFile (path, data, options, cb) {
+ if (typeof options === 'function')
+ cb = options, options = null
+
+ return go$appendFile(path, data, options, cb)
+
+ function go$appendFile (path, data, options, cb, startTime) {
+ return fs$appendFile(path, data, options, function (err) {
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
+ enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
+ else {
+ if (typeof cb === 'function')
+ cb.apply(this, arguments)
+ }
+ })
+ }
+ }
+
+ var fs$copyFile = fs.copyFile
+ if (fs$copyFile)
+ fs.copyFile = copyFile
+ function copyFile (src, dest, flags, cb) {
+ if (typeof flags === 'function') {
+ cb = flags
+ flags = 0
+ }
+ return go$copyFile(src, dest, flags, cb)
+
+ function go$copyFile (src, dest, flags, cb, startTime) {
+ return fs$copyFile(src, dest, flags, function (err) {
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
+ enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])
+ else {
+ if (typeof cb === 'function')
+ cb.apply(this, arguments)
+ }
+ })
+ }
+ }
+
+ var fs$readdir = fs.readdir
+ fs.readdir = readdir
+ var noReaddirOptionVersions = /^v[0-5]\./
+ function readdir (path, options, cb) {
+ if (typeof options === 'function')
+ cb = options, options = null
+
+ var go$readdir = noReaddirOptionVersions.test(process.version)
+ ? function go$readdir (path, options, cb, startTime) {
+ return fs$readdir(path, fs$readdirCallback(
+ path, options, cb, startTime
+ ))
+ }
+ : function go$readdir (path, options, cb, startTime) {
+ return fs$readdir(path, options, fs$readdirCallback(
+ path, options, cb, startTime
+ ))
+ }
+
+ return go$readdir(path, options, cb)
+
+ function fs$readdirCallback (path, options, cb, startTime) {
+ return function (err, files) {
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
+ enqueue([
+ go$readdir,
+ [path, options, cb],
+ err,
+ startTime || Date.now(),
+ Date.now()
+ ])
+ else {
+ if (files && files.sort)
+ files.sort()
+
+ if (typeof cb === 'function')
+ cb.call(this, err, files)
+ }
+ }
+ }
+ }
+
+ if (process.version.substr(0, 4) === 'v0.8') {
+ var legStreams = legacy(fs)
+ ReadStream = legStreams.ReadStream
+ WriteStream = legStreams.WriteStream
+ }
+
+ var fs$ReadStream = fs.ReadStream
+ if (fs$ReadStream) {
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype)
+ ReadStream.prototype.open = ReadStream$open
+ }
+
+ var fs$WriteStream = fs.WriteStream
+ if (fs$WriteStream) {
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype)
+ WriteStream.prototype.open = WriteStream$open
+ }
+
+ Object.defineProperty(fs, 'ReadStream', {
+ get: function () {
+ return ReadStream
+ },
+ set: function (val) {
+ ReadStream = val
+ },
+ enumerable: true,
+ configurable: true
+ })
+ Object.defineProperty(fs, 'WriteStream', {
+ get: function () {
+ return WriteStream
+ },
+ set: function (val) {
+ WriteStream = val
+ },
+ enumerable: true,
+ configurable: true
+ })
+
+ // legacy names
+ var FileReadStream = ReadStream
+ Object.defineProperty(fs, 'FileReadStream', {
+ get: function () {
+ return FileReadStream
+ },
+ set: function (val) {
+ FileReadStream = val
+ },
+ enumerable: true,
+ configurable: true
+ })
+ var FileWriteStream = WriteStream
+ Object.defineProperty(fs, 'FileWriteStream', {
+ get: function () {
+ return FileWriteStream
+ },
+ set: function (val) {
+ FileWriteStream = val
+ },
+ enumerable: true,
+ configurable: true
+ })
+
+ function ReadStream (path, options) {
+ if (this instanceof ReadStream)
+ return fs$ReadStream.apply(this, arguments), this
+ else
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
+ }
+
+ function ReadStream$open () {
+ var that = this
+ open(that.path, that.flags, that.mode, function (err, fd) {
+ if (err) {
+ if (that.autoClose)
+ that.destroy()
+
+ that.emit('error', err)
+ } else {
+ that.fd = fd
+ that.emit('open', fd)
+ that.read()
+ }
+ })
+ }
+
+ function WriteStream (path, options) {
+ if (this instanceof WriteStream)
+ return fs$WriteStream.apply(this, arguments), this
+ else
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
+ }
+
+ function WriteStream$open () {
+ var that = this
+ open(that.path, that.flags, that.mode, function (err, fd) {
+ if (err) {
+ that.destroy()
+ that.emit('error', err)
+ } else {
+ that.fd = fd
+ that.emit('open', fd)
+ }
+ })
+ }
+
+ function createReadStream (path, options) {
+ return new fs.ReadStream(path, options)
+ }
+
+ function createWriteStream (path, options) {
+ return new fs.WriteStream(path, options)
+ }
+
+ var fs$open = fs.open
+ fs.open = open
+ function open (path, flags, mode, cb) {
+ if (typeof mode === 'function')
+ cb = mode, mode = null
+
+ return go$open(path, flags, mode, cb)
+
+ function go$open (path, flags, mode, cb, startTime) {
+ return fs$open(path, flags, mode, function (err, fd) {
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
+ enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])
+ else {
+ if (typeof cb === 'function')
+ cb.apply(this, arguments)
+ }
+ })
+ }
+ }
+
+ return fs
+}
+
+function enqueue (elem) {
+ debug('ENQUEUE', elem[0].name, elem[1])
+ fs[gracefulQueue].push(elem)
+ retry()
+}
+
+// keep track of the timeout between retry() calls
+var retryTimer
+
+// reset the startTime and lastTime to now
+// this resets the start of the 60 second overall timeout as well as the
+// delay between attempts so that we'll retry these jobs sooner
+function resetQueue () {
+ var now = Date.now()
+ for (var i = 0; i < fs[gracefulQueue].length; ++i) {
+ // entries that are only a length of 2 are from an older version, don't
+ // bother modifying those since they'll be retried anyway.
+ if (fs[gracefulQueue][i].length > 2) {
+ fs[gracefulQueue][i][3] = now // startTime
+ fs[gracefulQueue][i][4] = now // lastTime
+ }
+ }
+ // call retry to make sure we're actively processing the queue
+ retry()
+}
+
+function retry () {
+ // clear the timer and remove it to help prevent unintended concurrency
+ clearTimeout(retryTimer)
+ retryTimer = undefined
+
+ if (fs[gracefulQueue].length === 0)
+ return
+
+ var elem = fs[gracefulQueue].shift()
+ var fn = elem[0]
+ var args = elem[1]
+ // these items may be unset if they were added by an older graceful-fs
+ var err = elem[2]
+ var startTime = elem[3]
+ var lastTime = elem[4]
+
+ // if we don't have a startTime we have no way of knowing if we've waited
+ // long enough, so go ahead and retry this item now
+ if (startTime === undefined) {
+ debug('RETRY', fn.name, args)
+ fn.apply(null, args)
+ } else if (Date.now() - startTime >= 60000) {
+ // it's been more than 60 seconds total, bail now
+ debug('TIMEOUT', fn.name, args)
+ var cb = args.pop()
+ if (typeof cb === 'function')
+ cb.call(null, err)
+ } else {
+ // the amount of time between the last attempt and right now
+ var sinceAttempt = Date.now() - lastTime
+ // the amount of time between when we first tried, and when we last tried
+ // rounded up to at least 1
+ var sinceStart = Math.max(lastTime - startTime, 1)
+ // backoff. wait longer than the total time we've been retrying, but only
+ // up to a maximum of 100ms
+ var desiredDelay = Math.min(sinceStart * 1.2, 100)
+ // it's been long enough since the last retry, do it again
+ if (sinceAttempt >= desiredDelay) {
+ debug('RETRY', fn.name, args)
+ fn.apply(null, args.concat([startTime]))
+ } else {
+ // if we can't do this job yet, push it to the end of the queue
+ // and let the next iteration check again
+ fs[gracefulQueue].push(elem)
+ }
+ }
+
+ // schedule our next run if one isn't already scheduled
+ if (retryTimer === undefined) {
+ retryTimer = setTimeout(retry, 0)
+ }
+}
diff --git a/includes/translator/node_modules/graceful-fs/legacy-streams.js b/includes/translator/node_modules/graceful-fs/legacy-streams.js
new file mode 100644
index 0000000..d617b50
--- /dev/null
+++ b/includes/translator/node_modules/graceful-fs/legacy-streams.js
@@ -0,0 +1,118 @@
+var Stream = require('stream').Stream
+
+module.exports = legacy
+
+function legacy (fs) {
+ return {
+ ReadStream: ReadStream,
+ WriteStream: WriteStream
+ }
+
+ function ReadStream (path, options) {
+ if (!(this instanceof ReadStream)) return new ReadStream(path, options);
+
+ Stream.call(this);
+
+ var self = this;
+
+ this.path = path;
+ this.fd = null;
+ this.readable = true;
+ this.paused = false;
+
+ this.flags = 'r';
+ this.mode = 438; /*=0666*/
+ this.bufferSize = 64 * 1024;
+
+ options = options || {};
+
+ // Mixin options into this
+ var keys = Object.keys(options);
+ for (var index = 0, length = keys.length; index < length; index++) {
+ var key = keys[index];
+ this[key] = options[key];
+ }
+
+ if (this.encoding) this.setEncoding(this.encoding);
+
+ if (this.start !== undefined) {
+ if ('number' !== typeof this.start) {
+ throw TypeError('start must be a Number');
+ }
+ if (this.end === undefined) {
+ this.end = Infinity;
+ } else if ('number' !== typeof this.end) {
+ throw TypeError('end must be a Number');
+ }
+
+ if (this.start > this.end) {
+ throw new Error('start must be <= end');
+ }
+
+ this.pos = this.start;
+ }
+
+ if (this.fd !== null) {
+ process.nextTick(function() {
+ self._read();
+ });
+ return;
+ }
+
+ fs.open(this.path, this.flags, this.mode, function (err, fd) {
+ if (err) {
+ self.emit('error', err);
+ self.readable = false;
+ return;
+ }
+
+ self.fd = fd;
+ self.emit('open', fd);
+ self._read();
+ })
+ }
+
+ function WriteStream (path, options) {
+ if (!(this instanceof WriteStream)) return new WriteStream(path, options);
+
+ Stream.call(this);
+
+ this.path = path;
+ this.fd = null;
+ this.writable = true;
+
+ this.flags = 'w';
+ this.encoding = 'binary';
+ this.mode = 438; /*=0666*/
+ this.bytesWritten = 0;
+
+ options = options || {};
+
+ // Mixin options into this
+ var keys = Object.keys(options);
+ for (var index = 0, length = keys.length; index < length; index++) {
+ var key = keys[index];
+ this[key] = options[key];
+ }
+
+ if (this.start !== undefined) {
+ if ('number' !== typeof this.start) {
+ throw TypeError('start must be a Number');
+ }
+ if (this.start < 0) {
+ throw new Error('start must be >= zero');
+ }
+
+ this.pos = this.start;
+ }
+
+ this.busy = false;
+ this._queue = [];
+
+ if (this.fd === null) {
+ this._open = fs.open;
+ this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
+ this.flush();
+ }
+ }
+}
diff --git a/includes/translator/node_modules/graceful-fs/package.json b/includes/translator/node_modules/graceful-fs/package.json
new file mode 100644
index 0000000..87babf0
--- /dev/null
+++ b/includes/translator/node_modules/graceful-fs/package.json
@@ -0,0 +1,53 @@
+{
+ "name": "graceful-fs",
+ "description": "A drop-in replacement for fs, making various improvements.",
+ "version": "4.2.11",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/isaacs/node-graceful-fs"
+ },
+ "main": "graceful-fs.js",
+ "directories": {
+ "test": "test"
+ },
+ "scripts": {
+ "preversion": "npm test",
+ "postversion": "npm publish",
+ "postpublish": "git push origin --follow-tags",
+ "test": "nyc --silent node test.js | tap -c -",
+ "posttest": "nyc report"
+ },
+ "keywords": [
+ "fs",
+ "module",
+ "reading",
+ "retry",
+ "retries",
+ "queue",
+ "error",
+ "errors",
+ "handling",
+ "EMFILE",
+ "EAGAIN",
+ "EINVAL",
+ "EPERM",
+ "EACCESS"
+ ],
+ "license": "ISC",
+ "devDependencies": {
+ "import-fresh": "^2.0.0",
+ "mkdirp": "^0.5.0",
+ "rimraf": "^2.2.8",
+ "tap": "^16.3.4"
+ },
+ "files": [
+ "fs.js",
+ "graceful-fs.js",
+ "legacy-streams.js",
+ "polyfills.js",
+ "clone.js"
+ ],
+ "tap": {
+ "reporter": "classic"
+ }
+}
diff --git a/includes/translator/node_modules/graceful-fs/polyfills.js b/includes/translator/node_modules/graceful-fs/polyfills.js
new file mode 100644
index 0000000..453f1a9
--- /dev/null
+++ b/includes/translator/node_modules/graceful-fs/polyfills.js
@@ -0,0 +1,355 @@
+var constants = require('constants')
+
+var origCwd = process.cwd
+var cwd = null
+
+var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
+
+process.cwd = function() {
+ if (!cwd)
+ cwd = origCwd.call(process)
+ return cwd
+}
+try {
+ process.cwd()
+} catch (er) {}
+
+// This check is needed until node.js 12 is required
+if (typeof process.chdir === 'function') {
+ var chdir = process.chdir
+ process.chdir = function (d) {
+ cwd = null
+ chdir.call(process, d)
+ }
+ if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)
+}
+
+module.exports = patch
+
+function patch (fs) {
+ // (re-)implement some things that are known busted or missing.
+
+ // lchmod, broken prior to 0.6.2
+ // back-port the fix here.
+ if (constants.hasOwnProperty('O_SYMLINK') &&
+ process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
+ patchLchmod(fs)
+ }
+
+ // lutimes implementation, or no-op
+ if (!fs.lutimes) {
+ patchLutimes(fs)
+ }
+
+ // https://github.com/isaacs/node-graceful-fs/issues/4
+ // Chown should not fail on einval or eperm if non-root.
+ // It should not fail on enosys ever, as this just indicates
+ // that a fs doesn't support the intended operation.
+
+ fs.chown = chownFix(fs.chown)
+ fs.fchown = chownFix(fs.fchown)
+ fs.lchown = chownFix(fs.lchown)
+
+ fs.chmod = chmodFix(fs.chmod)
+ fs.fchmod = chmodFix(fs.fchmod)
+ fs.lchmod = chmodFix(fs.lchmod)
+
+ fs.chownSync = chownFixSync(fs.chownSync)
+ fs.fchownSync = chownFixSync(fs.fchownSync)
+ fs.lchownSync = chownFixSync(fs.lchownSync)
+
+ fs.chmodSync = chmodFixSync(fs.chmodSync)
+ fs.fchmodSync = chmodFixSync(fs.fchmodSync)
+ fs.lchmodSync = chmodFixSync(fs.lchmodSync)
+
+ fs.stat = statFix(fs.stat)
+ fs.fstat = statFix(fs.fstat)
+ fs.lstat = statFix(fs.lstat)
+
+ fs.statSync = statFixSync(fs.statSync)
+ fs.fstatSync = statFixSync(fs.fstatSync)
+ fs.lstatSync = statFixSync(fs.lstatSync)
+
+ // if lchmod/lchown do not exist, then make them no-ops
+ if (fs.chmod && !fs.lchmod) {
+ fs.lchmod = function (path, mode, cb) {
+ if (cb) process.nextTick(cb)
+ }
+ fs.lchmodSync = function () {}
+ }
+ if (fs.chown && !fs.lchown) {
+ fs.lchown = function (path, uid, gid, cb) {
+ if (cb) process.nextTick(cb)
+ }
+ fs.lchownSync = function () {}
+ }
+
+ // on Windows, A/V software can lock the directory, causing this
+ // to fail with an EACCES or EPERM if the directory contains newly
+ // created files. Try again on failure, for up to 60 seconds.
+
+ // Set the timeout this long because some Windows Anti-Virus, such as Parity
+ // bit9, may lock files for up to a minute, causing npm package install
+ // failures. Also, take care to yield the scheduler. Windows scheduling gives
+ // CPU to a busy looping process, which can cause the program causing the lock
+ // contention to be starved of CPU by node, so the contention doesn't resolve.
+ if (platform === "win32") {
+ fs.rename = typeof fs.rename !== 'function' ? fs.rename
+ : (function (fs$rename) {
+ function rename (from, to, cb) {
+ var start = Date.now()
+ var backoff = 0;
+ fs$rename(from, to, function CB (er) {
+ if (er
+ && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY")
+ && Date.now() - start < 60000) {
+ setTimeout(function() {
+ fs.stat(to, function (stater, st) {
+ if (stater && stater.code === "ENOENT")
+ fs$rename(from, to, CB);
+ else
+ cb(er)
+ })
+ }, backoff)
+ if (backoff < 100)
+ backoff += 10;
+ return;
+ }
+ if (cb) cb(er)
+ })
+ }
+ if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)
+ return rename
+ })(fs.rename)
+ }
+
+ // if read() returns EAGAIN, then just try it again.
+ fs.read = typeof fs.read !== 'function' ? fs.read
+ : (function (fs$read) {
+ function read (fd, buffer, offset, length, position, callback_) {
+ var callback
+ if (callback_ && typeof callback_ === 'function') {
+ var eagCounter = 0
+ callback = function (er, _, __) {
+ if (er && er.code === 'EAGAIN' && eagCounter < 10) {
+ eagCounter ++
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback)
+ }
+ callback_.apply(this, arguments)
+ }
+ }
+ return fs$read.call(fs, fd, buffer, offset, length, position, callback)
+ }
+
+ // This ensures `util.promisify` works as it does for native `fs.read`.
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
+ return read
+ })(fs.read)
+
+ fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync
+ : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
+ var eagCounter = 0
+ while (true) {
+ try {
+ return fs$readSync.call(fs, fd, buffer, offset, length, position)
+ } catch (er) {
+ if (er.code === 'EAGAIN' && eagCounter < 10) {
+ eagCounter ++
+ continue
+ }
+ throw er
+ }
+ }
+ }})(fs.readSync)
+
+ function patchLchmod (fs) {
+ fs.lchmod = function (path, mode, callback) {
+ fs.open( path
+ , constants.O_WRONLY | constants.O_SYMLINK
+ , mode
+ , function (err, fd) {
+ if (err) {
+ if (callback) callback(err)
+ return
+ }
+ // prefer to return the chmod error, if one occurs,
+ // but still try to close, and report closing errors if they occur.
+ fs.fchmod(fd, mode, function (err) {
+ fs.close(fd, function(err2) {
+ if (callback) callback(err || err2)
+ })
+ })
+ })
+ }
+
+ fs.lchmodSync = function (path, mode) {
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
+
+ // prefer to return the chmod error, if one occurs,
+ // but still try to close, and report closing errors if they occur.
+ var threw = true
+ var ret
+ try {
+ ret = fs.fchmodSync(fd, mode)
+ threw = false
+ } finally {
+ if (threw) {
+ try {
+ fs.closeSync(fd)
+ } catch (er) {}
+ } else {
+ fs.closeSync(fd)
+ }
+ }
+ return ret
+ }
+ }
+
+ function patchLutimes (fs) {
+ if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
+ fs.lutimes = function (path, at, mt, cb) {
+ fs.open(path, constants.O_SYMLINK, function (er, fd) {
+ if (er) {
+ if (cb) cb(er)
+ return
+ }
+ fs.futimes(fd, at, mt, function (er) {
+ fs.close(fd, function (er2) {
+ if (cb) cb(er || er2)
+ })
+ })
+ })
+ }
+
+ fs.lutimesSync = function (path, at, mt) {
+ var fd = fs.openSync(path, constants.O_SYMLINK)
+ var ret
+ var threw = true
+ try {
+ ret = fs.futimesSync(fd, at, mt)
+ threw = false
+ } finally {
+ if (threw) {
+ try {
+ fs.closeSync(fd)
+ } catch (er) {}
+ } else {
+ fs.closeSync(fd)
+ }
+ }
+ return ret
+ }
+
+ } else if (fs.futimes) {
+ fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
+ fs.lutimesSync = function () {}
+ }
+ }
+
+ function chmodFix (orig) {
+ if (!orig) return orig
+ return function (target, mode, cb) {
+ return orig.call(fs, target, mode, function (er) {
+ if (chownErOk(er)) er = null
+ if (cb) cb.apply(this, arguments)
+ })
+ }
+ }
+
+ function chmodFixSync (orig) {
+ if (!orig) return orig
+ return function (target, mode) {
+ try {
+ return orig.call(fs, target, mode)
+ } catch (er) {
+ if (!chownErOk(er)) throw er
+ }
+ }
+ }
+
+
+ function chownFix (orig) {
+ if (!orig) return orig
+ return function (target, uid, gid, cb) {
+ return orig.call(fs, target, uid, gid, function (er) {
+ if (chownErOk(er)) er = null
+ if (cb) cb.apply(this, arguments)
+ })
+ }
+ }
+
+ function chownFixSync (orig) {
+ if (!orig) return orig
+ return function (target, uid, gid) {
+ try {
+ return orig.call(fs, target, uid, gid)
+ } catch (er) {
+ if (!chownErOk(er)) throw er
+ }
+ }
+ }
+
+ function statFix (orig) {
+ if (!orig) return orig
+ // Older versions of Node erroneously returned signed integers for
+ // uid + gid.
+ return function (target, options, cb) {
+ if (typeof options === 'function') {
+ cb = options
+ options = null
+ }
+ function callback (er, stats) {
+ if (stats) {
+ if (stats.uid < 0) stats.uid += 0x100000000
+ if (stats.gid < 0) stats.gid += 0x100000000
+ }
+ if (cb) cb.apply(this, arguments)
+ }
+ return options ? orig.call(fs, target, options, callback)
+ : orig.call(fs, target, callback)
+ }
+ }
+
+ function statFixSync (orig) {
+ if (!orig) return orig
+ // Older versions of Node erroneously returned signed integers for
+ // uid + gid.
+ return function (target, options) {
+ var stats = options ? orig.call(fs, target, options)
+ : orig.call(fs, target)
+ if (stats) {
+ if (stats.uid < 0) stats.uid += 0x100000000
+ if (stats.gid < 0) stats.gid += 0x100000000
+ }
+ return stats;
+ }
+ }
+
+ // ENOSYS means that the fs doesn't support the op. Just ignore
+ // that, because it doesn't matter.
+ //
+ // if there's no getuid, or if getuid() is something other
+ // than 0, and the error is EINVAL or EPERM, then just ignore
+ // it.
+ //
+ // This specific case is a silent failure in cp, install, tar,
+ // and most other unix tools that manage permissions.
+ //
+ // When running as root, or if other types of errors are
+ // encountered, then it's strict.
+ function chownErOk (er) {
+ if (!er)
+ return true
+
+ if (er.code === "ENOSYS")
+ return true
+
+ var nonroot = !process.getuid || process.getuid() !== 0
+ if (nonroot) {
+ if (er.code === "EINVAL" || er.code === "EPERM")
+ return true
+ }
+
+ return false
+ }
+}
diff --git a/includes/translator/node_modules/http-cache-semantics/LICENSE b/includes/translator/node_modules/http-cache-semantics/LICENSE
new file mode 100644
index 0000000..493d2ea
--- /dev/null
+++ b/includes/translator/node_modules/http-cache-semantics/LICENSE
@@ -0,0 +1,9 @@
+Copyright 2016-2018 Kornel Lesiński
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/includes/translator/node_modules/http-cache-semantics/README.md b/includes/translator/node_modules/http-cache-semantics/README.md
new file mode 100644
index 0000000..685aa55
--- /dev/null
+++ b/includes/translator/node_modules/http-cache-semantics/README.md
@@ -0,0 +1,203 @@
+# Can I cache this? [![Build Status](https://travis-ci.org/kornelski/http-cache-semantics.svg?branch=master)](https://travis-ci.org/kornelski/http-cache-semantics)
+
+`CachePolicy` tells when responses can be reused from a cache, taking into account [HTTP RFC 7234](http://httpwg.org/specs/rfc7234.html) rules for user agents and shared caches.
+It also implements [RFC 5861](https://tools.ietf.org/html/rfc5861), implementing `stale-if-error` and `stale-while-revalidate`.
+It's aware of many tricky details such as the `Vary` header, proxy revalidation, and authenticated responses.
+
+## Usage
+
+Cacheability of an HTTP response depends on how it was requested, so both `request` and `response` are required to create the policy.
+
+```js
+const policy = new CachePolicy(request, response, options);
+
+if (!policy.storable()) {
+ // throw the response away, it's not usable at all
+ return;
+}
+
+// Cache the data AND the policy object in your cache
+// (this is pseudocode, roll your own cache (lru-cache package works))
+letsPretendThisIsSomeCache.set(
+ request.url,
+ { policy, response },
+ policy.timeToLive()
+);
+```
+
+```js
+// And later, when you receive a new request:
+const { policy, response } = letsPretendThisIsSomeCache.get(newRequest.url);
+
+// It's not enough that it exists in the cache, it has to match the new request, too:
+if (policy && policy.satisfiesWithoutRevalidation(newRequest)) {
+ // OK, the previous response can be used to respond to the `newRequest`.
+ // Response headers have to be updated, e.g. to add Age and remove uncacheable headers.
+ response.headers = policy.responseHeaders();
+ return response;
+}
+```
+
+It may be surprising, but it's not enough for an HTTP response to be [fresh](#yo-fresh) to satisfy a request. It may need to match request headers specified in `Vary`. Even a matching fresh response may still not be usable if the new request restricted cacheability, etc.
+
+The key method is `satisfiesWithoutRevalidation(newRequest)`, which checks whether the `newRequest` is compatible with the original request and whether all caching conditions are met.
+
+### Constructor options
+
+Request and response must have a `headers` property with all header names in lower case. `url`, `status` and `method` are optional (defaults are any URL, status `200`, and `GET` method).
+
+```js
+const request = {
+ url: '/',
+ method: 'GET',
+ headers: {
+ accept: '*/*',
+ },
+};
+
+const response = {
+ status: 200,
+ headers: {
+ 'cache-control': 'public, max-age=7234',
+ },
+};
+
+const options = {
+ shared: true,
+ cacheHeuristic: 0.1,
+ immutableMinTimeToLive: 24 * 3600 * 1000, // 24h
+ ignoreCargoCult: false,
+};
+```
+
+If `options.shared` is `true` (default), then the response is evaluated from a perspective of a shared cache (i.e. `private` is not cacheable and `s-maxage` is respected). If `options.shared` is `false`, then the response is evaluated from a perspective of a single-user cache (i.e. `private` is cacheable and `s-maxage` is ignored). `shared: true` is recommended for HTTP clients.
+
+`options.cacheHeuristic` is a fraction of response's age that is used as a fallback cache duration. The default is 0.1 (10%), e.g. if a file hasn't been modified for 100 days, it'll be cached for 100\*0.1 = 10 days.
+
+`options.immutableMinTimeToLive` is a number of milliseconds to assume as the default time to cache responses with `Cache-Control: immutable`. Note that [per RFC](http://httpwg.org/http-extensions/immutable.html) these can become stale, so `max-age` still overrides the default.
+
+If `options.ignoreCargoCult` is true, common anti-cache directives will be completely ignored if the non-standard `pre-check` and `post-check` directives are present. These two useless directives are most commonly found in bad StackOverflow answers and PHP's "session limiter" defaults.
+
+### `storable()`
+
+Returns `true` if the response can be stored in a cache. If it's `false` then you MUST NOT store either the request or the response.
+
+### `satisfiesWithoutRevalidation(newRequest)`
+
+This is the most important method. Use this method to check whether the cached response is still fresh in the context of the new request.
+
+If it returns `true`, then the given `request` matches the original response this cache policy has been created with, and the response can be reused without contacting the server. Note that the old response can't be returned without being updated, see `responseHeaders()`.
+
+If it returns `false`, then the response may not be matching at all (e.g. it's for a different URL or method), or may require to be refreshed first (see `revalidationHeaders()`).
+
+### `responseHeaders()`
+
+Returns updated, filtered set of response headers to return to clients receiving the cached response. This function is necessary, because proxies MUST always remove hop-by-hop headers (such as `TE` and `Connection`) and update response's `Age` to avoid doubling cache time.
+
+```js
+cachedResponse.headers = cachePolicy.responseHeaders(cachedResponse);
+```
+
+### `timeToLive()`
+
+Returns approximate time in _milliseconds_ until the response becomes stale (i.e. not fresh).
+
+After that time (when `timeToLive() <= 0`) the response might not be usable without revalidation. However, there are exceptions, e.g. a client can explicitly allow stale responses, so always check with `satisfiesWithoutRevalidation()`.
+`stale-if-error` and `stale-while-revalidate` extend the time to live of the cache, that can still be used if stale.
+
+### `toObject()`/`fromObject(json)`
+
+Chances are you'll want to store the `CachePolicy` object along with the cached response. `obj = policy.toObject()` gives a plain JSON-serializable object. `policy = CachePolicy.fromObject(obj)` creates an instance from it.
+
+### Refreshing stale cache (revalidation)
+
+When a cached response has expired, it can be made fresh again by making a request to the origin server. The server may respond with status 304 (Not Modified) without sending the response body again, saving bandwidth.
+
+The following methods help perform the update efficiently and correctly.
+
+#### `revalidationHeaders(newRequest)`
+
+Returns updated, filtered set of request headers to send to the origin server to check if the cached response can be reused. These headers allow the origin server to return status 304 indicating the response is still fresh. All headers unrelated to caching are passed through as-is.
+
+Use this method when updating cache from the origin server.
+
+```js
+updateRequest.headers = cachePolicy.revalidationHeaders(updateRequest);
+```
+
+#### `revalidatedPolicy(revalidationRequest, revalidationResponse)`
+
+Use this method to update the cache after receiving a new response from the origin server. It returns an object with two keys:
+
+- `policy` — A new `CachePolicy` with HTTP headers updated from `revalidationResponse`. You can always replace the old cached `CachePolicy` with the new one.
+- `modified` — Boolean indicating whether the response body has changed.
+ - If `false`, then a valid 304 Not Modified response has been received, and you can reuse the old cached response body. This is also affected by `stale-if-error`.
+ - If `true`, you should use new response's body (if present), or make another request to the origin server without any conditional headers (i.e. don't use `revalidationHeaders()` this time) to get the new resource.
+
+```js
+// When serving requests from cache:
+const { oldPolicy, oldResponse } = letsPretendThisIsSomeCache.get(
+ newRequest.url
+);
+
+if (!oldPolicy.satisfiesWithoutRevalidation(newRequest)) {
+ // Change the request to ask the origin server if the cached response can be used
+ newRequest.headers = oldPolicy.revalidationHeaders(newRequest);
+
+ // Send request to the origin server. The server may respond with status 304
+ const newResponse = await makeRequest(newRequest);
+
+ // Create updated policy and combined response from the old and new data
+ const { policy, modified } = oldPolicy.revalidatedPolicy(
+ newRequest,
+ newResponse
+ );
+ const response = modified ? newResponse : oldResponse;
+
+ // Update the cache with the newer/fresher response
+ letsPretendThisIsSomeCache.set(
+ newRequest.url,
+ { policy, response },
+ policy.timeToLive()
+ );
+
+ // And proceed returning cached response as usual
+ response.headers = policy.responseHeaders();
+ return response;
+}
+```
+
+# Yo, FRESH
+
+![satisfiesWithoutRevalidation](fresh.jpg)
+
+## Used by
+
+- [ImageOptim API](https://imageoptim.com/api), [make-fetch-happen](https://github.com/zkat/make-fetch-happen), [cacheable-request](https://www.npmjs.com/package/cacheable-request) ([got](https://www.npmjs.com/package/got)), [npm/registry-fetch](https://github.com/npm/registry-fetch), [etc.](https://github.com/kornelski/http-cache-semantics/network/dependents)
+
+## Implemented
+
+- `Cache-Control` response header with all the quirks.
+- `Expires` with check for bad clocks.
+- `Pragma` response header.
+- `Age` response header.
+- `Vary` response header.
+- Default cacheability of statuses and methods.
+- Requests for stale data.
+- Filtering of hop-by-hop headers.
+- Basic revalidation request
+- `stale-if-error`
+
+## Unimplemented
+
+- Merging of range requests, `If-Range` (but correctly supports them as non-cacheable)
+- Revalidation of multiple representations
+
+### Trusting server `Date`
+
+Per the RFC, the cache should take into account the time between server-supplied `Date` and the time it received the response. The RFC-mandated behavior creates two problems:
+
+ * Servers with incorrectly set timezone may add several hours to cache age (or more, if the clock is completely wrong).
+ * Even reasonably correct clocks may be off by a couple of seconds, breaking `max-age=1` trick (which is useful for reverse proxies on high-traffic servers).
+
+Previous versions of this library had an option to ignore the server date if it was "too inaccurate". To support the `max-age=1` trick the library also has to ignore dates that pretty accurate. There's no point of having an option to trust dates that are only a bit inaccurate, so this library won't trust any server dates. `max-age` will be interpreted from the time the response has been received, not from when it has been sent. This will affect only [RFC 1149 networks](https://tools.ietf.org/html/rfc1149).
diff --git a/includes/translator/node_modules/http-cache-semantics/index.js b/includes/translator/node_modules/http-cache-semantics/index.js
new file mode 100644
index 0000000..31fba48
--- /dev/null
+++ b/includes/translator/node_modules/http-cache-semantics/index.js
@@ -0,0 +1,674 @@
+'use strict';
+// rfc7231 6.1
+const statusCodeCacheableByDefault = new Set([
+ 200,
+ 203,
+ 204,
+ 206,
+ 300,
+ 301,
+ 308,
+ 404,
+ 405,
+ 410,
+ 414,
+ 501,
+]);
+
+// This implementation does not understand partial responses (206)
+const understoodStatuses = new Set([
+ 200,
+ 203,
+ 204,
+ 300,
+ 301,
+ 302,
+ 303,
+ 307,
+ 308,
+ 404,
+ 405,
+ 410,
+ 414,
+ 501,
+]);
+
+const errorStatusCodes = new Set([
+ 500,
+ 502,
+ 503,
+ 504,
+]);
+
+const hopByHopHeaders = {
+ date: true, // included, because we add Age update Date
+ connection: true,
+ 'keep-alive': true,
+ 'proxy-authenticate': true,
+ 'proxy-authorization': true,
+ te: true,
+ trailer: true,
+ 'transfer-encoding': true,
+ upgrade: true,
+};
+
+const excludedFromRevalidationUpdate = {
+ // Since the old body is reused, it doesn't make sense to change properties of the body
+ 'content-length': true,
+ 'content-encoding': true,
+ 'transfer-encoding': true,
+ 'content-range': true,
+};
+
+function toNumberOrZero(s) {
+ const n = parseInt(s, 10);
+ return isFinite(n) ? n : 0;
+}
+
+// RFC 5861
+function isErrorResponse(response) {
+ // consider undefined response as faulty
+ if(!response) {
+ return true
+ }
+ return errorStatusCodes.has(response.status);
+}
+
+function parseCacheControl(header) {
+ const cc = {};
+ if (!header) return cc;
+
+ // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives),
+ // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale
+ const parts = header.trim().split(/,/);
+ for (const part of parts) {
+ const [k, v] = part.split(/=/, 2);
+ cc[k.trim()] = v === undefined ? true : v.trim().replace(/^"|"$/g, '');
+ }
+
+ return cc;
+}
+
+function formatCacheControl(cc) {
+ let parts = [];
+ for (const k in cc) {
+ const v = cc[k];
+ parts.push(v === true ? k : k + '=' + v);
+ }
+ if (!parts.length) {
+ return undefined;
+ }
+ return parts.join(', ');
+}
+
+module.exports = class CachePolicy {
+ constructor(
+ req,
+ res,
+ {
+ shared,
+ cacheHeuristic,
+ immutableMinTimeToLive,
+ ignoreCargoCult,
+ _fromObject,
+ } = {}
+ ) {
+ if (_fromObject) {
+ this._fromObject(_fromObject);
+ return;
+ }
+
+ if (!res || !res.headers) {
+ throw Error('Response headers missing');
+ }
+ this._assertRequestHasHeaders(req);
+
+ this._responseTime = this.now();
+ this._isShared = shared !== false;
+ this._cacheHeuristic =
+ undefined !== cacheHeuristic ? cacheHeuristic : 0.1; // 10% matches IE
+ this._immutableMinTtl =
+ undefined !== immutableMinTimeToLive
+ ? immutableMinTimeToLive
+ : 24 * 3600 * 1000;
+
+ this._status = 'status' in res ? res.status : 200;
+ this._resHeaders = res.headers;
+ this._rescc = parseCacheControl(res.headers['cache-control']);
+ this._method = 'method' in req ? req.method : 'GET';
+ this._url = req.url;
+ this._host = req.headers.host;
+ this._noAuthorization = !req.headers.authorization;
+ this._reqHeaders = res.headers.vary ? req.headers : null; // Don't keep all request headers if they won't be used
+ this._reqcc = parseCacheControl(req.headers['cache-control']);
+
+ // Assume that if someone uses legacy, non-standard uncecessary options they don't understand caching,
+ // so there's no point stricly adhering to the blindly copy&pasted directives.
+ if (
+ ignoreCargoCult &&
+ 'pre-check' in this._rescc &&
+ 'post-check' in this._rescc
+ ) {
+ delete this._rescc['pre-check'];
+ delete this._rescc['post-check'];
+ delete this._rescc['no-cache'];
+ delete this._rescc['no-store'];
+ delete this._rescc['must-revalidate'];
+ this._resHeaders = Object.assign({}, this._resHeaders, {
+ 'cache-control': formatCacheControl(this._rescc),
+ });
+ delete this._resHeaders.expires;
+ delete this._resHeaders.pragma;
+ }
+
+ // When the Cache-Control header field is not present in a request, caches MUST consider the no-cache request pragma-directive
+ // as having the same effect as if "Cache-Control: no-cache" were present (see Section 5.2.1).
+ if (
+ res.headers['cache-control'] == null &&
+ /no-cache/.test(res.headers.pragma)
+ ) {
+ this._rescc['no-cache'] = true;
+ }
+ }
+
+ now() {
+ return Date.now();
+ }
+
+ storable() {
+ // The "no-store" request directive indicates that a cache MUST NOT store any part of either this request or any response to it.
+ return !!(
+ !this._reqcc['no-store'] &&
+ // A cache MUST NOT store a response to any request, unless:
+ // The request method is understood by the cache and defined as being cacheable, and
+ ('GET' === this._method ||
+ 'HEAD' === this._method ||
+ ('POST' === this._method && this._hasExplicitExpiration())) &&
+ // the response status code is understood by the cache, and
+ understoodStatuses.has(this._status) &&
+ // the "no-store" cache directive does not appear in request or response header fields, and
+ !this._rescc['no-store'] &&
+ // the "private" response directive does not appear in the response, if the cache is shared, and
+ (!this._isShared || !this._rescc.private) &&
+ // the Authorization header field does not appear in the request, if the cache is shared,
+ (!this._isShared ||
+ this._noAuthorization ||
+ this._allowsStoringAuthenticated()) &&
+ // the response either:
+ // contains an Expires header field, or
+ (this._resHeaders.expires ||
+ // contains a max-age response directive, or
+ // contains a s-maxage response directive and the cache is shared, or
+ // contains a public response directive.
+ this._rescc['max-age'] ||
+ (this._isShared && this._rescc['s-maxage']) ||
+ this._rescc.public ||
+ // has a status code that is defined as cacheable by default
+ statusCodeCacheableByDefault.has(this._status))
+ );
+ }
+
+ _hasExplicitExpiration() {
+ // 4.2.1 Calculating Freshness Lifetime
+ return (
+ (this._isShared && this._rescc['s-maxage']) ||
+ this._rescc['max-age'] ||
+ this._resHeaders.expires
+ );
+ }
+
+ _assertRequestHasHeaders(req) {
+ if (!req || !req.headers) {
+ throw Error('Request headers missing');
+ }
+ }
+
+ satisfiesWithoutRevalidation(req) {
+ this._assertRequestHasHeaders(req);
+
+ // When presented with a request, a cache MUST NOT reuse a stored response, unless:
+ // the presented request does not contain the no-cache pragma (Section 5.4), nor the no-cache cache directive,
+ // unless the stored response is successfully validated (Section 4.3), and
+ const requestCC = parseCacheControl(req.headers['cache-control']);
+ if (requestCC['no-cache'] || /no-cache/.test(req.headers.pragma)) {
+ return false;
+ }
+
+ if (requestCC['max-age'] && this.age() > requestCC['max-age']) {
+ return false;
+ }
+
+ if (
+ requestCC['min-fresh'] &&
+ this.timeToLive() < 1000 * requestCC['min-fresh']
+ ) {
+ return false;
+ }
+
+ // the stored response is either:
+ // fresh, or allowed to be served stale
+ if (this.stale()) {
+ const allowsStale =
+ requestCC['max-stale'] &&
+ !this._rescc['must-revalidate'] &&
+ (true === requestCC['max-stale'] ||
+ requestCC['max-stale'] > this.age() - this.maxAge());
+ if (!allowsStale) {
+ return false;
+ }
+ }
+
+ return this._requestMatches(req, false);
+ }
+
+ _requestMatches(req, allowHeadMethod) {
+ // The presented effective request URI and that of the stored response match, and
+ return (
+ (!this._url || this._url === req.url) &&
+ this._host === req.headers.host &&
+ // the request method associated with the stored response allows it to be used for the presented request, and
+ (!req.method ||
+ this._method === req.method ||
+ (allowHeadMethod && 'HEAD' === req.method)) &&
+ // selecting header fields nominated by the stored response (if any) match those presented, and
+ this._varyMatches(req)
+ );
+ }
+
+ _allowsStoringAuthenticated() {
+ // following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage.
+ return (
+ this._rescc['must-revalidate'] ||
+ this._rescc.public ||
+ this._rescc['s-maxage']
+ );
+ }
+
+ _varyMatches(req) {
+ if (!this._resHeaders.vary) {
+ return true;
+ }
+
+ // A Vary header field-value of "*" always fails to match
+ if (this._resHeaders.vary === '*') {
+ return false;
+ }
+
+ const fields = this._resHeaders.vary
+ .trim()
+ .toLowerCase()
+ .split(/\s*,\s*/);
+ for (const name of fields) {
+ if (req.headers[name] !== this._reqHeaders[name]) return false;
+ }
+ return true;
+ }
+
+ _copyWithoutHopByHopHeaders(inHeaders) {
+ const headers = {};
+ for (const name in inHeaders) {
+ if (hopByHopHeaders[name]) continue;
+ headers[name] = inHeaders[name];
+ }
+ // 9.1. Connection
+ if (inHeaders.connection) {
+ const tokens = inHeaders.connection.trim().split(/\s*,\s*/);
+ for (const name of tokens) {
+ delete headers[name];
+ }
+ }
+ if (headers.warning) {
+ const warnings = headers.warning.split(/,/).filter(warning => {
+ return !/^\s*1[0-9][0-9]/.test(warning);
+ });
+ if (!warnings.length) {
+ delete headers.warning;
+ } else {
+ headers.warning = warnings.join(',').trim();
+ }
+ }
+ return headers;
+ }
+
+ responseHeaders() {
+ const headers = this._copyWithoutHopByHopHeaders(this._resHeaders);
+ const age = this.age();
+
+ // A cache SHOULD generate 113 warning if it heuristically chose a freshness
+ // lifetime greater than 24 hours and the response's age is greater than 24 hours.
+ if (
+ age > 3600 * 24 &&
+ !this._hasExplicitExpiration() &&
+ this.maxAge() > 3600 * 24
+ ) {
+ headers.warning =
+ (headers.warning ? `${headers.warning}, ` : '') +
+ '113 - "rfc7234 5.5.4"';
+ }
+ headers.age = `${Math.round(age)}`;
+ headers.date = new Date(this.now()).toUTCString();
+ return headers;
+ }
+
+ /**
+ * Value of the Date response header or current time if Date was invalid
+ * @return timestamp
+ */
+ date() {
+ const serverDate = Date.parse(this._resHeaders.date);
+ if (isFinite(serverDate)) {
+ return serverDate;
+ }
+ return this._responseTime;
+ }
+
+ /**
+ * Value of the Age header, in seconds, updated for the current time.
+ * May be fractional.
+ *
+ * @return Number
+ */
+ age() {
+ let age = this._ageValue();
+
+ const residentTime = (this.now() - this._responseTime) / 1000;
+ return age + residentTime;
+ }
+
+ _ageValue() {
+ return toNumberOrZero(this._resHeaders.age);
+ }
+
+ /**
+ * Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's `Date`.
+ *
+ * For an up-to-date value, see `timeToLive()`.
+ *
+ * @return Number
+ */
+ maxAge() {
+ if (!this.storable() || this._rescc['no-cache']) {
+ return 0;
+ }
+
+ // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default
+ // so this implementation requires explicit opt-in via public header
+ if (
+ this._isShared &&
+ (this._resHeaders['set-cookie'] &&
+ !this._rescc.public &&
+ !this._rescc.immutable)
+ ) {
+ return 0;
+ }
+
+ if (this._resHeaders.vary === '*') {
+ return 0;
+ }
+
+ if (this._isShared) {
+ if (this._rescc['proxy-revalidate']) {
+ return 0;
+ }
+ // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field.
+ if (this._rescc['s-maxage']) {
+ return toNumberOrZero(this._rescc['s-maxage']);
+ }
+ }
+
+ // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field.
+ if (this._rescc['max-age']) {
+ return toNumberOrZero(this._rescc['max-age']);
+ }
+
+ const defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0;
+
+ const serverDate = this.date();
+ if (this._resHeaders.expires) {
+ const expires = Date.parse(this._resHeaders.expires);
+ // A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired").
+ if (Number.isNaN(expires) || expires < serverDate) {
+ return 0;
+ }
+ return Math.max(defaultMinTtl, (expires - serverDate) / 1000);
+ }
+
+ if (this._resHeaders['last-modified']) {
+ const lastModified = Date.parse(this._resHeaders['last-modified']);
+ if (isFinite(lastModified) && serverDate > lastModified) {
+ return Math.max(
+ defaultMinTtl,
+ ((serverDate - lastModified) / 1000) * this._cacheHeuristic
+ );
+ }
+ }
+
+ return defaultMinTtl;
+ }
+
+ timeToLive() {
+ const age = this.maxAge() - this.age();
+ const staleIfErrorAge = age + toNumberOrZero(this._rescc['stale-if-error']);
+ const staleWhileRevalidateAge = age + toNumberOrZero(this._rescc['stale-while-revalidate']);
+ return Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1000;
+ }
+
+ stale() {
+ return this.maxAge() <= this.age();
+ }
+
+ _useStaleIfError() {
+ return this.maxAge() + toNumberOrZero(this._rescc['stale-if-error']) > this.age();
+ }
+
+ useStaleWhileRevalidate() {
+ return this.maxAge() + toNumberOrZero(this._rescc['stale-while-revalidate']) > this.age();
+ }
+
+ static fromObject(obj) {
+ return new this(undefined, undefined, { _fromObject: obj });
+ }
+
+ _fromObject(obj) {
+ if (this._responseTime) throw Error('Reinitialized');
+ if (!obj || obj.v !== 1) throw Error('Invalid serialization');
+
+ this._responseTime = obj.t;
+ this._isShared = obj.sh;
+ this._cacheHeuristic = obj.ch;
+ this._immutableMinTtl =
+ obj.imm !== undefined ? obj.imm : 24 * 3600 * 1000;
+ this._status = obj.st;
+ this._resHeaders = obj.resh;
+ this._rescc = obj.rescc;
+ this._method = obj.m;
+ this._url = obj.u;
+ this._host = obj.h;
+ this._noAuthorization = obj.a;
+ this._reqHeaders = obj.reqh;
+ this._reqcc = obj.reqcc;
+ }
+
+ toObject() {
+ return {
+ v: 1,
+ t: this._responseTime,
+ sh: this._isShared,
+ ch: this._cacheHeuristic,
+ imm: this._immutableMinTtl,
+ st: this._status,
+ resh: this._resHeaders,
+ rescc: this._rescc,
+ m: this._method,
+ u: this._url,
+ h: this._host,
+ a: this._noAuthorization,
+ reqh: this._reqHeaders,
+ reqcc: this._reqcc,
+ };
+ }
+
+ /**
+ * Headers for sending to the origin server to revalidate stale response.
+ * Allows server to return 304 to allow reuse of the previous response.
+ *
+ * Hop by hop headers are always stripped.
+ * Revalidation headers may be added or removed, depending on request.
+ */
+ revalidationHeaders(incomingReq) {
+ this._assertRequestHasHeaders(incomingReq);
+ const headers = this._copyWithoutHopByHopHeaders(incomingReq.headers);
+
+ // This implementation does not understand range requests
+ delete headers['if-range'];
+
+ if (!this._requestMatches(incomingReq, true) || !this.storable()) {
+ // revalidation allowed via HEAD
+ // not for the same resource, or wasn't allowed to be cached anyway
+ delete headers['if-none-match'];
+ delete headers['if-modified-since'];
+ return headers;
+ }
+
+ /* MUST send that entity-tag in any cache validation request (using If-Match or If-None-Match) if an entity-tag has been provided by the origin server. */
+ if (this._resHeaders.etag) {
+ headers['if-none-match'] = headers['if-none-match']
+ ? `${headers['if-none-match']}, ${this._resHeaders.etag}`
+ : this._resHeaders.etag;
+ }
+
+ // Clients MAY issue simple (non-subrange) GET requests with either weak validators or strong validators. Clients MUST NOT use weak validators in other forms of request.
+ const forbidsWeakValidators =
+ headers['accept-ranges'] ||
+ headers['if-match'] ||
+ headers['if-unmodified-since'] ||
+ (this._method && this._method != 'GET');
+
+ /* SHOULD send the Last-Modified value in non-subrange cache validation requests (using If-Modified-Since) if only a Last-Modified value has been provided by the origin server.
+ Note: This implementation does not understand partial responses (206) */
+ if (forbidsWeakValidators) {
+ delete headers['if-modified-since'];
+
+ if (headers['if-none-match']) {
+ const etags = headers['if-none-match']
+ .split(/,/)
+ .filter(etag => {
+ return !/^\s*W\//.test(etag);
+ });
+ if (!etags.length) {
+ delete headers['if-none-match'];
+ } else {
+ headers['if-none-match'] = etags.join(',').trim();
+ }
+ }
+ } else if (
+ this._resHeaders['last-modified'] &&
+ !headers['if-modified-since']
+ ) {
+ headers['if-modified-since'] = this._resHeaders['last-modified'];
+ }
+
+ return headers;
+ }
+
+ /**
+ * Creates new CachePolicy with information combined from the previews response,
+ * and the new revalidation response.
+ *
+ * Returns {policy, modified} where modified is a boolean indicating
+ * whether the response body has been modified, and old cached body can't be used.
+ *
+ * @return {Object} {policy: CachePolicy, modified: Boolean}
+ */
+ revalidatedPolicy(request, response) {
+ this._assertRequestHasHeaders(request);
+ if(this._useStaleIfError() && isErrorResponse(response)) { // I consider the revalidation request unsuccessful
+ return {
+ modified: false,
+ matches: false,
+ policy: this,
+ };
+ }
+ if (!response || !response.headers) {
+ throw Error('Response headers missing');
+ }
+
+ // These aren't going to be supported exactly, since one CachePolicy object
+ // doesn't know about all the other cached objects.
+ let matches = false;
+ if (response.status !== undefined && response.status != 304) {
+ matches = false;
+ } else if (
+ response.headers.etag &&
+ !/^\s*W\//.test(response.headers.etag)
+ ) {
+ // "All of the stored responses with the same strong validator are selected.
+ // If none of the stored responses contain the same strong validator,
+ // then the cache MUST NOT use the new response to update any stored responses."
+ matches =
+ this._resHeaders.etag &&
+ this._resHeaders.etag.replace(/^\s*W\//, '') ===
+ response.headers.etag;
+ } else if (this._resHeaders.etag && response.headers.etag) {
+ // "If the new response contains a weak validator and that validator corresponds
+ // to one of the cache's stored responses,
+ // then the most recent of those matching stored responses is selected for update."
+ matches =
+ this._resHeaders.etag.replace(/^\s*W\//, '') ===
+ response.headers.etag.replace(/^\s*W\//, '');
+ } else if (this._resHeaders['last-modified']) {
+ matches =
+ this._resHeaders['last-modified'] ===
+ response.headers['last-modified'];
+ } else {
+ // If the new response does not include any form of validator (such as in the case where
+ // a client generates an If-Modified-Since request from a source other than the Last-Modified
+ // response header field), and there is only one stored response, and that stored response also
+ // lacks a validator, then that stored response is selected for update.
+ if (
+ !this._resHeaders.etag &&
+ !this._resHeaders['last-modified'] &&
+ !response.headers.etag &&
+ !response.headers['last-modified']
+ ) {
+ matches = true;
+ }
+ }
+
+ if (!matches) {
+ return {
+ policy: new this.constructor(request, response),
+ // Client receiving 304 without body, even if it's invalid/mismatched has no option
+ // but to reuse a cached body. We don't have a good way to tell clients to do
+ // error recovery in such case.
+ modified: response.status != 304,
+ matches: false,
+ };
+ }
+
+ // use other header fields provided in the 304 (Not Modified) response to replace all instances
+ // of the corresponding header fields in the stored response.
+ const headers = {};
+ for (const k in this._resHeaders) {
+ headers[k] =
+ k in response.headers && !excludedFromRevalidationUpdate[k]
+ ? response.headers[k]
+ : this._resHeaders[k];
+ }
+
+ const newResponse = Object.assign({}, response, {
+ status: this._status,
+ method: this._method,
+ headers,
+ });
+ return {
+ policy: new this.constructor(request, newResponse, {
+ shared: this._isShared,
+ cacheHeuristic: this._cacheHeuristic,
+ immutableMinTimeToLive: this._immutableMinTtl,
+ }),
+ modified: false,
+ matches: true,
+ };
+ }
+};
diff --git a/includes/translator/node_modules/http-cache-semantics/package.json b/includes/translator/node_modules/http-cache-semantics/package.json
new file mode 100644
index 0000000..defbb04
--- /dev/null
+++ b/includes/translator/node_modules/http-cache-semantics/package.json
@@ -0,0 +1,18 @@
+{
+ "name": "http-cache-semantics",
+ "version": "4.1.1",
+ "description": "Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies",
+ "repository": "https://github.com/kornelski/http-cache-semantics.git",
+ "main": "index.js",
+ "scripts": {
+ "test": "mocha"
+ },
+ "files": [
+ "index.js"
+ ],
+ "author": "Kornel Lesiński <kornel@geekhood.net> (https://kornel.ski/)",
+ "license": "BSD-2-Clause",
+ "devDependencies": {
+ "mocha": "^10.0"
+ }
+}
diff --git a/includes/translator/node_modules/imurmurhash/README.md b/includes/translator/node_modules/imurmurhash/README.md
new file mode 100644
index 0000000..f35b20a
--- /dev/null
+++ b/includes/translator/node_modules/imurmurhash/README.md
@@ -0,0 +1,122 @@
+iMurmurHash.js
+==============
+
+An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js).
+
+This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing.
+
+Installation
+------------
+
+To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site.
+
+```html
+<script type="text/javascript" src="/scripts/imurmurhash.min.js"></script>
+<script>
+// Your code here, access iMurmurHash using the global object MurmurHash3
+</script>
+```
+
+---
+
+To use iMurmurHash in Node.js, install the module using NPM:
+
+```bash
+npm install imurmurhash
+```
+
+Then simply include it in your scripts:
+
+```javascript
+MurmurHash3 = require('imurmurhash');
+```
+
+Quick Example
+-------------
+
+```javascript
+// Create the initial hash
+var hashState = MurmurHash3('string');
+
+// Incrementally add text
+hashState.hash('more strings');
+hashState.hash('even more strings');
+
+// All calls can be chained if desired
+hashState.hash('and').hash('some').hash('more');
+
+// Get a result
+hashState.result();
+// returns 0xe4ccfe6b
+```
+
+Functions
+---------
+
+### MurmurHash3 ([string], [seed])
+Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example:
+
+```javascript
+// Use the cached object, calling the function again will return the same
+// object (but reset, so the current state would be lost)
+hashState = MurmurHash3();
+...
+
+// Create a new object that can be safely used however you wish. Calling the
+// function again will simply return a new state object, and no state loss
+// will occur, at the cost of creating more objects.
+hashState = new MurmurHash3();
+```
+
+Both methods can be mixed however you like if you have different use cases.
+
+---
+
+### MurmurHash3.prototype.hash (string)
+Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained.
+
+---
+
+### MurmurHash3.prototype.result ()
+Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`.
+
+```javascript
+// Do the whole string at once
+MurmurHash3('this is a test string').result();
+// 0x70529328
+
+// Do part of the string, get a result, then the other part
+var m = MurmurHash3('this is a');
+m.result();
+// 0xbfc4f834
+m.hash(' test string').result();
+// 0x70529328 (same as above)
+```
+
+---
+
+### MurmurHash3.prototype.reset ([seed])
+Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained.
+
+---
+
+License (MIT)
+-------------
+Copyright (c) 2013 Gary Court, Jens Taylor
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/imurmurhash/imurmurhash.js b/includes/translator/node_modules/imurmurhash/imurmurhash.js
new file mode 100644
index 0000000..e63146a
--- /dev/null
+++ b/includes/translator/node_modules/imurmurhash/imurmurhash.js
@@ -0,0 +1,138 @@
+/**
+ * @preserve
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
+ *
+ * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
+ * @see http://github.com/homebrewing/brauhaus-diff
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
+ * @see http://github.com/garycourt/murmurhash-js
+ * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
+ * @see http://sites.google.com/site/murmurhash/
+ */
+(function(){
+ var cache;
+
+ // Call this function without `new` to use the cached object (good for
+ // single-threaded environments), or with `new` to create a new object.
+ //
+ // @param {string} key A UTF-16 or ASCII string
+ // @param {number} seed An optional positive integer
+ // @return {object} A MurmurHash3 object for incremental hashing
+ function MurmurHash3(key, seed) {
+ var m = this instanceof MurmurHash3 ? this : cache;
+ m.reset(seed)
+ if (typeof key === 'string' && key.length > 0) {
+ m.hash(key);
+ }
+
+ if (m !== this) {
+ return m;
+ }
+ };
+
+ // Incrementally add a string to this hash
+ //
+ // @param {string} key A UTF-16 or ASCII string
+ // @return {object} this
+ MurmurHash3.prototype.hash = function(key) {
+ var h1, k1, i, top, len;
+
+ len = key.length;
+ this.len += len;
+
+ k1 = this.k1;
+ i = 0;
+ switch (this.rem) {
+ case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0;
+ case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0;
+ case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0;
+ case 3:
+ k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0;
+ k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0;
+ }
+
+ this.rem = (len + this.rem) & 3; // & 3 is same as % 4
+ len -= this.rem;
+ if (len > 0) {
+ h1 = this.h1;
+ while (1) {
+ k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;
+ k1 = (k1 << 15) | (k1 >>> 17);
+ k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;
+
+ h1 ^= k1;
+ h1 = (h1 << 13) | (h1 >>> 19);
+ h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff;
+
+ if (i >= len) {
+ break;
+ }
+
+ k1 = ((key.charCodeAt(i++) & 0xffff)) ^
+ ((key.charCodeAt(i++) & 0xffff) << 8) ^
+ ((key.charCodeAt(i++) & 0xffff) << 16);
+ top = key.charCodeAt(i++);
+ k1 ^= ((top & 0xff) << 24) ^
+ ((top & 0xff00) >> 8);
+ }
+
+ k1 = 0;
+ switch (this.rem) {
+ case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16;
+ case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8;
+ case 1: k1 ^= (key.charCodeAt(i) & 0xffff);
+ }
+
+ this.h1 = h1;
+ }
+
+ this.k1 = k1;
+ return this;
+ };
+
+ // Get the result of this hash
+ //
+ // @return {number} The 32-bit hash
+ MurmurHash3.prototype.result = function() {
+ var k1, h1;
+
+ k1 = this.k1;
+ h1 = this.h1;
+
+ if (k1 > 0) {
+ k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;
+ k1 = (k1 << 15) | (k1 >>> 17);
+ k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;
+ h1 ^= k1;
+ }
+
+ h1 ^= this.len;
+
+ h1 ^= h1 >>> 16;
+ h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff;
+ h1 ^= h1 >>> 13;
+ h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff;
+ h1 ^= h1 >>> 16;
+
+ return h1 >>> 0;
+ };
+
+ // Reset the hash object for reuse
+ //
+ // @param {number} seed An optional positive integer
+ MurmurHash3.prototype.reset = function(seed) {
+ this.h1 = typeof seed === 'number' ? seed : 0;
+ this.rem = this.k1 = this.len = 0;
+ return this;
+ };
+
+ // A cached object to use. This can be safely used if you're in a single-
+ // threaded environment, otherwise you need to create new hashes to use.
+ cache = new MurmurHash3();
+
+ if (typeof(module) != 'undefined') {
+ module.exports = MurmurHash3;
+ } else {
+ this.MurmurHash3 = MurmurHash3;
+ }
+}());
diff --git a/includes/translator/node_modules/imurmurhash/imurmurhash.min.js b/includes/translator/node_modules/imurmurhash/imurmurhash.min.js
new file mode 100644
index 0000000..dc0ee88
--- /dev/null
+++ b/includes/translator/node_modules/imurmurhash/imurmurhash.min.js
@@ -0,0 +1,12 @@
+/**
+ * @preserve
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
+ *
+ * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
+ * @see http://github.com/homebrewing/brauhaus-diff
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
+ * @see http://github.com/garycourt/murmurhash-js
+ * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
+ * @see http://sites.google.com/site/murmurhash/
+ */
+!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}(); \ No newline at end of file
diff --git a/includes/translator/node_modules/imurmurhash/package.json b/includes/translator/node_modules/imurmurhash/package.json
new file mode 100644
index 0000000..8a93edb
--- /dev/null
+++ b/includes/translator/node_modules/imurmurhash/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "imurmurhash",
+ "version": "0.1.4",
+ "description": "An incremental implementation of MurmurHash3",
+ "homepage": "https://github.com/jensyt/imurmurhash-js",
+ "main": "imurmurhash.js",
+ "files": [
+ "imurmurhash.js",
+ "imurmurhash.min.js",
+ "package.json",
+ "README.md"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/jensyt/imurmurhash-js"
+ },
+ "bugs": {
+ "url": "https://github.com/jensyt/imurmurhash-js/issues"
+ },
+ "keywords": [
+ "murmur",
+ "murmurhash",
+ "murmurhash3",
+ "hash",
+ "incremental"
+ ],
+ "author": {
+ "name": "Jens Taylor",
+ "email": "jensyt@gmail.com",
+ "url": "https://github.com/homebrewing"
+ },
+ "license": "MIT",
+ "dependencies": {
+ },
+ "devDependencies": {
+ },
+ "engines": {
+ "node": ">=0.8.19"
+ }
+}
diff --git a/includes/translator/node_modules/is-obj/index.js b/includes/translator/node_modules/is-obj/index.js
new file mode 100644
index 0000000..4d023bc
--- /dev/null
+++ b/includes/translator/node_modules/is-obj/index.js
@@ -0,0 +1,5 @@
+'use strict';
+module.exports = function (x) {
+ var type = typeof x;
+ return x !== null && (type === 'object' || type === 'function');
+};
diff --git a/includes/translator/node_modules/is-obj/license b/includes/translator/node_modules/is-obj/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/includes/translator/node_modules/is-obj/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/includes/translator/node_modules/is-obj/package.json b/includes/translator/node_modules/is-obj/package.json
new file mode 100644
index 0000000..c441d27
--- /dev/null
+++ b/includes/translator/node_modules/is-obj/package.json
@@ -0,0 +1,33 @@
+{
+ "name": "is-obj",
+ "version": "1.0.1",
+ "description": "Check if a value is an object",
+ "license": "MIT",
+ "repository": "sindresorhus/is-obj",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "obj",
+ "object",
+ "is",
+ "check",
+ "test",
+ "type"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ }
+}
diff --git a/includes/translator/node_modules/is-obj/readme.md b/includes/translator/node_modules/is-obj/readme.md
new file mode 100644
index 0000000..d311026
--- /dev/null
+++ b/includes/translator/node_modules/is-obj/readme.md
@@ -0,0 +1,34 @@
+# is-obj [![Build Status](https://travis-ci.org/sindresorhus/is-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/is-obj)
+
+> Check if a value is an object
+
+Keep in mind that array, function, regexp, etc, are objects in JavaScript.<br>
+See [`is-plain-obj`](https://github.com/sindresorhus/is-plain-obj) if you want to check for plain objects.
+
+
+## Install
+
+```
+$ npm install --save is-obj
+```
+
+
+## Usage
+
+```js
+const isObj = require('is-obj');
+
+isObj({foo: 'bar'});
+//=> true
+
+isObj([1, 2, 3]);
+//=> true
+
+isObj('foo');
+//=> false
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/json-buffer/.npmignore b/includes/translator/node_modules/json-buffer/.npmignore
new file mode 100644
index 0000000..13abef4
--- /dev/null
+++ b/includes/translator/node_modules/json-buffer/.npmignore
@@ -0,0 +1,3 @@
+node_modules
+node_modules/*
+npm_debug.log
diff --git a/includes/translator/node_modules/json-buffer/.travis.yml b/includes/translator/node_modules/json-buffer/.travis.yml
new file mode 100644
index 0000000..244b7e8
--- /dev/null
+++ b/includes/translator/node_modules/json-buffer/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - '0.10'
diff --git a/includes/translator/node_modules/json-buffer/LICENSE b/includes/translator/node_modules/json-buffer/LICENSE
new file mode 100644
index 0000000..b799ec0
--- /dev/null
+++ b/includes/translator/node_modules/json-buffer/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Dominic Tarr
+
+Permission is hereby granted, free of charge,
+to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to
+deal in the Software without restriction, including
+without limitation the rights to use, copy, modify,
+merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom
+the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/json-buffer/README.md b/includes/translator/node_modules/json-buffer/README.md
new file mode 100644
index 0000000..43857bb
--- /dev/null
+++ b/includes/translator/node_modules/json-buffer/README.md
@@ -0,0 +1,24 @@
+# json-buffer
+
+JSON functions that can convert buffers!
+
+[![build status](https://secure.travis-ci.org/dominictarr/json-buffer.png)](http://travis-ci.org/dominictarr/json-buffer)
+
+[![testling badge](https://ci.testling.com/dominictarr/json-buffer.png)](https://ci.testling.com/dominictarr/json-buffer)
+
+JSON mangles buffers by converting to an array...
+which isn't helpful. json-buffers converts to base64 instead,
+and deconverts base64 to a buffer.
+
+``` js
+var JSONB = require('json-buffer')
+var Buffer = require('buffer').Buffer
+
+var str = JSONB.stringify(new Buffer('hello there!'))
+
+console.log(JSONB.parse(str)) //GET a BUFFER back
+```
+
+## License
+
+MIT
diff --git a/includes/translator/node_modules/json-buffer/index.js b/includes/translator/node_modules/json-buffer/index.js
new file mode 100644
index 0000000..9cafed8
--- /dev/null
+++ b/includes/translator/node_modules/json-buffer/index.js
@@ -0,0 +1,58 @@
+//TODO: handle reviver/dehydrate function like normal
+//and handle indentation, like normal.
+//if anyone needs this... please send pull request.
+
+exports.stringify = function stringify (o) {
+ if('undefined' == typeof o) return o
+
+ if(o && Buffer.isBuffer(o))
+ return JSON.stringify(':base64:' + o.toString('base64'))
+
+ if(o && o.toJSON)
+ o = o.toJSON()
+
+ if(o && 'object' === typeof o) {
+ var s = ''
+ var array = Array.isArray(o)
+ s = array ? '[' : '{'
+ var first = true
+
+ for(var k in o) {
+ var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k])
+ if(Object.hasOwnProperty.call(o, k) && !ignore) {
+ if(!first)
+ s += ','
+ first = false
+ if (array) {
+ if(o[k] == undefined)
+ s += 'null'
+ else
+ s += stringify(o[k])
+ } else if (o[k] !== void(0)) {
+ s += stringify(k) + ':' + stringify(o[k])
+ }
+ }
+ }
+
+ s += array ? ']' : '}'
+
+ return s
+ } else if ('string' === typeof o) {
+ return JSON.stringify(/^:/.test(o) ? ':' + o : o)
+ } else if ('undefined' === typeof o) {
+ return 'null';
+ } else
+ return JSON.stringify(o)
+}
+
+exports.parse = function (s) {
+ return JSON.parse(s, function (key, value) {
+ if('string' === typeof value) {
+ if(/^:base64:/.test(value))
+ return new Buffer(value.substring(8), 'base64')
+ else
+ return /^:/.test(value) ? value.substring(1) : value
+ }
+ return value
+ })
+}
diff --git a/includes/translator/node_modules/json-buffer/package.json b/includes/translator/node_modules/json-buffer/package.json
new file mode 100644
index 0000000..035df50
--- /dev/null
+++ b/includes/translator/node_modules/json-buffer/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "json-buffer",
+ "description": "JSON parse & stringify that supports binary via bops & base64",
+ "version": "3.0.0",
+ "homepage": "https://github.com/dominictarr/json-buffer",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/dominictarr/json-buffer.git"
+ },
+ "devDependencies": {
+ "tape": "^4.6.3"
+ },
+ "scripts": {
+ "test": "set -e; for t in test/*.js; do node $t; done"
+ },
+ "author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)",
+ "license": "MIT",
+ "testling": {
+ "files": "test/*.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/17..latest",
+ "firefox/nightly",
+ "chrome/22..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ }
+}
diff --git a/includes/translator/node_modules/json-buffer/test/index.js b/includes/translator/node_modules/json-buffer/test/index.js
new file mode 100644
index 0000000..8351804
--- /dev/null
+++ b/includes/translator/node_modules/json-buffer/test/index.js
@@ -0,0 +1,63 @@
+
+var test = require('tape')
+var _JSON = require('../')
+
+function clone (o) {
+ return JSON.parse(JSON.stringify(o))
+}
+
+var examples = {
+ simple: { foo: [], bar: {}, baz: new Buffer('some binary data') },
+ just_buffer: new Buffer('JUST A BUFFER'),
+ all_types: {
+ string:'hello',
+ number: 3145,
+ null: null,
+ object: {},
+ array: [],
+ boolean: true,
+ boolean2: false
+ },
+ foo: new Buffer('foo'),
+ foo2: new Buffer('foo2'),
+ escape: {
+ buffer: new Buffer('x'),
+ string: _JSON.stringify(new Buffer('x'))
+ },
+ escape2: {
+ buffer: new Buffer('x'),
+ string: ':base64:'+ new Buffer('x').toString('base64')
+ },
+ undefined: {
+ empty: undefined, test: true
+ },
+ undefined2: {
+ first: 1, empty: undefined, test: true
+ },
+ undefinedArray: {
+ array: [undefined, 1, 'two']
+ },
+ fn: {
+ fn: function () {}
+ },
+ undefined: undefined
+}
+
+for(k in examples)
+(function (value, k) {
+ test(k, function (t) {
+ var s = _JSON.stringify(value)
+ console.log('parse', s)
+ if(JSON.stringify(value) !== undefined) {
+ console.log(s)
+ var _value = _JSON.parse(s)
+ t.deepEqual(clone(_value), clone(value))
+ }
+ else
+ t.equal(s, undefined)
+ t.end()
+ })
+})(examples[k], k)
+
+
+
diff --git a/includes/translator/node_modules/keyv/LICENSE b/includes/translator/node_modules/keyv/LICENSE
new file mode 100644
index 0000000..f27ee9b
--- /dev/null
+++ b/includes/translator/node_modules/keyv/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Luke Childs
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/includes/translator/node_modules/keyv/README.md b/includes/translator/node_modules/keyv/README.md
new file mode 100644
index 0000000..2a9287c
--- /dev/null
+++ b/includes/translator/node_modules/keyv/README.md
@@ -0,0 +1,276 @@
+<h1 align="center">
+ <img width="250" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">
+ <br>
+ <br>
+</h1>
+
+> Simple key-value storage with support for multiple backends
+
+[![Build Status](https://travis-ci.org/lukechilds/keyv.svg?branch=master)](https://travis-ci.org/lukechilds/keyv)
+[![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv?branch=master)
+[![npm](https://img.shields.io/npm/dm/keyv.svg)](https://www.npmjs.com/package/keyv)
+[![npm](https://img.shields.io/npm/v/keyv.svg)](https://www.npmjs.com/package/keyv)
+
+Keyv provides a consistent interface for key-value storage across multiple backends via storage adapters. It supports TTL based expiry, making it suitable as a cache or a persistent key-value store.
+
+## Features
+
+There are a few existing modules similar to Keyv, however Keyv is different because it:
+
+- Isn't bloated
+- Has a simple Promise based API
+- Suitable as a TTL based cache or persistent key-value store
+- [Easily embeddable](#add-cache-support-to-your-module) inside another module
+- Works with any storage that implements the [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) API
+- Handles all JSON types plus `Buffer`
+- Supports namespaces
+- Wide range of [**efficient, well tested**](#official-storage-adapters) storage adapters
+- Connection errors are passed through (db failures won't kill your app)
+- Supports the current active LTS version of Node.js or higher
+
+## Usage
+
+Install Keyv.
+
+```
+npm install --save keyv
+```
+
+By default everything is stored in memory, you can optionally also install a storage adapter.
+
+```
+npm install --save @keyv/redis
+npm install --save @keyv/mongo
+npm install --save @keyv/sqlite
+npm install --save @keyv/postgres
+npm install --save @keyv/mysql
+```
+
+Create a new Keyv instance, passing your connection string if applicable. Keyv will automatically load the correct storage adapter.
+
+```js
+const Keyv = require('keyv');
+
+// One of the following
+const keyv = new Keyv();
+const keyv = new Keyv('redis://user:pass@localhost:6379');
+const keyv = new Keyv('mongodb://user:pass@localhost:27017/dbname');
+const keyv = new Keyv('sqlite://path/to/database.sqlite');
+const keyv = new Keyv('postgresql://user:pass@localhost:5432/dbname');
+const keyv = new Keyv('mysql://user:pass@localhost:3306/dbname');
+
+// Handle DB connection errors
+keyv.on('error', err => console.log('Connection Error', err));
+
+await keyv.set('foo', 'expires in 1 second', 1000); // true
+await keyv.set('foo', 'never expires'); // true
+await keyv.get('foo'); // 'never expires'
+await keyv.delete('foo'); // true
+await keyv.clear(); // undefined
+```
+
+### Namespaces
+
+You can namespace your Keyv instance to avoid key collisions and allow you to clear only a certain namespace while using the same database.
+
+```js
+const users = new Keyv('redis://user:pass@localhost:6379', { namespace: 'users' });
+const cache = new Keyv('redis://user:pass@localhost:6379', { namespace: 'cache' });
+
+await users.set('foo', 'users'); // true
+await cache.set('foo', 'cache'); // true
+await users.get('foo'); // 'users'
+await cache.get('foo'); // 'cache'
+await users.clear(); // undefined
+await users.get('foo'); // undefined
+await cache.get('foo'); // 'cache'
+```
+
+### Custom Serializers
+
+Keyv uses [`json-buffer`](https://github.com/dominictarr/json-buffer) for data serialization to ensure consistency across different backends.
+
+You can optionally provide your own serialization functions to support extra data types or to serialize to something other than JSON.
+
+```js
+const keyv = new Keyv({ serialize: JSON.stringify, deserialize: JSON.parse });
+```
+
+**Warning:** Using custom serializers means you lose any guarantee of data consistency. You should do extensive testing with your serialisation functions and chosen storage engine.
+
+## Official Storage Adapters
+
+The official storage adapters are covered by [over 150 integration tests](https://travis-ci.org/lukechilds/keyv/jobs/260418145) to guarantee consistent behaviour. They are lightweight, efficient wrappers over the DB clients making use of indexes and native TTLs where available.
+
+Database | Adapter | Native TTL | Status
+---|---|---|---
+Redis | [@keyv/redis](https://github.com/lukechilds/keyv-redis) | Yes | [![Build Status](https://travis-ci.org/lukechilds/keyv-redis.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-redis) [![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-redis/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-redis?branch=master)
+MongoDB | [@keyv/mongo](https://github.com/lukechilds/keyv-mongo) | Yes | [![Build Status](https://travis-ci.org/lukechilds/keyv-mongo.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-mongo) [![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-mongo/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-mongo?branch=master)
+SQLite | [@keyv/sqlite](https://github.com/lukechilds/keyv-sqlite) | No | [![Build Status](https://travis-ci.org/lukechilds/keyv-sqlite.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-sqlite) [![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-sqlite/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-sqlite?branch=master)
+PostgreSQL | [@keyv/postgres](https://github.com/lukechilds/keyv-postgres) | No | [![Build Status](https://travis-ci.org/lukechilds/keyv-postgres.svg?branch=master)](https://travis-ci.org/lukechildskeyv-postgreskeyv) [![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-postgres/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-postgres?branch=master)
+MySQL | [@keyv/mysql](https://github.com/lukechilds/keyv-mysql) | No | [![Build Status](https://travis-ci.org/lukechilds/keyv-mysql.svg?branch=master)](https://travis-ci.org/lukechilds/keyv-mysql) [![Coverage Status](https://coveralls.io/repos/github/lukechilds/keyv-mysql/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/keyv-mysql?branch=master)
+
+## Third-party Storage Adapters
+
+You can also use third-party storage adapters or build your own. Keyv will wrap these storage adapters in TTL functionality and handle complex types internally.
+
+```js
+const Keyv = require('keyv');
+const myAdapter = require('./my-storage-adapter');
+
+const keyv = new Keyv({ store: myAdapter });
+```
+
+Any store that follows the [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) api will work.
+
+```js
+new Keyv({ store: new Map() });
+```
+
+For example, [`quick-lru`](https://github.com/sindresorhus/quick-lru) is a completely unrelated module that implements the Map API.
+
+```js
+const Keyv = require('keyv');
+const QuickLRU = require('quick-lru');
+
+const lru = new QuickLRU({ maxSize: 1000 });
+const keyv = new Keyv({ store: lru });
+```
+
+The following are third-party storage adapters compatible with Keyv:
+
+- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple "Least Recently Used" (LRU) cache
+- [keyv-file](https://github.com/zaaack/keyv-file) - File system storage adapter for Keyv
+- [keyv-dynamodb](https://www.npmjs.com/package/keyv-dynamodb) - DynamoDB storage adapter for Keyv
+
+## Add Cache Support to your Module
+
+Keyv is designed to be easily embedded into other modules to add cache support. The recommended pattern is to expose a `cache` option in your modules options which is passed through to Keyv. Caching will work in memory by default and users have the option to also install a Keyv storage adapter and pass in a connection string, or any other storage that implements the `Map` API.
+
+You should also set a namespace for your module so you can safely call `.clear()` without clearing unrelated app data.
+
+Inside your module:
+
+```js
+class AwesomeModule {
+ constructor(opts) {
+ this.cache = new Keyv({
+ uri: typeof opts.cache === 'string' && opts.cache,
+ store: typeof opts.cache !== 'string' && opts.cache,
+ namespace: 'awesome-module'
+ });
+ }
+}
+```
+
+Now it can be consumed like this:
+
+```js
+const AwesomeModule = require('awesome-module');
+
+// Caches stuff in memory by default
+const awesomeModule = new AwesomeModule();
+
+// After npm install --save keyv-redis
+const awesomeModule = new AwesomeModule({ cache: 'redis://localhost' });
+
+// Some third-party module that implements the Map API
+const awesomeModule = new AwesomeModule({ cache: some3rdPartyStore });
+```
+
+## API
+
+### new Keyv([uri], [options])
+
+Returns a new Keyv instance.
+
+The Keyv instance is also an `EventEmitter` that will emit an `'error'` event if the storage adapter connection fails.
+
+### uri
+
+Type: `String`<br>
+Default: `undefined`
+
+The connection string URI.
+
+Merged into the options object as options.uri.
+
+### options
+
+Type: `Object`
+
+The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options.
+
+#### options.namespace
+
+Type: `String`<br>
+Default: `'keyv'`
+
+Namespace for the current instance.
+
+#### options.ttl
+
+Type: `Number`<br>
+Default: `undefined`
+
+Default TTL. Can be overridden by specififying a TTL on `.set()`.
+
+#### options.serialize
+
+Type: `Function`<br>
+Default: `JSONB.stringify`
+
+A custom serialization function.
+
+#### options.deserialize
+
+Type: `Function`<br>
+Default: `JSONB.parse`
+
+A custom deserialization function.
+
+#### options.store
+
+Type: `Storage adapter instance`<br>
+Default: `new Map()`
+
+The storage adapter instance to be used by Keyv.
+
+#### options.adapter
+
+Type: `String`<br>
+Default: `undefined`
+
+Specify an adapter to use. e.g `'redis'` or `'mongodb'`.
+
+### Instance
+
+Keys must always be strings. Values can be of any type.
+
+#### .set(key, value, [ttl])
+
+Set a value.
+
+By default keys are persistent. You can set an expiry TTL in milliseconds.
+
+Returns `true`.
+
+#### .get(key)
+
+Returns the value.
+
+#### .delete(key)
+
+Deletes an entry.
+
+Returns `true` if the key existed, `false` if not.
+
+#### .clear()
+
+Delete all entries in the current namespace.
+
+Returns `undefined`.
+
+## License
+
+MIT © Luke Childs
diff --git a/includes/translator/node_modules/keyv/package.json b/includes/translator/node_modules/keyv/package.json
new file mode 100644
index 0000000..00a5531
--- /dev/null
+++ b/includes/translator/node_modules/keyv/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "keyv",
+ "version": "3.1.0",
+ "description": "Simple key-value storage with support for multiple backends",
+ "main": "src/index.js",
+ "scripts": {
+ "test": "xo && nyc ava test/keyv.js",
+ "test:full": "xo && nyc ava --serial",
+ "coverage": "nyc report --reporter=text-lcov | coveralls"
+ },
+ "xo": {
+ "extends": "xo-lukechilds"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/lukechilds/keyv.git"
+ },
+ "keywords": [
+ "key",
+ "value",
+ "store",
+ "cache",
+ "ttl"
+ ],
+ "author": "Luke Childs <lukechilds123@gmail.com> (http://lukechilds.co.uk)",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/lukechilds/keyv/issues"
+ },
+ "homepage": "https://github.com/lukechilds/keyv",
+ "dependencies": {
+ "json-buffer": "3.0.0"
+ },
+ "devDependencies": {
+ "ava": "^0.25.0",
+ "coveralls": "^3.0.0",
+ "eslint-config-xo-lukechilds": "^1.0.0",
+ "@keyv/mongo": "*",
+ "@keyv/mysql": "*",
+ "@keyv/postgres": "*",
+ "@keyv/redis": "*",
+ "@keyv/sqlite": "*",
+ "@keyv/test-suite": "*",
+ "nyc": "^11.0.3",
+ "this": "^1.0.2",
+ "timekeeper": "^2.0.0",
+ "xo": "^0.20.1"
+ }
+}
diff --git a/includes/translator/node_modules/keyv/src/index.js b/includes/translator/node_modules/keyv/src/index.js
new file mode 100644
index 0000000..02af495
--- /dev/null
+++ b/includes/translator/node_modules/keyv/src/index.js
@@ -0,0 +1,103 @@
+'use strict';
+
+const EventEmitter = require('events');
+const JSONB = require('json-buffer');
+
+const loadStore = opts => {
+ const adapters = {
+ redis: '@keyv/redis',
+ mongodb: '@keyv/mongo',
+ mongo: '@keyv/mongo',
+ sqlite: '@keyv/sqlite',
+ postgresql: '@keyv/postgres',
+ postgres: '@keyv/postgres',
+ mysql: '@keyv/mysql'
+ };
+ if (opts.adapter || opts.uri) {
+ const adapter = opts.adapter || /^[^:]*/.exec(opts.uri)[0];
+ return new (require(adapters[adapter]))(opts);
+ }
+ return new Map();
+};
+
+class Keyv extends EventEmitter {
+ constructor(uri, opts) {
+ super();
+ this.opts = Object.assign(
+ {
+ namespace: 'keyv',
+ serialize: JSONB.stringify,
+ deserialize: JSONB.parse
+ },
+ (typeof uri === 'string') ? { uri } : uri,
+ opts
+ );
+
+ if (!this.opts.store) {
+ const adapterOpts = Object.assign({}, this.opts);
+ this.opts.store = loadStore(adapterOpts);
+ }
+
+ if (typeof this.opts.store.on === 'function') {
+ this.opts.store.on('error', err => this.emit('error', err));
+ }
+
+ this.opts.store.namespace = this.opts.namespace;
+ }
+
+ _getKeyPrefix(key) {
+ return `${this.opts.namespace}:${key}`;
+ }
+
+ get(key) {
+ key = this._getKeyPrefix(key);
+ const store = this.opts.store;
+ return Promise.resolve()
+ .then(() => store.get(key))
+ .then(data => {
+ data = (typeof data === 'string') ? this.opts.deserialize(data) : data;
+ if (data === undefined) {
+ return undefined;
+ }
+ if (typeof data.expires === 'number' && Date.now() > data.expires) {
+ this.delete(key);
+ return undefined;
+ }
+ return data.value;
+ });
+ }
+
+ set(key, value, ttl) {
+ key = this._getKeyPrefix(key);
+ if (typeof ttl === 'undefined') {
+ ttl = this.opts.ttl;
+ }
+ if (ttl === 0) {
+ ttl = undefined;
+ }
+ const store = this.opts.store;
+
+ return Promise.resolve()
+ .then(() => {
+ const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null;
+ value = { value, expires };
+ return store.set(key, this.opts.serialize(value), ttl);
+ })
+ .then(() => true);
+ }
+
+ delete(key) {
+ key = this._getKeyPrefix(key);
+ const store = this.opts.store;
+ return Promise.resolve()
+ .then(() => store.delete(key));
+ }
+
+ clear() {
+ const store = this.opts.store;
+ return Promise.resolve()
+ .then(() => store.clear());
+ }
+}
+
+module.exports = Keyv;
diff --git a/includes/translator/node_modules/lowercase-keys/index.js b/includes/translator/node_modules/lowercase-keys/index.js
new file mode 100644
index 0000000..b8d8898
--- /dev/null
+++ b/includes/translator/node_modules/lowercase-keys/index.js
@@ -0,0 +1,11 @@
+'use strict';
+module.exports = function (obj) {
+ var ret = {};
+ var keys = Object.keys(Object(obj));
+
+ for (var i = 0; i < keys.length; i++) {
+ ret[keys[i].toLowerCase()] = obj[keys[i]];
+ }
+
+ return ret;
+};
diff --git a/includes/translator/node_modules/lowercase-keys/license b/includes/translator/node_modules/lowercase-keys/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/includes/translator/node_modules/lowercase-keys/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/includes/translator/node_modules/lowercase-keys/package.json b/includes/translator/node_modules/lowercase-keys/package.json
new file mode 100644
index 0000000..188af70
--- /dev/null
+++ b/includes/translator/node_modules/lowercase-keys/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "lowercase-keys",
+ "version": "1.0.1",
+ "description": "Lowercase the keys of an object",
+ "license": "MIT",
+ "repository": "sindresorhus/lowercase-keys",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "object",
+ "assign",
+ "extend",
+ "properties",
+ "lowercase",
+ "lower-case",
+ "case",
+ "keys",
+ "key"
+ ],
+ "devDependencies": {
+ "ava": "*"
+ }
+}
diff --git a/includes/translator/node_modules/lowercase-keys/readme.md b/includes/translator/node_modules/lowercase-keys/readme.md
new file mode 100644
index 0000000..dc65770
--- /dev/null
+++ b/includes/translator/node_modules/lowercase-keys/readme.md
@@ -0,0 +1,33 @@
+# lowercase-keys [![Build Status](https://travis-ci.org/sindresorhus/lowercase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/lowercase-keys)
+
+> Lowercase the keys of an object
+
+
+## Install
+
+```
+$ npm install --save lowercase-keys
+```
+
+
+## Usage
+
+```js
+var lowercaseKeys = require('lowercase-keys');
+
+lowercaseKeys({FOO: true, bAr: false});
+//=> {foo: true, bar: false}
+```
+
+
+## API
+
+### lowercaseKeys(object)
+
+Lowercases the keys and returns a new object.
+
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/includes/translator/node_modules/make-dir/index.js b/includes/translator/node_modules/make-dir/index.js
new file mode 100644
index 0000000..1843955
--- /dev/null
+++ b/includes/translator/node_modules/make-dir/index.js
@@ -0,0 +1,85 @@
+'use strict';
+const fs = require('fs');
+const path = require('path');
+const pify = require('pify');
+
+const defaults = {
+ mode: 0o777 & (~process.umask()),
+ fs
+};
+
+// https://github.com/nodejs/node/issues/8987
+// https://github.com/libuv/libuv/pull/1088
+const checkPath = pth => {
+ if (process.platform === 'win32') {
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''));
+
+ if (pathHasInvalidWinCharacters) {
+ const err = new Error(`Path contains invalid characters: ${pth}`);
+ err.code = 'EINVAL';
+ throw err;
+ }
+ }
+};
+
+module.exports = (input, opts) => Promise.resolve().then(() => {
+ checkPath(input);
+ opts = Object.assign({}, defaults, opts);
+
+ const mkdir = pify(opts.fs.mkdir);
+ const stat = pify(opts.fs.stat);
+
+ const make = pth => {
+ return mkdir(pth, opts.mode)
+ .then(() => pth)
+ .catch(err => {
+ if (err.code === 'ENOENT') {
+ if (err.message.includes('null bytes') || path.dirname(pth) === pth) {
+ throw err;
+ }
+
+ return make(path.dirname(pth)).then(() => make(pth));
+ }
+
+ return stat(pth)
+ .then(stats => stats.isDirectory() ? pth : Promise.reject())
+ .catch(() => {
+ throw err;
+ });
+ });
+ };
+
+ return make(path.resolve(input));
+});
+
+module.exports.sync = (input, opts) => {
+ checkPath(input);
+ opts = Object.assign({}, defaults, opts);
+
+ const make = pth => {
+ try {
+ opts.fs.mkdirSync(pth, opts.mode);
+ } catch (err) {
+ if (err.code === 'ENOENT') {
+ if (err.message.includes('null bytes') || path.dirname(pth) === pth) {
+ throw err;
+ }
+
+ make(path.dirname(pth));
+ return make(pth);
+ }
+
+ try {
+ if (!opts.fs.statSync(pth).isDirectory()) {
+ throw new Error('The path is not a directory');
+ }
+ } catch (_) {
+ throw err;
+ }
+ }
+
+ return pth;
+ };
+
+ return make(path.resolve(input));
+};
diff --git a/includes/translator/node_modules/make-dir/license b/includes/translator/node_modules/make-dir/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/make-dir/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/make-dir/package.json b/includes/translator/node_modules/make-dir/package.json
new file mode 100644
index 0000000..ec907a7
--- /dev/null
+++ b/includes/translator/node_modules/make-dir/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "make-dir",
+ "version": "1.3.0",
+ "description": "Make a directory and its parents if needed - Think `mkdir -p`",
+ "license": "MIT",
+ "repository": "sindresorhus/make-dir",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && nyc ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "mkdir",
+ "mkdirp",
+ "make",
+ "directories",
+ "dir",
+ "dirs",
+ "folders",
+ "directory",
+ "folder",
+ "path",
+ "parent",
+ "parents",
+ "intermediate",
+ "recursively",
+ "recursive",
+ "create",
+ "fs",
+ "filesystem",
+ "file-system"
+ ],
+ "dependencies": {
+ "pify": "^3.0.0"
+ },
+ "devDependencies": {
+ "ava": "*",
+ "codecov": "^3.0.0",
+ "graceful-fs": "^4.1.11",
+ "nyc": "^11.3.0",
+ "path-type": "^3.0.0",
+ "tempy": "^0.2.1",
+ "xo": "^0.20.0"
+ }
+}
diff --git a/includes/translator/node_modules/make-dir/readme.md b/includes/translator/node_modules/make-dir/readme.md
new file mode 100644
index 0000000..8a32bf4
--- /dev/null
+++ b/includes/translator/node_modules/make-dir/readme.md
@@ -0,0 +1,116 @@
+# make-dir [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/e0vtt8y600w91gcs/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/make-dir/branch/master) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir)
+
+> Make a directory and its parents if needed - Think `mkdir -p`
+
+
+## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp)
+
+- Promise API *(Async/await ready!)*
+- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66)
+- 100% test coverage
+- CI-tested on macOS, Linux, and Windows
+- Actively maintained
+- Doesn't bundle a CLI
+
+
+## Install
+
+```
+$ npm install make-dir
+```
+
+
+## Usage
+
+```
+$ pwd
+/Users/sindresorhus/fun
+$ tree
+.
+```
+
+```js
+const makeDir = require('make-dir');
+
+makeDir('unicorn/rainbow/cake').then(path => {
+ console.log(path);
+ //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake'
+});
+```
+
+```
+$ tree
+.
+└── unicorn
+ └── rainbow
+ └── cake
+```
+
+Multiple directories:
+
+```js
+const makeDir = require('make-dir');
+
+Promise.all([
+ makeDir('unicorn/rainbow')
+ makeDir('foo/bar')
+]).then(paths => {
+ console.log(paths);
+ /*
+ [
+ '/Users/sindresorhus/fun/unicorn/rainbow',
+ '/Users/sindresorhus/fun/foo/bar'
+ ]
+ */
+});
+```
+
+
+## API
+
+### makeDir(path, [options])
+
+Returns a `Promise` for the path to the created directory.
+
+### makeDir.sync(path, [options])
+
+Returns the path to the created directory.
+
+#### path
+
+Type: `string`
+
+Directory to create.
+
+#### options
+
+Type: `Object`
+
+##### mode
+
+Type: `integer`<br>
+Default: `0o777 & (~process.umask())`
+
+Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
+
+##### fs
+
+Type: `Object`<br>
+Default: `require('fs')`
+
+Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
+
+
+## Related
+
+- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module
+- [del](https://github.com/sindresorhus/del) - Delete files and directories
+- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching
+- [cpy](https://github.com/sindresorhus/cpy) - Copy files
+- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line
+- [move-file](https://github.com/sindresorhus/move-file) - Move a file
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/mimic-response/index.js b/includes/translator/node_modules/mimic-response/index.js
new file mode 100644
index 0000000..d5e33be
--- /dev/null
+++ b/includes/translator/node_modules/mimic-response/index.js
@@ -0,0 +1,32 @@
+'use strict';
+
+// We define these manually to ensure they're always copied
+// even if they would move up the prototype chain
+// https://nodejs.org/api/http.html#http_class_http_incomingmessage
+const knownProps = [
+ 'destroy',
+ 'setTimeout',
+ 'socket',
+ 'headers',
+ 'trailers',
+ 'rawHeaders',
+ 'statusCode',
+ 'httpVersion',
+ 'httpVersionMinor',
+ 'httpVersionMajor',
+ 'rawTrailers',
+ 'statusMessage'
+];
+
+module.exports = (fromStream, toStream) => {
+ const fromProps = new Set(Object.keys(fromStream).concat(knownProps));
+
+ for (const prop of fromProps) {
+ // Don't overwrite existing properties
+ if (prop in toStream) {
+ continue;
+ }
+
+ toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop];
+ }
+};
diff --git a/includes/translator/node_modules/mimic-response/license b/includes/translator/node_modules/mimic-response/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/mimic-response/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/mimic-response/package.json b/includes/translator/node_modules/mimic-response/package.json
new file mode 100644
index 0000000..689cb61
--- /dev/null
+++ b/includes/translator/node_modules/mimic-response/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "mimic-response",
+ "version": "1.0.1",
+ "description": "Mimic a Node.js HTTP response stream",
+ "license": "MIT",
+ "repository": "sindresorhus/mimic-response",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "mimic",
+ "response",
+ "stream",
+ "http",
+ "https",
+ "request",
+ "get",
+ "core"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "create-test-server": "^0.1.0",
+ "pify": "^3.0.0",
+ "xo": "*"
+ }
+}
diff --git a/includes/translator/node_modules/mimic-response/readme.md b/includes/translator/node_modules/mimic-response/readme.md
new file mode 100644
index 0000000..e07ec66
--- /dev/null
+++ b/includes/translator/node_modules/mimic-response/readme.md
@@ -0,0 +1,54 @@
+# mimic-response [![Build Status](https://travis-ci.org/sindresorhus/mimic-response.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-response)
+
+> Mimic a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
+
+
+## Install
+
+```
+$ npm install mimic-response
+```
+
+
+## Usage
+
+```js
+const stream = require('stream');
+const mimicResponse = require('mimic-response');
+
+const responseStream = getHttpResponseStream();
+const myStream = new stream.PassThrough();
+
+mimicResponse(responseStream, myStream);
+
+console.log(myStream.statusCode);
+//=> 200
+```
+
+
+## API
+
+### mimicResponse(from, to)
+
+#### from
+
+Type: `Stream`
+
+[Node.js HTTP response stream.](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
+
+#### to
+
+Type: `Stream`
+
+Any stream.
+
+
+## Related
+
+- [mimic-fn](https://github.com/sindresorhus/mimic-fn) - Make a function mimic another one
+- [clone-response](https://github.com/lukechilds/clone-response) - Clone a Node.js response stream
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/normalize-url/index.d.ts b/includes/translator/node_modules/normalize-url/index.d.ts
new file mode 100644
index 0000000..7e332f2
--- /dev/null
+++ b/includes/translator/node_modules/normalize-url/index.d.ts
@@ -0,0 +1,216 @@
+declare namespace normalizeUrl {
+ interface Options {
+ /**
+ @default 'http:'
+ */
+ readonly defaultProtocol?: string;
+
+ /**
+ Prepends `defaultProtocol` to the URL if it's protocol-relative.
+
+ @default true
+
+ @example
+ ```
+ normalizeUrl('//sindresorhus.com:80/');
+ //=> 'http://sindresorhus.com'
+
+ normalizeUrl('//sindresorhus.com:80/', {normalizeProtocol: false});
+ //=> '//sindresorhus.com'
+ ```
+ */
+ readonly normalizeProtocol?: boolean;
+
+ /**
+ Normalizes `https:` URLs to `http:`.
+
+ @default false
+
+ @example
+ ```
+ normalizeUrl('https://sindresorhus.com:80/');
+ //=> 'https://sindresorhus.com'
+
+ normalizeUrl('https://sindresorhus.com:80/', {forceHttp: true});
+ //=> 'http://sindresorhus.com'
+ ```
+ */
+ readonly forceHttp?: boolean;
+
+ /**
+ Normalizes `http:` URLs to `https:`.
+
+ This option can't be used with the `forceHttp` option at the same time.
+
+ @default false
+
+ @example
+ ```
+ normalizeUrl('https://sindresorhus.com:80/');
+ //=> 'https://sindresorhus.com'
+
+ normalizeUrl('http://sindresorhus.com:80/', {forceHttps: true});
+ //=> 'https://sindresorhus.com'
+ ```
+ */
+ readonly forceHttps?: boolean;
+
+ /**
+ Strip the [authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) part of a URL.
+
+ @default true
+
+ @example
+ ```
+ normalizeUrl('user:password@sindresorhus.com');
+ //=> 'https://sindresorhus.com'
+
+ normalizeUrl('user:password@sindresorhus.com', {stripAuthentication: false});
+ //=> 'https://user:password@sindresorhus.com'
+ ```
+ */
+ readonly stripAuthentication?: boolean;
+
+ /**
+ Removes hash from the URL.
+
+ @default false
+
+ @example
+ ```
+ normalizeUrl('sindresorhus.com/about.html#contact');
+ //=> 'http://sindresorhus.com/about.html#contact'
+
+ normalizeUrl('sindresorhus.com/about.html#contact', {stripHash: true});
+ //=> 'http://sindresorhus.com/about.html'
+ ```
+ */
+ readonly stripHash?: boolean;
+
+ /**
+ Removes HTTP(S) protocol from an URL `http://sindresorhus.com` → `sindresorhus.com`.
+
+ @default false
+
+ @example
+ ```
+ normalizeUrl('https://sindresorhus.com');
+ //=> 'https://sindresorhus.com'
+
+ normalizeUrl('sindresorhus.com', {stripProtocol: true});
+ //=> 'sindresorhus.com'
+ ```
+ */
+ readonly stripProtocol?: boolean;
+
+ /**
+ Removes `www.` from the URL.
+
+ @default true
+
+ @example
+ ```
+ normalizeUrl('http://www.sindresorhus.com');
+ //=> 'http://sindresorhus.com'
+
+ normalizeUrl('http://www.sindresorhus.com', {stripWWW: false});
+ //=> 'http://www.sindresorhus.com'
+ ```
+ */
+ readonly stripWWW?: boolean;
+
+ /**
+ Removes query parameters that matches any of the provided strings or regexes.
+
+ @default [/^utm_\w+/i]
+
+ @example
+ ```
+ normalizeUrl('www.sindresorhus.com?foo=bar&ref=test_ref', {
+ removeQueryParameters: ['ref']
+ });
+ //=> 'http://sindresorhus.com/?foo=bar'
+ ```
+ */
+ readonly removeQueryParameters?: ReadonlyArray<RegExp | string>;
+
+ /**
+ Removes trailing slash.
+
+ __Note__: Trailing slash is always removed if the URL doesn't have a pathname.
+
+ @default true
+
+ @example
+ ```
+ normalizeUrl('http://sindresorhus.com/redirect/');
+ //=> 'http://sindresorhus.com/redirect'
+
+ normalizeUrl('http://sindresorhus.com/redirect/', {removeTrailingSlash: false});
+ //=> 'http://sindresorhus.com/redirect/'
+
+ normalizeUrl('http://sindresorhus.com/', {removeTrailingSlash: false});
+ //=> 'http://sindresorhus.com'
+ ```
+ */
+ readonly removeTrailingSlash?: boolean;
+
+ /**
+ Removes the default directory index file from path that matches any of the provided strings or regexes.
+ When `true`, the regex `/^index\.[a-z]+$/` is used.
+
+ @default false
+
+ @example
+ ```
+ normalizeUrl('www.sindresorhus.com/foo/default.php', {
+ removeDirectoryIndex: [/^default\.[a-z]+$/]
+ });
+ //=> 'http://sindresorhus.com/foo'
+ ```
+ */
+ readonly removeDirectoryIndex?: ReadonlyArray<RegExp | string>;
+
+ /**
+ Sorts the query parameters alphabetically by key.
+
+ @default true
+
+ @example
+ ```
+ normalizeUrl('www.sindresorhus.com?b=two&a=one&c=three', {
+ sortQueryParameters: false
+ });
+ //=> 'http://sindresorhus.com/?b=two&a=one&c=three'
+ ```
+ */
+ readonly sortQueryParameters?: boolean;
+ }
+}
+
+declare const normalizeUrl: {
+ /**
+ [Normalize](https://en.wikipedia.org/wiki/URL_normalization) a URL.
+
+ @param url - URL to normalize, including [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs).
+
+ @example
+ ```
+ import normalizeUrl = require('normalize-url');
+
+ normalizeUrl('sindresorhus.com');
+ //=> 'http://sindresorhus.com'
+
+ normalizeUrl('HTTP://xn--xample-hva.com:80/?b=bar&a=foo');
+ //=> 'http://êxample.com/?a=foo&b=bar'
+ ```
+ */
+ (url: string, options?: normalizeUrl.Options): string;
+
+ // TODO: Remove this for the next major release, refactor the whole definition to:
+ // declare function normalizeUrl(url: string, options?: normalizeUrl.Options): string;
+ // export = normalizeUrl;
+ default: typeof normalizeUrl;
+};
+
+export = normalizeUrl;
diff --git a/includes/translator/node_modules/normalize-url/index.js b/includes/translator/node_modules/normalize-url/index.js
new file mode 100644
index 0000000..2ab7f57
--- /dev/null
+++ b/includes/translator/node_modules/normalize-url/index.js
@@ -0,0 +1,221 @@
+'use strict';
+// TODO: Use the `URL` global when targeting Node.js 10
+const URLParser = typeof URL === 'undefined' ? require('url').URL : URL;
+
+// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
+const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain';
+const DATA_URL_DEFAULT_CHARSET = 'us-ascii';
+
+const testParameter = (name, filters) => {
+ return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name);
+};
+
+const normalizeDataURL = (urlString, {stripHash}) => {
+ const parts = urlString.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/);
+
+ if (!parts) {
+ throw new Error(`Invalid URL: ${urlString}`);
+ }
+
+ const mediaType = parts[1].split(';');
+ const body = parts[2];
+ const hash = stripHash ? '' : parts[3];
+
+ let base64 = false;
+
+ if (mediaType[mediaType.length - 1] === 'base64') {
+ mediaType.pop();
+ base64 = true;
+ }
+
+ // Lowercase MIME type
+ const mimeType = (mediaType.shift() || '').toLowerCase();
+ const attributes = mediaType
+ .map(attribute => {
+ let [key, value = ''] = attribute.split('=').map(string => string.trim());
+
+ // Lowercase `charset`
+ if (key === 'charset') {
+ value = value.toLowerCase();
+
+ if (value === DATA_URL_DEFAULT_CHARSET) {
+ return '';
+ }
+ }
+
+ return `${key}${value ? `=${value}` : ''}`;
+ })
+ .filter(Boolean);
+
+ const normalizedMediaType = [
+ ...attributes
+ ];
+
+ if (base64) {
+ normalizedMediaType.push('base64');
+ }
+
+ if (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) {
+ normalizedMediaType.unshift(mimeType);
+ }
+
+ return `data:${normalizedMediaType.join(';')},${base64 ? body.trim() : body}${hash ? `#${hash}` : ''}`;
+};
+
+const normalizeUrl = (urlString, options) => {
+ options = {
+ defaultProtocol: 'http:',
+ normalizeProtocol: true,
+ forceHttp: false,
+ forceHttps: false,
+ stripAuthentication: true,
+ stripHash: false,
+ stripWWW: true,
+ removeQueryParameters: [/^utm_\w+/i],
+ removeTrailingSlash: true,
+ removeDirectoryIndex: false,
+ sortQueryParameters: true,
+ ...options
+ };
+
+ // TODO: Remove this at some point in the future
+ if (Reflect.has(options, 'normalizeHttps')) {
+ throw new Error('options.normalizeHttps is renamed to options.forceHttp');
+ }
+
+ if (Reflect.has(options, 'normalizeHttp')) {
+ throw new Error('options.normalizeHttp is renamed to options.forceHttps');
+ }
+
+ if (Reflect.has(options, 'stripFragment')) {
+ throw new Error('options.stripFragment is renamed to options.stripHash');
+ }
+
+ urlString = urlString.trim();
+
+ // Data URL
+ if (/^data:/i.test(urlString)) {
+ return normalizeDataURL(urlString, options);
+ }
+
+ const hasRelativeProtocol = urlString.startsWith('//');
+ const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString);
+
+ // Prepend protocol
+ if (!isRelativeUrl) {
+ urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol);
+ }
+
+ const urlObj = new URLParser(urlString);
+
+ if (options.forceHttp && options.forceHttps) {
+ throw new Error('The `forceHttp` and `forceHttps` options cannot be used together');
+ }
+
+ if (options.forceHttp && urlObj.protocol === 'https:') {
+ urlObj.protocol = 'http:';
+ }
+
+ if (options.forceHttps && urlObj.protocol === 'http:') {
+ urlObj.protocol = 'https:';
+ }
+
+ // Remove auth
+ if (options.stripAuthentication) {
+ urlObj.username = '';
+ urlObj.password = '';
+ }
+
+ // Remove hash
+ if (options.stripHash) {
+ urlObj.hash = '';
+ }
+
+ // Remove duplicate slashes if not preceded by a protocol
+ if (urlObj.pathname) {
+ // TODO: Use the following instead when targeting Node.js 10
+ // `urlObj.pathname = urlObj.pathname.replace(/(?<!https?:)\/{2,}/g, '/');`
+ urlObj.pathname = urlObj.pathname.replace(/((?!:).|^)\/{2,}/g, (_, p1) => {
+ if (/^(?!\/)/g.test(p1)) {
+ return `${p1}/`;
+ }
+
+ return '/';
+ });
+ }
+
+ // Decode URI octets
+ if (urlObj.pathname) {
+ urlObj.pathname = decodeURI(urlObj.pathname);
+ }
+
+ // Remove directory index
+ if (options.removeDirectoryIndex === true) {
+ options.removeDirectoryIndex = [/^index\.[a-z]+$/];
+ }
+
+ if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) {
+ let pathComponents = urlObj.pathname.split('/');
+ const lastComponent = pathComponents[pathComponents.length - 1];
+
+ if (testParameter(lastComponent, options.removeDirectoryIndex)) {
+ pathComponents = pathComponents.slice(0, pathComponents.length - 1);
+ urlObj.pathname = pathComponents.slice(1).join('/') + '/';
+ }
+ }
+
+ if (urlObj.hostname) {
+ // Remove trailing dot
+ urlObj.hostname = urlObj.hostname.replace(/\.$/, '');
+
+ // Remove `www.`
+ if (options.stripWWW && /^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(urlObj.hostname)) {
+ // Each label should be max 63 at length (min: 2).
+ // The extension should be max 5 at length (min: 2).
+ // Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
+ urlObj.hostname = urlObj.hostname.replace(/^www\./, '');
+ }
+ }
+
+ // Remove query unwanted parameters
+ if (Array.isArray(options.removeQueryParameters)) {
+ for (const key of [...urlObj.searchParams.keys()]) {
+ if (testParameter(key, options.removeQueryParameters)) {
+ urlObj.searchParams.delete(key);
+ }
+ }
+ }
+
+ // Sort query parameters
+ if (options.sortQueryParameters) {
+ urlObj.searchParams.sort();
+ }
+
+ if (options.removeTrailingSlash) {
+ urlObj.pathname = urlObj.pathname.replace(/\/$/, '');
+ }
+
+ // Take advantage of many of the Node `url` normalizations
+ urlString = urlObj.toString();
+
+ // Remove ending `/`
+ if ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '') {
+ urlString = urlString.replace(/\/$/, '');
+ }
+
+ // Restore relative protocol, if applicable
+ if (hasRelativeProtocol && !options.normalizeProtocol) {
+ urlString = urlString.replace(/^http:\/\//, '//');
+ }
+
+ // Remove http/https
+ if (options.stripProtocol) {
+ urlString = urlString.replace(/^(?:https?:)?\/\//, '');
+ }
+
+ return urlString;
+};
+
+module.exports = normalizeUrl;
+// TODO: Remove this for the next major release
+module.exports.default = normalizeUrl;
diff --git a/includes/translator/node_modules/normalize-url/license b/includes/translator/node_modules/normalize-url/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/normalize-url/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/normalize-url/package.json b/includes/translator/node_modules/normalize-url/package.json
new file mode 100644
index 0000000..b0d59e0
--- /dev/null
+++ b/includes/translator/node_modules/normalize-url/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "normalize-url",
+ "version": "4.5.1",
+ "description": "Normalize a URL",
+ "license": "MIT",
+ "repository": "sindresorhus/normalize-url",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && nyc ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "normalize",
+ "url",
+ "uri",
+ "address",
+ "string",
+ "normalization",
+ "normalisation",
+ "query",
+ "querystring",
+ "simplify",
+ "strip",
+ "trim",
+ "canonical"
+ ],
+ "devDependencies": {
+ "ava": "^2.4.0",
+ "coveralls": "^3.0.6",
+ "nyc": "^14.1.1",
+ "tsd": "^0.8.0",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/includes/translator/node_modules/normalize-url/readme.md b/includes/translator/node_modules/normalize-url/readme.md
new file mode 100644
index 0000000..a851fdd
--- /dev/null
+++ b/includes/translator/node_modules/normalize-url/readme.md
@@ -0,0 +1,232 @@
+# normalize-url [![Build Status](https://travis-ci.org/sindresorhus/normalize-url.svg?branch=master)](https://travis-ci.org/sindresorhus/normalize-url) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/normalize-url/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/normalize-url?branch=master)
+
+> [Normalize](https://en.wikipedia.org/wiki/URL_normalization) a URL
+
+Useful when you need to display, store, deduplicate, sort, compare, etc, URLs.
+
+
+## Install
+
+```
+$ npm install normalize-url
+```
+
+
+## Usage
+
+```js
+const normalizeUrl = require('normalize-url');
+
+normalizeUrl('sindresorhus.com');
+//=> 'http://sindresorhus.com'
+
+normalizeUrl('HTTP://xn--xample-hva.com:80/?b=bar&a=foo');
+//=> 'http://êxample.com/?a=foo&b=bar'
+```
+
+
+## API
+
+### normalizeUrl(url, options?)
+
+#### url
+
+Type: `string`
+
+URL to normalize, including [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs).
+
+#### options
+
+Type: `object`
+
+##### defaultProtocol
+
+Type: `string`<br>
+Default: `http:`
+
+##### normalizeProtocol
+
+Type: `boolean`<br>
+Default: `true`
+
+Prepend `defaultProtocol` to the URL if it's protocol-relative.
+
+```js
+normalizeUrl('//sindresorhus.com:80/');
+//=> 'http://sindresorhus.com'
+
+normalizeUrl('//sindresorhus.com:80/', {normalizeProtocol: false});
+//=> '//sindresorhus.com'
+```
+
+##### forceHttp
+
+Type: `boolean`<br>
+Default: `false`
+
+Normalize `https:` to `http:`.
+
+```js
+normalizeUrl('https://sindresorhus.com:80/');
+//=> 'https://sindresorhus.com'
+
+normalizeUrl('https://sindresorhus.com:80/', {forceHttp: true});
+//=> 'http://sindresorhus.com'
+```
+
+##### forceHttps
+
+Type: `boolean`<br>
+Default: `false`
+
+Normalize `http:` to `https:`.
+
+```js
+normalizeUrl('https://sindresorhus.com:80/');
+//=> 'https://sindresorhus.com'
+
+normalizeUrl('http://sindresorhus.com:80/', {forceHttps: true});
+//=> 'https://sindresorhus.com'
+```
+
+This option can't be used with the `forceHttp` option at the same time.
+
+##### stripAuthentication
+
+Type: `boolean`<br>
+Default: `true`
+
+Strip the [authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) part of the URL.
+
+```js
+normalizeUrl('user:password@sindresorhus.com');
+//=> 'https://sindresorhus.com'
+
+normalizeUrl('user:password@sindresorhus.com', {stripAuthentication: false});
+//=> 'https://user:password@sindresorhus.com'
+```
+
+##### stripHash
+
+Type: `boolean`<br>
+Default: `false`
+
+Strip the hash part of the URL.
+
+```js
+normalizeUrl('sindresorhus.com/about.html#contact');
+//=> 'http://sindresorhus.com/about.html#contact'
+
+normalizeUrl('sindresorhus.com/about.html#contact', {stripHash: true});
+//=> 'http://sindresorhus.com/about.html'
+```
+
+##### stripProtocol
+
+Type: `boolean`<br>
+Default: `false`
+
+Remove HTTP(S) protocol from the URL: `http://sindresorhus.com` → `sindresorhus.com`.
+
+```js
+normalizeUrl('https://sindresorhus.com');
+//=> 'https://sindresorhus.com'
+
+normalizeUrl('sindresorhus.com', {stripProtocol: true});
+//=> 'sindresorhus.com'
+```
+
+##### stripWWW
+
+Type: `boolean`<br>
+Default: `true`
+
+Remove `www.` from the URL.
+
+```js
+normalizeUrl('http://www.sindresorhus.com');
+//=> 'http://sindresorhus.com'
+
+normalizeUrl('http://www.sindresorhus.com', {stripWWW: false});
+//=> 'http://www.sindresorhus.com'
+```
+
+##### removeQueryParameters
+
+Type: `Array<RegExp | string>`<br>
+Default: `[/^utm_\w+/i]`
+
+Remove query parameters that matches any of the provided strings or regexes.
+
+```js
+normalizeUrl('www.sindresorhus.com?foo=bar&ref=test_ref', {
+ removeQueryParameters: ['ref']
+});
+//=> 'http://sindresorhus.com/?foo=bar'
+```
+
+##### removeTrailingSlash
+
+Type: `boolean`<br>
+Default: `true`
+
+Remove trailing slash.
+
+**Note:** Trailing slash is always removed if the URL doesn't have a pathname.
+
+```js
+normalizeUrl('http://sindresorhus.com/redirect/');
+//=> 'http://sindresorhus.com/redirect'
+
+normalizeUrl('http://sindresorhus.com/redirect/', {removeTrailingSlash: false});
+//=> 'http://sindresorhus.com/redirect/'
+
+normalizeUrl('http://sindresorhus.com/', {removeTrailingSlash: false});
+//=> 'http://sindresorhus.com'
+```
+
+##### removeDirectoryIndex
+
+Type: `boolean | Array<RegExp | string>`<br>
+Default: `false`
+
+Removes the default directory index file from path that matches any of the provided strings or regexes. When `true`, the regex `/^index\.[a-z]+$/` is used.
+
+```js
+normalizeUrl('www.sindresorhus.com/foo/default.php', {
+ removeDirectoryIndex: [/^default\.[a-z]+$/]
+});
+//=> 'http://sindresorhus.com/foo'
+```
+
+##### sortQueryParameters
+
+Type: `boolean`<br>
+Default: `true`
+
+Sorts the query parameters alphabetically by key.
+
+```js
+normalizeUrl('www.sindresorhus.com?b=two&a=one&c=three', {
+ sortQueryParameters: false
+});
+//=> 'http://sindresorhus.com/?b=two&a=one&c=three'
+```
+
+
+## Related
+
+- [compare-urls](https://github.com/sindresorhus/compare-urls) - Compare URLs by first normalizing them
+
+
+---
+
+<div align="center">
+ <b>
+ <a href="https://tidelift.com/subscription/pkg/npm-normalize-url?utm_source=npm-normalize-url&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
+ </b>
+ <br>
+ <sub>
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
+ </sub>
+</div>
diff --git a/includes/translator/node_modules/once/LICENSE b/includes/translator/node_modules/once/LICENSE
new file mode 100644
index 0000000..19129e3
--- /dev/null
+++ b/includes/translator/node_modules/once/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/includes/translator/node_modules/once/README.md b/includes/translator/node_modules/once/README.md
new file mode 100644
index 0000000..1f1ffca
--- /dev/null
+++ b/includes/translator/node_modules/once/README.md
@@ -0,0 +1,79 @@
+# once
+
+Only call a function once.
+
+## usage
+
+```javascript
+var once = require('once')
+
+function load (file, cb) {
+ cb = once(cb)
+ loader.load('file')
+ loader.once('load', cb)
+ loader.once('error', cb)
+}
+```
+
+Or add to the Function.prototype in a responsible way:
+
+```javascript
+// only has to be done once
+require('once').proto()
+
+function load (file, cb) {
+ cb = cb.once()
+ loader.load('file')
+ loader.once('load', cb)
+ loader.once('error', cb)
+}
+```
+
+Ironically, the prototype feature makes this module twice as
+complicated as necessary.
+
+To check whether you function has been called, use `fn.called`. Once the
+function is called for the first time the return value of the original
+function is saved in `fn.value` and subsequent calls will continue to
+return this value.
+
+```javascript
+var once = require('once')
+
+function load (cb) {
+ cb = once(cb)
+ var stream = createStream()
+ stream.once('data', cb)
+ stream.once('end', function () {
+ if (!cb.called) cb(new Error('not found'))
+ })
+}
+```
+
+## `once.strict(func)`
+
+Throw an error if the function is called twice.
+
+Some functions are expected to be called only once. Using `once` for them would
+potentially hide logical errors.
+
+In the example below, the `greet` function has to call the callback only once:
+
+```javascript
+function greet (name, cb) {
+ // return is missing from the if statement
+ // when no name is passed, the callback is called twice
+ if (!name) cb('Hello anonymous')
+ cb('Hello ' + name)
+}
+
+function log (msg) {
+ console.log(msg)
+}
+
+// this will print 'Hello anonymous' but the logical error will be missed
+greet(null, once(msg))
+
+// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time
+greet(null, once.strict(msg))
+```
diff --git a/includes/translator/node_modules/once/once.js b/includes/translator/node_modules/once/once.js
new file mode 100644
index 0000000..2354067
--- /dev/null
+++ b/includes/translator/node_modules/once/once.js
@@ -0,0 +1,42 @@
+var wrappy = require('wrappy')
+module.exports = wrappy(once)
+module.exports.strict = wrappy(onceStrict)
+
+once.proto = once(function () {
+ Object.defineProperty(Function.prototype, 'once', {
+ value: function () {
+ return once(this)
+ },
+ configurable: true
+ })
+
+ Object.defineProperty(Function.prototype, 'onceStrict', {
+ value: function () {
+ return onceStrict(this)
+ },
+ configurable: true
+ })
+})
+
+function once (fn) {
+ var f = function () {
+ if (f.called) return f.value
+ f.called = true
+ return f.value = fn.apply(this, arguments)
+ }
+ f.called = false
+ return f
+}
+
+function onceStrict (fn) {
+ var f = function () {
+ if (f.called)
+ throw new Error(f.onceError)
+ f.called = true
+ return f.value = fn.apply(this, arguments)
+ }
+ var name = fn.name || 'Function wrapped with `once`'
+ f.onceError = name + " shouldn't be called more than once"
+ f.called = false
+ return f
+}
diff --git a/includes/translator/node_modules/once/package.json b/includes/translator/node_modules/once/package.json
new file mode 100644
index 0000000..16815b2
--- /dev/null
+++ b/includes/translator/node_modules/once/package.json
@@ -0,0 +1,33 @@
+{
+ "name": "once",
+ "version": "1.4.0",
+ "description": "Run a function exactly one time",
+ "main": "once.js",
+ "directories": {
+ "test": "test"
+ },
+ "dependencies": {
+ "wrappy": "1"
+ },
+ "devDependencies": {
+ "tap": "^7.0.1"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "files": [
+ "once.js"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/once"
+ },
+ "keywords": [
+ "once",
+ "function",
+ "one",
+ "single"
+ ],
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
+ "license": "ISC"
+}
diff --git a/includes/translator/node_modules/p-cancelable/index.d.ts b/includes/translator/node_modules/p-cancelable/index.d.ts
new file mode 100644
index 0000000..316d636
--- /dev/null
+++ b/includes/translator/node_modules/p-cancelable/index.d.ts
@@ -0,0 +1,168 @@
+/**
+ * Accepts a function that is called when the promise is canceled.
+ *
+ * You're not required to call this function. You can call this function multiple times to add multiple cancel handlers.
+ */
+export interface OnCancelFunction {
+ (cancelHandler: () => void): void;
+ shouldReject: boolean;
+}
+
+declare class PCancelable<ValueType> extends Promise<ValueType> {
+ /**
+ * Convenience method to make your promise-returning or async function cancelable.
+ *
+ * @param fn - A promise-returning function. The function you specify will have `onCancel` appended to its parameters.
+ *
+ * @example
+ *
+ * import PCancelable from 'p-cancelable';
+ *
+ * const fn = PCancelable.fn((input, onCancel) => {
+ * const job = new Job();
+ *
+ * onCancel(() => {
+ * job.cleanup();
+ * });
+ *
+ * return job.start(); //=> Promise
+ * });
+ *
+ * const cancelablePromise = fn('input'); //=> PCancelable
+ *
+ * // …
+ *
+ * cancelablePromise.cancel();
+ */
+ static fn<ReturnType>(
+ userFn: (onCancel: OnCancelFunction) => PromiseLike<ReturnType>
+ ): () => PCancelable<ReturnType>;
+ static fn<Agument1Type, ReturnType>(
+ userFn: (
+ argument1: Agument1Type,
+ onCancel: OnCancelFunction
+ ) => PromiseLike<ReturnType>
+ ): (argument1: Agument1Type) => PCancelable<ReturnType>;
+ static fn<Agument1Type, Agument2Type, ReturnType>(
+ userFn: (
+ argument1: Agument1Type,
+ argument2: Agument2Type,
+ onCancel: OnCancelFunction
+ ) => PromiseLike<ReturnType>
+ ): (
+ argument1: Agument1Type,
+ argument2: Agument2Type
+ ) => PCancelable<ReturnType>;
+ static fn<Agument1Type, Agument2Type, Agument3Type, ReturnType>(
+ userFn: (
+ argument1: Agument1Type,
+ argument2: Agument2Type,
+ argument3: Agument3Type,
+ onCancel: OnCancelFunction
+ ) => PromiseLike<ReturnType>
+ ): (
+ argument1: Agument1Type,
+ argument2: Agument2Type,
+ argument3: Agument3Type
+ ) => PCancelable<ReturnType>;
+ static fn<Agument1Type, Agument2Type, Agument3Type, Agument4Type, ReturnType>(
+ userFn: (
+ argument1: Agument1Type,
+ argument2: Agument2Type,
+ argument3: Agument3Type,
+ argument4: Agument4Type,
+ onCancel: OnCancelFunction
+ ) => PromiseLike<ReturnType>
+ ): (
+ argument1: Agument1Type,
+ argument2: Agument2Type,
+ argument3: Agument3Type,
+ argument4: Agument4Type
+ ) => PCancelable<ReturnType>;
+ static fn<
+ Agument1Type,
+ Agument2Type,
+ Agument3Type,
+ Agument4Type,
+ Agument5Type,
+ ReturnType
+ >(
+ userFn: (
+ argument1: Agument1Type,
+ argument2: Agument2Type,
+ argument3: Agument3Type,
+ argument4: Agument4Type,
+ argument5: Agument5Type,
+ onCancel: OnCancelFunction
+ ) => PromiseLike<ReturnType>
+ ): (
+ argument1: Agument1Type,
+ argument2: Agument2Type,
+ argument3: Agument3Type,
+ argument4: Agument4Type,
+ argument5: Agument5Type
+ ) => PCancelable<ReturnType>;
+ static fn<ReturnType>(
+ userFn: (...arguments: unknown[]) => PromiseLike<ReturnType>
+ ): (...arguments: unknown[]) => PCancelable<ReturnType>;
+
+ /**
+ * Create a promise that can be canceled.
+ *
+ * Can be constructed in the same was as a [`Promise` constructor](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise), but with an appended `onCancel` parameter in `executor`. `PCancelable` is a subclass of `Promise`.
+ *
+ * Cancelling will reject the promise with `CancelError`. To avoid that, set `onCancel.shouldReject` to `false`.
+ *
+ * @example
+ *
+ * import PCancelable from 'p-cancelable';
+ *
+ * const cancelablePromise = new PCancelable((resolve, reject, onCancel) => {
+ * const job = new Job();
+ *
+ * onCancel.shouldReject = false;
+ * onCancel(() => {
+ * job.stop();
+ * });
+ *
+ * job.on('finish', resolve);
+ * });
+ *
+ * cancelablePromise.cancel(); // Doesn't throw an error
+ */
+ constructor(
+ executor: (
+ resolve: (value?: ValueType | PromiseLike<ValueType>) => void,
+ reject: (reason?: unknown) => void,
+ onCancel: OnCancelFunction
+ ) => void
+ );
+
+ /**
+ * Whether the promise is canceled.
+ */
+ readonly isCanceled: boolean;
+
+ /**
+ * Cancel the promise and optionally provide a reason.
+ *
+ * The cancellation is synchronous. Calling it after the promise has settled or multiple times does nothing.
+ *
+ * @param reason - The cancellation reason to reject the promise with.
+ */
+ cancel(reason?: string): void;
+}
+
+export default PCancelable;
+
+/**
+ * Rejection reason when `.cancel()` is called.
+ *
+ * It includes a `.isCanceled` property for convenience.
+ */
+export class CancelError extends Error {
+ readonly name: 'CancelError';
+ readonly isCanceled: true;
+
+ constructor(reason?: string);
+}
diff --git a/includes/translator/node_modules/p-cancelable/index.js b/includes/translator/node_modules/p-cancelable/index.js
new file mode 100644
index 0000000..26bd42e
--- /dev/null
+++ b/includes/translator/node_modules/p-cancelable/index.js
@@ -0,0 +1,103 @@
+'use strict';
+
+class CancelError extends Error {
+ constructor(reason) {
+ super(reason || 'Promise was canceled');
+ this.name = 'CancelError';
+ }
+
+ get isCanceled() {
+ return true;
+ }
+}
+
+class PCancelable {
+ static fn(userFn) {
+ return (...args) => {
+ return new PCancelable((resolve, reject, onCancel) => {
+ args.push(onCancel);
+ userFn(...args).then(resolve, reject);
+ });
+ };
+ }
+
+ constructor(executor) {
+ this._cancelHandlers = [];
+ this._isPending = true;
+ this._isCanceled = false;
+ this._rejectOnCancel = true;
+
+ this._promise = new Promise((resolve, reject) => {
+ this._reject = reject;
+
+ const onResolve = value => {
+ this._isPending = false;
+ resolve(value);
+ };
+
+ const onReject = error => {
+ this._isPending = false;
+ reject(error);
+ };
+
+ const onCancel = handler => {
+ this._cancelHandlers.push(handler);
+ };
+
+ Object.defineProperties(onCancel, {
+ shouldReject: {
+ get: () => this._rejectOnCancel,
+ set: bool => {
+ this._rejectOnCancel = bool;
+ }
+ }
+ });
+
+ return executor(onResolve, onReject, onCancel);
+ });
+ }
+
+ then(onFulfilled, onRejected) {
+ return this._promise.then(onFulfilled, onRejected);
+ }
+
+ catch(onRejected) {
+ return this._promise.catch(onRejected);
+ }
+
+ finally(onFinally) {
+ return this._promise.finally(onFinally);
+ }
+
+ cancel(reason) {
+ if (!this._isPending || this._isCanceled) {
+ return;
+ }
+
+ if (this._cancelHandlers.length > 0) {
+ try {
+ for (const handler of this._cancelHandlers) {
+ handler();
+ }
+ } catch (error) {
+ this._reject(error);
+ }
+ }
+
+ this._isCanceled = true;
+ if (this._rejectOnCancel) {
+ this._reject(new CancelError(reason));
+ }
+ }
+
+ get isCanceled() {
+ return this._isCanceled;
+ }
+}
+
+Object.setPrototypeOf(PCancelable.prototype, Promise.prototype);
+
+module.exports = PCancelable;
+module.exports.default = PCancelable;
+
+module.exports.CancelError = CancelError;
diff --git a/includes/translator/node_modules/p-cancelable/license b/includes/translator/node_modules/p-cancelable/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/p-cancelable/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/p-cancelable/package.json b/includes/translator/node_modules/p-cancelable/package.json
new file mode 100644
index 0000000..fa3a6c9
--- /dev/null
+++ b/includes/translator/node_modules/p-cancelable/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "p-cancelable",
+ "version": "1.1.0",
+ "description": "Create a promise that can be canceled",
+ "license": "MIT",
+ "repository": "sindresorhus/p-cancelable",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd-check"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "promise",
+ "cancelable",
+ "cancel",
+ "canceled",
+ "canceling",
+ "cancellable",
+ "cancellation",
+ "abort",
+ "abortable",
+ "aborting",
+ "cleanup",
+ "task",
+ "token",
+ "async",
+ "function",
+ "await",
+ "promises",
+ "bluebird"
+ ],
+ "devDependencies": {
+ "ava": "^1.3.1",
+ "delay": "^4.1.0",
+ "promise.prototype.finally": "^3.1.0",
+ "tsd-check": "^0.3.0",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/includes/translator/node_modules/p-cancelable/readme.md b/includes/translator/node_modules/p-cancelable/readme.md
new file mode 100644
index 0000000..b66e96a
--- /dev/null
+++ b/includes/translator/node_modules/p-cancelable/readme.md
@@ -0,0 +1,155 @@
+# p-cancelable [![Build Status](https://travis-ci.org/sindresorhus/p-cancelable.svg?branch=master)](https://travis-ci.org/sindresorhus/p-cancelable)
+
+> Create a promise that can be canceled
+
+Useful for animation, loading resources, long-running async computations, async iteration, etc.
+
+
+## Install
+
+```
+$ npm install p-cancelable
+```
+
+
+## Usage
+
+```js
+const PCancelable = require('p-cancelable');
+
+const cancelablePromise = new PCancelable((resolve, reject, onCancel) => {
+ const worker = new SomeLongRunningOperation();
+
+ onCancel(() => {
+ worker.close();
+ });
+
+ worker.on('finish', resolve);
+ worker.on('error', reject);
+});
+
+(async () => {
+ try {
+ console.log('Operation finished successfully:', await cancelablePromise);
+ } catch (error) {
+ if (cancelablePromise.isCanceled) {
+ // Handle the cancelation here
+ console.log('Operation was canceled');
+ return;
+ }
+
+ throw error;
+ }
+})();
+
+// Cancel the operation after 10 seconds
+setTimeout(() => {
+ cancelablePromise.cancel('Unicorn has changed its color');
+}, 10000);
+```
+
+
+## API
+
+### new PCancelable(executor)
+
+Same as the [`Promise` constructor](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise), but with an appended `onCancel` parameter in `executor`.<br>
+Cancelling will reject the promise with `PCancelable.CancelError`. To avoid that, set `onCancel.shouldReject` to `false`.
+
+```js
+const PCancelable = require('p-cancelable');
+
+const cancelablePromise = new PCancelable((resolve, reject, onCancel) => {
+ const job = new Job();
+
+ onCancel.shouldReject = false;
+ onCancel(() => {
+ job.stop();
+ });
+
+ job.on('finish', resolve);
+});
+
+cancelablePromise.cancel(); // Doesn't throw an error
+```
+
+`PCancelable` is a subclass of `Promise`.
+
+#### onCanceled(fn)
+
+Type: `Function`
+
+Accepts a function that is called when the promise is canceled.
+
+You're not required to call this function. You can call this function multiple times to add multiple cancel handlers.
+
+### PCancelable#cancel([reason])
+
+Type: `Function`
+
+Cancel the promise and optionally provide a reason.
+
+The cancellation is synchronous. Calling it after the promise has settled or multiple times does nothing.
+
+### PCancelable#isCanceled
+
+Type: `boolean`
+
+Whether the promise is canceled.
+
+### PCancelable.CancelError
+
+Type: `Error`
+
+Rejection reason when `.cancel()` is called.
+
+It includes a `.isCanceled` property for convenience.
+
+### PCancelable.fn(fn)
+
+Convenience method to make your promise-returning or async function cancelable.
+
+The function you specify will have `onCancel` appended to its parameters.
+
+```js
+const PCancelable = require('p-cancelable');
+
+const fn = PCancelable.fn((input, onCancel) => {
+ const job = new Job();
+
+ onCancel(() => {
+ job.cleanup();
+ });
+
+ return job.start(); //=> Promise
+});
+
+const cancelablePromise = fn('input'); //=> PCancelable
+
+// …
+
+cancelablePromise.cancel();
+```
+
+
+## FAQ
+
+### Cancelable vs. Cancellable
+
+[In American English, the verb cancel is usually inflected canceled and canceling—with one l.](http://grammarist.com/spelling/cancel/)<br>Both a [browser API](https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable) and the [Cancelable Promises proposal](https://github.com/tc39/proposal-cancelable-promises) use this spelling.
+
+### What about the official [Cancelable Promises proposal](https://github.com/tc39/proposal-cancelable-promises)?
+
+~~It's still an early draft and I don't really like its current direction. It complicates everything and will require deep changes in the ecosystem to adapt to it. And the way you have to use cancel tokens is verbose and convoluted. I much prefer the more pragmatic and less invasive approach in this module.~~ The proposal was withdrawn.
+
+
+## Related
+
+- [p-progress](https://github.com/sindresorhus/p-progress) - Create a promise that reports progress
+- [p-lazy](https://github.com/sindresorhus/p-lazy) - Create a lazy promise that defers execution until `.then()` or `.catch()` is called
+- [More…](https://github.com/sindresorhus/promise-fun)
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/pify/index.js b/includes/translator/node_modules/pify/index.js
new file mode 100644
index 0000000..1dee43a
--- /dev/null
+++ b/includes/translator/node_modules/pify/index.js
@@ -0,0 +1,84 @@
+'use strict';
+
+const processFn = (fn, opts) => function () {
+ const P = opts.promiseModule;
+ const args = new Array(arguments.length);
+
+ for (let i = 0; i < arguments.length; i++) {
+ args[i] = arguments[i];
+ }
+
+ return new P((resolve, reject) => {
+ if (opts.errorFirst) {
+ args.push(function (err, result) {
+ if (opts.multiArgs) {
+ const results = new Array(arguments.length - 1);
+
+ for (let i = 1; i < arguments.length; i++) {
+ results[i - 1] = arguments[i];
+ }
+
+ if (err) {
+ results.unshift(err);
+ reject(results);
+ } else {
+ resolve(results);
+ }
+ } else if (err) {
+ reject(err);
+ } else {
+ resolve(result);
+ }
+ });
+ } else {
+ args.push(function (result) {
+ if (opts.multiArgs) {
+ const results = new Array(arguments.length - 1);
+
+ for (let i = 0; i < arguments.length; i++) {
+ results[i] = arguments[i];
+ }
+
+ resolve(results);
+ } else {
+ resolve(result);
+ }
+ });
+ }
+
+ fn.apply(this, args);
+ });
+};
+
+module.exports = (obj, opts) => {
+ opts = Object.assign({
+ exclude: [/.+(Sync|Stream)$/],
+ errorFirst: true,
+ promiseModule: Promise
+ }, opts);
+
+ const filter = key => {
+ const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key);
+ return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
+ };
+
+ let ret;
+ if (typeof obj === 'function') {
+ ret = function () {
+ if (opts.excludeMain) {
+ return obj.apply(this, arguments);
+ }
+
+ return processFn(obj, opts).apply(this, arguments);
+ };
+ } else {
+ ret = Object.create(Object.getPrototypeOf(obj));
+ }
+
+ for (const key in obj) { // eslint-disable-line guard-for-in
+ const x = obj[key];
+ ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x;
+ }
+
+ return ret;
+};
diff --git a/includes/translator/node_modules/pify/license b/includes/translator/node_modules/pify/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/pify/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/pify/package.json b/includes/translator/node_modules/pify/package.json
new file mode 100644
index 0000000..468d857
--- /dev/null
+++ b/includes/translator/node_modules/pify/package.json
@@ -0,0 +1,51 @@
+{
+ "name": "pify",
+ "version": "3.0.0",
+ "description": "Promisify a callback-style function",
+ "license": "MIT",
+ "repository": "sindresorhus/pify",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava && npm run optimization-test",
+ "optimization-test": "node --allow-natives-syntax optimization-test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "promise",
+ "promises",
+ "promisify",
+ "all",
+ "denodify",
+ "denodeify",
+ "callback",
+ "cb",
+ "node",
+ "then",
+ "thenify",
+ "convert",
+ "transform",
+ "wrap",
+ "wrapper",
+ "bind",
+ "to",
+ "async",
+ "await",
+ "es2015",
+ "bluebird"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "pinkie-promise": "^2.0.0",
+ "v8-natives": "^1.0.0",
+ "xo": "*"
+ }
+}
diff --git a/includes/translator/node_modules/pify/readme.md b/includes/translator/node_modules/pify/readme.md
new file mode 100644
index 0000000..376ca4e
--- /dev/null
+++ b/includes/translator/node_modules/pify/readme.md
@@ -0,0 +1,131 @@
+# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify)
+
+> Promisify a callback-style function
+
+
+## Install
+
+```
+$ npm install --save pify
+```
+
+
+## Usage
+
+```js
+const fs = require('fs');
+const pify = require('pify');
+
+// Promisify a single function
+pify(fs.readFile)('package.json', 'utf8').then(data => {
+ console.log(JSON.parse(data).name);
+ //=> 'pify'
+});
+
+// Promisify all methods in a module
+pify(fs).readFile('package.json', 'utf8').then(data => {
+ console.log(JSON.parse(data).name);
+ //=> 'pify'
+});
+```
+
+
+## API
+
+### pify(input, [options])
+
+Returns a `Promise` wrapped version of the supplied function or module.
+
+#### input
+
+Type: `Function` `Object`
+
+Callback-style function or module whose methods you want to promisify.
+
+#### options
+
+##### multiArgs
+
+Type: `boolean`<br>
+Default: `false`
+
+By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. This also applies to rejections, where it returns an array of all the callback arguments, including the error.
+
+```js
+const request = require('request');
+const pify = require('pify');
+
+pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => {
+ const [httpResponse, body] = result;
+});
+```
+
+##### include
+
+Type: `string[]` `RegExp[]`
+
+Methods in a module to promisify. Remaining methods will be left untouched.
+
+##### exclude
+
+Type: `string[]` `RegExp[]`<br>
+Default: `[/.+(Sync|Stream)$/]`
+
+Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default.
+
+##### excludeMain
+
+Type: `boolean`<br>
+Default: `false`
+
+If given module is a function itself, it will be promisified. Turn this option on if you want to promisify only methods of the module.
+
+```js
+const pify = require('pify');
+
+function fn() {
+ return true;
+}
+
+fn.method = (data, callback) => {
+ setImmediate(() => {
+ callback(null, data);
+ });
+};
+
+// Promisify methods but not `fn()`
+const promiseFn = pify(fn, {excludeMain: true});
+
+if (promiseFn()) {
+ promiseFn.method('hi').then(data => {
+ console.log(data);
+ });
+}
+```
+
+##### errorFirst
+
+Type: `boolean`<br>
+Default: `true`
+
+Whether the callback has an error as the first argument. You'll want to set this to `false` if you're dealing with an API that doesn't have an error as the first argument, like `fs.exists()`, some browser APIs, Chrome Extension APIs, etc.
+
+##### promiseModule
+
+Type: `Function`
+
+Custom promise module to use instead of the native one.
+
+Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill.
+
+
+## Related
+
+- [p-event](https://github.com/sindresorhus/p-event) - Promisify an event by waiting for it to be emitted
+- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
+- [More…](https://github.com/sindresorhus/promise-fun)
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/prepend-http/index.js b/includes/translator/node_modules/prepend-http/index.js
new file mode 100644
index 0000000..82b3a6b
--- /dev/null
+++ b/includes/translator/node_modules/prepend-http/index.js
@@ -0,0 +1,15 @@
+'use strict';
+module.exports = (url, opts) => {
+ if (typeof url !== 'string') {
+ throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``);
+ }
+
+ url = url.trim();
+ opts = Object.assign({https: false}, opts);
+
+ if (/^\.*\/|^(?!localhost)\w+:/.test(url)) {
+ return url;
+ }
+
+ return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://');
+};
diff --git a/includes/translator/node_modules/prepend-http/license b/includes/translator/node_modules/prepend-http/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/prepend-http/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/prepend-http/package.json b/includes/translator/node_modules/prepend-http/package.json
new file mode 100644
index 0000000..cbfac02
--- /dev/null
+++ b/includes/translator/node_modules/prepend-http/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "prepend-http",
+ "version": "2.0.0",
+ "description": "Prepend `http://` to humanized URLs like todomvc.com and localhost",
+ "license": "MIT",
+ "repository": "sindresorhus/prepend-http",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "prepend",
+ "protocol",
+ "scheme",
+ "url",
+ "uri",
+ "http",
+ "https",
+ "humanized"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ }
+}
diff --git a/includes/translator/node_modules/prepend-http/readme.md b/includes/translator/node_modules/prepend-http/readme.md
new file mode 100644
index 0000000..55d640d
--- /dev/null
+++ b/includes/translator/node_modules/prepend-http/readme.md
@@ -0,0 +1,56 @@
+# prepend-http [![Build Status](https://travis-ci.org/sindresorhus/prepend-http.svg?branch=master)](https://travis-ci.org/sindresorhus/prepend-http)
+
+> Prepend `http://` to humanized URLs like `todomvc.com` and `localhost`
+
+
+## Install
+
+```
+$ npm install prepend-http
+```
+
+
+## Usage
+
+```js
+const prependHttp = require('prepend-http');
+
+prependHttp('todomvc.com');
+//=> 'http://todomvc.com'
+
+prependHttp('localhost');
+//=> 'http://localhost'
+
+prependHttp('http://todomvc.com');
+//=> 'http://todomvc.com'
+
+prependHttp('todomvc.com', {https: true});
+//=> 'https://todomvc.com'
+```
+
+
+## API
+
+### prependHttp(url, [options])
+
+#### url
+
+Type: `string`
+
+URL to prepend `http://` on.
+
+#### options
+
+Type: `Object`
+
+##### https
+
+Type: `boolean`<br>
+Default: `false`
+
+Prepend `https://` instead of `http://`.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/proxy-check/README.md b/includes/translator/node_modules/proxy-check/README.md
new file mode 100644
index 0000000..29bd28a
--- /dev/null
+++ b/includes/translator/node_modules/proxy-check/README.md
@@ -0,0 +1,21 @@
+# Check proxy for NodeJS
+
+```javascript
+const proxy_check = require('proxy-check');
+
+const proxy = {
+ host: '54.82.74.24',
+ port: 5557,
+ proxyAuth: 'y0adXjeO:pAzAHCr4'
+};
+// or
+// const proxy = 'y0adXjeO:pAzAHCr4@54.82.74.24:5557';
+
+proxy_check(proxy).then(r => {
+ console.log(r); // true
+}).catch(e => {
+ console.error(e); // ECONNRESET
+});
+```
+
+#### Install your simple proxy-server: https://github.com/zamanuhina/install-proxy-one-line
diff --git a/includes/translator/node_modules/proxy-check/index.js b/includes/translator/node_modules/proxy-check/index.js
new file mode 100644
index 0000000..efb6991
--- /dev/null
+++ b/includes/translator/node_modules/proxy-check/index.js
@@ -0,0 +1,87 @@
+const http = require('http');
+
+const errors = [
+ 'Bad proxy string',
+ 'Proxy offline'
+];
+
+const proxy_check = p => {
+
+ return new Promise((resolve, reject) => {
+
+ let proxy = {
+ host: '',
+ port: 0,
+ proxyAuth: ''
+ };
+
+ if (typeof p === 'object') {
+ if (Array.isArray(p)) {
+ if (typeof p[0] === 'object') {
+ proxy = p[0];
+ } else if (typeof p === 'string') {
+ p = p[0];
+ } else {
+ return reject(errors[0]);
+ }
+ } else {
+ proxy = p;
+ }
+ }
+
+ if (typeof p === 'string') {
+ if (p.indexOf('@') + 1) {
+ proxy.proxyAuth = p.split('@')[0];
+ const host_port = p.split('@')[1];
+ if (host_port.indexOf(':') + 1) {
+ proxy.host = host_port.split(':')[0];
+ proxy.port = host_port.split(':')[1];
+ }
+ } else {
+ if (p.indexOf(':') + 1) {
+ proxy.host = p.split(':')[0];
+ proxy.port = p.split(':')[1];
+ }
+ }
+ }
+
+ const proxy_options = {
+ method: 'CONNECT',
+ path: 'www.google.com:443',
+ timeout: 1000,
+ agent: false
+ };
+
+ if (proxy.host) {
+ proxy_options.host = proxy.host;
+ }
+ if (proxy.port) {
+ proxy_options.port = proxy.port;
+ }
+ if (proxy.proxyAuth) {
+ proxy_options.headers = {
+ 'Proxy-Authorization': 'Basic ' + Buffer.from(proxy.proxyAuth).toString('base64')
+ };
+ }
+
+ const req = http.request(proxy_options);
+ req.on('connect', res => {
+ req.destroy();
+ if (res.statusCode === 200) {
+ return resolve(true);
+ } else {
+ return reject(errors[1]);
+ }
+ });
+ req.on('timeout', () => {
+ req.destroy();
+ });
+ req.on('error', err => {
+ return reject((err && err.code) || errors[1]);
+ });
+ req.end();
+
+ });
+}
+
+module.exports = proxy_check;
diff --git a/includes/translator/node_modules/proxy-check/package.json b/includes/translator/node_modules/proxy-check/package.json
new file mode 100644
index 0000000..b38e0cc
--- /dev/null
+++ b/includes/translator/node_modules/proxy-check/package.json
@@ -0,0 +1,22 @@
+{
+ "name": "proxy-check",
+ "version": "1.0.8",
+ "description": "Check proxy for NodeJS",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/zamanuhina/proxy-check.git"
+ },
+ "publishConfig": {
+ "registry": "https://registry.npmjs.org/"
+ },
+ "keywords": [
+ "proxy",
+ "proxy-check"
+ ],
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/zamanuhina/proxy-check/issues"
+ },
+ "homepage": "https://github.com/zamanuhina/proxy-check#readme"
+}
diff --git a/includes/translator/node_modules/pump/.travis.yml b/includes/translator/node_modules/pump/.travis.yml
new file mode 100644
index 0000000..17f9433
--- /dev/null
+++ b/includes/translator/node_modules/pump/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - "0.10"
+
+script: "npm test"
diff --git a/includes/translator/node_modules/pump/LICENSE b/includes/translator/node_modules/pump/LICENSE
new file mode 100644
index 0000000..757562e
--- /dev/null
+++ b/includes/translator/node_modules/pump/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE. \ No newline at end of file
diff --git a/includes/translator/node_modules/pump/README.md b/includes/translator/node_modules/pump/README.md
new file mode 100644
index 0000000..4c81471
--- /dev/null
+++ b/includes/translator/node_modules/pump/README.md
@@ -0,0 +1,65 @@
+# pump
+
+pump is a small node module that pipes streams together and destroys all of them if one of them closes.
+
+```
+npm install pump
+```
+
+[![build status](http://img.shields.io/travis/mafintosh/pump.svg?style=flat)](http://travis-ci.org/mafintosh/pump)
+
+## What problem does it solve?
+
+When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error.
+You are also not able to provide a callback to tell when then pipe has finished.
+
+pump does these two things for you
+
+## Usage
+
+Simply pass the streams you want to pipe together to pump and add an optional callback
+
+``` js
+var pump = require('pump')
+var fs = require('fs')
+
+var source = fs.createReadStream('/dev/random')
+var dest = fs.createWriteStream('/dev/null')
+
+pump(source, dest, function(err) {
+ console.log('pipe finished', err)
+})
+
+setTimeout(function() {
+ dest.destroy() // when dest is closed pump will destroy source
+}, 1000)
+```
+
+You can use pump to pipe more than two streams together as well
+
+``` js
+var transform = someTransformStream()
+
+pump(source, transform, anotherTransform, dest, function(err) {
+ console.log('pipe finished', err)
+})
+```
+
+If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed.
+
+Similarly to `stream.pipe()`, `pump()` returns the last stream passed in, so you can do:
+
+```
+return pump(s1, s2) // returns s2
+```
+
+If you want to return a stream that combines *both* s1 and s2 to a single stream use
+[pumpify](https://github.com/mafintosh/pumpify) instead.
+
+## License
+
+MIT
+
+## Related
+
+`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.
diff --git a/includes/translator/node_modules/pump/index.js b/includes/translator/node_modules/pump/index.js
new file mode 100644
index 0000000..c15059f
--- /dev/null
+++ b/includes/translator/node_modules/pump/index.js
@@ -0,0 +1,82 @@
+var once = require('once')
+var eos = require('end-of-stream')
+var fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes
+
+var noop = function () {}
+var ancient = /^v?\.0/.test(process.version)
+
+var isFn = function (fn) {
+ return typeof fn === 'function'
+}
+
+var isFS = function (stream) {
+ if (!ancient) return false // newer node version do not need to care about fs is a special way
+ if (!fs) return false // browser
+ return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
+}
+
+var isRequest = function (stream) {
+ return stream.setHeader && isFn(stream.abort)
+}
+
+var destroyer = function (stream, reading, writing, callback) {
+ callback = once(callback)
+
+ var closed = false
+ stream.on('close', function () {
+ closed = true
+ })
+
+ eos(stream, {readable: reading, writable: writing}, function (err) {
+ if (err) return callback(err)
+ closed = true
+ callback()
+ })
+
+ var destroyed = false
+ return function (err) {
+ if (closed) return
+ if (destroyed) return
+ destroyed = true
+
+ if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
+ if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
+
+ if (isFn(stream.destroy)) return stream.destroy()
+
+ callback(err || new Error('stream was destroyed'))
+ }
+}
+
+var call = function (fn) {
+ fn()
+}
+
+var pipe = function (from, to) {
+ return from.pipe(to)
+}
+
+var pump = function () {
+ var streams = Array.prototype.slice.call(arguments)
+ var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
+
+ if (Array.isArray(streams[0])) streams = streams[0]
+ if (streams.length < 2) throw new Error('pump requires two streams per minimum')
+
+ var error
+ var destroys = streams.map(function (stream, i) {
+ var reading = i < streams.length - 1
+ var writing = i > 0
+ return destroyer(stream, reading, writing, function (err) {
+ if (!error) error = err
+ if (err) destroys.forEach(call)
+ if (reading) return
+ destroys.forEach(call)
+ callback(error)
+ })
+ })
+
+ return streams.reduce(pipe)
+}
+
+module.exports = pump
diff --git a/includes/translator/node_modules/pump/package.json b/includes/translator/node_modules/pump/package.json
new file mode 100644
index 0000000..0b838f9
--- /dev/null
+++ b/includes/translator/node_modules/pump/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "pump",
+ "version": "3.0.0",
+ "repository": "git://github.com/mafintosh/pump.git",
+ "license": "MIT",
+ "description": "pipe streams together and close all of them if one of them closes",
+ "browser": {
+ "fs": false
+ },
+ "keywords": [
+ "streams",
+ "pipe",
+ "destroy",
+ "callback"
+ ],
+ "author": "Mathias Buus Madsen <mathiasbuus@gmail.com>",
+ "dependencies": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ },
+ "scripts": {
+ "test": "node test-browser.js && node test-node.js"
+ }
+}
diff --git a/includes/translator/node_modules/pump/test-browser.js b/includes/translator/node_modules/pump/test-browser.js
new file mode 100644
index 0000000..9a06c8a
--- /dev/null
+++ b/includes/translator/node_modules/pump/test-browser.js
@@ -0,0 +1,66 @@
+var stream = require('stream')
+var pump = require('./index')
+
+var rs = new stream.Readable()
+var ws = new stream.Writable()
+
+rs._read = function (size) {
+ this.push(Buffer(size).fill('abc'))
+}
+
+ws._write = function (chunk, encoding, cb) {
+ setTimeout(function () {
+ cb()
+ }, 100)
+}
+
+var toHex = function () {
+ var reverse = new (require('stream').Transform)()
+
+ reverse._transform = function (chunk, enc, callback) {
+ reverse.push(chunk.toString('hex'))
+ callback()
+ }
+
+ return reverse
+}
+
+var wsClosed = false
+var rsClosed = false
+var callbackCalled = false
+
+var check = function () {
+ if (wsClosed && rsClosed && callbackCalled) {
+ console.log('test-browser.js passes')
+ clearTimeout(timeout)
+ }
+}
+
+ws.on('finish', function () {
+ wsClosed = true
+ check()
+})
+
+rs.on('end', function () {
+ rsClosed = true
+ check()
+})
+
+var res = pump(rs, toHex(), toHex(), toHex(), ws, function () {
+ callbackCalled = true
+ check()
+})
+
+if (res !== ws) {
+ throw new Error('should return last stream')
+}
+
+setTimeout(function () {
+ rs.push(null)
+ rs.emit('close')
+}, 1000)
+
+var timeout = setTimeout(function () {
+ check()
+ throw new Error('timeout')
+}, 5000)
diff --git a/includes/translator/node_modules/pump/test-node.js b/includes/translator/node_modules/pump/test-node.js
new file mode 100644
index 0000000..561251a
--- /dev/null
+++ b/includes/translator/node_modules/pump/test-node.js
@@ -0,0 +1,53 @@
+var pump = require('./index')
+
+var rs = require('fs').createReadStream('/dev/random')
+var ws = require('fs').createWriteStream('/dev/null')
+
+var toHex = function () {
+ var reverse = new (require('stream').Transform)()
+
+ reverse._transform = function (chunk, enc, callback) {
+ reverse.push(chunk.toString('hex'))
+ callback()
+ }
+
+ return reverse
+}
+
+var wsClosed = false
+var rsClosed = false
+var callbackCalled = false
+
+var check = function () {
+ if (wsClosed && rsClosed && callbackCalled) {
+ console.log('test-node.js passes')
+ clearTimeout(timeout)
+ }
+}
+
+ws.on('close', function () {
+ wsClosed = true
+ check()
+})
+
+rs.on('close', function () {
+ rsClosed = true
+ check()
+})
+
+var res = pump(rs, toHex(), toHex(), toHex(), ws, function () {
+ callbackCalled = true
+ check()
+})
+
+if (res !== ws) {
+ throw new Error('should return last stream')
+}
+
+setTimeout(function () {
+ rs.destroy()
+}, 1000)
+
+var timeout = setTimeout(function () {
+ throw new Error('timeout')
+}, 5000)
diff --git a/includes/translator/node_modules/responselike/LICENSE b/includes/translator/node_modules/responselike/LICENSE
new file mode 100644
index 0000000..8829a00
--- /dev/null
+++ b/includes/translator/node_modules/responselike/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2017 Luke Childs
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/includes/translator/node_modules/responselike/README.md b/includes/translator/node_modules/responselike/README.md
new file mode 100644
index 0000000..6361931
--- /dev/null
+++ b/includes/translator/node_modules/responselike/README.md
@@ -0,0 +1,77 @@
+# responselike
+
+> A response-like object for mocking a Node.js HTTP response stream
+
+[![Build Status](https://travis-ci.org/lukechilds/responselike.svg?branch=master)](https://travis-ci.org/lukechilds/responselike)
+[![Coverage Status](https://coveralls.io/repos/github/lukechilds/responselike/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/responselike?branch=master)
+[![npm](https://img.shields.io/npm/dm/responselike.svg)](https://www.npmjs.com/package/responselike)
+[![npm](https://img.shields.io/npm/v/responselike.svg)](https://www.npmjs.com/package/responselike)
+
+Returns a streamable response object similar to a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage). Useful for formatting cached responses so they can be consumed by code expecting a real response.
+
+## Install
+
+```shell
+npm install --save responselike
+```
+
+Or if you're just using for testing you'll want:
+
+```shell
+npm install --save-dev responselike
+```
+
+## Usage
+
+```js
+const Response = require('responselike');
+
+const response = new Response(200, { foo: 'bar' }, Buffer.from('Hi!'), 'https://example.com');
+
+response.statusCode;
+// 200
+response.headers;
+// { foo: 'bar' }
+response.body;
+// <Buffer 48 69 21>
+response.url;
+// 'https://example.com'
+
+response.pipe(process.stdout);
+// Hi!
+```
+
+
+## API
+
+### new Response(statusCode, headers, body, url)
+
+Returns a streamable response object similar to a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage).
+
+#### statusCode
+
+Type: `number`
+
+HTTP response status code.
+
+#### headers
+
+Type: `object`
+
+HTTP headers object. Keys will be automatically lowercased.
+
+#### body
+
+Type: `buffer`
+
+A Buffer containing the response body. The Buffer contents will be streamable but is also exposed directly as `response.body`.
+
+#### url
+
+Type: `string`
+
+Request URL string.
+
+## License
+
+MIT © Luke Childs
diff --git a/includes/translator/node_modules/responselike/package.json b/includes/translator/node_modules/responselike/package.json
new file mode 100644
index 0000000..520c8a1
--- /dev/null
+++ b/includes/translator/node_modules/responselike/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "responselike",
+ "version": "1.0.2",
+ "description": "A response-like object for mocking a Node.js HTTP response stream",
+ "main": "src/index.js",
+ "scripts": {
+ "test": "xo && nyc ava",
+ "coverage": "nyc report --reporter=text-lcov | coveralls"
+ },
+ "xo": {
+ "extends": "xo-lukechilds"
+ },
+ "keywords": [
+ "http",
+ "https",
+ "response",
+ "mock",
+ "request",
+ "responselike"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/lukechilds/responselike.git"
+ },
+ "author": "lukechilds",
+ "license": "MIT",
+ "devDependencies": {
+ "ava": "^0.22.0",
+ "coveralls": "^2.13.1",
+ "eslint-config-xo-lukechilds": "^1.0.0",
+ "get-stream": "^3.0.0",
+ "nyc": "^11.1.0",
+ "xo": "^0.19.0"
+ },
+ "dependencies": {
+ "lowercase-keys": "^1.0.0"
+ }
+}
diff --git a/includes/translator/node_modules/responselike/src/index.js b/includes/translator/node_modules/responselike/src/index.js
new file mode 100644
index 0000000..b17b481
--- /dev/null
+++ b/includes/translator/node_modules/responselike/src/index.js
@@ -0,0 +1,34 @@
+'use strict';
+
+const Readable = require('stream').Readable;
+const lowercaseKeys = require('lowercase-keys');
+
+class Response extends Readable {
+ constructor(statusCode, headers, body, url) {
+ if (typeof statusCode !== 'number') {
+ throw new TypeError('Argument `statusCode` should be a number');
+ }
+ if (typeof headers !== 'object') {
+ throw new TypeError('Argument `headers` should be an object');
+ }
+ if (!(body instanceof Buffer)) {
+ throw new TypeError('Argument `body` should be a buffer');
+ }
+ if (typeof url !== 'string') {
+ throw new TypeError('Argument `url` should be a string');
+ }
+
+ super();
+ this.statusCode = statusCode;
+ this.headers = lowercaseKeys(headers);
+ this.body = body;
+ this.url = url;
+ }
+
+ _read() {
+ this.push(this.body);
+ this.push(null);
+ }
+}
+
+module.exports = Response;
diff --git a/includes/translator/node_modules/sax/LICENSE b/includes/translator/node_modules/sax/LICENSE
new file mode 100644
index 0000000..ccffa08
--- /dev/null
+++ b/includes/translator/node_modules/sax/LICENSE
@@ -0,0 +1,41 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+====
+
+`String.fromCodePoint` by Mathias Bynens used according to terms of MIT
+License, as follows:
+
+ Copyright Mathias Bynens <https://mathiasbynens.be/>
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/sax/README.md b/includes/translator/node_modules/sax/README.md
new file mode 100644
index 0000000..afcd3f3
--- /dev/null
+++ b/includes/translator/node_modules/sax/README.md
@@ -0,0 +1,225 @@
+# sax js
+
+A sax-style parser for XML and HTML.
+
+Designed with [node](http://nodejs.org/) in mind, but should work fine in
+the browser or other CommonJS implementations.
+
+## What This Is
+
+* A very simple tool to parse through an XML string.
+* A stepping stone to a streaming HTML parser.
+* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML
+ docs.
+
+## What This Is (probably) Not
+
+* An HTML Parser - That's a fine goal, but this isn't it. It's just
+ XML.
+* A DOM Builder - You can use it to build an object model out of XML,
+ but it doesn't do that out of the box.
+* XSLT - No DOM = no querying.
+* 100% Compliant with (some other SAX implementation) - Most SAX
+ implementations are in Java and do a lot more than this does.
+* An XML Validator - It does a little validation when in strict mode, but
+ not much.
+* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic
+ masochism.
+* A DTD-aware Thing - Fetching DTDs is a much bigger job.
+
+## Regarding `<!DOCTYPE`s and `<!ENTITY`s
+
+The parser will handle the basic XML entities in text nodes and attribute
+values: `&amp; &lt; &gt; &apos; &quot;`. It's possible to define additional
+entities in XML by putting them in the DTD. This parser doesn't do anything
+with that. If you want to listen to the `ondoctype` event, and then fetch
+the doctypes, and read the entities and add them to `parser.ENTITIES`, then
+be my guest.
+
+Unknown entities will fail in strict mode, and in loose mode, will pass
+through unmolested.
+
+## Usage
+
+```javascript
+var sax = require("./lib/sax"),
+ strict = true, // set to false for html-mode
+ parser = sax.parser(strict);
+
+parser.onerror = function (e) {
+ // an error happened.
+};
+parser.ontext = function (t) {
+ // got some text. t is the string of text.
+};
+parser.onopentag = function (node) {
+ // opened a tag. node has "name" and "attributes"
+};
+parser.onattribute = function (attr) {
+ // an attribute. attr has "name" and "value"
+};
+parser.onend = function () {
+ // parser stream is done, and ready to have more stuff written to it.
+};
+
+parser.write('<xml>Hello, <who name="world">world</who>!</xml>').close();
+
+// stream usage
+// takes the same options as the parser
+var saxStream = require("sax").createStream(strict, options)
+saxStream.on("error", function (e) {
+ // unhandled errors will throw, since this is a proper node
+ // event emitter.
+ console.error("error!", e)
+ // clear the error
+ this._parser.error = null
+ this._parser.resume()
+})
+saxStream.on("opentag", function (node) {
+ // same object as above
+})
+// pipe is supported, and it's readable/writable
+// same chunks coming in also go out.
+fs.createReadStream("file.xml")
+ .pipe(saxStream)
+ .pipe(fs.createWriteStream("file-copy.xml"))
+```
+
+
+## Arguments
+
+Pass the following arguments to the parser function. All are optional.
+
+`strict` - Boolean. Whether or not to be a jerk. Default: `false`.
+
+`opt` - Object bag of settings regarding string formatting. All default to `false`.
+
+Settings supported:
+
+* `trim` - Boolean. Whether or not to trim text and comment nodes.
+* `normalize` - Boolean. If true, then turn any whitespace into a single
+ space.
+* `lowercase` - Boolean. If true, then lowercase tag names and attribute names
+ in loose mode, rather than uppercasing them.
+* `xmlns` - Boolean. If true, then namespaces are supported.
+* `position` - Boolean. If false, then don't track line/col/position.
+* `strictEntities` - Boolean. If true, only parse [predefined XML
+ entities](http://www.w3.org/TR/REC-xml/#sec-predefined-ent)
+ (`&amp;`, `&apos;`, `&gt;`, `&lt;`, and `&quot;`)
+
+## Methods
+
+`write` - Write bytes onto the stream. You don't have to do this all at
+once. You can keep writing as much as you want.
+
+`close` - Close the stream. Once closed, no more data may be written until
+it is done processing the buffer, which is signaled by the `end` event.
+
+`resume` - To gracefully handle errors, assign a listener to the `error`
+event. Then, when the error is taken care of, you can call `resume` to
+continue parsing. Otherwise, the parser will not continue while in an error
+state.
+
+## Members
+
+At all times, the parser object will have the following members:
+
+`line`, `column`, `position` - Indications of the position in the XML
+document where the parser currently is looking.
+
+`startTagPosition` - Indicates the position where the current tag starts.
+
+`closed` - Boolean indicating whether or not the parser can be written to.
+If it's `true`, then wait for the `ready` event to write again.
+
+`strict` - Boolean indicating whether or not the parser is a jerk.
+
+`opt` - Any options passed into the constructor.
+
+`tag` - The current tag being dealt with.
+
+And a bunch of other stuff that you probably shouldn't touch.
+
+## Events
+
+All events emit with a single argument. To listen to an event, assign a
+function to `on<eventname>`. Functions get executed in the this-context of
+the parser object. The list of supported events are also in the exported
+`EVENTS` array.
+
+When using the stream interface, assign handlers using the EventEmitter
+`on` function in the normal fashion.
+
+`error` - Indication that something bad happened. The error will be hanging
+out on `parser.error`, and must be deleted before parsing can continue. By
+listening to this event, you can keep an eye on that kind of stuff. Note:
+this happens *much* more in strict mode. Argument: instance of `Error`.
+
+`text` - Text node. Argument: string of text.
+
+`doctype` - The `<!DOCTYPE` declaration. Argument: doctype string.
+
+`processinginstruction` - Stuff like `<?xml foo="blerg" ?>`. Argument:
+object with `name` and `body` members. Attributes are not parsed, as
+processing instructions have implementation dependent semantics.
+
+`sgmldeclaration` - Random SGML declarations. Stuff like `<!ENTITY p>`
+would trigger this kind of event. This is a weird thing to support, so it
+might go away at some point. SAX isn't intended to be used to parse SGML,
+after all.
+
+`opentagstart` - Emitted immediately when the tag name is available,
+but before any attributes are encountered. Argument: object with a
+`name` field and an empty `attributes` set. Note that this is the
+same object that will later be emitted in the `opentag` event.
+
+`opentag` - An opening tag. Argument: object with `name` and `attributes`.
+In non-strict mode, tag names are uppercased, unless the `lowercase`
+option is set. If the `xmlns` option is set, then it will contain
+namespace binding information on the `ns` member, and will have a
+`local`, `prefix`, and `uri` member.
+
+`closetag` - A closing tag. In loose mode, tags are auto-closed if their
+parent closes. In strict mode, well-formedness is enforced. Note that
+self-closing tags will have `closeTag` emitted immediately after `openTag`.
+Argument: tag name.
+
+`attribute` - An attribute node. Argument: object with `name` and `value`.
+In non-strict mode, attribute names are uppercased, unless the `lowercase`
+option is set. If the `xmlns` option is set, it will also contains namespace
+information.
+
+`comment` - A comment node. Argument: the string of the comment.
+
+`opencdata` - The opening tag of a `<![CDATA[` block.
+
+`cdata` - The text of a `<![CDATA[` block. Since `<![CDATA[` blocks can get
+quite large, this event may fire multiple times for a single block, if it
+is broken up into multiple `write()`s. Argument: the string of random
+character data.
+
+`closecdata` - The closing tag (`]]>`) of a `<![CDATA[` block.
+
+`opennamespace` - If the `xmlns` option is set, then this event will
+signal the start of a new namespace binding.
+
+`closenamespace` - If the `xmlns` option is set, then this event will
+signal the end of a namespace binding.
+
+`end` - Indication that the closed stream has ended.
+
+`ready` - Indication that the stream has reset, and is ready to be written
+to.
+
+`noscript` - In non-strict mode, `<script>` tags trigger a `"script"`
+event, and their contents are not checked for special xml characters.
+If you pass `noscript: true`, then this behavior is suppressed.
+
+## Reporting Problems
+
+It's best to write a failing test if you find an issue. I will always
+accept pull requests with failing tests if they demonstrate intended
+behavior, but it is very hard to figure out what issue you're describing
+without a test. Writing a test is also the best way for you yourself
+to figure out if you really understand the issue you think you have with
+sax-js.
diff --git a/includes/translator/node_modules/sax/lib/sax.js b/includes/translator/node_modules/sax/lib/sax.js
new file mode 100644
index 0000000..795d607
--- /dev/null
+++ b/includes/translator/node_modules/sax/lib/sax.js
@@ -0,0 +1,1565 @@
+;(function (sax) { // wrapper for non-node envs
+ sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
+ sax.SAXParser = SAXParser
+ sax.SAXStream = SAXStream
+ sax.createStream = createStream
+
+ // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
+ // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
+ // since that's the earliest that a buffer overrun could occur. This way, checks are
+ // as rare as required, but as often as necessary to ensure never crossing this bound.
+ // Furthermore, buffers are only tested at most once per write(), so passing a very
+ // large string into write() might have undesirable effects, but this is manageable by
+ // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
+ // edge case, result in creating at most one complete copy of the string passed in.
+ // Set to Infinity to have unlimited buffers.
+ sax.MAX_BUFFER_LENGTH = 64 * 1024
+
+ var buffers = [
+ 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',
+ 'procInstName', 'procInstBody', 'entity', 'attribName',
+ 'attribValue', 'cdata', 'script'
+ ]
+
+ sax.EVENTS = [
+ 'text',
+ 'processinginstruction',
+ 'sgmldeclaration',
+ 'doctype',
+ 'comment',
+ 'opentagstart',
+ 'attribute',
+ 'opentag',
+ 'closetag',
+ 'opencdata',
+ 'cdata',
+ 'closecdata',
+ 'error',
+ 'end',
+ 'ready',
+ 'script',
+ 'opennamespace',
+ 'closenamespace'
+ ]
+
+ function SAXParser (strict, opt) {
+ if (!(this instanceof SAXParser)) {
+ return new SAXParser(strict, opt)
+ }
+
+ var parser = this
+ clearBuffers(parser)
+ parser.q = parser.c = ''
+ parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
+ parser.opt = opt || {}
+ parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
+ parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'
+ parser.tags = []
+ parser.closed = parser.closedRoot = parser.sawRoot = false
+ parser.tag = parser.error = null
+ parser.strict = !!strict
+ parser.noscript = !!(strict || parser.opt.noscript)
+ parser.state = S.BEGIN
+ parser.strictEntities = parser.opt.strictEntities
+ parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)
+ parser.attribList = []
+
+ // namespaces form a prototype chain.
+ // it always points at the current tag,
+ // which protos to its parent tag.
+ if (parser.opt.xmlns) {
+ parser.ns = Object.create(rootNS)
+ }
+
+ // mostly just for error reporting
+ parser.trackPosition = parser.opt.position !== false
+ if (parser.trackPosition) {
+ parser.position = parser.line = parser.column = 0
+ }
+ emit(parser, 'onready')
+ }
+
+ if (!Object.create) {
+ Object.create = function (o) {
+ function F () {}
+ F.prototype = o
+ var newf = new F()
+ return newf
+ }
+ }
+
+ if (!Object.keys) {
+ Object.keys = function (o) {
+ var a = []
+ for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
+ return a
+ }
+ }
+
+ function checkBufferLength (parser) {
+ var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
+ var maxActual = 0
+ for (var i = 0, l = buffers.length; i < l; i++) {
+ var len = parser[buffers[i]].length
+ if (len > maxAllowed) {
+ // Text/cdata nodes can get big, and since they're buffered,
+ // we can get here under normal conditions.
+ // Avoid issues by emitting the text node now,
+ // so at least it won't get any bigger.
+ switch (buffers[i]) {
+ case 'textNode':
+ closeText(parser)
+ break
+
+ case 'cdata':
+ emitNode(parser, 'oncdata', parser.cdata)
+ parser.cdata = ''
+ break
+
+ case 'script':
+ emitNode(parser, 'onscript', parser.script)
+ parser.script = ''
+ break
+
+ default:
+ error(parser, 'Max buffer length exceeded: ' + buffers[i])
+ }
+ }
+ maxActual = Math.max(maxActual, len)
+ }
+ // schedule the next check for the earliest possible buffer overrun.
+ var m = sax.MAX_BUFFER_LENGTH - maxActual
+ parser.bufferCheckPosition = m + parser.position
+ }
+
+ function clearBuffers (parser) {
+ for (var i = 0, l = buffers.length; i < l; i++) {
+ parser[buffers[i]] = ''
+ }
+ }
+
+ function flushBuffers (parser) {
+ closeText(parser)
+ if (parser.cdata !== '') {
+ emitNode(parser, 'oncdata', parser.cdata)
+ parser.cdata = ''
+ }
+ if (parser.script !== '') {
+ emitNode(parser, 'onscript', parser.script)
+ parser.script = ''
+ }
+ }
+
+ SAXParser.prototype = {
+ end: function () { end(this) },
+ write: write,
+ resume: function () { this.error = null; return this },
+ close: function () { return this.write(null) },
+ flush: function () { flushBuffers(this) }
+ }
+
+ var Stream
+ try {
+ Stream = require('stream').Stream
+ } catch (ex) {
+ Stream = function () {}
+ }
+
+ var streamWraps = sax.EVENTS.filter(function (ev) {
+ return ev !== 'error' && ev !== 'end'
+ })
+
+ function createStream (strict, opt) {
+ return new SAXStream(strict, opt)
+ }
+
+ function SAXStream (strict, opt) {
+ if (!(this instanceof SAXStream)) {
+ return new SAXStream(strict, opt)
+ }
+
+ Stream.apply(this)
+
+ this._parser = new SAXParser(strict, opt)
+ this.writable = true
+ this.readable = true
+
+ var me = this
+
+ this._parser.onend = function () {
+ me.emit('end')
+ }
+
+ this._parser.onerror = function (er) {
+ me.emit('error', er)
+
+ // if didn't throw, then means error was handled.
+ // go ahead and clear error, so we can write again.
+ me._parser.error = null
+ }
+
+ this._decoder = null
+
+ streamWraps.forEach(function (ev) {
+ Object.defineProperty(me, 'on' + ev, {
+ get: function () {
+ return me._parser['on' + ev]
+ },
+ set: function (h) {
+ if (!h) {
+ me.removeAllListeners(ev)
+ me._parser['on' + ev] = h
+ return h
+ }
+ me.on(ev, h)
+ },
+ enumerable: true,
+ configurable: false
+ })
+ })
+ }
+
+ SAXStream.prototype = Object.create(Stream.prototype, {
+ constructor: {
+ value: SAXStream
+ }
+ })
+
+ SAXStream.prototype.write = function (data) {
+ if (typeof Buffer === 'function' &&
+ typeof Buffer.isBuffer === 'function' &&
+ Buffer.isBuffer(data)) {
+ if (!this._decoder) {
+ var SD = require('string_decoder').StringDecoder
+ this._decoder = new SD('utf8')
+ }
+ data = this._decoder.write(data)
+ }
+
+ this._parser.write(data.toString())
+ this.emit('data', data)
+ return true
+ }
+
+ SAXStream.prototype.end = function (chunk) {
+ if (chunk && chunk.length) {
+ this.write(chunk)
+ }
+ this._parser.end()
+ return true
+ }
+
+ SAXStream.prototype.on = function (ev, handler) {
+ var me = this
+ if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {
+ me._parser['on' + ev] = function () {
+ var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
+ args.splice(0, 0, ev)
+ me.emit.apply(me, args)
+ }
+ }
+
+ return Stream.prototype.on.call(me, ev, handler)
+ }
+
+ // this really needs to be replaced with character classes.
+ // XML allows all manner of ridiculous numbers and digits.
+ var CDATA = '[CDATA['
+ var DOCTYPE = 'DOCTYPE'
+ var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'
+ var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'
+ var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
+
+ // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
+ // This implementation works on strings, a single character at a time
+ // as such, it cannot ever support astral-plane characters (10000-EFFFF)
+ // without a significant breaking change to either this parser, or the
+ // JavaScript language. Implementation of an emoji-capable xml parser
+ // is left as an exercise for the reader.
+ var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+
+ var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
+
+ var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+ var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
+
+ function isWhitespace (c) {
+ return c === ' ' || c === '\n' || c === '\r' || c === '\t'
+ }
+
+ function isQuote (c) {
+ return c === '"' || c === '\''
+ }
+
+ function isAttribEnd (c) {
+ return c === '>' || isWhitespace(c)
+ }
+
+ function isMatch (regex, c) {
+ return regex.test(c)
+ }
+
+ function notMatch (regex, c) {
+ return !isMatch(regex, c)
+ }
+
+ var S = 0
+ sax.STATE = {
+ BEGIN: S++, // leading byte order mark or whitespace
+ BEGIN_WHITESPACE: S++, // leading whitespace
+ TEXT: S++, // general stuff
+ TEXT_ENTITY: S++, // &amp and such.
+ OPEN_WAKA: S++, // <
+ SGML_DECL: S++, // <!BLARG
+ SGML_DECL_QUOTED: S++, // <!BLARG foo "bar
+ DOCTYPE: S++, // <!DOCTYPE
+ DOCTYPE_QUOTED: S++, // <!DOCTYPE "//blah
+ DOCTYPE_DTD: S++, // <!DOCTYPE "//blah" [ ...
+ DOCTYPE_DTD_QUOTED: S++, // <!DOCTYPE "//blah" [ "foo
+ COMMENT_STARTING: S++, // <!-
+ COMMENT: S++, // <!--
+ COMMENT_ENDING: S++, // <!-- blah -
+ COMMENT_ENDED: S++, // <!-- blah --
+ CDATA: S++, // <![CDATA[ something
+ CDATA_ENDING: S++, // ]
+ CDATA_ENDING_2: S++, // ]]
+ PROC_INST: S++, // <?hi
+ PROC_INST_BODY: S++, // <?hi there
+ PROC_INST_ENDING: S++, // <?hi "there" ?
+ OPEN_TAG: S++, // <strong
+ OPEN_TAG_SLASH: S++, // <strong /
+ ATTRIB: S++, // <a
+ ATTRIB_NAME: S++, // <a foo
+ ATTRIB_NAME_SAW_WHITE: S++, // <a foo _
+ ATTRIB_VALUE: S++, // <a foo=
+ ATTRIB_VALUE_QUOTED: S++, // <a foo="bar
+ ATTRIB_VALUE_CLOSED: S++, // <a foo="bar"
+ ATTRIB_VALUE_UNQUOTED: S++, // <a foo=bar
+ ATTRIB_VALUE_ENTITY_Q: S++, // <foo bar="&quot;"
+ ATTRIB_VALUE_ENTITY_U: S++, // <foo bar=&quot
+ CLOSE_TAG: S++, // </a
+ CLOSE_TAG_SAW_WHITE: S++, // </a >
+ SCRIPT: S++, // <script> ...
+ SCRIPT_ENDING: S++ // <script> ... <
+ }
+
+ sax.XML_ENTITIES = {
+ 'amp': '&',
+ 'gt': '>',
+ 'lt': '<',
+ 'quot': '"',
+ 'apos': "'"
+ }
+
+ sax.ENTITIES = {
+ 'amp': '&',
+ 'gt': '>',
+ 'lt': '<',
+ 'quot': '"',
+ 'apos': "'",
+ 'AElig': 198,
+ 'Aacute': 193,
+ 'Acirc': 194,
+ 'Agrave': 192,
+ 'Aring': 197,
+ 'Atilde': 195,
+ 'Auml': 196,
+ 'Ccedil': 199,
+ 'ETH': 208,
+ 'Eacute': 201,
+ 'Ecirc': 202,
+ 'Egrave': 200,
+ 'Euml': 203,
+ 'Iacute': 205,
+ 'Icirc': 206,
+ 'Igrave': 204,
+ 'Iuml': 207,
+ 'Ntilde': 209,
+ 'Oacute': 211,
+ 'Ocirc': 212,
+ 'Ograve': 210,
+ 'Oslash': 216,
+ 'Otilde': 213,
+ 'Ouml': 214,
+ 'THORN': 222,
+ 'Uacute': 218,
+ 'Ucirc': 219,
+ 'Ugrave': 217,
+ 'Uuml': 220,
+ 'Yacute': 221,
+ 'aacute': 225,
+ 'acirc': 226,
+ 'aelig': 230,
+ 'agrave': 224,
+ 'aring': 229,
+ 'atilde': 227,
+ 'auml': 228,
+ 'ccedil': 231,
+ 'eacute': 233,
+ 'ecirc': 234,
+ 'egrave': 232,
+ 'eth': 240,
+ 'euml': 235,
+ 'iacute': 237,
+ 'icirc': 238,
+ 'igrave': 236,
+ 'iuml': 239,
+ 'ntilde': 241,
+ 'oacute': 243,
+ 'ocirc': 244,
+ 'ograve': 242,
+ 'oslash': 248,
+ 'otilde': 245,
+ 'ouml': 246,
+ 'szlig': 223,
+ 'thorn': 254,
+ 'uacute': 250,
+ 'ucirc': 251,
+ 'ugrave': 249,
+ 'uuml': 252,
+ 'yacute': 253,
+ 'yuml': 255,
+ 'copy': 169,
+ 'reg': 174,
+ 'nbsp': 160,
+ 'iexcl': 161,
+ 'cent': 162,
+ 'pound': 163,
+ 'curren': 164,
+ 'yen': 165,
+ 'brvbar': 166,
+ 'sect': 167,
+ 'uml': 168,
+ 'ordf': 170,
+ 'laquo': 171,
+ 'not': 172,
+ 'shy': 173,
+ 'macr': 175,
+ 'deg': 176,
+ 'plusmn': 177,
+ 'sup1': 185,
+ 'sup2': 178,
+ 'sup3': 179,
+ 'acute': 180,
+ 'micro': 181,
+ 'para': 182,
+ 'middot': 183,
+ 'cedil': 184,
+ 'ordm': 186,
+ 'raquo': 187,
+ 'frac14': 188,
+ 'frac12': 189,
+ 'frac34': 190,
+ 'iquest': 191,
+ 'times': 215,
+ 'divide': 247,
+ 'OElig': 338,
+ 'oelig': 339,
+ 'Scaron': 352,
+ 'scaron': 353,
+ 'Yuml': 376,
+ 'fnof': 402,
+ 'circ': 710,
+ 'tilde': 732,
+ 'Alpha': 913,
+ 'Beta': 914,
+ 'Gamma': 915,
+ 'Delta': 916,
+ 'Epsilon': 917,
+ 'Zeta': 918,
+ 'Eta': 919,
+ 'Theta': 920,
+ 'Iota': 921,
+ 'Kappa': 922,
+ 'Lambda': 923,
+ 'Mu': 924,
+ 'Nu': 925,
+ 'Xi': 926,
+ 'Omicron': 927,
+ 'Pi': 928,
+ 'Rho': 929,
+ 'Sigma': 931,
+ 'Tau': 932,
+ 'Upsilon': 933,
+ 'Phi': 934,
+ 'Chi': 935,
+ 'Psi': 936,
+ 'Omega': 937,
+ 'alpha': 945,
+ 'beta': 946,
+ 'gamma': 947,
+ 'delta': 948,
+ 'epsilon': 949,
+ 'zeta': 950,
+ 'eta': 951,
+ 'theta': 952,
+ 'iota': 953,
+ 'kappa': 954,
+ 'lambda': 955,
+ 'mu': 956,
+ 'nu': 957,
+ 'xi': 958,
+ 'omicron': 959,
+ 'pi': 960,
+ 'rho': 961,
+ 'sigmaf': 962,
+ 'sigma': 963,
+ 'tau': 964,
+ 'upsilon': 965,
+ 'phi': 966,
+ 'chi': 967,
+ 'psi': 968,
+ 'omega': 969,
+ 'thetasym': 977,
+ 'upsih': 978,
+ 'piv': 982,
+ 'ensp': 8194,
+ 'emsp': 8195,
+ 'thinsp': 8201,
+ 'zwnj': 8204,
+ 'zwj': 8205,
+ 'lrm': 8206,
+ 'rlm': 8207,
+ 'ndash': 8211,
+ 'mdash': 8212,
+ 'lsquo': 8216,
+ 'rsquo': 8217,
+ 'sbquo': 8218,
+ 'ldquo': 8220,
+ 'rdquo': 8221,
+ 'bdquo': 8222,
+ 'dagger': 8224,
+ 'Dagger': 8225,
+ 'bull': 8226,
+ 'hellip': 8230,
+ 'permil': 8240,
+ 'prime': 8242,
+ 'Prime': 8243,
+ 'lsaquo': 8249,
+ 'rsaquo': 8250,
+ 'oline': 8254,
+ 'frasl': 8260,
+ 'euro': 8364,
+ 'image': 8465,
+ 'weierp': 8472,
+ 'real': 8476,
+ 'trade': 8482,
+ 'alefsym': 8501,
+ 'larr': 8592,
+ 'uarr': 8593,
+ 'rarr': 8594,
+ 'darr': 8595,
+ 'harr': 8596,
+ 'crarr': 8629,
+ 'lArr': 8656,
+ 'uArr': 8657,
+ 'rArr': 8658,
+ 'dArr': 8659,
+ 'hArr': 8660,
+ 'forall': 8704,
+ 'part': 8706,
+ 'exist': 8707,
+ 'empty': 8709,
+ 'nabla': 8711,
+ 'isin': 8712,
+ 'notin': 8713,
+ 'ni': 8715,
+ 'prod': 8719,
+ 'sum': 8721,
+ 'minus': 8722,
+ 'lowast': 8727,
+ 'radic': 8730,
+ 'prop': 8733,
+ 'infin': 8734,
+ 'ang': 8736,
+ 'and': 8743,
+ 'or': 8744,
+ 'cap': 8745,
+ 'cup': 8746,
+ 'int': 8747,
+ 'there4': 8756,
+ 'sim': 8764,
+ 'cong': 8773,
+ 'asymp': 8776,
+ 'ne': 8800,
+ 'equiv': 8801,
+ 'le': 8804,
+ 'ge': 8805,
+ 'sub': 8834,
+ 'sup': 8835,
+ 'nsub': 8836,
+ 'sube': 8838,
+ 'supe': 8839,
+ 'oplus': 8853,
+ 'otimes': 8855,
+ 'perp': 8869,
+ 'sdot': 8901,
+ 'lceil': 8968,
+ 'rceil': 8969,
+ 'lfloor': 8970,
+ 'rfloor': 8971,
+ 'lang': 9001,
+ 'rang': 9002,
+ 'loz': 9674,
+ 'spades': 9824,
+ 'clubs': 9827,
+ 'hearts': 9829,
+ 'diams': 9830
+ }
+
+ Object.keys(sax.ENTITIES).forEach(function (key) {
+ var e = sax.ENTITIES[key]
+ var s = typeof e === 'number' ? String.fromCharCode(e) : e
+ sax.ENTITIES[key] = s
+ })
+
+ for (var s in sax.STATE) {
+ sax.STATE[sax.STATE[s]] = s
+ }
+
+ // shorthand
+ S = sax.STATE
+
+ function emit (parser, event, data) {
+ parser[event] && parser[event](data)
+ }
+
+ function emitNode (parser, nodeType, data) {
+ if (parser.textNode) closeText(parser)
+ emit(parser, nodeType, data)
+ }
+
+ function closeText (parser) {
+ parser.textNode = textopts(parser.opt, parser.textNode)
+ if (parser.textNode) emit(parser, 'ontext', parser.textNode)
+ parser.textNode = ''
+ }
+
+ function textopts (opt, text) {
+ if (opt.trim) text = text.trim()
+ if (opt.normalize) text = text.replace(/\s+/g, ' ')
+ return text
+ }
+
+ function error (parser, er) {
+ closeText(parser)
+ if (parser.trackPosition) {
+ er += '\nLine: ' + parser.line +
+ '\nColumn: ' + parser.column +
+ '\nChar: ' + parser.c
+ }
+ er = new Error(er)
+ parser.error = er
+ emit(parser, 'onerror', er)
+ return parser
+ }
+
+ function end (parser) {
+ if (parser.sawRoot && !parser.closedRoot) strictFail(parser, 'Unclosed root tag')
+ if ((parser.state !== S.BEGIN) &&
+ (parser.state !== S.BEGIN_WHITESPACE) &&
+ (parser.state !== S.TEXT)) {
+ error(parser, 'Unexpected end')
+ }
+ closeText(parser)
+ parser.c = ''
+ parser.closed = true
+ emit(parser, 'onend')
+ SAXParser.call(parser, parser.strict, parser.opt)
+ return parser
+ }
+
+ function strictFail (parser, message) {
+ if (typeof parser !== 'object' || !(parser instanceof SAXParser)) {
+ throw new Error('bad call to strictFail')
+ }
+ if (parser.strict) {
+ error(parser, message)
+ }
+ }
+
+ function newTag (parser) {
+ if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ var tag = parser.tag = { name: parser.tagName, attributes: {} }
+
+ // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
+ if (parser.opt.xmlns) {
+ tag.ns = parent.ns
+ }
+ parser.attribList.length = 0
+ emitNode(parser, 'onopentagstart', tag)
+ }
+
+ function qname (name, attribute) {
+ var i = name.indexOf(':')
+ var qualName = i < 0 ? [ '', name ] : name.split(':')
+ var prefix = qualName[0]
+ var local = qualName[1]
+
+ // <x "xmlns"="http://foo">
+ if (attribute && name === 'xmlns') {
+ prefix = 'xmlns'
+ local = ''
+ }
+
+ return { prefix: prefix, local: local }
+ }
+
+ function attrib (parser) {
+ if (!parser.strict) {
+ parser.attribName = parser.attribName[parser.looseCase]()
+ }
+
+ if (parser.attribList.indexOf(parser.attribName) !== -1 ||
+ parser.tag.attributes.hasOwnProperty(parser.attribName)) {
+ parser.attribName = parser.attribValue = ''
+ return
+ }
+
+ if (parser.opt.xmlns) {
+ var qn = qname(parser.attribName, true)
+ var prefix = qn.prefix
+ var local = qn.local
+
+ if (prefix === 'xmlns') {
+ // namespace binding attribute. push the binding into scope
+ if (local === 'xml' && parser.attribValue !== XML_NAMESPACE) {
+ strictFail(parser,
+ 'xml: prefix must be bound to ' + XML_NAMESPACE + '\n' +
+ 'Actual: ' + parser.attribValue)
+ } else if (local === 'xmlns' && parser.attribValue !== XMLNS_NAMESPACE) {
+ strictFail(parser,
+ 'xmlns: prefix must be bound to ' + XMLNS_NAMESPACE + '\n' +
+ 'Actual: ' + parser.attribValue)
+ } else {
+ var tag = parser.tag
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (tag.ns === parent.ns) {
+ tag.ns = Object.create(parent.ns)
+ }
+ tag.ns[local] = parser.attribValue
+ }
+ }
+
+ // defer onattribute events until all attributes have been seen
+ // so any new bindings can take effect. preserve attribute order
+ // so deferred events can be emitted in document order
+ parser.attribList.push([parser.attribName, parser.attribValue])
+ } else {
+ // in non-xmlns mode, we can emit the event right away
+ parser.tag.attributes[parser.attribName] = parser.attribValue
+ emitNode(parser, 'onattribute', {
+ name: parser.attribName,
+ value: parser.attribValue
+ })
+ }
+
+ parser.attribName = parser.attribValue = ''
+ }
+
+ function openTag (parser, selfClosing) {
+ if (parser.opt.xmlns) {
+ // emit namespace binding events
+ var tag = parser.tag
+
+ // add namespace info to tag
+ var qn = qname(parser.tagName)
+ tag.prefix = qn.prefix
+ tag.local = qn.local
+ tag.uri = tag.ns[qn.prefix] || ''
+
+ if (tag.prefix && !tag.uri) {
+ strictFail(parser, 'Unbound namespace prefix: ' +
+ JSON.stringify(parser.tagName))
+ tag.uri = qn.prefix
+ }
+
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (tag.ns && parent.ns !== tag.ns) {
+ Object.keys(tag.ns).forEach(function (p) {
+ emitNode(parser, 'onopennamespace', {
+ prefix: p,
+ uri: tag.ns[p]
+ })
+ })
+ }
+
+ // handle deferred onattribute events
+ // Note: do not apply default ns to attributes:
+ // http://www.w3.org/TR/REC-xml-names/#defaulting
+ for (var i = 0, l = parser.attribList.length; i < l; i++) {
+ var nv = parser.attribList[i]
+ var name = nv[0]
+ var value = nv[1]
+ var qualName = qname(name, true)
+ var prefix = qualName.prefix
+ var local = qualName.local
+ var uri = prefix === '' ? '' : (tag.ns[prefix] || '')
+ var a = {
+ name: name,
+ value: value,
+ prefix: prefix,
+ local: local,
+ uri: uri
+ }
+
+ // if there's any attributes with an undefined namespace,
+ // then fail on them now.
+ if (prefix && prefix !== 'xmlns' && !uri) {
+ strictFail(parser, 'Unbound namespace prefix: ' +
+ JSON.stringify(prefix))
+ a.uri = prefix
+ }
+ parser.tag.attributes[name] = a
+ emitNode(parser, 'onattribute', a)
+ }
+ parser.attribList.length = 0
+ }
+
+ parser.tag.isSelfClosing = !!selfClosing
+
+ // process the tag
+ parser.sawRoot = true
+ parser.tags.push(parser.tag)
+ emitNode(parser, 'onopentag', parser.tag)
+ if (!selfClosing) {
+ // special case for <script> in non-strict mode.
+ if (!parser.noscript && parser.tagName.toLowerCase() === 'script') {
+ parser.state = S.SCRIPT
+ } else {
+ parser.state = S.TEXT
+ }
+ parser.tag = null
+ parser.tagName = ''
+ }
+ parser.attribName = parser.attribValue = ''
+ parser.attribList.length = 0
+ }
+
+ function closeTag (parser) {
+ if (!parser.tagName) {
+ strictFail(parser, 'Weird empty close tag.')
+ parser.textNode += '</>'
+ parser.state = S.TEXT
+ return
+ }
+
+ if (parser.script) {
+ if (parser.tagName !== 'script') {
+ parser.script += '</' + parser.tagName + '>'
+ parser.tagName = ''
+ parser.state = S.SCRIPT
+ return
+ }
+ emitNode(parser, 'onscript', parser.script)
+ parser.script = ''
+ }
+
+ // first make sure that the closing tag actually exists.
+ // <a><b></c></b></a> will close everything, otherwise.
+ var t = parser.tags.length
+ var tagName = parser.tagName
+ if (!parser.strict) {
+ tagName = tagName[parser.looseCase]()
+ }
+ var closeTo = tagName
+ while (t--) {
+ var close = parser.tags[t]
+ if (close.name !== closeTo) {
+ // fail the first time in strict mode
+ strictFail(parser, 'Unexpected close tag')
+ } else {
+ break
+ }
+ }
+
+ // didn't find it. we already failed for strict, so just abort.
+ if (t < 0) {
+ strictFail(parser, 'Unmatched closing tag: ' + parser.tagName)
+ parser.textNode += '</' + parser.tagName + '>'
+ parser.state = S.TEXT
+ return
+ }
+ parser.tagName = tagName
+ var s = parser.tags.length
+ while (s-- > t) {
+ var tag = parser.tag = parser.tags.pop()
+ parser.tagName = parser.tag.name
+ emitNode(parser, 'onclosetag', parser.tagName)
+
+ var x = {}
+ for (var i in tag.ns) {
+ x[i] = tag.ns[i]
+ }
+
+ var parent = parser.tags[parser.tags.length - 1] || parser
+ if (parser.opt.xmlns && tag.ns !== parent.ns) {
+ // remove namespace bindings introduced by tag
+ Object.keys(tag.ns).forEach(function (p) {
+ var n = tag.ns[p]
+ emitNode(parser, 'onclosenamespace', { prefix: p, uri: n })
+ })
+ }
+ }
+ if (t === 0) parser.closedRoot = true
+ parser.tagName = parser.attribValue = parser.attribName = ''
+ parser.attribList.length = 0
+ parser.state = S.TEXT
+ }
+
+ function parseEntity (parser) {
+ var entity = parser.entity
+ var entityLC = entity.toLowerCase()
+ var num
+ var numStr = ''
+
+ if (parser.ENTITIES[entity]) {
+ return parser.ENTITIES[entity]
+ }
+ if (parser.ENTITIES[entityLC]) {
+ return parser.ENTITIES[entityLC]
+ }
+ entity = entityLC
+ if (entity.charAt(0) === '#') {
+ if (entity.charAt(1) === 'x') {
+ entity = entity.slice(2)
+ num = parseInt(entity, 16)
+ numStr = num.toString(16)
+ } else {
+ entity = entity.slice(1)
+ num = parseInt(entity, 10)
+ numStr = num.toString(10)
+ }
+ }
+ entity = entity.replace(/^0+/, '')
+ if (isNaN(num) || numStr.toLowerCase() !== entity) {
+ strictFail(parser, 'Invalid character entity')
+ return '&' + parser.entity + ';'
+ }
+
+ return String.fromCodePoint(num)
+ }
+
+ function beginWhiteSpace (parser, c) {
+ if (c === '<') {
+ parser.state = S.OPEN_WAKA
+ parser.startTagPosition = parser.position
+ } else if (!isWhitespace(c)) {
+ // have to process this as a text node.
+ // weird, but happens.
+ strictFail(parser, 'Non-whitespace before first tag.')
+ parser.textNode = c
+ parser.state = S.TEXT
+ }
+ }
+
+ function charAt (chunk, i) {
+ var result = ''
+ if (i < chunk.length) {
+ result = chunk.charAt(i)
+ }
+ return result
+ }
+
+ function write (chunk) {
+ var parser = this
+ if (this.error) {
+ throw this.error
+ }
+ if (parser.closed) {
+ return error(parser,
+ 'Cannot write after close. Assign an onready handler.')
+ }
+ if (chunk === null) {
+ return end(parser)
+ }
+ if (typeof chunk === 'object') {
+ chunk = chunk.toString()
+ }
+ var i = 0
+ var c = ''
+ while (true) {
+ c = charAt(chunk, i++)
+ parser.c = c
+
+ if (!c) {
+ break
+ }
+
+ if (parser.trackPosition) {
+ parser.position++
+ if (c === '\n') {
+ parser.line++
+ parser.column = 0
+ } else {
+ parser.column++
+ }
+ }
+
+ switch (parser.state) {
+ case S.BEGIN:
+ parser.state = S.BEGIN_WHITESPACE
+ if (c === '\uFEFF') {
+ continue
+ }
+ beginWhiteSpace(parser, c)
+ continue
+
+ case S.BEGIN_WHITESPACE:
+ beginWhiteSpace(parser, c)
+ continue
+
+ case S.TEXT:
+ if (parser.sawRoot && !parser.closedRoot) {
+ var starti = i - 1
+ while (c && c !== '<' && c !== '&') {
+ c = charAt(chunk, i++)
+ if (c && parser.trackPosition) {
+ parser.position++
+ if (c === '\n') {
+ parser.line++
+ parser.column = 0
+ } else {
+ parser.column++
+ }
+ }
+ }
+ parser.textNode += chunk.substring(starti, i - 1)
+ }
+ if (c === '<' && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
+ parser.state = S.OPEN_WAKA
+ parser.startTagPosition = parser.position
+ } else {
+ if (!isWhitespace(c) && (!parser.sawRoot || parser.closedRoot)) {
+ strictFail(parser, 'Text data outside of root node.')
+ }
+ if (c === '&') {
+ parser.state = S.TEXT_ENTITY
+ } else {
+ parser.textNode += c
+ }
+ }
+ continue
+
+ case S.SCRIPT:
+ // only non-strict
+ if (c === '<') {
+ parser.state = S.SCRIPT_ENDING
+ } else {
+ parser.script += c
+ }
+ continue
+
+ case S.SCRIPT_ENDING:
+ if (c === '/') {
+ parser.state = S.CLOSE_TAG
+ } else {
+ parser.script += '<' + c
+ parser.state = S.SCRIPT
+ }
+ continue
+
+ case S.OPEN_WAKA:
+ // either a /, ?, !, or text is coming next.
+ if (c === '!') {
+ parser.state = S.SGML_DECL
+ parser.sgmlDecl = ''
+ } else if (isWhitespace(c)) {
+ // wait for it...
+ } else if (isMatch(nameStart, c)) {
+ parser.state = S.OPEN_TAG
+ parser.tagName = c
+ } else if (c === '/') {
+ parser.state = S.CLOSE_TAG
+ parser.tagName = ''
+ } else if (c === '?') {
+ parser.state = S.PROC_INST
+ parser.procInstName = parser.procInstBody = ''
+ } else {
+ strictFail(parser, 'Unencoded <')
+ // if there was some whitespace, then add that in.
+ if (parser.startTagPosition + 1 < parser.position) {
+ var pad = parser.position - parser.startTagPosition
+ c = new Array(pad).join(' ') + c
+ }
+ parser.textNode += '<' + c
+ parser.state = S.TEXT
+ }
+ continue
+
+ case S.SGML_DECL:
+ if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
+ emitNode(parser, 'onopencdata')
+ parser.state = S.CDATA
+ parser.sgmlDecl = ''
+ parser.cdata = ''
+ } else if (parser.sgmlDecl + c === '--') {
+ parser.state = S.COMMENT
+ parser.comment = ''
+ parser.sgmlDecl = ''
+ } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
+ parser.state = S.DOCTYPE
+ if (parser.doctype || parser.sawRoot) {
+ strictFail(parser,
+ 'Inappropriately located doctype declaration')
+ }
+ parser.doctype = ''
+ parser.sgmlDecl = ''
+ } else if (c === '>') {
+ emitNode(parser, 'onsgmldeclaration', parser.sgmlDecl)
+ parser.sgmlDecl = ''
+ parser.state = S.TEXT
+ } else if (isQuote(c)) {
+ parser.state = S.SGML_DECL_QUOTED
+ parser.sgmlDecl += c
+ } else {
+ parser.sgmlDecl += c
+ }
+ continue
+
+ case S.SGML_DECL_QUOTED:
+ if (c === parser.q) {
+ parser.state = S.SGML_DECL
+ parser.q = ''
+ }
+ parser.sgmlDecl += c
+ continue
+
+ case S.DOCTYPE:
+ if (c === '>') {
+ parser.state = S.TEXT
+ emitNode(parser, 'ondoctype', parser.doctype)
+ parser.doctype = true // just remember that we saw it.
+ } else {
+ parser.doctype += c
+ if (c === '[') {
+ parser.state = S.DOCTYPE_DTD
+ } else if (isQuote(c)) {
+ parser.state = S.DOCTYPE_QUOTED
+ parser.q = c
+ }
+ }
+ continue
+
+ case S.DOCTYPE_QUOTED:
+ parser.doctype += c
+ if (c === parser.q) {
+ parser.q = ''
+ parser.state = S.DOCTYPE
+ }
+ continue
+
+ case S.DOCTYPE_DTD:
+ parser.doctype += c
+ if (c === ']') {
+ parser.state = S.DOCTYPE
+ } else if (isQuote(c)) {
+ parser.state = S.DOCTYPE_DTD_QUOTED
+ parser.q = c
+ }
+ continue
+
+ case S.DOCTYPE_DTD_QUOTED:
+ parser.doctype += c
+ if (c === parser.q) {
+ parser.state = S.DOCTYPE_DTD
+ parser.q = ''
+ }
+ continue
+
+ case S.COMMENT:
+ if (c === '-') {
+ parser.state = S.COMMENT_ENDING
+ } else {
+ parser.comment += c
+ }
+ continue
+
+ case S.COMMENT_ENDING:
+ if (c === '-') {
+ parser.state = S.COMMENT_ENDED
+ parser.comment = textopts(parser.opt, parser.comment)
+ if (parser.comment) {
+ emitNode(parser, 'oncomment', parser.comment)
+ }
+ parser.comment = ''
+ } else {
+ parser.comment += '-' + c
+ parser.state = S.COMMENT
+ }
+ continue
+
+ case S.COMMENT_ENDED:
+ if (c !== '>') {
+ strictFail(parser, 'Malformed comment')
+ // allow <!-- blah -- bloo --> in non-strict mode,
+ // which is a comment of " blah -- bloo "
+ parser.comment += '--' + c
+ parser.state = S.COMMENT
+ } else {
+ parser.state = S.TEXT
+ }
+ continue
+
+ case S.CDATA:
+ if (c === ']') {
+ parser.state = S.CDATA_ENDING
+ } else {
+ parser.cdata += c
+ }
+ continue
+
+ case S.CDATA_ENDING:
+ if (c === ']') {
+ parser.state = S.CDATA_ENDING_2
+ } else {
+ parser.cdata += ']' + c
+ parser.state = S.CDATA
+ }
+ continue
+
+ case S.CDATA_ENDING_2:
+ if (c === '>') {
+ if (parser.cdata) {
+ emitNode(parser, 'oncdata', parser.cdata)
+ }
+ emitNode(parser, 'onclosecdata')
+ parser.cdata = ''
+ parser.state = S.TEXT
+ } else if (c === ']') {
+ parser.cdata += ']'
+ } else {
+ parser.cdata += ']]' + c
+ parser.state = S.CDATA
+ }
+ continue
+
+ case S.PROC_INST:
+ if (c === '?') {
+ parser.state = S.PROC_INST_ENDING
+ } else if (isWhitespace(c)) {
+ parser.state = S.PROC_INST_BODY
+ } else {
+ parser.procInstName += c
+ }
+ continue
+
+ case S.PROC_INST_BODY:
+ if (!parser.procInstBody && isWhitespace(c)) {
+ continue
+ } else if (c === '?') {
+ parser.state = S.PROC_INST_ENDING
+ } else {
+ parser.procInstBody += c
+ }
+ continue
+
+ case S.PROC_INST_ENDING:
+ if (c === '>') {
+ emitNode(parser, 'onprocessinginstruction', {
+ name: parser.procInstName,
+ body: parser.procInstBody
+ })
+ parser.procInstName = parser.procInstBody = ''
+ parser.state = S.TEXT
+ } else {
+ parser.procInstBody += '?' + c
+ parser.state = S.PROC_INST_BODY
+ }
+ continue
+
+ case S.OPEN_TAG:
+ if (isMatch(nameBody, c)) {
+ parser.tagName += c
+ } else {
+ newTag(parser)
+ if (c === '>') {
+ openTag(parser)
+ } else if (c === '/') {
+ parser.state = S.OPEN_TAG_SLASH
+ } else {
+ if (!isWhitespace(c)) {
+ strictFail(parser, 'Invalid character in tag name')
+ }
+ parser.state = S.ATTRIB
+ }
+ }
+ continue
+
+ case S.OPEN_TAG_SLASH:
+ if (c === '>') {
+ openTag(parser, true)
+ closeTag(parser)
+ } else {
+ strictFail(parser, 'Forward-slash in opening tag not followed by >')
+ parser.state = S.ATTRIB
+ }
+ continue
+
+ case S.ATTRIB:
+ // haven't read the attribute name yet.
+ if (isWhitespace(c)) {
+ continue
+ } else if (c === '>') {
+ openTag(parser)
+ } else if (c === '/') {
+ parser.state = S.OPEN_TAG_SLASH
+ } else if (isMatch(nameStart, c)) {
+ parser.attribName = c
+ parser.attribValue = ''
+ parser.state = S.ATTRIB_NAME
+ } else {
+ strictFail(parser, 'Invalid attribute name')
+ }
+ continue
+
+ case S.ATTRIB_NAME:
+ if (c === '=') {
+ parser.state = S.ATTRIB_VALUE
+ } else if (c === '>') {
+ strictFail(parser, 'Attribute without value')
+ parser.attribValue = parser.attribName
+ attrib(parser)
+ openTag(parser)
+ } else if (isWhitespace(c)) {
+ parser.state = S.ATTRIB_NAME_SAW_WHITE
+ } else if (isMatch(nameBody, c)) {
+ parser.attribName += c
+ } else {
+ strictFail(parser, 'Invalid attribute name')
+ }
+ continue
+
+ case S.ATTRIB_NAME_SAW_WHITE:
+ if (c === '=') {
+ parser.state = S.ATTRIB_VALUE
+ } else if (isWhitespace(c)) {
+ continue
+ } else {
+ strictFail(parser, 'Attribute without value')
+ parser.tag.attributes[parser.attribName] = ''
+ parser.attribValue = ''
+ emitNode(parser, 'onattribute', {
+ name: parser.attribName,
+ value: ''
+ })
+ parser.attribName = ''
+ if (c === '>') {
+ openTag(parser)
+ } else if (isMatch(nameStart, c)) {
+ parser.attribName = c
+ parser.state = S.ATTRIB_NAME
+ } else {
+ strictFail(parser, 'Invalid attribute name')
+ parser.state = S.ATTRIB
+ }
+ }
+ continue
+
+ case S.ATTRIB_VALUE:
+ if (isWhitespace(c)) {
+ continue
+ } else if (isQuote(c)) {
+ parser.q = c
+ parser.state = S.ATTRIB_VALUE_QUOTED
+ } else {
+ strictFail(parser, 'Unquoted attribute value')
+ parser.state = S.ATTRIB_VALUE_UNQUOTED
+ parser.attribValue = c
+ }
+ continue
+
+ case S.ATTRIB_VALUE_QUOTED:
+ if (c !== parser.q) {
+ if (c === '&') {
+ parser.state = S.ATTRIB_VALUE_ENTITY_Q
+ } else {
+ parser.attribValue += c
+ }
+ continue
+ }
+ attrib(parser)
+ parser.q = ''
+ parser.state = S.ATTRIB_VALUE_CLOSED
+ continue
+
+ case S.ATTRIB_VALUE_CLOSED:
+ if (isWhitespace(c)) {
+ parser.state = S.ATTRIB
+ } else if (c === '>') {
+ openTag(parser)
+ } else if (c === '/') {
+ parser.state = S.OPEN_TAG_SLASH
+ } else if (isMatch(nameStart, c)) {
+ strictFail(parser, 'No whitespace between attributes')
+ parser.attribName = c
+ parser.attribValue = ''
+ parser.state = S.ATTRIB_NAME
+ } else {
+ strictFail(parser, 'Invalid attribute name')
+ }
+ continue
+
+ case S.ATTRIB_VALUE_UNQUOTED:
+ if (!isAttribEnd(c)) {
+ if (c === '&') {
+ parser.state = S.ATTRIB_VALUE_ENTITY_U
+ } else {
+ parser.attribValue += c
+ }
+ continue
+ }
+ attrib(parser)
+ if (c === '>') {
+ openTag(parser)
+ } else {
+ parser.state = S.ATTRIB
+ }
+ continue
+
+ case S.CLOSE_TAG:
+ if (!parser.tagName) {
+ if (isWhitespace(c)) {
+ continue
+ } else if (notMatch(nameStart, c)) {
+ if (parser.script) {
+ parser.script += '</' + c
+ parser.state = S.SCRIPT
+ } else {
+ strictFail(parser, 'Invalid tagname in closing tag.')
+ }
+ } else {
+ parser.tagName = c
+ }
+ } else if (c === '>') {
+ closeTag(parser)
+ } else if (isMatch(nameBody, c)) {
+ parser.tagName += c
+ } else if (parser.script) {
+ parser.script += '</' + parser.tagName
+ parser.tagName = ''
+ parser.state = S.SCRIPT
+ } else {
+ if (!isWhitespace(c)) {
+ strictFail(parser, 'Invalid tagname in closing tag')
+ }
+ parser.state = S.CLOSE_TAG_SAW_WHITE
+ }
+ continue
+
+ case S.CLOSE_TAG_SAW_WHITE:
+ if (isWhitespace(c)) {
+ continue
+ }
+ if (c === '>') {
+ closeTag(parser)
+ } else {
+ strictFail(parser, 'Invalid characters in closing tag')
+ }
+ continue
+
+ case S.TEXT_ENTITY:
+ case S.ATTRIB_VALUE_ENTITY_Q:
+ case S.ATTRIB_VALUE_ENTITY_U:
+ var returnState
+ var buffer
+ switch (parser.state) {
+ case S.TEXT_ENTITY:
+ returnState = S.TEXT
+ buffer = 'textNode'
+ break
+
+ case S.ATTRIB_VALUE_ENTITY_Q:
+ returnState = S.ATTRIB_VALUE_QUOTED
+ buffer = 'attribValue'
+ break
+
+ case S.ATTRIB_VALUE_ENTITY_U:
+ returnState = S.ATTRIB_VALUE_UNQUOTED
+ buffer = 'attribValue'
+ break
+ }
+
+ if (c === ';') {
+ parser[buffer] += parseEntity(parser)
+ parser.entity = ''
+ parser.state = returnState
+ } else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) {
+ parser.entity += c
+ } else {
+ strictFail(parser, 'Invalid character in entity name')
+ parser[buffer] += '&' + parser.entity + c
+ parser.entity = ''
+ parser.state = returnState
+ }
+
+ continue
+
+ default:
+ throw new Error(parser, 'Unknown state: ' + parser.state)
+ }
+ } // while
+
+ if (parser.position >= parser.bufferCheckPosition) {
+ checkBufferLength(parser)
+ }
+ return parser
+ }
+
+ /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
+ /* istanbul ignore next */
+ if (!String.fromCodePoint) {
+ (function () {
+ var stringFromCharCode = String.fromCharCode
+ var floor = Math.floor
+ var fromCodePoint = function () {
+ var MAX_SIZE = 0x4000
+ var codeUnits = []
+ var highSurrogate
+ var lowSurrogate
+ var index = -1
+ var length = arguments.length
+ if (!length) {
+ return ''
+ }
+ var result = ''
+ while (++index < length) {
+ var codePoint = Number(arguments[index])
+ if (
+ !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
+ codePoint < 0 || // not a valid Unicode code point
+ codePoint > 0x10FFFF || // not a valid Unicode code point
+ floor(codePoint) !== codePoint // not an integer
+ ) {
+ throw RangeError('Invalid code point: ' + codePoint)
+ }
+ if (codePoint <= 0xFFFF) { // BMP code point
+ codeUnits.push(codePoint)
+ } else { // Astral code point; split in surrogate halves
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ codePoint -= 0x10000
+ highSurrogate = (codePoint >> 10) + 0xD800
+ lowSurrogate = (codePoint % 0x400) + 0xDC00
+ codeUnits.push(highSurrogate, lowSurrogate)
+ }
+ if (index + 1 === length || codeUnits.length > MAX_SIZE) {
+ result += stringFromCharCode.apply(null, codeUnits)
+ codeUnits.length = 0
+ }
+ }
+ return result
+ }
+ /* istanbul ignore next */
+ if (Object.defineProperty) {
+ Object.defineProperty(String, 'fromCodePoint', {
+ value: fromCodePoint,
+ configurable: true,
+ writable: true
+ })
+ } else {
+ String.fromCodePoint = fromCodePoint
+ }
+ }())
+ }
+})(typeof exports === 'undefined' ? this.sax = {} : exports)
diff --git a/includes/translator/node_modules/sax/package.json b/includes/translator/node_modules/sax/package.json
new file mode 100644
index 0000000..d2039bf
--- /dev/null
+++ b/includes/translator/node_modules/sax/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "sax",
+ "description": "An evented streaming XML parser in JavaScript",
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
+ "version": "1.2.4",
+ "main": "lib/sax.js",
+ "license": "ISC",
+ "scripts": {
+ "test": "tap test/*.js --cov -j4",
+ "posttest": "standard -F test/*.js lib/*.js",
+ "preversion": "npm test",
+ "postversion": "npm publish",
+ "postpublish": "git push origin --all; git push origin --tags"
+ },
+ "repository": "git://github.com/isaacs/sax-js.git",
+ "files": [
+ "lib/sax.js",
+ "LICENSE",
+ "README.md"
+ ],
+ "devDependencies": {
+ "standard": "^8.6.0",
+ "tap": "^10.5.1"
+ }
+}
diff --git a/includes/translator/node_modules/signal-exit/LICENSE.txt b/includes/translator/node_modules/signal-exit/LICENSE.txt
new file mode 100644
index 0000000..eead04a
--- /dev/null
+++ b/includes/translator/node_modules/signal-exit/LICENSE.txt
@@ -0,0 +1,16 @@
+The ISC License
+
+Copyright (c) 2015, Contributors
+
+Permission to use, copy, modify, and/or distribute this software
+for any purpose with or without fee is hereby granted, provided
+that the above copyright notice and this permission notice
+appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
+LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/includes/translator/node_modules/signal-exit/README.md b/includes/translator/node_modules/signal-exit/README.md
new file mode 100644
index 0000000..f9c7c00
--- /dev/null
+++ b/includes/translator/node_modules/signal-exit/README.md
@@ -0,0 +1,39 @@
+# signal-exit
+
+[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit)
+[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master)
+[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit)
+[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
+
+When you want to fire an event no matter how a process exits:
+
+* reaching the end of execution.
+* explicitly having `process.exit(code)` called.
+* having `process.kill(pid, sig)` called.
+* receiving a fatal signal from outside the process
+
+Use `signal-exit`.
+
+```js
+var onExit = require('signal-exit')
+
+onExit(function (code, signal) {
+ console.log('process exited!')
+})
+```
+
+## API
+
+`var remove = onExit(function (code, signal) {}, options)`
+
+The return value of the function is a function that will remove the
+handler.
+
+Note that the function *only* fires for signals if the signal would
+cause the process to exit. That is, there are no other listeners, and
+it is a fatal signal.
+
+## Options
+
+* `alwaysLast`: Run this handler after any other signal or exit
+ handlers. This causes `process.emit` to be monkeypatched.
diff --git a/includes/translator/node_modules/signal-exit/index.js b/includes/translator/node_modules/signal-exit/index.js
new file mode 100644
index 0000000..93703f3
--- /dev/null
+++ b/includes/translator/node_modules/signal-exit/index.js
@@ -0,0 +1,202 @@
+// Note: since nyc uses this module to output coverage, any lines
+// that are in the direct sync flow of nyc's outputCoverage are
+// ignored, since we can never get coverage for them.
+// grab a reference to node's real process object right away
+var process = global.process
+
+const processOk = function (process) {
+ return process &&
+ typeof process === 'object' &&
+ typeof process.removeListener === 'function' &&
+ typeof process.emit === 'function' &&
+ typeof process.reallyExit === 'function' &&
+ typeof process.listeners === 'function' &&
+ typeof process.kill === 'function' &&
+ typeof process.pid === 'number' &&
+ typeof process.on === 'function'
+}
+
+// some kind of non-node environment, just no-op
+/* istanbul ignore if */
+if (!processOk(process)) {
+ module.exports = function () {
+ return function () {}
+ }
+} else {
+ var assert = require('assert')
+ var signals = require('./signals.js')
+ var isWin = /^win/i.test(process.platform)
+
+ var EE = require('events')
+ /* istanbul ignore if */
+ if (typeof EE !== 'function') {
+ EE = EE.EventEmitter
+ }
+
+ var emitter
+ if (process.__signal_exit_emitter__) {
+ emitter = process.__signal_exit_emitter__
+ } else {
+ emitter = process.__signal_exit_emitter__ = new EE()
+ emitter.count = 0
+ emitter.emitted = {}
+ }
+
+ // Because this emitter is a global, we have to check to see if a
+ // previous version of this library failed to enable infinite listeners.
+ // I know what you're about to say. But literally everything about
+ // signal-exit is a compromise with evil. Get used to it.
+ if (!emitter.infinite) {
+ emitter.setMaxListeners(Infinity)
+ emitter.infinite = true
+ }
+
+ module.exports = function (cb, opts) {
+ /* istanbul ignore if */
+ if (!processOk(global.process)) {
+ return function () {}
+ }
+ assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
+
+ if (loaded === false) {
+ load()
+ }
+
+ var ev = 'exit'
+ if (opts && opts.alwaysLast) {
+ ev = 'afterexit'
+ }
+
+ var remove = function () {
+ emitter.removeListener(ev, cb)
+ if (emitter.listeners('exit').length === 0 &&
+ emitter.listeners('afterexit').length === 0) {
+ unload()
+ }
+ }
+ emitter.on(ev, cb)
+
+ return remove
+ }
+
+ var unload = function unload () {
+ if (!loaded || !processOk(global.process)) {
+ return
+ }
+ loaded = false
+
+ signals.forEach(function (sig) {
+ try {
+ process.removeListener(sig, sigListeners[sig])
+ } catch (er) {}
+ })
+ process.emit = originalProcessEmit
+ process.reallyExit = originalProcessReallyExit
+ emitter.count -= 1
+ }
+ module.exports.unload = unload
+
+ var emit = function emit (event, code, signal) {
+ /* istanbul ignore if */
+ if (emitter.emitted[event]) {
+ return
+ }
+ emitter.emitted[event] = true
+ emitter.emit(event, code, signal)
+ }
+
+ // { <signal>: <listener fn>, ... }
+ var sigListeners = {}
+ signals.forEach(function (sig) {
+ sigListeners[sig] = function listener () {
+ /* istanbul ignore if */
+ if (!processOk(global.process)) {
+ return
+ }
+ // If there are no other listeners, an exit is coming!
+ // Simplest way: remove us and then re-send the signal.
+ // We know that this will kill the process, so we can
+ // safely emit now.
+ var listeners = process.listeners(sig)
+ if (listeners.length === emitter.count) {
+ unload()
+ emit('exit', null, sig)
+ /* istanbul ignore next */
+ emit('afterexit', null, sig)
+ /* istanbul ignore next */
+ if (isWin && sig === 'SIGHUP') {
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
+ // so use a supported signal instead
+ sig = 'SIGINT'
+ }
+ /* istanbul ignore next */
+ process.kill(process.pid, sig)
+ }
+ }
+ })
+
+ module.exports.signals = function () {
+ return signals
+ }
+
+ var loaded = false
+
+ var load = function load () {
+ if (loaded || !processOk(global.process)) {
+ return
+ }
+ loaded = true
+
+ // This is the number of onSignalExit's that are in play.
+ // It's important so that we can count the correct number of
+ // listeners on signals, and don't wait for the other one to
+ // handle it instead of us.
+ emitter.count += 1
+
+ signals = signals.filter(function (sig) {
+ try {
+ process.on(sig, sigListeners[sig])
+ return true
+ } catch (er) {
+ return false
+ }
+ })
+
+ process.emit = processEmit
+ process.reallyExit = processReallyExit
+ }
+ module.exports.load = load
+
+ var originalProcessReallyExit = process.reallyExit
+ var processReallyExit = function processReallyExit (code) {
+ /* istanbul ignore if */
+ if (!processOk(global.process)) {
+ return
+ }
+ process.exitCode = code || /* istanbul ignore next */ 0
+ emit('exit', process.exitCode, null)
+ /* istanbul ignore next */
+ emit('afterexit', process.exitCode, null)
+ /* istanbul ignore next */
+ originalProcessReallyExit.call(process, process.exitCode)
+ }
+
+ var originalProcessEmit = process.emit
+ var processEmit = function processEmit (ev, arg) {
+ if (ev === 'exit' && processOk(global.process)) {
+ /* istanbul ignore else */
+ if (arg !== undefined) {
+ process.exitCode = arg
+ }
+ var ret = originalProcessEmit.apply(this, arguments)
+ /* istanbul ignore next */
+ emit('exit', process.exitCode, null)
+ /* istanbul ignore next */
+ emit('afterexit', process.exitCode, null)
+ /* istanbul ignore next */
+ return ret
+ } else {
+ return originalProcessEmit.apply(this, arguments)
+ }
+ }
+}
diff --git a/includes/translator/node_modules/signal-exit/package.json b/includes/translator/node_modules/signal-exit/package.json
new file mode 100644
index 0000000..e1a0031
--- /dev/null
+++ b/includes/translator/node_modules/signal-exit/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "signal-exit",
+ "version": "3.0.7",
+ "description": "when you want to fire an event no matter how a process exits.",
+ "main": "index.js",
+ "scripts": {
+ "test": "tap",
+ "snap": "tap",
+ "preversion": "npm test",
+ "postversion": "npm publish",
+ "prepublishOnly": "git push origin --follow-tags"
+ },
+ "files": [
+ "index.js",
+ "signals.js"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/tapjs/signal-exit.git"
+ },
+ "keywords": [
+ "signal",
+ "exit"
+ ],
+ "author": "Ben Coe <ben@npmjs.com>",
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/tapjs/signal-exit/issues"
+ },
+ "homepage": "https://github.com/tapjs/signal-exit",
+ "devDependencies": {
+ "chai": "^3.5.0",
+ "coveralls": "^3.1.1",
+ "nyc": "^15.1.0",
+ "standard-version": "^9.3.1",
+ "tap": "^15.1.1"
+ }
+}
diff --git a/includes/translator/node_modules/signal-exit/signals.js b/includes/translator/node_modules/signal-exit/signals.js
new file mode 100644
index 0000000..3bd67a8
--- /dev/null
+++ b/includes/translator/node_modules/signal-exit/signals.js
@@ -0,0 +1,53 @@
+// This is not the set of all possible signals.
+//
+// It IS, however, the set of all signals that trigger
+// an exit on either Linux or BSD systems. Linux is a
+// superset of the signal names supported on BSD, and
+// the unknown signals just fail to register, so we can
+// catch that easily enough.
+//
+// Don't bother with SIGKILL. It's uncatchable, which
+// means that we can't fire any callbacks anyway.
+//
+// If a user does happen to register a handler on a non-
+// fatal signal like SIGWINCH or something, and then
+// exit, it'll end up firing `process.emit('exit')`, so
+// the handler will be fired anyway.
+//
+// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
+// artificially, inherently leave the process in a
+// state from which it is not safe to try and enter JS
+// listeners.
+module.exports = [
+ 'SIGABRT',
+ 'SIGALRM',
+ 'SIGHUP',
+ 'SIGINT',
+ 'SIGTERM'
+]
+
+if (process.platform !== 'win32') {
+ module.exports.push(
+ 'SIGVTALRM',
+ 'SIGXCPU',
+ 'SIGXFSZ',
+ 'SIGUSR2',
+ 'SIGTRAP',
+ 'SIGSYS',
+ 'SIGQUIT',
+ 'SIGIOT'
+ // should detect profiler and enable/disable accordingly.
+ // see #21
+ // 'SIGPROF'
+ )
+}
+
+if (process.platform === 'linux') {
+ module.exports.push(
+ 'SIGIO',
+ 'SIGPOLL',
+ 'SIGPWR',
+ 'SIGSTKFLT',
+ 'SIGUNUSED'
+ )
+}
diff --git a/includes/translator/node_modules/to-readable-stream/index.js b/includes/translator/node_modules/to-readable-stream/index.js
new file mode 100644
index 0000000..554bfa5
--- /dev/null
+++ b/includes/translator/node_modules/to-readable-stream/index.js
@@ -0,0 +1,11 @@
+'use strict';
+const {Readable} = require('stream');
+
+module.exports = input => (
+ new Readable({
+ read() {
+ this.push(input);
+ this.push(null);
+ }
+ })
+);
diff --git a/includes/translator/node_modules/to-readable-stream/license b/includes/translator/node_modules/to-readable-stream/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/to-readable-stream/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/to-readable-stream/package.json b/includes/translator/node_modules/to-readable-stream/package.json
new file mode 100644
index 0000000..c475a92
--- /dev/null
+++ b/includes/translator/node_modules/to-readable-stream/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "to-readable-stream",
+ "version": "1.0.0",
+ "description": "Convert a string/Buffer/Uint8Array to a readable stream",
+ "license": "MIT",
+ "repository": "sindresorhus/to-readable-stream",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "stream",
+ "readablestream",
+ "string",
+ "buffer",
+ "uint8array",
+ "from",
+ "into",
+ "to",
+ "transform",
+ "convert",
+ "readable",
+ "pull"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "get-stream": "^3.0.0",
+ "xo": "*"
+ }
+}
diff --git a/includes/translator/node_modules/to-readable-stream/readme.md b/includes/translator/node_modules/to-readable-stream/readme.md
new file mode 100644
index 0000000..fc207c5
--- /dev/null
+++ b/includes/translator/node_modules/to-readable-stream/readme.md
@@ -0,0 +1,42 @@
+# to-readable-stream [![Build Status](https://travis-ci.org/sindresorhus/to-readable-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/to-readable-stream)
+
+> Convert a string/Buffer/Uint8Array to a [readable stream](https://nodejs.org/api/stream.html#stream_readable_streams)
+
+
+## Install
+
+```
+$ npm install to-readable-stream
+```
+
+
+## Usage
+
+```js
+const toReadableStream = require('to-readable-stream');
+
+toReadableStream('🦄🌈').pipe(process.stdout);
+```
+
+
+## API
+
+### toReadableStream(input)
+
+Returns a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_readable_streams).
+
+#### input
+
+Type: `string` `Buffer` `Uint8Array`
+
+Value to convert to a stream.
+
+
+## Related
+
+- [into-stream](https://github.com/sindresorhus/into-stream) - More advanced version of this module
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/translatte/LICENSE.txt b/includes/translator/node_modules/translatte/LICENSE.txt
new file mode 100755
index 0000000..1f6d321
--- /dev/null
+++ b/includes/translator/node_modules/translatte/LICENSE.txt
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2019, ExtensionsApp <extensionsapp@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. \ No newline at end of file
diff --git a/includes/translator/node_modules/translatte/README.md b/includes/translator/node_modules/translatte/README.md
new file mode 100755
index 0000000..03e4290
--- /dev/null
+++ b/includes/translator/node_modules/translatte/README.md
@@ -0,0 +1,200 @@
+# A free and unlimited translate for NodeJS.
+
+<p align="center"><img src="https://raw.githubusercontent.com/extensionsapp/translatte/master/translatte_md.png" alt="TRANSLATTE, npm package translate for NodeJS" title="TRANSLATTE, npm package translate for NodeJS"></p>
+
+### Installation
+```
+npm i translatte
+```
+
+### Usage
+
+Translate string to German:
+
+```javascript
+const translatte = require('translatte');
+
+translatte('Do you speak Russian?', {to: 'de'}).then(res => {
+ console.log(res.text);
+}).catch(err => {
+ console.error(err);
+});
+// Ihr sprecht auf Russisch?
+```
+
+Translate string to English using proxy:
+
+```javascript
+const translatte = require('translatte');
+
+translatte('Вы говорите по-русски?', {
+ from: 'ru',
+ to: 'en',
+ agents: [
+ 'Mozilla/5.0 (Windows NT 10.0; ...',
+ 'Mozilla/4.0 (Windows NT 10.0; ...',
+ 'Mozilla/5.0 (Windows NT 10.0; ...'
+ ],
+ proxies: [
+ 'LOGIN:PASSWORD@192.0.2.100:12345',
+ 'LOGIN:PASSWORD@192.0.2.200:54321'
+ ]
+}).then(res => {
+ console.log(res);
+}).catch(err => {
+ console.error(err);
+});
+// { text: 'Do you speak Russian?',
+// from: {
+// language: {
+// didYouMean: false,
+// iso: 'ru'
+// },
+// text: {
+// autoCorrected: false,
+// value: '',
+// didYouMean: false
+// }
+// },
+// raw: '' }
+```
+
+## API
+
+### translatte(text, options)
+
+#### text
+
+Type: `string`
+
+The text to be translated.
+
+#### options
+
+Type: `object`
+
+##### from
+
+Type: `string` Default: `auto`
+
+The `text` language. Must be `auto` or one of the codes/names (not case sensitive) contained in [languages.js](https://github.com/extensionsapp/translatte/blob/master/languages.js).
+
+##### to
+
+Type: `string` Default: `en`
+
+The language in which the text should be translated. Must be one of the codes/names (not case sensitive) contained in [languages.js](https://github.com/extensionsapp/translatte/blob/master/languages.js).
+
+##### raw
+
+Type: `boolean` Default: `false`
+
+If `true`, the returned object will have a `raw` property with the raw response (`string`) from Google Translate.
+
+##### agents
+
+Type: `array` Default: `[]`
+
+An `array` of strings specifying the user-agent `['Mozilla/5.0 ...', 'Mozilla/4.0 ...']`. One random result will be selected.
+
+##### proxies
+
+Type: `array` Default: `[]`
+
+An `array` of strings `LOGIN:PASSWORD@IP:PORT` specifying the proxies `['LOGIN:PASSWORD@192.0.2.100:12345', 'LOGIN:PASSWORD@192.0.2.200:54321']`. One random result will be selected.
+
+##### tld
+
+Type: `string` Default: `com`
+
+TLD for Google translate host to be used in API calls: `https://translate.google.[tld]`
+
+##### client
+
+Type: `string` Default: `t`
+
+Query parameter client used in API calls. Can be `t|gtx`.
+
+#### priority
+
+Type: `array` Default: `['google_free']`
+
+Array of priority services.
+
+#### services
+
+Type: `object` Default: `{"google_free": true}`
+
+Objects in order of priority, if one of the services does not perform the translation, it proceeds to the next.
+
+**Supported services:**
+- `{"google_free": true}`
+ - <a href="https://translate.google.com/" target="_blank">Google Translate</a>, this service works by default. It is completely free and has no limits.
+- `{"google_v3": {"project-id": "XXX", "token": "YYY"}}`
+ - <a href="https://cloud.google.com/translate/docs/quickstart-client-libraries-v3" target="_blank">Google Cloud</a>, requires registration and credit card details. 500,000 characters per month are issued free of charge, then $20 for every million characters.
+- `{"microsoft_v3": {"key": "XXX", "location": "global"}}`
+ - <a href="https://azure.microsoft.com/en-us/pricing/details/cognitive-services/translator-text-api/" target="_blank">Microsoft Azure</a>, requires registration and credit card details. Free of charge 2,000,000 characters per month, then $10 for every million characters.
+- `{"yandex_v1": {"key": "XXX"}}`
+ - <a href="https://translate.yandex.ru/developers/keys" target="_blank">Yandex Translate</a>, requires registration. Free of charge 10,000,000 characters per month.
+- `{"yandex_v2": {"key": "XXX"}}`
+ - <a href="https://cloud.yandex.ru/docs/translate/" target="_blank">Yandex Cloud</a>, requires registration and credit card details. $15 for every million characters.
+
+### Returns an `object`:
+
+- `text` *(string)* – The translated text.
+- `from` *(object)*
+ - `language` *(object)*
+ - `didYouMean` *(boolean)* - `true` if the API suggest a correction in the source language
+ - `iso` *(string)* - The [code of the language](https://github.com/extensionsapp/translatte/blob/master/languages.js) that the API has recognized in the `text`
+ - `text` *(object)*
+ - `autoCorrected` *(boolean)* – `true` if the API has auto corrected the `text`
+ - `value` *(string)* – The auto corrected `text` or the `text` with suggested corrections
+ - `didYouMean` *(boolean)* – `true` if the API has suggested corrections to the `text`
+- `raw` *(string)* - If `options.raw` is true, the raw response from Google Translate servers. Otherwise, `''`.
+- `proxy` *(string)* – The proxy that were used in the request.
+- `agent` *(string)* – The agent that were used in the request.
+- `service` *(object)* – The service that were used in the request.
+
+Note that `res.from.text` will only be returned if `from.text.autoCorrected` or `from.text.didYouMean` equals to `true`. In this case, it will have the corrections delimited with brackets (`[ ]`):
+
+``` js
+translate('I spea Dutch').then(res => {
+ console.log(res.from.text.value);
+ //=> I [speak] Dutch
+}).catch(err => {
+ console.error(err);
+});
+```
+Otherwise, it will be an empty `string` (`''`).
+
+### Errors an `object`:
+
+Errors in the name of each `services`.
+
+```json
+{
+ "google_free": "Could not get token from google",
+ "google_v3": "Response code 403 (Forbidden)",
+ "microsoft_v3": "Response code 403 (Forbidden)",
+ "yandex_v1": "Response code 403 (Forbidden)",
+ "yandex_v2": "Response code 403 (Forbidden)"
+}
+```
+
+If the proxy server `LOGIN:PASSWORD@192.0.2.100:12345` is inactive.
+
+```json
+{
+ "google_free": "LOGIN:PASSWORD@192.0.2.100:12345"
+}
+```
+
+If the error is not related to `services`.
+
+```json
+{
+ "message": "The language «foo» is not supported"
+}
+```
+
+**2020 ExtensionsApp** \ No newline at end of file
diff --git a/includes/translator/node_modules/translatte/index.js b/includes/translator/node_modules/translatte/index.js
new file mode 100755
index 0000000..16083db
--- /dev/null
+++ b/includes/translator/node_modules/translatte/index.js
@@ -0,0 +1,406 @@
+const querystring = require('querystring');
+const languages = require('./languages');
+const proxy_check = require('proxy-check');
+const tunnel = require('tunnel');
+const token = require('./token');
+const got = require('got');
+
+const translatte = async (text, opts) => {
+ opts = opts || {};
+ opts = JSON.parse(JSON.stringify(opts));
+
+ let result = {
+ text: '',
+ raw: '',
+ from: {
+ language: {
+ didYouMean: false,
+ iso: ''
+ },
+ text: {
+ autoCorrected: false,
+ value: '',
+ didYouMean: false
+ }
+ },
+ proxy: '',
+ agent: '',
+ service: {google_free: true}
+ };
+
+ let errors = [
+ 'The language «[lang]» is not supported',
+ 'Text must not exceed 5000 bytes',
+ 'The server returned an empty response',
+ 'Could not get token from google',
+ 'Text translation request failed'
+ ];
+
+ if (opts.from && !languages.isSupported(opts.from)) {
+ return Promise.reject({message: errors[0].replace('[lang]', opts.from)});
+ }
+
+ if (opts.to && !languages.isSupported(opts.to)) {
+ return Promise.reject({message: errors[0].replace('[lang]', opts.to)});
+ }
+
+ let bytes = languages.utf8Length(text);
+ opts.client = opts.client || 't';
+ opts.tld = opts.tld || 'com';
+ opts.from = languages.getCode(opts.from || 'auto');
+ opts.to = languages.getCode(opts.to || 'en');
+ opts.services = opts.services || {google_free: true};
+ let services = Object.keys(opts.services);
+
+ opts.priority = opts.priority
+ ? typeof opts.priority === 'string'
+ ? [opts.priority]
+ : opts.priority.filter(p => services.indexOf(p) + 1)
+ : services;
+
+ if (opts.priority.length > 1) {
+ let all_index = opts.priority.length - 1;
+ let err_services = {};
+ return opts.priority.reduce((p, priority, index) => {
+ return p.then(prev => {
+ return new Promise((resolve, reject) => {
+ if (prev) return resolve(prev);
+ translatte(text, {...opts, priority}).then(t => {
+ if (!t || !t.text) {
+ err_services[priority] = errors[2];
+ return all_index === index
+ ? reject(err_services)
+ : resolve();
+ }
+ return resolve(t);
+ }).catch(e => {
+ err_services[priority] = typeof e === 'object' && (e[priority] || e.message)
+ ? e[priority] || e.message
+ : e;
+ return all_index === index
+ ? reject(err_services)
+ : resolve();
+ });
+ });
+ });
+ }, Promise.resolve());
+ }
+
+ let priority = opts.priority[0];
+
+ if (bytes > 5000) {
+ let chars = Math.ceil(text.length / Math.ceil(bytes / 4700)) + 100;
+ let plain = ' ' + text + ' ';
+ let texts = [];
+ let j = 0;
+ ['.', ',', ' '].forEach(separator => {
+ if (!plain) return;
+ let split = plain.split(separator);
+ for (let i = 0, l = split.length; i < l; i++) {
+ if (!texts[j]) texts[j] = [];
+ if ((texts[j].join(separator) + split[i]).length < chars) {
+ texts[j].push(split[i]);
+ plain = split.slice(i+1).join(separator);
+ } else {
+ if (!texts[j].length) break;
+ texts[j].push('');
+ texts[++j] = [];
+ if ((texts[j].join(separator) + split[i]).length < chars) {
+ texts[j].push(split[i]);
+ plain = split.slice(i+1).join(separator);
+ } else {
+ break;
+ }
+ }
+ }
+ texts = texts.map(function (t) {
+ if (!t) return;
+ if (typeof t === 'object') {
+ return t.join(separator).trim();
+ } else if (typeof t === 'string') {
+ return t.trim();
+ }
+ }).filter(Boolean);
+ });
+ if (!texts || !texts.length) return Promise.reject({[priority]: errors[1]});
+ return texts.reduce((p, item) => {
+ return p.then(prev => {
+ return new Promise((resolve, reject) => {
+ setTimeout(() => {
+ translatte(item, opts).then(t => {
+ if (!t || !t.text) return reject(errors[2]);
+ t.text = prev && prev.text ? prev.text + ' ' + t.text : t.text;
+ return resolve(t);
+ }).catch(e => reject(e));
+ }, 1000);
+ });
+ });
+ }, Promise.resolve());
+ }
+
+ if (priority === 'google_v3') {
+ if (Array.isArray(opts.services['google_v3'])) {
+ opts.services['google_v3'] = opts
+ .services['google_v3'][Math.floor(Math.random() * opts
+ .services['google_v3'].length)];
+ }
+ result.service = {google_v3: opts.services['google_v3']};
+ let url = 'https://translation.googleapis.com/v3beta1/projects/' +
+ opts.services['google_v3']['project-id'] + '/locations/global:translateText';
+ try {
+ const {body} = await got(url, {
+ method: 'POST',
+ headers: {
+ 'Authorization': 'Bearer ' + opts.services['google_v3']['token'],
+ 'Content-type': 'application/json'
+ },
+ body: {
+ source_language_code: opts.from,
+ target_language_code: opts.to,
+ contents: [text]
+ },
+ json: true,
+ timeout: 10000,
+ retry: 0
+ });
+ for (const translation of body.translations) {
+ result.text += result.text
+ ? ' ' + translation.translations.translatedText
+ : translation.translations.translatedText;
+ }
+ } catch (e) {
+ return Promise.reject({google_v3: e.message || e});
+ }
+ return Promise.resolve(result);
+ }
+
+ if (priority === 'microsoft_v3') {
+ if (!opts.services['microsoft_v3']) return Promise.resolve(result);
+ if (Array.isArray(opts.services['microsoft_v3'])) {
+ opts.services['microsoft_v3'] = opts
+ .services['microsoft_v3'][Math.floor(Math.random() * opts
+ .services['microsoft_v3'].length)];
+ }
+ result.service = {microsoft_v3: opts.services['microsoft_v3']};
+ let url = 'https://api.cognitive.microsofttranslator.com/translate?' +
+ querystring.stringify({
+ 'api-version': '3.0',
+ from: opts.from === 'auto' ? '' : opts.from,
+ to: opts.to
+ });
+ try {
+ const {body} = await got(url, {
+ method: 'POST',
+ headers: {
+ 'Ocp-Apim-Subscription-Key': opts.services['microsoft_v3']['key'],
+ 'Ocp-Apim-Subscription-Region': opts.services['microsoft_v3']['location']
+ ? opts.services['microsoft_v3']['location'].replace(/[^a-z]/ig, '').toLowerCase()
+ : 'global',
+ 'Content-type': 'application/json'
+ },
+ body: [{text}],
+ json: true,
+ timeout: 10000,
+ retry: 0
+ });
+ for (const translation of body) {
+ if (translation.detectedLanguage && translation.detectedLanguage.language) {
+ result.from.language.iso = translation.detectedLanguage.language;
+ }
+ result.text += result.text
+ ? ' ' + translation.translations[0].text
+ : translation.translations[0].text;
+ }
+ } catch (e) {
+ return Promise.reject({microsoft_v3: e.message || e});
+ }
+ return Promise.resolve(result);
+ }
+
+ if (priority === 'yandex_v1') {
+ if (!opts.services['yandex_v1']) return Promise.resolve(result);
+ if (Array.isArray(opts.services['yandex_v1'])) {
+ opts.services['yandex_v1'] = opts
+ .services['yandex_v1'][Math.floor(Math.random() * opts
+ .services['yandex_v1'].length)];
+ }
+ result.service = {yandex_v1: opts.services['yandex_v1']};
+ let url = 'https://translate.yandex.net/api/v1.5/tr.json/translate?' +
+ querystring.stringify({
+ key: opts.services['yandex_v1']['key'],
+ lang: opts.from && opts.from !== 'auto'
+ ? opts.from + '-' + opts.to
+ : opts.to,
+ text: text
+ });
+ try {
+ const {body} = await got(url, {json: true, timeout: 10000, retry: 0});
+ for (const translation of body.text) {
+ result.text += result.text
+ ? ' ' + translation
+ : translation;
+ }
+ } catch (e) {
+ return Promise.reject({yandex_v1: e.message || e});
+ }
+ return Promise.resolve(result);
+ }
+
+ if (priority === 'yandex_v2') {
+ if (!opts.services['yandex_v2']) return Promise.resolve(result);
+ if (Array.isArray(opts.services['yandex_v2'])) {
+ opts.services['yandex_v2'] = opts
+ .services['yandex_v2'][Math.floor(Math.random() * opts
+ .services['yandex_v2'].length)];
+ }
+ result.service = {yandex_v2: opts.services['yandex_v2']};
+ let url = 'https://translate.api.cloud.yandex.net/translate/v2/translate';
+ try {
+ const {body} = await got(url, {
+ method: 'POST',
+ headers: {
+ 'Authorization': 'Api-Key ' + opts.services['yandex_v2']['key'],
+ 'Content-type': 'application/json'
+ },
+ body: {
+ sourceLanguageCode: opts.from,
+ targetLanguageCode: opts.to,
+ texts: [text]
+ },
+ json: true,
+ timeout: 10000,
+ retry: 0
+ });
+ for (const translation of body.translations) {
+ result.text += result.text
+ ? ' ' + translation.text
+ : translation.text;
+ }
+ } catch (e) {
+ return Promise.reject({yandex_v2: e.message || e});
+ }
+ return Promise.resolve(result);
+ }
+
+ let proxy = {};
+ let translate = {};
+
+ opts.agents = opts.agents
+ ? typeof opts.agents === 'string'
+ ? opts.agents.split(',').map(p => p.trim())
+ : opts.agents
+ : [];
+ opts.proxies = opts.proxies
+ ? typeof opts.proxies === 'string'
+ ? opts.proxies.split(',').map(p => p.trim())
+ : opts.proxies
+ : [];
+
+ if (opts.agents.length) {
+ let a = opts.agents[Math.floor(Math.random() * opts.agents.length)];
+ result.agent = a;
+ opts.headers = {
+ 'User-Agent': a
+ };
+ }
+ if (opts.proxies.length) {
+ let p = opts.proxies[Math.floor(Math.random() * opts.proxies.length)];
+ result.proxy = p;
+ if (p.indexOf('@') + 1) {
+ proxy.proxyAuth = p.split('@')[0];
+ proxy.host = (p.split('@')[1]).split(':')[0];
+ proxy.port = (p.split('@')[1]).split(':')[1];
+ } else {
+ proxy.host = p.split(':')[0];
+ proxy.port = p.split(':')[1];
+ }
+ }
+
+ opts.proxy = proxy.host
+ ? opts.headers
+ ? {agent: tunnel.httpsOverHttp({proxy, headers: opts.headers})}
+ : {agent: tunnel.httpsOverHttp({proxy})}
+ : {};
+
+ const translate_string = () => {
+ return new Promise(async (resolve, reject) => {
+ let t = await token.get(text, opts);
+
+ if (!t) return reject({google_free: errors[3]});
+
+ let url = 'https://translate.google.' + opts.tld + '/translate_a/single?' +
+ querystring.stringify({
+ [t.name]: t.value,
+ client: opts.client,
+ sl: opts.from,
+ tl: opts.to,
+ hl: opts.to,
+ dt: ['at', 'bd', 'ex', 'ld', 'md', 'qca', 'rw', 'rm', 'ss', 't'],
+ ie: 'UTF-8',
+ oe: 'UTF-8',
+ otf: 1,
+ ssel: 0,
+ tsel: 0,
+ kc: 7,
+ q: text
+ });
+
+ try {
+ translate = await got(url, {...opts.proxy, json: true, timeout: 10000, headers: opts.headers, retry: 0});
+ } catch (e) {
+ return reject({google_free: errors[4]});
+ }
+
+ result.raw = opts.raw
+ ? JSON.stringify(translate.body)
+ : '';
+
+ let body = translate.body;
+
+ body[0].forEach(obj => {
+ if (obj[0]) {
+ result.text += obj[0];
+ }
+ });
+
+ if (body[2] === body[8][0][0]) {
+ result.from.language.iso = body[2];
+ } else {
+ result.from.language.didYouMean = true;
+ result.from.language.iso = body[8][0][0];
+ }
+
+ if (body[7] && body[7][0]) {
+ let str = body[7][0];
+
+ str = str.replace(/<b><i>/g, '[');
+ str = str.replace(/<\/i><\/b>/g, ']');
+
+ result.from.text.value = str;
+
+ if (body[7][5] === true) {
+ result.from.text.autoCorrected = true;
+ } else {
+ result.from.text.didYouMean = true;
+ }
+ }
+
+ return result.text
+ ? resolve(result)
+ : reject({google_free: errors[2]});
+ });
+ };
+
+ if (opts && opts.proxy && opts.proxy.agent) {
+ return proxy_check(result.proxy).then(() => {
+ return translate_string();
+ }).catch(() => {
+ return Promise.reject({google_free: result.proxy});
+ });
+ } else {
+ return translate_string();
+ }
+};
+
+module.exports = translatte;
+module.exports.languages = languages; \ No newline at end of file
diff --git a/includes/translator/node_modules/translatte/languages.js b/includes/translator/node_modules/translatte/languages.js
new file mode 100755
index 0000000..083714e
--- /dev/null
+++ b/includes/translator/node_modules/translatte/languages.js
@@ -0,0 +1,187 @@
+/**
+ *
+ * Generated from https://translate.google.com
+ *
+ * The languages that Google Translate supports (as of 5/15/16) alongside with their ISO 639-1 codes
+ * See https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
+ */
+
+var langs = {
+ 'auto': 'Automatic',
+ 'af': 'Afrikaans',
+ 'sq': 'Albanian',
+ 'am': 'Amharic',
+ 'ar': 'Arabic',
+ 'hy': 'Armenian',
+ 'az': 'Azerbaijani',
+ 'eu': 'Basque',
+ 'be': 'Belarusian',
+ 'bn': 'Bengali',
+ 'bs': 'Bosnian',
+ 'bg': 'Bulgarian',
+ 'ca': 'Catalan',
+ 'ceb': 'Cebuano',
+ 'ny': 'Chichewa',
+ 'zh': 'Chinese (Simplified)',
+ 'zh-cn': 'Chinese (Simplified)',
+ 'zh-tw': 'Chinese (Traditional)',
+ 'co': 'Corsican',
+ 'hr': 'Croatian',
+ 'cs': 'Czech',
+ 'da': 'Danish',
+ 'nl': 'Dutch',
+ 'en': 'English',
+ 'eo': 'Esperanto',
+ 'et': 'Estonian',
+ 'tl': 'Filipino',
+ 'fi': 'Finnish',
+ 'fr': 'French',
+ 'fy': 'Frisian',
+ 'gl': 'Galician',
+ 'ka': 'Georgian',
+ 'de': 'German',
+ 'el': 'Greek',
+ 'gu': 'Gujarati',
+ 'ht': 'Haitian Creole',
+ 'ha': 'Hausa',
+ 'haw': 'Hawaiian',
+ 'he': 'Hebrew',
+ 'iw': 'Hebrew',
+ 'hi': 'Hindi',
+ 'hmn': 'Hmong',
+ 'hu': 'Hungarian',
+ 'is': 'Icelandic',
+ 'ig': 'Igbo',
+ 'id': 'Indonesian',
+ 'ga': 'Irish',
+ 'it': 'Italian',
+ 'ja': 'Japanese',
+ 'jw': 'Javanese',
+ 'kn': 'Kannada',
+ 'kk': 'Kazakh',
+ 'km': 'Khmer',
+ 'ko': 'Korean',
+ 'ku': 'Kurdish (Kurmanji)',
+ 'ky': 'Kyrgyz',
+ 'lo': 'Lao',
+ 'la': 'Latin',
+ 'lv': 'Latvian',
+ 'lt': 'Lithuanian',
+ 'lb': 'Luxembourgish',
+ 'mk': 'Macedonian',
+ 'mg': 'Malagasy',
+ 'ms': 'Malay',
+ 'ml': 'Malayalam',
+ 'mt': 'Maltese',
+ 'mi': 'Maori',
+ 'mr': 'Marathi',
+ 'mn': 'Mongolian',
+ 'my': 'Myanmar (Burmese)',
+ 'ne': 'Nepali',
+ 'no': 'Norwegian',
+ 'ps': 'Pashto',
+ 'fa': 'Persian',
+ 'pl': 'Polish',
+ 'pt': 'Portuguese',
+ 'pa': 'Punjabi',
+ 'ro': 'Romanian',
+ 'ru': 'Russian',
+ 'sm': 'Samoan',
+ 'gd': 'Scots Gaelic',
+ 'sr': 'Serbian',
+ 'st': 'Sesotho',
+ 'sn': 'Shona',
+ 'sd': 'Sindhi',
+ 'si': 'Sinhala',
+ 'sk': 'Slovak',
+ 'sl': 'Slovenian',
+ 'so': 'Somali',
+ 'es': 'Spanish',
+ 'su': 'Sundanese',
+ 'sw': 'Swahili',
+ 'sv': 'Swedish',
+ 'tg': 'Tajik',
+ 'ta': 'Tamil',
+ 'te': 'Telugu',
+ 'th': 'Thai',
+ 'tr': 'Turkish',
+ 'uk': 'Ukrainian',
+ 'ur': 'Urdu',
+ 'uz': 'Uzbek',
+ 'vi': 'Vietnamese',
+ 'cy': 'Welsh',
+ 'xh': 'Xhosa',
+ 'yi': 'Yiddish',
+ 'yo': 'Yoruba',
+ 'zu': 'Zulu'
+};
+/**
+ * Returns the ISO 639-1 code of the desiredLang – if it is supported by Google Translate
+ * @param {string} desiredLang – the name or the code of the desired language
+ * @returns {string|boolean} The ISO 639-1 code of the language or false if the language is not supported
+ */
+function getCode(desiredLang) {
+ if (!desiredLang) {
+ return false;
+ }
+ desiredLang = desiredLang.toLowerCase();
+
+ if (langs[desiredLang]) {
+ return desiredLang;
+ }
+
+ var keys = Object.keys(langs).filter(function (key) {
+ if (typeof langs[key] !== 'string') {
+ return false;
+ }
+
+ return langs[key].toLowerCase() === desiredLang;
+ });
+
+ return keys[0] || false;
+}
+
+/**
+ * Returns true if the desiredLang is supported by Google Translate and false otherwise
+ * @param desiredLang – the ISO 639-1 code or the name of the desired language
+ * @returns {boolean}
+ */
+function isSupported(desiredLang) {
+ return Boolean(getCode(desiredLang));
+}
+
+/**
+ * Returns utf8 length
+ * @param str – string
+ * @returns {number}
+ */
+function utf8Length(str) {
+ var utf8 = [];
+ for (var i = 0; i < str.length; i++) {
+ var charcode = str.charCodeAt(i);
+ if (charcode < 0x80) utf8.push(charcode);
+ else if (charcode < 0x800) {
+ utf8.push(0xc0 | (charcode >> 6),
+ 0x80 | (charcode & 0x3f));
+ } else if (charcode < 0xd800 || charcode >= 0xe000) {
+ utf8.push(0xe0 | (charcode >> 12),
+ 0x80 | ((charcode >> 6) & 0x3f),
+ 0x80 | (charcode & 0x3f));
+ }
+ else {
+ i++;
+ charcode = 0x10000 + (((charcode & 0x3ff) << 10)
+ | (str.charCodeAt(i) & 0x3ff));
+ utf8.push(0xf0 | (charcode >> 18),
+ 0x80 | ((charcode >> 12) & 0x3f),
+ 0x80 | ((charcode >> 6) & 0x3f),
+ 0x80 | (charcode & 0x3f));
+ }
+ }
+ return utf8.length;
+}
+
+module.exports = langs;
+module.exports.isSupported = isSupported;
+module.exports.getCode = getCode;
+module.exports.utf8Length = utf8Length; \ No newline at end of file
diff --git a/includes/translator/node_modules/translatte/logo.png b/includes/translator/node_modules/translatte/logo.png
new file mode 100755
index 0000000..9a13d88
--- /dev/null
+++ b/includes/translator/node_modules/translatte/logo.png
Binary files differ
diff --git a/includes/translator/node_modules/translatte/package.json b/includes/translator/node_modules/translatte/package.json
new file mode 100755
index 0000000..96ea209
--- /dev/null
+++ b/includes/translator/node_modules/translatte/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "translatte",
+ "version": "3.0.1",
+ "description": "A free and unlimited translate for NodeJS",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/extensionsapp/translatte.git"
+ },
+ "keywords": [
+ "translate",
+ "translator",
+ "google",
+ "google translate",
+ "api",
+ "free",
+ "language",
+ "proxy",
+ "translatte",
+ "microsoft",
+ "azure",
+ "microsoft azure",
+ "microsoft translate",
+ "azure translate",
+ "google cloud",
+ "google cloud translate",
+ "yandex",
+ "yandex cloud",
+ "yandex translate",
+ "yandex cloud translate"
+ ],
+ "author": {
+ "name": "ExtensionsApp",
+ "email": "extensionsapp@gmail.com"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/extensionsapp/translatte/issues"
+ },
+ "homepage": "https://github.com/extensionsapp/translatte#readme",
+ "dependencies": {
+ "tunnel": "0.0.6",
+ "configstore": "4.0.0",
+ "proxy-check": "1.0.8",
+ "got": "9.6.0"
+ }
+}
diff --git a/includes/translator/node_modules/translatte/token.js b/includes/translator/node_modules/translatte/token.js
new file mode 100755
index 0000000..71f360b
--- /dev/null
+++ b/includes/translator/node_modules/translatte/token.js
@@ -0,0 +1,120 @@
+/**
+ * Last update: 2018/11/24
+ * https://translate.google.com/translate/releases/twsfe_w_20160620_RC00/r/js/desktop_module_main.js
+ *
+ * Everything between 'BEGIN' and 'END' was copied from the url above.
+ */
+
+var got = require('got');
+var Configstore = require('configstore');
+
+/* eslint-disable */
+// BEGIN
+
+function sM(a) {
+ var b;
+ if (null !== yr)
+ b = yr;
+ else {
+ b = wr(String.fromCharCode(84));
+ var c = wr(String.fromCharCode(75));
+ b = [b(), b()];
+ b[1] = c();
+ b = (yr = window[b.join(c())] || "") || ""
+ }
+ var d = wr(String.fromCharCode(116))
+ , c = wr(String.fromCharCode(107))
+ , d = [d(), d()];
+ d[1] = c();
+ c = "&" + d.join("") + "=";
+ d = b.split(".");
+ b = Number(d[0]) || 0;
+ for (var e = [], f = 0, g = 0; g < a.length; g++) {
+ var l = a.charCodeAt(g);
+ 128 > l ? e[f++] = l : (2048 > l ? e[f++] = l >> 6 | 192 : (55296 === (l & 64512) && g + 1 < a.length && 56320 === (a.charCodeAt(g + 1) & 64512) ? (l = 65536 + ((l & 1023) << 10) + (a.charCodeAt(++g) & 1023),
+ e[f++] = l >> 18 | 240,
+ e[f++] = l >> 12 & 63 | 128) : e[f++] = l >> 12 | 224,
+ e[f++] = l >> 6 & 63 | 128),
+ e[f++] = l & 63 | 128)
+ }
+ a = b;
+ for (f = 0; f < e.length; f++)
+ a += e[f],
+ a = xr(a, "+-a^+6");
+ a = xr(a, "+-3^+b+-f");
+ a ^= Number(d[1]) || 0;
+ 0 > a && (a = (a & 2147483647) + 2147483648);
+ a %= 1E6;
+ return c + (a.toString() + "." + (a ^ b))
+}
+
+var yr = null;
+var wr = function (a) {
+ return function () {
+ return a
+ }
+}
+ , xr = function (a, b) {
+ for (var c = 0; c < b.length - 2; c += 3) {
+ var d = b.charAt(c + 2)
+ , d = "a" <= d ? d.charCodeAt(0) - 87 : Number(d)
+ , d = "+" === b.charAt(c + 1) ? a >>> d : a << d;
+ a = "+" === b.charAt(c) ? a + d & 4294967295 : a ^ d
+ }
+ return a
+};
+
+// END
+/* eslint-enable */
+
+var config = new Configstore('google-translate-api');
+
+var window = {
+ TKK: config.get('TKK') || '422854.923862967'
+};
+
+function updateTKK(opts) {
+ opts = opts || {tld: 'com', proxy: {}, headers: {}};
+ return new Promise(function (resolve, reject) {
+ var now = Math.floor(Date.now() / 3600000);
+
+ if (Number(window.TKK.split('.')[0]) === now) {
+ resolve();
+ } else {
+ got('https://translate.google.' + opts.tld, {...opts.proxy, headers: opts.headers, timeout: 2000, retry: 0}).then(function (res) {
+ var code = res.body.match(/TKK='.*?';/g);
+
+ if (code) {
+ eval(code[0]);
+ /* eslint-disable no-undef */
+ if (typeof TKK !== 'undefined') {
+ window.TKK = TKK;
+ config.set('TKK', TKK);
+ }
+ /* eslint-enable no-undef */
+ }
+
+ /**
+ * Note: If the regex or the eval fail, there is no need to worry. The server will accept
+ * relatively old seeds.
+ */
+
+ resolve();
+ }).catch(function () {
+ reject();
+ });
+ }
+ });
+}
+
+function get(text, opts) {
+ return updateTKK(opts).then(function () {
+ var tk = sM(text);
+ tk = tk.replace('&tk=', '');
+ return {name: 'tk', value: tk};
+ }).catch(function () {
+ return null;
+ });
+}
+
+module.exports.get = get; \ No newline at end of file
diff --git a/includes/translator/node_modules/translatte/translatte_lg.png b/includes/translator/node_modules/translatte/translatte_lg.png
new file mode 100755
index 0000000..a544465
--- /dev/null
+++ b/includes/translator/node_modules/translatte/translatte_lg.png
Binary files differ
diff --git a/includes/translator/node_modules/translatte/translatte_md.png b/includes/translator/node_modules/translatte/translatte_md.png
new file mode 100755
index 0000000..c166c39
--- /dev/null
+++ b/includes/translator/node_modules/translatte/translatte_md.png
Binary files differ
diff --git a/includes/translator/node_modules/tunnel/.idea/encodings.xml b/includes/translator/node_modules/tunnel/.idea/encodings.xml
new file mode 100644
index 0000000..97626ba
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/.idea/encodings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Encoding">
+ <file url="PROJECT" charset="UTF-8" />
+ </component>
+</project> \ No newline at end of file
diff --git a/includes/translator/node_modules/tunnel/.idea/modules.xml b/includes/translator/node_modules/tunnel/.idea/modules.xml
new file mode 100644
index 0000000..27bf888
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/node-tunnel.iml" filepath="$PROJECT_DIR$/.idea/node-tunnel.iml" />
+ </modules>
+ </component>
+</project> \ No newline at end of file
diff --git a/includes/translator/node_modules/tunnel/.idea/node-tunnel.iml b/includes/translator/node_modules/tunnel/.idea/node-tunnel.iml
new file mode 100644
index 0000000..24643cc
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/.idea/node-tunnel.iml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module> \ No newline at end of file
diff --git a/includes/translator/node_modules/tunnel/.idea/vcs.xml b/includes/translator/node_modules/tunnel/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/.idea/vcs.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
+ </component>
+</project> \ No newline at end of file
diff --git a/includes/translator/node_modules/tunnel/.idea/workspace.xml b/includes/translator/node_modules/tunnel/.idea/workspace.xml
new file mode 100644
index 0000000..1a318c8
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/.idea/workspace.xml
@@ -0,0 +1,797 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ChangeListManager">
+ <list default="true" id="3caed8aa-31ae-4b3d-ad18-6f9796663516" name="Default" comment="">
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.travis.yml" afterPath="$PROJECT_DIR$/.travis.yml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/CHANGELOG.md" afterPath="$PROJECT_DIR$/CHANGELOG.md" />
+ </list>
+ <ignored path="$PROJECT_DIR$/.tmp/" />
+ <ignored path="$PROJECT_DIR$/temp/" />
+ <ignored path="$PROJECT_DIR$/tmp/" />
+ <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+ <option name="TRACKING_ENABLED" value="true" />
+ <option name="SHOW_DIALOG" value="false" />
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+ <option name="LAST_RESOLUTION" value="IGNORE" />
+ </component>
+ <component name="FileEditorManager">
+ <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
+ <file leaf-file-name="package.json" pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/package.json">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="34">
+ <caret line="2" column="19" lean-forward="false" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="README.md" pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/README.md">
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
+ <state split_layout="SPLIT">
+ <first_editor relative-caret-position="2312">
+ <caret line="136" column="67" lean-forward="false" selection-start-line="136" selection-start-column="67" selection-end-line="136" selection-end-column="67" />
+ <folding>
+ <marker date="1497272379133" expanded="true" signature="590:646" ph="{...}" />
+ <marker date="1497272379133" expanded="true" signature="601:644" ph="{&quot;host&quot;: 'localhost'...}" />
+ <marker date="1497272379133" expanded="true" signature="674:737" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="884:1330" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="964:1328" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="1103:1192" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="1290:1324" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="1357:1419" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="1514:2209" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="1540:1623" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="1842:2207" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="1981:2070" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="2168:2202" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="2237:2300" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="2395:3180" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="2475:3178" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="2615:2704" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="2802:2836" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="3207:3269" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="3366:4398" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="3392:3475" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="3694:4396" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="3834:3923" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="4021:4055" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="4426:4489" ph="{&quot;host&quot;: 'example.com'...}" />
+ </folding>
+ </first_editor>
+ <second_editor />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name=".travis.yml" pinned="false" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/.travis.yml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="102">
+ <caret line="6" column="0" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="tunnel.js" pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/lib/tunnel.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="697">
+ <caret line="41" column="19" lean-forward="false" selection-start-line="41" selection-start-column="19" selection-end-line="41" selection-end-column="19" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="http-over-http-error.js" pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/test/http-over-http-error.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="935">
+ <caret line="55" column="26" lean-forward="true" selection-start-line="55" selection-start-column="26" selection-end-line="55" selection-end-column="26" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="http-over-http-error2.js" pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/test/http-over-http-error2.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="1207">
+ <caret line="71" column="0" lean-forward="false" selection-start-line="71" selection-start-column="0" selection-end-line="71" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="https-over-http.js" pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/test/https-over-http.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="1479">
+ <caret line="87" column="0" lean-forward="false" selection-start-line="87" selection-start-column="0" selection-end-line="87" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="https-over-https.js" pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/test/https-over-https.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="http-over-http.js" pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/test/http-over-http.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="1088">
+ <caret line="64" column="26" lean-forward="true" selection-start-line="64" selection-start-column="26" selection-end-line="64" selection-end-column="26" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/CHANGELOG.md">
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
+ <state split_layout="SPLIT">
+ <first_editor relative-caret-position="102">
+ <caret line="6" column="0" lean-forward="false" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
+ <folding />
+ </first_editor>
+ <second_editor />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ </leaf>
+ </component>
+ <component name="FileTemplateManagerImpl">
+ <option name="RECENT_TEMPLATES">
+ <list>
+ <option value="JavaScript File" />
+ </list>
+ </option>
+ </component>
+ <component name="FindInProjectRecents">
+ <findStrings>
+ <find>max</find>
+ <find>onconne</find>
+ </findStrings>
+ </component>
+ <component name="Git.Settings">
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+ </component>
+ <component name="IdeDocumentHistory">
+ <option name="CHANGED_PATHS">
+ <list>
+ <option value="$PROJECT_DIR$/test/http-over-http-error.js" />
+ <option value="$PROJECT_DIR$/README.md" />
+ <option value="$PROJECT_DIR$/package.json" />
+ <option value="$PROJECT_DIR$/test/http-over-http-error2.js" />
+ <option value="$PROJECT_DIR$/test/https-over-http-localaddress.js" />
+ <option value="$PROJECT_DIR$/test/https-over-http.js" />
+ <option value="$PROJECT_DIR$/lib/tunnel.js" />
+ <option value="$PROJECT_DIR$/CHANGELOG.md" />
+ <option value="$PROJECT_DIR$/.travis.yml" />
+ </list>
+ </option>
+ </component>
+ <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
+ <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER">
+ <package-json value="$PROJECT_DIR$/package.json" />
+ </component>
+ <component name="JsFlowSettings">
+ <service-enabled>false</service-enabled>
+ <exe-path />
+ <annotation-enable>false</annotation-enable>
+ <other-services-enabled>false</other-services-enabled>
+ <auto-save>true</auto-save>
+ </component>
+ <component name="JsGulpfileManager">
+ <detection-done>true</detection-done>
+ <sorting>DEFINITION_ORDER</sorting>
+ </component>
+ <component name="NodeModulesDirectoryManager">
+ <handled-path value="$PROJECT_DIR$/node_modules" />
+ </component>
+ <component name="ProjectFrameBounds">
+ <option name="x" value="785" />
+ <option name="y" value="40" />
+ <option name="width" value="1788" />
+ <option name="height" value="1407" />
+ </component>
+ <component name="ProjectView">
+ <navigator currentView="ProjectPane" proportions="" version="1">
+ <flattenPackages />
+ <showMembers />
+ <showModules />
+ <showLibraryContents />
+ <hideEmptyPackages />
+ <abbreviatePackageNames />
+ <autoscrollToSource />
+ <autoscrollFromSource ProjectPane="true" />
+ <sortByType />
+ <manualOrder />
+ <foldersAlwaysOnTop value="true" />
+ </navigator>
+ <panes>
+ <pane id="Scope" />
+ <pane id="Scratches" />
+ <pane id="ProjectPane">
+ <subPane>
+ <expand>
+ <path>
+ <item name="node-tunnel" type="b2602c69:ProjectViewProjectNode" />
+ <item name="node-tunnel" type="462c0819:PsiDirectoryNode" />
+ </path>
+ <path>
+ <item name="node-tunnel" type="b2602c69:ProjectViewProjectNode" />
+ <item name="node-tunnel" type="462c0819:PsiDirectoryNode" />
+ <item name="lib" type="462c0819:PsiDirectoryNode" />
+ </path>
+ <path>
+ <item name="node-tunnel" type="b2602c69:ProjectViewProjectNode" />
+ <item name="node-tunnel" type="462c0819:PsiDirectoryNode" />
+ <item name="test" type="462c0819:PsiDirectoryNode" />
+ </path>
+ </expand>
+ <select />
+ </subPane>
+ </pane>
+ </panes>
+ </component>
+ <component name="PropertiesComponent">
+ <property name="WebServerToolWindowFactoryState" value="false" />
+ <property name="last_opened_file_path" value="$PROJECT_DIR$" />
+ <property name="HbShouldOpenHtmlAsHb" value="" />
+ <property name="nodejs_interpreter_path" value="$PROJECT_DIR$/../../nvmw/v6.10.3/node" />
+ </component>
+ <component name="RecentsManager">
+ <key name="CopyFile.RECENT_KEYS">
+ <recent name="C:\Users\koichik\git\koichik\node-tunnel\test" />
+ </key>
+ </component>
+ <component name="RunDashboard">
+ <option name="ruleStates">
+ <list>
+ <RuleState>
+ <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
+ </RuleState>
+ <RuleState>
+ <option name="name" value="StatusDashboardGroupingRule" />
+ </RuleState>
+ </list>
+ </option>
+ </component>
+ <component name="RunManager">
+ <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
+ <node-interpreter>project</node-interpreter>
+ <node-options />
+ <gulpfile />
+ <tasks />
+ <arguments />
+ <envs />
+ </configuration>
+ <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
+ <method />
+ </configuration>
+ <configuration default="true" type="DartTestRunConfigurationType" factoryName="Dart Test">
+ <method />
+ </configuration>
+ <configuration default="true" type="JavaScriptTestRunnerJest" factoryName="Jest">
+ <node-interpreter value="project" />
+ <working-dir value="" />
+ <envs />
+ <scope-kind value="ALL" />
+ <method />
+ </configuration>
+ <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma">
+ <config-file value="" />
+ <node-interpreter value="project" />
+ <envs />
+ <method />
+ </configuration>
+ <configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
+ <config-file value="" />
+ <node-interpreter value="project" />
+ <envs />
+ <method />
+ </configuration>
+ <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
+ <method />
+ </configuration>
+ <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir="">
+ <method />
+ </configuration>
+ <configuration default="true" type="cucumber.js" factoryName="Cucumber.js">
+ <option name="cucumberJsArguments" value="" />
+ <option name="executablePath" />
+ <option name="filePath" />
+ <method />
+ </configuration>
+ <configuration default="true" type="js.build_tools.npm" factoryName="npm">
+ <command value="run" />
+ <scripts />
+ <node-interpreter value="project" />
+ <envs />
+ <method />
+ </configuration>
+ <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
+ <node-interpreter>project</node-interpreter>
+ <node-options />
+ <working-directory />
+ <pass-parent-env>true</pass-parent-env>
+ <envs />
+ <ui />
+ <extra-mocha-options />
+ <test-kind>DIRECTORY</test-kind>
+ <test-directory />
+ <recursive>false</recursive>
+ <method />
+ </configuration>
+ </component>
+ <component name="ShelveChangesManager" show_recycled="false">
+ <option name="remove_strategy" value="false" />
+ </component>
+ <component name="SvnConfiguration">
+ <configuration />
+ </component>
+ <component name="TaskManager">
+ <task active="true" id="Default" summary="Default task">
+ <changelist id="3caed8aa-31ae-4b3d-ad18-6f9796663516" name="Default" comment="" />
+ <created>1497256565348</created>
+ <option name="number" value="Default" />
+ <option name="presentableId" value="Default" />
+ <updated>1497256565348</updated>
+ <workItem from="1497256566573" duration="8794000" />
+ <workItem from="1497272051717" duration="2328000" />
+ <workItem from="1536577850117" duration="8708000" />
+ <workItem from="1536636907096" duration="739000" />
+ </task>
+ <servers />
+ </component>
+ <component name="TimeTrackingManager">
+ <option name="totallyTimeSpent" value="20569000" />
+ </component>
+ <component name="ToolWindowManager">
+ <frame x="785" y="40" width="1788" height="1407" extended-state="0" />
+ <editor active="true" />
+ <layout>
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
+ <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+ <window_info id="SvgViewer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32967034" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
+ <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+ <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+ </layout>
+ </component>
+ <component name="TypeScriptGeneratedFilesManager">
+ <option name="version" value="1" />
+ </component>
+ <component name="VcsContentAnnotationSettings">
+ <option name="myLimit" value="2678400000" />
+ </component>
+ <component name="XDebuggerManager">
+ <breakpoint-manager />
+ <watches-manager />
+ </component>
+ <component name="editorHistoryManager">
+ <entry file="file://$PROJECT_DIR$/package.json">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="34">
+ <caret line="2" column="19" lean-forward="false" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/README.md">
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
+ <state split_layout="SPLIT">
+ <first_editor relative-caret-position="2312">
+ <caret line="136" column="67" lean-forward="false" selection-start-line="136" selection-start-column="67" selection-end-line="136" selection-end-column="67" />
+ <folding>
+ <marker date="1497272379133" expanded="true" signature="590:646" ph="{...}" />
+ <marker date="1497272379133" expanded="true" signature="601:644" ph="{&quot;host&quot;: 'localhost'...}" />
+ <marker date="1497272379133" expanded="true" signature="674:737" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="884:1330" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="964:1328" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="1103:1192" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="1290:1324" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="1357:1419" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="1514:2209" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="1540:1623" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="1842:2207" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="1981:2070" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="2168:2202" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="2237:2300" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="2395:3180" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="2475:3178" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="2615:2704" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="2802:2836" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="3207:3269" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="3366:4398" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="3392:3475" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="3694:4396" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="3834:3923" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="4021:4055" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="4426:4489" ph="{&quot;host&quot;: 'example.com'...}" />
+ </folding>
+ </first_editor>
+ <second_editor />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/.travis.yml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="102">
+ <caret line="6" column="0" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/http-over-http-error.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="935">
+ <caret line="55" column="26" lean-forward="true" selection-start-line="55" selection-start-column="26" selection-end-line="55" selection-end-column="26" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/http-over-http-error2.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="1207">
+ <caret line="71" column="0" lean-forward="false" selection-start-line="71" selection-start-column="0" selection-end-line="71" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/https-over-http.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="1479">
+ <caret line="87" column="0" lean-forward="false" selection-start-line="87" selection-start-column="0" selection-end-line="87" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/https-over-https.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/http-over-http.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="1088">
+ <caret line="64" column="26" lean-forward="true" selection-start-line="64" selection-start-column="26" selection-end-line="64" selection-end-column="26" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/lib/tunnel.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="697">
+ <caret line="41" column="19" lean-forward="false" selection-start-line="41" selection-start-column="19" selection-end-line="41" selection-end-column="19" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/package.json">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="34">
+ <caret line="2" column="19" lean-forward="false" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/README.md">
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
+ <state split_layout="SPLIT">
+ <first_editor relative-caret-position="2312">
+ <caret line="136" column="67" lean-forward="false" selection-start-line="136" selection-start-column="67" selection-end-line="136" selection-end-column="67" />
+ <folding>
+ <marker date="1497272379133" expanded="true" signature="590:646" ph="{...}" />
+ <marker date="1497272379133" expanded="true" signature="601:644" ph="{&quot;host&quot;: 'localhost'...}" />
+ <marker date="1497272379133" expanded="true" signature="674:737" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="884:1330" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="964:1328" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="1103:1192" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="1290:1324" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="1357:1419" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="1514:2209" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="1540:1623" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="1842:2207" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="1981:2070" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="2168:2202" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="2237:2300" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="2395:3180" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="2475:3178" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="2615:2704" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="2802:2836" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="3207:3269" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="3366:4398" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="3392:3475" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="3694:4396" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="3834:3923" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="4021:4055" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="4426:4489" ph="{&quot;host&quot;: 'example.com'...}" />
+ </folding>
+ </first_editor>
+ <second_editor />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/lib/tunnel.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="2550">
+ <caret line="150" column="0" lean-forward="false" selection-start-line="150" selection-start-column="0" selection-end-line="150" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/CHANGELOG.md">
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
+ <state split_layout="SPLIT">
+ <first_editor relative-caret-position="51">
+ <caret line="3" column="21" lean-forward="false" selection-start-line="3" selection-start-column="21" selection-end-line="3" selection-end-column="21" />
+ <folding />
+ </first_editor>
+ <second_editor />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/.travis.yml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="119">
+ <caret line="7" column="0" lean-forward="true" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/package.json">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/README.md">
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
+ <state split_layout="SPLIT">
+ <first_editor relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ <folding>
+ <marker date="1497272379133" expanded="true" signature="590:646" ph="{...}" />
+ <marker date="1497272379133" expanded="true" signature="601:644" ph="{&quot;host&quot;: 'localhost'...}" />
+ <marker date="1497272379133" expanded="true" signature="674:737" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="884:1330" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="964:1328" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="1103:1192" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="1290:1324" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="1357:1419" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="1514:2209" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="1540:1623" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="1842:2207" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="1981:2070" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="2168:2202" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="2237:2300" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="2395:3180" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="2475:3178" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="2615:2704" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="2802:2836" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="3207:3269" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="3366:4398" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="3392:3475" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="3694:4396" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="3834:3923" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="4021:4055" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="4426:4489" ph="{&quot;host&quot;: 'example.com'...}" />
+ </folding>
+ </first_editor>
+ <second_editor />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/.travis.yml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/lib/tunnel.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="2550">
+ <caret line="150" column="0" lean-forward="false" selection-start-line="150" selection-start-column="0" selection-end-line="150" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/https-over-https.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/https-over-https-error.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/http-over-http.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="136">
+ <caret line="8" column="0" lean-forward="false" selection-start-line="7" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/http-over-http-error.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="1309">
+ <caret line="77" column="0" lean-forward="false" selection-start-line="77" selection-start-column="0" selection-end-line="77" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/http-over-https.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/http-over-https.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/https-over-https-error.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/README.md">
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
+ <state split_layout="SPLIT">
+ <first_editor relative-caret-position="2312">
+ <caret line="136" column="67" lean-forward="false" selection-start-line="136" selection-start-column="67" selection-end-line="136" selection-end-column="67" />
+ <folding>
+ <marker date="1497272379133" expanded="true" signature="590:646" ph="{...}" />
+ <marker date="1497272379133" expanded="true" signature="601:644" ph="{&quot;host&quot;: 'localhost'...}" />
+ <marker date="1497272379133" expanded="true" signature="674:737" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="884:1330" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="964:1328" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="1103:1192" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="1290:1324" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="1357:1419" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="1514:2209" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="1540:1623" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="1842:2207" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="1981:2070" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="2168:2202" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="2237:2300" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="2395:3180" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="2475:3178" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="2615:2704" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="2802:2836" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="3207:3269" ph="{&quot;host&quot;: 'example.com'...}" />
+ <marker date="1497272379133" expanded="true" signature="3366:4398" ph="{&quot;maxSockets&quot;: poolSize...}" />
+ <marker date="1497272379133" expanded="true" signature="3392:3475" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="3694:4396" ph="{&quot;host&quot;: proxyHost...}" />
+ <marker date="1497272379133" expanded="true" signature="3834:3923" ph="//..." />
+ <marker date="1497272379133" expanded="true" signature="4021:4055" ph="{&quot;User-Agent&quot;: 'Node'...}" />
+ <marker date="1497272379133" expanded="true" signature="4426:4489" ph="{&quot;host&quot;: 'example.com'...}" />
+ </folding>
+ </first_editor>
+ <second_editor />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/package.json">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="34">
+ <caret line="2" column="19" lean-forward="false" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/http-over-http-error.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="935">
+ <caret line="55" column="26" lean-forward="true" selection-start-line="55" selection-start-column="26" selection-end-line="55" selection-end-column="26" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/http-over-http-error2.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="1207">
+ <caret line="71" column="0" lean-forward="false" selection-start-line="71" selection-start-column="0" selection-end-line="71" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/https-over-http-localaddress.js" />
+ <entry file="file://$PROJECT_DIR$/test/https-over-https.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="0">
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/http-over-http.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="1088">
+ <caret line="64" column="26" lean-forward="true" selection-start-line="64" selection-start-column="26" selection-end-line="64" selection-end-column="26" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/test/https-over-http.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="1479">
+ <caret line="87" column="0" lean-forward="false" selection-start-line="87" selection-start-column="0" selection-end-line="87" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/lib/tunnel.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="697">
+ <caret line="41" column="19" lean-forward="false" selection-start-line="41" selection-start-column="19" selection-end-line="41" selection-end-column="19" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/CHANGELOG.md">
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
+ <state split_layout="SPLIT">
+ <first_editor relative-caret-position="102">
+ <caret line="6" column="0" lean-forward="false" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
+ <folding />
+ </first_editor>
+ <second_editor />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/.travis.yml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state relative-caret-position="102">
+ <caret line="6" column="0" lean-forward="true" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </component>
+</project> \ No newline at end of file
diff --git a/includes/translator/node_modules/tunnel/.travis.yml b/includes/translator/node_modules/tunnel/.travis.yml
new file mode 100644
index 0000000..cb6e182
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/.travis.yml
@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+ - "4"
+ - "6"
+ - "8"
+ - "10"
diff --git a/includes/translator/node_modules/tunnel/CHANGELOG.md b/includes/translator/node_modules/tunnel/CHANGELOG.md
new file mode 100644
index 0000000..baf6b18
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/CHANGELOG.md
@@ -0,0 +1,22 @@
+# Changelog
+
+ - 0.0.6 (2018/09/11)
+ - Fix `localAddress` not working (#25)
+ - Fix `Host:` header for CONNECT method by @tmurakam (#29, #30)
+ - Fix default port for https (#32)
+ - Fix error handling when the proxy send illegal response body (#33)
+
+ - 0.0.5 (2017/06/12)
+ - Fix socket leak.
+
+ - 0.0.4 (2016/01/23)
+ - supported Node v0.12 or later.
+
+ - 0.0.3 (2014/01/20)
+ - fixed package.json
+
+ - 0.0.1 (2012/02/18)
+ - supported Node v0.6.x (0.6.11 or later).
+
+ - 0.0.0 (2012/02/11)
+ - first release.
diff --git a/includes/translator/node_modules/tunnel/LICENSE b/includes/translator/node_modules/tunnel/LICENSE
new file mode 100644
index 0000000..8b8a895
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2012 Koichi Kobayashi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/includes/translator/node_modules/tunnel/README.md b/includes/translator/node_modules/tunnel/README.md
new file mode 100644
index 0000000..f54bca5
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/README.md
@@ -0,0 +1,185 @@
+# node-tunnel - HTTP/HTTPS Agents for tunneling proxies
+
+[![Build Status](https://img.shields.io/travis/koichik/node-tunnel.svg?style=flat)](https://travis-ci.org/koichik/node-tunnel)
+[![Dependency Status](http://img.shields.io/david/koichik/node-tunnel.svg?style=flat)](https://david-dm.org/koichik/node-tunnel#info=dependencies)
+[![DevDependency Status](http://img.shields.io/david/dev/koichik/node-tunnel.svg?style=flat)](https://david-dm.org/koichik/node-tunnel#info=devDependencies)
+
+## Example
+
+```javascript
+var tunnel = require('tunnel');
+
+var tunnelingAgent = tunnel.httpsOverHttp({
+ proxy: {
+ host: 'localhost',
+ port: 3128
+ }
+});
+
+var req = https.request({
+ host: 'example.com',
+ port: 443,
+ agent: tunnelingAgent
+});
+```
+
+## Installation
+
+ $ npm install tunnel
+
+## Usages
+
+### HTTP over HTTP tunneling
+
+```javascript
+var tunnelingAgent = tunnel.httpOverHttp({
+ maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
+
+ proxy: { // Proxy settings
+ host: proxyHost, // Defaults to 'localhost'
+ port: proxyPort, // Defaults to 80
+ localAddress: localAddress, // Local interface if necessary
+
+ // Basic authorization for proxy server if necessary
+ proxyAuth: 'user:password',
+
+ // Header fields for proxy server if necessary
+ headers: {
+ 'User-Agent': 'Node'
+ }
+ }
+});
+
+var req = http.request({
+ host: 'example.com',
+ port: 80,
+ agent: tunnelingAgent
+});
+```
+
+### HTTPS over HTTP tunneling
+
+```javascript
+var tunnelingAgent = tunnel.httpsOverHttp({
+ maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
+
+ // CA for origin server if necessary
+ ca: [ fs.readFileSync('origin-server-ca.pem')],
+
+ // Client certification for origin server if necessary
+ key: fs.readFileSync('origin-server-key.pem'),
+ cert: fs.readFileSync('origin-server-cert.pem'),
+
+ proxy: { // Proxy settings
+ host: proxyHost, // Defaults to 'localhost'
+ port: proxyPort, // Defaults to 80
+ localAddress: localAddress, // Local interface if necessary
+
+ // Basic authorization for proxy server if necessary
+ proxyAuth: 'user:password',
+
+ // Header fields for proxy server if necessary
+ headers: {
+ 'User-Agent': 'Node'
+ },
+ }
+});
+
+var req = https.request({
+ host: 'example.com',
+ port: 443,
+ agent: tunnelingAgent
+});
+```
+
+### HTTP over HTTPS tunneling
+
+```javascript
+var tunnelingAgent = tunnel.httpOverHttps({
+ maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
+
+ proxy: { // Proxy settings
+ host: proxyHost, // Defaults to 'localhost'
+ port: proxyPort, // Defaults to 443
+ localAddress: localAddress, // Local interface if necessary
+
+ // Basic authorization for proxy server if necessary
+ proxyAuth: 'user:password',
+
+ // Header fields for proxy server if necessary
+ headers: {
+ 'User-Agent': 'Node'
+ },
+
+ // CA for proxy server if necessary
+ ca: [ fs.readFileSync('origin-server-ca.pem')],
+
+ // Server name for verification if necessary
+ servername: 'example.com',
+
+ // Client certification for proxy server if necessary
+ key: fs.readFileSync('origin-server-key.pem'),
+ cert: fs.readFileSync('origin-server-cert.pem'),
+ }
+});
+
+var req = http.request({
+ host: 'example.com',
+ port: 80,
+ agent: tunnelingAgent
+});
+```
+
+### HTTPS over HTTPS tunneling
+
+```javascript
+var tunnelingAgent = tunnel.httpsOverHttps({
+ maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
+
+ // CA for origin server if necessary
+ ca: [ fs.readFileSync('origin-server-ca.pem')],
+
+ // Client certification for origin server if necessary
+ key: fs.readFileSync('origin-server-key.pem'),
+ cert: fs.readFileSync('origin-server-cert.pem'),
+
+ proxy: { // Proxy settings
+ host: proxyHost, // Defaults to 'localhost'
+ port: proxyPort, // Defaults to 443
+ localAddress: localAddress, // Local interface if necessary
+
+ // Basic authorization for proxy server if necessary
+ proxyAuth: 'user:password',
+
+ // Header fields for proxy server if necessary
+ headers: {
+ 'User-Agent': 'Node'
+ }
+
+ // CA for proxy server if necessary
+ ca: [ fs.readFileSync('origin-server-ca.pem')],
+
+ // Server name for verification if necessary
+ servername: 'example.com',
+
+ // Client certification for proxy server if necessary
+ key: fs.readFileSync('origin-server-key.pem'),
+ cert: fs.readFileSync('origin-server-cert.pem'),
+ }
+});
+
+var req = https.request({
+ host: 'example.com',
+ port: 443,
+ agent: tunnelingAgent
+});
+```
+
+## CONTRIBUTORS
+* [Aleksis Brezas (abresas)](https://github.com/abresas)
+* [Jackson Tian (JacksonTian)](https://github.com/JacksonTian)
+* [Dmitry Sorin (1999)](https://github.com/1999)
+
+## License
+
+Licensed under the [MIT](https://github.com/koichik/node-tunnel/blob/master/LICENSE) license.
diff --git a/includes/translator/node_modules/tunnel/index.js b/includes/translator/node_modules/tunnel/index.js
new file mode 100644
index 0000000..2947757
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/index.js
@@ -0,0 +1 @@
+module.exports = require('./lib/tunnel');
diff --git a/includes/translator/node_modules/tunnel/lib/tunnel.js b/includes/translator/node_modules/tunnel/lib/tunnel.js
new file mode 100644
index 0000000..10cc382
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/lib/tunnel.js
@@ -0,0 +1,264 @@
+'use strict';
+
+var net = require('net');
+var tls = require('tls');
+var http = require('http');
+var https = require('https');
+var events = require('events');
+var assert = require('assert');
+var util = require('util');
+
+
+exports.httpOverHttp = httpOverHttp;
+exports.httpsOverHttp = httpsOverHttp;
+exports.httpOverHttps = httpOverHttps;
+exports.httpsOverHttps = httpsOverHttps;
+
+
+function httpOverHttp(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = http.request;
+ return agent;
+}
+
+function httpsOverHttp(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = http.request;
+ agent.createSocket = createSecureSocket;
+ agent.defaultPort = 443;
+ return agent;
+}
+
+function httpOverHttps(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = https.request;
+ return agent;
+}
+
+function httpsOverHttps(options) {
+ var agent = new TunnelingAgent(options);
+ agent.request = https.request;
+ agent.createSocket = createSecureSocket;
+ agent.defaultPort = 443;
+ return agent;
+}
+
+
+function TunnelingAgent(options) {
+ var self = this;
+ self.options = options || {};
+ self.proxyOptions = self.options.proxy || {};
+ self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
+ self.requests = [];
+ self.sockets = [];
+
+ self.on('free', function onFree(socket, host, port, localAddress) {
+ var options = toOptions(host, port, localAddress);
+ for (var i = 0, len = self.requests.length; i < len; ++i) {
+ var pending = self.requests[i];
+ if (pending.host === options.host && pending.port === options.port) {
+ // Detect the request to connect same origin server,
+ // reuse the connection.
+ self.requests.splice(i, 1);
+ pending.request.onSocket(socket);
+ return;
+ }
+ }
+ socket.destroy();
+ self.removeSocket(socket);
+ });
+}
+util.inherits(TunnelingAgent, events.EventEmitter);
+
+TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
+ var self = this;
+ var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
+
+ if (self.sockets.length >= this.maxSockets) {
+ // We are over limit so we'll add it to the queue.
+ self.requests.push(options);
+ return;
+ }
+
+ // If we are under maxSockets create a new one.
+ self.createSocket(options, function(socket) {
+ socket.on('free', onFree);
+ socket.on('close', onCloseOrRemove);
+ socket.on('agentRemove', onCloseOrRemove);
+ req.onSocket(socket);
+
+ function onFree() {
+ self.emit('free', socket, options);
+ }
+
+ function onCloseOrRemove(err) {
+ self.removeSocket(socket);
+ socket.removeListener('free', onFree);
+ socket.removeListener('close', onCloseOrRemove);
+ socket.removeListener('agentRemove', onCloseOrRemove);
+ }
+ });
+};
+
+TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
+ var self = this;
+ var placeholder = {};
+ self.sockets.push(placeholder);
+
+ var connectOptions = mergeOptions({}, self.proxyOptions, {
+ method: 'CONNECT',
+ path: options.host + ':' + options.port,
+ agent: false,
+ headers: {
+ host: options.host + ':' + options.port
+ }
+ });
+ if (options.localAddress) {
+ connectOptions.localAddress = options.localAddress;
+ }
+ if (connectOptions.proxyAuth) {
+ connectOptions.headers = connectOptions.headers || {};
+ connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
+ new Buffer(connectOptions.proxyAuth).toString('base64');
+ }
+
+ debug('making CONNECT request');
+ var connectReq = self.request(connectOptions);
+ connectReq.useChunkedEncodingByDefault = false; // for v0.6
+ connectReq.once('response', onResponse); // for v0.6
+ connectReq.once('upgrade', onUpgrade); // for v0.6
+ connectReq.once('connect', onConnect); // for v0.7 or later
+ connectReq.once('error', onError);
+ connectReq.end();
+
+ function onResponse(res) {
+ // Very hacky. This is necessary to avoid http-parser leaks.
+ res.upgrade = true;
+ }
+
+ function onUpgrade(res, socket, head) {
+ // Hacky.
+ process.nextTick(function() {
+ onConnect(res, socket, head);
+ });
+ }
+
+ function onConnect(res, socket, head) {
+ connectReq.removeAllListeners();
+ socket.removeAllListeners();
+
+ if (res.statusCode !== 200) {
+ debug('tunneling socket could not be established, statusCode=%d',
+ res.statusCode);
+ socket.destroy();
+ var error = new Error('tunneling socket could not be established, ' +
+ 'statusCode=' + res.statusCode);
+ error.code = 'ECONNRESET';
+ options.request.emit('error', error);
+ self.removeSocket(placeholder);
+ return;
+ }
+ if (head.length > 0) {
+ debug('got illegal response body from proxy');
+ socket.destroy();
+ var error = new Error('got illegal response body from proxy');
+ error.code = 'ECONNRESET';
+ options.request.emit('error', error);
+ self.removeSocket(placeholder);
+ return;
+ }
+ debug('tunneling connection has established');
+ self.sockets[self.sockets.indexOf(placeholder)] = socket;
+ return cb(socket);
+ }
+
+ function onError(cause) {
+ connectReq.removeAllListeners();
+
+ debug('tunneling socket could not be established, cause=%s\n',
+ cause.message, cause.stack);
+ var error = new Error('tunneling socket could not be established, ' +
+ 'cause=' + cause.message);
+ error.code = 'ECONNRESET';
+ options.request.emit('error', error);
+ self.removeSocket(placeholder);
+ }
+};
+
+TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
+ var pos = this.sockets.indexOf(socket)
+ if (pos === -1) {
+ return;
+ }
+ this.sockets.splice(pos, 1);
+
+ var pending = this.requests.shift();
+ if (pending) {
+ // If we have pending requests and a socket gets closed a new one
+ // needs to be created to take over in the pool for the one that closed.
+ this.createSocket(pending, function(socket) {
+ pending.request.onSocket(socket);
+ });
+ }
+};
+
+function createSecureSocket(options, cb) {
+ var self = this;
+ TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
+ var hostHeader = options.request.getHeader('host');
+ var tlsOptions = mergeOptions({}, self.options, {
+ socket: socket,
+ servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
+ });
+
+ // 0 is dummy port for v0.6
+ var secureSocket = tls.connect(0, tlsOptions);
+ self.sockets[self.sockets.indexOf(socket)] = secureSocket;
+ cb(secureSocket);
+ });
+}
+
+
+function toOptions(host, port, localAddress) {
+ if (typeof host === 'string') { // since v0.10
+ return {
+ host: host,
+ port: port,
+ localAddress: localAddress
+ };
+ }
+ return host; // for v0.11 or later
+}
+
+function mergeOptions(target) {
+ for (var i = 1, len = arguments.length; i < len; ++i) {
+ var overrides = arguments[i];
+ if (typeof overrides === 'object') {
+ var keys = Object.keys(overrides);
+ for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
+ var k = keys[j];
+ if (overrides[k] !== undefined) {
+ target[k] = overrides[k];
+ }
+ }
+ }
+ }
+ return target;
+}
+
+
+var debug;
+if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
+ debug = function() {
+ var args = Array.prototype.slice.call(arguments);
+ if (typeof args[0] === 'string') {
+ args[0] = 'TUNNEL: ' + args[0];
+ } else {
+ args.unshift('TUNNEL:');
+ }
+ console.error.apply(console, args);
+ }
+} else {
+ debug = function() {};
+}
+exports.debug = debug; // for test
diff --git a/includes/translator/node_modules/tunnel/package.json b/includes/translator/node_modules/tunnel/package.json
new file mode 100644
index 0000000..bcd7b95
--- /dev/null
+++ b/includes/translator/node_modules/tunnel/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "tunnel",
+ "version": "0.0.6",
+ "description": "Node HTTP/HTTPS Agents for tunneling proxies",
+ "keywords": [
+ "http",
+ "https",
+ "agent",
+ "proxy",
+ "tunnel"
+ ],
+ "homepage": "https://github.com/koichik/node-tunnel/",
+ "bugs": "https://github.com/koichik/node-tunnel/issues",
+ "license": "MIT",
+ "author": "Koichi Kobayashi <koichik@improvement.jp>",
+ "main": "./index.js",
+ "directories": {
+ "lib": "./lib"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/koichik/node-tunnel.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "devDependencies": {
+ "mocha": "^5.2.0",
+ "should": "^13.2.3"
+ },
+ "engines": {
+ "node": ">=0.6.11 <=0.7.0 || >=0.7.3"
+ }
+}
diff --git a/includes/translator/node_modules/unique-string/index.js b/includes/translator/node_modules/unique-string/index.js
new file mode 100644
index 0000000..5bc7787
--- /dev/null
+++ b/includes/translator/node_modules/unique-string/index.js
@@ -0,0 +1,4 @@
+'use strict';
+const cryptoRandomString = require('crypto-random-string');
+
+module.exports = () => cryptoRandomString(32);
diff --git a/includes/translator/node_modules/unique-string/license b/includes/translator/node_modules/unique-string/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/includes/translator/node_modules/unique-string/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/includes/translator/node_modules/unique-string/package.json b/includes/translator/node_modules/unique-string/package.json
new file mode 100644
index 0000000..b12954a
--- /dev/null
+++ b/includes/translator/node_modules/unique-string/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "unique-string",
+ "version": "1.0.0",
+ "description": "Generate a unique random string",
+ "license": "MIT",
+ "repository": "sindresorhus/unique-string",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "unique",
+ "string",
+ "random",
+ "uniq",
+ "str",
+ "rand",
+ "text",
+ "id",
+ "identifier",
+ "slug",
+ "hex"
+ ],
+ "dependencies": {
+ "crypto-random-string": "^1.0.0"
+ },
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "xo": {
+ "esnext": true
+ }
+}
diff --git a/includes/translator/node_modules/unique-string/readme.md b/includes/translator/node_modules/unique-string/readme.md
new file mode 100644
index 0000000..5d5ac97
--- /dev/null
+++ b/includes/translator/node_modules/unique-string/readme.md
@@ -0,0 +1,32 @@
+# unique-string [![Build Status](https://travis-ci.org/sindresorhus/unique-string.svg?branch=master)](https://travis-ci.org/sindresorhus/unique-string)
+
+> Generate a unique random string
+
+
+## Install
+
+```
+$ npm install --save unique-string
+```
+
+
+## Usage
+
+```js
+const uniqueString = require('unique-string');
+
+uniqueString();
+//=> 'b4de2a49c8ffa3fbee04446f045483b2'
+```
+
+
+## API
+
+### uniqueString()
+
+Returns a 32 character unique string. Matches the length of MD5, which is [unique enough](http://stackoverflow.com/a/2444336/64949) for non-crypto purposes.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/url-parse-lax/index.js b/includes/translator/node_modules/url-parse-lax/index.js
new file mode 100644
index 0000000..5c62a58
--- /dev/null
+++ b/includes/translator/node_modules/url-parse-lax/index.js
@@ -0,0 +1,12 @@
+'use strict';
+const url = require('url');
+const prependHttp = require('prepend-http');
+
+module.exports = (input, options) => {
+ if (typeof input !== 'string') {
+ throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof input}\` instead.`);
+ }
+
+ const finalUrl = prependHttp(input, Object.assign({https: true}, options));
+ return url.parse(finalUrl);
+};
diff --git a/includes/translator/node_modules/url-parse-lax/license b/includes/translator/node_modules/url-parse-lax/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/includes/translator/node_modules/url-parse-lax/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/url-parse-lax/package.json b/includes/translator/node_modules/url-parse-lax/package.json
new file mode 100644
index 0000000..b3c58f9
--- /dev/null
+++ b/includes/translator/node_modules/url-parse-lax/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "url-parse-lax",
+ "version": "3.0.0",
+ "description": "Lax url.parse() with support for protocol-less URLs & IPs",
+ "license": "MIT",
+ "repository": "sindresorhus/url-parse-lax",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "url",
+ "uri",
+ "parse",
+ "parser",
+ "loose",
+ "lax",
+ "protocol",
+ "less",
+ "protocol-less",
+ "ip",
+ "ipv4",
+ "ipv6"
+ ],
+ "dependencies": {
+ "prepend-http": "^2.0.0"
+ },
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ }
+}
diff --git a/includes/translator/node_modules/url-parse-lax/readme.md b/includes/translator/node_modules/url-parse-lax/readme.md
new file mode 100644
index 0000000..be0d437
--- /dev/null
+++ b/includes/translator/node_modules/url-parse-lax/readme.md
@@ -0,0 +1,127 @@
+# url-parse-lax [![Build Status](https://travis-ci.org/sindresorhus/url-parse-lax.svg?branch=master)](https://travis-ci.org/sindresorhus/url-parse-lax)
+
+> Lax [`url.parse()`](https://nodejs.org/docs/latest/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost) with support for protocol-less URLs & IPs
+
+
+## Install
+
+```
+$ npm install url-parse-lax
+```
+
+
+## Usage
+
+```js
+const urlParseLax = require('url-parse-lax');
+
+urlParseLax('sindresorhus.com');
+/*
+{
+ protocol: 'https:',
+ slashes: true,
+ auth: null,
+ host: 'sindresorhus.com',
+ port: null,
+ hostname: 'sindresorhus.com',
+ hash: null,
+ search: null,
+ query: null,
+ pathname: '/',
+ path: '/',
+ href: 'https://sindresorhus.com/'
+}
+*/
+
+urlParseLax('[2001:db8::]:8000');
+/*
+{
+ protocol: null,
+ slashes: true,
+ auth: null,
+ host: '[2001:db8::]:8000',
+ port: '8000',
+ hostname: '2001:db8::',
+ hash: null,
+ search: null,
+ query: null,
+ pathname: '/',
+ path: '/',
+ href: 'http://[2001:db8::]:8000/'
+}
+*/
+```
+
+And with the built-in `url.parse()`:
+
+```js
+const url = require('url');
+
+url.parse('sindresorhus.com');
+/*
+{
+ protocol: null,
+ slashes: null,
+ auth: null,
+ host: null,
+ port: null,
+ hostname: null,
+ hash: null,
+ search: null,
+ query: null,
+ pathname: 'sindresorhus',
+ path: 'sindresorhus',
+ href: 'sindresorhus'
+}
+*/
+
+url.parse('[2001:db8::]:8000');
+/*
+{
+ protocol: null,
+ slashes: null,
+ auth: null,
+ host: null,
+ port: null,
+ hostname: null,
+ hash: null,
+ search: null,
+ query: null,
+ pathname: '[2001:db8::]:8000',
+ path: '[2001:db8::]:8000',
+ href: '[2001:db8::]:8000'
+}
+*/
+```
+
+
+## API
+
+### urlParseLax(url, [options])
+
+#### url
+
+Type: `string`
+
+URL to parse.
+
+#### options
+
+Type: `Object`
+
+##### https
+
+Type: `boolean`<br>
+Default: `true`
+
+Prepend `https://` instead of `http://` to protocol-less URLs.
+
+
+## Related
+
+- [url-format-lax](https://github.com/sindresorhus/url-format-lax) - Lax `url.format()` that formats a hostname and port into IPv6-compatible socket form of `hostname:port`
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/wrappy/LICENSE b/includes/translator/node_modules/wrappy/LICENSE
new file mode 100644
index 0000000..19129e3
--- /dev/null
+++ b/includes/translator/node_modules/wrappy/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/includes/translator/node_modules/wrappy/README.md b/includes/translator/node_modules/wrappy/README.md
new file mode 100644
index 0000000..98eab25
--- /dev/null
+++ b/includes/translator/node_modules/wrappy/README.md
@@ -0,0 +1,36 @@
+# wrappy
+
+Callback wrapping utility
+
+## USAGE
+
+```javascript
+var wrappy = require("wrappy")
+
+// var wrapper = wrappy(wrapperFunction)
+
+// make sure a cb is called only once
+// See also: http://npm.im/once for this specific use case
+var once = wrappy(function (cb) {
+ var called = false
+ return function () {
+ if (called) return
+ called = true
+ return cb.apply(this, arguments)
+ }
+})
+
+function printBoo () {
+ console.log('boo')
+}
+// has some rando property
+printBoo.iAmBooPrinter = true
+
+var onlyPrintOnce = once(printBoo)
+
+onlyPrintOnce() // prints 'boo'
+onlyPrintOnce() // does nothing
+
+// random property is retained!
+assert.equal(onlyPrintOnce.iAmBooPrinter, true)
+```
diff --git a/includes/translator/node_modules/wrappy/package.json b/includes/translator/node_modules/wrappy/package.json
new file mode 100644
index 0000000..1307520
--- /dev/null
+++ b/includes/translator/node_modules/wrappy/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "wrappy",
+ "version": "1.0.2",
+ "description": "Callback wrapping utility",
+ "main": "wrappy.js",
+ "files": [
+ "wrappy.js"
+ ],
+ "directories": {
+ "test": "test"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tap": "^2.3.1"
+ },
+ "scripts": {
+ "test": "tap --coverage test/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/npm/wrappy"
+ },
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/npm/wrappy/issues"
+ },
+ "homepage": "https://github.com/npm/wrappy"
+}
diff --git a/includes/translator/node_modules/wrappy/wrappy.js b/includes/translator/node_modules/wrappy/wrappy.js
new file mode 100644
index 0000000..bb7e7d6
--- /dev/null
+++ b/includes/translator/node_modules/wrappy/wrappy.js
@@ -0,0 +1,33 @@
+// Returns a wrapper function that returns a wrapped callback
+// The wrapper function should do some stuff, and return a
+// presumably different callback function.
+// This makes sure that own properties are retained, so that
+// decorations and such are not lost along the way.
+module.exports = wrappy
+function wrappy (fn, cb) {
+ if (fn && cb) return wrappy(fn)(cb)
+
+ if (typeof fn !== 'function')
+ throw new TypeError('need wrapper function')
+
+ Object.keys(fn).forEach(function (k) {
+ wrapper[k] = fn[k]
+ })
+
+ return wrapper
+
+ function wrapper() {
+ var args = new Array(arguments.length)
+ for (var i = 0; i < args.length; i++) {
+ args[i] = arguments[i]
+ }
+ var ret = fn.apply(this, args)
+ var cb = args[args.length-1]
+ if (typeof ret === 'function' && ret !== cb) {
+ Object.keys(cb).forEach(function (k) {
+ ret[k] = cb[k]
+ })
+ }
+ return ret
+ }
+}
diff --git a/includes/translator/node_modules/write-file-atomic/CHANGELOG.md b/includes/translator/node_modules/write-file-atomic/CHANGELOG.md
new file mode 100644
index 0000000..920ae2c
--- /dev/null
+++ b/includes/translator/node_modules/write-file-atomic/CHANGELOG.md
@@ -0,0 +1,25 @@
+# 2.4.3
+
+* Ignore errors raised by `fs.closeSync` when cleaning up after a write
+ error.
+
+# 2.4.2
+
+* A pair of patches to fix some fd leaks. We would leak fds with sync use
+ when errors occured and with async use any time fsync was not in use. (#34)
+
+# 2.4.1
+
+* Fix a bug where `signal-exit` instances would be leaked. This was fixed when addressing #35.
+
+# 2.4.0
+
+## Features
+
+* Allow chown and mode options to be set to false to disable the defaulting behavior. (#20)
+* Support passing encoding strings in options slot for compat with Node.js API. (#31)
+* Add support for running inside of worker threads (#37)
+
+## Fixes
+
+* Remove unneeded call when returning success (#36)
diff --git a/includes/translator/node_modules/write-file-atomic/LICENSE b/includes/translator/node_modules/write-file-atomic/LICENSE
new file mode 100644
index 0000000..95e65a7
--- /dev/null
+++ b/includes/translator/node_modules/write-file-atomic/LICENSE
@@ -0,0 +1,6 @@
+Copyright (c) 2015, Rebecca Turner
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/includes/translator/node_modules/write-file-atomic/README.md b/includes/translator/node_modules/write-file-atomic/README.md
new file mode 100644
index 0000000..ca28e99
--- /dev/null
+++ b/includes/translator/node_modules/write-file-atomic/README.md
@@ -0,0 +1,56 @@
+write-file-atomic
+-----------------
+
+This is an extension for node's `fs.writeFile` that makes its operation
+atomic and allows you set ownership (uid/gid of the file).
+
+### var writeFileAtomic = require('write-file-atomic')<br>writeFileAtomic(filename, data, [options], callback)
+
+* filename **String**
+* data **String** | **Buffer**
+* options **Object** | **String**
+ * chown **Object** default, uid & gid of existing file, if any
+ * uid **Number**
+ * gid **Number**
+ * encoding **String** | **Null** default = 'utf8'
+ * fsync **Boolean** default = true
+ * mode **Number** default, from existing file, if any
+ * Promise **Object** default = native Promise object
+* callback **Function**
+
+Atomically and asynchronously writes data to a file, replacing the file if it already
+exists. data can be a string or a buffer.
+
+The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`.
+Note that `require('worker_threads').threadId` is used in addition to `process.pid` if running inside of a worker thread.
+If writeFile completes successfully then, if passed the **chown** option it will change
+the ownership of the file. Finally it renames the file back to the filename you specified. If
+it encounters errors at any of these steps it will attempt to unlink the temporary file and then
+pass the error back to the caller.
+If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Native promises are used by default, but you can inject your own promise-like object with the **Promise** option. Writes to different files are still executed in parallel.
+
+If provided, the **chown** option requires both **uid** and **gid** properties or else
+you'll get an error. If **chown** is not specified it will default to using
+the owner of the previous file. To prevent chown from being ran you can
+also pass `false`, in which case the file will be created with the current user's credentials.
+
+If **mode** is not specified, it will default to using the permissions from
+an existing file, if any. Expicitly setting this to `false` remove this default, resulting
+in a file created with the system default permissions.
+
+If options is a String, it's assumed to be the **encoding** option. The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'.
+
+If the **fsync** option is **false**, writeFile will skip the final fsync call.
+
+Example:
+
+```javascript
+writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) {
+ if (err) throw err;
+ console.log('It\'s saved!');
+});
+```
+
+### var writeFileAtomicSync = require('write-file-atomic').sync<br>writeFileAtomicSync(filename, data, [options])
+
+The synchronous version of **writeFileAtomic**.
diff --git a/includes/translator/node_modules/write-file-atomic/index.js b/includes/translator/node_modules/write-file-atomic/index.js
new file mode 100644
index 0000000..64ae987
--- /dev/null
+++ b/includes/translator/node_modules/write-file-atomic/index.js
@@ -0,0 +1,238 @@
+'use strict'
+module.exports = writeFile
+module.exports.sync = writeFileSync
+module.exports._getTmpname = getTmpname // for testing
+module.exports._cleanupOnExit = cleanupOnExit
+
+var fs = require('graceful-fs')
+var MurmurHash3 = require('imurmurhash')
+var onExit = require('signal-exit')
+var path = require('path')
+var activeFiles = {}
+
+// if we run inside of a worker_thread, `process.pid` is not unique
+/* istanbul ignore next */
+var threadId = (function getId () {
+ try {
+ var workerThreads = require('worker_threads')
+
+ /// if we are in main thread, this is set to `0`
+ return workerThreads.threadId
+ } catch (e) {
+ // worker_threads are not available, fallback to 0
+ return 0
+ }
+})()
+
+var invocations = 0
+function getTmpname (filename) {
+ return filename + '.' +
+ MurmurHash3(__filename)
+ .hash(String(process.pid))
+ .hash(String(threadId))
+ .hash(String(++invocations))
+ .result()
+}
+
+function cleanupOnExit (tmpfile) {
+ return function () {
+ try {
+ fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile)
+ } catch (_) {}
+ }
+}
+
+function writeFile (filename, data, options, callback) {
+ if (options) {
+ if (options instanceof Function) {
+ callback = options
+ options = {}
+ } else if (typeof options === 'string') {
+ options = { encoding: options }
+ }
+ } else {
+ options = {}
+ }
+
+ var Promise = options.Promise || global.Promise
+ var truename
+ var fd
+ var tmpfile
+ /* istanbul ignore next -- The closure only gets called when onExit triggers */
+ var removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile))
+ var absoluteName = path.resolve(filename)
+
+ new Promise(function serializeSameFile (resolve) {
+ // make a queue if it doesn't already exist
+ if (!activeFiles[absoluteName]) activeFiles[absoluteName] = []
+
+ activeFiles[absoluteName].push(resolve) // add this job to the queue
+ if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one
+ }).then(function getRealPath () {
+ return new Promise(function (resolve) {
+ fs.realpath(filename, function (_, realname) {
+ truename = realname || filename
+ tmpfile = getTmpname(truename)
+ resolve()
+ })
+ })
+ }).then(function stat () {
+ return new Promise(function stat (resolve) {
+ if (options.mode && options.chown) resolve()
+ else {
+ // Either mode or chown is not explicitly set
+ // Default behavior is to copy it from original file
+ fs.stat(truename, function (err, stats) {
+ if (err || !stats) resolve()
+ else {
+ options = Object.assign({}, options)
+
+ if (options.mode == null) {
+ options.mode = stats.mode
+ }
+ if (options.chown == null && process.getuid) {
+ options.chown = { uid: stats.uid, gid: stats.gid }
+ }
+ resolve()
+ }
+ })
+ }
+ })
+ }).then(function thenWriteFile () {
+ return new Promise(function (resolve, reject) {
+ fs.open(tmpfile, 'w', options.mode, function (err, _fd) {
+ fd = _fd
+ if (err) reject(err)
+ else resolve()
+ })
+ })
+ }).then(function write () {
+ return new Promise(function (resolve, reject) {
+ if (Buffer.isBuffer(data)) {
+ fs.write(fd, data, 0, data.length, 0, function (err) {
+ if (err) reject(err)
+ else resolve()
+ })
+ } else if (data != null) {
+ fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) {
+ if (err) reject(err)
+ else resolve()
+ })
+ } else resolve()
+ })
+ }).then(function syncAndClose () {
+ return new Promise(function (resolve, reject) {
+ if (options.fsync !== false) {
+ fs.fsync(fd, function (err) {
+ if (err) fs.close(fd, () => reject(err))
+ else fs.close(fd, resolve)
+ })
+ } else {
+ fs.close(fd, resolve)
+ }
+ })
+ }).then(function chown () {
+ fd = null
+ if (options.chown) {
+ return new Promise(function (resolve, reject) {
+ fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) {
+ if (err) reject(err)
+ else resolve()
+ })
+ })
+ }
+ }).then(function chmod () {
+ if (options.mode) {
+ return new Promise(function (resolve, reject) {
+ fs.chmod(tmpfile, options.mode, function (err) {
+ if (err) reject(err)
+ else resolve()
+ })
+ })
+ }
+ }).then(function rename () {
+ return new Promise(function (resolve, reject) {
+ fs.rename(tmpfile, truename, function (err) {
+ if (err) reject(err)
+ else resolve()
+ })
+ })
+ }).then(function success () {
+ removeOnExitHandler()
+ callback()
+ }, function fail (err) {
+ return new Promise(resolve => {
+ return fd ? fs.close(fd, resolve) : resolve()
+ }).then(() => {
+ removeOnExitHandler()
+ fs.unlink(tmpfile, function () {
+ callback(err)
+ })
+ })
+ }).then(function checkQueue () {
+ activeFiles[absoluteName].shift() // remove the element added by serializeSameFile
+ if (activeFiles[absoluteName].length > 0) {
+ activeFiles[absoluteName][0]() // start next job if one is pending
+ } else delete activeFiles[absoluteName]
+ })
+}
+
+function writeFileSync (filename, data, options) {
+ if (typeof options === 'string') options = { encoding: options }
+ else if (!options) options = {}
+ try {
+ filename = fs.realpathSync(filename)
+ } catch (ex) {
+ // it's ok, it'll happen on a not yet existing file
+ }
+ var tmpfile = getTmpname(filename)
+
+ if (!options.mode || !options.chown) {
+ // Either mode or chown is not explicitly set
+ // Default behavior is to copy it from original file
+ try {
+ var stats = fs.statSync(filename)
+ options = Object.assign({}, options)
+ if (!options.mode) {
+ options.mode = stats.mode
+ }
+ if (!options.chown && process.getuid) {
+ options.chown = { uid: stats.uid, gid: stats.gid }
+ }
+ } catch (ex) {
+ // ignore stat errors
+ }
+ }
+
+ var fd
+ var cleanup = cleanupOnExit(tmpfile)
+ var removeOnExitHandler = onExit(cleanup)
+
+ try {
+ fd = fs.openSync(tmpfile, 'w', options.mode)
+ if (Buffer.isBuffer(data)) {
+ fs.writeSync(fd, data, 0, data.length, 0)
+ } else if (data != null) {
+ fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8'))
+ }
+ if (options.fsync !== false) {
+ fs.fsyncSync(fd)
+ }
+ fs.closeSync(fd)
+ if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid)
+ if (options.mode) fs.chmodSync(tmpfile, options.mode)
+ fs.renameSync(tmpfile, filename)
+ removeOnExitHandler()
+ } catch (err) {
+ if (fd) {
+ try {
+ fs.closeSync(fd)
+ } catch (ex) {
+ // ignore close errors at this stage, error may have closed fd already.
+ }
+ }
+ removeOnExitHandler()
+ cleanup()
+ throw err
+ }
+}
diff --git a/includes/translator/node_modules/write-file-atomic/package.json b/includes/translator/node_modules/write-file-atomic/package.json
new file mode 100644
index 0000000..bbb0fa2
--- /dev/null
+++ b/includes/translator/node_modules/write-file-atomic/package.json
@@ -0,0 +1,41 @@
+{
+ "name": "write-file-atomic",
+ "version": "2.4.3",
+ "description": "Write files in an atomic fashion w/configurable ownership",
+ "main": "index.js",
+ "scripts": {
+ "test": "standard && tap --100 test/*.js",
+ "preversion": "npm test",
+ "postversion": "npm publish",
+ "postpublish": "git push origin --follow-tags"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:iarna/write-file-atomic.git"
+ },
+ "keywords": [
+ "writeFile",
+ "atomic"
+ ],
+ "author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org)",
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/iarna/write-file-atomic/issues"
+ },
+ "homepage": "https://github.com/iarna/write-file-atomic",
+ "dependencies": {
+ "graceful-fs": "^4.1.11",
+ "imurmurhash": "^0.1.4",
+ "signal-exit": "^3.0.2"
+ },
+ "devDependencies": {
+ "mkdirp": "^0.5.1",
+ "require-inject": "^1.4.0",
+ "rimraf": "^2.5.4",
+ "standard": "^12.0.1",
+ "tap": "^12.1.3"
+ },
+ "files": [
+ "index.js"
+ ]
+}
diff --git a/includes/translator/node_modules/xdg-basedir/index.js b/includes/translator/node_modules/xdg-basedir/index.js
new file mode 100644
index 0000000..f5aa176
--- /dev/null
+++ b/includes/translator/node_modules/xdg-basedir/index.js
@@ -0,0 +1,28 @@
+'use strict';
+const os = require('os');
+const path = require('path');
+
+const home = os.homedir();
+const env = process.env;
+
+exports.data = env.XDG_DATA_HOME ||
+ (home ? path.join(home, '.local', 'share') : null);
+
+exports.config = env.XDG_CONFIG_HOME ||
+ (home ? path.join(home, '.config') : null);
+
+exports.cache = env.XDG_CACHE_HOME || (home ? path.join(home, '.cache') : null);
+
+exports.runtime = env.XDG_RUNTIME_DIR || null;
+
+exports.dataDirs = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':');
+
+if (exports.data) {
+ exports.dataDirs.unshift(exports.data);
+}
+
+exports.configDirs = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':');
+
+if (exports.config) {
+ exports.configDirs.unshift(exports.config);
+}
diff --git a/includes/translator/node_modules/xdg-basedir/license b/includes/translator/node_modules/xdg-basedir/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/includes/translator/node_modules/xdg-basedir/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/includes/translator/node_modules/xdg-basedir/package.json b/includes/translator/node_modules/xdg-basedir/package.json
new file mode 100644
index 0000000..08bfa8c
--- /dev/null
+++ b/includes/translator/node_modules/xdg-basedir/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "xdg-basedir",
+ "version": "3.0.0",
+ "description": "Get XDG Base Directory paths",
+ "license": "MIT",
+ "repository": "sindresorhus/xdg-basedir",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "xdg",
+ "base",
+ "directory",
+ "dir",
+ "basedir",
+ "path",
+ "data",
+ "config",
+ "cache",
+ "linux",
+ "unix",
+ "spec"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "require-uncached": "^1.0.2",
+ "xo": "*"
+ }
+}
diff --git a/includes/translator/node_modules/xdg-basedir/readme.md b/includes/translator/node_modules/xdg-basedir/readme.md
new file mode 100644
index 0000000..61f8c16
--- /dev/null
+++ b/includes/translator/node_modules/xdg-basedir/readme.md
@@ -0,0 +1,60 @@
+# xdg-basedir [![Build Status](https://travis-ci.org/sindresorhus/xdg-basedir.svg?branch=master)](https://travis-ci.org/sindresorhus/xdg-basedir)
+
+> Get [XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) paths
+
+
+## Install
+
+```
+$ npm install --save xdg-basedir
+```
+
+
+## Usage
+
+```js
+const xdgBasedir = require('xdg-basedir');
+
+xdgBasedir.data;
+//=> '/home/sindresorhus/.local/share'
+
+xdgBasedir.config;
+//=> '/home/sindresorhus/.config'
+
+xdgBasedir.dataDirs
+//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/']
+```
+
+
+## API
+
+The properties `.data`, `.config`, `.cache`, `.runtime` will return `null` in the uncommon case that both the XDG environment variable is not set and the users home directory can't be found. You need to handle this case. A common solution is to [fall back to a temp directory](https://github.com/yeoman/configstore/blob/b82690fc401318ad18dcd7d151a0003a4898a314/index.js#L15).
+
+### .data
+
+Directory for user specific data files.
+
+### .config
+
+Directory for user specific configuration files.
+
+### .cache
+
+Directory for user specific non-essential data files.
+
+### .runtime
+
+Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).
+
+### .dataDirs
+
+Preference-ordered array of base directories to search for data files in addition to `.data`.
+
+### .configDirs
+
+Preference-ordered array of base directories to search for configuration files in addition to `.config`.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/includes/translator/node_modules/xml2js/LICENSE b/includes/translator/node_modules/xml2js/LICENSE
new file mode 100644
index 0000000..e3b4222
--- /dev/null
+++ b/includes/translator/node_modules/xml2js/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2010, 2011, 2012, 2013. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/includes/translator/node_modules/xml2js/README.md b/includes/translator/node_modules/xml2js/README.md
new file mode 100644
index 0000000..67f2104
--- /dev/null
+++ b/includes/translator/node_modules/xml2js/README.md
@@ -0,0 +1,507 @@
+node-xml2js
+===========
+
+Ever had the urge to parse XML? And wanted to access the data in some sane,
+easy way? Don't want to compile a C parser, for whatever reason? Then xml2js is
+what you're looking for!
+
+Description
+===========
+
+Simple XML to JavaScript object converter. It supports bi-directional conversion.
+Uses [sax-js](https://github.com/isaacs/sax-js/) and
+[xmlbuilder-js](https://github.com/oozcitak/xmlbuilder-js/).
+
+Note: If you're looking for a full DOM parser, you probably want
+[JSDom](https://github.com/tmpvar/jsdom).
+
+Installation
+============
+
+Simplest way to install `xml2js` is to use [npm](http://npmjs.org), just `npm
+install xml2js` which will download xml2js and all dependencies.
+
+xml2js is also available via [Bower](http://bower.io/), just `bower install
+xml2js` which will download xml2js and all dependencies.
+
+Usage
+=====
+
+No extensive tutorials required because you are a smart developer! The task of
+parsing XML should be an easy one, so let's make it so! Here's some examples.
+
+Shoot-and-forget usage
+----------------------
+
+You want to parse XML as simple and easy as possible? It's dangerous to go
+alone, take this:
+
+```javascript
+var parseString = require('xml2js').parseString;
+var xml = "<root>Hello xml2js!</root>"
+parseString(xml, function (err, result) {
+ console.dir(result);
+});
+```
+
+Can't get easier than this, right? This works starting with `xml2js` 0.2.3.
+With CoffeeScript it looks like this:
+
+```coffeescript
+{parseString} = require 'xml2js'
+xml = "<root>Hello xml2js!</root>"
+parseString xml, (err, result) ->
+ console.dir result
+```
+
+If you need some special options, fear not, `xml2js` supports a number of
+options (see below), you can specify these as second argument:
+
+```javascript
+parseString(xml, {trim: true}, function (err, result) {
+});
+```
+
+Simple as pie usage
+-------------------
+
+That's right, if you have been using xml-simple or a home-grown
+wrapper, this was added in 0.1.11 just for you:
+
+```javascript
+var fs = require('fs'),
+ xml2js = require('xml2js');
+
+var parser = new xml2js.Parser();
+fs.readFile(__dirname + '/foo.xml', function(err, data) {
+ parser.parseString(data, function (err, result) {
+ console.dir(result);
+ console.log('Done');
+ });
+});
+```
+
+Look ma, no event listeners!
+
+You can also use `xml2js` from
+[CoffeeScript](https://github.com/jashkenas/coffeescript), further reducing
+the clutter:
+
+```coffeescript
+fs = require 'fs',
+xml2js = require 'xml2js'
+
+parser = new xml2js.Parser()
+fs.readFile __dirname + '/foo.xml', (err, data) ->
+ parser.parseString data, (err, result) ->
+ console.dir result
+ console.log 'Done.'
+```
+
+But what happens if you forget the `new` keyword to create a new `Parser`? In
+the middle of a nightly coding session, it might get lost, after all. Worry
+not, we got you covered! Starting with 0.2.8 you can also leave it out, in
+which case `xml2js` will helpfully add it for you, no bad surprises and
+inexplicable bugs!
+
+Promise usage
+-------------
+
+```javascript
+var xml2js = require('xml2js');
+var xml = '<foo></foo>';
+
+// With parser
+var parser = new xml2js.Parser(/* options */);
+parser.parseStringPromise(xml).then(function (result) {
+ console.dir(result);
+ console.log('Done');
+})
+.catch(function (err) {
+ // Failed
+});
+
+// Without parser
+xml2js.parseStringPromise(xml /*, options */).then(function (result) {
+ console.dir(result);
+ console.log('Done');
+})
+.catch(function (err) {
+ // Failed
+});
+```
+
+Parsing multiple files
+----------------------
+
+If you want to parse multiple files, you have multiple possibilities:
+
+ * You can create one `xml2js.Parser` per file. That's the recommended one
+ and is promised to always *just work*.
+ * You can call `reset()` on your parser object.
+ * You can hope everything goes well anyway. This behaviour is not
+ guaranteed work always, if ever. Use option #1 if possible. Thanks!
+
+So you wanna some JSON?
+-----------------------
+
+Just wrap the `result` object in a call to `JSON.stringify` like this
+`JSON.stringify(result)`. You get a string containing the JSON representation
+of the parsed object that you can feed to JSON-hungry consumers.
+
+Displaying results
+------------------
+
+You might wonder why, using `console.dir` or `console.log` the output at some
+level is only `[Object]`. Don't worry, this is not because `xml2js` got lazy.
+That's because Node uses `util.inspect` to convert the object into strings and
+that function stops after `depth=2` which is a bit low for most XML.
+
+To display the whole deal, you can use `console.log(util.inspect(result, false,
+null))`, which displays the whole result.
+
+So much for that, but what if you use
+[eyes](https://github.com/cloudhead/eyes.js) for nice colored output and it
+truncates the output with `…`? Don't fear, there's also a solution for that,
+you just need to increase the `maxLength` limit by creating a custom inspector
+`var inspect = require('eyes').inspector({maxLength: false})` and then you can
+easily `inspect(result)`.
+
+XML builder usage
+-----------------
+
+Since 0.4.0, objects can be also be used to build XML:
+
+```javascript
+var xml2js = require('xml2js');
+
+var obj = {name: "Super", Surname: "Man", age: 23};
+
+var builder = new xml2js.Builder();
+var xml = builder.buildObject(obj);
+```
+will result in:
+
+```xml
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<root>
+ <name>Super</name>
+ <Surname>Man</Surname>
+ <age>23</age>
+</root>
+```
+
+At the moment, a one to one bi-directional conversion is guaranteed only for
+default configuration, except for `attrkey`, `charkey` and `explicitArray` options
+you can redefine to your taste. Writing CDATA is supported via setting the `cdata`
+option to `true`.
+
+To specify attributes:
+```javascript
+var xml2js = require('xml2js');
+
+var obj = {root: {$: {id: "my id"}, _: "my inner text"}};
+
+var builder = new xml2js.Builder();
+var xml = builder.buildObject(obj);
+```
+will result in:
+```xml
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<root id="my id">my inner text</root>
+```
+
+### Adding xmlns attributes
+
+You can generate XML that declares XML namespace prefix / URI pairs with xmlns attributes.
+
+Example declaring a default namespace on the root element:
+
+```javascript
+let obj = {
+ Foo: {
+ $: {
+ "xmlns": "http://foo.com"
+ }
+ }
+};
+```
+Result of `buildObject(obj)`:
+```xml
+<Foo xmlns="http://foo.com"/>
+```
+Example declaring non-default namespaces on non-root elements:
+```javascript
+let obj = {
+ 'foo:Foo': {
+ $: {
+ 'xmlns:foo': 'http://foo.com'
+ },
+ 'bar:Bar': {
+ $: {
+ 'xmlns:bar': 'http://bar.com'
+ }
+ }
+ }
+}
+```
+Result of `buildObject(obj)`:
+```xml
+<foo:Foo xmlns:foo="http://foo.com">
+ <bar:Bar xmlns:bar="http://bar.com"/>
+</foo:Foo>
+```
+
+
+Processing attribute, tag names and values
+------------------------------------------
+
+Since 0.4.1 you can optionally provide the parser with attribute name and tag name processors as well as element value processors (Since 0.4.14, you can also optionally provide the parser with attribute value processors):
+
+```javascript
+
+function nameToUpperCase(name){
+ return name.toUpperCase();
+}
+
+//transform all attribute and tag names and values to uppercase
+parseString(xml, {
+ tagNameProcessors: [nameToUpperCase],
+ attrNameProcessors: [nameToUpperCase],
+ valueProcessors: [nameToUpperCase],
+ attrValueProcessors: [nameToUpperCase]},
+ function (err, result) {
+ // processed data
+});
+```
+
+The `tagNameProcessors` and `attrNameProcessors` options
+accept an `Array` of functions with the following signature:
+
+```javascript
+function (name){
+ //do something with `name`
+ return name
+}
+```
+
+The `attrValueProcessors` and `valueProcessors` options
+accept an `Array` of functions with the following signature:
+
+```javascript
+function (value, name) {
+ //`name` will be the node name or attribute name
+ //do something with `value`, (optionally) dependent on the node/attr name
+ return value
+}
+```
+
+Some processors are provided out-of-the-box and can be found in `lib/processors.js`:
+
+- `normalize`: transforms the name to lowercase.
+(Automatically used when `options.normalize` is set to `true`)
+
+- `firstCharLowerCase`: transforms the first character to lower case.
+E.g. 'MyTagName' becomes 'myTagName'
+
+- `stripPrefix`: strips the xml namespace prefix. E.g `<foo:Bar/>` will become 'Bar'.
+(N.B.: the `xmlns` prefix is NOT stripped.)
+
+- `parseNumbers`: parses integer-like strings as integers and float-like strings as floats
+E.g. "0" becomes 0 and "15.56" becomes 15.56
+
+- `parseBooleans`: parses boolean-like strings to booleans
+E.g. "true" becomes true and "False" becomes false
+
+Options
+=======
+
+Apart from the default settings, there are a number of options that can be
+specified for the parser. Options are specified by ``new Parser({optionName:
+value})``. Possible options are:
+
+ * `attrkey` (default: `$`): Prefix that is used to access the attributes.
+ Version 0.1 default was `@`.
+ * `charkey` (default: `_`): Prefix that is used to access the character
+ content. Version 0.1 default was `#`.
+ * `explicitCharkey` (default: `false`) Determines whether or not to use
+ a `charkey` prefix for elements with no attributes.
+ * `trim` (default: `false`): Trim the whitespace at the beginning and end of
+ text nodes.
+ * `normalizeTags` (default: `false`): Normalize all tag names to lowercase.
+ * `normalize` (default: `false`): Trim whitespaces inside text nodes.
+ * `explicitRoot` (default: `true`): Set this if you want to get the root
+ node in the resulting object.
+ * `emptyTag` (default: `''`): what will the value of empty nodes be. In case
+ you want to use an empty object as a default value, it is better to provide a factory
+ function `() => ({})` instead. Without this function a plain object would
+ become a shared reference across all occurrences with unwanted behavior.
+ * `explicitArray` (default: `true`): Always put child nodes in an array if
+ true; otherwise an array is created only if there is more than one.
+ * `ignoreAttrs` (default: `false`): Ignore all XML attributes and only create
+ text nodes.
+ * `mergeAttrs` (default: `false`): Merge attributes and child elements as
+ properties of the parent, instead of keying attributes off a child
+ attribute object. This option is ignored if `ignoreAttrs` is `true`.
+ * `validator` (default `null`): You can specify a callable that validates
+ the resulting structure somehow, however you want. See unit tests
+ for an example.
+ * `xmlns` (default `false`): Give each element a field usually called '$ns'
+ (the first character is the same as attrkey) that contains its local name
+ and namespace URI.
+ * `explicitChildren` (default `false`): Put child elements to separate
+ property. Doesn't work with `mergeAttrs = true`. If element has no children
+ then "children" won't be created. Added in 0.2.5.
+ * `childkey` (default `$$`): Prefix that is used to access child elements if
+ `explicitChildren` is set to `true`. Added in 0.2.5.
+ * `preserveChildrenOrder` (default `false`): Modifies the behavior of
+ `explicitChildren` so that the value of the "children" property becomes an
+ ordered array. When this is `true`, every node will also get a `#name` field
+ whose value will correspond to the XML nodeName, so that you may iterate
+ the "children" array and still be able to determine node names. The named
+ (and potentially unordered) properties are also retained in this
+ configuration at the same level as the ordered "children" array. Added in
+ 0.4.9.
+ * `charsAsChildren` (default `false`): Determines whether chars should be
+ considered children if `explicitChildren` is on. Added in 0.2.5.
+ * `includeWhiteChars` (default `false`): Determines whether whitespace-only
+ text nodes should be included. Added in 0.4.17.
+ * `async` (default `false`): Should the callbacks be async? This *might* be
+ an incompatible change if your code depends on sync execution of callbacks.
+ Future versions of `xml2js` might change this default, so the recommendation
+ is to not depend on sync execution anyway. Added in 0.2.6.
+ * `strict` (default `true`): Set sax-js to strict or non-strict parsing mode.
+ Defaults to `true` which is *highly* recommended, since parsing HTML which
+ is not well-formed XML might yield just about anything. Added in 0.2.7.
+ * `attrNameProcessors` (default: `null`): Allows the addition of attribute
+ name processing functions. Accepts an `Array` of functions with following
+ signature:
+ ```javascript
+ function (name){
+ //do something with `name`
+ return name
+ }
+ ```
+ Added in 0.4.14
+ * `attrValueProcessors` (default: `null`): Allows the addition of attribute
+ value processing functions. Accepts an `Array` of functions with following
+ signature:
+ ```javascript
+ function (value, name){
+ //do something with `name`
+ return name
+ }
+ ```
+ Added in 0.4.1
+ * `tagNameProcessors` (default: `null`): Allows the addition of tag name
+ processing functions. Accepts an `Array` of functions with following
+ signature:
+ ```javascript
+ function (name){
+ //do something with `name`
+ return name
+ }
+ ```
+ Added in 0.4.1
+ * `valueProcessors` (default: `null`): Allows the addition of element value
+ processing functions. Accepts an `Array` of functions with following
+ signature:
+ ```javascript
+ function (value, name){
+ //do something with `name`
+ return name
+ }
+ ```
+ Added in 0.4.6
+
+Options for the `Builder` class
+-------------------------------
+These options are specified by ``new Builder({optionName: value})``.
+Possible options are:
+
+ * `attrkey` (default: `$`): Prefix that is used to access the attributes.
+ Version 0.1 default was `@`.
+ * `charkey` (default: `_`): Prefix that is used to access the character
+ content. Version 0.1 default was `#`.
+ * `rootName` (default `root` or the root key name): root element name to be used in case
+ `explicitRoot` is `false` or to override the root element name.
+ * `renderOpts` (default `{ 'pretty': true, 'indent': ' ', 'newline': '\n' }`):
+ Rendering options for xmlbuilder-js.
+ * pretty: prettify generated XML
+ * indent: whitespace for indentation (only when pretty)
+ * newline: newline char (only when pretty)
+ * `xmldec` (default `{ 'version': '1.0', 'encoding': 'UTF-8', 'standalone': true }`:
+ XML declaration attributes.
+ * `xmldec.version` A version number string, e.g. 1.0
+ * `xmldec.encoding` Encoding declaration, e.g. UTF-8
+ * `xmldec.standalone` standalone document declaration: true or false
+ * `doctype` (default `null`): optional DTD. Eg. `{'ext': 'hello.dtd'}`
+ * `headless` (default: `false`): omit the XML header. Added in 0.4.3.
+ * `allowSurrogateChars` (default: `false`): allows using characters from the Unicode
+ surrogate blocks.
+ * `cdata` (default: `false`): wrap text nodes in `<![CDATA[ ... ]]>` instead of
+ escaping when necessary. Does not add `<![CDATA[ ... ]]>` if it is not required.
+ Added in 0.4.5.
+
+`renderOpts`, `xmldec`,`doctype` and `headless` pass through to
+[xmlbuilder-js](https://github.com/oozcitak/xmlbuilder-js).
+
+Updating to new version
+=======================
+
+Version 0.2 changed the default parsing settings, but version 0.1.14 introduced
+the default settings for version 0.2, so these settings can be tried before the
+migration.
+
+```javascript
+var xml2js = require('xml2js');
+var parser = new xml2js.Parser(xml2js.defaults["0.2"]);
+```
+
+To get the 0.1 defaults in version 0.2 you can just use
+`xml2js.defaults["0.1"]` in the same place. This provides you with enough time
+to migrate to the saner way of parsing in `xml2js` 0.2. We try to make the
+migration as simple and gentle as possible, but some breakage cannot be
+avoided.
+
+So, what exactly did change and why? In 0.2 we changed some defaults to parse
+the XML in a more universal and sane way. So we disabled `normalize` and `trim`
+so `xml2js` does not cut out any text content. You can reenable this at will of
+course. A more important change is that we return the root tag in the resulting
+JavaScript structure via the `explicitRoot` setting, so you need to access the
+first element. This is useful for anybody who wants to know what the root node
+is and preserves more information. The last major change was to enable
+`explicitArray`, so everytime it is possible that one might embed more than one
+sub-tag into a tag, xml2js >= 0.2 returns an array even if the array just
+includes one element. This is useful when dealing with APIs that return
+variable amounts of subtags.
+
+Running tests, development
+==========================
+
+[![Build Status](https://travis-ci.org/Leonidas-from-XIV/node-xml2js.svg?branch=master)](https://travis-ci.org/Leonidas-from-XIV/node-xml2js)
+[![Coverage Status](https://coveralls.io/repos/Leonidas-from-XIV/node-xml2js/badge.svg?branch=)](https://coveralls.io/r/Leonidas-from-XIV/node-xml2js?branch=master)
+[![Dependency Status](https://david-dm.org/Leonidas-from-XIV/node-xml2js.svg)](https://david-dm.org/Leonidas-from-XIV/node-xml2js)
+
+The development requirements are handled by npm, you just need to install them.
+We also have a number of unit tests, they can be run using `npm test` directly
+from the project root. This runs zap to discover all the tests and execute
+them.
+
+If you like to contribute, keep in mind that `xml2js` is written in
+CoffeeScript, so don't develop on the JavaScript files that are checked into
+the repository for convenience reasons. Also, please write some unit test to
+check your behaviour and if it is some user-facing thing, add some
+documentation to this README, so people will know it exists. Thanks in advance!
+
+Getting support
+===============
+
+Please, if you have a problem with the library, first make sure you read this
+README. If you read this far, thanks, you're good. Then, please make sure your
+problem really is with `xml2js`. It is? Okay, then I'll look at it. Send me a
+mail and we can talk. Please don't open issues, as I don't think that is the
+proper forum for support problems. Some problems might as well really be bugs
+in `xml2js`, if so I'll let you know to open an issue instead :)
+
+But if you know you really found a bug, feel free to open an issue instead.
diff --git a/includes/translator/node_modules/xml2js/lib/bom.js b/includes/translator/node_modules/xml2js/lib/bom.js
new file mode 100644
index 0000000..7b8fb27
--- /dev/null
+++ b/includes/translator/node_modules/xml2js/lib/bom.js
@@ -0,0 +1,12 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ "use strict";
+ exports.stripBOM = function(str) {
+ if (str[0] === '\uFEFF') {
+ return str.substring(1);
+ } else {
+ return str;
+ }
+ };
+
+}).call(this);
diff --git a/includes/translator/node_modules/xml2js/lib/builder.js b/includes/translator/node_modules/xml2js/lib/builder.js
new file mode 100644
index 0000000..58f3638
--- /dev/null
+++ b/includes/translator/node_modules/xml2js/lib/builder.js
@@ -0,0 +1,127 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ "use strict";
+ var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA,
+ hasProp = {}.hasOwnProperty;
+
+ builder = require('xmlbuilder');
+
+ defaults = require('./defaults').defaults;
+
+ requiresCDATA = function(entry) {
+ return typeof entry === "string" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0);
+ };
+
+ wrapCDATA = function(entry) {
+ return "<![CDATA[" + (escapeCDATA(entry)) + "]]>";
+ };
+
+ escapeCDATA = function(entry) {
+ return entry.replace(']]>', ']]]]><![CDATA[>');
+ };
+
+ exports.Builder = (function() {
+ function Builder(opts) {
+ var key, ref, value;
+ this.options = {};
+ ref = defaults["0.2"];
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ value = ref[key];
+ this.options[key] = value;
+ }
+ for (key in opts) {
+ if (!hasProp.call(opts, key)) continue;
+ value = opts[key];
+ this.options[key] = value;
+ }
+ }
+
+ Builder.prototype.buildObject = function(rootObj) {
+ var attrkey, charkey, render, rootElement, rootName;
+ attrkey = this.options.attrkey;
+ charkey = this.options.charkey;
+ if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) {
+ rootName = Object.keys(rootObj)[0];
+ rootObj = rootObj[rootName];
+ } else {
+ rootName = this.options.rootName;
+ }
+ render = (function(_this) {
+ return function(element, obj) {
+ var attr, child, entry, index, key, value;
+ if (typeof obj !== 'object') {
+ if (_this.options.cdata && requiresCDATA(obj)) {
+ element.raw(wrapCDATA(obj));
+ } else {
+ element.txt(obj);
+ }
+ } else if (Array.isArray(obj)) {
+ for (index in obj) {
+ if (!hasProp.call(obj, index)) continue;
+ child = obj[index];
+ for (key in child) {
+ entry = child[key];
+ element = render(element.ele(key), entry).up();
+ }
+ }
+ } else {
+ for (key in obj) {
+ if (!hasProp.call(obj, key)) continue;
+ child = obj[key];
+ if (key === attrkey) {
+ if (typeof child === "object") {
+ for (attr in child) {
+ value = child[attr];
+ element = element.att(attr, value);
+ }
+ }
+ } else if (key === charkey) {
+ if (_this.options.cdata && requiresCDATA(child)) {
+ element = element.raw(wrapCDATA(child));
+ } else {
+ element = element.txt(child);
+ }
+ } else if (Array.isArray(child)) {
+ for (index in child) {
+ if (!hasProp.call(child, index)) continue;
+ entry = child[index];
+ if (typeof entry === 'string') {
+ if (_this.options.cdata && requiresCDATA(entry)) {
+ element = element.ele(key).raw(wrapCDATA(entry)).up();
+ } else {
+ element = element.ele(key, entry).up();
+ }
+ } else {
+ element = render(element.ele(key), entry).up();
+ }
+ }
+ } else if (typeof child === "object") {
+ element = render(element.ele(key), child).up();
+ } else {
+ if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) {
+ element = element.ele(key).raw(wrapCDATA(child)).up();
+ } else {
+ if (child == null) {
+ child = '';
+ }
+ element = element.ele(key, child.toString()).up();
+ }
+ }
+ }
+ }
+ return element;
+ };
+ })(this);
+ rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {
+ headless: this.options.headless,
+ allowSurrogateChars: this.options.allowSurrogateChars
+ });
+ return render(rootElement, rootObj).end(this.options.renderOpts);
+ };
+
+ return Builder;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xml2js/lib/defaults.js b/includes/translator/node_modules/xml2js/lib/defaults.js
new file mode 100644
index 0000000..0a21da0
--- /dev/null
+++ b/includes/translator/node_modules/xml2js/lib/defaults.js
@@ -0,0 +1,72 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ exports.defaults = {
+ "0.1": {
+ explicitCharkey: false,
+ trim: true,
+ normalize: true,
+ normalizeTags: false,
+ attrkey: "@",
+ charkey: "#",
+ explicitArray: false,
+ ignoreAttrs: false,
+ mergeAttrs: false,
+ explicitRoot: false,
+ validator: null,
+ xmlns: false,
+ explicitChildren: false,
+ childkey: '@@',
+ charsAsChildren: false,
+ includeWhiteChars: false,
+ async: false,
+ strict: true,
+ attrNameProcessors: null,
+ attrValueProcessors: null,
+ tagNameProcessors: null,
+ valueProcessors: null,
+ emptyTag: ''
+ },
+ "0.2": {
+ explicitCharkey: false,
+ trim: false,
+ normalize: false,
+ normalizeTags: false,
+ attrkey: "$",
+ charkey: "_",
+ explicitArray: true,
+ ignoreAttrs: false,
+ mergeAttrs: false,
+ explicitRoot: true,
+ validator: null,
+ xmlns: false,
+ explicitChildren: false,
+ preserveChildrenOrder: false,
+ childkey: '$$',
+ charsAsChildren: false,
+ includeWhiteChars: false,
+ async: false,
+ strict: true,
+ attrNameProcessors: null,
+ attrValueProcessors: null,
+ tagNameProcessors: null,
+ valueProcessors: null,
+ rootName: 'root',
+ xmldec: {
+ 'version': '1.0',
+ 'encoding': 'UTF-8',
+ 'standalone': true
+ },
+ doctype: null,
+ renderOpts: {
+ 'pretty': true,
+ 'indent': ' ',
+ 'newline': '\n'
+ },
+ headless: false,
+ chunkSize: 10000,
+ emptyTag: '',
+ cdata: false
+ }
+ };
+
+}).call(this);
diff --git a/includes/translator/node_modules/xml2js/lib/parser.js b/includes/translator/node_modules/xml2js/lib/parser.js
new file mode 100644
index 0000000..0893591
--- /dev/null
+++ b/includes/translator/node_modules/xml2js/lib/parser.js
@@ -0,0 +1,396 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ "use strict";
+ var bom, defaults, events, isEmpty, isValidKey, processItem, processors, sax, setImmediate,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ sax = require('sax');
+
+ events = require('events');
+
+ bom = require('./bom');
+
+ processors = require('./processors');
+
+ setImmediate = require('timers').setImmediate;
+
+ defaults = require('./defaults').defaults;
+
+ isEmpty = function(thing) {
+ return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0;
+ };
+
+ isValidKey = function(key) {
+ return key !== '__proto__' && key !== 'constructor' && key !== 'prototype';
+ };
+
+ processItem = function(processors, item, key) {
+ var i, len, process;
+ for (i = 0, len = processors.length; i < len; i++) {
+ process = processors[i];
+ item = process(item, key);
+ }
+ return item;
+ };
+
+ exports.Parser = (function(superClass) {
+ extend(Parser, superClass);
+
+ function Parser(opts) {
+ this.parseStringPromise = bind(this.parseStringPromise, this);
+ this.parseString = bind(this.parseString, this);
+ this.reset = bind(this.reset, this);
+ this.assignOrPush = bind(this.assignOrPush, this);
+ this.processAsync = bind(this.processAsync, this);
+ var key, ref, value;
+ if (!(this instanceof exports.Parser)) {
+ return new exports.Parser(opts);
+ }
+ this.options = {};
+ ref = defaults["0.2"];
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ value = ref[key];
+ this.options[key] = value;
+ }
+ for (key in opts) {
+ if (!hasProp.call(opts, key)) continue;
+ value = opts[key];
+ this.options[key] = value;
+ }
+ if (this.options.xmlns) {
+ this.options.xmlnskey = this.options.attrkey + "ns";
+ }
+ if (this.options.normalizeTags) {
+ if (!this.options.tagNameProcessors) {
+ this.options.tagNameProcessors = [];
+ }
+ this.options.tagNameProcessors.unshift(processors.normalize);
+ }
+ this.reset();
+ }
+
+ Parser.prototype.processAsync = function() {
+ var chunk, err;
+ try {
+ if (this.remaining.length <= this.options.chunkSize) {
+ chunk = this.remaining;
+ this.remaining = '';
+ this.saxParser = this.saxParser.write(chunk);
+ return this.saxParser.close();
+ } else {
+ chunk = this.remaining.substr(0, this.options.chunkSize);
+ this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);
+ this.saxParser = this.saxParser.write(chunk);
+ return setImmediate(this.processAsync);
+ }
+ } catch (error1) {
+ err = error1;
+ if (!this.saxParser.errThrown) {
+ this.saxParser.errThrown = true;
+ return this.emit(err);
+ }
+ }
+ };
+
+ Parser.prototype.assignOrPush = function(obj, key, newValue) {
+ if (!isValidKey(key)) {
+ return;
+ }
+ if (!(key in obj)) {
+ if (!this.options.explicitArray) {
+ return obj[key] = newValue;
+ } else {
+ return obj[key] = [newValue];
+ }
+ } else {
+ if (!(obj[key] instanceof Array)) {
+ obj[key] = [obj[key]];
+ }
+ return obj[key].push(newValue);
+ }
+ };
+
+ Parser.prototype.reset = function() {
+ var attrkey, charkey, ontext, stack;
+ this.removeAllListeners();
+ this.saxParser = sax.parser(this.options.strict, {
+ trim: false,
+ normalize: false,
+ xmlns: this.options.xmlns
+ });
+ this.saxParser.errThrown = false;
+ this.saxParser.onerror = (function(_this) {
+ return function(error) {
+ _this.saxParser.resume();
+ if (!_this.saxParser.errThrown) {
+ _this.saxParser.errThrown = true;
+ return _this.emit("error", error);
+ }
+ };
+ })(this);
+ this.saxParser.onend = (function(_this) {
+ return function() {
+ if (!_this.saxParser.ended) {
+ _this.saxParser.ended = true;
+ return _this.emit("end", _this.resultObject);
+ }
+ };
+ })(this);
+ this.saxParser.ended = false;
+ this.EXPLICIT_CHARKEY = this.options.explicitCharkey;
+ this.resultObject = null;
+ stack = [];
+ attrkey = this.options.attrkey;
+ charkey = this.options.charkey;
+ this.saxParser.onopentag = (function(_this) {
+ return function(node) {
+ var key, newValue, obj, processedKey, ref;
+ obj = {};
+ obj[charkey] = "";
+ if (!_this.options.ignoreAttrs) {
+ ref = node.attributes;
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ if (!(attrkey in obj) && !_this.options.mergeAttrs) {
+ obj[attrkey] = {};
+ }
+ newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
+ processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
+ if (isValidKey(processedKey)) {
+ if (_this.options.mergeAttrs) {
+ _this.assignOrPush(obj, processedKey, newValue);
+ } else {
+ obj[attrkey][processedKey] = newValue;
+ }
+ }
+ }
+ }
+ obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;
+ if (_this.options.xmlns) {
+ obj[_this.options.xmlnskey] = {
+ uri: node.uri,
+ local: node.local
+ };
+ }
+ return stack.push(obj);
+ };
+ })(this);
+ this.saxParser.onclosetag = (function(_this) {
+ return function() {
+ var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;
+ obj = stack.pop();
+ nodeName = obj["#name"];
+ if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) {
+ delete obj["#name"];
+ }
+ if (obj.cdata === true) {
+ cdata = obj.cdata;
+ delete obj.cdata;
+ }
+ s = stack[stack.length - 1];
+ if (obj[charkey].match(/^\s*$/) && !cdata) {
+ emptyStr = obj[charkey];
+ delete obj[charkey];
+ } else {
+ if (_this.options.trim) {
+ obj[charkey] = obj[charkey].trim();
+ }
+ if (_this.options.normalize) {
+ obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim();
+ }
+ obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];
+ if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
+ obj = obj[charkey];
+ }
+ }
+ if (isEmpty(obj)) {
+ if (typeof _this.options.emptyTag === 'function') {
+ obj = _this.options.emptyTag();
+ } else {
+ obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;
+ }
+ }
+ if (_this.options.validator != null) {
+ xpath = "/" + ((function() {
+ var i, len, results;
+ results = [];
+ for (i = 0, len = stack.length; i < len; i++) {
+ node = stack[i];
+ results.push(node["#name"]);
+ }
+ return results;
+ })()).concat(nodeName).join("/");
+ (function() {
+ var err;
+ try {
+ return obj = _this.options.validator(xpath, s && s[nodeName], obj);
+ } catch (error1) {
+ err = error1;
+ return _this.emit("error", err);
+ }
+ })();
+ }
+ if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') {
+ if (!_this.options.preserveChildrenOrder) {
+ node = {};
+ if (_this.options.attrkey in obj) {
+ node[_this.options.attrkey] = obj[_this.options.attrkey];
+ delete obj[_this.options.attrkey];
+ }
+ if (!_this.options.charsAsChildren && _this.options.charkey in obj) {
+ node[_this.options.charkey] = obj[_this.options.charkey];
+ delete obj[_this.options.charkey];
+ }
+ if (Object.getOwnPropertyNames(obj).length > 0) {
+ node[_this.options.childkey] = obj;
+ }
+ obj = node;
+ } else if (s) {
+ s[_this.options.childkey] = s[_this.options.childkey] || [];
+ objClone = {};
+ for (key in obj) {
+ if (!hasProp.call(obj, key)) continue;
+ if (isValidKey(key)) {
+ objClone[key] = obj[key];
+ }
+ }
+ s[_this.options.childkey].push(objClone);
+ delete obj["#name"];
+ if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
+ obj = obj[charkey];
+ }
+ }
+ }
+ if (stack.length > 0) {
+ return _this.assignOrPush(s, nodeName, obj);
+ } else {
+ if (_this.options.explicitRoot) {
+ old = obj;
+ obj = {};
+ obj[nodeName] = old;
+ }
+ _this.resultObject = obj;
+ _this.saxParser.ended = true;
+ return _this.emit("end", _this.resultObject);
+ }
+ };
+ })(this);
+ ontext = (function(_this) {
+ return function(text) {
+ var charChild, s;
+ s = stack[stack.length - 1];
+ if (s) {
+ s[charkey] += text;
+ if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, '').trim() !== '')) {
+ s[_this.options.childkey] = s[_this.options.childkey] || [];
+ charChild = {
+ '#name': '__text__'
+ };
+ charChild[charkey] = text;
+ if (_this.options.normalize) {
+ charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim();
+ }
+ s[_this.options.childkey].push(charChild);
+ }
+ return s;
+ }
+ };
+ })(this);
+ this.saxParser.ontext = ontext;
+ return this.saxParser.oncdata = (function(_this) {
+ return function(text) {
+ var s;
+ s = ontext(text);
+ if (s) {
+ return s.cdata = true;
+ }
+ };
+ })(this);
+ };
+
+ Parser.prototype.parseString = function(str, cb) {
+ var err;
+ if ((cb != null) && typeof cb === "function") {
+ this.on("end", function(result) {
+ this.reset();
+ return cb(null, result);
+ });
+ this.on("error", function(err) {
+ this.reset();
+ return cb(err);
+ });
+ }
+ try {
+ str = str.toString();
+ if (str.trim() === '') {
+ this.emit("end", null);
+ return true;
+ }
+ str = bom.stripBOM(str);
+ if (this.options.async) {
+ this.remaining = str;
+ setImmediate(this.processAsync);
+ return this.saxParser;
+ }
+ return this.saxParser.write(str).close();
+ } catch (error1) {
+ err = error1;
+ if (!(this.saxParser.errThrown || this.saxParser.ended)) {
+ this.emit('error', err);
+ return this.saxParser.errThrown = true;
+ } else if (this.saxParser.ended) {
+ throw err;
+ }
+ }
+ };
+
+ Parser.prototype.parseStringPromise = function(str) {
+ return new Promise((function(_this) {
+ return function(resolve, reject) {
+ return _this.parseString(str, function(err, value) {
+ if (err) {
+ return reject(err);
+ } else {
+ return resolve(value);
+ }
+ });
+ };
+ })(this));
+ };
+
+ return Parser;
+
+ })(events);
+
+ exports.parseString = function(str, a, b) {
+ var cb, options, parser;
+ if (b != null) {
+ if (typeof b === 'function') {
+ cb = b;
+ }
+ if (typeof a === 'object') {
+ options = a;
+ }
+ } else {
+ if (typeof a === 'function') {
+ cb = a;
+ }
+ options = {};
+ }
+ parser = new exports.Parser(options);
+ return parser.parseString(str, cb);
+ };
+
+ exports.parseStringPromise = function(str, a) {
+ var options, parser;
+ if (typeof a === 'object') {
+ options = a;
+ }
+ parser = new exports.Parser(options);
+ return parser.parseStringPromise(str);
+ };
+
+}).call(this);
diff --git a/includes/translator/node_modules/xml2js/lib/processors.js b/includes/translator/node_modules/xml2js/lib/processors.js
new file mode 100644
index 0000000..89aa85f
--- /dev/null
+++ b/includes/translator/node_modules/xml2js/lib/processors.js
@@ -0,0 +1,34 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ "use strict";
+ var prefixMatch;
+
+ prefixMatch = new RegExp(/(?!xmlns)^.*:/);
+
+ exports.normalize = function(str) {
+ return str.toLowerCase();
+ };
+
+ exports.firstCharLowerCase = function(str) {
+ return str.charAt(0).toLowerCase() + str.slice(1);
+ };
+
+ exports.stripPrefix = function(str) {
+ return str.replace(prefixMatch, '');
+ };
+
+ exports.parseNumbers = function(str) {
+ if (!isNaN(str)) {
+ str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);
+ }
+ return str;
+ };
+
+ exports.parseBooleans = function(str) {
+ if (/^(?:true|false)$/i.test(str)) {
+ str = str.toLowerCase() === 'true';
+ }
+ return str;
+ };
+
+}).call(this);
diff --git a/includes/translator/node_modules/xml2js/lib/xml2js.js b/includes/translator/node_modules/xml2js/lib/xml2js.js
new file mode 100644
index 0000000..24b6e69
--- /dev/null
+++ b/includes/translator/node_modules/xml2js/lib/xml2js.js
@@ -0,0 +1,39 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ "use strict";
+ var builder, defaults, parser, processors,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ defaults = require('./defaults');
+
+ builder = require('./builder');
+
+ parser = require('./parser');
+
+ processors = require('./processors');
+
+ exports.defaults = defaults.defaults;
+
+ exports.processors = processors;
+
+ exports.ValidationError = (function(superClass) {
+ extend(ValidationError, superClass);
+
+ function ValidationError(message) {
+ this.message = message;
+ }
+
+ return ValidationError;
+
+ })(Error);
+
+ exports.Builder = builder.Builder;
+
+ exports.Parser = parser.Parser;
+
+ exports.parseString = parser.parseString;
+
+ exports.parseStringPromise = parser.parseStringPromise;
+
+}).call(this);
diff --git a/includes/translator/node_modules/xml2js/package.json b/includes/translator/node_modules/xml2js/package.json
new file mode 100644
index 0000000..d70b792
--- /dev/null
+++ b/includes/translator/node_modules/xml2js/package.json
@@ -0,0 +1,93 @@
+{
+ "name": "xml2js",
+ "description": "Simple XML to JavaScript object converter.",
+ "keywords": [
+ "xml",
+ "json"
+ ],
+ "homepage": "https://github.com/Leonidas-from-XIV/node-xml2js",
+ "version": "0.6.0",
+ "author": "Marek Kubica <marek@xivilization.net> (https://xivilization.net)",
+ "contributors": [
+ "maqr <maqr.lollerskates@gmail.com> (https://github.com/maqr)",
+ "Ben Weaver (http://benweaver.com/)",
+ "Jae Kwon (https://github.com/jaekwon)",
+ "Jim Robert",
+ "Ștefan Rusu (http://www.saltwaterc.eu/)",
+ "Carter Cole <carter.cole@cartercole.com> (http://cartercole.com/)",
+ "Kurt Raschke <kurt@kurtraschke.com> (http://www.kurtraschke.com/)",
+ "Contra <contra@australia.edu> (https://github.com/Contra)",
+ "Marcelo Diniz <marudiniz@gmail.com> (https://github.com/mdiniz)",
+ "Michael Hart (https://github.com/mhart)",
+ "Zachary Scott <zachary@zacharyscott.net> (http://zacharyscott.net/)",
+ "Raoul Millais (https://github.com/raoulmillais)",
+ "Salsita Software (http://www.salsitasoft.com/)",
+ "Mike Schilling <mike@emotive.com> (http://www.emotive.com/)",
+ "Jackson Tian <shyvo1987@gmail.com> (http://weibo.com/shyvo)",
+ "Mikhail Zyatin <mikhail.zyatin@gmail.com> (https://github.com/Sitin)",
+ "Chris Tavares <ctavares@microsoft.com> (https://github.com/christav)",
+ "Frank Xu <yyfrankyy@gmail.com> (http://f2e.us/)",
+ "Guido D'Albore <guido@bitstorm.it> (http://www.bitstorm.it/)",
+ "Jack Senechal (http://jacksenechal.com/)",
+ "Matthias Hölzl <tc@xantira.com> (https://github.com/hoelzl)",
+ "Camille Reynders <info@creynders.be> (http://www.creynders.be/)",
+ "Taylor Gautier (https://github.com/tsgautier)",
+ "Todd Bryan (https://github.com/toddrbryan)",
+ "Leore Avidar <leore.avidar@gmail.com> (http://leoreavidar.com/)",
+ "Dave Aitken <dave.aitken@gmail.com> (http://www.actionshrimp.com/)",
+ "Shaney Orrowe <shaney.orrowe@practiceweb.co.uk>",
+ "Candle <candle@candle.me.uk>",
+ "Jess Telford <hi@jes.st> (http://jes.st)",
+ "Tom Hughes <<tom@compton.nu> (http://compton.nu/)",
+ "Piotr Rochala (http://rocha.la/)",
+ "Michael Avila (https://github.com/michaelavila)",
+ "Ryan Gahl (https://github.com/ryedin)",
+ "Eric Laberge <e.laberge@gmail.com> (https://github.com/elaberge)",
+ "Benjamin E. Coe <ben@npmjs.com> (https://twitter.com/benjamincoe)",
+ "Stephen Cresswell (https://github.com/cressie176)",
+ "Pascal Ehlert <pascal@hacksrus.net> (http://www.hacksrus.net/)",
+ "Tom Spencer <fiznool@gmail.com> (http://fiznool.com/)",
+ "Tristian Flanagan <tflanagan@datacollaborative.com> (https://github.com/tflanagan)",
+ "Tim Johns <timjohns@yahoo.com> (https://github.com/TimJohns)",
+ "Bogdan Chadkin <trysound@yandex.ru> (https://github.com/TrySound)",
+ "David Wood <david.p.wood@gmail.com> (http://codesleuth.co.uk/)",
+ "Nicolas Maquet (https://github.com/nmaquet)",
+ "Lovell Fuller (http://lovell.info/)",
+ "d3adc0d3 (https://github.com/d3adc0d3)",
+ "James Crosby (https://github.com/autopulated)"
+ ],
+ "main": "./lib/xml2js",
+ "files": [
+ "lib"
+ ],
+ "directories": {
+ "lib": "./lib"
+ },
+ "scripts": {
+ "build": "cake build",
+ "test": "zap",
+ "coverage": "nyc npm test && nyc report",
+ "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
+ "doc": "cake doc"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Leonidas-from-XIV/node-xml2js.git"
+ },
+ "dependencies": {
+ "sax": ">=0.6.0",
+ "xmlbuilder": "~11.0.0"
+ },
+ "devDependencies": {
+ "coffeescript": ">=1.10.0 <2",
+ "coveralls": "^3.0.1",
+ "diff": ">=1.0.8",
+ "docco": ">=0.6.2",
+ "nyc": ">=2.2.1",
+ "zap": ">=0.2.9 <1"
+ },
+ "engines": {
+ "node": ">=4.0.0"
+ },
+ "license": "MIT"
+}
diff --git a/includes/translator/node_modules/xmlbuilder/CHANGELOG.md b/includes/translator/node_modules/xmlbuilder/CHANGELOG.md
new file mode 100644
index 0000000..610f412
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/CHANGELOG.md
@@ -0,0 +1,470 @@
+# Change Log
+
+All notable changes to this project are documented in this file. This project adheres to [Semantic Versioning](http://semver.org/#semantic-versioning-200).
+
+## [11.0.0] - 2019-02-18
+- Calling `end()` with arguments no longer overwrites writer options. See [#120](https://github.com/oozcitak/xmlbuilder-js/issues/120).
+- Added writer state and customizable space and endline functions to help customize writer behavior. Also added `openNode` and `closeNode` functions to writer. See [#193](https://github.com/oozcitak/xmlbuilder-js/issues/193).
+- Fixed a bug where writer functions would not be called for nodes with a single child node in pretty print mode. See [#195](https://github.com/oozcitak/xmlbuilder-js/issues/195).
+- Renamed `elEscape` to `textEscape` in `XMLStringifier`.
+- Fixed a bug where empty arrays would produce child nodes. See [#190](https://github.com/oozcitak/xmlbuilder-js/issues/190).
+- Removed the `skipNullAttributes` option. `null` attributes are now skipped by default. Added the `keepNullAttributes` option in case someone needs the old behavior.
+- Removed the `skipNullNodes` option. `null` nodes are now skipped by default. Added the `keepNullNodes` option in case someone needs the old behavior.
+- `undefined` values are now skipped when converting JS objects.
+- Renamed stringify functions. See [#194](https://github.com/oozcitak/xmlbuilder-js/issues/194):
+ * `eleName` -> `name`
+ * `attName` -> `name`
+ * `eleText` -> `text`
+- Fixed argument order for `attribute` function in the writer. See [#196](https://github.com/oozcitak/xmlbuilder-js/issues/196).
+- Added `openAttribute` and `closeAttribute` functions to writer. See [#196](https://github.com/oozcitak/xmlbuilder-js/issues/196).
+- Added node types to node objects. Node types and writer states are exported by the module with the `nodeType` and `writerState` properties.
+- Fixed a bug where array items would not be correctly converted. See [#159](https://github.com/oozcitak/xmlbuilder-js/issues/159).
+- Fixed a bug where mixed-content inside JS objects with `#text` decorator would not be correctly converted. See [#171](https://github.com/oozcitak/xmlbuilder-js/issues/171).
+- Fixed a bug where JS objects would not be expanded in callback mode. See [#173](https://github.com/oozcitak/xmlbuilder-js/issues/173).
+- Fixed a bug where character validation would not obey document's XML version. Added separate validation for XML 1.0 and XML 1.1 documents. See [#169](https://github.com/oozcitak/xmlbuilder-js/issues/169).
+- Fixed a bug where names would not be validated according to the spec. See [#49](https://github.com/oozcitak/xmlbuilder-js/issues/49).
+- Renamed `text` property to `value` in comment and cdata nodes to unify the API.
+- Removed `doctype` function to prevent name clash with DOM implementation. Use the `dtd` function instead.
+- Removed dummy nodes from the XML tree (Those were created while chain-building the tree).
+- Renamed `attributes`property to `attribs` to prevent name clash with DOM property with the same name.
+- Implemented the DOM standard (read-only) to support XPath lookups. XML namespaces are not currently supported. See [#122](https://github.com/oozcitak/xmlbuilder-js/issues/122).
+
+## [10.1.1] - 2018-10-24
+- Fixed an edge case where a null node at root level would be printed although `skipNullNodes` was set. See [#187](https://github.com/oozcitak/xmlbuilder-js/issues/187).
+
+## [10.1.0] - 2018-10-10
+- Added the `skipNullNodes` option to skip nodes with null values. See [#158](https://github.com/oozcitak/xmlbuilder-js/issues/158).
+
+## [10.0.0] - 2018-04-26
+- Added current indentation level as a parameter to the onData function when in callback mode. See [#125](https://github.com/oozcitak/xmlbuilder-js/issues/125).
+- Added name of the current node and parent node to error messages where possible. See [#152](https://github.com/oozcitak/xmlbuilder-js/issues/152). This has the potential to break code depending on the content of error messages.
+- Fixed an issue where objects created with Object.create(null) created an error. See [#176](https://github.com/oozcitak/xmlbuilder-js/issues/176).
+- Added test builds for node.js v8 and v10.
+
+## [9.0.7] - 2018-02-09
+- Simplified regex used for validating encoding.
+
+## [9.0.4] - 2017-08-16
+- `spacebeforeslash` writer option accepts `true` as well as space char(s).
+
+## [9.0.3] - 2017-08-15
+- `spacebeforeslash` writer option can now be used with XML fragments.
+
+## [9.0.2] - 2017-08-15
+- Added the `spacebeforeslash` writer option to add a space character before closing tags of empty elements. See
+[#157](https://github.com/oozcitak/xmlbuilder-js/issues/157).
+
+## [9.0.1] - 2017-06-19
+- Fixed character validity checks to work with node.js 4.0 and 5.0. See
+[#161](https://github.com/oozcitak/xmlbuilder-js/issues/161).
+
+## [9.0.0] - 2017-05-05
+- Removed case conversion options.
+- Removed support for node.js 4.0 and 5.0. Minimum required version is now 6.0.
+- Fixed valid char filter to use XML 1.1 instead of 1.0. See
+[#147](https://github.com/oozcitak/xmlbuilder-js/issues/147).
+- Added options for negative indentation and suppressing pretty printing of text
+nodes. See
+[#145](https://github.com/oozcitak/xmlbuilder-js/issues/145).
+
+## [8.2.2] - 2016-04-08
+- Falsy values can now be used as a text node in callback mode.
+
+## [8.2.1] - 2016-04-07
+- Falsy values can now be used as a text node. See
+[#117](https://github.com/oozcitak/xmlbuilder-js/issues/117).
+
+## [8.2.0] - 2016-04-01
+- Removed lodash dependency to keep the library small and simple. See
+[#114](https://github.com/oozcitak/xmlbuilder-js/issues/114),
+[#53](https://github.com/oozcitak/xmlbuilder-js/issues/53),
+and [#43](https://github.com/oozcitak/xmlbuilder-js/issues/43).
+- Added title case to name conversion options.
+
+## [8.1.0] - 2016-03-29
+- Added the callback option to the `begin` export function. When used with a
+callback function, the XML document will be generated in chunks and each chunk
+will be passed to the supplied function. In this mode, `begin` uses a different
+code path and the builder should use much less memory since the entire XML tree
+is not kept. There are a few drawbacks though. For example, traversing the document
+tree or adding attributes to a node after it is written is not possible. It is
+also not possible to remove nodes or attributes.
+
+``` js
+var result = '';
+
+builder.begin(function(chunk) { result += chunk; })
+ .dec()
+ .ele('root')
+ .ele('xmlbuilder').up()
+ .end();
+```
+
+- Replaced native `Object.assign` with `lodash.assign` to support old JS engines. See [#111](https://github.com/oozcitak/xmlbuilder-js/issues/111).
+
+## [8.0.0] - 2016-03-25
+- Added the `begin` export function. See the wiki for details.
+- Added the ability to add comments and processing instructions before and after the root element. Added `commentBefore`, `commentAfter`, `instructionBefore` and `instructionAfter` functions for this purpose.
+- Dropped support for old node.js releases. Minimum required node.js version is now 4.0.
+
+## [7.0.0] - 2016-03-21
+- Processing instructions are now created as regular nodes. This is a major breaking change if you are using processing instructions. Previously processing instructions were inserted before their parent node. After this change processing instructions are appended to the children of the parent node. Note that it is not currently possible to insert processing instructions before or after the root element.
+```js
+root.ele('node').ins('pi');
+// pre-v7
+<?pi?><node/>
+// v7
+<node><?pi?></node>
+```
+
+## [6.0.0] - 2016-03-20
+- Added custom XML writers. The default string conversion functions are now collected under the `XMLStringWriter` class which can be accessed by the `stringWriter(options)` function exported by the module. An `XMLStreamWriter` is also added which outputs the XML document to a writable stream. A stream writer can be created by calling the `streamWriter(stream, options)` function exported by the module. Both classes are heavily customizable and the details are added to the wiki. It is also possible to write an XML writer from scratch and use it when calling `end()` on the XML document.
+
+## [5.0.1] - 2016-03-08
+- Moved require statements for text case conversion to the top of files to reduce lazy requires.
+
+## [5.0.0] - 2016-03-05
+- Added text case option for element names and attribute names. Valid cases are `lower`, `upper`, `camel`, `kebab` and `snake`.
+- Attribute and element values are escaped according to the [Canonical XML 1.0 specification](http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping). See [#54](https://github.com/oozcitak/xmlbuilder-js/issues/54) and [#86](https://github.com/oozcitak/xmlbuilder-js/issues/86).
+- Added the `allowEmpty` option to `end()`. When this option is set, empty elements are not self-closed.
+- Added support for [nested CDATA](https://en.wikipedia.org/wiki/CDATA#Nesting). The triad `]]>` in CDATA is now automatically replaced with `]]]]><![CDATA[>`.
+
+## [4.2.1] - 2016-01-15
+- Updated lodash dependency to 4.0.0.
+
+## [4.2.0] - 2015-12-16
+- Added the `noDoubleEncoding` option to `create()` to control whether existing html entities are encoded.
+
+## [4.1.0] - 2015-11-11
+- Added the `separateArrayItems` option to `create()` to control how arrays are handled when converting from objects. e.g.
+
+```js
+root.ele({ number: [ "one", "two" ]});
+// with separateArrayItems: true
+<number>
+ <one/>
+ <two/>
+</number>
+// with separateArrayItems: false
+<number>one</number>
+<number>two</number>
+```
+
+## [4.0.0] - 2015-11-01
+- Removed the `#list` decorator. Array items are now created as child nodes by default.
+- Fixed a bug where the XML encoding string was checked partially.
+
+## [3.1.0] - 2015-09-19
+- `#list` decorator ignores empty arrays.
+
+## [3.0.0] - 2015-09-10
+- Allow `\r`, `\n` and `\t` in attribute values without escaping. See [#86](https://github.com/oozcitak/xmlbuilder-js/issues/86).
+
+## [2.6.5] - 2015-09-09
+- Use native `isArray` instead of lodash.
+- Indentation of processing instructions are set to the parent element's.
+
+## [2.6.4] - 2015-05-27
+- Updated lodash dependency to 3.5.0.
+
+## [2.6.3] - 2015-05-27
+- Bumped version because previous release was not published on npm.
+
+## [2.6.2] - 2015-03-10
+- Updated lodash dependency to 3.5.0.
+
+## [2.6.1] - 2015-02-20
+- Updated lodash dependency to 3.3.0.
+
+## [2.6.0] - 2015-02-20
+- Fixed a bug where the `XMLNode` constructor overwrote the super class parent.
+- Removed document property from cloned nodes.
+- Switched to mocha.js for testing.
+
+## [2.5.2] - 2015-02-16
+- Updated lodash dependency to 3.2.0.
+
+## [2.5.1] - 2015-02-09
+- Updated lodash dependency to 3.1.0.
+- Support all node >= 0.8.
+
+## [2.5.0] - 2015-00-03
+- Updated lodash dependency to 3.0.0.
+
+## [2.4.6] - 2015-01-26
+- Show more information from attribute creation with null values.
+- Added iojs as an engine.
+- Self close elements with empty text.
+
+## [2.4.5] - 2014-11-15
+- Fixed prepublish script to run on windows.
+- Fixed bug in XMLStringifier where an undefined value was used while reporting an invalid encoding value.
+- Moved require statements to the top of files to reduce lazy requires. See [#62](https://github.com/oozcitak/xmlbuilder-js/issues/62).
+
+## [2.4.4] - 2014-09-08
+- Added the `offset` option to `toString()` for use in XML fragments.
+
+## [2.4.3] - 2014-08-13
+- Corrected license in package description.
+
+## [2.4.2] - 2014-08-13
+- Dropped performance test and memwatch dependency.
+
+## [2.4.1] - 2014-08-12
+- Fixed a bug where empty indent string was omitted when pretty printing. See [#59](https://github.com/oozcitak/xmlbuilder-js/issues/59).
+
+## [2.4.0] - 2014-08-04
+- Correct cases of pubID and sysID.
+- Use single lodash instead of separate npm modules. See [#53](https://github.com/oozcitak/xmlbuilder-js/issues/53).
+- Escape according to Canonical XML 1.0. See [#54](https://github.com/oozcitak/xmlbuilder-js/issues/54).
+
+## [2.3.0] - 2014-07-17
+- Convert objects to JS primitives while sanitizing user input.
+- Object builder preserves items with null values. See [#44](https://github.com/oozcitak/xmlbuilder-js/issues/44).
+- Use modularized lodash functions to cut down dependencies.
+- Process empty objects when converting from objects so that we don't throw on empty child objects.
+
+## [2.2.1] - 2014-04-04
+- Bumped version because previous release was not published on npm.
+
+## [2.2.0] - 2014-04-04
+- Switch to lodash from underscore.
+- Removed legacy `ext` option from `create()`.
+- Drop old node versions: 0.4, 0.5, 0.6. 0.8 is the minimum requirement from now on.
+
+## [2.1.0] - 2013-12-30
+- Removed duplicate null checks from constructors.
+- Fixed node count in performance test.
+- Added option for skipping null attribute values. See [#26](https://github.com/oozcitak/xmlbuilder-js/issues/26).
+- Allow multiple values in `att()` and `ins()`.
+- Added ability to run individual performance tests.
+- Added flag for ignoring decorator strings.
+
+## [2.0.1] - 2013-12-24
+- Removed performance tests from npm package.
+
+## [2.0.0] - 2013-12-24
+- Combined loops for speed up.
+- Added support for the DTD and XML declaration.
+- `clone` includes attributes.
+- Added performance tests.
+- Evaluate attribute value if function.
+- Evaluate instruction value if function.
+
+## [1.1.2] - 2013-12-11
+- Changed processing instruction decorator to `?`.
+
+## [1.1.1] - 2013-12-11
+- Added processing instructions to JS object conversion.
+
+## [1.1.0] - 2013-12-10
+- Added license to package.
+- `create()` and `element()` accept JS object to fully build the document.
+- Added `nod()` and `n()` aliases for `node()`.
+- Renamed `convertAttChar` decorator to `convertAttKey`.
+- Ignore empty decorator strings when converting JS objects.
+
+## [1.0.2] - 2013-11-27
+- Removed temp file which was accidentally included in the package.
+
+## [1.0.1] - 2013-11-27
+- Custom stringify functions affect current instance only.
+
+## [1.0.0] - 2013-11-27
+- Added processing instructions.
+- Added stringify functions to sanitize and convert input values.
+- Added option for headless XML documents.
+- Added vows tests.
+- Removed Makefile. Using npm publish scripts instead.
+- Removed the `begin()` function. `create()` begins the document by creating the root node.
+
+## [0.4.3] - 2013-11-08
+- Added option to include surrogate pairs in XML content. See [#29](https://github.com/oozcitak/xmlbuilder-js/issues/29).
+- Fixed empty value string representation in pretty mode.
+- Added pre and postpublish scripts to package.json.
+- Filtered out prototype properties when appending attributes. See [#31](https://github.com/oozcitak/xmlbuilder-js/issues/31).
+
+## [0.4.2] - 2012-09-14
+- Removed README.md from `.npmignore`.
+
+## [0.4.1] - 2012-08-31
+- Removed `begin()` calls in favor of `XMLBuilder` constructor.
+- Added the `end()` function. `end()` is a convenience over `doc().toString()`.
+
+## [0.4.0] - 2012-08-31
+- Added arguments to `XMLBuilder` constructor to allow the name of the root element and XML prolog to be defined in one line.
+- Soft deprecated `begin()`.
+
+## [0.3.11] - 2012-08-13
+- Package keywords are fixed to be an array of values.
+
+## [0.3.10] - 2012-08-13
+- Brought back npm package contents which were lost due to incorrect configuration of `package.json` in previous releases.
+
+## [0.3.3] - 2012-07-27
+- Implemented `importXMLBuilder()`.
+
+## [0.3.2] - 2012-07-20
+- Fixed a duplicated escaping problem on `element()`.
+- Fixed a problem with text node creation from empty string.
+- Calling `root()` on the document element returns the root element.
+- `XMLBuilder` no longer extends `XMLFragment`.
+
+## [0.3.1] - 2011-11-28
+- Added guards for document element so that nodes cannot be inserted at document level.
+
+## [0.3.0] - 2011-11-28
+- Added `doc()` to return the document element.
+
+## [0.2.2] - 2011-11-28
+- Prevent code relying on `up()`'s older behavior to break.
+
+## [0.2.1] - 2011-11-28
+- Added the `root()` function.
+
+## [0.2.0] - 2011-11-21
+- Added Travis-CI integration.
+- Added coffee-script dependency.
+- Added insert, traversal and delete functions.
+
+## [0.1.7] - 2011-10-25
+- No changes. Accidental release.
+
+## [0.1.6] - 2011-10-25
+- Corrected `package.json` bugs link to `url` from `web`.
+
+## [0.1.5] - 2011-08-08
+- Added missing npm package contents.
+
+## [0.1.4] - 2011-07-29
+- Text-only nodes are no longer indented.
+- Added documentation for multiple instances.
+
+## [0.1.3] - 2011-07-27
+- Exported the `create()` function to return a new instance. This allows multiple builder instances to be constructed.
+- Fixed `u()` function so that it now correctly calls `up()`.
+- Fixed typo in `element()` so that `attributes` and `text` can be passed interchangeably.
+
+## [0.1.2] - 2011-06-03
+- `ele()` accepts element text.
+- `attributes()` now overrides existing attributes if passed the same attribute name.
+
+## [0.1.1] - 2011-05-19
+- Added the raw output option.
+- Removed most validity checks.
+
+## [0.1.0] - 2011-04-27
+- `text()` and `cdata()` now return parent element.
+- Attribute values are escaped.
+
+## [0.0.7] - 2011-04-23
+- Coerced text values to string.
+
+## [0.0.6] - 2011-02-23
+- Added support for XML comments.
+- Text nodes are checked against CharData.
+
+## [0.0.5] - 2010-12-31
+- Corrected the name of the main npm module in `package.json`.
+
+## [0.0.4] - 2010-12-28
+- Added `.npmignore`.
+
+## [0.0.3] - 2010-12-27
+- root element is now constructed in `begin()`.
+- moved prolog to `begin()`.
+- Added the ability to have CDATA in element text.
+- Removed unused prolog aliases.
+- Removed `builder()` function from main module.
+- Added the name of the main npm module in `package.json`.
+
+## [0.0.2] - 2010-11-03
+- `element()` expands nested arrays.
+- Added pretty printing.
+- Added the `up()`, `build()` and `prolog()` functions.
+- Added readme.
+
+## 0.0.1 - 2010-11-02
+- Initial release
+
+[11.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.1.1...v11.0.0
+[10.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.1.0...v10.1.1
+[10.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.0.0...v10.1.0
+[10.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.7...v10.0.0
+[9.0.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.4...v9.0.7
+[9.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.3...v9.0.4
+[9.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.2...v9.0.3
+[9.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.1...v9.0.2
+[9.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.0...v9.0.1
+[9.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.2...v9.0.0
+[8.2.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.1...v8.2.2
+[8.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.0...v8.2.1
+[8.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.1.0...v8.2.0
+[8.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.0.0...v8.1.0
+[8.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v7.0.0...v8.0.0
+[7.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v6.0.0...v7.0.0
+[6.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v5.0.1...v6.0.0
+[5.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v5.0.0...v5.0.1
+[5.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.2.1...v5.0.0
+[4.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.2.0...v4.2.1
+[4.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.1.0...v4.2.0
+[4.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.0.0...v4.1.0
+[4.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v3.1.0...v4.0.0
+[3.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v3.0.0...v3.1.0
+[3.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.5...v3.0.0
+[2.6.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.4...v2.6.5
+[2.6.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.3...v2.6.4
+[2.6.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.2...v2.6.3
+[2.6.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.1...v2.6.2
+[2.6.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.0...v2.6.1
+[2.6.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.2...v2.6.0
+[2.5.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.1...v2.5.2
+[2.5.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.0...v2.5.1
+[2.5.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.6...v2.5.0
+[2.4.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.5...v2.4.6
+[2.4.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.4...v2.4.5
+[2.4.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.3...v2.4.4
+[2.4.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.2...v2.4.3
+[2.4.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.1...v2.4.2
+[2.4.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.0...v2.4.1
+[2.4.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.3.0...v2.4.0
+[2.3.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.2.1...v2.3.0
+[2.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.2.0...v2.2.1
+[2.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.1.0...v2.2.0
+[2.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.0.1...v2.1.0
+[2.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.0.0...v2.0.1
+[2.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.2...v2.0.0
+[1.1.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.1...v1.1.2
+[1.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.0...v1.1.1
+[1.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.2...v1.1.0
+[1.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.1...v1.0.2
+[1.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.0...v1.0.1
+[1.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.3...v1.0.0
+[0.4.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.2...v0.4.3
+[0.4.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.1...v0.4.2
+[0.4.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.0...v0.4.1
+[0.4.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.11...v0.4.0
+[0.3.11]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.10...v0.3.11
+[0.3.10]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.3...v0.3.10
+[0.3.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.2...v0.3.3
+[0.3.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.1...v0.3.2
+[0.3.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.0...v0.3.1
+[0.3.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.2...v0.3.0
+[0.2.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.1...v0.2.2
+[0.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.0...v0.2.1
+[0.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.7...v0.2.0
+[0.1.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.6...v0.1.7
+[0.1.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.5...v0.1.6
+[0.1.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.4...v0.1.5
+[0.1.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.3...v0.1.4
+[0.1.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.2...v0.1.3
+[0.1.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.1...v0.1.2
+[0.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.0...v0.1.1
+[0.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.7...v0.1.0
+[0.0.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.6...v0.0.7
+[0.0.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.5...v0.0.6
+[0.0.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.4...v0.0.5
+[0.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.3...v0.0.4
+[0.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.2...v0.0.3
+[0.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.1...v0.0.2
+
diff --git a/includes/translator/node_modules/xmlbuilder/LICENSE b/includes/translator/node_modules/xmlbuilder/LICENSE
new file mode 100644
index 0000000..9fb9700
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Ozgur Ozcitak
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/includes/translator/node_modules/xmlbuilder/README.md b/includes/translator/node_modules/xmlbuilder/README.md
new file mode 100644
index 0000000..1a96edb
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/README.md
@@ -0,0 +1,86 @@
+# xmlbuilder-js
+
+An XML builder for [node.js](https://nodejs.org/) similar to
+[java-xmlbuilder](https://github.com/jmurty/java-xmlbuilder).
+
+[![License](http://img.shields.io/npm/l/xmlbuilder.svg?style=flat-square)](http://opensource.org/licenses/MIT)
+[![NPM Version](http://img.shields.io/npm/v/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder)
+[![NPM Downloads](https://img.shields.io/npm/dm/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder)
+
+[![Travis Build Status](http://img.shields.io/travis/oozcitak/xmlbuilder-js.svg?style=flat-square)](http://travis-ci.org/oozcitak/xmlbuilder-js)
+[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/bf7odb20hj77isry?svg=true)](https://ci.appveyor.com/project/oozcitak/xmlbuilder-js)
+[![Dev Dependency Status](http://img.shields.io/david/dev/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://david-dm.org/oozcitak/xmlbuilder-js)
+[![Code Coverage](https://img.shields.io/coveralls/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://coveralls.io/github/oozcitak/xmlbuilder-js)
+
+### Installation:
+
+``` sh
+npm install xmlbuilder
+```
+
+### Usage:
+
+``` js
+var builder = require('xmlbuilder');
+var xml = builder.create('root')
+ .ele('xmlbuilder')
+ .ele('repo', {'type': 'git'}, 'git://github.com/oozcitak/xmlbuilder-js.git')
+ .end({ pretty: true});
+
+console.log(xml);
+```
+
+will result in:
+
+``` xml
+<?xml version="1.0"?>
+<root>
+ <xmlbuilder>
+ <repo type="git">git://github.com/oozcitak/xmlbuilder-js.git</repo>
+ </xmlbuilder>
+</root>
+```
+
+It is also possible to convert objects into nodes:
+
+``` js
+builder.create({
+ root: {
+ xmlbuilder: {
+ repo: {
+ '@type': 'git', // attributes start with @
+ '#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // text node
+ }
+ }
+ }
+});
+```
+
+If you need to do some processing:
+
+``` js
+var root = builder.create('squares');
+root.com('f(x) = x^2');
+for(var i = 1; i <= 5; i++)
+{
+ var item = root.ele('data');
+ item.att('x', i);
+ item.att('y', i * i);
+}
+```
+
+This will result in:
+
+``` xml
+<?xml version="1.0"?>
+<squares>
+ <!-- f(x) = x^2 -->
+ <data x="1" y="1"/>
+ <data x="2" y="4"/>
+ <data x="3" y="9"/>
+ <data x="4" y="16"/>
+ <data x="5" y="25"/>
+</squares>
+```
+
+See the [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki) for details and [examples](https://github.com/oozcitak/xmlbuilder-js/wiki/Examples) for more complex examples.
diff --git a/includes/translator/node_modules/xmlbuilder/appveyor.yml b/includes/translator/node_modules/xmlbuilder/appveyor.yml
new file mode 100644
index 0000000..9604b78
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/appveyor.yml
@@ -0,0 +1,20 @@
+environment:
+ matrix:
+ - nodejs_version: "4"
+ - nodejs_version: "5"
+ - nodejs_version: "6"
+ - nodejs_version: "8"
+ - nodejs_version: "10"
+ - nodejs_version: "" # latest
+
+install:
+ - ps: "Install-Product node $env:nodejs_version"
+ - "npm install"
+
+test_script:
+ - "node --version"
+ - "npm --version"
+ - "npm test"
+
+build: off
+
diff --git a/includes/translator/node_modules/xmlbuilder/lib/Derivation.js b/includes/translator/node_modules/xmlbuilder/lib/Derivation.js
new file mode 100644
index 0000000..2abfd08
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/Derivation.js
@@ -0,0 +1,10 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ module.exports = {
+ Restriction: 1,
+ Extension: 2,
+ Union: 4,
+ List: 8
+ };
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/DocumentPosition.js b/includes/translator/node_modules/xmlbuilder/lib/DocumentPosition.js
new file mode 100644
index 0000000..1cbd21c
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/DocumentPosition.js
@@ -0,0 +1,12 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ module.exports = {
+ Disconnected: 1,
+ Preceding: 2,
+ Following: 4,
+ Contains: 8,
+ ContainedBy: 16,
+ ImplementationSpecific: 32
+ };
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/NodeType.js b/includes/translator/node_modules/xmlbuilder/lib/NodeType.js
new file mode 100644
index 0000000..4c200e3
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/NodeType.js
@@ -0,0 +1,23 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ module.exports = {
+ Element: 1,
+ Attribute: 2,
+ Text: 3,
+ CData: 4,
+ EntityReference: 5,
+ EntityDeclaration: 6,
+ ProcessingInstruction: 7,
+ Comment: 8,
+ Document: 9,
+ DocType: 10,
+ DocumentFragment: 11,
+ NotationDeclaration: 12,
+ Declaration: 201,
+ Raw: 202,
+ AttributeDeclaration: 203,
+ ElementDeclaration: 204,
+ Dummy: 205
+ };
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/OperationType.js b/includes/translator/node_modules/xmlbuilder/lib/OperationType.js
new file mode 100644
index 0000000..29428f6
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/OperationType.js
@@ -0,0 +1,11 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ module.exports = {
+ Clones: 1,
+ Imported: 2,
+ Deleted: 3,
+ Renamed: 4,
+ Adopted: 5
+ };
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/Utility.js b/includes/translator/node_modules/xmlbuilder/lib/Utility.js
new file mode 100644
index 0000000..1d42cfd
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/Utility.js
@@ -0,0 +1,83 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject,
+ slice = [].slice,
+ hasProp = {}.hasOwnProperty;
+
+ assign = function() {
+ var i, key, len, source, sources, target;
+ target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+ if (isFunction(Object.assign)) {
+ Object.assign.apply(null, arguments);
+ } else {
+ for (i = 0, len = sources.length; i < len; i++) {
+ source = sources[i];
+ if (source != null) {
+ for (key in source) {
+ if (!hasProp.call(source, key)) continue;
+ target[key] = source[key];
+ }
+ }
+ }
+ }
+ return target;
+ };
+
+ isFunction = function(val) {
+ return !!val && Object.prototype.toString.call(val) === '[object Function]';
+ };
+
+ isObject = function(val) {
+ var ref;
+ return !!val && ((ref = typeof val) === 'function' || ref === 'object');
+ };
+
+ isArray = function(val) {
+ if (isFunction(Array.isArray)) {
+ return Array.isArray(val);
+ } else {
+ return Object.prototype.toString.call(val) === '[object Array]';
+ }
+ };
+
+ isEmpty = function(val) {
+ var key;
+ if (isArray(val)) {
+ return !val.length;
+ } else {
+ for (key in val) {
+ if (!hasProp.call(val, key)) continue;
+ return false;
+ }
+ return true;
+ }
+ };
+
+ isPlainObject = function(val) {
+ var ctor, proto;
+ return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && (typeof ctor === 'function') && (ctor instanceof ctor) && (Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object));
+ };
+
+ getValue = function(obj) {
+ if (isFunction(obj.valueOf)) {
+ return obj.valueOf();
+ } else {
+ return obj;
+ }
+ };
+
+ module.exports.assign = assign;
+
+ module.exports.isFunction = isFunction;
+
+ module.exports.isObject = isObject;
+
+ module.exports.isArray = isArray;
+
+ module.exports.isEmpty = isEmpty;
+
+ module.exports.isPlainObject = isPlainObject;
+
+ module.exports.getValue = getValue;
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/WriterState.js b/includes/translator/node_modules/xmlbuilder/lib/WriterState.js
new file mode 100644
index 0000000..0923eec
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/WriterState.js
@@ -0,0 +1,10 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ module.exports = {
+ None: 0,
+ OpenTag: 1,
+ InsideTag: 2,
+ CloseTag: 3
+ };
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLAttribute.js b/includes/translator/node_modules/xmlbuilder/lib/XMLAttribute.js
new file mode 100644
index 0000000..c208566
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLAttribute.js
@@ -0,0 +1,108 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLAttribute, XMLNode;
+
+ NodeType = require('./NodeType');
+
+ XMLNode = require('./XMLNode');
+
+ module.exports = XMLAttribute = (function() {
+ function XMLAttribute(parent, name, value) {
+ this.parent = parent;
+ if (this.parent) {
+ this.options = this.parent.options;
+ this.stringify = this.parent.stringify;
+ }
+ if (name == null) {
+ throw new Error("Missing attribute name. " + this.debugInfo(name));
+ }
+ this.name = this.stringify.name(name);
+ this.value = this.stringify.attValue(value);
+ this.type = NodeType.Attribute;
+ this.isId = false;
+ this.schemaTypeInfo = null;
+ }
+
+ Object.defineProperty(XMLAttribute.prototype, 'nodeType', {
+ get: function() {
+ return this.type;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'ownerElement', {
+ get: function() {
+ return this.parent;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'textContent', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'namespaceURI', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'prefix', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'localName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'specified', {
+ get: function() {
+ return true;
+ }
+ });
+
+ XMLAttribute.prototype.clone = function() {
+ return Object.create(this);
+ };
+
+ XMLAttribute.prototype.toString = function(options) {
+ return this.options.writer.attribute(this, this.options.writer.filterOptions(options));
+ };
+
+ XMLAttribute.prototype.debugInfo = function(name) {
+ name = name || this.name;
+ if (name == null) {
+ return "parent: <" + this.parent.name + ">";
+ } else {
+ return "attribute: {" + name + "}, parent: <" + this.parent.name + ">";
+ }
+ };
+
+ XMLAttribute.prototype.isEqualNode = function(node) {
+ if (node.namespaceURI !== this.namespaceURI) {
+ return false;
+ }
+ if (node.prefix !== this.prefix) {
+ return false;
+ }
+ if (node.localName !== this.localName) {
+ return false;
+ }
+ if (node.value !== this.value) {
+ return false;
+ }
+ return true;
+ };
+
+ return XMLAttribute;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLCData.js b/includes/translator/node_modules/xmlbuilder/lib/XMLCData.js
new file mode 100644
index 0000000..c732ec5
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLCData.js
@@ -0,0 +1,36 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLCData, XMLCharacterData,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ module.exports = XMLCData = (function(superClass) {
+ extend(XMLCData, superClass);
+
+ function XMLCData(parent, text) {
+ XMLCData.__super__.constructor.call(this, parent);
+ if (text == null) {
+ throw new Error("Missing CDATA text. " + this.debugInfo());
+ }
+ this.name = "#cdata-section";
+ this.type = NodeType.CData;
+ this.value = this.stringify.cdata(text);
+ }
+
+ XMLCData.prototype.clone = function() {
+ return Object.create(this);
+ };
+
+ XMLCData.prototype.toString = function(options) {
+ return this.options.writer.cdata(this, this.options.writer.filterOptions(options));
+ };
+
+ return XMLCData;
+
+ })(XMLCharacterData);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLCharacterData.js b/includes/translator/node_modules/xmlbuilder/lib/XMLCharacterData.js
new file mode 100644
index 0000000..c007a18
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLCharacterData.js
@@ -0,0 +1,79 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var XMLCharacterData, XMLNode,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ XMLNode = require('./XMLNode');
+
+ module.exports = XMLCharacterData = (function(superClass) {
+ extend(XMLCharacterData, superClass);
+
+ function XMLCharacterData(parent) {
+ XMLCharacterData.__super__.constructor.call(this, parent);
+ this.value = '';
+ }
+
+ Object.defineProperty(XMLCharacterData.prototype, 'data', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ Object.defineProperty(XMLCharacterData.prototype, 'length', {
+ get: function() {
+ return this.value.length;
+ }
+ });
+
+ Object.defineProperty(XMLCharacterData.prototype, 'textContent', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ XMLCharacterData.prototype.clone = function() {
+ return Object.create(this);
+ };
+
+ XMLCharacterData.prototype.substringData = function(offset, count) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLCharacterData.prototype.appendData = function(arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLCharacterData.prototype.insertData = function(offset, arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLCharacterData.prototype.deleteData = function(offset, count) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLCharacterData.prototype.replaceData = function(offset, count, arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLCharacterData.prototype.isEqualNode = function(node) {
+ if (!XMLCharacterData.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
+ return false;
+ }
+ if (node.data !== this.data) {
+ return false;
+ }
+ return true;
+ };
+
+ return XMLCharacterData;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLComment.js b/includes/translator/node_modules/xmlbuilder/lib/XMLComment.js
new file mode 100644
index 0000000..8287216
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLComment.js
@@ -0,0 +1,36 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLCharacterData, XMLComment,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ module.exports = XMLComment = (function(superClass) {
+ extend(XMLComment, superClass);
+
+ function XMLComment(parent, text) {
+ XMLComment.__super__.constructor.call(this, parent);
+ if (text == null) {
+ throw new Error("Missing comment text. " + this.debugInfo());
+ }
+ this.name = "#comment";
+ this.type = NodeType.Comment;
+ this.value = this.stringify.comment(text);
+ }
+
+ XMLComment.prototype.clone = function() {
+ return Object.create(this);
+ };
+
+ XMLComment.prototype.toString = function(options) {
+ return this.options.writer.comment(this, this.options.writer.filterOptions(options));
+ };
+
+ return XMLComment;
+
+ })(XMLCharacterData);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js
new file mode 100644
index 0000000..b331b86
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js
@@ -0,0 +1,64 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
+
+ XMLDOMErrorHandler = require('./XMLDOMErrorHandler');
+
+ XMLDOMStringList = require('./XMLDOMStringList');
+
+ module.exports = XMLDOMConfiguration = (function() {
+ function XMLDOMConfiguration() {
+ var clonedSelf;
+ this.defaultParams = {
+ "canonical-form": false,
+ "cdata-sections": false,
+ "comments": false,
+ "datatype-normalization": false,
+ "element-content-whitespace": true,
+ "entities": true,
+ "error-handler": new XMLDOMErrorHandler(),
+ "infoset": true,
+ "validate-if-schema": false,
+ "namespaces": true,
+ "namespace-declarations": true,
+ "normalize-characters": false,
+ "schema-location": '',
+ "schema-type": '',
+ "split-cdata-sections": true,
+ "validate": false,
+ "well-formed": true
+ };
+ this.params = clonedSelf = Object.create(this.defaultParams);
+ }
+
+ Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', {
+ get: function() {
+ return new XMLDOMStringList(Object.keys(this.defaultParams));
+ }
+ });
+
+ XMLDOMConfiguration.prototype.getParameter = function(name) {
+ if (this.params.hasOwnProperty(name)) {
+ return this.params[name];
+ } else {
+ return null;
+ }
+ };
+
+ XMLDOMConfiguration.prototype.canSetParameter = function(name, value) {
+ return true;
+ };
+
+ XMLDOMConfiguration.prototype.setParameter = function(name, value) {
+ if (value != null) {
+ return this.params[name] = value;
+ } else {
+ return delete this.params[name];
+ }
+ };
+
+ return XMLDOMConfiguration;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js
new file mode 100644
index 0000000..4a0446c
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js
@@ -0,0 +1,16 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var XMLDOMErrorHandler;
+
+ module.exports = XMLDOMErrorHandler = (function() {
+ function XMLDOMErrorHandler() {}
+
+ XMLDOMErrorHandler.prototype.handleError = function(error) {
+ throw new Error(error);
+ };
+
+ return XMLDOMErrorHandler;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDOMImplementation.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDOMImplementation.js
new file mode 100644
index 0000000..4f9f9db
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDOMImplementation.js
@@ -0,0 +1,32 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var XMLDOMImplementation;
+
+ module.exports = XMLDOMImplementation = (function() {
+ function XMLDOMImplementation() {}
+
+ XMLDOMImplementation.prototype.hasFeature = function(feature, version) {
+ return true;
+ };
+
+ XMLDOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {
+ throw new Error("This DOM method is not implemented.");
+ };
+
+ XMLDOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype) {
+ throw new Error("This DOM method is not implemented.");
+ };
+
+ XMLDOMImplementation.prototype.createHTMLDocument = function(title) {
+ throw new Error("This DOM method is not implemented.");
+ };
+
+ XMLDOMImplementation.prototype.getFeature = function(feature, version) {
+ throw new Error("This DOM method is not implemented.");
+ };
+
+ return XMLDOMImplementation;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDOMStringList.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDOMStringList.js
new file mode 100644
index 0000000..ba558c5
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDOMStringList.js
@@ -0,0 +1,28 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var XMLDOMStringList;
+
+ module.exports = XMLDOMStringList = (function() {
+ function XMLDOMStringList(arr) {
+ this.arr = arr || [];
+ }
+
+ Object.defineProperty(XMLDOMStringList.prototype, 'length', {
+ get: function() {
+ return this.arr.length;
+ }
+ });
+
+ XMLDOMStringList.prototype.item = function(index) {
+ return this.arr[index] || null;
+ };
+
+ XMLDOMStringList.prototype.contains = function(str) {
+ return this.arr.indexOf(str) !== -1;
+ };
+
+ return XMLDOMStringList;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDTDAttList.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDTDAttList.js
new file mode 100644
index 0000000..aca9dbd
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDTDAttList.js
@@ -0,0 +1,55 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLDTDAttList, XMLNode,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ module.exports = XMLDTDAttList = (function(superClass) {
+ extend(XMLDTDAttList, superClass);
+
+ function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ XMLDTDAttList.__super__.constructor.call(this, parent);
+ if (elementName == null) {
+ throw new Error("Missing DTD element name. " + this.debugInfo());
+ }
+ if (attributeName == null) {
+ throw new Error("Missing DTD attribute name. " + this.debugInfo(elementName));
+ }
+ if (!attributeType) {
+ throw new Error("Missing DTD attribute type. " + this.debugInfo(elementName));
+ }
+ if (!defaultValueType) {
+ throw new Error("Missing DTD attribute default. " + this.debugInfo(elementName));
+ }
+ if (defaultValueType.indexOf('#') !== 0) {
+ defaultValueType = '#' + defaultValueType;
+ }
+ if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
+ throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(elementName));
+ }
+ if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
+ throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(elementName));
+ }
+ this.elementName = this.stringify.name(elementName);
+ this.type = NodeType.AttributeDeclaration;
+ this.attributeName = this.stringify.name(attributeName);
+ this.attributeType = this.stringify.dtdAttType(attributeType);
+ if (defaultValue) {
+ this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
+ }
+ this.defaultValueType = defaultValueType;
+ }
+
+ XMLDTDAttList.prototype.toString = function(options) {
+ return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options));
+ };
+
+ return XMLDTDAttList;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDTDElement.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDTDElement.js
new file mode 100644
index 0000000..f8f1ae7
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDTDElement.js
@@ -0,0 +1,38 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLDTDElement, XMLNode,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ module.exports = XMLDTDElement = (function(superClass) {
+ extend(XMLDTDElement, superClass);
+
+ function XMLDTDElement(parent, name, value) {
+ XMLDTDElement.__super__.constructor.call(this, parent);
+ if (name == null) {
+ throw new Error("Missing DTD element name. " + this.debugInfo());
+ }
+ if (!value) {
+ value = '(#PCDATA)';
+ }
+ if (Array.isArray(value)) {
+ value = '(' + value.join(',') + ')';
+ }
+ this.name = this.stringify.name(name);
+ this.type = NodeType.ElementDeclaration;
+ this.value = this.stringify.dtdElementValue(value);
+ }
+
+ XMLDTDElement.prototype.toString = function(options) {
+ return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
+ };
+
+ return XMLDTDElement;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDTDEntity.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDTDEntity.js
new file mode 100644
index 0000000..0a940d6
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDTDEntity.js
@@ -0,0 +1,97 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLDTDEntity, XMLNode, isObject,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ isObject = require('./Utility').isObject;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ module.exports = XMLDTDEntity = (function(superClass) {
+ extend(XMLDTDEntity, superClass);
+
+ function XMLDTDEntity(parent, pe, name, value) {
+ XMLDTDEntity.__super__.constructor.call(this, parent);
+ if (name == null) {
+ throw new Error("Missing DTD entity name. " + this.debugInfo(name));
+ }
+ if (value == null) {
+ throw new Error("Missing DTD entity value. " + this.debugInfo(name));
+ }
+ this.pe = !!pe;
+ this.name = this.stringify.name(name);
+ this.type = NodeType.EntityDeclaration;
+ if (!isObject(value)) {
+ this.value = this.stringify.dtdEntityValue(value);
+ this.internal = true;
+ } else {
+ if (!value.pubID && !value.sysID) {
+ throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(name));
+ }
+ if (value.pubID && !value.sysID) {
+ throw new Error("System identifier is required for a public external entity. " + this.debugInfo(name));
+ }
+ this.internal = false;
+ if (value.pubID != null) {
+ this.pubID = this.stringify.dtdPubID(value.pubID);
+ }
+ if (value.sysID != null) {
+ this.sysID = this.stringify.dtdSysID(value.sysID);
+ }
+ if (value.nData != null) {
+ this.nData = this.stringify.dtdNData(value.nData);
+ }
+ if (this.pe && this.nData) {
+ throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(name));
+ }
+ }
+ }
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'notationName', {
+ get: function() {
+ return this.nData || null;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'inputEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'xmlEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'xmlVersion', {
+ get: function() {
+ return null;
+ }
+ });
+
+ XMLDTDEntity.prototype.toString = function(options) {
+ return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));
+ };
+
+ return XMLDTDEntity;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDTDNotation.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDTDNotation.js
new file mode 100644
index 0000000..57a119d
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDTDNotation.js
@@ -0,0 +1,52 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLDTDNotation, XMLNode,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ module.exports = XMLDTDNotation = (function(superClass) {
+ extend(XMLDTDNotation, superClass);
+
+ function XMLDTDNotation(parent, name, value) {
+ XMLDTDNotation.__super__.constructor.call(this, parent);
+ if (name == null) {
+ throw new Error("Missing DTD notation name. " + this.debugInfo(name));
+ }
+ if (!value.pubID && !value.sysID) {
+ throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name));
+ }
+ this.name = this.stringify.name(name);
+ this.type = NodeType.NotationDeclaration;
+ if (value.pubID != null) {
+ this.pubID = this.stringify.dtdPubID(value.pubID);
+ }
+ if (value.sysID != null) {
+ this.sysID = this.stringify.dtdSysID(value.sysID);
+ }
+ }
+
+ Object.defineProperty(XMLDTDNotation.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDNotation.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ XMLDTDNotation.prototype.toString = function(options) {
+ return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));
+ };
+
+ return XMLDTDNotation;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDeclaration.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDeclaration.js
new file mode 100644
index 0000000..d4f7f44
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDeclaration.js
@@ -0,0 +1,43 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLDeclaration, XMLNode, isObject,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ isObject = require('./Utility').isObject;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ module.exports = XMLDeclaration = (function(superClass) {
+ extend(XMLDeclaration, superClass);
+
+ function XMLDeclaration(parent, version, encoding, standalone) {
+ var ref;
+ XMLDeclaration.__super__.constructor.call(this, parent);
+ if (isObject(version)) {
+ ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
+ }
+ if (!version) {
+ version = '1.0';
+ }
+ this.type = NodeType.Declaration;
+ this.version = this.stringify.xmlVersion(version);
+ if (encoding != null) {
+ this.encoding = this.stringify.xmlEncoding(encoding);
+ }
+ if (standalone != null) {
+ this.standalone = this.stringify.xmlStandalone(standalone);
+ }
+ }
+
+ XMLDeclaration.prototype.toString = function(options) {
+ return this.options.writer.declaration(this, this.options.writer.filterOptions(options));
+ };
+
+ return XMLDeclaration;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDocType.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDocType.js
new file mode 100644
index 0000000..ef043f4
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDocType.js
@@ -0,0 +1,186 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ isObject = require('./Utility').isObject;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+
+ module.exports = XMLDocType = (function(superClass) {
+ extend(XMLDocType, superClass);
+
+ function XMLDocType(parent, pubID, sysID) {
+ var child, i, len, ref, ref1, ref2;
+ XMLDocType.__super__.constructor.call(this, parent);
+ this.type = NodeType.DocType;
+ if (parent.children) {
+ ref = parent.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ if (child.type === NodeType.Element) {
+ this.name = child.name;
+ break;
+ }
+ }
+ }
+ this.documentObject = parent;
+ if (isObject(pubID)) {
+ ref1 = pubID, pubID = ref1.pubID, sysID = ref1.sysID;
+ }
+ if (sysID == null) {
+ ref2 = [pubID, sysID], sysID = ref2[0], pubID = ref2[1];
+ }
+ if (pubID != null) {
+ this.pubID = this.stringify.dtdPubID(pubID);
+ }
+ if (sysID != null) {
+ this.sysID = this.stringify.dtdSysID(sysID);
+ }
+ }
+
+ Object.defineProperty(XMLDocType.prototype, 'entities', {
+ get: function() {
+ var child, i, len, nodes, ref;
+ nodes = {};
+ ref = this.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ if ((child.type === NodeType.EntityDeclaration) && !child.pe) {
+ nodes[child.name] = child;
+ }
+ }
+ return new XMLNamedNodeMap(nodes);
+ }
+ });
+
+ Object.defineProperty(XMLDocType.prototype, 'notations', {
+ get: function() {
+ var child, i, len, nodes, ref;
+ nodes = {};
+ ref = this.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ if (child.type === NodeType.NotationDeclaration) {
+ nodes[child.name] = child;
+ }
+ }
+ return new XMLNamedNodeMap(nodes);
+ }
+ });
+
+ Object.defineProperty(XMLDocType.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDocType.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ Object.defineProperty(XMLDocType.prototype, 'internalSubset', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ XMLDocType.prototype.element = function(name, value) {
+ var child;
+ child = new XMLDTDElement(this, name, value);
+ this.children.push(child);
+ return this;
+ };
+
+ XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ var child;
+ child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ this.children.push(child);
+ return this;
+ };
+
+ XMLDocType.prototype.entity = function(name, value) {
+ var child;
+ child = new XMLDTDEntity(this, false, name, value);
+ this.children.push(child);
+ return this;
+ };
+
+ XMLDocType.prototype.pEntity = function(name, value) {
+ var child;
+ child = new XMLDTDEntity(this, true, name, value);
+ this.children.push(child);
+ return this;
+ };
+
+ XMLDocType.prototype.notation = function(name, value) {
+ var child;
+ child = new XMLDTDNotation(this, name, value);
+ this.children.push(child);
+ return this;
+ };
+
+ XMLDocType.prototype.toString = function(options) {
+ return this.options.writer.docType(this, this.options.writer.filterOptions(options));
+ };
+
+ XMLDocType.prototype.ele = function(name, value) {
+ return this.element(name, value);
+ };
+
+ XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ };
+
+ XMLDocType.prototype.ent = function(name, value) {
+ return this.entity(name, value);
+ };
+
+ XMLDocType.prototype.pent = function(name, value) {
+ return this.pEntity(name, value);
+ };
+
+ XMLDocType.prototype.not = function(name, value) {
+ return this.notation(name, value);
+ };
+
+ XMLDocType.prototype.up = function() {
+ return this.root() || this.documentObject;
+ };
+
+ XMLDocType.prototype.isEqualNode = function(node) {
+ if (!XMLDocType.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
+ return false;
+ }
+ if (node.name !== this.name) {
+ return false;
+ }
+ if (node.publicId !== this.publicId) {
+ return false;
+ }
+ if (node.systemId !== this.systemId) {
+ return false;
+ }
+ return true;
+ };
+
+ return XMLDocType;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDocument.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDocument.js
new file mode 100644
index 0000000..88df56c
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDocument.js
@@ -0,0 +1,242 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ isPlainObject = require('./Utility').isPlainObject;
+
+ XMLDOMImplementation = require('./XMLDOMImplementation');
+
+ XMLDOMConfiguration = require('./XMLDOMConfiguration');
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLStringifier = require('./XMLStringifier');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ module.exports = XMLDocument = (function(superClass) {
+ extend(XMLDocument, superClass);
+
+ function XMLDocument(options) {
+ XMLDocument.__super__.constructor.call(this, null);
+ this.name = "#document";
+ this.type = NodeType.Document;
+ this.documentURI = null;
+ this.domConfig = new XMLDOMConfiguration();
+ options || (options = {});
+ if (!options.writer) {
+ options.writer = new XMLStringWriter();
+ }
+ this.options = options;
+ this.stringify = new XMLStringifier(options);
+ }
+
+ Object.defineProperty(XMLDocument.prototype, 'implementation', {
+ value: new XMLDOMImplementation()
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'doctype', {
+ get: function() {
+ var child, i, len, ref;
+ ref = this.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ if (child.type === NodeType.DocType) {
+ return child;
+ }
+ }
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'documentElement', {
+ get: function() {
+ return this.rootObject || null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'inputEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'strictErrorChecking', {
+ get: function() {
+ return false;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlEncoding', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].encoding;
+ } else {
+ return null;
+ }
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlStandalone', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].standalone === 'yes';
+ } else {
+ return false;
+ }
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlVersion', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].version;
+ } else {
+ return "1.0";
+ }
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'URL', {
+ get: function() {
+ return this.documentURI;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'origin', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'compatMode', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'characterSet', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'contentType', {
+ get: function() {
+ return null;
+ }
+ });
+
+ XMLDocument.prototype.end = function(writer) {
+ var writerOptions;
+ writerOptions = {};
+ if (!writer) {
+ writer = this.options.writer;
+ } else if (isPlainObject(writer)) {
+ writerOptions = writer;
+ writer = this.options.writer;
+ }
+ return writer.document(this, writer.filterOptions(writerOptions));
+ };
+
+ XMLDocument.prototype.toString = function(options) {
+ return this.options.writer.document(this, this.options.writer.filterOptions(options));
+ };
+
+ XMLDocument.prototype.createElement = function(tagName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createDocumentFragment = function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createTextNode = function(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createComment = function(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createCDATASection = function(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createProcessingInstruction = function(target, data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createAttribute = function(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createEntityReference = function(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.getElementsByTagName = function(tagname) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.importNode = function(importedNode, deep) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createElementNS = function(namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createAttributeNS = function(namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.getElementById = function(elementId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.adoptNode = function(source) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.normalizeDocument = function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.renameNode = function(node, namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.getElementsByClassName = function(classNames) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createEvent = function(eventInterface) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createRange = function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createNodeIterator = function(root, whatToShow, filter) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLDocument.prototype.createTreeWalker = function(root, whatToShow, filter) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ return XMLDocument;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDocumentCB.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDocumentCB.js
new file mode 100644
index 0000000..ca1aa1c
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDocumentCB.js
@@ -0,0 +1,528 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref,
+ hasProp = {}.hasOwnProperty;
+
+ ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue;
+
+ NodeType = require('./NodeType');
+
+ XMLDocument = require('./XMLDocument');
+
+ XMLElement = require('./XMLElement');
+
+ XMLCData = require('./XMLCData');
+
+ XMLComment = require('./XMLComment');
+
+ XMLRaw = require('./XMLRaw');
+
+ XMLText = require('./XMLText');
+
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+ XMLDeclaration = require('./XMLDeclaration');
+
+ XMLDocType = require('./XMLDocType');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ XMLAttribute = require('./XMLAttribute');
+
+ XMLStringifier = require('./XMLStringifier');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ WriterState = require('./WriterState');
+
+ module.exports = XMLDocumentCB = (function() {
+ function XMLDocumentCB(options, onData, onEnd) {
+ var writerOptions;
+ this.name = "?xml";
+ this.type = NodeType.Document;
+ options || (options = {});
+ writerOptions = {};
+ if (!options.writer) {
+ options.writer = new XMLStringWriter();
+ } else if (isPlainObject(options.writer)) {
+ writerOptions = options.writer;
+ options.writer = new XMLStringWriter();
+ }
+ this.options = options;
+ this.writer = options.writer;
+ this.writerOptions = this.writer.filterOptions(writerOptions);
+ this.stringify = new XMLStringifier(options);
+ this.onDataCallback = onData || function() {};
+ this.onEndCallback = onEnd || function() {};
+ this.currentNode = null;
+ this.currentLevel = -1;
+ this.openTags = {};
+ this.documentStarted = false;
+ this.documentCompleted = false;
+ this.root = null;
+ }
+
+ XMLDocumentCB.prototype.createChildNode = function(node) {
+ var att, attName, attributes, child, i, len, ref1, ref2;
+ switch (node.type) {
+ case NodeType.CData:
+ this.cdata(node.value);
+ break;
+ case NodeType.Comment:
+ this.comment(node.value);
+ break;
+ case NodeType.Element:
+ attributes = {};
+ ref1 = node.attribs;
+ for (attName in ref1) {
+ if (!hasProp.call(ref1, attName)) continue;
+ att = ref1[attName];
+ attributes[attName] = att.value;
+ }
+ this.node(node.name, attributes);
+ break;
+ case NodeType.Dummy:
+ this.dummy();
+ break;
+ case NodeType.Raw:
+ this.raw(node.value);
+ break;
+ case NodeType.Text:
+ this.text(node.value);
+ break;
+ case NodeType.ProcessingInstruction:
+ this.instruction(node.target, node.value);
+ break;
+ default:
+ throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name);
+ }
+ ref2 = node.children;
+ for (i = 0, len = ref2.length; i < len; i++) {
+ child = ref2[i];
+ this.createChildNode(child);
+ if (child.type === NodeType.Element) {
+ this.up();
+ }
+ }
+ return this;
+ };
+
+ XMLDocumentCB.prototype.dummy = function() {
+ return this;
+ };
+
+ XMLDocumentCB.prototype.node = function(name, attributes, text) {
+ var ref1;
+ if (name == null) {
+ throw new Error("Missing node name.");
+ }
+ if (this.root && this.currentLevel === -1) {
+ throw new Error("Document can only have one root node. " + this.debugInfo(name));
+ }
+ this.openCurrent();
+ name = getValue(name);
+ if (attributes == null) {
+ attributes = {};
+ }
+ attributes = getValue(attributes);
+ if (!isObject(attributes)) {
+ ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
+ }
+ this.currentNode = new XMLElement(this, name, attributes);
+ this.currentNode.children = false;
+ this.currentLevel++;
+ this.openTags[this.currentLevel] = this.currentNode;
+ if (text != null) {
+ this.text(text);
+ }
+ return this;
+ };
+
+ XMLDocumentCB.prototype.element = function(name, attributes, text) {
+ var child, i, len, oldValidationFlag, ref1, root;
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ this.dtdElement.apply(this, arguments);
+ } else {
+ if (Array.isArray(name) || isObject(name) || isFunction(name)) {
+ oldValidationFlag = this.options.noValidation;
+ this.options.noValidation = true;
+ root = new XMLDocument(this.options).element('TEMP_ROOT');
+ root.element(name);
+ this.options.noValidation = oldValidationFlag;
+ ref1 = root.children;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ child = ref1[i];
+ this.createChildNode(child);
+ if (child.type === NodeType.Element) {
+ this.up();
+ }
+ }
+ } else {
+ this.node(name, attributes, text);
+ }
+ }
+ return this;
+ };
+
+ XMLDocumentCB.prototype.attribute = function(name, value) {
+ var attName, attValue;
+ if (!this.currentNode || this.currentNode.children) {
+ throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name));
+ }
+ if (name != null) {
+ name = getValue(name);
+ }
+ if (isObject(name)) {
+ for (attName in name) {
+ if (!hasProp.call(name, attName)) continue;
+ attValue = name[attName];
+ this.attribute(attName, attValue);
+ }
+ } else {
+ if (isFunction(value)) {
+ value = value.apply();
+ }
+ if (this.options.keepNullAttributes && (value == null)) {
+ this.currentNode.attribs[name] = new XMLAttribute(this, name, "");
+ } else if (value != null) {
+ this.currentNode.attribs[name] = new XMLAttribute(this, name, value);
+ }
+ }
+ return this;
+ };
+
+ XMLDocumentCB.prototype.text = function(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLText(this, value);
+ this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ };
+
+ XMLDocumentCB.prototype.cdata = function(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLCData(this, value);
+ this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ };
+
+ XMLDocumentCB.prototype.comment = function(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLComment(this, value);
+ this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ };
+
+ XMLDocumentCB.prototype.raw = function(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLRaw(this, value);
+ this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ };
+
+ XMLDocumentCB.prototype.instruction = function(target, value) {
+ var i, insTarget, insValue, len, node;
+ this.openCurrent();
+ if (target != null) {
+ target = getValue(target);
+ }
+ if (value != null) {
+ value = getValue(value);
+ }
+ if (Array.isArray(target)) {
+ for (i = 0, len = target.length; i < len; i++) {
+ insTarget = target[i];
+ this.instruction(insTarget);
+ }
+ } else if (isObject(target)) {
+ for (insTarget in target) {
+ if (!hasProp.call(target, insTarget)) continue;
+ insValue = target[insTarget];
+ this.instruction(insTarget, insValue);
+ }
+ } else {
+ if (isFunction(value)) {
+ value = value.apply();
+ }
+ node = new XMLProcessingInstruction(this, target, value);
+ this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ }
+ return this;
+ };
+
+ XMLDocumentCB.prototype.declaration = function(version, encoding, standalone) {
+ var node;
+ this.openCurrent();
+ if (this.documentStarted) {
+ throw new Error("declaration() must be the first node.");
+ }
+ node = new XMLDeclaration(this, version, encoding, standalone);
+ this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ };
+
+ XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) {
+ this.openCurrent();
+ if (root == null) {
+ throw new Error("Missing root node name.");
+ }
+ if (this.root) {
+ throw new Error("dtd() must come before the root node.");
+ }
+ this.currentNode = new XMLDocType(this, pubID, sysID);
+ this.currentNode.rootNodeName = root;
+ this.currentNode.children = false;
+ this.currentLevel++;
+ this.openTags[this.currentLevel] = this.currentNode;
+ return this;
+ };
+
+ XMLDocumentCB.prototype.dtdElement = function(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDElement(this, name, value);
+ this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ };
+
+ XMLDocumentCB.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ };
+
+ XMLDocumentCB.prototype.entity = function(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDEntity(this, false, name, value);
+ this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ };
+
+ XMLDocumentCB.prototype.pEntity = function(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDEntity(this, true, name, value);
+ this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ };
+
+ XMLDocumentCB.prototype.notation = function(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDNotation(this, name, value);
+ this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ };
+
+ XMLDocumentCB.prototype.up = function() {
+ if (this.currentLevel < 0) {
+ throw new Error("The document node has no parent.");
+ }
+ if (this.currentNode) {
+ if (this.currentNode.children) {
+ this.closeNode(this.currentNode);
+ } else {
+ this.openNode(this.currentNode);
+ }
+ this.currentNode = null;
+ } else {
+ this.closeNode(this.openTags[this.currentLevel]);
+ }
+ delete this.openTags[this.currentLevel];
+ this.currentLevel--;
+ return this;
+ };
+
+ XMLDocumentCB.prototype.end = function() {
+ while (this.currentLevel >= 0) {
+ this.up();
+ }
+ return this.onEnd();
+ };
+
+ XMLDocumentCB.prototype.openCurrent = function() {
+ if (this.currentNode) {
+ this.currentNode.children = true;
+ return this.openNode(this.currentNode);
+ }
+ };
+
+ XMLDocumentCB.prototype.openNode = function(node) {
+ var att, chunk, name, ref1;
+ if (!node.isOpen) {
+ if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) {
+ this.root = node;
+ }
+ chunk = '';
+ if (node.type === NodeType.Element) {
+ this.writerOptions.state = WriterState.OpenTag;
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name;
+ ref1 = node.attribs;
+ for (name in ref1) {
+ if (!hasProp.call(ref1, name)) continue;
+ att = ref1[name];
+ chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);
+ }
+ chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel);
+ this.writerOptions.state = WriterState.InsideTag;
+ } else {
+ this.writerOptions.state = WriterState.OpenTag;
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<!DOCTYPE ' + node.rootNodeName;
+ if (node.pubID && node.sysID) {
+ chunk += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ chunk += ' SYSTEM "' + node.sysID + '"';
+ }
+ if (node.children) {
+ chunk += ' [';
+ this.writerOptions.state = WriterState.InsideTag;
+ } else {
+ this.writerOptions.state = WriterState.CloseTag;
+ chunk += '>';
+ }
+ chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);
+ }
+ this.onData(chunk, this.currentLevel);
+ return node.isOpen = true;
+ }
+ };
+
+ XMLDocumentCB.prototype.closeNode = function(node) {
+ var chunk;
+ if (!node.isClosed) {
+ chunk = '';
+ this.writerOptions.state = WriterState.CloseTag;
+ if (node.type === NodeType.Element) {
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '</' + node.name + '>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
+ } else {
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
+ }
+ this.writerOptions.state = WriterState.None;
+ this.onData(chunk, this.currentLevel);
+ return node.isClosed = true;
+ }
+ };
+
+ XMLDocumentCB.prototype.onData = function(chunk, level) {
+ this.documentStarted = true;
+ return this.onDataCallback(chunk, level + 1);
+ };
+
+ XMLDocumentCB.prototype.onEnd = function() {
+ this.documentCompleted = true;
+ return this.onEndCallback();
+ };
+
+ XMLDocumentCB.prototype.debugInfo = function(name) {
+ if (name == null) {
+ return "";
+ } else {
+ return "node: <" + name + ">";
+ }
+ };
+
+ XMLDocumentCB.prototype.ele = function() {
+ return this.element.apply(this, arguments);
+ };
+
+ XMLDocumentCB.prototype.nod = function(name, attributes, text) {
+ return this.node(name, attributes, text);
+ };
+
+ XMLDocumentCB.prototype.txt = function(value) {
+ return this.text(value);
+ };
+
+ XMLDocumentCB.prototype.dat = function(value) {
+ return this.cdata(value);
+ };
+
+ XMLDocumentCB.prototype.com = function(value) {
+ return this.comment(value);
+ };
+
+ XMLDocumentCB.prototype.ins = function(target, value) {
+ return this.instruction(target, value);
+ };
+
+ XMLDocumentCB.prototype.dec = function(version, encoding, standalone) {
+ return this.declaration(version, encoding, standalone);
+ };
+
+ XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) {
+ return this.doctype(root, pubID, sysID);
+ };
+
+ XMLDocumentCB.prototype.e = function(name, attributes, text) {
+ return this.element(name, attributes, text);
+ };
+
+ XMLDocumentCB.prototype.n = function(name, attributes, text) {
+ return this.node(name, attributes, text);
+ };
+
+ XMLDocumentCB.prototype.t = function(value) {
+ return this.text(value);
+ };
+
+ XMLDocumentCB.prototype.d = function(value) {
+ return this.cdata(value);
+ };
+
+ XMLDocumentCB.prototype.c = function(value) {
+ return this.comment(value);
+ };
+
+ XMLDocumentCB.prototype.r = function(value) {
+ return this.raw(value);
+ };
+
+ XMLDocumentCB.prototype.i = function(target, value) {
+ return this.instruction(target, value);
+ };
+
+ XMLDocumentCB.prototype.att = function() {
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ return this.attList.apply(this, arguments);
+ } else {
+ return this.attribute.apply(this, arguments);
+ }
+ };
+
+ XMLDocumentCB.prototype.a = function() {
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ return this.attList.apply(this, arguments);
+ } else {
+ return this.attribute.apply(this, arguments);
+ }
+ };
+
+ XMLDocumentCB.prototype.ent = function(name, value) {
+ return this.entity(name, value);
+ };
+
+ XMLDocumentCB.prototype.pent = function(name, value) {
+ return this.pEntity(name, value);
+ };
+
+ XMLDocumentCB.prototype.not = function(name, value) {
+ return this.notation(name, value);
+ };
+
+ return XMLDocumentCB;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDocumentFragment.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDocumentFragment.js
new file mode 100644
index 0000000..5d6039c
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDocumentFragment.js
@@ -0,0 +1,24 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLDocumentFragment, XMLNode,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ module.exports = XMLDocumentFragment = (function(superClass) {
+ extend(XMLDocumentFragment, superClass);
+
+ function XMLDocumentFragment() {
+ XMLDocumentFragment.__super__.constructor.call(this, null);
+ this.name = "#document-fragment";
+ this.type = NodeType.DocumentFragment;
+ }
+
+ return XMLDocumentFragment;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLDummy.js b/includes/translator/node_modules/xmlbuilder/lib/XMLDummy.js
new file mode 100644
index 0000000..b26083a
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLDummy.js
@@ -0,0 +1,31 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLDummy, XMLNode,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ module.exports = XMLDummy = (function(superClass) {
+ extend(XMLDummy, superClass);
+
+ function XMLDummy(parent) {
+ XMLDummy.__super__.constructor.call(this, parent);
+ this.type = NodeType.Dummy;
+ }
+
+ XMLDummy.prototype.clone = function() {
+ return Object.create(this);
+ };
+
+ XMLDummy.prototype.toString = function(options) {
+ return '';
+ };
+
+ return XMLDummy;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLElement.js b/includes/translator/node_modules/xmlbuilder/lib/XMLElement.js
new file mode 100644
index 0000000..c165729
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLElement.js
@@ -0,0 +1,298 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLAttribute = require('./XMLAttribute');
+
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+
+ module.exports = XMLElement = (function(superClass) {
+ extend(XMLElement, superClass);
+
+ function XMLElement(parent, name, attributes) {
+ var child, j, len, ref1;
+ XMLElement.__super__.constructor.call(this, parent);
+ if (name == null) {
+ throw new Error("Missing element name. " + this.debugInfo());
+ }
+ this.name = this.stringify.name(name);
+ this.type = NodeType.Element;
+ this.attribs = {};
+ this.schemaTypeInfo = null;
+ if (attributes != null) {
+ this.attribute(attributes);
+ }
+ if (parent.type === NodeType.Document) {
+ this.isRoot = true;
+ this.documentObject = parent;
+ parent.rootObject = this;
+ if (parent.children) {
+ ref1 = parent.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (child.type === NodeType.DocType) {
+ child.name = this.name;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ Object.defineProperty(XMLElement.prototype, 'tagName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'namespaceURI', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'prefix', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'localName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'id', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'className', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'classList', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'attributes', {
+ get: function() {
+ if (!this.attributeMap || !this.attributeMap.nodes) {
+ this.attributeMap = new XMLNamedNodeMap(this.attribs);
+ }
+ return this.attributeMap;
+ }
+ });
+
+ XMLElement.prototype.clone = function() {
+ var att, attName, clonedSelf, ref1;
+ clonedSelf = Object.create(this);
+ if (clonedSelf.isRoot) {
+ clonedSelf.documentObject = null;
+ }
+ clonedSelf.attribs = {};
+ ref1 = this.attribs;
+ for (attName in ref1) {
+ if (!hasProp.call(ref1, attName)) continue;
+ att = ref1[attName];
+ clonedSelf.attribs[attName] = att.clone();
+ }
+ clonedSelf.children = [];
+ this.children.forEach(function(child) {
+ var clonedChild;
+ clonedChild = child.clone();
+ clonedChild.parent = clonedSelf;
+ return clonedSelf.children.push(clonedChild);
+ });
+ return clonedSelf;
+ };
+
+ XMLElement.prototype.attribute = function(name, value) {
+ var attName, attValue;
+ if (name != null) {
+ name = getValue(name);
+ }
+ if (isObject(name)) {
+ for (attName in name) {
+ if (!hasProp.call(name, attName)) continue;
+ attValue = name[attName];
+ this.attribute(attName, attValue);
+ }
+ } else {
+ if (isFunction(value)) {
+ value = value.apply();
+ }
+ if (this.options.keepNullAttributes && (value == null)) {
+ this.attribs[name] = new XMLAttribute(this, name, "");
+ } else if (value != null) {
+ this.attribs[name] = new XMLAttribute(this, name, value);
+ }
+ }
+ return this;
+ };
+
+ XMLElement.prototype.removeAttribute = function(name) {
+ var attName, j, len;
+ if (name == null) {
+ throw new Error("Missing attribute name. " + this.debugInfo());
+ }
+ name = getValue(name);
+ if (Array.isArray(name)) {
+ for (j = 0, len = name.length; j < len; j++) {
+ attName = name[j];
+ delete this.attribs[attName];
+ }
+ } else {
+ delete this.attribs[name];
+ }
+ return this;
+ };
+
+ XMLElement.prototype.toString = function(options) {
+ return this.options.writer.element(this, this.options.writer.filterOptions(options));
+ };
+
+ XMLElement.prototype.att = function(name, value) {
+ return this.attribute(name, value);
+ };
+
+ XMLElement.prototype.a = function(name, value) {
+ return this.attribute(name, value);
+ };
+
+ XMLElement.prototype.getAttribute = function(name) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name].value;
+ } else {
+ return null;
+ }
+ };
+
+ XMLElement.prototype.setAttribute = function(name, value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.getAttributeNode = function(name) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name];
+ } else {
+ return null;
+ }
+ };
+
+ XMLElement.prototype.setAttributeNode = function(newAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.removeAttributeNode = function(oldAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.getElementsByTagName = function(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.getAttributeNS = function(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.removeAttributeNS = function(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.getAttributeNodeNS = function(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.setAttributeNodeNS = function(newAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.hasAttribute = function(name) {
+ return this.attribs.hasOwnProperty(name);
+ };
+
+ XMLElement.prototype.hasAttributeNS = function(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.setIdAttribute = function(name, isId) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name].isId;
+ } else {
+ return isId;
+ }
+ };
+
+ XMLElement.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.setIdAttributeNode = function(idAttr, isId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.getElementsByTagName = function(tagname) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.getElementsByClassName = function(classNames) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLElement.prototype.isEqualNode = function(node) {
+ var i, j, ref1;
+ if (!XMLElement.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
+ return false;
+ }
+ if (node.namespaceURI !== this.namespaceURI) {
+ return false;
+ }
+ if (node.prefix !== this.prefix) {
+ return false;
+ }
+ if (node.localName !== this.localName) {
+ return false;
+ }
+ if (node.attribs.length !== this.attribs.length) {
+ return false;
+ }
+ for (i = j = 0, ref1 = this.attribs.length - 1; 0 <= ref1 ? j <= ref1 : j >= ref1; i = 0 <= ref1 ? ++j : --j) {
+ if (!this.attribs[i].isEqualNode(node.attribs[i])) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ return XMLElement;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js b/includes/translator/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js
new file mode 100644
index 0000000..885402d
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js
@@ -0,0 +1,58 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var XMLNamedNodeMap;
+
+ module.exports = XMLNamedNodeMap = (function() {
+ function XMLNamedNodeMap(nodes) {
+ this.nodes = nodes;
+ }
+
+ Object.defineProperty(XMLNamedNodeMap.prototype, 'length', {
+ get: function() {
+ return Object.keys(this.nodes).length || 0;
+ }
+ });
+
+ XMLNamedNodeMap.prototype.clone = function() {
+ return this.nodes = null;
+ };
+
+ XMLNamedNodeMap.prototype.getNamedItem = function(name) {
+ return this.nodes[name];
+ };
+
+ XMLNamedNodeMap.prototype.setNamedItem = function(node) {
+ var oldNode;
+ oldNode = this.nodes[node.nodeName];
+ this.nodes[node.nodeName] = node;
+ return oldNode || null;
+ };
+
+ XMLNamedNodeMap.prototype.removeNamedItem = function(name) {
+ var oldNode;
+ oldNode = this.nodes[name];
+ delete this.nodes[name];
+ return oldNode || null;
+ };
+
+ XMLNamedNodeMap.prototype.item = function(index) {
+ return this.nodes[Object.keys(this.nodes)[index]] || null;
+ };
+
+ XMLNamedNodeMap.prototype.getNamedItemNS = function(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented.");
+ };
+
+ XMLNamedNodeMap.prototype.setNamedItemNS = function(node) {
+ throw new Error("This DOM method is not implemented.");
+ };
+
+ XMLNamedNodeMap.prototype.removeNamedItemNS = function(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented.");
+ };
+
+ return XMLNamedNodeMap;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLNode.js b/includes/translator/node_modules/xmlbuilder/lib/XMLNode.js
new file mode 100644
index 0000000..e2c7bb7
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLNode.js
@@ -0,0 +1,785 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1,
+ hasProp = {}.hasOwnProperty;
+
+ ref1 = require('./Utility'), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue;
+
+ XMLElement = null;
+
+ XMLCData = null;
+
+ XMLComment = null;
+
+ XMLDeclaration = null;
+
+ XMLDocType = null;
+
+ XMLRaw = null;
+
+ XMLText = null;
+
+ XMLProcessingInstruction = null;
+
+ XMLDummy = null;
+
+ NodeType = null;
+
+ XMLNodeList = null;
+
+ XMLNamedNodeMap = null;
+
+ DocumentPosition = null;
+
+ module.exports = XMLNode = (function() {
+ function XMLNode(parent1) {
+ this.parent = parent1;
+ if (this.parent) {
+ this.options = this.parent.options;
+ this.stringify = this.parent.stringify;
+ }
+ this.value = null;
+ this.children = [];
+ this.baseURI = null;
+ if (!XMLElement) {
+ XMLElement = require('./XMLElement');
+ XMLCData = require('./XMLCData');
+ XMLComment = require('./XMLComment');
+ XMLDeclaration = require('./XMLDeclaration');
+ XMLDocType = require('./XMLDocType');
+ XMLRaw = require('./XMLRaw');
+ XMLText = require('./XMLText');
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+ XMLDummy = require('./XMLDummy');
+ NodeType = require('./NodeType');
+ XMLNodeList = require('./XMLNodeList');
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+ DocumentPosition = require('./DocumentPosition');
+ }
+ }
+
+ Object.defineProperty(XMLNode.prototype, 'nodeName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nodeType', {
+ get: function() {
+ return this.type;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nodeValue', {
+ get: function() {
+ return this.value;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'parentNode', {
+ get: function() {
+ return this.parent;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'childNodes', {
+ get: function() {
+ if (!this.childNodeList || !this.childNodeList.nodes) {
+ this.childNodeList = new XMLNodeList(this.children);
+ }
+ return this.childNodeList;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'firstChild', {
+ get: function() {
+ return this.children[0] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'lastChild', {
+ get: function() {
+ return this.children[this.children.length - 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'previousSibling', {
+ get: function() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ return this.parent.children[i - 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nextSibling', {
+ get: function() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ return this.parent.children[i + 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'ownerDocument', {
+ get: function() {
+ return this.document() || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'textContent', {
+ get: function() {
+ var child, j, len, ref2, str;
+ if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {
+ str = '';
+ ref2 = this.children;
+ for (j = 0, len = ref2.length; j < len; j++) {
+ child = ref2[j];
+ if (child.textContent) {
+ str += child.textContent;
+ }
+ }
+ return str;
+ } else {
+ return null;
+ }
+ },
+ set: function(value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ XMLNode.prototype.setParent = function(parent) {
+ var child, j, len, ref2, results;
+ this.parent = parent;
+ if (parent) {
+ this.options = parent.options;
+ this.stringify = parent.stringify;
+ }
+ ref2 = this.children;
+ results = [];
+ for (j = 0, len = ref2.length; j < len; j++) {
+ child = ref2[j];
+ results.push(child.setParent(this));
+ }
+ return results;
+ };
+
+ XMLNode.prototype.element = function(name, attributes, text) {
+ var childNode, item, j, k, key, lastChild, len, len1, ref2, ref3, val;
+ lastChild = null;
+ if (attributes === null && (text == null)) {
+ ref2 = [{}, null], attributes = ref2[0], text = ref2[1];
+ }
+ if (attributes == null) {
+ attributes = {};
+ }
+ attributes = getValue(attributes);
+ if (!isObject(attributes)) {
+ ref3 = [attributes, text], text = ref3[0], attributes = ref3[1];
+ }
+ if (name != null) {
+ name = getValue(name);
+ }
+ if (Array.isArray(name)) {
+ for (j = 0, len = name.length; j < len; j++) {
+ item = name[j];
+ lastChild = this.element(item);
+ }
+ } else if (isFunction(name)) {
+ lastChild = this.element(name.apply());
+ } else if (isObject(name)) {
+ for (key in name) {
+ if (!hasProp.call(name, key)) continue;
+ val = name[key];
+ if (isFunction(val)) {
+ val = val.apply();
+ }
+ if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
+ lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
+ } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) {
+ lastChild = this.dummy();
+ } else if (isObject(val) && isEmpty(val)) {
+ lastChild = this.element(key);
+ } else if (!this.options.keepNullNodes && (val == null)) {
+ lastChild = this.dummy();
+ } else if (!this.options.separateArrayItems && Array.isArray(val)) {
+ for (k = 0, len1 = val.length; k < len1; k++) {
+ item = val[k];
+ childNode = {};
+ childNode[key] = item;
+ lastChild = this.element(childNode);
+ }
+ } else if (isObject(val)) {
+ if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) {
+ lastChild = this.element(val);
+ } else {
+ lastChild = this.element(key);
+ lastChild.element(val);
+ }
+ } else {
+ lastChild = this.element(key, val);
+ }
+ }
+ } else if (!this.options.keepNullNodes && text === null) {
+ lastChild = this.dummy();
+ } else {
+ if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
+ lastChild = this.text(text);
+ } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
+ lastChild = this.cdata(text);
+ } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
+ lastChild = this.comment(text);
+ } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
+ lastChild = this.raw(text);
+ } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
+ lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
+ } else {
+ lastChild = this.node(name, attributes, text);
+ }
+ }
+ if (lastChild == null) {
+ throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo());
+ }
+ return lastChild;
+ };
+
+ XMLNode.prototype.insertBefore = function(name, attributes, text) {
+ var child, i, newChild, refChild, removed;
+ if (name != null ? name.type : void 0) {
+ newChild = name;
+ refChild = attributes;
+ newChild.setParent(this);
+ if (refChild) {
+ i = children.indexOf(refChild);
+ removed = children.splice(i);
+ children.push(newChild);
+ Array.prototype.push.apply(children, removed);
+ } else {
+ children.push(newChild);
+ }
+ return newChild;
+ } else {
+ if (this.isRoot) {
+ throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
+ }
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+ child = this.parent.element(name, attributes, text);
+ Array.prototype.push.apply(this.parent.children, removed);
+ return child;
+ }
+ };
+
+ XMLNode.prototype.insertAfter = function(name, attributes, text) {
+ var child, i, removed;
+ if (this.isRoot) {
+ throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
+ }
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+ child = this.parent.element(name, attributes, text);
+ Array.prototype.push.apply(this.parent.children, removed);
+ return child;
+ };
+
+ XMLNode.prototype.remove = function() {
+ var i, ref2;
+ if (this.isRoot) {
+ throw new Error("Cannot remove the root element. " + this.debugInfo());
+ }
+ i = this.parent.children.indexOf(this);
+ [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref2 = [])), ref2;
+ return this.parent;
+ };
+
+ XMLNode.prototype.node = function(name, attributes, text) {
+ var child, ref2;
+ if (name != null) {
+ name = getValue(name);
+ }
+ attributes || (attributes = {});
+ attributes = getValue(attributes);
+ if (!isObject(attributes)) {
+ ref2 = [attributes, text], text = ref2[0], attributes = ref2[1];
+ }
+ child = new XMLElement(this, name, attributes);
+ if (text != null) {
+ child.text(text);
+ }
+ this.children.push(child);
+ return child;
+ };
+
+ XMLNode.prototype.text = function(value) {
+ var child;
+ if (isObject(value)) {
+ this.element(value);
+ }
+ child = new XMLText(this, value);
+ this.children.push(child);
+ return this;
+ };
+
+ XMLNode.prototype.cdata = function(value) {
+ var child;
+ child = new XMLCData(this, value);
+ this.children.push(child);
+ return this;
+ };
+
+ XMLNode.prototype.comment = function(value) {
+ var child;
+ child = new XMLComment(this, value);
+ this.children.push(child);
+ return this;
+ };
+
+ XMLNode.prototype.commentBefore = function(value) {
+ var child, i, removed;
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+ child = this.parent.comment(value);
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ };
+
+ XMLNode.prototype.commentAfter = function(value) {
+ var child, i, removed;
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+ child = this.parent.comment(value);
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ };
+
+ XMLNode.prototype.raw = function(value) {
+ var child;
+ child = new XMLRaw(this, value);
+ this.children.push(child);
+ return this;
+ };
+
+ XMLNode.prototype.dummy = function() {
+ var child;
+ child = new XMLDummy(this);
+ return child;
+ };
+
+ XMLNode.prototype.instruction = function(target, value) {
+ var insTarget, insValue, instruction, j, len;
+ if (target != null) {
+ target = getValue(target);
+ }
+ if (value != null) {
+ value = getValue(value);
+ }
+ if (Array.isArray(target)) {
+ for (j = 0, len = target.length; j < len; j++) {
+ insTarget = target[j];
+ this.instruction(insTarget);
+ }
+ } else if (isObject(target)) {
+ for (insTarget in target) {
+ if (!hasProp.call(target, insTarget)) continue;
+ insValue = target[insTarget];
+ this.instruction(insTarget, insValue);
+ }
+ } else {
+ if (isFunction(value)) {
+ value = value.apply();
+ }
+ instruction = new XMLProcessingInstruction(this, target, value);
+ this.children.push(instruction);
+ }
+ return this;
+ };
+
+ XMLNode.prototype.instructionBefore = function(target, value) {
+ var child, i, removed;
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+ child = this.parent.instruction(target, value);
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ };
+
+ XMLNode.prototype.instructionAfter = function(target, value) {
+ var child, i, removed;
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+ child = this.parent.instruction(target, value);
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ };
+
+ XMLNode.prototype.declaration = function(version, encoding, standalone) {
+ var doc, xmldec;
+ doc = this.document();
+ xmldec = new XMLDeclaration(doc, version, encoding, standalone);
+ if (doc.children.length === 0) {
+ doc.children.unshift(xmldec);
+ } else if (doc.children[0].type === NodeType.Declaration) {
+ doc.children[0] = xmldec;
+ } else {
+ doc.children.unshift(xmldec);
+ }
+ return doc.root() || doc;
+ };
+
+ XMLNode.prototype.dtd = function(pubID, sysID) {
+ var child, doc, doctype, i, j, k, len, len1, ref2, ref3;
+ doc = this.document();
+ doctype = new XMLDocType(doc, pubID, sysID);
+ ref2 = doc.children;
+ for (i = j = 0, len = ref2.length; j < len; i = ++j) {
+ child = ref2[i];
+ if (child.type === NodeType.DocType) {
+ doc.children[i] = doctype;
+ return doctype;
+ }
+ }
+ ref3 = doc.children;
+ for (i = k = 0, len1 = ref3.length; k < len1; i = ++k) {
+ child = ref3[i];
+ if (child.isRoot) {
+ doc.children.splice(i, 0, doctype);
+ return doctype;
+ }
+ }
+ doc.children.push(doctype);
+ return doctype;
+ };
+
+ XMLNode.prototype.up = function() {
+ if (this.isRoot) {
+ throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
+ }
+ return this.parent;
+ };
+
+ XMLNode.prototype.root = function() {
+ var node;
+ node = this;
+ while (node) {
+ if (node.type === NodeType.Document) {
+ return node.rootObject;
+ } else if (node.isRoot) {
+ return node;
+ } else {
+ node = node.parent;
+ }
+ }
+ };
+
+ XMLNode.prototype.document = function() {
+ var node;
+ node = this;
+ while (node) {
+ if (node.type === NodeType.Document) {
+ return node;
+ } else {
+ node = node.parent;
+ }
+ }
+ };
+
+ XMLNode.prototype.end = function(options) {
+ return this.document().end(options);
+ };
+
+ XMLNode.prototype.prev = function() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ if (i < 1) {
+ throw new Error("Already at the first node. " + this.debugInfo());
+ }
+ return this.parent.children[i - 1];
+ };
+
+ XMLNode.prototype.next = function() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ if (i === -1 || i === this.parent.children.length - 1) {
+ throw new Error("Already at the last node. " + this.debugInfo());
+ }
+ return this.parent.children[i + 1];
+ };
+
+ XMLNode.prototype.importDocument = function(doc) {
+ var clonedRoot;
+ clonedRoot = doc.root().clone();
+ clonedRoot.parent = this;
+ clonedRoot.isRoot = false;
+ this.children.push(clonedRoot);
+ return this;
+ };
+
+ XMLNode.prototype.debugInfo = function(name) {
+ var ref2, ref3;
+ name = name || this.name;
+ if ((name == null) && !((ref2 = this.parent) != null ? ref2.name : void 0)) {
+ return "";
+ } else if (name == null) {
+ return "parent: <" + this.parent.name + ">";
+ } else if (!((ref3 = this.parent) != null ? ref3.name : void 0)) {
+ return "node: <" + name + ">";
+ } else {
+ return "node: <" + name + ">, parent: <" + this.parent.name + ">";
+ }
+ };
+
+ XMLNode.prototype.ele = function(name, attributes, text) {
+ return this.element(name, attributes, text);
+ };
+
+ XMLNode.prototype.nod = function(name, attributes, text) {
+ return this.node(name, attributes, text);
+ };
+
+ XMLNode.prototype.txt = function(value) {
+ return this.text(value);
+ };
+
+ XMLNode.prototype.dat = function(value) {
+ return this.cdata(value);
+ };
+
+ XMLNode.prototype.com = function(value) {
+ return this.comment(value);
+ };
+
+ XMLNode.prototype.ins = function(target, value) {
+ return this.instruction(target, value);
+ };
+
+ XMLNode.prototype.doc = function() {
+ return this.document();
+ };
+
+ XMLNode.prototype.dec = function(version, encoding, standalone) {
+ return this.declaration(version, encoding, standalone);
+ };
+
+ XMLNode.prototype.e = function(name, attributes, text) {
+ return this.element(name, attributes, text);
+ };
+
+ XMLNode.prototype.n = function(name, attributes, text) {
+ return this.node(name, attributes, text);
+ };
+
+ XMLNode.prototype.t = function(value) {
+ return this.text(value);
+ };
+
+ XMLNode.prototype.d = function(value) {
+ return this.cdata(value);
+ };
+
+ XMLNode.prototype.c = function(value) {
+ return this.comment(value);
+ };
+
+ XMLNode.prototype.r = function(value) {
+ return this.raw(value);
+ };
+
+ XMLNode.prototype.i = function(target, value) {
+ return this.instruction(target, value);
+ };
+
+ XMLNode.prototype.u = function() {
+ return this.up();
+ };
+
+ XMLNode.prototype.importXMLBuilder = function(doc) {
+ return this.importDocument(doc);
+ };
+
+ XMLNode.prototype.replaceChild = function(newChild, oldChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.removeChild = function(oldChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.appendChild = function(newChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.hasChildNodes = function() {
+ return this.children.length !== 0;
+ };
+
+ XMLNode.prototype.cloneNode = function(deep) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.normalize = function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.isSupported = function(feature, version) {
+ return true;
+ };
+
+ XMLNode.prototype.hasAttributes = function() {
+ return this.attribs.length !== 0;
+ };
+
+ XMLNode.prototype.compareDocumentPosition = function(other) {
+ var ref, res;
+ ref = this;
+ if (ref === other) {
+ return 0;
+ } else if (this.document() !== other.document()) {
+ res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;
+ if (Math.random() < 0.5) {
+ res |= DocumentPosition.Preceding;
+ } else {
+ res |= DocumentPosition.Following;
+ }
+ return res;
+ } else if (ref.isAncestor(other)) {
+ return DocumentPosition.Contains | DocumentPosition.Preceding;
+ } else if (ref.isDescendant(other)) {
+ return DocumentPosition.Contains | DocumentPosition.Following;
+ } else if (ref.isPreceding(other)) {
+ return DocumentPosition.Preceding;
+ } else {
+ return DocumentPosition.Following;
+ }
+ };
+
+ XMLNode.prototype.isSameNode = function(other) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.lookupPrefix = function(namespaceURI) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.isDefaultNamespace = function(namespaceURI) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.lookupNamespaceURI = function(prefix) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.isEqualNode = function(node) {
+ var i, j, ref2;
+ if (node.nodeType !== this.nodeType) {
+ return false;
+ }
+ if (node.children.length !== this.children.length) {
+ return false;
+ }
+ for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) {
+ if (!this.children[i].isEqualNode(node.children[i])) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ XMLNode.prototype.getFeature = function(feature, version) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.setUserData = function(key, data, handler) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.getUserData = function(key) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLNode.prototype.contains = function(other) {
+ if (!other) {
+ return false;
+ }
+ return other === this || this.isDescendant(other);
+ };
+
+ XMLNode.prototype.isDescendant = function(node) {
+ var child, isDescendantChild, j, len, ref2;
+ ref2 = this.children;
+ for (j = 0, len = ref2.length; j < len; j++) {
+ child = ref2[j];
+ if (node === child) {
+ return true;
+ }
+ isDescendantChild = child.isDescendant(node);
+ if (isDescendantChild) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ XMLNode.prototype.isAncestor = function(node) {
+ return node.isDescendant(this);
+ };
+
+ XMLNode.prototype.isPreceding = function(node) {
+ var nodePos, thisPos;
+ nodePos = this.treePosition(node);
+ thisPos = this.treePosition(this);
+ if (nodePos === -1 || thisPos === -1) {
+ return false;
+ } else {
+ return nodePos < thisPos;
+ }
+ };
+
+ XMLNode.prototype.isFollowing = function(node) {
+ var nodePos, thisPos;
+ nodePos = this.treePosition(node);
+ thisPos = this.treePosition(this);
+ if (nodePos === -1 || thisPos === -1) {
+ return false;
+ } else {
+ return nodePos > thisPos;
+ }
+ };
+
+ XMLNode.prototype.treePosition = function(node) {
+ var found, pos;
+ pos = 0;
+ found = false;
+ this.foreachTreeNode(this.document(), function(childNode) {
+ pos++;
+ if (!found && childNode === node) {
+ return found = true;
+ }
+ });
+ if (found) {
+ return pos;
+ } else {
+ return -1;
+ }
+ };
+
+ XMLNode.prototype.foreachTreeNode = function(node, func) {
+ var child, j, len, ref2, res;
+ node || (node = this.document());
+ ref2 = node.children;
+ for (j = 0, len = ref2.length; j < len; j++) {
+ child = ref2[j];
+ if (res = func(child)) {
+ return res;
+ } else {
+ res = this.foreachTreeNode(child, func);
+ if (res) {
+ return res;
+ }
+ }
+ }
+ };
+
+ return XMLNode;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLNodeFilter.js b/includes/translator/node_modules/xmlbuilder/lib/XMLNodeFilter.js
new file mode 100644
index 0000000..ce32fd5
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLNodeFilter.js
@@ -0,0 +1,48 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var XMLNodeFilter;
+
+ module.exports = XMLNodeFilter = (function() {
+ function XMLNodeFilter() {}
+
+ XMLNodeFilter.prototype.FilterAccept = 1;
+
+ XMLNodeFilter.prototype.FilterReject = 2;
+
+ XMLNodeFilter.prototype.FilterSkip = 3;
+
+ XMLNodeFilter.prototype.ShowAll = 0xffffffff;
+
+ XMLNodeFilter.prototype.ShowElement = 0x1;
+
+ XMLNodeFilter.prototype.ShowAttribute = 0x2;
+
+ XMLNodeFilter.prototype.ShowText = 0x4;
+
+ XMLNodeFilter.prototype.ShowCDataSection = 0x8;
+
+ XMLNodeFilter.prototype.ShowEntityReference = 0x10;
+
+ XMLNodeFilter.prototype.ShowEntity = 0x20;
+
+ XMLNodeFilter.prototype.ShowProcessingInstruction = 0x40;
+
+ XMLNodeFilter.prototype.ShowComment = 0x80;
+
+ XMLNodeFilter.prototype.ShowDocument = 0x100;
+
+ XMLNodeFilter.prototype.ShowDocumentType = 0x200;
+
+ XMLNodeFilter.prototype.ShowDocumentFragment = 0x400;
+
+ XMLNodeFilter.prototype.ShowNotation = 0x800;
+
+ XMLNodeFilter.prototype.acceptNode = function(node) {
+ throw new Error("This DOM method is not implemented.");
+ };
+
+ return XMLNodeFilter;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLNodeList.js b/includes/translator/node_modules/xmlbuilder/lib/XMLNodeList.js
new file mode 100644
index 0000000..3414a3e
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLNodeList.js
@@ -0,0 +1,28 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var XMLNodeList;
+
+ module.exports = XMLNodeList = (function() {
+ function XMLNodeList(nodes) {
+ this.nodes = nodes;
+ }
+
+ Object.defineProperty(XMLNodeList.prototype, 'length', {
+ get: function() {
+ return this.nodes.length || 0;
+ }
+ });
+
+ XMLNodeList.prototype.clone = function() {
+ return this.nodes = null;
+ };
+
+ XMLNodeList.prototype.item = function(index) {
+ return this.nodes[index] || null;
+ };
+
+ return XMLNodeList;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js b/includes/translator/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js
new file mode 100644
index 0000000..d4333d4
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js
@@ -0,0 +1,49 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLCharacterData, XMLProcessingInstruction,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ module.exports = XMLProcessingInstruction = (function(superClass) {
+ extend(XMLProcessingInstruction, superClass);
+
+ function XMLProcessingInstruction(parent, target, value) {
+ XMLProcessingInstruction.__super__.constructor.call(this, parent);
+ if (target == null) {
+ throw new Error("Missing instruction target. " + this.debugInfo());
+ }
+ this.type = NodeType.ProcessingInstruction;
+ this.target = this.stringify.insTarget(target);
+ this.name = this.target;
+ if (value) {
+ this.value = this.stringify.insValue(value);
+ }
+ }
+
+ XMLProcessingInstruction.prototype.clone = function() {
+ return Object.create(this);
+ };
+
+ XMLProcessingInstruction.prototype.toString = function(options) {
+ return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options));
+ };
+
+ XMLProcessingInstruction.prototype.isEqualNode = function(node) {
+ if (!XMLProcessingInstruction.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
+ return false;
+ }
+ if (node.target !== this.target) {
+ return false;
+ }
+ return true;
+ };
+
+ return XMLProcessingInstruction;
+
+ })(XMLCharacterData);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLRaw.js b/includes/translator/node_modules/xmlbuilder/lib/XMLRaw.js
new file mode 100644
index 0000000..b592850
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLRaw.js
@@ -0,0 +1,35 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLNode, XMLRaw,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ NodeType = require('./NodeType');
+
+ XMLNode = require('./XMLNode');
+
+ module.exports = XMLRaw = (function(superClass) {
+ extend(XMLRaw, superClass);
+
+ function XMLRaw(parent, text) {
+ XMLRaw.__super__.constructor.call(this, parent);
+ if (text == null) {
+ throw new Error("Missing raw text. " + this.debugInfo());
+ }
+ this.type = NodeType.Raw;
+ this.value = this.stringify.raw(text);
+ }
+
+ XMLRaw.prototype.clone = function() {
+ return Object.create(this);
+ };
+
+ XMLRaw.prototype.toString = function(options) {
+ return this.options.writer.raw(this, this.options.writer.filterOptions(options));
+ };
+
+ return XMLRaw;
+
+ })(XMLNode);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLStreamWriter.js b/includes/translator/node_modules/xmlbuilder/lib/XMLStreamWriter.js
new file mode 100644
index 0000000..159dc6b
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLStreamWriter.js
@@ -0,0 +1,176 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, WriterState, XMLStreamWriter, XMLWriterBase,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ NodeType = require('./NodeType');
+
+ XMLWriterBase = require('./XMLWriterBase');
+
+ WriterState = require('./WriterState');
+
+ module.exports = XMLStreamWriter = (function(superClass) {
+ extend(XMLStreamWriter, superClass);
+
+ function XMLStreamWriter(stream, options) {
+ this.stream = stream;
+ XMLStreamWriter.__super__.constructor.call(this, options);
+ }
+
+ XMLStreamWriter.prototype.endline = function(node, options, level) {
+ if (node.isLastRootNode && options.state === WriterState.CloseTag) {
+ return '';
+ } else {
+ return XMLStreamWriter.__super__.endline.call(this, node, options, level);
+ }
+ };
+
+ XMLStreamWriter.prototype.document = function(doc, options) {
+ var child, i, j, k, len, len1, ref, ref1, results;
+ ref = doc.children;
+ for (i = j = 0, len = ref.length; j < len; i = ++j) {
+ child = ref[i];
+ child.isLastRootNode = i === doc.children.length - 1;
+ }
+ options = this.filterOptions(options);
+ ref1 = doc.children;
+ results = [];
+ for (k = 0, len1 = ref1.length; k < len1; k++) {
+ child = ref1[k];
+ results.push(this.writeChildNode(child, options, 0));
+ }
+ return results;
+ };
+
+ XMLStreamWriter.prototype.attribute = function(att, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.attribute.call(this, att, options, level));
+ };
+
+ XMLStreamWriter.prototype.cdata = function(node, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.cdata.call(this, node, options, level));
+ };
+
+ XMLStreamWriter.prototype.comment = function(node, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.comment.call(this, node, options, level));
+ };
+
+ XMLStreamWriter.prototype.declaration = function(node, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.declaration.call(this, node, options, level));
+ };
+
+ XMLStreamWriter.prototype.docType = function(node, options, level) {
+ var child, j, len, ref;
+ level || (level = 0);
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ this.stream.write(this.indent(node, options, level));
+ this.stream.write('<!DOCTYPE ' + node.root().name);
+ if (node.pubID && node.sysID) {
+ this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
+ } else if (node.sysID) {
+ this.stream.write(' SYSTEM "' + node.sysID + '"');
+ }
+ if (node.children.length > 0) {
+ this.stream.write(' [');
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.InsideTag;
+ ref = node.children;
+ for (j = 0, len = ref.length; j < len; j++) {
+ child = ref[j];
+ this.writeChildNode(child, options, level + 1);
+ }
+ options.state = WriterState.CloseTag;
+ this.stream.write(']');
+ }
+ options.state = WriterState.CloseTag;
+ this.stream.write(options.spaceBeforeSlash + '>');
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.None;
+ return this.closeNode(node, options, level);
+ };
+
+ XMLStreamWriter.prototype.element = function(node, options, level) {
+ var att, child, childNodeCount, firstChildNode, j, len, name, prettySuppressed, ref, ref1;
+ level || (level = 0);
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ this.stream.write(this.indent(node, options, level) + '<' + node.name);
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ this.attribute(att, options, level);
+ }
+ childNodeCount = node.children.length;
+ firstChildNode = childNodeCount === 0 ? null : node.children[0];
+ if (childNodeCount === 0 || node.children.every(function(e) {
+ return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === '';
+ })) {
+ if (options.allowEmpty) {
+ this.stream.write('>');
+ options.state = WriterState.CloseTag;
+ this.stream.write('</' + node.name + '>');
+ } else {
+ options.state = WriterState.CloseTag;
+ this.stream.write(options.spaceBeforeSlash + '/>');
+ }
+ } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) {
+ this.stream.write('>');
+ options.state = WriterState.InsideTag;
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ this.writeChildNode(firstChildNode, options, level + 1);
+ options.suppressPrettyCount--;
+ prettySuppressed = false;
+ options.state = WriterState.CloseTag;
+ this.stream.write('</' + node.name + '>');
+ } else {
+ this.stream.write('>' + this.endline(node, options, level));
+ options.state = WriterState.InsideTag;
+ ref1 = node.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ this.writeChildNode(child, options, level + 1);
+ }
+ options.state = WriterState.CloseTag;
+ this.stream.write(this.indent(node, options, level) + '</' + node.name + '>');
+ }
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.None;
+ return this.closeNode(node, options, level);
+ };
+
+ XMLStreamWriter.prototype.processingInstruction = function(node, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this, node, options, level));
+ };
+
+ XMLStreamWriter.prototype.raw = function(node, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.raw.call(this, node, options, level));
+ };
+
+ XMLStreamWriter.prototype.text = function(node, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.text.call(this, node, options, level));
+ };
+
+ XMLStreamWriter.prototype.dtdAttList = function(node, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this, node, options, level));
+ };
+
+ XMLStreamWriter.prototype.dtdElement = function(node, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this, node, options, level));
+ };
+
+ XMLStreamWriter.prototype.dtdEntity = function(node, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this, node, options, level));
+ };
+
+ XMLStreamWriter.prototype.dtdNotation = function(node, options, level) {
+ return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this, node, options, level));
+ };
+
+ return XMLStreamWriter;
+
+ })(XMLWriterBase);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLStringWriter.js b/includes/translator/node_modules/xmlbuilder/lib/XMLStringWriter.js
new file mode 100644
index 0000000..7187017
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLStringWriter.js
@@ -0,0 +1,35 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var XMLStringWriter, XMLWriterBase,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ XMLWriterBase = require('./XMLWriterBase');
+
+ module.exports = XMLStringWriter = (function(superClass) {
+ extend(XMLStringWriter, superClass);
+
+ function XMLStringWriter(options) {
+ XMLStringWriter.__super__.constructor.call(this, options);
+ }
+
+ XMLStringWriter.prototype.document = function(doc, options) {
+ var child, i, len, r, ref;
+ options = this.filterOptions(options);
+ r = '';
+ ref = doc.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ r += this.writeChildNode(child, options, 0);
+ }
+ if (options.pretty && r.slice(-options.newline.length) === options.newline) {
+ r = r.slice(0, -options.newline.length);
+ }
+ return r;
+ };
+
+ return XMLStringWriter;
+
+ })(XMLWriterBase);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLStringifier.js b/includes/translator/node_modules/xmlbuilder/lib/XMLStringifier.js
new file mode 100644
index 0000000..a39475c
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLStringifier.js
@@ -0,0 +1,240 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var XMLStringifier,
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ hasProp = {}.hasOwnProperty;
+
+ module.exports = XMLStringifier = (function() {
+ function XMLStringifier(options) {
+ this.assertLegalName = bind(this.assertLegalName, this);
+ this.assertLegalChar = bind(this.assertLegalChar, this);
+ var key, ref, value;
+ options || (options = {});
+ this.options = options;
+ if (!this.options.version) {
+ this.options.version = '1.0';
+ }
+ ref = options.stringify || {};
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ value = ref[key];
+ this[key] = value;
+ }
+ }
+
+ XMLStringifier.prototype.name = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalName('' + val || '');
+ };
+
+ XMLStringifier.prototype.text = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar(this.textEscape('' + val || ''));
+ };
+
+ XMLStringifier.prototype.cdata = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ val = val.replace(']]>', ']]]]><![CDATA[>');
+ return this.assertLegalChar(val);
+ };
+
+ XMLStringifier.prototype.comment = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (val.match(/--/)) {
+ throw new Error("Comment text cannot contain double-hypen: " + val);
+ }
+ return this.assertLegalChar(val);
+ };
+
+ XMLStringifier.prototype.raw = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return '' + val || '';
+ };
+
+ XMLStringifier.prototype.attValue = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar(this.attEscape(val = '' + val || ''));
+ };
+
+ XMLStringifier.prototype.insTarget = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ };
+
+ XMLStringifier.prototype.insValue = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (val.match(/\?>/)) {
+ throw new Error("Invalid processing instruction value: " + val);
+ }
+ return this.assertLegalChar(val);
+ };
+
+ XMLStringifier.prototype.xmlVersion = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (!val.match(/1\.[0-9]+/)) {
+ throw new Error("Invalid version number: " + val);
+ }
+ return val;
+ };
+
+ XMLStringifier.prototype.xmlEncoding = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
+ throw new Error("Invalid encoding: " + val);
+ }
+ return this.assertLegalChar(val);
+ };
+
+ XMLStringifier.prototype.xmlStandalone = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ if (val) {
+ return "yes";
+ } else {
+ return "no";
+ }
+ };
+
+ XMLStringifier.prototype.dtdPubID = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ };
+
+ XMLStringifier.prototype.dtdSysID = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ };
+
+ XMLStringifier.prototype.dtdElementValue = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ };
+
+ XMLStringifier.prototype.dtdAttType = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ };
+
+ XMLStringifier.prototype.dtdAttDefault = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ };
+
+ XMLStringifier.prototype.dtdEntityValue = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ };
+
+ XMLStringifier.prototype.dtdNData = function(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ };
+
+ XMLStringifier.prototype.convertAttKey = '@';
+
+ XMLStringifier.prototype.convertPIKey = '?';
+
+ XMLStringifier.prototype.convertTextKey = '#text';
+
+ XMLStringifier.prototype.convertCDataKey = '#cdata';
+
+ XMLStringifier.prototype.convertCommentKey = '#comment';
+
+ XMLStringifier.prototype.convertRawKey = '#raw';
+
+ XMLStringifier.prototype.assertLegalChar = function(str) {
+ var regex, res;
+ if (this.options.noValidation) {
+ return str;
+ }
+ regex = '';
+ if (this.options.version === '1.0') {
+ regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+ if (res = str.match(regex)) {
+ throw new Error("Invalid character in string: " + str + " at index " + res.index);
+ }
+ } else if (this.options.version === '1.1') {
+ regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+ if (res = str.match(regex)) {
+ throw new Error("Invalid character in string: " + str + " at index " + res.index);
+ }
+ }
+ return str;
+ };
+
+ XMLStringifier.prototype.assertLegalName = function(str) {
+ var regex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ this.assertLegalChar(str);
+ regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;
+ if (!str.match(regex)) {
+ throw new Error("Invalid character in name");
+ }
+ return str;
+ };
+
+ XMLStringifier.prototype.textEscape = function(str) {
+ var ampregex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
+ return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;');
+ };
+
+ XMLStringifier.prototype.attEscape = function(str) {
+ var ampregex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
+ return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;');
+ };
+
+ return XMLStringifier;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLText.js b/includes/translator/node_modules/xmlbuilder/lib/XMLText.js
new file mode 100644
index 0000000..59acc19
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLText.js
@@ -0,0 +1,69 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, XMLCharacterData, XMLText,
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ module.exports = XMLText = (function(superClass) {
+ extend(XMLText, superClass);
+
+ function XMLText(parent, text) {
+ XMLText.__super__.constructor.call(this, parent);
+ if (text == null) {
+ throw new Error("Missing element text. " + this.debugInfo());
+ }
+ this.name = "#text";
+ this.type = NodeType.Text;
+ this.value = this.stringify.text(text);
+ }
+
+ Object.defineProperty(XMLText.prototype, 'isElementContentWhitespace', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLText.prototype, 'wholeText', {
+ get: function() {
+ var next, prev, str;
+ str = '';
+ prev = this.previousSibling;
+ while (prev) {
+ str = prev.data + str;
+ prev = prev.previousSibling;
+ }
+ str += this.data;
+ next = this.nextSibling;
+ while (next) {
+ str = str + next.data;
+ next = next.nextSibling;
+ }
+ return str;
+ }
+ });
+
+ XMLText.prototype.clone = function() {
+ return Object.create(this);
+ };
+
+ XMLText.prototype.toString = function(options) {
+ return this.options.writer.text(this, this.options.writer.filterOptions(options));
+ };
+
+ XMLText.prototype.splitText = function(offset) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ XMLText.prototype.replaceWholeText = function(content) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ };
+
+ return XMLText;
+
+ })(XMLCharacterData);
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLTypeInfo.js b/includes/translator/node_modules/xmlbuilder/lib/XMLTypeInfo.js
new file mode 100644
index 0000000..b9bff15
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLTypeInfo.js
@@ -0,0 +1,21 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var Derivation, XMLTypeInfo;
+
+ Derivation = require('./Derivation');
+
+ module.exports = XMLTypeInfo = (function() {
+ function XMLTypeInfo(typeName, typeNamespace) {
+ this.typeName = typeName;
+ this.typeNamespace = typeNamespace;
+ }
+
+ XMLTypeInfo.prototype.isDerivedFrom = function(typeNamespaceArg, typeNameArg, derivationMethod) {
+ throw new Error("This DOM method is not implemented.");
+ };
+
+ return XMLTypeInfo;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLUserDataHandler.js b/includes/translator/node_modules/xmlbuilder/lib/XMLUserDataHandler.js
new file mode 100644
index 0000000..e172f89
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLUserDataHandler.js
@@ -0,0 +1,16 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var OperationType, XMLUserDataHandler;
+
+ OperationType = require('./OperationType');
+
+ module.exports = XMLUserDataHandler = (function() {
+ function XMLUserDataHandler() {}
+
+ XMLUserDataHandler.prototype.handle = function(operation, key, data, src, dst) {};
+
+ return XMLUserDataHandler;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/XMLWriterBase.js b/includes/translator/node_modules/xmlbuilder/lib/XMLWriterBase.js
new file mode 100644
index 0000000..215dba4
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/XMLWriterBase.js
@@ -0,0 +1,428 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign,
+ hasProp = {}.hasOwnProperty;
+
+ assign = require('./Utility').assign;
+
+ NodeType = require('./NodeType');
+
+ XMLDeclaration = require('./XMLDeclaration');
+
+ XMLDocType = require('./XMLDocType');
+
+ XMLCData = require('./XMLCData');
+
+ XMLComment = require('./XMLComment');
+
+ XMLElement = require('./XMLElement');
+
+ XMLRaw = require('./XMLRaw');
+
+ XMLText = require('./XMLText');
+
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+ XMLDummy = require('./XMLDummy');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ WriterState = require('./WriterState');
+
+ module.exports = XMLWriterBase = (function() {
+ function XMLWriterBase(options) {
+ var key, ref, value;
+ options || (options = {});
+ this.options = options;
+ ref = options.writer || {};
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ value = ref[key];
+ this["_" + key] = this[key];
+ this[key] = value;
+ }
+ }
+
+ XMLWriterBase.prototype.filterOptions = function(options) {
+ var filteredOptions, ref, ref1, ref2, ref3, ref4, ref5, ref6;
+ options || (options = {});
+ options = assign({}, this.options, options);
+ filteredOptions = {
+ writer: this
+ };
+ filteredOptions.pretty = options.pretty || false;
+ filteredOptions.allowEmpty = options.allowEmpty || false;
+ filteredOptions.indent = (ref = options.indent) != null ? ref : ' ';
+ filteredOptions.newline = (ref1 = options.newline) != null ? ref1 : '\n';
+ filteredOptions.offset = (ref2 = options.offset) != null ? ref2 : 0;
+ filteredOptions.dontPrettyTextNodes = (ref3 = (ref4 = options.dontPrettyTextNodes) != null ? ref4 : options.dontprettytextnodes) != null ? ref3 : 0;
+ filteredOptions.spaceBeforeSlash = (ref5 = (ref6 = options.spaceBeforeSlash) != null ? ref6 : options.spacebeforeslash) != null ? ref5 : '';
+ if (filteredOptions.spaceBeforeSlash === true) {
+ filteredOptions.spaceBeforeSlash = ' ';
+ }
+ filteredOptions.suppressPrettyCount = 0;
+ filteredOptions.user = {};
+ filteredOptions.state = WriterState.None;
+ return filteredOptions;
+ };
+
+ XMLWriterBase.prototype.indent = function(node, options, level) {
+ var indentLevel;
+ if (!options.pretty || options.suppressPrettyCount) {
+ return '';
+ } else if (options.pretty) {
+ indentLevel = (level || 0) + options.offset + 1;
+ if (indentLevel > 0) {
+ return new Array(indentLevel).join(options.indent);
+ }
+ }
+ return '';
+ };
+
+ XMLWriterBase.prototype.endline = function(node, options, level) {
+ if (!options.pretty || options.suppressPrettyCount) {
+ return '';
+ } else {
+ return options.newline;
+ }
+ };
+
+ XMLWriterBase.prototype.attribute = function(att, options, level) {
+ var r;
+ this.openAttribute(att, options, level);
+ r = ' ' + att.name + '="' + att.value + '"';
+ this.closeAttribute(att, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.cdata = function(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<![CDATA[';
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += ']]>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.comment = function(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!-- ';
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += ' -->' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.declaration = function(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<?xml';
+ options.state = WriterState.InsideTag;
+ r += ' version="' + node.version + '"';
+ if (node.encoding != null) {
+ r += ' encoding="' + node.encoding + '"';
+ }
+ if (node.standalone != null) {
+ r += ' standalone="' + node.standalone + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '?>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.docType = function(node, options, level) {
+ var child, i, len, r, ref;
+ level || (level = 0);
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ r += '<!DOCTYPE ' + node.root().name;
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ if (node.children.length > 0) {
+ r += ' [';
+ r += this.endline(node, options, level);
+ options.state = WriterState.InsideTag;
+ ref = node.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ r += this.writeChildNode(child, options, level + 1);
+ }
+ options.state = WriterState.CloseTag;
+ r += ']';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.element = function(node, options, level) {
+ var att, child, childNodeCount, firstChildNode, i, j, len, len1, name, prettySuppressed, r, ref, ref1, ref2;
+ level || (level = 0);
+ prettySuppressed = false;
+ r = '';
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r += this.indent(node, options, level) + '<' + node.name;
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ r += this.attribute(att, options, level);
+ }
+ childNodeCount = node.children.length;
+ firstChildNode = childNodeCount === 0 ? null : node.children[0];
+ if (childNodeCount === 0 || node.children.every(function(e) {
+ return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === '';
+ })) {
+ if (options.allowEmpty) {
+ r += '>';
+ options.state = WriterState.CloseTag;
+ r += '</' + node.name + '>' + this.endline(node, options, level);
+ } else {
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '/>' + this.endline(node, options, level);
+ }
+ } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) {
+ r += '>';
+ options.state = WriterState.InsideTag;
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ r += this.writeChildNode(firstChildNode, options, level + 1);
+ options.suppressPrettyCount--;
+ prettySuppressed = false;
+ options.state = WriterState.CloseTag;
+ r += '</' + node.name + '>' + this.endline(node, options, level);
+ } else {
+ if (options.dontPrettyTextNodes) {
+ ref1 = node.children;
+ for (i = 0, len = ref1.length; i < len; i++) {
+ child = ref1[i];
+ if ((child.type === NodeType.Text || child.type === NodeType.Raw) && (child.value != null)) {
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ break;
+ }
+ }
+ }
+ r += '>' + this.endline(node, options, level);
+ options.state = WriterState.InsideTag;
+ ref2 = node.children;
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ child = ref2[j];
+ r += this.writeChildNode(child, options, level + 1);
+ }
+ options.state = WriterState.CloseTag;
+ r += this.indent(node, options, level) + '</' + node.name + '>';
+ if (prettySuppressed) {
+ options.suppressPrettyCount--;
+ }
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ }
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.writeChildNode = function(node, options, level) {
+ switch (node.type) {
+ case NodeType.CData:
+ return this.cdata(node, options, level);
+ case NodeType.Comment:
+ return this.comment(node, options, level);
+ case NodeType.Element:
+ return this.element(node, options, level);
+ case NodeType.Raw:
+ return this.raw(node, options, level);
+ case NodeType.Text:
+ return this.text(node, options, level);
+ case NodeType.ProcessingInstruction:
+ return this.processingInstruction(node, options, level);
+ case NodeType.Dummy:
+ return '';
+ case NodeType.Declaration:
+ return this.declaration(node, options, level);
+ case NodeType.DocType:
+ return this.docType(node, options, level);
+ case NodeType.AttributeDeclaration:
+ return this.dtdAttList(node, options, level);
+ case NodeType.ElementDeclaration:
+ return this.dtdElement(node, options, level);
+ case NodeType.EntityDeclaration:
+ return this.dtdEntity(node, options, level);
+ case NodeType.NotationDeclaration:
+ return this.dtdNotation(node, options, level);
+ default:
+ throw new Error("Unknown XML node type: " + node.constructor.name);
+ }
+ };
+
+ XMLWriterBase.prototype.processingInstruction = function(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<?';
+ options.state = WriterState.InsideTag;
+ r += node.target;
+ if (node.value) {
+ r += ' ' + node.value;
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '?>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.raw = function(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.text = function(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.dtdAttList = function(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ATTLIST';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType;
+ if (node.defaultValueType !== '#DEFAULT') {
+ r += ' ' + node.defaultValueType;
+ }
+ if (node.defaultValue) {
+ r += ' "' + node.defaultValue + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.dtdElement = function(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ELEMENT';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.name + ' ' + node.value;
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.dtdEntity = function(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ENTITY';
+ options.state = WriterState.InsideTag;
+ if (node.pe) {
+ r += ' %';
+ }
+ r += ' ' + node.name;
+ if (node.value) {
+ r += ' "' + node.value + '"';
+ } else {
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ if (node.nData) {
+ r += ' NDATA ' + node.nData;
+ }
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.dtdNotation = function(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!NOTATION';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.name;
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.pubID) {
+ r += ' PUBLIC "' + node.pubID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ };
+
+ XMLWriterBase.prototype.openNode = function(node, options, level) {};
+
+ XMLWriterBase.prototype.closeNode = function(node, options, level) {};
+
+ XMLWriterBase.prototype.openAttribute = function(att, options, level) {};
+
+ XMLWriterBase.prototype.closeAttribute = function(att, options, level) {};
+
+ return XMLWriterBase;
+
+ })();
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/lib/index.js b/includes/translator/node_modules/xmlbuilder/lib/index.js
new file mode 100644
index 0000000..b1ed263
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/lib/index.js
@@ -0,0 +1,65 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+ var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref;
+
+ ref = require('./Utility'), assign = ref.assign, isFunction = ref.isFunction;
+
+ XMLDOMImplementation = require('./XMLDOMImplementation');
+
+ XMLDocument = require('./XMLDocument');
+
+ XMLDocumentCB = require('./XMLDocumentCB');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ XMLStreamWriter = require('./XMLStreamWriter');
+
+ NodeType = require('./NodeType');
+
+ WriterState = require('./WriterState');
+
+ module.exports.create = function(name, xmldec, doctype, options) {
+ var doc, root;
+ if (name == null) {
+ throw new Error("Root element needs a name.");
+ }
+ options = assign({}, xmldec, doctype, options);
+ doc = new XMLDocument(options);
+ root = doc.element(name);
+ if (!options.headless) {
+ doc.declaration(options);
+ if ((options.pubID != null) || (options.sysID != null)) {
+ doc.dtd(options);
+ }
+ }
+ return root;
+ };
+
+ module.exports.begin = function(options, onData, onEnd) {
+ var ref1;
+ if (isFunction(options)) {
+ ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1];
+ options = {};
+ }
+ if (onData) {
+ return new XMLDocumentCB(options, onData, onEnd);
+ } else {
+ return new XMLDocument(options);
+ }
+ };
+
+ module.exports.stringWriter = function(options) {
+ return new XMLStringWriter(options);
+ };
+
+ module.exports.streamWriter = function(stream, options) {
+ return new XMLStreamWriter(stream, options);
+ };
+
+ module.exports.implementation = new XMLDOMImplementation();
+
+ module.exports.nodeType = NodeType;
+
+ module.exports.writerState = WriterState;
+
+}).call(this);
diff --git a/includes/translator/node_modules/xmlbuilder/package.json b/includes/translator/node_modules/xmlbuilder/package.json
new file mode 100644
index 0000000..512cd97
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "xmlbuilder",
+ "version": "11.0.1",
+ "keywords": [
+ "xml",
+ "xmlbuilder"
+ ],
+ "homepage": "http://github.com/oozcitak/xmlbuilder-js",
+ "description": "An XML builder for node.js",
+ "author": "Ozgur Ozcitak <oozcitak@gmail.com>",
+ "contributors": [],
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/oozcitak/xmlbuilder-js.git"
+ },
+ "bugs": {
+ "url": "http://github.com/oozcitak/xmlbuilder-js/issues"
+ },
+ "main": "./lib/index",
+ "typings": "./typings/index.d.ts",
+ "engines": {
+ "node": ">=4.0"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "coffeescript": "1.*",
+ "mocha": "*",
+ "coffee-coverage": "2.*",
+ "istanbul": "*",
+ "coveralls": "*",
+ "xpath": "*"
+ },
+ "scripts": {
+ "prepublishOnly": "coffee -co lib src",
+ "postpublish": "rm -rf lib",
+ "test": "mocha \"test/**/*.coffee\" && istanbul report text lcov"
+ }
+}
diff --git a/includes/translator/node_modules/xmlbuilder/typings/index.d.ts b/includes/translator/node_modules/xmlbuilder/typings/index.d.ts
new file mode 100644
index 0000000..3e0e5b0
--- /dev/null
+++ b/includes/translator/node_modules/xmlbuilder/typings/index.d.ts
@@ -0,0 +1,153 @@
+// Type definitions for xmlbuilder
+// Project: https://github.com/oozcitak/xmlbuilder-js
+// Definitions by: Wallymathieu <https://github.com/wallymathieu>
+// : GaikwadPratik <https://github.com/GaikwadPratik>
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+export = xmlbuilder;
+
+declare namespace xmlbuilder {
+
+ class XMLDocType {
+ clone(): XMLDocType;
+ element(name: string, value?: Object): XMLDocType;
+ attList(elementName: string, attributeName: string, attributeType: string, defaultValueType?: string, defaultValue?: any): XMLDocType;
+ entity(name: string, value: any): XMLDocType;
+ pEntity(name: string, value: any): XMLDocType;
+ notation(name: string, value: any): XMLDocType;
+ cdata(value: string): XMLDocType;
+ comment(value: string): XMLDocType;
+ instruction(target: string, value: any): XMLDocType;
+ root(): XMLDocType;
+ document(): any;
+ toString(options?: XMLToStringOptions, level?: Number): string;
+
+ ele(name: string, value?: Object): XMLDocType;
+ att(elementName: string, attributeName: string, attributeType: string, defaultValueType?: string, defaultValue?: any): XMLDocType;
+ ent(name: string, value: any): XMLDocType;
+ pent(name: string, value: any): XMLDocType;
+ not(name: string, value: any): XMLDocType;
+ dat(value: string): XMLDocType;
+ com(value: string): XMLDocType;
+ ins(target: string, value: any): XMLDocType;
+ up(): XMLDocType;
+ doc(): any;
+ }
+
+ class XMLElementOrXMLNode {
+ // XMLElement:
+ clone(): XMLElementOrXMLNode;
+ attribute(name: any, value?: any): XMLElementOrXMLNode;
+ att(name: any, value?: any): XMLElementOrXMLNode;
+ removeAttribute(name: string): XMLElementOrXMLNode;
+ instruction(target: string, value: any): XMLElementOrXMLNode;
+ instruction(array: Array<any>): XMLElementOrXMLNode;
+ instruction(obj: Object): XMLElementOrXMLNode;
+ ins(target: string, value: any): XMLElementOrXMLNode;
+ ins(array: Array<any>): XMLElementOrXMLNode;
+ ins(obj: Object): XMLElementOrXMLNode;
+ a(name: any, value?: any): XMLElementOrXMLNode;
+ i(target: string, value: any): XMLElementOrXMLNode;
+ i(array: Array<any>): XMLElementOrXMLNode;
+ i(obj: Object): XMLElementOrXMLNode;
+ toString(options?: XMLToStringOptions, level?: Number): string;
+ // XMLNode:
+ element(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode;
+ ele(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode;
+ insertBefore(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode;
+ insertAfter(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode;
+ remove(): XMLElementOrXMLNode;
+ node(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode;
+ text(value: string): XMLElementOrXMLNode;
+ cdata(value: string): XMLElementOrXMLNode;
+ comment(value: string): XMLElementOrXMLNode;
+ raw(value: string): XMLElementOrXMLNode;
+ declaration(version: string, encoding: string, standalone: boolean): XMLElementOrXMLNode;
+ doctype(pubID: string, sysID: string): XMLDocType;
+ up(): XMLElementOrXMLNode;
+ importDocument(input: XMLElementOrXMLNode): XMLElementOrXMLNode;
+ root(): XMLElementOrXMLNode;
+ document(): any;
+ end(options?: XMLEndOptions): string;
+ prev(): XMLElementOrXMLNode;
+ next(): XMLElementOrXMLNode;
+ nod(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode;
+ txt(value: string): XMLElementOrXMLNode;
+ dat(value: string): XMLElementOrXMLNode;
+ com(value: string): XMLElementOrXMLNode;
+ doc(): XMLElementOrXMLNode;
+ dec(version: string, encoding: string, standalone: boolean): XMLElementOrXMLNode;
+ dtd(pubID: string, sysID: string): XMLDocType;
+ e(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode;
+ n(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode;
+ t(value: string): XMLElementOrXMLNode;
+ d(value: string): XMLElementOrXMLNode;
+ c(value: string): XMLElementOrXMLNode;
+ r(value: string): XMLElementOrXMLNode;
+ u(): XMLElementOrXMLNode;
+ }
+
+ interface XMLDec {
+ version?: string;
+ encoding?: string;
+ standalone?: boolean;
+ }
+
+ interface XMLDtd {
+ pubID?: string;
+ sysID?: string;
+ }
+
+ interface XMLStringifier {
+ [x: string]: ((v: any) => string) | string;
+ }
+
+ interface XMLWriter {
+ [x: string]: ((e: XMLElementOrXMLNode, options: WriterOptions, level?: number) => void);
+ }
+
+ interface XMLCreateOptions {
+ headless?: boolean;
+ keepNullNodes?: boolean;
+ keepNullAttributes?: boolean;
+ ignoreDecorators?: boolean;
+ separateArrayItems?: boolean;
+ noDoubleEncoding?: boolean;
+ stringify?: XMLStringifier;
+ }
+
+ interface XMLToStringOptions {
+ pretty?: boolean;
+ indent?: string;
+ offset?: number;
+ newline?: string;
+ allowEmpty?: boolean;
+ spacebeforeslash?: string;
+ }
+
+ interface XMLEndOptions extends XMLToStringOptions {
+ writer?: XMLWriter;
+ }
+
+ interface WriterOptions {
+ pretty?: boolean;
+ indent?: string;
+ newline?: string;
+ offset?: number;
+ allowEmpty?: boolean;
+ dontPrettyTextNodes?: boolean;
+ spaceBeforeSlash?: string | boolean;
+ user? :any;
+ state?: WriterState;
+ }
+
+ enum WriterState {
+ None = 0,
+ OpenTag = 1,
+ InsideTag = 2,
+ CloseTag = 3
+ }
+
+ function create(nameOrObjSpec: string | { [name: string]: Object }, xmldecOrOptions?: XMLDec | XMLCreateOptions, doctypeOrOptions?: XMLDtd | XMLCreateOptions, options?: XMLCreateOptions): XMLElementOrXMLNode;
+ function begin(): XMLElementOrXMLNode;
+} \ No newline at end of file
diff --git a/includes/translator/package-lock.json b/includes/translator/package-lock.json
new file mode 100644
index 0000000..aec306b
--- /dev/null
+++ b/includes/translator/package-lock.json
@@ -0,0 +1,408 @@
+{
+ "name": "translator",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "dependencies": {
+ "translatte": "^3.0.1",
+ "xml2js": "^0.6.0"
+ }
+ },
+ "node_modules/@sindresorhus/is": {
+ "version": "0.14.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
+ "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@szmarczak/http-timer": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz",
+ "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==",
+ "dependencies": {
+ "defer-to-connect": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/cacheable-request": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz",
+ "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==",
+ "dependencies": {
+ "clone-response": "^1.0.2",
+ "get-stream": "^5.1.0",
+ "http-cache-semantics": "^4.0.0",
+ "keyv": "^3.0.0",
+ "lowercase-keys": "^2.0.0",
+ "normalize-url": "^4.1.0",
+ "responselike": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cacheable-request/node_modules/get-stream": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
+ "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
+ "dependencies": {
+ "pump": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cacheable-request/node_modules/lowercase-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
+ "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/clone-response": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz",
+ "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==",
+ "dependencies": {
+ "mimic-response": "^1.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/configstore": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/configstore/-/configstore-4.0.0.tgz",
+ "integrity": "sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ==",
+ "dependencies": {
+ "dot-prop": "^4.1.0",
+ "graceful-fs": "^4.1.2",
+ "make-dir": "^1.0.0",
+ "unique-string": "^1.0.0",
+ "write-file-atomic": "^2.0.0",
+ "xdg-basedir": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/crypto-random-string": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz",
+ "integrity": "sha512-GsVpkFPlycH7/fRR7Dhcmnoii54gV1nz7y4CWyeFS14N+JVBBhY+r8amRHE4BwSYal7BPTDp8isvAlCxyFt3Hg==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/decompress-response": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz",
+ "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==",
+ "dependencies": {
+ "mimic-response": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/defer-to-connect": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz",
+ "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ=="
+ },
+ "node_modules/dot-prop": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz",
+ "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==",
+ "dependencies": {
+ "is-obj": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/duplexer3": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz",
+ "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA=="
+ },
+ "node_modules/end-of-stream": {
+ "version": "1.4.4",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
+ "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
+ "dependencies": {
+ "once": "^1.4.0"
+ }
+ },
+ "node_modules/get-stream": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+ "dependencies": {
+ "pump": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/got": {
+ "version": "9.6.0",
+ "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz",
+ "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==",
+ "dependencies": {
+ "@sindresorhus/is": "^0.14.0",
+ "@szmarczak/http-timer": "^1.1.2",
+ "cacheable-request": "^6.0.0",
+ "decompress-response": "^3.3.0",
+ "duplexer3": "^0.1.4",
+ "get-stream": "^4.1.0",
+ "lowercase-keys": "^1.0.1",
+ "mimic-response": "^1.0.1",
+ "p-cancelable": "^1.0.0",
+ "to-readable-stream": "^1.0.0",
+ "url-parse-lax": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
+ },
+ "node_modules/http-cache-semantics": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz",
+ "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ=="
+ },
+ "node_modules/imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
+ "engines": {
+ "node": ">=0.8.19"
+ }
+ },
+ "node_modules/is-obj": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
+ "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/json-buffer": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
+ "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ=="
+ },
+ "node_modules/keyv": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz",
+ "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==",
+ "dependencies": {
+ "json-buffer": "3.0.0"
+ }
+ },
+ "node_modules/lowercase-keys": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
+ "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/make-dir": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
+ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
+ "dependencies": {
+ "pify": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/mimic-response": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
+ "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/normalize-url": {
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz",
+ "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/p-cancelable": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz",
+ "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/prepend-http": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
+ "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/proxy-check": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/proxy-check/-/proxy-check-1.0.8.tgz",
+ "integrity": "sha512-gooLamKpgl6wi3tJuVpDC7KL3+xSwstUIatyrknMSLaznc+n/cpEiO2HwIAcU30VLExafchmzTpFOgHr8of0wA=="
+ },
+ "node_modules/pump": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+ "dependencies": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
+ "node_modules/responselike": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz",
+ "integrity": "sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==",
+ "dependencies": {
+ "lowercase-keys": "^1.0.0"
+ }
+ },
+ "node_modules/sax": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
+ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
+ },
+ "node_modules/signal-exit": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
+ },
+ "node_modules/to-readable-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz",
+ "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/translatte": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/translatte/-/translatte-3.0.1.tgz",
+ "integrity": "sha512-OP41nm4dS1ctRmDDXfgJGK7tAtq2yJe0QCOaRBQjBM+kS4ak4dhWrbL8Mf8p7TFzWJAdV+TLZ1oiYEW3gpWGJg==",
+ "dependencies": {
+ "configstore": "4.0.0",
+ "got": "9.6.0",
+ "proxy-check": "1.0.8",
+ "tunnel": "0.0.6"
+ }
+ },
+ "node_modules/tunnel": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
+ "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
+ "engines": {
+ "node": ">=0.6.11 <=0.7.0 || >=0.7.3"
+ }
+ },
+ "node_modules/unique-string": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz",
+ "integrity": "sha512-ODgiYu03y5g76A1I9Gt0/chLCzQjvzDy7DsZGsLOE/1MrF6wriEskSncj1+/C58Xk/kPZDppSctDybCwOSaGAg==",
+ "dependencies": {
+ "crypto-random-string": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/url-parse-lax": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz",
+ "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==",
+ "dependencies": {
+ "prepend-http": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
+ },
+ "node_modules/write-file-atomic": {
+ "version": "2.4.3",
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz",
+ "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==",
+ "dependencies": {
+ "graceful-fs": "^4.1.11",
+ "imurmurhash": "^0.1.4",
+ "signal-exit": "^3.0.2"
+ }
+ },
+ "node_modules/xdg-basedir": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz",
+ "integrity": "sha512-1Dly4xqlulvPD3fZUQJLY+FUIeqN3N2MM3uqe4rCJftAvOjFa3jFGfctOgluGx4ahPbUCsZkmJILiP0Vi4T6lQ==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/xml2js": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.0.tgz",
+ "integrity": "sha512-eLTh0kA8uHceqesPqSE+VvO1CDDJWMwlQfB6LuN6T8w6MaDJ8Txm8P7s5cHD0miF0V+GGTZrDQfxPZQVsur33w==",
+ "dependencies": {
+ "sax": ">=0.6.0",
+ "xmlbuilder": "~11.0.0"
+ },
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/xmlbuilder": {
+ "version": "11.0.1",
+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
+ "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
+ "engines": {
+ "node": ">=4.0"
+ }
+ }
+ }
+}
diff --git a/includes/translator/package.json b/includes/translator/package.json
new file mode 100644
index 0000000..8b4be45
--- /dev/null
+++ b/includes/translator/package.json
@@ -0,0 +1,6 @@
+{
+ "dependencies": {
+ "translatte": "^3.0.1",
+ "xml2js": "^0.6.0"
+ }
+}
diff --git a/includes/translator/translate.js b/includes/translator/translate.js
new file mode 100644
index 0000000..25dd9ab
--- /dev/null
+++ b/includes/translator/translate.js
@@ -0,0 +1,35 @@
+const fs = require('fs');
+const translatte = require('translatte');
+
+if (!fs.existsSync('../data/translator.json')) fs.writeFileSync('../data/translator.json', '{}');
+const cache = require('../data/translator.json');
+
+module.exports = async (text, source, target) => {
+ if (text.trim() === "") return text;
+
+ if (!cache[source]) cache[source] = {};
+ if (!cache[source][text]) cache[source][text] = {};
+
+ if (cache[source][text]) {
+ if (cache[source][text][target]) {
+ return cache[source][text][target];
+ }
+ }
+
+ let success = false;
+ let translated;
+
+ while (!success) {
+ try {
+ translated = (await translatte(text, { from: source, to: target })).text;
+ success = true;
+ } catch (e) {
+ success = false;
+ }
+ }
+
+ cache[source][text][target] = translated;
+ fs.writeFileSync('../data/translator.json', JSON.stringify(cache));
+
+ return translated;
+} \ No newline at end of file
diff --git a/lang/en.json b/lang/en.json
index 348bad7..b583a50 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -24,7 +24,8 @@
},
"oauth2": {
"notfound": "The email address from your Equestria.dev account (%1) is not registered on Delta"
- }
+ },
+ "eqd": "Sign in with"
},
"home": {
"title": "Dashboard",
@@ -1066,7 +1067,15 @@
"reject": "Reject",
"manual": "Manual changes required",
"notify": "Author will be notified of the decision taken",
- "full": "View full request object"
+ "full": "View full request object",
+ "view": [
+ "ID:",
+ "Publish date:",
+ "User:",
+ "Target:",
+ "Summary:",
+ "Not applicable"
+ ]
},
"registrations": {
"nothing": "There are no pending registrations for now.",
@@ -1260,5 +1269,12 @@
"Here is the reason we have provided:"
]
}
+ },
+ "translation": {
+ "none": "This page is in %1 and it is not yet available in %2. A translation will be made available soon, please check back later.",
+ "notice": "This page was originally in %1 and has been automatically translated to %2 about %3. These translations are currently experimental and may not be 100% accurate.",
+ "available": "You are viewing the %1 version of this page, but a version in %2 is available. Note, however, that the translation version may not be 100% accurate.",
+ "original": "View original",
+ "translated": "View translated"
}
} \ No newline at end of file
diff --git a/lang/fr.json b/lang/fr.json
index ffd49f6..b9e7bfa 100644
--- a/lang/fr.json
+++ b/lang/fr.json
@@ -24,7 +24,8 @@
},
"oauth2": {
"notfound": "L'adresse courriel de votre compte Equestria.dev (%1) n'est pas valide sur Delta"
- }
+ },
+ "eqd": "Se connecter avec"
},
"home": {
"title": "Tableau de bord",
@@ -1066,7 +1067,15 @@
"reject": "Rejeter",
"manual": "Des changements manuels sont nécessaires",
"notify": "L'auteur sera notifié de la décision prise",
- "full": "Afficher l'objet de demande complet"
+ "full": "Afficher l'objet de demande complet",
+ "view": [
+ "Identifiant :",
+ "Date de publication :",
+ "Utilisateur :",
+ "Cible :",
+ "Résumé :",
+ "Non applicable"
+ ]
},
"registrations": {
"nothing": "Il n'y a aucun enregistrement en attente pour l'instant.",
diff --git a/login/index.php b/login/index.php
index 672eabc..2db1d41 100644
--- a/login/index.php
+++ b/login/index.php
@@ -84,7 +84,7 @@ if (!isset($_GET["return"])) {
}
if (!isset($_GET["method"])) {
- $_GET["method"] = null;
+ $_GET["method"] = "email";
}
if ($step === 0 && $_GET["method"] === "hub") {
@@ -100,75 +100,62 @@ $title = "lang_login_title"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes
?>
-<div class="container">
-<?php if (isset($_COOKIE["DeltaHandoffPalette"])): $palette = explode(",", $_COOKIE["DeltaHandoffPalette"]); ?>
+<div class="container"> <?php global $palette; ?>
<div style="background-color: #<?= $palette[0] ?>; position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;">
- <div style="background-color: #<?= $palette[2] ?>; padding: 20px; border-radius: 20px; text-align: center; width: 70vw; max-height: 80vh; overflow: auto;">
- <?php else: ?>
- <div style="background-color: var(--bs-secondary); position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;">
- <div style="background-color: var(--bs-white); padding: 20px; border-radius: 20px; text-align: center; width: 70vw; max-height: 80vh; overflow: auto;">
-<?php endif; ?>
+ <div style="background-color: #<?= $palette[2] ?>; padding: 20px; border-radius: 20px; text-align: center; width: 70vw; max-height: 80vh; overflow: auto; max-width: 500px;">
<?php if ($step < 2): ?>
- <?php if (!isset($_GET["method"])): ?>
- <img src="/logo.svg" style="width: 48px; margin-bottom: 10px;">
- <p><b><?= l("lang_login_oobe") ?></b></p>
- <p><?= l("lang_login_oobe2") ?></p>
-
- <?php if (trim($error) !== ""): ?>
- <div class="alert alert-danger"><?= str_replace("%1", strip_tags($_GET["v"] ?? "-"), l($error)) ?></div>
- <?php endif; ?>
-
- <div class="list-group" style="max-width: 400px; margin-left: auto; margin-right: auto;">
- <a class="list-group-item list-group-item-action list-group-item-primary" href="/login/?method=email&return=<?= rawurlencode($_GET["return"]) ?>"><?= l("lang_login_auth_email") ?></a>
- <?php if (!isset($_COOKIE["DeltaHandoffPalette"])): ?>
- <a class="list-group-item list-group-item-action" href="/login/?method=hub&return=<?= rawurlencode($_GET["return"]) ?>"><?= l("lang_login_auth_hub") ?></a>
- <a class="list-group-item list-group-item-action" href="/login/?method=apply&return=<?= rawurlencode($_GET["return"]) ?>"><?= l("lang_login_auth_apply") ?></a>
- <?php endif; ?>
- </div>
- <?php elseif ($step === 0): ?>
- <img src="/icons/email.svg" style="width: 48px; margin-bottom: 10px;">
- <p><b><?= l("lang_login_email2") ?></b></p>
- <p><?= l("lang_login_intro") ?></p>
-
- <?php if (trim($error) !== ""): ?>
- <div class="alert alert-danger"><?= l($error) ?></div>
- <?php endif; ?>
-
- <form method="post">
- <input type="hidden" name="p" value="1">
-
- <p>
- <label>
- <input style="text-align: left;" autocomplete="off" spellcheck="off" required name="email" type="email" placeholder="<?= l("lang_login_email") ?>" class="form-control" autofocus>
- </label>
- </p>
-
- <input type="submit" class="btn btn-primary" value="<?= l("lang_login_continue") ?>">
- </form>
- <?php elseif ($step === 1): ?>
- <img src="/icons/code.svg" style="width: 48px; margin-bottom: 10px;">
- <p><b><?= l("lang_login_code3") ?></b></p>
- <p><?= str_replace('%1', '<b>' . strip_tags($_POST["email"]) . '</b>', l("lang_login_code")) ?></p>
-
- <?php if (trim($error) !== ""): ?>
- <div class="alert alert-danger"><?= l($error) ?></div>
- <?php endif; ?>
-
- <form method="post">
- <input type="hidden" name="p" value="2">
- <input name="email" type="hidden" value="<?= $_POST["email"] ?>">
-
- <p>
- <label>
- <input style="text-align: left;" autocomplete="off" spellcheck="off" required name="code" type="number" maxlength="10" minlength="10" placeholder="<?= l("lang_login_code2") ?>" class="form-control" autofocus>
- </label>
- </p>
-
- <input type="submit" class="btn btn-primary" value="<?= l("lang_login_continue") ?>">
- </form>
- <?php endif; ?>
+ <?php if ((!isset($_GET["method"]) || $_GET["method"] === "email") && $step === 0): ?>
+ <img src="/logo.svg" style="width: 48px; margin-bottom: 10px;">
+ <p><b><?= l("lang_login_oobe") ?></b></p>
+ <p><?= l("lang_login_oobe2") ?></p>
+
+ <?php if (trim($error) !== ""): ?>
+ <div class="alert alert-danger"><?= str_replace("%1", strip_tags($_GET["v"] ?? "-"), l($error)) ?></div>
+ <?php endif; ?>
+
+ <form method="post">
+ <input type="hidden" name="p" value="1">
+
+ <p>
+ <label>
+ <input style="text-align: left;" autocomplete="off" spellcheck="off" required name="email" type="email" placeholder="<?= l("lang_login_email") ?>" class="form-control" autofocus>
+ </label>
+ </p>
+
+ <input type="submit" class="btn btn-primary" value="<?= l("lang_login_continue") ?>">
+ </form>
+
+ <?php if (!isset($_COOKIE["DeltaHandoffPalette"])): ?>
+ <hr>
+ <div style="margin-top: 20px;">
+ <a class="btn btn-outline-secondary" href="/login/?method=hub&return=<?= rawurlencode($_GET["return"]) ?>"><span style="vertical-align: middle; margin-right: 2px;"><?= l("lang_login_eqd") ?></span><img style="height: 36px;" alt="Equestria.dev" src="/equestriadev.svg"></a>
+ <a style="display: block; margin-top: 5px;" href="/login/?method=apply&return=<?= rawurlencode($_GET["return"]) ?>"><?= l("lang_login_auth_apply") ?></a>
+ </div>
+ <?php endif; ?>
+ <?php elseif ($step === 1): ?>
+ <img src="/icons/code.svg?o" style="width: 48px; margin-bottom: 10px;">
+ <p><b><?= l("lang_login_code3") ?></b></p>
+ <p><?= str_replace('%1', '<b>' . strip_tags($_POST["email"]) . '</b>', l("lang_login_code")) ?></p>
+
+ <?php if (trim($error) !== ""): ?>
+ <div class="alert alert-danger"><?= l($error) ?></div>
+ <?php endif; ?>
+
+ <form method="post">
+ <input type="hidden" name="p" value="2">
+ <input name="email" type="hidden" value="<?= $_POST["email"] ?>">
+
+ <p>
+ <label>
+ <input style="text-align: left;" autocomplete="off" spellcheck="off" required name="code" type="number" maxlength="10" minlength="10" placeholder="<?= l("lang_login_code2") ?>" class="form-control" autofocus>
+ </label>
+ </p>
+
+ <input type="submit" class="btn btn-primary" value="<?= l("lang_login_continue") ?>">
+ </form>
+ <?php endif; ?>
<?php else: global $_USER; $user = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/profiles/" . $_USER . ".json")), true); ?>
- <img src="/icons/finish.svg" style="width: 48px; margin-bottom: 10px;">
+ <img src="/icons/finish.svg?o" style="width: 48px; margin-bottom: 10px;">
<p><b><?= str_replace('%1', $user["nick_name"] ?? $user["first_name"] . " " . $user["last_name"], l("lang_login_back")) ?></b></p>
<p><?= l("lang_login_done") ?></p>
<a href="<?= str_replace('"', '&quot;', $_GET["return"]) ?>" class="btn btn-primary"><?= l("lang_login_finish") ?></a>