diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 612c435f..d714ffdf 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -12,7 +12,7 @@ module.exports = { parserOptions: { project: ["./tsconfig.json"] }, - ignorePatterns: ["scripts/**/*", "src-tauri/**/*", "plugins/**/*"], + ignorePatterns: ["scripts/**/*", "plugin-runtime/**/*", "src-tauri/**/*", "plugins/**/*"], settings: { react: { version: "detect" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1bf250bb..e467ee97 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,9 @@ on: push: tags: [ v* ] +env: + YAAK_PLUGINS_DIR: ./checkout/plugins + jobs: build-artifacts: permissions: @@ -27,6 +30,11 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 + - name: Checkout plugins repo + uses: actions/checkout@v4 + with: + repository: yaakapp/plugins + path: $YAAK_PLUGINS_DIR - name: install Rust stable uses: dtolnay/rust-toolchain@stable with: @@ -50,6 +58,8 @@ jobs: sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf - name: Install dependencies run: npm ci + - name: Build plugins + run: node scrips/copy-plugins.cjs - name: Run lint run: npm run lint - name: Run tests diff --git a/.gitignore b/.gitignore index 05eba812..350aa951 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,3 @@ dist-ssr *.sqlite-* .cargo -plugins/**/build diff --git a/package-lock.json b/package-lock.json index 7cdae75f..43835d19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,6 +68,7 @@ "@typescript-eslint/parser": "^7.0.2", "@vitejs/plugin-react": "^4.2.1", "autoprefixer": "^10.4.13", + "decompress": "^4.2.1", "eslint": "^8.34.0", "eslint-config-prettier": "^8.6.0", "eslint-plugin-import": "^2.27.5", @@ -77,11 +78,13 @@ "husky": "^8.0.3", "internal-ip": "^8.0.0", "lint-staged": "^15.0.2", + "nodejs-file-downloader": "^4.13.0", "npm-run-all": "^4.1.5", "postcss": "^8.4.21", "postcss-nesting": "^11.2.1", "prettier": "^2.8.4", "react-devtools": "^4.27.2", + "rimraf": "^5.0.7", "tailwindcss": "^3.2.7", "typescript": "^5.4.5", "vite": "^5.0.0", @@ -1448,6 +1451,22 @@ "semver": "bin/semver.js" } }, + "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3124,7 +3143,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "optional": true, + "devOptional": true, "dependencies": { "debug": "4" }, @@ -3577,6 +3596,52 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bl": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", + "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", + "dev": true, + "dependencies": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/bl/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/bl/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/bl/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/boolean": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", @@ -3719,6 +3784,22 @@ "ieee754": "^1.2.1" } }, + "node_modules/buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, + "dependencies": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "node_modules/buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -3728,6 +3809,12 @@ "node": "*" } }, + "node_modules/buffer-fill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==", + "dev": true + }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -4329,6 +4416,12 @@ "toggle-selection": "^1.0.6" } }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, "node_modules/cosmiconfig": { "version": "8.3.6", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", @@ -4544,6 +4637,25 @@ "node": ">=0.10.0" } }, + "node_modules/decompress": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.1.tgz", + "integrity": "sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ==", + "dev": true, + "dependencies": { + "decompress-tar": "^4.0.0", + "decompress-tarbz2": "^4.0.0", + "decompress-targz": "^4.0.0", + "decompress-unzip": "^4.0.1", + "graceful-fs": "^4.1.10", + "make-dir": "^1.0.0", + "pify": "^2.3.0", + "strip-dirs": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -4571,6 +4683,141 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/decompress-tar": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", + "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", + "dev": true, + "dependencies": { + "file-type": "^5.2.0", + "is-stream": "^1.1.0", + "tar-stream": "^1.5.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/decompress-tar/node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress-tarbz2": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", + "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", + "dev": true, + "dependencies": { + "decompress-tar": "^4.1.0", + "file-type": "^6.1.0", + "is-stream": "^1.1.0", + "seek-bzip": "^1.0.5", + "unbzip2-stream": "^1.0.9" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/decompress-tarbz2/node_modules/file-type": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", + "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/decompress-tarbz2/node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress-targz": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", + "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", + "dev": true, + "dependencies": { + "decompress-tar": "^4.1.1", + "file-type": "^5.2.0", + "is-stream": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/decompress-targz/node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress-unzip": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", + "integrity": "sha512-1fqeluvxgnn86MOh66u8FjbtJpAFv5wgCT9Iw8rcBqQcCo5tO8eiJw7NNTrvt9n4CRBVq7CstiS922oPgyGLrw==", + "dev": true, + "dependencies": { + "file-type": "^3.8.0", + "get-stream": "^2.2.0", + "pify": "^2.3.0", + "yauzl": "^2.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/decompress-unzip/node_modules/file-type": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", + "integrity": "sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress-unzip/node_modules/get-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", + "integrity": "sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA==", + "dev": true, + "dependencies": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress-unzip/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/deep-eql": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", @@ -5841,6 +6088,15 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/file-type": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", + "integrity": "sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -5882,6 +6138,22 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", @@ -5910,6 +6182,26 @@ "react-dom": ">=16.3.0" } }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -5996,6 +6288,12 @@ "react-dom": "^18.0.0" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true + }, "node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -6575,7 +6873,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "optional": true, + "devOptional": true, "dependencies": { "agent-base": "6", "debug": "4" @@ -7025,6 +7323,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-natural-number": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", + "integrity": "sha512-Y4LTamMe0DDQIIAlaer9eKebAlDSV6huy+TWhJVPlzZh2o4tRP5SQWFlLn5N0To4mDD22/qdOq+veo1cSISLgQ==", + "dev": true + }, "node_modules/is-negative-zero": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", @@ -7952,6 +8256,27 @@ "node": ">=16" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -7997,9 +8322,9 @@ } }, "node_modules/minipass": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.0.tgz", - "integrity": "sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "engines": { "node": ">=16 || 14 >=14.17" } @@ -8195,6 +8520,18 @@ "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, + "node_modules/nodejs-file-downloader": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/nodejs-file-downloader/-/nodejs-file-downloader-4.13.0.tgz", + "integrity": "sha512-nI2fKnmJWWFZF6SgMPe1iBodKhfpztLKJTtCtNYGhm/9QXmWa/Pk9Sv00qHgzEvNLe1x7hjGDRor7gcm/ChaIQ==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "https-proxy-agent": "^5.0.0", + "mime-types": "^2.1.27", + "sanitize-filename": "^1.6.3" + } + }, "node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -8702,6 +9039,12 @@ "node": ">=4" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true + }, "node_modules/package-json/node_modules/get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -8845,15 +9188,15 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-scurry": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", - "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -8955,6 +9298,27 @@ "node": ">=4" } }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "dev": true, + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/pirates": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", @@ -9205,6 +9569,12 @@ "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -9861,20 +10231,58 @@ "dev": true }, "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "devOptional": true, + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.9.tgz", + "integrity": "sha512-3i7b8OcswU6CpU8Ej89quJD4O98id7TtVM5U4Mybh84zQXdrFmDLouWBEEaD/QfO3gDDfH+AGFCGsR7kngzQnA==", + "dev": true, "dependencies": { - "glob": "^7.1.3" + "glob": "^10.3.7" }, "bin": { - "rimraf": "bin.js" + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "14 >=14.20 || 16 >=16.20 || >=18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rimraf/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/roarr": { "version": "2.15.4", "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", @@ -10013,6 +10421,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/sanitize-filename": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", + "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", + "dev": true, + "dependencies": { + "truncate-utf8-bytes": "^1.0.0" + } + }, "node_modules/scheduler": { "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", @@ -10032,6 +10449,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/seek-bzip": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz", + "integrity": "sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==", + "dev": true, + "dependencies": { + "commander": "^2.8.1" + }, + "bin": { + "seek-bunzip": "bin/seek-bunzip", + "seek-table": "bin/seek-bzip-table" + } + }, + "node_modules/seek-bzip/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, "node_modules/semver": { "version": "7.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", @@ -10671,6 +11107,15 @@ "node": ">=4" } }, + "node_modules/strip-dirs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", + "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", + "dev": true, + "dependencies": { + "is-natural-number": "^4.0.1" + } + }, "node_modules/strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", @@ -10924,6 +11369,60 @@ "node": ">=10" } }, + "node_modules/tar-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", + "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "dev": true, + "dependencies": { + "bl": "^1.0.0", + "buffer-alloc": "^1.2.0", + "end-of-stream": "^1.0.0", + "fs-constants": "^1.0.0", + "readable-stream": "^2.3.0", + "to-buffer": "^1.1.1", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/tar-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/tar-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/tar-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/tar-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/tar/node_modules/minipass": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", @@ -11110,6 +11609,12 @@ "node": ">=10" } }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, "node_modules/time-span": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/time-span/-/time-span-5.1.0.tgz", @@ -11168,6 +11673,12 @@ "node": ">=14.0.0" } }, + "node_modules/to-buffer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", + "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", + "dev": true + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -11198,6 +11709,15 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, + "node_modules/truncate-utf8-bytes": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", + "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", + "dev": true, + "dependencies": { + "utf8-byte-length": "^1.0.1" + } + }, "node_modules/ts-api-utils": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", @@ -11390,6 +11910,40 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "dev": true, + "dependencies": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, + "node_modules/unbzip2-stream/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -11506,6 +12060,12 @@ "node": ">=0.10.0" } }, + "node_modules/utf8-byte-length": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", + "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", + "dev": true + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -12260,6 +12820,15 @@ "node": ">= 14" } }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, "node_modules/y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", diff --git a/package.json b/package.json index c8abf180..70983ffd 100644 --- a/package.json +++ b/package.json @@ -9,20 +9,13 @@ "tauri-dev:ios": "tauri ios dev --force-ip-prompt --config ./src-tauri/tauri-dev.conf.json", "tauri-build": "tauri build", "tauri": "tauri", - "build": "npm run build:frontend", - "dev": "vite dev", + "dev:js": "vite dev", "lint": "tsc && eslint . --ext .ts,.tsx", "build:icon:release": "tauri icon design/icon.png --output ./src-tauri/icons/release", "build:icon:dev": "tauri icon design/icon-dev.png --output ./src-tauri/icons/dev", - "build:frontend": "vite build", - "build:plugins": "run-p build:plugin:*", - "build:plugin:exporter-curl": "cd plugins/exporter-curl && vite build --emptyOutDir", - "build:plugin:importer-insomnia": "cd plugins/importer-insomnia && vite build --emptyOutDir", - "build:plugin:importer-postman": "cd plugins/importer-postman && vite build --emptyOutDir", - "build:plugin:importer-yaak": "cd plugins/importer-yaak && vite build --emptyOutDir", - "build:plugin:importer-curl": "cd plugins/importer-curl && vite build --emptyOutDir", - "build:plugin:filter-jsonpath": "cd plugins/filter-jsonpath && vite build --emptyOutDir", - "build:plugin:filter-xpath": "cd plugins/filter-xpath && vite build --emptyOutDir", + "build": "run-p build:*", + "build:js": "vite build", + "build:plugin-runtime": "npm run --prefix plugin-runtime build && node scripts/copy-plugins.cjs", "test": "vitest", "coverage": "vitest run --coverage", "prepare": "husky install", @@ -107,6 +100,9 @@ "typescript": "^5.4.5", "vite": "^5.0.0", "vite-plugin-static-copy": "^1.0.5", + "decompress": "^4.2.1", + "nodejs-file-downloader": "^4.13.0", + "rimraf": "^5.0.7", "vite-plugin-svgr": "^4.2.0", "vite-plugin-top-level-await": "^1.4.1", "vitest": "^1.3.0" diff --git a/plugin-runtime/.gitignore b/plugin-runtime/.gitignore new file mode 100644 index 00000000..e3fbd983 --- /dev/null +++ b/plugin-runtime/.gitignore @@ -0,0 +1,2 @@ +build +node_modules diff --git a/plugin-runtime/nodemon.json b/plugin-runtime/nodemon.json new file mode 100644 index 00000000..b819ba41 --- /dev/null +++ b/plugin-runtime/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": ["src"], + "ext": "ts", + "exec": "node -r ts-node/register ./src/index.ts" +} diff --git a/plugin-runtime/package-lock.json b/plugin-runtime/package-lock.json new file mode 100644 index 00000000..ef045f27 --- /dev/null +++ b/plugin-runtime/package-lock.json @@ -0,0 +1,3004 @@ +{ + "name": "@yaak/plugin-runtime", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@yaak/plugin-runtime", + "dependencies": { + "long": "^5.2.3", + "nice-grpc": "^2.1.9", + "protobufjs": "^7.3.2" + }, + "devDependencies": { + "grpc-tools": "^1.12.4", + "nodemon": "^3.1.4", + "npm-run-all": "^4.1.5", + "ts-node": "^10.9.2", + "ts-proto": "^1.180.0", + "typescript": "^5.5.2" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.10.9", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.9.tgz", + "integrity": "sha512-5tcgUctCG0qoNyfChZifz2tJqbRbXVO9J7X6duFcOjY3HUNCxg5D0ZCK7EP9vIcZ0zRpLU9bWkyCqVCLZ46IbQ==", + "dependencies": { + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", + "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "dev": true, + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.14.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.7.tgz", + "integrity": "sha512-uTr2m2IbJJucF3KUxgnGOZvYbN0QgkGyWxG6973HCpMYFy2KfcgYuIwkJQMQkt1VbBMlvWRbpshFTLxnxCZjKQ==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "node_modules/abort-controller-x": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/abort-controller-x/-/abort-controller-x-0.4.3.tgz", + "integrity": "sha512-VtUwTNU8fpMwvWGn4xE93ywbogTYsuT+AUxAXOeelbXuQVIwNmC5YLeho9sH4vZ4ITW8414TTAOG1nW6uIVHCA==" + }, + "node_modules/acorn": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", + "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", + "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", + "dev": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/case-anything": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz", + "integrity": "sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==", + "dev": true, + "engines": { + "node": ">=12.13" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/chalk/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "dev": true + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/cross-spawn/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dprint-node": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.8.tgz", + "integrity": "sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg==", + "dev": true, + "dependencies": { + "detect-libc": "^1.0.3" + } + }, + "node_modules/dprint-node/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", + "dev": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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==", + "dev": true, + "license": "ISC" + }, + "node_modules/grpc-tools": { + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/grpc-tools/-/grpc-tools-1.12.4.tgz", + "integrity": "sha512-5+mLAJJma3BjnW/KQp6JBjUMgvu7Mu3dBvBPd1dcbNIb+qiR0817zDpgPjS7gRb+l/8EVNIa3cB02xI9JLToKg==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.5" + }, + "bin": { + "grpc_tools_node_protoc": "bin/protoc.js", + "grpc_tools_node_protoc_plugin": "bin/protoc_plugin.js" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true, + "license": "ISC" + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nice-grpc": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/nice-grpc/-/nice-grpc-2.1.9.tgz", + "integrity": "sha512-shJlg1t4Wn3qTVE31gxofbTrgCX/p4tS1xRnk4bNskCYKvXNEUpJQZpjModsVk1aau69YZDViyC18K9nC7QHYA==", + "dependencies": { + "@grpc/grpc-js": "^1.10.8", + "abort-controller-x": "^0.4.0", + "nice-grpc-common": "^2.0.2" + } + }, + "node_modules/nice-grpc-common": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/nice-grpc-common/-/nice-grpc-common-2.0.2.tgz", + "integrity": "sha512-7RNWbls5kAL1QVUOXvBsv1uO0wPQK3lHv+cY1gwkTzirnG1Nop4cBJZubpgziNbaVc/bl9QJcyvsf/NQxa3rjQ==", + "dependencies": { + "ts-error": "^1.0.6" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/nodemon": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.4.tgz", + "integrity": "sha512-wjPBbFhtpJwmIeY2yP7QF+UKzPfltVGtfce1g/bB15/8vCGZj8uxD62b/b9M9/WVgme0NZudpownKN+c0plXlQ==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/npm-run-all/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", + "dev": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/protobufjs": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz", + "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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==", + "dev": true + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", + "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.padend": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/ts-error": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/ts-error/-/ts-error-1.0.6.tgz", + "integrity": "sha512-tLJxacIQUM82IR7JO1UUkKlYuUTmoY9HBJAmNWFzheSlDS5SPMcNIepejHJa4BpPQLAcbRhRf3GDJzyj6rbKvA==" + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-poet": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-6.9.0.tgz", + "integrity": "sha512-roe6W6MeZmCjRmppyfOURklO5tQFQ6Sg7swURKkwYJvV7dbGCrK28um5+51iW3twdPRKtwarqFAVMU6G1mvnuQ==", + "dev": true, + "dependencies": { + "dprint-node": "^1.0.8" + } + }, + "node_modules/ts-proto": { + "version": "1.180.0", + "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.180.0.tgz", + "integrity": "sha512-Gx+y1ohKNitnBpoA4ELRPl2nHBa4zUkedj3kHKuwYn0THpLiLVLuzYidlqJVZBDooI+l/EROGGqlCt95FItI9g==", + "dev": true, + "dependencies": { + "case-anything": "^2.1.13", + "protobufjs": "^7.2.4", + "ts-poet": "^6.7.0", + "ts-proto-descriptors": "1.16.0" + }, + "bin": { + "protoc-gen-ts_proto": "protoc-gen-ts_proto" + } + }, + "node_modules/ts-proto-descriptors": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.16.0.tgz", + "integrity": "sha512-3yKuzMLpltdpcyQji1PJZRfoo4OJjNieKTYkQY8pF7xGKsYz/RHe3aEe4KiRxcinoBmnEhmuI+yJTxLb922ULA==", + "dev": true, + "dependencies": { + "long": "^5.2.3", + "protobufjs": "^7.2.4" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "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==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + } + } +} diff --git a/plugin-runtime/package.json b/plugin-runtime/package.json new file mode 100644 index 00000000..4e8cc981 --- /dev/null +++ b/plugin-runtime/package.json @@ -0,0 +1,23 @@ +{ + "name": "@yaak/plugin-runtime", + "scripts": { + "dev": "nodemon", + "build": "run-p build:* && node scripts/generate-sea.cjs", + "build:main": "esbuild src/index.ts --bundle --platform=node --outfile=build/index.js", + "build:worker": "esbuild src/index.worker.ts --bundle --platform=node --outfile=build/index.worker.js", + "build:proto": "./node_modules/.bin/grpc_tools_node_protoc --ts_proto_out=./src/gen --ts_proto_opt=outputServices=nice-grpc,outputServices=generic-definitions,useExactTypes=false --proto_path=../proto ../proto/plugins/*.proto" + }, + "dependencies": { + "long": "^5.2.3", + "nice-grpc": "^2.1.9", + "protobufjs": "^7.3.2" + }, + "devDependencies": { + "grpc-tools": "^1.12.4", + "nodemon": "^3.1.4", + "npm-run-all": "^4.1.5", + "ts-node": "^10.9.2", + "ts-proto": "^1.180.0", + "typescript": "^5.5.2" + } +} diff --git a/plugin-runtime/scripts/generate-sea.cjs b/plugin-runtime/scripts/generate-sea.cjs new file mode 100644 index 00000000..eb718a6d --- /dev/null +++ b/plugin-runtime/scripts/generate-sea.cjs @@ -0,0 +1,66 @@ +const path = require('node:path'); +const {execSync} = require('node:child_process'); +const {tmpdir} = require('node:os'); +const {cpSync, mkdirSync, chmodSync, unlinkSync} = require('node:fs'); +const pluginRuntimeDir = path.join(__dirname, '..'); +const destDir = path.join(__dirname, '..', '..', 'src-tauri', 'vendored', 'plugin-runtime'); +const blobPath = path.join(pluginRuntimeDir, 'yaak-plugins.blob'); + +const DST_BIN_MAP = { + darwin_arm64: 'yaakplugins-aarch64-apple-darwin', + darwin_x64: 'yaakplugins-x86_64-apple-darwin', + linux_x64: 'yaakplugins-x86_64-unknown-linux-gnu', + win32: 'yaakplugins-x86_64-pc-windows-msvc.exe', +}; + +// Build the sea +console.log('Building SEA blob'); +execSync('node --experimental-sea-config sea-config.json', {cwd: pluginRuntimeDir}); + +const tmp = path.join(tmpdir(), new Date().toISOString()); +mkdirSync(tmp); + +let tmpNodePath = process.platform === 'win32' ? path.join(tmp, 'node.exe') : path.join(tmp, 'node'); + +console.log('Copying Node.js binary'); +cpSync(process.execPath, tmpNodePath); + +console.log('Changing Node.js binary permissions'); +chmodSync(tmpNodePath, 0o755); + +console.log('Removing Node.js code signature'); +try { + if (process.platform === 'darwin') execSync(`codesign --remove-signature ${tmpNodePath}`); + else if (process.platform === 'win32') execSync(`signtool remove /s ${tmpNodePath}`); + /* Nothing for Linux */ +} catch (err) { + console.log('Failed remove signature', err); + process.exit(1); +} + +try { + console.log('Injecting sea blob into Node.js'); + if (process.platform === 'win32') execSync(`npx postject ${tmpNodePath} NODE_SEA_BLOB ${blobPath} --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2`); + else if (process.platform === 'darwin') execSync(`npx postject ${tmpNodePath} NODE_SEA_BLOB ${blobPath} --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA`); + else if (process.platform === 'linux') execSync(`npx postject ${tmpNodePath} NODE_SEA_BLOB ${blobPath} --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2`); +} catch (err) { + console.log('Failed to inject blob', err.stdout.toString()); + process.exit(1); +} + +unlinkSync(blobPath); + +console.log('Re-signing Node.js'); +try { + if (process.platform === 'darwin') execSync(`codesign --sign - ${tmpNodePath}`); + else if (process.platform === 'win32') execSync(`signtool sign /fd SHA256 ${tmpNodePath}`); + /* Nothing for Linux */ +} catch (err) { + console.log('Failed sign', err); + process.exit(1); +} + +const dstPath = path.join(destDir, DST_BIN_MAP[`${process.platform}_${process.arch}`]); +cpSync(tmpNodePath, dstPath); + +console.log(`Copied sea to ${dstPath}`) diff --git a/plugin-runtime/sea-config.json b/plugin-runtime/sea-config.json new file mode 100644 index 00000000..83bb5d19 --- /dev/null +++ b/plugin-runtime/sea-config.json @@ -0,0 +1,8 @@ +{ + "main": "build/index.js", + "disableExperimentalSEAWarning": true, + "output": "yaak-plugins.blob", + "assets": { + "worker": "build/index.worker.js" + } +} diff --git a/plugin-runtime/src/PluginHandle.ts b/plugin-runtime/src/PluginHandle.ts new file mode 100644 index 00000000..b80223f5 --- /dev/null +++ b/plugin-runtime/src/PluginHandle.ts @@ -0,0 +1,90 @@ +import { randomUUID } from 'node:crypto'; +import { Worker } from 'node:worker_threads'; +import { PluginInfo } from './plugins'; + +export interface ParentToWorkerEvent { + callbackId: string; + name: string; + payload: T; +} + +export type WorkerToParentSuccessEvent = { + callbackId: string; + payload: T; +}; + +export type WorkerToParentErrorEvent = { + callbackId: string; + error: string; +}; + +export type WorkerToParentEvent = WorkerToParentErrorEvent | WorkerToParentSuccessEvent; + +export class PluginHandle { + readonly pluginDir: string; + readonly #worker: Worker; + + constructor({ pluginDir, workerJsPath }: { pluginDir: string; workerJsPath: string }) { + this.pluginDir = pluginDir; + + this.#worker = new Worker(workerJsPath, { + workerData: { + pluginDir: this.pluginDir, + }, + }); + + this.#worker.on('error', this.#handleError.bind(this)); + this.#worker.on('exit', this.#handleExit.bind(this)); + } + + async getInfo(): Promise { + return this.#callPlugin('info', null); + } + + async runResponseFilter({ filter, body }: { filter: string; body: string }): Promise { + return this.#callPlugin('run-filter', { filter, body }); + } + + async runExport(request: any): Promise { + return this.#callPlugin('run-export', request); + } + + async runImport(data: string): Promise { + const result = await this.#callPlugin('run-import', data); + + // Plugin returns object, but we convert to string + return JSON.stringify(result, null, 2); + } + + #callPlugin(name: string, payload: P): Promise { + const callbackId = `cb_${randomUUID().replaceAll('-', '')}`; + return new Promise((resolve, reject) => { + const cb = (e: WorkerToParentEvent) => { + if (e.callbackId !== callbackId) return; + + if ('error' in e) { + reject(e.error); + } else { + resolve(e.payload as R); + } + + this.#worker.removeListener('message', cb); + }; + + this.#worker.addListener('message', cb); + this.#worker.postMessage({ callbackId, name, payload }); + }); + } + + async #handleError(err: Error) { + console.error('PLUGIN ERROR', this.pluginDir, err); + } + + async #handleExit(code: number) { + if (code === 0) { + console.log('PLUGIN EXITED SUCCESSFULLY'); + } else { + console.log('PLUGIN EXITED CODE', code); + } + } +} diff --git a/plugin-runtime/src/PluginManager.ts b/plugin-runtime/src/PluginManager.ts new file mode 100644 index 00000000..59bd149b --- /dev/null +++ b/plugin-runtime/src/PluginManager.ts @@ -0,0 +1,61 @@ +import { existsSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import path from 'node:path'; +import { getAsset } from 'node:sea'; +import { PluginHandle } from './PluginHandle'; +import { loadPlugins, PluginInfo } from './plugins'; + +export class PluginManager { + #handles: PluginHandle[] | null = null; + static #instance: PluginManager | null = null; + static #workerPath = path.join(tmpdir(), `index.${Math.random()}.worker.js`); + + public static instance(): PluginManager { + if (PluginManager.#instance == null) { + PluginManager.#instance = new PluginManager(); + PluginManager.#instance.plugins(); // Trigger workers to boot, as it takes a few seconds + } + return PluginManager.#instance; + } + + async plugins(): Promise { + await this.#ensureWorkerForSea(); + this.#handles = this.#handles ?? loadPlugins(PluginManager.#workerPath); + return this.#handles; + } + + /** + * Copy worker JS asset to filesystem if we're in single-executable-application (SEA) + * @private + */ + async #ensureWorkerForSea() { + if (existsSync(PluginManager.#workerPath)) return; + + console.log('Writing worker file to', PluginManager.#workerPath); + writeFileSync(PluginManager.#workerPath, getAsset('worker', 'utf8')); + } + + async #pluginsWithInfo(): Promise<{ plugin: PluginHandle; info: PluginInfo }[]> { + const plugins = await this.plugins(); + return Promise.all(plugins.map(async (plugin) => ({ plugin, info: await plugin.getInfo() }))); + } + + async pluginsWith(capability: PluginInfo['capabilities'][0]): Promise { + return (await this.#pluginsWithInfo()) + .filter((v) => v.info.capabilities.includes(capability)) + .map((v) => v.plugin); + } + + async plugin(name: string): Promise { + return (await this.#pluginsWithInfo()).find((v) => v.info.name === name)?.plugin ?? null; + } + + async pluginOrThrow(name: string): Promise { + const plugin = await this.plugin(name); + if (plugin == null) { + throw new Error(`Failed to find plugin by ${name}`); + } + + return plugin; + } +} diff --git a/plugin-runtime/src/gen/plugins/runtime.ts b/plugin-runtime/src/gen/plugins/runtime.ts new file mode 100644 index 00000000..a3dad4fb --- /dev/null +++ b/plugin-runtime/src/gen/plugins/runtime.ts @@ -0,0 +1,432 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v1.180.0 +// protoc v3.19.1 +// source: plugins/runtime.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import * as _m0 from "protobufjs/minimal"; + +export const protobufPackage = "yaak.plugins.runtime"; + +export interface PluginInfo { + plugin: string; +} + +export interface HookResponse { + info: PluginInfo | undefined; + data: string; +} + +export interface HookImportRequest { + data: string; +} + +export interface HookResponseFilterRequest { + filter: string; + body: string; + contentType: string; +} + +export interface HookExportRequest { + request: string; +} + +function createBasePluginInfo(): PluginInfo { + return { plugin: "" }; +} + +export const PluginInfo = { + encode(message: PluginInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.plugin !== "") { + writer.uint32(10).string(message.plugin); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PluginInfo { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePluginInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.plugin = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): PluginInfo { + return { plugin: isSet(object.plugin) ? globalThis.String(object.plugin) : "" }; + }, + + toJSON(message: PluginInfo): unknown { + const obj: any = {}; + if (message.plugin !== "") { + obj.plugin = message.plugin; + } + return obj; + }, + + create(base?: DeepPartial): PluginInfo { + return PluginInfo.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PluginInfo { + const message = createBasePluginInfo(); + message.plugin = object.plugin ?? ""; + return message; + }, +}; + +function createBaseHookResponse(): HookResponse { + return { info: undefined, data: "" }; +} + +export const HookResponse = { + encode(message: HookResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.info !== undefined) { + PluginInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== "") { + writer.uint32(18).string(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HookResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.info = PluginInfo.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.data = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): HookResponse { + return { + info: isSet(object.info) ? PluginInfo.fromJSON(object.info) : undefined, + data: isSet(object.data) ? globalThis.String(object.data) : "", + }; + }, + + toJSON(message: HookResponse): unknown { + const obj: any = {}; + if (message.info !== undefined) { + obj.info = PluginInfo.toJSON(message.info); + } + if (message.data !== "") { + obj.data = message.data; + } + return obj; + }, + + create(base?: DeepPartial): HookResponse { + return HookResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HookResponse { + const message = createBaseHookResponse(); + message.info = (object.info !== undefined && object.info !== null) + ? PluginInfo.fromPartial(object.info) + : undefined; + message.data = object.data ?? ""; + return message; + }, +}; + +function createBaseHookImportRequest(): HookImportRequest { + return { data: "" }; +} + +export const HookImportRequest = { + encode(message: HookImportRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data !== "") { + writer.uint32(10).string(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HookImportRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHookImportRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.data = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): HookImportRequest { + return { data: isSet(object.data) ? globalThis.String(object.data) : "" }; + }, + + toJSON(message: HookImportRequest): unknown { + const obj: any = {}; + if (message.data !== "") { + obj.data = message.data; + } + return obj; + }, + + create(base?: DeepPartial): HookImportRequest { + return HookImportRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HookImportRequest { + const message = createBaseHookImportRequest(); + message.data = object.data ?? ""; + return message; + }, +}; + +function createBaseHookResponseFilterRequest(): HookResponseFilterRequest { + return { filter: "", body: "", contentType: "" }; +} + +export const HookResponseFilterRequest = { + encode(message: HookResponseFilterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.filter !== "") { + writer.uint32(10).string(message.filter); + } + if (message.body !== "") { + writer.uint32(18).string(message.body); + } + if (message.contentType !== "") { + writer.uint32(26).string(message.contentType); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HookResponseFilterRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHookResponseFilterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filter = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.body = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.contentType = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): HookResponseFilterRequest { + return { + filter: isSet(object.filter) ? globalThis.String(object.filter) : "", + body: isSet(object.body) ? globalThis.String(object.body) : "", + contentType: isSet(object.contentType) ? globalThis.String(object.contentType) : "", + }; + }, + + toJSON(message: HookResponseFilterRequest): unknown { + const obj: any = {}; + if (message.filter !== "") { + obj.filter = message.filter; + } + if (message.body !== "") { + obj.body = message.body; + } + if (message.contentType !== "") { + obj.contentType = message.contentType; + } + return obj; + }, + + create(base?: DeepPartial): HookResponseFilterRequest { + return HookResponseFilterRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HookResponseFilterRequest { + const message = createBaseHookResponseFilterRequest(); + message.filter = object.filter ?? ""; + message.body = object.body ?? ""; + message.contentType = object.contentType ?? ""; + return message; + }, +}; + +function createBaseHookExportRequest(): HookExportRequest { + return { request: "" }; +} + +export const HookExportRequest = { + encode(message: HookExportRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.request !== "") { + writer.uint32(10).string(message.request); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HookExportRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHookExportRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.request = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): HookExportRequest { + return { request: isSet(object.request) ? globalThis.String(object.request) : "" }; + }, + + toJSON(message: HookExportRequest): unknown { + const obj: any = {}; + if (message.request !== "") { + obj.request = message.request; + } + return obj; + }, + + create(base?: DeepPartial): HookExportRequest { + return HookExportRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HookExportRequest { + const message = createBaseHookExportRequest(); + message.request = object.request ?? ""; + return message; + }, +}; + +export type PluginRuntimeDefinition = typeof PluginRuntimeDefinition; +export const PluginRuntimeDefinition = { + name: "PluginRuntime", + fullName: "yaak.plugins.runtime.PluginRuntime", + methods: { + hookImport: { + name: "hookImport", + requestType: HookImportRequest, + requestStream: false, + responseType: HookResponse, + responseStream: false, + options: {}, + }, + hookResponseFilter: { + name: "hookResponseFilter", + requestType: HookResponseFilterRequest, + requestStream: false, + responseType: HookResponse, + responseStream: false, + options: {}, + }, + hookExport: { + name: "hookExport", + requestType: HookExportRequest, + requestStream: false, + responseType: HookResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface PluginRuntimeServiceImplementation { + hookImport(request: HookImportRequest, context: CallContext & CallContextExt): Promise>; + hookResponseFilter( + request: HookResponseFilterRequest, + context: CallContext & CallContextExt, + ): Promise>; + hookExport(request: HookExportRequest, context: CallContext & CallContextExt): Promise>; +} + +export interface PluginRuntimeClient { + hookImport(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + hookResponseFilter( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + hookExport(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/plugin-runtime/src/index.ts b/plugin-runtime/src/index.ts new file mode 100644 index 00000000..82d821a9 --- /dev/null +++ b/plugin-runtime/src/index.ts @@ -0,0 +1,87 @@ +import { isAbortError } from 'abort-controller-x'; +import { createServer, ServerError, ServerMiddlewareCall, Status } from 'nice-grpc'; +import { CallContext } from 'nice-grpc-common'; +import * as fs from 'node:fs'; +import { + DeepPartial, + HookExportRequest, + HookImportRequest, + HookResponse, + HookResponseFilterRequest, + PluginRuntimeDefinition, + PluginRuntimeServiceImplementation, +} from './gen/plugins/runtime'; +import { PluginManager } from './PluginManager'; + +class PluginRuntimeService implements PluginRuntimeServiceImplementation { + #manager: PluginManager; + + constructor() { + this.#manager = PluginManager.instance(); + } + + async hookExport(request: HookExportRequest): Promise> { + const plugin = await this.#manager.pluginOrThrow('exporter-curl'); + const data = await plugin.runExport(JSON.parse(request.request)); + const info = { plugin: (await plugin.getInfo()).name }; + return { info, data }; + } + + async hookImport(request: HookImportRequest): Promise> { + const plugins = await this.#manager.pluginsWith('import'); + for (const p of plugins) { + const data = await p.runImport(request.data); + if (data != 'null') { + const info = { plugin: (await p.getInfo()).name }; + return { info, data }; + } + } + + throw new ServerError(Status.UNKNOWN, 'No importers found for data'); + } + + async hookResponseFilter(request: HookResponseFilterRequest): Promise> { + const pluginName = request.contentType.includes('json') ? 'filter-jsonpath' : 'filter-xpath'; + const plugin = await this.#manager.pluginOrThrow(pluginName); + const data = await plugin.runResponseFilter(request); + const info = { plugin: (await plugin.getInfo()).name }; + return { info, data }; + } +} + +let server = createServer(); + +async function* errorHandlingMiddleware( + call: ServerMiddlewareCall, + context: CallContext, +) { + try { + return yield* call.next(call.request, context); + } catch (error: unknown) { + if (error instanceof ServerError || isAbortError(error)) { + throw error; + } + + let details = String(error); + + if (process.env.NODE_ENV === 'development') { + // @ts-ignore + details += `: ${error.stack}`; + } + + throw new ServerError(Status.UNKNOWN, details); + } +} + +server = server.use(errorHandlingMiddleware); +server.add(PluginRuntimeDefinition, new PluginRuntimeService()); + +// Start on random port if GRPC_PORT_FILE_PATH is set, or :4000 +const addr = process.env.GRPC_PORT_FILE_PATH ? 'localhost:0' : 'localhost:4000'; +server.listen(addr).then((port) => { + console.log('gRPC server listening on', `http://localhost:${port}`); + if (process.env.GRPC_PORT_FILE_PATH) { + console.log('Wrote port file to', process.env.GRPC_PORT_FILE_PATH); + fs.writeFileSync(process.env.GRPC_PORT_FILE_PATH, JSON.stringify({ port }, null, 2)); + } +}); diff --git a/plugin-runtime/src/index.worker.ts b/plugin-runtime/src/index.worker.ts new file mode 100644 index 00000000..491adef1 --- /dev/null +++ b/plugin-runtime/src/index.worker.ts @@ -0,0 +1,64 @@ +import { readFileSync } from 'node:fs'; +import path from 'node:path'; +import { parentPort, workerData } from 'node:worker_threads'; +import { ParentToWorkerEvent } from './PluginHandle'; +import { PluginInfo } from './plugins'; + +new Promise(async () => { + const { pluginDir } = workerData; + const pathMod = path.join(pluginDir, 'build/index.js'); + const pathPkg = path.join(pluginDir, 'package.json'); + + const pkg = JSON.parse(readFileSync(pathPkg, 'utf8')); + const mod = (await import(pathMod)).default ?? {}; + + const info: PluginInfo = { + capabilities: [], + name: pkg['name'] ?? 'n/a', + dir: pluginDir, + }; + + if (typeof mod['pluginHookImport'] === 'function') { + info.capabilities.push('import'); + } + + if (typeof mod['pluginHookExport'] === 'function') { + info.capabilities.push('export'); + } + + if (typeof mod['pluginHookResponseFilter'] === 'function') { + info.capabilities.push('filter'); + } + + console.log('Loaded plugin', info.name, info.capabilities, info.dir); + + function reply(originalMsg: ParentToWorkerEvent, payload: T) { + parentPort!.postMessage({ payload, callbackId: originalMsg.callbackId }); + } + + function replyErr(originalMsg: ParentToWorkerEvent, error: unknown) { + parentPort!.postMessage({ + error: String(error), + callbackId: originalMsg.callbackId, + }); + } + + parentPort!.on('message', (msg: ParentToWorkerEvent) => { + try { + const ctx = { todo: 'implement me' }; + if (msg.name === 'run-import') { + reply(msg, mod.pluginHookImport(ctx, msg.payload)); + } else if (msg.name === 'run-filter') { + reply(msg, mod.pluginHookResponseFilter(ctx, msg.payload)); + } else if (msg.name === 'run-export') { + reply(msg, mod.pluginHookExport(ctx, msg.payload)); + } else if (msg.name === 'info') { + reply(msg, info); + } else { + console.log('Unknown message', msg); + } + } catch (err: unknown) { + replyErr(msg, err); + } + }); +}).catch((err) => console.log('failed to boot plugin', err)); diff --git a/plugin-runtime/src/plugins.ts b/plugin-runtime/src/plugins.ts new file mode 100644 index 00000000..14e6479e --- /dev/null +++ b/plugin-runtime/src/plugins.ts @@ -0,0 +1,18 @@ +import * as fs from 'node:fs'; +import path from 'node:path'; +import { PluginHandle } from './PluginHandle'; + +export interface PluginInfo { + name: string; + dir: string; + capabilities: ('import' | 'export' | 'filter')[]; +} + +export function loadPlugins(workerJsPath: string): PluginHandle[] { + const pluginsDir = process.env.PLUGINS_DIR; + if (!pluginsDir) throw new Error('PLUGINS_DIR is not set'); + console.log('Loading plugins from', pluginsDir); + + const pluginDirs = fs.readdirSync(pluginsDir).map((p) => path.join(pluginsDir, p)); + return pluginDirs.map((pluginDir) => new PluginHandle({ pluginDir, workerJsPath })); +} diff --git a/plugin-runtime/tsconfig.json b/plugin-runtime/tsconfig.json new file mode 100644 index 00000000..a3217bba --- /dev/null +++ b/plugin-runtime/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "node16", + "strict": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "target": "es2021", + "lib": ["es2021"], + "noImplicitAny": false, + "moduleResolution": "node", + "sourceMap": true, + "outDir": "dist", + "baseUrl": ".", + "skipLibCheck": true, + "paths": { + "*": [ + "node_modules/*", + "src/types/*" + ] + } + }, + "include": [ + "src/**/*" + ] +} diff --git a/plugins/exporter-curl/package-lock.json b/plugins/exporter-curl/package-lock.json deleted file mode 100644 index c8ee5b8a..00000000 --- a/plugins/exporter-curl/package-lock.json +++ /dev/null @@ -1,1544 +0,0 @@ -{ - "name": "exporter-curl", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "exporter-curl", - "version": "0.0.1", - "devDependencies": { - "vitest": "^1.4.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.17.2.tgz", - "integrity": "sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.17.2.tgz", - "integrity": "sha512-yeX/Usk7daNIVwkq2uGoq2BYJKZY1JfyLTaHO/jaiSwi/lsf8fTFoQW/n6IdAsx5tx+iotu2zCJwz8MxI6D/Bw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.17.2.tgz", - "integrity": "sha512-kcMLpE6uCwls023+kknm71ug7MZOrtXo+y5p/tsg6jltpDtgQY1Eq5sGfHcQfb+lfuKwhBmEURDga9N0ol4YPw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.17.2.tgz", - "integrity": "sha512-AtKwD0VEx0zWkL0ZjixEkp5tbNLzX+FCqGG1SvOu993HnSz4qDI6S4kGzubrEJAljpVkhRSlg5bzpV//E6ysTQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.17.2.tgz", - "integrity": "sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.17.2.tgz", - "integrity": "sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.17.2.tgz", - "integrity": "sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.17.2.tgz", - "integrity": "sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.17.2.tgz", - "integrity": "sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.17.2.tgz", - "integrity": "sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.17.2.tgz", - "integrity": "sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.17.2.tgz", - "integrity": "sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.17.2.tgz", - "integrity": "sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.17.2.tgz", - "integrity": "sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.17.2.tgz", - "integrity": "sha512-7II/QCSTAHuE5vdZaQEwJq2ZACkBpQDOmQsE6D6XUbnBHW8IAhm4eTufL6msLJorzrHDFv3CF8oCA/hSIRuZeQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.17.2.tgz", - "integrity": "sha512-TGGO7v7qOq4CYmSBVEYpI1Y5xDuCEnbVC5Vth8mOsW0gDSzxNrVERPc790IGHsrT2dQSimgMr9Ub3Y1Jci5/8w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, - "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, - "node_modules/@vitest/expect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", - "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", - "dev": true, - "dependencies": { - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "chai": "^4.3.10" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", - "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", - "dev": true, - "dependencies": { - "@vitest/utils": "1.6.0", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", - "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", - "dev": true, - "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/spy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", - "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", - "dev": true, - "dependencies": { - "tinyspy": "^2.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/utils": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", - "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", - "dev": true, - "dependencies": { - "diff-sequences": "^29.6.3", - "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", - "dev": true, - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, - "engines": { - "node": "*" - } - }, - "node_modules/confbox": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", - "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" - } - }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/js-tokens": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", - "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", - "dev": true - }, - "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", - "dev": true, - "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.1" - } - }, - "node_modules/magic-string": { - "version": "0.30.10", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", - "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mlly": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.0.tgz", - "integrity": "sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==", - "dev": true, - "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.1.0", - "ufo": "^1.5.3" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/pkg-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.0.tgz", - "integrity": "sha512-/RpmvKdxKf8uILTtoOhAgf30wYbP2Qw+L9p3Rvshx1JZVX+XQNZQFjlbmGHEGIm4CkVPlSn+NXmIM8+9oWQaSA==", - "dev": true, - "dependencies": { - "confbox": "^0.1.7", - "mlly": "^1.6.1", - "pathe": "^1.1.2" - } - }, - "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, - "node_modules/rollup": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.17.2.tgz", - "integrity": "sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==", - "dev": true, - "dependencies": { - "@types/estree": "1.0.5" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.17.2", - "@rollup/rollup-android-arm64": "4.17.2", - "@rollup/rollup-darwin-arm64": "4.17.2", - "@rollup/rollup-darwin-x64": "4.17.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.17.2", - "@rollup/rollup-linux-arm-musleabihf": "4.17.2", - "@rollup/rollup-linux-arm64-gnu": "4.17.2", - "@rollup/rollup-linux-arm64-musl": "4.17.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.17.2", - "@rollup/rollup-linux-riscv64-gnu": "4.17.2", - "@rollup/rollup-linux-s390x-gnu": "4.17.2", - "@rollup/rollup-linux-x64-gnu": "4.17.2", - "@rollup/rollup-linux-x64-musl": "4.17.2", - "@rollup/rollup-win32-arm64-msvc": "4.17.2", - "@rollup/rollup-win32-ia32-msvc": "4.17.2", - "@rollup/rollup-win32-x64-msvc": "4.17.2", - "fsevents": "~2.3.2" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true - }, - "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", - "dev": true - }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/strip-literal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", - "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", - "dev": true, - "dependencies": { - "js-tokens": "^9.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/tinybench": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", - "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", - "dev": true - }, - "node_modules/tinypool": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", - "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ufo": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", - "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", - "dev": true - }, - "node_modules/vite": { - "version": "5.2.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz", - "integrity": "sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==", - "dev": true, - "dependencies": { - "esbuild": "^0.20.1", - "postcss": "^8.4.38", - "rollup": "^4.13.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } - } - }, - "node_modules/vite-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", - "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", - "dev": true, - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "vite": "^5.0.0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/vitest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", - "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", - "dev": true, - "dependencies": { - "@vitest/expect": "1.6.0", - "@vitest/runner": "1.6.0", - "@vitest/snapshot": "1.6.0", - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", - "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.3", - "vite": "^5.0.0", - "vite-node": "1.6.0", - "why-is-node-running": "^2.2.2" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.6.0", - "@vitest/ui": "1.6.0", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", - "dev": true, - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/plugins/exporter-curl/package.json b/plugins/exporter-curl/package.json deleted file mode 100644 index 4674e1a0..00000000 --- a/plugins/exporter-curl/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "exporter-curl", - "version": "0.0.1", - "devDependencies": { - "vitest": "^1.4.0" - } -} diff --git a/plugins/exporter-curl/src/index.ts b/plugins/exporter-curl/src/index.ts deleted file mode 100644 index 44c99a1f..00000000 --- a/plugins/exporter-curl/src/index.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { HttpRequest } from '../../../src-web/lib/models'; - -const NEWLINE = '\\\n '; - -export function pluginHookExport(_: any, request: Partial) { - const xs = ['curl']; - - // Add method and URL all on first line - if (request.method) xs.push('-X', request.method); - if (request.url) xs.push(quote(request.url)); - - xs.push(NEWLINE); - - // Add URL params - for (const p of (request.urlParameters ?? []).filter(onlyEnabled)) { - xs.push('--url-query', quote(`${p.name}=${p.value}`)); - xs.push(NEWLINE); - } - - // Add headers - for (const h of (request.headers ?? []).filter(onlyEnabled)) { - xs.push('--header', quote(`${h.name}: ${h.value}`)); - xs.push(NEWLINE); - } - - // Add form params - if (Array.isArray(request.body?.form)) { - const flag = request.bodyType === 'multipart/form-data' ? '--form' : '--data'; - for (const p of (request.body?.form ?? []).filter(onlyEnabled)) { - if (p.file) { - let v = `${p.name}=@${p.file}`; - v += p.contentType ? `;type=${p.contentType}` : ''; - xs.push(flag, v); - } else { - xs.push(flag, quote(`${p.name}=${p.value}`)); - } - xs.push(NEWLINE); - } - } else if (typeof request.body?.text === 'string') { - // --data-raw $'...' to do special ANSI C quoting - xs.push('--data-raw', `$${quote(request.body.text)}`); - xs.push(NEWLINE); - } - - // Add basic/digest authentication - if (request.authenticationType === 'basic' || request.authenticationType === 'digest') { - if (request.authenticationType === 'digest') xs.push('--digest'); - xs.push( - '--user', - quote(`${request.authentication?.username ?? ''}:${request.authentication?.password ?? ''}`), - ); - xs.push(NEWLINE); - } - - // Add bearer authentication - if (request.authenticationType === 'bearer') { - xs.push('--header', quote(`Authorization: Bearer ${request.authentication?.token ?? ''}`)); - xs.push(NEWLINE); - } - - // Remove trailing newline - if (xs[xs.length - 1] === NEWLINE) { - xs.splice(xs.length - 1, 1); - } - - return xs.join(' '); -} - -function quote(arg: string): string { - const escaped = arg.replace(/'/g, "\\'"); - return `'${escaped}'`; -} - -function onlyEnabled(v: { name?: string; enabled?: boolean }): boolean { - return v.enabled !== false && !!v.name; -} diff --git a/plugins/exporter-curl/tests/index.test.ts b/plugins/exporter-curl/tests/index.test.ts deleted file mode 100644 index caceb95f..00000000 --- a/plugins/exporter-curl/tests/index.test.ts +++ /dev/null @@ -1,177 +0,0 @@ -import { describe, expect, test } from 'vitest'; -import { pluginHookExport } from '../src'; - -const ctx = {}; - -describe('exporter-curl', () => { - test('Exports GET with params', () => { - expect( - pluginHookExport(ctx, { - url: 'https://yaak.app', - urlParameters: [ - { name: 'a', value: 'aaa' }, - { name: 'b', value: 'bbb', enabled: true }, - { name: 'c', value: 'ccc', enabled: false }, - ], - }), - ).toEqual( - [`curl 'https://yaak.app'`, `--url-query 'a=aaa'`, `--url-query 'b=bbb'`].join(` \\\n `), - ); - }); - test('Exports POST with url form data', () => { - expect( - pluginHookExport(ctx, { - url: 'https://yaak.app', - method: 'POST', - bodyType: 'application/x-www-form-urlencoded', - body: { - form: [ - { name: 'a', value: 'aaa' }, - { name: 'b', value: 'bbb', enabled: true }, - { name: 'c', value: 'ccc', enabled: false }, - ], - }, - }), - ).toEqual( - [`curl -X POST 'https://yaak.app'`, `--data 'a=aaa'`, `--data 'b=bbb'`].join(` \\\n `), - ); - }); - - test('Exports PUT with multipart form', () => { - expect( - pluginHookExport(ctx, { - url: 'https://yaak.app', - method: 'PUT', - bodyType: 'multipart/form-data', - body: { - form: [ - { name: 'a', value: 'aaa' }, - { name: 'b', value: 'bbb', enabled: true }, - { name: 'c', value: 'ccc', enabled: false }, - { name: 'f', file: '/foo/bar.png', contentType: 'image/png' }, - ], - }, - }), - ).toEqual( - [ - `curl -X PUT 'https://yaak.app'`, - `--form 'a=aaa'`, - `--form 'b=bbb'`, - `--form f=@/foo/bar.png;type=image/png`, - ].join(` \\\n `), - ); - }); - - test('Exports JSON body', () => { - expect( - pluginHookExport(ctx, { - url: 'https://yaak.app', - method: 'POST', - bodyType: 'application/json', - body: { - text: `{"foo":"bar's"}`, - }, - headers: [{ name: 'Content-Type', value: 'application/json' }], - }), - ).toEqual( - [ - `curl -X POST 'https://yaak.app'`, - `--header 'Content-Type: application/json'`, - `--data-raw $'{"foo":"bar\\'s"}'`, - ].join(` \\\n `), - ); - }); - - test('Exports multi-line JSON body', () => { - expect( - pluginHookExport(ctx, { - url: 'https://yaak.app', - method: 'POST', - bodyType: 'application/json', - body: { - text: `{"foo":"bar",\n"baz":"qux"}`, - }, - headers: [{ name: 'Content-Type', value: 'application/json' }], - }), - ).toEqual( - [ - `curl -X POST 'https://yaak.app'`, - `--header 'Content-Type: application/json'`, - `--data-raw $'{"foo":"bar",\n"baz":"qux"}'`, - ].join(` \\\n `), - ); - }); - - test('Exports headers', () => { - expect( - pluginHookExport(ctx, { - headers: [ - { name: 'a', value: 'aaa' }, - { name: 'b', value: 'bbb', enabled: true }, - { name: 'c', value: 'ccc', enabled: false }, - ], - }), - ).toEqual([`curl`, `--header 'a: aaa'`, `--header 'b: bbb'`].join(` \\\n `)); - }); - - test('Basic auth', () => { - expect( - pluginHookExport(ctx, { - url: 'https://yaak.app', - authenticationType: 'basic', - authentication: { - username: 'user', - password: 'pass', - }, - }), - ).toEqual([`curl 'https://yaak.app'`, `--user 'user:pass'`].join(` \\\n `)); - }); - - test('Broken basic auth', () => { - expect( - pluginHookExport(ctx, { - url: 'https://yaak.app', - authenticationType: 'basic', - authentication: {}, - }), - ).toEqual([`curl 'https://yaak.app'`, `--user ':'`].join(` \\\n `)); - }); - - test('Digest auth', () => { - expect( - pluginHookExport(ctx, { - url: 'https://yaak.app', - authenticationType: 'digest', - authentication: { - username: 'user', - password: 'pass', - }, - }), - ).toEqual([`curl 'https://yaak.app'`, `--digest --user 'user:pass'`].join(` \\\n `)); - }); - - test('Bearer auth', () => { - expect( - pluginHookExport(ctx, { - url: 'https://yaak.app', - authenticationType: 'bearer', - authentication: { - token: 'tok', - }, - }), - ).toEqual([`curl 'https://yaak.app'`, `--header 'Authorization: Bearer tok'`].join(` \\\n `)); - }); - - test('Broken bearer auth', () => { - expect( - pluginHookExport(ctx, { - url: 'https://yaak.app', - authenticationType: 'bearer', - authentication: { - username: 'user', - password: 'pass', - }, - }), - ).toEqual([`curl 'https://yaak.app'`, `--header 'Authorization: Bearer '`].join(` \\\n `)); - }); -}); diff --git a/plugins/exporter-curl/vite.config.js b/plugins/exporter-curl/vite.config.js deleted file mode 100644 index 8ae4262f..00000000 --- a/plugins/exporter-curl/vite.config.js +++ /dev/null @@ -1,15 +0,0 @@ -import { resolve } from 'path'; -import { defineConfig } from 'vite'; - -export default defineConfig({ - build: { - lib: { - entry: resolve(__dirname, 'src/index.ts'), - fileName: 'index', - formats: ['es'], - }, - emptyOutDir: true, - sourcemap: true, - outDir: resolve(__dirname, '../../src-tauri/plugins/exporter-curl'), - }, -}); diff --git a/plugins/filter-jsonpath/package-lock.json b/plugins/filter-jsonpath/package-lock.json deleted file mode 100644 index 0beff7d1..00000000 --- a/plugins/filter-jsonpath/package-lock.json +++ /dev/null @@ -1,173 +0,0 @@ -{ - "name": "filter-jsonpath", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "filter-jsonpath", - "version": "0.0.1", - "dependencies": { - "jsonpath": "^1.1.1" - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" - }, - "node_modules/escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=4.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/escodegen/node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", - "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" - }, - "node_modules/jsonpath": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz", - "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==", - "dependencies": { - "esprima": "1.2.2", - "static-eval": "2.0.2", - "underscore": "1.12.1" - } - }, - "node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-eval": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", - "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", - "dependencies": { - "escodegen": "^1.8.1" - } - }, - "node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/underscore": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", - "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "engines": { - "node": ">=0.10.0" - } - } - } -} diff --git a/plugins/filter-jsonpath/package.json b/plugins/filter-jsonpath/package.json deleted file mode 100644 index b867923b..00000000 --- a/plugins/filter-jsonpath/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "filter-jsonpath", - "version": "0.0.1", - "dependencies": { - "jsonpath": "^1.1.1" - } -} diff --git a/plugins/filter-jsonpath/src/index.js b/plugins/filter-jsonpath/src/index.js deleted file mode 100644 index 78973419..00000000 --- a/plugins/filter-jsonpath/src/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import jp from 'jsonpath'; - -export function pluginHookResponseFilter(ctx, filter, text) { - let parsed; - try { - parsed = JSON.parse(text); - } catch (e) { - return; - } - const filtered = jp.query(parsed, filter); - return { filtered: JSON.stringify(filtered, null, 2) }; -} diff --git a/plugins/filter-jsonpath/vite.config.js b/plugins/filter-jsonpath/vite.config.js deleted file mode 100644 index 1067fae6..00000000 --- a/plugins/filter-jsonpath/vite.config.js +++ /dev/null @@ -1,15 +0,0 @@ -import { resolve } from 'path'; -import { defineConfig } from 'vite'; - -export default defineConfig({ - build: { - lib: { - entry: resolve(__dirname, 'src/index.js'), - fileName: 'index', - formats: ['es'], - }, - emptyOutDir: true, - sourcemap: true, - outDir: resolve(__dirname, '../../src-tauri/plugins/filter-jsonpath'), - }, -}); diff --git a/plugins/filter-xpath/package-lock.json b/plugins/filter-xpath/package-lock.json deleted file mode 100644 index 9fb40cd4..00000000 --- a/plugins/filter-xpath/package-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "filter-xpath", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "filter-xpath", - "version": "0.0.1", - "dependencies": { - "@xmldom/xmldom": "^0.8.10", - "xpath": "^0.0.34" - } - }, - "node_modules/@xmldom/xmldom": { - "version": "0.8.10", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", - "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==", - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/xpath": { - "version": "0.0.34", - "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.34.tgz", - "integrity": "sha512-FxF6+rkr1rNSQrhUNYrAFJpRXNzlDoMxeXN5qI84939ylEv3qqPFKa85Oxr6tDaJKqwW6KKyo2v26TSv3k6LeA==", - "engines": { - "node": ">=0.6.0" - } - } - } -} diff --git a/plugins/filter-xpath/package.json b/plugins/filter-xpath/package.json deleted file mode 100644 index 897faa3d..00000000 --- a/plugins/filter-xpath/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "filter-xpath", - "version": "0.0.1", - "dependencies": { - "@xmldom/xmldom": "^0.8.10", - "xpath": "^0.0.34" - } -} diff --git a/plugins/filter-xpath/src/index.js b/plugins/filter-xpath/src/index.js deleted file mode 100644 index 8ad18313..00000000 --- a/plugins/filter-xpath/src/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import xpath from 'xpath'; -import { DOMParser } from '@xmldom/xmldom'; - -export function pluginHookResponseFilter(ctx, filter, text) { - const doc = new DOMParser().parseFromString(text, 'text/xml'); - const filtered = `${xpath.select(filter, doc)}`; - return { filtered }; -} diff --git a/plugins/filter-xpath/vite.config.js b/plugins/filter-xpath/vite.config.js deleted file mode 100644 index d3e785d6..00000000 --- a/plugins/filter-xpath/vite.config.js +++ /dev/null @@ -1,15 +0,0 @@ -import { resolve } from 'path'; -import { defineConfig } from 'vite'; - -export default defineConfig({ - build: { - lib: { - entry: resolve(__dirname, 'src/index.js'), - fileName: 'index', - formats: ['es'], - }, - emptyOutDir: true, - sourcemap: true, - outDir: resolve(__dirname, '../../src-tauri/plugins/filter-xpath'), - }, -}); diff --git a/plugins/importer-curl/package-lock.json b/plugins/importer-curl/package-lock.json deleted file mode 100644 index 2846dda8..00000000 --- a/plugins/importer-curl/package-lock.json +++ /dev/null @@ -1,1562 +0,0 @@ -{ - "name": "importer-curl", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "importer-curl", - "version": "0.0.1", - "dependencies": { - "shell-quote": "^1.8.1" - }, - "devDependencies": { - "@types/shell-quote": "^1.7.5", - "vitest": "^1.4.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.17.2.tgz", - "integrity": "sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.17.2.tgz", - "integrity": "sha512-yeX/Usk7daNIVwkq2uGoq2BYJKZY1JfyLTaHO/jaiSwi/lsf8fTFoQW/n6IdAsx5tx+iotu2zCJwz8MxI6D/Bw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.17.2.tgz", - "integrity": "sha512-kcMLpE6uCwls023+kknm71ug7MZOrtXo+y5p/tsg6jltpDtgQY1Eq5sGfHcQfb+lfuKwhBmEURDga9N0ol4YPw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.17.2.tgz", - "integrity": "sha512-AtKwD0VEx0zWkL0ZjixEkp5tbNLzX+FCqGG1SvOu993HnSz4qDI6S4kGzubrEJAljpVkhRSlg5bzpV//E6ysTQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.17.2.tgz", - "integrity": "sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.17.2.tgz", - "integrity": "sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.17.2.tgz", - "integrity": "sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.17.2.tgz", - "integrity": "sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.17.2.tgz", - "integrity": "sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.17.2.tgz", - "integrity": "sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.17.2.tgz", - "integrity": "sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.17.2.tgz", - "integrity": "sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.17.2.tgz", - "integrity": "sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.17.2.tgz", - "integrity": "sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.17.2.tgz", - "integrity": "sha512-7II/QCSTAHuE5vdZaQEwJq2ZACkBpQDOmQsE6D6XUbnBHW8IAhm4eTufL6msLJorzrHDFv3CF8oCA/hSIRuZeQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.17.2.tgz", - "integrity": "sha512-TGGO7v7qOq4CYmSBVEYpI1Y5xDuCEnbVC5Vth8mOsW0gDSzxNrVERPc790IGHsrT2dQSimgMr9Ub3Y1Jci5/8w==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, - "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, - "node_modules/@types/shell-quote": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/@types/shell-quote/-/shell-quote-1.7.5.tgz", - "integrity": "sha512-+UE8GAGRPbJVQDdxi16dgadcBfQ+KG2vgZhV1+3A1XmHbmwcdwhCUwIdy+d3pAGrbvgRoVSjeI9vOWyq376Yzw==", - "dev": true - }, - "node_modules/@vitest/expect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", - "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", - "dev": true, - "dependencies": { - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "chai": "^4.3.10" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", - "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", - "dev": true, - "dependencies": { - "@vitest/utils": "1.6.0", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", - "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", - "dev": true, - "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/spy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", - "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", - "dev": true, - "dependencies": { - "tinyspy": "^2.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/utils": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", - "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", - "dev": true, - "dependencies": { - "diff-sequences": "^29.6.3", - "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", - "dev": true, - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, - "engines": { - "node": "*" - } - }, - "node_modules/confbox": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", - "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" - } - }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/js-tokens": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", - "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", - "dev": true - }, - "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", - "dev": true, - "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.1" - } - }, - "node_modules/magic-string": { - "version": "0.30.10", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", - "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mlly": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.0.tgz", - "integrity": "sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==", - "dev": true, - "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.1.0", - "ufo": "^1.5.3" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/pkg-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.0.tgz", - "integrity": "sha512-/RpmvKdxKf8uILTtoOhAgf30wYbP2Qw+L9p3Rvshx1JZVX+XQNZQFjlbmGHEGIm4CkVPlSn+NXmIM8+9oWQaSA==", - "dev": true, - "dependencies": { - "confbox": "^0.1.7", - "mlly": "^1.6.1", - "pathe": "^1.1.2" - } - }, - "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, - "node_modules/rollup": { - "version": "4.17.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.17.2.tgz", - "integrity": "sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==", - "dev": true, - "dependencies": { - "@types/estree": "1.0.5" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.17.2", - "@rollup/rollup-android-arm64": "4.17.2", - "@rollup/rollup-darwin-arm64": "4.17.2", - "@rollup/rollup-darwin-x64": "4.17.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.17.2", - "@rollup/rollup-linux-arm-musleabihf": "4.17.2", - "@rollup/rollup-linux-arm64-gnu": "4.17.2", - "@rollup/rollup-linux-arm64-musl": "4.17.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.17.2", - "@rollup/rollup-linux-riscv64-gnu": "4.17.2", - "@rollup/rollup-linux-s390x-gnu": "4.17.2", - "@rollup/rollup-linux-x64-gnu": "4.17.2", - "@rollup/rollup-linux-x64-musl": "4.17.2", - "@rollup/rollup-win32-arm64-msvc": "4.17.2", - "@rollup/rollup-win32-ia32-msvc": "4.17.2", - "@rollup/rollup-win32-x64-msvc": "4.17.2", - "fsevents": "~2.3.2" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/shell-quote": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", - "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true - }, - "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", - "dev": true - }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/strip-literal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", - "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", - "dev": true, - "dependencies": { - "js-tokens": "^9.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/tinybench": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", - "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", - "dev": true - }, - "node_modules/tinypool": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", - "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ufo": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", - "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", - "dev": true - }, - "node_modules/vite": { - "version": "5.2.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz", - "integrity": "sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==", - "dev": true, - "dependencies": { - "esbuild": "^0.20.1", - "postcss": "^8.4.38", - "rollup": "^4.13.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } - } - }, - "node_modules/vite-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", - "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", - "dev": true, - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "vite": "^5.0.0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/vitest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", - "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", - "dev": true, - "dependencies": { - "@vitest/expect": "1.6.0", - "@vitest/runner": "1.6.0", - "@vitest/snapshot": "1.6.0", - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", - "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.3", - "vite": "^5.0.0", - "vite-node": "1.6.0", - "why-is-node-running": "^2.2.2" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.6.0", - "@vitest/ui": "1.6.0", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", - "dev": true, - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/plugins/importer-curl/package.json b/plugins/importer-curl/package.json deleted file mode 100644 index 989b2d66..00000000 --- a/plugins/importer-curl/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "importer-curl", - "version": "0.0.1", - "dependencies": { - "shell-quote": "^1.8.1" - }, - "devDependencies": { - "@types/shell-quote": "^1.7.5", - "vitest": "^1.4.0" - } -} diff --git a/plugins/importer-curl/src/index.ts b/plugins/importer-curl/src/index.ts deleted file mode 100644 index 376a9a46..00000000 --- a/plugins/importer-curl/src/index.ts +++ /dev/null @@ -1,421 +0,0 @@ -import { ControlOperator, parse, ParseEntry } from 'shell-quote'; -import { - Environment, - Folder, - HttpRequest, - HttpUrlParameter, - Model, - Workspace, -} from '../../../src-web/lib/models'; - -type AtLeast = Partial & Pick; - -interface ExportResources { - workspaces: AtLeast[]; - environments: AtLeast[]; - httpRequests: AtLeast[]; - folders: AtLeast[]; -} - -export const id = 'curl'; -export const name = 'cURL'; -export const description = 'cURL command line tool'; - -const DATA_FLAGS = ['d', 'data', 'data-raw', 'data-urlencode', 'data-binary', 'data-ascii']; -const SUPPORTED_ARGS = [ - ['url'], // Specify the URL explicitly - ['user', 'u'], // Authentication - ['digest'], // Apply auth as digest - ['header', 'H'], - ['cookie', 'b'], - ['get', 'G'], // Put the post data in the URL - ['d', 'data'], // Add url encoded data - ['data-raw'], - ['data-urlencode'], - ['data-binary'], - ['data-ascii'], - ['form', 'F'], // Add multipart data - ['request', 'X'], // Request method - DATA_FLAGS, -].flatMap((v) => v); - -type Pair = string | boolean; - -type PairsByName = Record; - -export function pluginHookImport(_: any, rawData: string) { - if (!rawData.match(/^\s*curl /)) { - return null; - } - - const commands: ParseEntry[][] = []; - - // Replace non-escaped newlines with semicolons to make parsing easier - // NOTE: This is really slow in debug build but fast in release mode - const normalizedData = rawData.replace(/\ncurl/g, '; curl'); - - let currentCommand: ParseEntry[] = []; - - const parsed = parse(normalizedData); - - // Break up `-XPOST` into `-X POST` - const normalizedParseEntries = parsed.flatMap((entry) => { - if ( - typeof entry === 'string' && - entry.startsWith('-') && - !entry.startsWith('--') && - entry.length > 2 - ) { - return [entry.slice(0, 2), entry.slice(2)]; - } - return entry; - }); - - for (const parseEntry of normalizedParseEntries) { - if (typeof parseEntry === 'string') { - if (parseEntry.startsWith('$')) { - currentCommand.push(parseEntry.slice(1)); - } else { - currentCommand.push(parseEntry); - } - continue; - } - - if ('comment' in parseEntry) { - continue; - } - - const { op } = parseEntry as { op: 'glob'; pattern: string } | { op: ControlOperator }; - - // `;` separates commands - if (op === ';') { - commands.push(currentCommand); - currentCommand = []; - continue; - } - - if (op?.startsWith('$')) { - // Handle the case where literal like -H $'Header: \'Some Quoted Thing\'' - const str = op.slice(2, op.length - 1).replace(/\\'/g, "'"); - - currentCommand.push(str); - continue; - } - - if (op === 'glob') { - currentCommand.push((parseEntry as { op: 'glob'; pattern: string }).pattern); - } - } - - commands.push(currentCommand); - - const workspace: ExportResources['workspaces'][0] = { - model: 'workspace', - id: generateId('workspace'), - name: 'Curl Import', - }; - - const requests: ExportResources['httpRequests'] = commands - .filter((command) => command[0] === 'curl') - .map((v) => importCommand(v, workspace.id)); - - return { - resources: { - httpRequests: requests, - workspaces: [workspace], - }, - }; -} - -export function importCommand(parseEntries: ParseEntry[], workspaceId: string) { - // ~~~~~~~~~~~~~~~~~~~~~ // - // Collect all the flags // - // ~~~~~~~~~~~~~~~~~~~~~ // - const pairsByName: PairsByName = {}; - const singletons: ParseEntry[] = []; - - // Start at 1 so we can skip the ^curl part - for (let i = 1; i < parseEntries.length; i++) { - let parseEntry = parseEntries[i]; - if (typeof parseEntry === 'string') { - parseEntry = parseEntry.trim(); - } - - if (typeof parseEntry === 'string' && parseEntry.match(/^-{1,2}[\w-]+/)) { - const isSingleDash = parseEntry[0] === '-' && parseEntry[1] !== '-'; - let name = parseEntry.replace(/^-{1,2}/, ''); - - if (!SUPPORTED_ARGS.includes(name)) { - continue; - } - - let value; - const nextEntry = parseEntries[i + 1]; - if (isSingleDash && name.length > 1) { - // Handle squished arguments like -XPOST - value = name.slice(1); - name = name.slice(0, 1); - } else if (typeof nextEntry === 'string' && !nextEntry.startsWith('-')) { - // Next arg is not a flag, so assign it as the value - value = nextEntry; - i++; // Skip next one - } else { - value = true; - } - - pairsByName[name] = pairsByName[name] || []; - pairsByName[name]!.push(value); - } else if (parseEntry) { - singletons.push(parseEntry); - } - } - - // ~~~~~~~~~~~~~~~~~ // - // Build the request // - // ~~~~~~~~~~~~~~~~~ // - - // Url & parameters - - let urlParameters: HttpUrlParameter[]; - let url: string; - - const urlArg = getPairValue(pairsByName, (singletons[0] as string) || '', ['url']); - const [baseUrl, search] = splitOnce(urlArg, '?'); - urlParameters = - search?.split('&').map((p) => { - const v = splitOnce(p, '='); - return { name: v[0] ?? '', value: v[1] ?? '', enabled: true }; - }) ?? []; - - url = baseUrl ?? urlArg; - - // Authentication - const [username, password] = getPairValue(pairsByName, '', ['u', 'user']).split(/:(.*)$/); - - const isDigest = getPairValue(pairsByName, false, ['digest']); - const authenticationType = username ? (isDigest ? 'digest' : 'basic') : null; - const authentication = username - ? { - username: username.trim(), - password: (password ?? '').trim(), - } - : {}; - - // Headers - const headers = [ - ...((pairsByName.header as string[] | undefined) || []), - ...((pairsByName.H as string[] | undefined) || []), - ].map((header) => { - const [name, value] = header.split(/:(.*)$/); - // remove final colon from header name if present - if (!value) { - return { - name: (name ?? '').trim().replace(/;$/, ''), - value: '', - enabled: true, - }; - } - return { - name: (name ?? '').trim(), - value: value.trim(), - enabled: true, - }; - }); - - // Cookies - const cookieHeaderValue = [ - ...((pairsByName.cookie as string[] | undefined) || []), - ...((pairsByName.b as string[] | undefined) || []), - ] - .map((str) => { - const name = str.split('=', 1)[0]; - const value = str.replace(`${name}=`, ''); - return `${name}=${value}`; - }) - .join('; '); - - // Convert cookie value to header - const existingCookieHeader = headers.find((header) => header.name.toLowerCase() === 'cookie'); - - if (cookieHeaderValue && existingCookieHeader) { - // Has existing cookie header, so let's update it - existingCookieHeader.value += `; ${cookieHeaderValue}`; - } else if (cookieHeaderValue) { - // No existing cookie header, so let's make a new one - headers.push({ - name: 'Cookie', - value: cookieHeaderValue, - enabled: true, - }); - } - - ///Body (Text or Blob) - const dataParameters = pairsToDataParameters(pairsByName); - const contentTypeHeader = headers.find((header) => header.name.toLowerCase() === 'content-type'); - const mimeType = contentTypeHeader ? contentTypeHeader.value.split(';')[0] : null; - - // Body (Multipart Form Data) - const formDataParams = [ - ...((pairsByName.form as string[] | undefined) || []), - ...((pairsByName.F as string[] | undefined) || []), - ].map((str) => { - const parts = str.split('='); - const name = parts[0] ?? ''; - const value = parts[1] ?? ''; - const item: { name: string; value?: string; file?: string; enabled: boolean } = { - name, - enabled: true, - }; - - if (value.indexOf('@') === 0) { - item.file = value.slice(1); - } else { - item.value = value; - } - - return item; - }); - - // Body - let body = {}; - let bodyType: string | null = null; - const bodyAsGET = getPairValue(pairsByName, false, ['G', 'get']); - - if (dataParameters.length > 0 && bodyAsGET) { - urlParameters.push(...dataParameters); - } else if ( - dataParameters.length > 0 && - (mimeType == null || mimeType === 'application/x-www-form-urlencoded') - ) { - bodyType = mimeType ?? 'application/x-www-form-urlencoded'; - body = { - form: dataParameters.map((parameter) => ({ - ...parameter, - name: decodeURIComponent(parameter.name || ''), - value: decodeURIComponent(parameter.value || ''), - })), - }; - headers.push({ - name: 'Content-Type', - value: 'application/x-www-form-urlencoded', - enabled: true, - }); - } else if (dataParameters.length > 0) { - bodyType = - mimeType === 'application/json' || mimeType === 'text/xml' || mimeType === 'text/plain' - ? mimeType - : 'other'; - body = { - text: dataParameters - .map(({ name, value }) => (name && value ? `${name}=${value}` : name || value)) - .join('&'), - }; - } else if (formDataParams.length) { - bodyType = mimeType ?? 'multipart/form-data'; - body = { - form: formDataParams, - }; - if (mimeType == null) { - headers.push({ - name: 'Content-Type', - value: 'multipart/form-data', - enabled: true, - }); - } - } - - // Method - let method = getPairValue(pairsByName, '', ['X', 'request']).toUpperCase(); - - if (method === '' && body) { - method = 'text' in body || 'form' in body ? 'POST' : 'GET'; - } - - const request: ExportResources['httpRequests'][0] = { - id: generateId('http_request'), - model: 'http_request', - workspaceId, - name: '', - urlParameters, - url, - method, - headers, - authentication, - authenticationType, - body, - bodyType, - folderId: null, - sortPriority: 0, - }; - - return request; -} - -const pairsToDataParameters = (keyedPairs: PairsByName) => { - let dataParameters: { - name: string; - value: string; - contentType?: string; - filePath?: string; - enabled?: boolean; - }[] = []; - - for (const flagName of DATA_FLAGS) { - const pairs = keyedPairs[flagName]; - - if (!pairs || pairs.length === 0) { - continue; - } - - for (const p of pairs) { - if (typeof p !== 'string') continue; - - const [name, value] = p.split('='); - if (p.startsWith('@')) { - // Yaak doesn't support files in url-encoded data, so - dataParameters.push({ - name: name ?? '', - value: '', - filePath: p.slice(1), - enabled: true, - }); - } else { - dataParameters.push({ - name: name ?? '', - value: flagName === 'data-urlencode' ? encodeURIComponent(value ?? '') : value ?? '', - enabled: true, - }); - } - } - } - - return dataParameters; -}; - -const getPairValue = ( - pairsByName: PairsByName, - defaultValue: T, - names: string[], -) => { - for (const name of names) { - if (pairsByName[name] && pairsByName[name]!.length) { - return pairsByName[name]![0] as T; - } - } - - return defaultValue; -}; - -function splitOnce(str: string, sep: string): string[] { - const index = str.indexOf(sep); - if (index > -1) { - return [str.slice(0, index), str.slice(index + 1)]; - } - return [str]; -} - -const idCount: Partial> = {}; -function generateId(model: Model['model']): string { - idCount[model] = (idCount[model] ?? -1) + 1; - return `GENERATE_ID::${model.toUpperCase()}_${idCount[model]}`; -} diff --git a/plugins/importer-curl/tests/index.test.ts b/plugins/importer-curl/tests/index.test.ts deleted file mode 100644 index f2aac370..00000000 --- a/plugins/importer-curl/tests/index.test.ts +++ /dev/null @@ -1,341 +0,0 @@ -import { describe, expect, test } from 'vitest'; -import { HttpRequest, Model, Workspace } from '../../../src-web/lib/models'; -import { pluginHookImport } from '../src'; - -const ctx = {}; - -describe('importer-curl', () => { - test('Imports basic GET', () => { - expect(pluginHookImport(ctx, 'curl https://yaak.app')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - }), - ], - }, - }); - }); - - test('Explicit URL', () => { - expect(pluginHookImport(ctx, 'curl --url https://yaak.app')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - }), - ], - }, - }); - }); - - test('Missing URL', () => { - expect(pluginHookImport(ctx, 'curl -X POST')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - method: 'POST', - }), - ], - }, - }); - }); - - test('URL between', () => { - expect(pluginHookImport(ctx, 'curl -v https://yaak.app -X POST')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - method: 'POST', - }), - ], - }, - }); - }); - - test('Random flags', () => { - expect(pluginHookImport(ctx, 'curl --random -Z -Y -S --foo https://yaak.app')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - }), - ], - }, - }); - }); - - test('Imports --request method', () => { - expect(pluginHookImport(ctx, 'curl --request POST https://yaak.app')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - method: 'POST', - }), - ], - }, - }); - }); - - test('Imports -XPOST method', () => { - expect(pluginHookImport(ctx, 'curl -XPOST --request POST https://yaak.app')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - method: 'POST', - }), - ], - }, - }); - }); - - test('Imports multiple requests', () => { - expect( - pluginHookImport( - ctx, - 'curl \\\n https://yaak.app\necho "foo"\ncurl example.com;curl foo.com', - ), - ).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ url: 'https://yaak.app' }), - baseRequest({ url: 'example.com' }), - baseRequest({ url: 'foo.com' }), - ], - }, - }); - }); - - test('Imports form data', () => { - expect( - pluginHookImport(ctx, 'curl -X POST -F "a=aaa" -F b=bbb" -F f=@filepath https://yaak.app'), - ).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - method: 'POST', - url: 'https://yaak.app', - headers: [ - { - name: 'Content-Type', - value: 'multipart/form-data', - enabled: true, - }, - ], - bodyType: 'multipart/form-data', - body: { - form: [ - { enabled: true, name: 'a', value: 'aaa' }, - { enabled: true, name: 'b', value: 'bbb' }, - { enabled: true, name: 'f', file: 'filepath' }, - ], - }, - }), - ], - }, - }); - }); - - test('Imports data params as form url-encoded', () => { - expect(pluginHookImport(ctx, 'curl -d a -d b -d c=ccc https://yaak.app')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - method: 'POST', - url: 'https://yaak.app', - bodyType: 'application/x-www-form-urlencoded', - headers: [ - { - name: 'Content-Type', - value: 'application/x-www-form-urlencoded', - enabled: true, - }, - ], - body: { - form: [ - { name: 'a', value: '', enabled: true }, - { name: 'b', value: '', enabled: true }, - { name: 'c', value: 'ccc', enabled: true }, - ], - }, - }), - ], - }, - }); - }); - - test('Imports data params as text', () => { - expect( - pluginHookImport(ctx, 'curl -H Content-Type:text/plain -d a -d b -d c=ccc https://yaak.app'), - ).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - method: 'POST', - url: 'https://yaak.app', - headers: [{ name: 'Content-Type', value: 'text/plain', enabled: true }], - bodyType: 'text/plain', - body: { text: 'a&b&c=ccc' }, - }), - ], - }, - }); - }); - - test('Imports multi-line JSON', () => { - expect( - pluginHookImport( - ctx, - `curl -H Content-Type:application/json -d $'{\n "foo":"bar"\n}' https://yaak.app`, - ), - ).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - method: 'POST', - url: 'https://yaak.app', - headers: [{ name: 'Content-Type', value: 'application/json', enabled: true }], - bodyType: 'application/json', - body: { text: '{\n "foo":"bar"\n}' }, - }), - ], - }, - }); - }); - - test('Imports multiple headers', () => { - expect( - pluginHookImport(ctx, 'curl -H Foo:bar --header Name -H AAA:bbb -H :ccc https://yaak.app'), - ).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - headers: [ - { name: 'Name', value: '', enabled: true }, - { name: 'Foo', value: 'bar', enabled: true }, - { name: 'AAA', value: 'bbb', enabled: true }, - { name: '', value: 'ccc', enabled: true }, - ], - }), - ], - }, - }); - }); - - test('Imports basic auth', () => { - expect(pluginHookImport(ctx, 'curl --user user:pass https://yaak.app')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - authenticationType: 'basic', - authentication: { - username: 'user', - password: 'pass', - }, - }), - ], - }, - }); - }); - - test('Imports digest auth', () => { - expect(pluginHookImport(ctx, 'curl --digest --user user:pass https://yaak.app')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - authenticationType: 'digest', - authentication: { - username: 'user', - password: 'pass', - }, - }), - ], - }, - }); - }); - - test('Imports cookie as header', () => { - expect(pluginHookImport(ctx, 'curl --cookie "foo=bar" https://yaak.app')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - headers: [{ name: 'Cookie', value: 'foo=bar', enabled: true }], - }), - ], - }, - }); - }); - - test('Imports query params from the URL', () => { - expect(pluginHookImport(ctx, 'curl "https://yaak.app?foo=bar&baz=a%20a"')).toEqual({ - resources: { - workspaces: [baseWorkspace()], - httpRequests: [ - baseRequest({ - url: 'https://yaak.app', - urlParameters: [ - { name: 'foo', value: 'bar', enabled: true }, - { name: 'baz', value: 'a%20a', enabled: true }, - ], - }), - ], - }, - }); - }); -}); - -const idCount: Partial> = {}; - -function baseRequest(mergeWith: Partial) { - idCount.http_request = (idCount.http_request ?? -1) + 1; - return { - id: `GENERATE_ID::HTTP_REQUEST_${idCount.http_request}`, - model: 'http_request', - authentication: {}, - authenticationType: null, - body: {}, - bodyType: null, - folderId: null, - headers: [], - method: 'GET', - name: '', - sortPriority: 0, - url: '', - urlParameters: [], - workspaceId: `GENERATE_ID::WORKSPACE_${idCount.workspace}`, - ...mergeWith, - }; -} - -function baseWorkspace(mergeWith: Partial = {}) { - idCount.workspace = (idCount.workspace ?? -1) + 1; - return { - id: `GENERATE_ID::WORKSPACE_${idCount.workspace}`, - model: 'workspace', - name: 'Curl Import', - ...mergeWith, - }; -} diff --git a/plugins/importer-curl/vite.config.js b/plugins/importer-curl/vite.config.js deleted file mode 100644 index ad176f6d..00000000 --- a/plugins/importer-curl/vite.config.js +++ /dev/null @@ -1,15 +0,0 @@ -import { resolve } from 'path'; -import { defineConfig } from 'vite'; - -export default defineConfig({ - build: { - lib: { - entry: resolve(__dirname, 'src/index.ts'), - fileName: 'index', - formats: ['es'], - }, - emptyOutDir: true, - sourcemap: true, - outDir: resolve(__dirname, '../../src-tauri/plugins/importer-curl'), - }, -}); diff --git a/plugins/importer-insomnia/package-lock.json b/plugins/importer-insomnia/package-lock.json deleted file mode 100644 index a7dd6a64..00000000 --- a/plugins/importer-insomnia/package-lock.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "importer-insomnia", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "importer-insomnia", - "version": "0.0.1", - "dependencies": { - "yaml": "^2.4.2" - } - }, - "node_modules/yaml": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", - "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14" - } - } - } -} diff --git a/plugins/importer-insomnia/package.json b/plugins/importer-insomnia/package.json deleted file mode 100644 index 7432d496..00000000 --- a/plugins/importer-insomnia/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "importer-insomnia", - "version": "0.0.1", - "dependencies": { - "yaml": "^2.4.2" - } -} diff --git a/plugins/importer-insomnia/src/index.ts b/plugins/importer-insomnia/src/index.ts deleted file mode 100644 index 152c2328..00000000 --- a/plugins/importer-insomnia/src/index.ts +++ /dev/null @@ -1,280 +0,0 @@ -import { - Environment, - Folder, - GrpcRequest, - HttpRequest, - Workspace, -} from '../../../src-web/lib/models'; -import '../../../src-web/plugin/runtime.d.ts'; - -type AtLeast = Partial & Pick; - -export interface ExportResources { - workspaces: AtLeast[]; - environments: AtLeast[]; - httpRequests: AtLeast[]; - grpcRequests: AtLeast[]; - folders: AtLeast[]; -} - -export function pluginHookImport(ctx: YaakContext, contents: string) { - let parsed: any; - - try { - parsed = JSON.parse(contents); - } catch (e) {} - - try { - parsed = parsed ?? YAML.parse(contents); - } catch (e) { - console.log('FAILED', e); - } - - if (!isJSObject(parsed)) return; - if (!Array.isArray(parsed.resources)) return; - - const resources: ExportResources = { - workspaces: [], - httpRequests: [], - grpcRequests: [], - environments: [], - folders: [], - }; - - // Import workspaces - const workspacesToImport = parsed.resources.filter(isWorkspace); - for (const workspaceToImport of workspacesToImport) { - const baseEnvironment = parsed.resources.find( - (r: any) => isEnvironment(r) && r.parentId === workspaceToImport._id, - ); - resources.workspaces.push({ - id: convertId(workspaceToImport._id), - createdAt: new Date(workspacesToImport.created ?? Date.now()).toISOString().replace('Z', ''), - updatedAt: new Date(workspacesToImport.updated ?? Date.now()).toISOString().replace('Z', ''), - model: 'workspace', - name: workspaceToImport.name, - variables: baseEnvironment ? parseVariables(baseEnvironment.data) : [], - }); - const environmentsToImport = parsed.resources.filter( - (r: any) => isEnvironment(r) && r.parentId === baseEnvironment?._id, - ); - resources.environments.push( - ...environmentsToImport.map((r: any) => importEnvironment(r, workspaceToImport._id)), - ); - - const nextFolder = (parentId: string) => { - const children = parsed.resources.filter((r: any) => r.parentId === parentId); - let sortPriority = 0; - for (const child of children) { - if (isRequestGroup(child)) { - resources.folders.push(importFolder(child, workspaceToImport._id)); - nextFolder(child._id); - } else if (isHttpRequest(child)) { - resources.httpRequests.push( - importHttpRequest(child, workspaceToImport._id, sortPriority++), - ); - } else if (isGrpcRequest(child)) { - resources.grpcRequests.push( - importGrpcRequest(child, workspaceToImport._id, sortPriority++), - ); - } - } - }; - - // Import folders - nextFolder(workspaceToImport._id); - } - - // Filter out any `null` values - resources.httpRequests = resources.httpRequests.filter(Boolean); - resources.grpcRequests = resources.grpcRequests.filter(Boolean); - resources.environments = resources.environments.filter(Boolean); - resources.workspaces = resources.workspaces.filter(Boolean); - - return { resources }; -} - -function importEnvironment(e: any, workspaceId: string): ExportResources['environments'][0] { - return { - id: convertId(e._id), - createdAt: new Date(e.created ?? Date.now()).toISOString().replace('Z', ''), - updatedAt: new Date(e.updated ?? Date.now()).toISOString().replace('Z', ''), - workspaceId: convertId(workspaceId), - model: 'environment', - name: e.name, - variables: Object.entries(e.data).map(([name, value]) => ({ - enabled: true, - name, - value: `${value}`, - })), - }; -} - -function importFolder(f: any, workspaceId: string): ExportResources['folders'][0] { - return { - id: convertId(f._id), - createdAt: new Date(f.created ?? Date.now()).toISOString().replace('Z', ''), - updatedAt: new Date(f.updated ?? Date.now()).toISOString().replace('Z', ''), - folderId: f.parentId === workspaceId ? null : convertId(f.parentId), - workspaceId: convertId(workspaceId), - model: 'folder', - name: f.name, - }; -} - -function importGrpcRequest( - r: any, - workspaceId: string, - sortPriority = 0, -): ExportResources['grpcRequests'][0] { - const parts = r.protoMethodName.split('/').filter((p: any) => p !== ''); - const service = parts[0] ?? null; - const method = parts[1] ?? null; - - return { - id: convertId(r._id), - createdAt: new Date(r.created ?? Date.now()).toISOString().replace('Z', ''), - updatedAt: new Date(r.updated ?? Date.now()).toISOString().replace('Z', ''), - workspaceId: convertId(workspaceId), - folderId: r.parentId === workspaceId ? null : convertId(r.parentId), - model: 'grpc_request', - sortPriority, - name: r.name, - url: convertSyntax(r.url), - service, - method, - message: r.body?.text ?? '', - metadata: (r.metadata ?? []) - .map((h: any) => ({ - enabled: !h.disabled, - name: h.name ?? '', - value: h.value ?? '', - })) - .filter(({ name, value }: any) => name !== '' || value !== ''), - }; -} - -function importHttpRequest( - r: any, - workspaceId: string, - sortPriority = 0, -): ExportResources['httpRequests'][0] { - let bodyType = null; - let body = {}; - if (r.body.mimeType === 'application/octet-stream') { - bodyType = 'binary'; - body = { filePath: r.body.fileName ?? '' }; - } else if (r.body?.mimeType === 'application/x-www-form-urlencoded') { - bodyType = 'application/x-www-form-urlencoded'; - body = { - form: (r.body.params ?? []).map((p: any) => ({ - enabled: !p.disabled, - name: p.name ?? '', - value: p.value ?? '', - })), - }; - } else if (r.body?.mimeType === 'multipart/form-data') { - bodyType = 'multipart/form-data'; - body = { - form: (r.body.params ?? []).map((p: any) => ({ - enabled: !p.disabled, - name: p.name ?? '', - value: p.value ?? '', - file: p.fileName ?? null, - })), - }; - } else if (r.body?.mimeType === 'application/graphql') { - bodyType = 'graphql'; - body = { text: convertSyntax(r.body.text ?? '') }; - } else if (r.body?.mimeType === 'application/json') { - bodyType = 'application/json'; - body = { text: convertSyntax(r.body.text ?? '') }; - } - - let authenticationType = null; - let authentication = {}; - if (r.authentication.type === 'bearer') { - authenticationType = 'bearer'; - authentication = { - token: convertSyntax(r.authentication.token), - }; - } else if (r.authentication.type === 'basic') { - authenticationType = 'basic'; - authentication = { - username: convertSyntax(r.authentication.username), - password: convertSyntax(r.authentication.password), - }; - } - - return { - id: convertId(r._id), - createdAt: new Date(r.created ?? Date.now()).toISOString().replace('Z', ''), - updatedAt: new Date(r.updated ?? Date.now()).toISOString().replace('Z', ''), - workspaceId: convertId(workspaceId), - folderId: r.parentId === workspaceId ? null : convertId(r.parentId), - model: 'http_request', - sortPriority, - name: r.name, - url: convertSyntax(r.url), - body, - bodyType, - authentication, - authenticationType, - method: r.method, - headers: (r.headers ?? []) - .map((h: any) => ({ - enabled: !h.disabled, - name: h.name ?? '', - value: h.value ?? '', - })) - .filter(({ name, value }: any) => name !== '' || value !== ''), - }; -} - -function parseVariables(data: Record) { - return Object.entries(data).map(([name, value]) => ({ - enabled: true, - name, - value: `${value}`, - })); -} - -function convertSyntax(variable: string): string { - if (!isJSString(variable)) return variable; - return variable.replaceAll(/{{\s*(_\.)?([^}]+)\s*}}/g, '${[$2]}'); -} - -function isWorkspace(obj: any) { - return isJSObject(obj) && obj._type === 'workspace'; -} - -function isRequestGroup(obj: any) { - return isJSObject(obj) && obj._type === 'request_group'; -} - -function isHttpRequest(obj: any) { - return isJSObject(obj) && obj._type === 'request'; -} - -function isGrpcRequest(obj: any) { - return isJSObject(obj) && obj._type === 'grpc_request'; -} - -function isEnvironment(obj: any) { - return isJSObject(obj) && obj._type === 'environment'; -} - -function isJSObject(obj: any) { - return Object.prototype.toString.call(obj) === '[object Object]'; -} - -function isJSString(obj: any) { - return Object.prototype.toString.call(obj) === '[object String]'; -} - -function convertId(id: string): string { - if (id.startsWith('GENERATE_ID::')) { - return id; - } - return `GENERATE_ID::${id}`; -} diff --git a/plugins/importer-insomnia/vite.config.js b/plugins/importer-insomnia/vite.config.js deleted file mode 100644 index 7a7d6121..00000000 --- a/plugins/importer-insomnia/vite.config.js +++ /dev/null @@ -1,15 +0,0 @@ -import { resolve } from 'path'; -import { defineConfig } from 'vite'; - -export default defineConfig({ - build: { - lib: { - entry: resolve(__dirname, 'src/index.ts'), - fileName: 'index', - formats: ['es'], - }, - emptyOutDir: true, - sourcemap: true, - outDir: resolve(__dirname, '../../src-tauri/plugins/importer-insomnia'), - }, -}); diff --git a/plugins/importer-postman/package-lock.json b/plugins/importer-postman/package-lock.json deleted file mode 100644 index 8a024c67..00000000 --- a/plugins/importer-postman/package-lock.json +++ /dev/null @@ -1,1505 +0,0 @@ -{ - "name": "importer-postman", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "importer-postman", - "version": "0.0.1", - "devDependencies": { - "vitest": "^1.4.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.0.tgz", - "integrity": "sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.0.tgz", - "integrity": "sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.0.tgz", - "integrity": "sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.0.tgz", - "integrity": "sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.0.tgz", - "integrity": "sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.0.tgz", - "integrity": "sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.0.tgz", - "integrity": "sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.0.tgz", - "integrity": "sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.0.tgz", - "integrity": "sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.0.tgz", - "integrity": "sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.0.tgz", - "integrity": "sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.0.tgz", - "integrity": "sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.0.tgz", - "integrity": "sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, - "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, - "node_modules/@vitest/expect": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.4.0.tgz", - "integrity": "sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==", - "dev": true, - "dependencies": { - "@vitest/spy": "1.4.0", - "@vitest/utils": "1.4.0", - "chai": "^4.3.10" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.4.0.tgz", - "integrity": "sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==", - "dev": true, - "dependencies": { - "@vitest/utils": "1.4.0", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.4.0.tgz", - "integrity": "sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==", - "dev": true, - "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/spy": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.4.0.tgz", - "integrity": "sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==", - "dev": true, - "dependencies": { - "tinyspy": "^2.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.4.0.tgz", - "integrity": "sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==", - "dev": true, - "dependencies": { - "diff-sequences": "^29.6.3", - "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", - "dev": true, - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, - "engines": { - "node": "*" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" - } - }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/js-tokens": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", - "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", - "dev": true - }, - "node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, - "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", - "dev": true, - "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.1" - } - }, - "node_modules/magic-string": { - "version": "0.30.8", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", - "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", - "dev": true, - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mlly": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", - "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", - "dev": true, - "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.0.3", - "ufo": "^1.3.2" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", - "dev": true, - "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" - } - }, - "node_modules/postcss": { - "version": "8.4.36", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.36.tgz", - "integrity": "sha512-/n7eumA6ZjFHAsbX30yhHup/IMkOmlmvtEi7P+6RMYf+bGJSUHc3geH4a0NSZxAz/RJfiS9tooCTs9LAVYUZKw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.1.0" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, - "node_modules/rollup": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.0.tgz", - "integrity": "sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg==", - "dev": true, - "dependencies": { - "@types/estree": "1.0.5" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.13.0", - "@rollup/rollup-android-arm64": "4.13.0", - "@rollup/rollup-darwin-arm64": "4.13.0", - "@rollup/rollup-darwin-x64": "4.13.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.13.0", - "@rollup/rollup-linux-arm64-gnu": "4.13.0", - "@rollup/rollup-linux-arm64-musl": "4.13.0", - "@rollup/rollup-linux-riscv64-gnu": "4.13.0", - "@rollup/rollup-linux-x64-gnu": "4.13.0", - "@rollup/rollup-linux-x64-musl": "4.13.0", - "@rollup/rollup-win32-arm64-msvc": "4.13.0", - "@rollup/rollup-win32-ia32-msvc": "4.13.0", - "@rollup/rollup-win32-x64-msvc": "4.13.0", - "fsevents": "~2.3.2" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/source-map-js": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.1.0.tgz", - "integrity": "sha512-9vC2SfsJzlej6MAaMPLu8HiBSHGdRAJ9hVFYN1ibZoNkeanmDmLUcIrj6G9DGL7XMJ54AKg/G75akXl1/izTOw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true - }, - "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", - "dev": true - }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/strip-literal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", - "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", - "dev": true, - "dependencies": { - "js-tokens": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/tinybench": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", - "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", - "dev": true - }, - "node_modules/tinypool": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", - "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", - "dev": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ufo": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.2.tgz", - "integrity": "sha512-eiutMaL0J2MKdhcOM1tUy13pIrYnyR87fEd8STJQFrrAwImwvlXkxlZEjaKah8r2viPohld08lt73QfLG1NxMg==", - "dev": true - }, - "node_modules/vite": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.6.tgz", - "integrity": "sha512-yYIAZs9nVfRJ/AiOLCA91zzhjsHUgMjB+EigzFb6W2XTLO8JixBCKCjvhKZaye+NKYHCrkv3Oh50dH9EdLU2RA==", - "dev": true, - "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - } - } - }, - "node_modules/vite-node": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.4.0.tgz", - "integrity": "sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==", - "dev": true, - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "vite": "^5.0.0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/vitest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.4.0.tgz", - "integrity": "sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==", - "dev": true, - "dependencies": { - "@vitest/expect": "1.4.0", - "@vitest/runner": "1.4.0", - "@vitest/snapshot": "1.4.0", - "@vitest/spy": "1.4.0", - "@vitest/utils": "1.4.0", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", - "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.2", - "vite": "^5.0.0", - "vite-node": "1.4.0", - "why-is-node-running": "^2.2.2" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.4.0", - "@vitest/ui": "1.4.0", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", - "dev": true, - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/plugins/importer-postman/package.json b/plugins/importer-postman/package.json deleted file mode 100644 index 73a2caf5..00000000 --- a/plugins/importer-postman/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "importer-postman", - "version": "0.0.1", - "devDependencies": { - "vitest": "^1.4.0" - } -} diff --git a/plugins/importer-postman/src/index.ts b/plugins/importer-postman/src/index.ts deleted file mode 100644 index fc529cde..00000000 --- a/plugins/importer-postman/src/index.ts +++ /dev/null @@ -1,256 +0,0 @@ -import { Environment, Folder, HttpRequest, Model, Workspace } from '../../../src-web/lib/models'; - -const POSTMAN_2_1_0_SCHEMA = 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json'; -const POSTMAN_2_0_0_SCHEMA = 'https://schema.getpostman.com/json/collection/v2.0.0/collection.json'; -const VALID_SCHEMAS = [POSTMAN_2_0_0_SCHEMA, POSTMAN_2_1_0_SCHEMA]; - -type AtLeast = Partial & Pick; - -interface ExportResources { - workspaces: AtLeast[]; - environments: AtLeast[]; - httpRequests: AtLeast[]; - folders: AtLeast[]; -} - -export function pluginHookImport( - ctx: any, - contents: string, -): { resources: ExportResources } | undefined { - console.log('CTX', ctx); - const root = parseJSONToRecord(contents); - if (root == null) return; - - const info = toRecord(root.info); - const isValidSchema = VALID_SCHEMAS.includes(info.schema); - if (!isValidSchema || !Array.isArray(root.item)) { - return; - } - - const globalAuth = importAuth(root.auth); - - const exportResources: ExportResources = { - workspaces: [], - environments: [], - httpRequests: [], - folders: [], - }; - - const workspace: ExportResources['workspaces'][0] = { - model: 'workspace', - id: generateId('workspace'), - name: info.name || 'Postman Import', - description: info.description || '', - variables: - root.variable?.map((v: any) => ({ - name: v.key, - value: v.value, - })) ?? [], - }; - exportResources.workspaces.push(workspace); - - const importItem = (v: Record, folderId: string | null = null) => { - if (typeof v.name === 'string' && Array.isArray(v.item)) { - const folder: ExportResources['folders'][0] = { - model: 'folder', - workspaceId: workspace.id, - id: generateId('folder'), - name: v.name, - folderId, - }; - exportResources.folders.push(folder); - for (const child of v.item) { - importItem(child, folder.id); - } - } else if (typeof v.name === 'string' && 'request' in v) { - const r = toRecord(v.request); - const bodyPatch = importBody(r.body); - const requestAuthPath = importAuth(r.auth); - const authPatch = requestAuthPath.authenticationType == null ? globalAuth : requestAuthPath; - const request: ExportResources['httpRequests'][0] = { - model: 'http_request', - id: generateId('http_request'), - workspaceId: workspace.id, - folderId, - name: v.name, - method: r.method || 'GET', - url: typeof r.url === 'string' ? r.url : toRecord(r.url).raw, - body: bodyPatch.body, - bodyType: bodyPatch.bodyType, - authentication: authPatch.authentication, - authenticationType: authPatch.authenticationType, - headers: [ - ...bodyPatch.headers, - ...authPatch.headers, - ...toArray(r.header).map((h) => { - return { - name: h.key, - value: h.value, - enabled: !h.disabled, - }; - }), - ], - }; - exportResources.httpRequests.push(request); - } else { - console.log('Unknown item', v, folderId); - } - }; - - for (const item of root.item) { - importItem(item); - } - - return { resources: convertTemplateSyntax(exportResources) }; -} - -function importAuth( - rawAuth: any, -): Pick { - const auth = toRecord(rawAuth); - if ('basic' in auth) { - return { - headers: [], - authenticationType: 'basic', - authentication: { - username: auth.basic.username || '', - password: auth.basic.password || '', - }, - }; - } else if ('bearer' in auth) { - return { - headers: [], - authenticationType: 'bearer', - authentication: { - token: auth.bearer.token || '', - }, - }; - } else { - // TODO: support other auth types - return { headers: [], authenticationType: null, authentication: {} }; - } -} - -function importBody(rawBody: any): Pick { - const body = toRecord(rawBody); - if ('graphql' in body) { - return { - headers: [ - { - name: 'Content-Type', - value: 'application/json', - enabled: true, - }, - ], - bodyType: 'graphql', - body: { - text: JSON.stringify( - { query: body.graphql.query, variables: parseJSONToRecord(body.graphql.variables) }, - null, - 2, - ), - }, - }; - } else if ('urlencoded' in body) { - return { - headers: [ - { - name: 'Content-Type', - value: 'application/x-www-form-urlencoded', - enabled: true, - }, - ], - bodyType: 'application/x-www-form-urlencoded', - body: { - form: toArray(body.urlencoded).map((f) => ({ - enabled: !f.disabled, - name: f.key ?? '', - value: f.value ?? '', - })), - }, - }; - } else if ('formdata' in body) { - return { - headers: [ - { - name: 'Content-Type', - value: 'multipart/form-data', - enabled: true, - }, - ], - bodyType: 'multipart/form-data', - body: { - form: toArray(body.formdata).map((f) => - f.src != null - ? { - enabled: !f.disabled, - contentType: f.contentType ?? null, - name: f.key ?? '', - file: f.src ?? '', - } - : { - enabled: !f.disabled, - name: f.key ?? '', - value: f.value ?? '', - }, - ), - }, - }; - } else if ('raw' in body) { - return { - headers: [ - { - name: 'Content-Type', - value: body.options?.raw?.language === 'json' ? 'application/json' : '', - enabled: true, - }, - ], - bodyType: body.options?.raw?.language === 'json' ? 'application/json' : 'other', - body: { - text: body.raw ?? '', - }, - }; - } else { - // TODO: support other body types - return { headers: [], bodyType: null, body: {} }; - } -} - -function parseJSONToRecord(jsonStr: string): Record | null { - try { - return toRecord(JSON.parse(jsonStr)); - } catch (err) {} - return null; -} - -function toRecord(value: any): Record { - if (Object.prototype.toString.call(value) === '[object Object]') return value; - else return {}; -} - -function toArray(value: any): any[] { - if (Object.prototype.toString.call(value) === '[object Array]') return value; - else return []; -} - -/** Recursively render all nested object properties */ -function convertTemplateSyntax(obj: T): T { - if (typeof obj === 'string') { - return obj.replace(/{{\s*(_\.)?([^}]+)\s*}}/g, '${[$2]}') as T; - } else if (Array.isArray(obj) && obj != null) { - return obj.map(convertTemplateSyntax) as T; - } else if (typeof obj === 'object' && obj != null) { - return Object.fromEntries( - Object.entries(obj).map(([k, v]) => [k, convertTemplateSyntax(v)]), - ) as T; - } else { - return obj; - } -} - -const idCount: Partial> = {}; - -function generateId(model: Model['model']): string { - idCount[model] = (idCount[model] ?? -1) + 1; - return `GENERATE_ID::${model.toUpperCase()}_${idCount[model]}`; -} diff --git a/plugins/importer-postman/tests/fixtures/nested.json b/plugins/importer-postman/tests/fixtures/nested.json deleted file mode 100644 index 0061656e..00000000 --- a/plugins/importer-postman/tests/fixtures/nested.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info": { - "_postman_id": "9e6dfada-256c-49ea-a38f-7d1b05b7ca2d", - "name": "New Collection", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json", - "_exporter_id": "18798" - }, - "item": [ - { - "name": "Top Folder", - "item": [ - { - "name": "Nested Folder", - "item": [ - { - "name": "Request 1", - "request": { - "method": "GET" - } - } - ] - }, - { - "name": "Request 2", - "request": { - "method": "GET" - } - } - ] - }, - { - "name": "Request 3", - "request": { - "method": "GET" - } - } - ] -} diff --git a/plugins/importer-postman/tests/index.test.ts b/plugins/importer-postman/tests/index.test.ts deleted file mode 100644 index ce294cb7..00000000 --- a/plugins/importer-postman/tests/index.test.ts +++ /dev/null @@ -1,90 +0,0 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'; -import { Model } from '../../../src-web/lib/models'; -import { pluginHookImport } from '../src'; - -let originalRandom = Math.random; - -describe('importer-postman', () => { - beforeEach(() => { - let i = 0; - // Psuedo-random number generator to ensure consistent ID generation - Math.random = vi.fn(() => ((i++ * 1000) % 133) / 100); - }); - - afterEach(() => { - Math.random = originalRandom; - }); - - const p = path.join(__dirname, 'fixtures'); - const fixtures = fs.readdirSync(p); - - for (const fixture of fixtures) { - test('Imports ' + fixture, () => { - const contents = fs.readFileSync(path.join(p, fixture), 'utf-8'); - const imported = pluginHookImport({}, contents); - const folder0 = newId('folder'); - const folder1 = newId('folder'); - expect(imported).toEqual({ - resources: expect.objectContaining({ - workspaces: [ - expect.objectContaining({ - id: newId('workspace'), - model: 'workspace', - name: 'New Collection', - }), - ], - folders: expect.arrayContaining([ - expect.objectContaining({ - id: folder0, - model: 'folder', - workspaceId: existingId('workspace'), - name: 'Top Folder', - }), - expect.objectContaining({ - folderId: folder0, - id: folder1, - model: 'folder', - workspaceId: existingId('workspace'), - name: 'Nested Folder', - }), - ]), - httpRequests: expect.arrayContaining([ - expect.objectContaining({ - id: newId('http_request'), - model: 'http_request', - name: 'Request 1', - workspaceId: existingId('workspace'), - folderId: folder1, - }), - expect.objectContaining({ - id: newId('http_request'), - model: 'http_request', - name: 'Request 2', - workspaceId: existingId('workspace'), - folderId: folder0, - }), - expect.objectContaining({ - id: newId('http_request'), - model: 'http_request', - name: 'Request 3', - workspaceId: existingId('workspace'), - folderId: null, - }), - ]), - }), - }); - }); - } -}); - -const idCount: Partial> = {}; -function newId(model: Model['model']): string { - idCount[model] = (idCount[model] ?? -1) + 1; - return `GENERATE_ID::${model.toUpperCase()}_${idCount[model]}`; -} - -function existingId(model: Model['model']): string { - return `GENERATE_ID::${model.toUpperCase()}_${idCount[model] ?? 0}`; -} diff --git a/plugins/importer-postman/tsconfig.json b/plugins/importer-postman/tsconfig.json deleted file mode 100644 index 20f016b6..00000000 --- a/plugins/importer-postman/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "target": "ESNext", - "useDefineForClassFields": true, - "module": "ESNext", - "lib": [ - "ESNext", - ], - "skipLibCheck": true, - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true - }, - "include": [ - "./src" - ] -} diff --git a/plugins/importer-postman/vite.config.js b/plugins/importer-postman/vite.config.js deleted file mode 100644 index 93e8a483..00000000 --- a/plugins/importer-postman/vite.config.js +++ /dev/null @@ -1,15 +0,0 @@ -import { resolve } from 'path'; -import { defineConfig } from 'vite'; - -export default defineConfig({ - build: { - lib: { - entry: resolve(__dirname, 'src/index.ts'), - fileName: 'index', - formats: ['es'], - }, - emptyOutDir: true, - sourcemap: true, - outDir: resolve(__dirname, '../../src-tauri/plugins/importer-postman'), - }, -}); diff --git a/plugins/importer-yaak/package-lock.json b/plugins/importer-yaak/package-lock.json deleted file mode 100644 index ed05c44a..00000000 --- a/plugins/importer-yaak/package-lock.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "importer-yaak", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "importer-yaak", - "version": "0.0.1" - } - } -} diff --git a/plugins/importer-yaak/package.json b/plugins/importer-yaak/package.json deleted file mode 100644 index eca40620..00000000 --- a/plugins/importer-yaak/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "importer-yaak", - "version": "0.0.1" -} diff --git a/plugins/importer-yaak/src/index.ts b/plugins/importer-yaak/src/index.ts deleted file mode 100644 index f50a13fd..00000000 --- a/plugins/importer-yaak/src/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -export function pluginHookImport(ctx: any, contents: string) { - let parsed; - try { - parsed = JSON.parse(contents); - } catch (err) { - return undefined; - } - - if (!isJSObject(parsed)) { - return undefined; - } - - const isYaakExport = 'yaakSchema' in parsed; - if (!isYaakExport) { - return; - } - - // Migrate v1 to v2 -- changes requests to httpRequests - if ('requests' in parsed.resources) { - parsed.resources.httpRequests = parsed.resources.requests; - delete parsed.resources['requests']; - } - - return { resources: parsed.resources }; // Should already be in the correct format -} - -export function isJSObject(obj: any) { - return Object.prototype.toString.call(obj) === '[object Object]'; -} diff --git a/plugins/importer-yaak/tests/index.test.ts b/plugins/importer-yaak/tests/index.test.ts deleted file mode 100644 index 38e44133..00000000 --- a/plugins/importer-yaak/tests/index.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { describe, expect, test } from 'vitest'; -import { pluginHookImport } from '../src'; - -const ctx = {}; - -describe('importer-yaak', () => { - test('Skips invalid imports', () => { - expect(pluginHookImport(ctx, 'not JSON')).toBeUndefined(); - expect(pluginHookImport(ctx, '[]')).toBeUndefined(); - expect(pluginHookImport(ctx, JSON.stringify({ resources: {} }))).toBeUndefined(); - }); - - test('converts schema 1 to 2', () => { - const imported = pluginHookImport( - ctx, - JSON.stringify({ - yaakSchema: 1, - resources: { - requests: [], - }, - }), - ); - - expect(imported).toEqual( - expect.objectContaining({ - resources: { - httpRequests: [], - }, - }), - ); - }); -}); diff --git a/plugins/importer-yaak/vite.config.js b/plugins/importer-yaak/vite.config.js deleted file mode 100644 index c52411a7..00000000 --- a/plugins/importer-yaak/vite.config.js +++ /dev/null @@ -1,15 +0,0 @@ -import { resolve } from 'path'; -import { defineConfig } from 'vite'; - -export default defineConfig({ - build: { - lib: { - entry: resolve(__dirname, 'src/index.ts'), - fileName: 'index', - formats: ['es'], - }, - emptyOutDir: true, - sourcemap: true, - outDir: resolve(__dirname, '../../src-tauri/plugins/importer-yaak'), - }, -}); diff --git a/proto/plugins/runtime.proto b/proto/plugins/runtime.proto new file mode 100644 index 00000000..e20498b1 --- /dev/null +++ b/proto/plugins/runtime.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package yaak.plugins.runtime; + +service PluginRuntime { + rpc hookImport (HookImportRequest) returns (HookResponse); + rpc hookResponseFilter (HookResponseFilterRequest) returns (HookResponse); + rpc hookExport (HookExportRequest) returns (HookResponse); +} + +message PluginInfo { + string plugin = 1; +} + +message HookResponse { + PluginInfo info = 1; + string data = 2; +} + +message HookImportRequest { + string data = 1; +} + +message HookResponseFilterRequest { + string filter = 1; + string body = 2; + string contentType = 3; +} + +message HookExportRequest { + string request = 1; +} diff --git a/scripts/copy-plugins.cjs b/scripts/copy-plugins.cjs new file mode 100644 index 00000000..f2f91af5 --- /dev/null +++ b/scripts/copy-plugins.cjs @@ -0,0 +1,23 @@ +const {readdirSync, cpSync} = require("node:fs"); +const {execSync} = require("node:child_process"); +const path = require("node:path"); +console.log('-----> Starting copy plugins script'); +const PLUGINS_DIR = process.env.YAAK_PLUGINS_DIR; +if (!PLUGINS_DIR) { + console.log("YAAK_PLUGINS_DIR is not set"); + process.exit(1); +} + +console.log('Building plugin repository at', PLUGINS_DIR); +execSync('npm ci'); +execSync('npm run build'); + +const pluginsRoot = path.join(PLUGINS_DIR, 'plugins'); +for (const name of readdirSync(pluginsRoot)) { + const dir = path.join(pluginsRoot, name); + if (name.startsWith('.')) continue; + const destDir = path.join(__dirname, '../../src-tauri/vendored/plugins/', name); + console.log(`Copying ${name} to ${destDir}`); + cpSync(path.join(dir, 'package.json'), path.join(destDir, 'package.json')); + cpSync(path.join(dir, 'build/index.js'), path.join(destDir, 'build/index.js')); +} diff --git a/scripts/download-protoc.cjs b/scripts/download-protoc.cjs new file mode 100644 index 00000000..4f963a29 --- /dev/null +++ b/scripts/download-protoc.cjs @@ -0,0 +1,62 @@ +const decompress = require('decompress'); +const Downloader = require("nodejs-file-downloader"); +const path = require("node:path"); +const fs = require("node:fs"); +const os = require("node:os"); +const rimraf = require('rimraf'); + +// `${process.platform}_${process.arch}` +const MAC_ARM = 'darwin_arm64'; +const MAC_X64 = 'darwin_x64'; +const LNX_X64 = 'linux_x64'; +const WIN_X64 = 'win32_x64'; + +const URL_MAP = { + [MAC_ARM]: 'https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-osx-aarch_64.zip', + [MAC_X64]: 'https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-osx-x86_64.zip', + [LNX_X64]: 'https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-linux-x86_64.zip', + [WIN_X64]: 'https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-win64.zip', +}; + +const DST_BIN_MAP = { + [MAC_ARM]: 'protoc-aarch64-apple-darwin', + [MAC_X64]: 'protoc-x86_64-apple-darwin', + [LNX_X64]: 'protoc-x86_64-unknown-linux-gnu', + [WIN_X64]: 'protoc-x86_64-pc-windows-msvc.exe', +}; + +const SRC_BIN_MAP = { + [MAC_ARM]: 'protoc', + [MAC_X64]: 'protoc', + [LNX_X64]: 'protoc', + [WIN_X64]: 'protoc.exe', +}; + +(async function () { + const key = `${process.platform}_${process.arch}`; + const url = URL_MAP[key]; + const tmpDir = path.join(os.tmpdir(), `${Math.random()}`); + const dstDir = path.join(__dirname, `..`, 'src-tauri', 'vendored', 'protoc'); + rimraf.sync(dstDir); + + // Download GitHub release artifact + const {filePath} = await new Downloader({url, directory: tmpDir,}).download(); + + // Decompress to the same directory + await decompress(filePath, tmpDir, {}); + + // Remove the original archive + fs.unlinkSync(filePath); + + // Copy binary + const binSrc = path.join(tmpDir, 'bin', SRC_BIN_MAP[key]); + const binDst = path.join(dstDir, DST_BIN_MAP[key]); + fs.cpSync(binSrc, binDst); + + // Copy other files + const includeSrc = path.join(tmpDir, 'include'); + const includeDst = path.join(dstDir, 'include'); + fs.cpSync(includeSrc, includeDst, {recursive: true}); + + console.log("Downloaded protoc to", dstDir); +})().catch(err => console.log('Script failed:', err)); diff --git a/src-tauri/.gitignore b/src-tauri/.gitignore index f4dfb82b..87f5040a 100644 --- a/src-tauri/.gitignore +++ b/src-tauri/.gitignore @@ -2,3 +2,4 @@ # will have compiled files and executables /target/ +vendored diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 80e0a64c..83269e8d 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2,16 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - [[package]] name = "addr2line" version = "0.22.0" @@ -170,18 +160,6 @@ dependencies = [ "zbus", ] -[[package]] -name = "ast_node" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab31376d309dd3bfc9cfb3c11c93ce0e0741bbe0354b20e7f8c60b044730b79" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.66", -] - [[package]] name = "async-broadcast" version = "0.7.1" @@ -404,7 +382,7 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower", "tower-layer", "tower-service", @@ -454,54 +432,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64-simd" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" -dependencies = [ - "simd-abstraction", -] - [[package]] name = "base64ct" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "better_scoped_tls" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794edcc9b3fb07bb4aecaa11f093fd45663b4feadb782d68303a2268bc2701de" -dependencies = [ - "scoped-tls", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bit_field" version = "0.10.2" @@ -749,7 +685,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver", "serde", "serde_json", "thiserror", @@ -918,23 +854,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" -[[package]] -name = "cooked-waker" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147be55d677052dabc6b22252d5dd0fd4c29c8c27aa4f2fbef0f94aa003b406f" - -[[package]] -name = "cookie" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" -dependencies = [ - "percent-encoding", - "time", - "version_check 0.9.4", -] - [[package]] name = "cookie" version = "0.18.1" @@ -946,30 +865,13 @@ dependencies = [ "version_check 0.9.4", ] -[[package]] -name = "cookie_store" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6" -dependencies = [ - "cookie 0.17.0", - "idna 0.3.0", - "log", - "publicsuffix", - "serde", - "serde_derive", - "serde_json", - "time", - "url", -] - [[package]] name = "cookie_store" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4934e6b7e8419148b6ef56950d277af8561060b56afd59e2aadf98b59fce6baa" dependencies = [ - "cookie 0.18.1", + "cookie", "idna 0.5.0", "log", "publicsuffix", @@ -1184,31 +1086,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - -[[package]] -name = "data-encoding" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" - -[[package]] -name = "data-url" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" - [[package]] name = "datetime" version = "0.5.2" @@ -1223,148 +1100,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "debugid" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" -dependencies = [ - "serde", - "uuid", -] - -[[package]] -name = "deno_ast" -version = "0.39.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "042645e6a505a359b288723ded5c8b30fdc4f70514a3bcd7a49221cc89c1ba90" -dependencies = [ - "anyhow", - "base64 0.21.7", - "deno_media_type", - "deno_terminal", - "dprint-swc-ext", - "once_cell", - "percent-encoding", - "serde", - "swc_atoms", - "swc_common", - "swc_config", - "swc_config_macro", - "swc_ecma_ast", - "swc_ecma_codegen", - "swc_ecma_codegen_macros", - "swc_ecma_loader", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_transforms_proposal", - "swc_ecma_transforms_react", - "swc_ecma_transforms_typescript", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_eq_ignore_macros", - "swc_macros_common", - "swc_visit", - "swc_visit_macros", - "text_lines", - "thiserror", - "unicode-width", - "url", -] - -[[package]] -name = "deno_console" -version = "0.155.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1010ed683985a70fce7f449c39b1d1a62675ab178b86f70eff954a161aa6dcaf" -dependencies = [ - "deno_core", -] - -[[package]] -name = "deno_core" -version = "0.284.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a5c809e81be26fcfbbce4275573251f6a156137b67059889e9e38f73e75b63" -dependencies = [ - "anyhow", - "bincode", - "bit-set", - "bit-vec", - "bytes", - "cooked-waker", - "deno_core_icudata", - "deno_ops", - "deno_unsync", - "futures", - "libc", - "memoffset", - "parking_lot", - "pin-project", - "serde", - "serde_json", - "serde_v8", - "smallvec", - "sourcemap", - "static_assertions", - "tokio", - "url", - "v8", -] - -[[package]] -name = "deno_core_icudata" -version = "0.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13951ea98c0a4c372f162d669193b4c9d991512de9f2381dd161027f34b26b1" - -[[package]] -name = "deno_media_type" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8978229b82552bf8457a0125aa20863f023619cfc21ebb007b1e571d68fd85b" -dependencies = [ - "data-url", - "serde", - "url", -] - -[[package]] -name = "deno_ops" -version = "0.160.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "517e54d41a2da6a69b8f534294334d79d9115ddd43aea88a5ceefdb717e6d85e" -dependencies = [ - "proc-macro-rules", - "proc-macro2", - "quote", - "strum", - "strum_macros", - "syn 2.0.66", - "thiserror", -] - -[[package]] -name = "deno_terminal" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e6337d4e7f375f8b986409a76fbeecfa4bd8a1343e63355729ae4befa058eaf" -dependencies = [ - "once_cell", - "termcolor", -] - -[[package]] -name = "deno_unsync" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7557a5e9278b9a5cc8056dc37062ea4344770bda4eeb5973c7cbb7ebf636b9a4" -dependencies = [ - "tokio", -] - [[package]] name = "der" version = "0.7.9" @@ -1417,7 +1152,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", + "rustc_version", "syn 1.0.109", ] @@ -1539,21 +1274,6 @@ dependencies = [ "serde", ] -[[package]] -name = "dprint-swc-ext" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "019d17f2c2457c5a70a7cf4505b1a562ca8ab168c0ac0c005744efbd29fcb8fe" -dependencies = [ - "num-bigint", - "rustc-hash", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_parser", - "text_lines", -] - [[package]] name = "dtoa" version = "1.0.9" @@ -1598,7 +1318,7 @@ checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" dependencies = [ "cc", "memchr", - "rustc_version 0.4.0", + "rustc_version", "toml 0.8.2", "vswhom", "winreg", @@ -1764,7 +1484,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ "memoffset", - "rustc_version 0.4.0", + "rustc_version", ] [[package]] @@ -1779,6 +1499,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.0.30" @@ -1857,27 +1583,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "from_variant" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc9cc75639b041067353b9bce2450d6847e547276c6fbe4487d7407980e07db" -dependencies = [ - "proc-macro2", - "swc_macros_common", - "syn 2.0.66", -] - -[[package]] -name = "fslock" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04412b8935272e3a9bae6f48c7bfff74c2911f60525404edfdd28e49884c3bfb" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "funty" version = "2.0.0" @@ -1894,21 +1599,6 @@ dependencies = [ "new_debug_unreachable", ] -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.30" @@ -1995,7 +1685,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ - "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -2300,7 +1989,7 @@ dependencies = [ "tauri-plugin-shell", "tokio", "tokio-stream", - "tonic", + "tonic 0.10.2", "tonic-reflection", "uuid", ] @@ -2357,15 +2046,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "gzip-header" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95cc527b92e6029a62960ad99aa8a6660faa4555fe5f731aab13aa6a921795a2" -dependencies = [ - "crc32fast", -] - [[package]] name = "h2" version = "0.3.26" @@ -2505,20 +2185,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "hstr" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96274be293b8877e61974a607105d09c84caebe9620b47774aa8a6b942042dd4" -dependencies = [ - "hashbrown 0.14.5", - "new_debug_unreachable", - "once_cell", - "phf 0.11.2", - "rustc-hash", - "triomphe", -] - [[package]] name = "html5ever" version = "0.26.0" @@ -2669,19 +2335,20 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", "hyper 1.3.1", "hyper-util", - "rustls 0.22.4", + "rustls 0.23.10", "rustls-pki-types", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tower-service", + "webpki-roots 0.26.2", ] [[package]] @@ -2791,12 +2458,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "if_chain" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" - [[package]] name = "image" version = "0.24.9" @@ -2883,18 +2544,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "is-macro" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a85abdc13717906baccb5a1e435556ce0df215f242892f721dff62bf25288f" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "is-terminal" version = "0.4.12" @@ -3340,6 +2989,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "native-tls" version = "0.2.12" @@ -3440,18 +3095,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-bigint" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" -dependencies = [ - "num-integer", - "num-traits", - "rand 0.8.5", - "serde", -] - [[package]] name = "num-bigint-dig" version = "0.8.4" @@ -3830,12 +3473,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "outref" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" - [[package]] name = "overload" version = "0.1.1" @@ -3932,6 +3569,16 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.2.6", +] + [[package]] name = "phf" version = "0.8.0" @@ -4150,6 +3797,24 @@ dependencies = [ "time", ] +[[package]] +name = "plugin_runtime" +version = "0.1.0" +dependencies = [ + "anyhow", + "log", + "prost", + "rand 0.8.5", + "reqwest", + "serde", + "serde_json", + "tauri", + "tauri-plugin-shell", + "tokio", + "tonic 0.11.0", + "tonic-build", +] + [[package]] name = "png" version = "0.17.13" @@ -4196,6 +3861,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.66", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -4246,29 +3921,6 @@ version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" -[[package]] -name = "proc-macro-rules" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c277e4e643ef00c1233393c673f655e3672cf7eb3ba08a00bdd0ea59139b5f" -dependencies = [ - "proc-macro-rules-macros", - "proc-macro2", - "syn 2.0.66", -] - -[[package]] -name = "proc-macro-rules-macros" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "207fffb0fe655d1d47f6af98cc2793405e85929bdbc420d685554ff07be27ac7" -dependencies = [ - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "proc-macro2" version = "1.0.85" @@ -4288,6 +3940,27 @@ dependencies = [ "prost-derive", ] +[[package]] +name = "prost-build" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +dependencies = [ + "bytes", + "heck 0.5.0", + "itertools", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.66", + "tempfile", +] + [[package]] name = "prost-derive" version = "0.12.6" @@ -4342,15 +4015,6 @@ version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" -[[package]] -name = "psm" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" -dependencies = [ - "cc", -] - [[package]] name = "ptr_meta" version = "0.1.4" @@ -4399,6 +4063,53 @@ dependencies = [ "memchr", ] +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.23.10", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring", + "rustc-hash", + "rustls 0.23.10", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -4617,15 +4328,15 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "async-compression", "base64 0.22.1", "bytes", - "cookie 0.17.0", - "cookie_store 0.20.0", + "cookie", + "cookie_store", "encoding_rs", "futures-core", "futures-util", @@ -4634,7 +4345,7 @@ dependencies = [ "http-body 1.0.0", "http-body-util", "hyper 1.3.1", - "hyper-rustls 0.26.0", + "hyper-rustls 0.27.2", "hyper-tls", "hyper-util", "ipnet", @@ -4646,17 +4357,18 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.4", + "quinn", + "rustls 0.23.10", "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tokio-util", "tower-service", "url", @@ -4675,7 +4387,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0b36498c7452f11b1833900f31fbb01fc46be20992a50269c88cf59d79f54e9" dependencies = [ "bytes", - "cookie_store 0.21.0", + "cookie_store", "reqwest", "url", ] @@ -4796,22 +4508,13 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.23", + "semver", ] [[package]] @@ -4841,11 +4544,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ - "log", + "once_cell", "ring", "rustls-pki-types", "rustls-webpki 0.102.4", @@ -4923,12 +4626,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "ryu-js" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" - [[package]] name = "same-file" version = "1.0.6" @@ -5044,15 +4741,6 @@ dependencies = [ "thin-slice", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.23" @@ -5062,12 +4750,6 @@ dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.203" @@ -5115,7 +4797,6 @@ version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ - "indexmap 2.2.6", "itoa 1.0.11", "ryu", "serde", @@ -5153,19 +4834,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_v8" -version = "0.193.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21ec612dfc7ab70330b5405e8015b25e637bbfe1d79c4bd173557933aea66e76" -dependencies = [ - "num-bigint", - "serde", - "smallvec", - "thiserror", - "v8", -] - [[package]] name = "serde_with" version = "3.8.1" @@ -5241,17 +4909,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "sha-1" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha1" version = "0.10.6" @@ -5312,15 +4969,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "simd-abstraction" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" -dependencies = [ - "outref", -] - [[package]] name = "simd-adler32" version = "0.3.7" @@ -5354,17 +5002,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "smartstring" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" -dependencies = [ - "autocfg", - "static_assertions", - "version_check 0.9.4", -] - [[package]] name = "socket2" version = "0.5.7" @@ -5425,25 +5062,6 @@ dependencies = [ "system-deps", ] -[[package]] -name = "sourcemap" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208d40b9e8cad9f93613778ea295ed8f3c2b1824217c6cfc7219d3f6f45b96d4" -dependencies = [ - "base64-simd", - "bitvec", - "data-encoding", - "debugid", - "if_chain", - "rustc-hash", - "rustc_version 0.2.3", - "serde", - "serde_json", - "unicode-id-start", - "url", -] - [[package]] name = "spin" version = "0.5.2" @@ -5691,19 +5309,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "stacker" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" -dependencies = [ - "cc", - "cfg-if", - "libc", - "psm", - "winapi", -] - [[package]] name = "state" version = "0.6.0" @@ -5745,18 +5350,6 @@ dependencies = [ "quote", ] -[[package]] -name = "string_enum" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e383308aebc257e7d7920224fa055c632478d92744eca77f99be8fa1545b90" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.66", -] - [[package]] name = "stringprep" version = "0.1.5" @@ -5774,384 +5367,12 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.66", -] - [[package]] name = "subtle" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" -[[package]] -name = "swc_atoms" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6567e4e67485b3e7662b486f1565bdae54bd5b9d6b16b2ba1a9babb1e42125" -dependencies = [ - "hstr", - "once_cell", - "rustc-hash", - "serde", -] - -[[package]] -name = "swc_cached" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83406221c501860fce9c27444f44125eafe9e598b8b81be7563d7036784cd05c" -dependencies = [ - "ahash 0.8.11", - "anyhow", - "dashmap", - "once_cell", - "regex", - "serde", -] - -[[package]] -name = "swc_common" -version = "0.33.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2f9706038906e66f3919028f9f7a37f3ed552f1b85578e93f4468742e2da438" -dependencies = [ - "ast_node", - "better_scoped_tls", - "cfg-if", - "either", - "from_variant", - "new_debug_unreachable", - "num-bigint", - "once_cell", - "rustc-hash", - "serde", - "siphasher", - "sourcemap", - "swc_atoms", - "swc_eq_ignore_macros", - "swc_visit", - "tracing", - "unicode-width", - "url", -] - -[[package]] -name = "swc_config" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be1a689e146be1eae53139482cb061dcf0fa01dff296bbe7b96fff92d8e2936" -dependencies = [ - "anyhow", - "indexmap 2.2.6", - "serde", - "serde_json", - "swc_cached", - "swc_config_macro", -] - -[[package]] -name = "swc_config_macro" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c5f56139042c1a95b54f5ca48baa0e0172d369bcc9d3d473dad1de36bae8399" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.66", -] - -[[package]] -name = "swc_ecma_ast" -version = "0.113.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1690cc0c9ab60b44ac0225ba1e231ac532f7ba1d754df761c6ee607561afae" -dependencies = [ - "bitflags 2.5.0", - "is-macro", - "num-bigint", - "phf 0.11.2", - "scoped-tls", - "serde", - "string_enum", - "swc_atoms", - "swc_common", - "unicode-id-start", -] - -[[package]] -name = "swc_ecma_codegen" -version = "0.149.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fef147127a2926ca26171c7afcbf028ff86dc543ced87d316713f25620a15b9" -dependencies = [ - "memchr", - "num-bigint", - "once_cell", - "rustc-hash", - "serde", - "sourcemap", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_codegen_macros", - "tracing", -] - -[[package]] -name = "swc_ecma_codegen_macros" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090e409af49c8d1a3c13b3aab1ed09dd4eda982207eb3e63c2ad342f072b49c8" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.66", -] - -[[package]] -name = "swc_ecma_loader" -version = "0.45.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c68f934bd2c51f29c4ad0bcae09924e9dc30d7ce0680367d45b42d40338a67" -dependencies = [ - "anyhow", - "pathdiff", - "serde", - "swc_atoms", - "swc_common", - "tracing", -] - -[[package]] -name = "swc_ecma_parser" -version = "0.144.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0499e69683ae5d67a20ff0279b94bc90f29df7922a46331b54d5dd367bf89570" -dependencies = [ - "either", - "new_debug_unreachable", - "num-bigint", - "num-traits", - "phf 0.11.2", - "serde", - "smallvec", - "smartstring", - "stacker", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "tracing", - "typed-arena", -] - -[[package]] -name = "swc_ecma_transforms_base" -version = "0.138.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eddb95c2bdad1c9c29edf35712e1e0f9b9ddc1cdb5ba2d582fd93468cb075a03" -dependencies = [ - "better_scoped_tls", - "bitflags 2.5.0", - "indexmap 2.2.6", - "once_cell", - "phf 0.11.2", - "rustc-hash", - "serde", - "smallvec", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_utils", - "swc_ecma_visit", - "tracing", -] - -[[package]] -name = "swc_ecma_transforms_classes" -version = "0.127.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53043d81678f3c693604eeb1d1f0fe6ba10f303104a31b954dbeebed9cadf530" -dependencies = [ - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_macros" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500a1dadad1e0e41e417d633b3d6d5de677c9e0d3159b94ba3348436cdb15aab" -dependencies = [ - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.66", -] - -[[package]] -name = "swc_ecma_transforms_proposal" -version = "0.172.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbc414d6a9c5479cfb4c6e92fcdac504582bd7bc89a0ed7f8808b72dc8bd1f0" -dependencies = [ - "either", - "rustc-hash", - "serde", - "smallvec", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_classes", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_react" -version = "0.184.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "565a76c4ca47ce31d78301c0beab878e4c2cb4f624691254d834ec8c0e236755" -dependencies = [ - "base64 0.21.7", - "dashmap", - "indexmap 2.2.6", - "once_cell", - "serde", - "sha-1", - "string_enum", - "swc_atoms", - "swc_common", - "swc_config", - "swc_ecma_ast", - "swc_ecma_parser", - "swc_ecma_transforms_base", - "swc_ecma_transforms_macros", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_transforms_typescript" -version = "0.189.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e209026c1d3c577cafac257d87e7c0d23119282fbdc8ed03d7f56077e95beb90" -dependencies = [ - "ryu-js", - "serde", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_transforms_base", - "swc_ecma_transforms_react", - "swc_ecma_utils", - "swc_ecma_visit", -] - -[[package]] -name = "swc_ecma_utils" -version = "0.128.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5242670bc74e0a0b64b9d4912b37be36944517ce0881314162aeb4381272c3" -dependencies = [ - "indexmap 2.2.6", - "num_cpus", - "once_cell", - "rustc-hash", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_visit", - "tracing", - "unicode-id", -] - -[[package]] -name = "swc_ecma_visit" -version = "0.99.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a6ce28ad8e591f8d627f1f9cb26b25e5d83052a9bc1b674d95fc28040cfa98" -dependencies = [ - "num-bigint", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_visit", - "tracing", -] - -[[package]] -name = "swc_eq_ignore_macros" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "695a1d8b461033d32429b5befbf0ad4d7a2c4d6ba9cd5ba4e0645c615839e8e4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "swc_macros_common" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91745f3561057493d2da768437c427c0e979dff7396507ae02f16c981c4a8466" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "swc_visit" -version = "0.5.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043d11fe683dcb934583ead49405c0896a5af5face522e4682c16971ef7871b9" -dependencies = [ - "either", - "swc_visit_macros", -] - -[[package]] -name = "swc_visit_macros" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae9ef18ff8daffa999f729db056d2821cd2f790f3a11e46422d19f46bb193e7" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.66", -] - [[package]] name = "swift-rs" version = "1.0.6" @@ -6203,6 +5424,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "sys-locale" version = "0.3.1" @@ -6382,7 +5609,7 @@ dependencies = [ "heck 0.5.0", "json-patch", "schemars", - "semver 1.0.23", + "semver", "serde", "serde_json", "tauri-utils", @@ -6405,7 +5632,7 @@ dependencies = [ "png", "proc-macro2", "quote", - "semver 1.0.23", + "semver", "serde", "serde_json", "sha2", @@ -6576,7 +5803,7 @@ dependencies = [ "infer", "minisign-verify", "reqwest", - "semver 1.0.23", + "semver", "serde", "serde_json", "tar", @@ -6671,7 +5898,7 @@ dependencies = [ "quote", "regex", "schemars", - "semver 1.0.23", + "semver", "serde", "serde_json", "serde_with", @@ -6720,24 +5947,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "text_lines" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fd5828de7deaa782e1dd713006ae96b3bee32d3279b79eb67ecf8072c059bcf" -dependencies = [ - "serde", -] - [[package]] name = "thin-slice" version = "0.1.1" @@ -6844,7 +6053,6 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", @@ -6896,11 +6104,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.4", + "rustls 0.23.10", "rustls-pki-types", "tokio", ] @@ -7015,6 +6223,46 @@ dependencies = [ "tracing", ] +[[package]] +name = "tonic" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.21.7", + "bytes", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.29", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-build" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "quote", + "syn 2.0.66", +] + [[package]] name = "tonic-reflection" version = "0.10.2" @@ -7025,7 +6273,7 @@ dependencies = [ "prost-types", "tokio", "tokio-stream", - "tonic", + "tonic 0.10.2", ] [[package]] @@ -7142,28 +6390,12 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "triomphe" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b2cb4fbb9995eeb36ac86fadf24031ccd58f99d6b4b2d7b911db70bddb80d90" -dependencies = [ - "serde", - "stable_deref_trait", -] - [[package]] name = "try-lock" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "typed-arena" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" - [[package]] name = "typenum" version = "1.17.0" @@ -7237,18 +6469,6 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" -[[package]] -name = "unicode-id" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" - -[[package]] -name = "unicode-id-start" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02aebfa694eccbbbffdd92922c7de136b9fe764396d2f10e21bce1681477cfc1" - [[package]] name = "unicode-ident" version = "1.0.12" @@ -7352,21 +6572,6 @@ dependencies = [ "getrandom 0.2.15", ] -[[package]] -name = "v8" -version = "0.92.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234589219e37a7496cbce73d971586db8369871be2420372c45a579b6a919b15" -dependencies = [ - "bitflags 2.5.0", - "fslock", - "gzip-header", - "home", - "miniz_oxide", - "once_cell", - "which", -] - [[package]] name = "valuable" version = "0.1.0" @@ -7661,19 +6866,6 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" -[[package]] -name = "which" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bf3ea8596f3a0dd5980b46430f2058dfe2c36a27ccfbb1845d6fbfcd9ba6e14" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", - "windows-sys 0.48.0", -] - [[package]] name = "whoami" version = "1.5.1" @@ -8151,15 +7343,13 @@ dependencies = [ "chrono", "cocoa", "datetime", - "deno_ast", - "deno_console", - "deno_core", "grpc", "hex_color", "http 1.1.0", "log", "objc", "openssl-sys", + "plugin_runtime", "rand 0.8.5", "regex", "reqwest", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index df2f3249..69d0914c 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,4 +1,4 @@ -workspace = { members = ["grpc", "templates"] } +workspace = { members = ["grpc", "templates", "tauri-plugin-plugin-runtime"] } [package] name = "yaak-app" @@ -26,13 +26,11 @@ openssl-sys = { version = "0.9", features = ["vendored"] } # For Ubuntu installa [dependencies] grpc = { path = "./grpc" } templates = { path = "./templates" } +plugin_runtime = { path = "tauri-plugin-plugin-runtime" } anyhow = "1.0.86" base64 = "0.22.0" chrono = { version = "0.4.31", features = ["serde"] } datetime = "0.5.2" -deno_ast = { version = "0.39.0", features = ["transpiling"] } -deno_console = "0.155.0" -deno_core = { version = "0.284.0" } hex_color = "3.0.0" http = "1" log = "0.4.21" diff --git a/src-tauri/grpc/src/proto.rs b/src-tauri/grpc/src/proto.rs index 91e627c1..5de2e44e 100644 --- a/src-tauri/grpc/src/proto.rs +++ b/src-tauri/grpc/src/proto.rs @@ -35,7 +35,7 @@ pub async fn fill_pool_from_files( let desc_path = temp_dir().join(random_file_name); let global_import_dir = app_handle .path() - .resolve("protoc-vendored/include", BaseDirectory::Resource) + .resolve("protoc-include", BaseDirectory::Resource) .expect("failed to resolve protoc include directory"); let mut args = vec![ diff --git a/src-tauri/plugins/exporter-curl/index.mjs b/src-tauri/plugins/exporter-curl/index.mjs deleted file mode 100644 index 5d490123..00000000 --- a/src-tauri/plugins/exporter-curl/index.mjs +++ /dev/null @@ -1,37 +0,0 @@ -const o = `\\ - `; -function y(p, t) { - var f, r, u, l, s, c; - const n = ["curl"]; - t.method && n.push("-X", t.method), t.url && n.push(i(t.url)), n.push(o); - for (const a of (t.urlParameters ?? []).filter(h)) - n.push("--url-query", i(`${a.name}=${a.value}`)), n.push(o); - for (const a of (t.headers ?? []).filter(h)) - n.push("--header", i(`${a.name}: ${a.value}`)), n.push(o); - if (Array.isArray((f = t.body) == null ? void 0 : f.form)) { - const a = t.bodyType === "multipart/form-data" ? "--form" : "--data"; - for (const e of (((r = t.body) == null ? void 0 : r.form) ?? []).filter(h)) { - if (e.file) { - let d = `${e.name}=@${e.file}`; - d += e.contentType ? `;type=${e.contentType}` : "", n.push(a, d); - } else - n.push(a, i(`${e.name}=${e.value}`)); - n.push(o); - } - } else - typeof ((u = t.body) == null ? void 0 : u.text) == "string" && (n.push("--data-raw", `$${i(t.body.text)}`), n.push(o)); - return (t.authenticationType === "basic" || t.authenticationType === "digest") && (t.authenticationType === "digest" && n.push("--digest"), n.push( - "--user", - i(`${((l = t.authentication) == null ? void 0 : l.username) ?? ""}:${((s = t.authentication) == null ? void 0 : s.password) ?? ""}`) - ), n.push(o)), t.authenticationType === "bearer" && (n.push("--header", i(`Authorization: Bearer ${((c = t.authentication) == null ? void 0 : c.token) ?? ""}`)), n.push(o)), n[n.length - 1] === o && n.splice(n.length - 1, 1), n.join(" "); -} -function i(p) { - return `'${p.replace(/'/g, "\\'")}'`; -} -function h(p) { - return p.enabled !== !1 && !!p.name; -} -export { - y as pluginHookExport -}; -//# sourceMappingURL=index.mjs.map diff --git a/src-tauri/plugins/exporter-curl/index.mjs.map b/src-tauri/plugins/exporter-curl/index.mjs.map deleted file mode 100644 index 6714617d..00000000 --- a/src-tauri/plugins/exporter-curl/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../plugins/exporter-curl/src/index.ts"],"sourcesContent":["import { HttpRequest } from '../../../src-web/lib/models';\n\nconst NEWLINE = '\\\\\\n ';\n\nexport function pluginHookExport(_: any, request: Partial) {\n const xs = ['curl'];\n\n // Add method and URL all on first line\n if (request.method) xs.push('-X', request.method);\n if (request.url) xs.push(quote(request.url));\n\n xs.push(NEWLINE);\n\n // Add URL params\n for (const p of (request.urlParameters ?? []).filter(onlyEnabled)) {\n xs.push('--url-query', quote(`${p.name}=${p.value}`));\n xs.push(NEWLINE);\n }\n\n // Add headers\n for (const h of (request.headers ?? []).filter(onlyEnabled)) {\n xs.push('--header', quote(`${h.name}: ${h.value}`));\n xs.push(NEWLINE);\n }\n\n // Add form params\n if (Array.isArray(request.body?.form)) {\n const flag = request.bodyType === 'multipart/form-data' ? '--form' : '--data';\n for (const p of (request.body?.form ?? []).filter(onlyEnabled)) {\n if (p.file) {\n let v = `${p.name}=@${p.file}`;\n v += p.contentType ? `;type=${p.contentType}` : '';\n xs.push(flag, v);\n } else {\n xs.push(flag, quote(`${p.name}=${p.value}`));\n }\n xs.push(NEWLINE);\n }\n } else if (typeof request.body?.text === 'string') {\n // --data-raw $'...' to do special ANSI C quoting\n xs.push('--data-raw', `$${quote(request.body.text)}`);\n xs.push(NEWLINE);\n }\n\n // Add basic/digest authentication\n if (request.authenticationType === 'basic' || request.authenticationType === 'digest') {\n if (request.authenticationType === 'digest') xs.push('--digest');\n xs.push(\n '--user',\n quote(`${request.authentication?.username ?? ''}:${request.authentication?.password ?? ''}`),\n );\n xs.push(NEWLINE);\n }\n\n // Add bearer authentication\n if (request.authenticationType === 'bearer') {\n xs.push('--header', quote(`Authorization: Bearer ${request.authentication?.token ?? ''}`));\n xs.push(NEWLINE);\n }\n\n // Remove trailing newline\n if (xs[xs.length - 1] === NEWLINE) {\n xs.splice(xs.length - 1, 1);\n }\n\n return xs.join(' ');\n}\n\nfunction quote(arg: string): string {\n const escaped = arg.replace(/'/g, \"\\\\'\");\n return `'${escaped}'`;\n}\n\nfunction onlyEnabled(v: { name?: string; enabled?: boolean }): boolean {\n return v.enabled !== false && !!v.name;\n}\n"],"names":["NEWLINE","pluginHookExport","_","request","_a","_b","_c","_d","_e","_f","xs","quote","p","onlyEnabled","h","flag","v","arg"],"mappings":"AAEA,MAAMA,IAAU;AAAA;AAEA,SAAAC,EAAiBC,GAAQC,GAA+B;AAFxE,MAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC;AAGQ,QAAAC,IAAK,CAAC,MAAM;AAGlB,EAAIP,EAAQ,UAAWO,EAAA,KAAK,MAAMP,EAAQ,MAAM,GAC5CA,EAAQ,OAAKO,EAAG,KAAKC,EAAMR,EAAQ,GAAG,CAAC,GAE3CO,EAAG,KAAKV,CAAO;AAGf,aAAWY,MAAMT,EAAQ,iBAAiB,IAAI,OAAOU,CAAW;AAC3D,IAAAH,EAAA,KAAK,eAAeC,EAAM,GAAGC,EAAE,IAAI,IAAIA,EAAE,KAAK,EAAE,CAAC,GACpDF,EAAG,KAAKV,CAAO;AAIjB,aAAWc,MAAMX,EAAQ,WAAW,IAAI,OAAOU,CAAW;AACrD,IAAAH,EAAA,KAAK,YAAYC,EAAM,GAAGG,EAAE,IAAI,KAAKA,EAAE,KAAK,EAAE,CAAC,GAClDJ,EAAG,KAAKV,CAAO;AAIjB,MAAI,MAAM,SAAQI,IAAAD,EAAQ,SAAR,gBAAAC,EAAc,IAAI,GAAG;AACrC,UAAMW,IAAOZ,EAAQ,aAAa,wBAAwB,WAAW;AAC1D,eAAAS,QAAMP,IAAAF,EAAQ,SAAR,gBAAAE,EAAc,SAAQ,CAAI,GAAA,OAAOQ,CAAW,GAAG;AAC9D,UAAID,EAAE,MAAM;AACV,YAAII,IAAI,GAAGJ,EAAE,IAAI,KAAKA,EAAE,IAAI;AAC5B,QAAAI,KAAKJ,EAAE,cAAc,SAASA,EAAE,WAAW,KAAK,IAC7CF,EAAA,KAAKK,GAAMC,CAAC;AAAA,MAAA;AAEZ,QAAAN,EAAA,KAAKK,GAAMJ,EAAM,GAAGC,EAAE,IAAI,IAAIA,EAAE,KAAK,EAAE,CAAC;AAE7C,MAAAF,EAAG,KAAKV,CAAO;AAAA,IACjB;AAAA,EACS;AAAA,IAAA,SAAOM,IAAAH,EAAQ,SAAR,gBAAAG,EAAc,SAAS,aAEpCI,EAAA,KAAK,cAAc,IAAIC,EAAMR,EAAQ,KAAK,IAAI,CAAC,EAAE,GACpDO,EAAG,KAAKV,CAAO;AAIjB,UAAIG,EAAQ,uBAAuB,WAAWA,EAAQ,uBAAuB,cACvEA,EAAQ,uBAAuB,YAAUO,EAAG,KAAK,UAAU,GAC5DA,EAAA;AAAA,IACD;AAAA,IACAC,EAAM,KAAGJ,IAAAJ,EAAQ,mBAAR,gBAAAI,EAAwB,aAAY,EAAE,MAAIC,IAAAL,EAAQ,mBAAR,gBAAAK,EAAwB,aAAY,EAAE,EAAE;AAAA,EAAA,GAE7FE,EAAG,KAAKV,CAAO,IAIbG,EAAQ,uBAAuB,aAC9BO,EAAA,KAAK,YAAYC,EAAM,2BAAyBF,IAAAN,EAAQ,mBAAR,gBAAAM,EAAwB,UAAS,EAAE,EAAE,CAAC,GACzFC,EAAG,KAAKV,CAAO,IAIbU,EAAGA,EAAG,SAAS,CAAC,MAAMV,KACxBU,EAAG,OAAOA,EAAG,SAAS,GAAG,CAAC,GAGrBA,EAAG,KAAK,GAAG;AACpB;AAEA,SAASC,EAAMM,GAAqB;AAElC,SAAO,IADSA,EAAI,QAAQ,MAAM,KAAK,CACrB;AACpB;AAEA,SAASJ,EAAYG,GAAkD;AACrE,SAAOA,EAAE,YAAY,MAAS,CAAC,CAACA,EAAE;AACpC;"} \ No newline at end of file diff --git a/src-tauri/plugins/filter-jsonpath/index.mjs b/src-tauri/plugins/filter-jsonpath/index.mjs deleted file mode 100644 index 37d99330..00000000 --- a/src-tauri/plugins/filter-jsonpath/index.mjs +++ /dev/null @@ -1,3192 +0,0 @@ -var Xe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function Nt(ce) { - return ce && ce.__esModule && Object.prototype.hasOwnProperty.call(ce, "default") ? ce.default : ce; -} -function Be(ce) { - throw new Error('Could not dynamically require "' + ce + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); -} -var Ve = { exports: {} }; -/*! jsonpath 1.1.1 */ -(function(ce, Ne) { - (function(T) { - ce.exports = T(); - })(function() { - return function T(L, B, v) { - function y(E, d) { - if (!B[E]) { - if (!L[E]) { - var a = typeof Be == "function" && Be; - if (!d && a) - return a(E, !0); - if (D) - return D(E, !0); - var o = new Error("Cannot find module '" + E + "'"); - throw o.code = "MODULE_NOT_FOUND", o; - } - var m = B[E] = { exports: {} }; - L[E][0].call(m.exports, function(s) { - var c = L[E][1][s]; - return y(c || s); - }, m, m.exports, T, L, B, v); - } - return B[E].exports; - } - for (var D = typeof Be == "function" && Be, S = 0; S < v.length; S++) - y(v[S]); - return y; - }({ "./aesprim": [function(T, L, B) { - (function(v, y) { - y(typeof B < "u" ? B : v.esprima = {}); - })(this, function(v) { - var y, D, S, E, d, a, o, m, s, c, r, g, b, h, n, i, p, f; - y = { - BooleanLiteral: 1, - EOF: 2, - Identifier: 3, - Keyword: 4, - NullLiteral: 5, - NumericLiteral: 6, - Punctuator: 7, - StringLiteral: 8, - RegularExpression: 9 - }, D = {}, D[y.BooleanLiteral] = "Boolean", D[y.EOF] = "", D[y.Identifier] = "Identifier", D[y.Keyword] = "Keyword", D[y.NullLiteral] = "Null", D[y.NumericLiteral] = "Numeric", D[y.Punctuator] = "Punctuator", D[y.StringLiteral] = "String", D[y.RegularExpression] = "RegularExpression", S = [ - "(", - "{", - "[", - "in", - "typeof", - "instanceof", - "new", - "return", - "case", - "delete", - "throw", - "void", - // assignment operators - "=", - "+=", - "-=", - "*=", - "/=", - "%=", - "<<=", - ">>=", - ">>>=", - "&=", - "|=", - "^=", - ",", - // binary/unary operators - "+", - "-", - "*", - "/", - "%", - "++", - "--", - "<<", - ">>", - ">>>", - "&", - "|", - "^", - "!", - "~", - "&&", - "||", - "?", - ":", - "===", - "==", - ">=", - "<=", - "<", - ">", - "!=", - "!==" - ], E = { - AssignmentExpression: "AssignmentExpression", - ArrayExpression: "ArrayExpression", - BlockStatement: "BlockStatement", - BinaryExpression: "BinaryExpression", - BreakStatement: "BreakStatement", - CallExpression: "CallExpression", - CatchClause: "CatchClause", - ConditionalExpression: "ConditionalExpression", - ContinueStatement: "ContinueStatement", - DoWhileStatement: "DoWhileStatement", - DebuggerStatement: "DebuggerStatement", - EmptyStatement: "EmptyStatement", - ExpressionStatement: "ExpressionStatement", - ForStatement: "ForStatement", - ForInStatement: "ForInStatement", - FunctionDeclaration: "FunctionDeclaration", - FunctionExpression: "FunctionExpression", - Identifier: "Identifier", - IfStatement: "IfStatement", - Literal: "Literal", - LabeledStatement: "LabeledStatement", - LogicalExpression: "LogicalExpression", - MemberExpression: "MemberExpression", - NewExpression: "NewExpression", - ObjectExpression: "ObjectExpression", - Program: "Program", - Property: "Property", - ReturnStatement: "ReturnStatement", - SequenceExpression: "SequenceExpression", - SwitchStatement: "SwitchStatement", - SwitchCase: "SwitchCase", - ThisExpression: "ThisExpression", - ThrowStatement: "ThrowStatement", - TryStatement: "TryStatement", - UnaryExpression: "UnaryExpression", - UpdateExpression: "UpdateExpression", - VariableDeclaration: "VariableDeclaration", - VariableDeclarator: "VariableDeclarator", - WhileStatement: "WhileStatement", - WithStatement: "WithStatement" - }, d = { - Data: 1, - Get: 2, - Set: 4 - }, a = { - UnexpectedToken: "Unexpected token %0", - UnexpectedNumber: "Unexpected number", - UnexpectedString: "Unexpected string", - UnexpectedIdentifier: "Unexpected identifier", - UnexpectedReserved: "Unexpected reserved word", - UnexpectedEOS: "Unexpected end of input", - NewlineAfterThrow: "Illegal newline after throw", - InvalidRegExp: "Invalid regular expression", - UnterminatedRegExp: "Invalid regular expression: missing /", - InvalidLHSInAssignment: "Invalid left-hand side in assignment", - InvalidLHSInForIn: "Invalid left-hand side in for-in", - MultipleDefaultsInSwitch: "More than one default clause in switch statement", - NoCatchOrFinally: "Missing catch or finally after try", - UnknownLabel: "Undefined label '%0'", - Redeclaration: "%0 '%1' has already been declared", - IllegalContinue: "Illegal continue statement", - IllegalBreak: "Illegal break statement", - IllegalReturn: "Illegal return statement", - StrictModeWith: "Strict mode code may not include a with statement", - StrictCatchVariable: "Catch variable may not be eval or arguments in strict mode", - StrictVarName: "Variable name may not be eval or arguments in strict mode", - StrictParamName: "Parameter name eval or arguments is not allowed in strict mode", - StrictParamDupe: "Strict mode function may not have duplicate parameter names", - StrictFunctionName: "Function name may not be eval or arguments in strict mode", - StrictOctalLiteral: "Octal literals are not allowed in strict mode.", - StrictDelete: "Delete of an unqualified identifier in strict mode.", - StrictDuplicateProperty: "Duplicate data property in object literal not allowed in strict mode", - AccessorDataProperty: "Object literal may not have data and accessor property with the same name", - AccessorGetSet: "Object literal may not have multiple get/set accessors with the same name", - StrictLHSAssignment: "Assignment to eval or arguments is not allowed in strict mode", - StrictLHSPostfix: "Postfix increment/decrement may not have eval or arguments operand in strict mode", - StrictLHSPrefix: "Prefix increment/decrement may not have eval or arguments operand in strict mode", - StrictReservedWord: "Use of future reserved word in strict mode" - }, o = { - NonAsciiIdentifierStart: new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"), - NonAsciiIdentifierPart: new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]") - }; - function I(e, t) { - if (!e) - throw new Error("ASSERT: " + t); - } - function R(e) { - return e >= 48 && e <= 57; - } - function U(e) { - return "0123456789abcdefABCDEF".indexOf(e) >= 0; - } - function w(e) { - return "01234567".indexOf(e) >= 0; - } - function H(e) { - return e === 32 || e === 9 || e === 11 || e === 12 || e === 160 || e >= 5760 && [5760, 6158, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279].indexOf(e) >= 0; - } - function M(e) { - return e === 10 || e === 13 || e === 8232 || e === 8233; - } - function z(e) { - return e == 64 || e === 36 || e === 95 || // $ (dollar) and _ (underscore) - e >= 65 && e <= 90 || // A..Z - e >= 97 && e <= 122 || // a..z - e === 92 || // \ (backslash) - e >= 128 && o.NonAsciiIdentifierStart.test(String.fromCharCode(e)); - } - function V(e) { - return e === 36 || e === 95 || // $ (dollar) and _ (underscore) - e >= 65 && e <= 90 || // A..Z - e >= 97 && e <= 122 || // a..z - e >= 48 && e <= 57 || // 0..9 - e === 92 || // \ (backslash) - e >= 128 && o.NonAsciiIdentifierPart.test(String.fromCharCode(e)); - } - function ae(e) { - switch (e) { - case "class": - case "enum": - case "export": - case "extends": - case "import": - case "super": - return !0; - default: - return !1; - } - } - function Y(e) { - switch (e) { - case "implements": - case "interface": - case "package": - case "private": - case "protected": - case "public": - case "static": - case "yield": - case "let": - return !0; - default: - return !1; - } - } - function J(e) { - return e === "eval" || e === "arguments"; - } - function se(e) { - if (c && Y(e)) - return !0; - switch (e.length) { - case 2: - return e === "if" || e === "in" || e === "do"; - case 3: - return e === "var" || e === "for" || e === "new" || e === "try" || e === "let"; - case 4: - return e === "this" || e === "else" || e === "case" || e === "void" || e === "with" || e === "enum"; - case 5: - return e === "while" || e === "break" || e === "catch" || e === "throw" || e === "const" || e === "yield" || e === "class" || e === "super"; - case 6: - return e === "return" || e === "typeof" || e === "delete" || e === "switch" || e === "export" || e === "import"; - case 7: - return e === "default" || e === "finally" || e === "extends"; - case 8: - return e === "function" || e === "continue" || e === "debugger"; - case 10: - return e === "instanceof"; - default: - return !1; - } - } - function ie(e, t, u, l, C) { - var x; - I(typeof u == "number", "Comment must have valid position"), !(p.lastCommentStart >= u) && (p.lastCommentStart = u, x = { - type: e, - value: t - }, f.range && (x.range = [u, l]), f.loc && (x.loc = C), f.comments.push(x), f.attachComment && (f.leadingComments.push(x), f.trailingComments.push(x))); - } - function oe(e) { - var t, u, l, C; - for (t = r - e, u = { - start: { - line: g, - column: r - b - e - } - }; r < h; ) - if (l = s.charCodeAt(r), ++r, M(l)) { - f.comments && (C = s.slice(t + e, r - 1), u.end = { - line: g, - column: r - b - 1 - }, ie("Line", C, t, r - 1, u)), l === 13 && s.charCodeAt(r) === 10 && ++r, ++g, b = r; - return; - } - f.comments && (C = s.slice(t + e, r), u.end = { - line: g, - column: r - b - }, ie("Line", C, t, r, u)); - } - function ve() { - var e, t, u, l; - for (f.comments && (e = r - 2, t = { - start: { - line: g, - column: r - b - 2 - } - }); r < h; ) - if (u = s.charCodeAt(r), M(u)) - u === 13 && s.charCodeAt(r + 1) === 10 && ++r, ++g, ++r, b = r, r >= h && P({}, a.UnexpectedToken, "ILLEGAL"); - else if (u === 42) { - if (s.charCodeAt(r + 1) === 47) { - ++r, ++r, f.comments && (l = s.slice(e + 2, r - 2), t.end = { - line: g, - column: r - b - }, ie("Block", l, e, r, t)); - return; - } - ++r; - } else - ++r; - P({}, a.UnexpectedToken, "ILLEGAL"); - } - function A() { - var e, t; - for (t = r === 0; r < h; ) - if (e = s.charCodeAt(r), H(e)) - ++r; - else if (M(e)) - ++r, e === 13 && s.charCodeAt(r) === 10 && ++r, ++g, b = r, t = !0; - else if (e === 47) - if (e = s.charCodeAt(r + 1), e === 47) - ++r, ++r, oe(2), t = !0; - else if (e === 42) - ++r, ++r, ve(); - else - break; - else if (t && e === 45) - if (s.charCodeAt(r + 1) === 45 && s.charCodeAt(r + 2) === 62) - r += 3, oe(3); - else - break; - else if (e === 60) - if (s.slice(r + 1, r + 4) === "!--") - ++r, ++r, ++r, ++r, oe(4); - else - break; - else - break; - } - function F(e) { - var t, u, l, C = 0; - for (u = e === "u" ? 4 : 2, t = 0; t < u; ++t) - if (r < h && U(s[r])) - l = s[r++], C = C * 16 + "0123456789abcdef".indexOf(l.toLowerCase()); - else - return ""; - return String.fromCharCode(C); - } - function k() { - var e, t; - for (e = s.charCodeAt(r++), t = String.fromCharCode(e), e === 92 && (s.charCodeAt(r) !== 117 && P({}, a.UnexpectedToken, "ILLEGAL"), ++r, e = F("u"), (!e || e === "\\" || !z(e.charCodeAt(0))) && P({}, a.UnexpectedToken, "ILLEGAL"), t = e); r < h && (e = s.charCodeAt(r), !!V(e)); ) - ++r, t += String.fromCharCode(e), e === 92 && (t = t.substr(0, t.length - 1), s.charCodeAt(r) !== 117 && P({}, a.UnexpectedToken, "ILLEGAL"), ++r, e = F("u"), (!e || e === "\\" || !V(e.charCodeAt(0))) && P({}, a.UnexpectedToken, "ILLEGAL"), t += e); - return t; - } - function X() { - var e, t; - for (e = r++; r < h; ) { - if (t = s.charCodeAt(r), t === 92) - return r = e, k(); - if (V(t)) - ++r; - else - break; - } - return s.slice(e, r); - } - function ee() { - var e, t, u; - return e = r, t = s.charCodeAt(r) === 92 ? k() : X(), t.length === 1 ? u = y.Identifier : se(t) ? u = y.Keyword : t === "null" ? u = y.NullLiteral : t === "true" || t === "false" ? u = y.BooleanLiteral : u = y.Identifier, { - type: u, - value: t, - lineNumber: g, - lineStart: b, - start: e, - end: r - }; - } - function $() { - var e = r, t = s.charCodeAt(r), u, l = s[r], C, x, j; - switch (t) { - case 46: - case 40: - case 41: - case 59: - case 44: - case 123: - case 125: - case 91: - case 93: - case 58: - case 63: - case 126: - return ++r, f.tokenize && (t === 40 ? f.openParenToken = f.tokens.length : t === 123 && (f.openCurlyToken = f.tokens.length)), { - type: y.Punctuator, - value: String.fromCharCode(t), - lineNumber: g, - lineStart: b, - start: e, - end: r - }; - default: - if (u = s.charCodeAt(r + 1), u === 61) - switch (t) { - case 43: - case 45: - case 47: - case 60: - case 62: - case 94: - case 124: - case 37: - case 38: - case 42: - return r += 2, { - type: y.Punctuator, - value: String.fromCharCode(t) + String.fromCharCode(u), - lineNumber: g, - lineStart: b, - start: e, - end: r - }; - case 33: - case 61: - return r += 2, s.charCodeAt(r) === 61 && ++r, { - type: y.Punctuator, - value: s.slice(e, r), - lineNumber: g, - lineStart: b, - start: e, - end: r - }; - } - } - if (j = s.substr(r, 4), j === ">>>=") - return r += 4, { - type: y.Punctuator, - value: j, - lineNumber: g, - lineStart: b, - start: e, - end: r - }; - if (x = j.substr(0, 3), x === ">>>" || x === "<<=" || x === ">>=") - return r += 3, { - type: y.Punctuator, - value: x, - lineNumber: g, - lineStart: b, - start: e, - end: r - }; - if (C = x.substr(0, 2), l === C[1] && "+-<>&|".indexOf(l) >= 0 || C === "=>") - return r += 2, { - type: y.Punctuator, - value: C, - lineNumber: g, - lineStart: b, - start: e, - end: r - }; - if ("<>=!+-*%&|^/".indexOf(l) >= 0) - return ++r, { - type: y.Punctuator, - value: l, - lineNumber: g, - lineStart: b, - start: e, - end: r - }; - P({}, a.UnexpectedToken, "ILLEGAL"); - } - function q(e) { - for (var t = ""; r < h && U(s[r]); ) - t += s[r++]; - return t.length === 0 && P({}, a.UnexpectedToken, "ILLEGAL"), z(s.charCodeAt(r)) && P({}, a.UnexpectedToken, "ILLEGAL"), { - type: y.NumericLiteral, - value: parseInt("0x" + t, 16), - lineNumber: g, - lineStart: b, - start: e, - end: r - }; - } - function K(e) { - for (var t = "0" + s[r++]; r < h && w(s[r]); ) - t += s[r++]; - return (z(s.charCodeAt(r)) || R(s.charCodeAt(r))) && P({}, a.UnexpectedToken, "ILLEGAL"), { - type: y.NumericLiteral, - value: parseInt(t, 8), - octal: !0, - lineNumber: g, - lineStart: b, - start: e, - end: r - }; - } - function Q() { - var e, t, u; - if (u = s[r], I( - R(u.charCodeAt(0)) || u === ".", - "Numeric literal must start with a decimal digit or a decimal point" - ), t = r, e = "", u !== ".") { - if (e = s[r++], u = s[r], e === "0") { - if (u === "x" || u === "X") - return ++r, q(t); - if (w(u)) - return K(t); - u && R(u.charCodeAt(0)) && P({}, a.UnexpectedToken, "ILLEGAL"); - } - for (; R(s.charCodeAt(r)); ) - e += s[r++]; - u = s[r]; - } - if (u === ".") { - for (e += s[r++]; R(s.charCodeAt(r)); ) - e += s[r++]; - u = s[r]; - } - if (u === "e" || u === "E") - if (e += s[r++], u = s[r], (u === "+" || u === "-") && (e += s[r++]), R(s.charCodeAt(r))) - for (; R(s.charCodeAt(r)); ) - e += s[r++]; - else - P({}, a.UnexpectedToken, "ILLEGAL"); - return z(s.charCodeAt(r)) && P({}, a.UnexpectedToken, "ILLEGAL"), { - type: y.NumericLiteral, - value: parseFloat(e), - lineNumber: g, - lineStart: b, - start: t, - end: r - }; - } - function fe() { - var e = "", t, u, l, C, x, j, W = !1, ue, re; - for (ue = g, re = b, t = s[r], I( - t === "'" || t === '"', - "String literal must starts with a quote" - ), u = r, ++r; r < h; ) - if (l = s[r++], l === t) { - t = ""; - break; - } else if (l === "\\") - if (l = s[r++], !l || !M(l.charCodeAt(0))) - switch (l) { - case "u": - case "x": - j = r, x = F(l), x ? e += x : (r = j, e += l); - break; - case "n": - e += ` -`; - break; - case "r": - e += "\r"; - break; - case "t": - e += " "; - break; - case "b": - e += "\b"; - break; - case "f": - e += "\f"; - break; - case "v": - e += "\v"; - break; - default: - w(l) ? (C = "01234567".indexOf(l), C !== 0 && (W = !0), r < h && w(s[r]) && (W = !0, C = C * 8 + "01234567".indexOf(s[r++]), "0123".indexOf(l) >= 0 && r < h && w(s[r]) && (C = C * 8 + "01234567".indexOf(s[r++]))), e += String.fromCharCode(C)) : e += l; - break; - } - else - ++g, l === "\r" && s[r] === ` -` && ++r, b = r; - else { - if (M(l.charCodeAt(0))) - break; - e += l; - } - return t !== "" && P({}, a.UnexpectedToken, "ILLEGAL"), { - type: y.StringLiteral, - value: e, - octal: W, - startLineNumber: ue, - startLineStart: re, - lineNumber: g, - lineStart: b, - start: u, - end: r - }; - } - function Ee(e, t) { - var u; - try { - u = new RegExp(e, t); - } catch { - P({}, a.InvalidRegExp); - } - return u; - } - function ke() { - var e, t, u, l, C; - for (e = s[r], I(e === "/", "Regular expression literal must start with a slash"), t = s[r++], u = !1, l = !1; r < h; ) - if (e = s[r++], t += e, e === "\\") - e = s[r++], M(e.charCodeAt(0)) && P({}, a.UnterminatedRegExp), t += e; - else if (M(e.charCodeAt(0))) - P({}, a.UnterminatedRegExp); - else if (u) - e === "]" && (u = !1); - else if (e === "/") { - l = !0; - break; - } else - e === "[" && (u = !0); - return l || P({}, a.UnterminatedRegExp), C = t.substr(1, t.length - 2), { - value: C, - literal: t - }; - } - function ge() { - var e, t, u, l; - for (t = "", u = ""; r < h && (e = s[r], !!V(e.charCodeAt(0))); ) - if (++r, e === "\\" && r < h) - if (e = s[r], e === "u") { - if (++r, l = r, e = F("u"), e) - for (u += e, t += "\\u"; l < r; ++l) - t += s[l]; - else - r = l, u += "u", t += "\\u"; - G({}, a.UnexpectedToken, "ILLEGAL"); - } else - t += "\\", G({}, a.UnexpectedToken, "ILLEGAL"); - else - u += e, t += e; - return { - value: u, - literal: t - }; - } - function Fe() { - var e, t, u, l; - return i = null, A(), e = r, t = ke(), u = ge(), l = Ee(t.value, u.value), f.tokenize ? { - type: y.RegularExpression, - value: l, - lineNumber: g, - lineStart: b, - start: e, - end: r - } : { - literal: t.literal + u.literal, - value: l, - start: e, - end: r - }; - } - function de() { - var e, t, u, l; - return A(), e = r, t = { - start: { - line: g, - column: r - b - } - }, u = Fe(), t.end = { - line: g, - column: r - b - }, f.tokenize || (f.tokens.length > 0 && (l = f.tokens[f.tokens.length - 1], l.range[0] === e && l.type === "Punctuator" && (l.value === "/" || l.value === "/=") && f.tokens.pop()), f.tokens.push({ - type: "RegularExpression", - value: u.literal, - range: [e, r], - loc: t - })), u; - } - function Ke(e) { - return e.type === y.Identifier || e.type === y.Keyword || e.type === y.BooleanLiteral || e.type === y.NullLiteral; - } - function Je() { - var e, t; - if (e = f.tokens[f.tokens.length - 1], !e) - return de(); - if (e.type === "Punctuator") { - if (e.value === "]") - return $(); - if (e.value === ")") - return t = f.tokens[f.openParenToken - 1], t && t.type === "Keyword" && (t.value === "if" || t.value === "while" || t.value === "for" || t.value === "with") ? de() : $(); - if (e.value === "}") { - if (f.tokens[f.openCurlyToken - 3] && f.tokens[f.openCurlyToken - 3].type === "Keyword") { - if (t = f.tokens[f.openCurlyToken - 4], !t) - return $(); - } else if (f.tokens[f.openCurlyToken - 4] && f.tokens[f.openCurlyToken - 4].type === "Keyword") { - if (t = f.tokens[f.openCurlyToken - 5], !t) - return de(); - } else - return $(); - return S.indexOf(t.value) >= 0 ? $() : de(); - } - return de(); - } - return e.type === "Keyword" ? de() : $(); - } - function Ie() { - var e; - return A(), r >= h ? { - type: y.EOF, - lineNumber: g, - lineStart: b, - start: r, - end: r - } : (e = s.charCodeAt(r), z(e) ? ee() : e === 40 || e === 41 || e === 59 ? $() : e === 39 || e === 34 ? fe() : e === 46 ? R(s.charCodeAt(r + 1)) ? Q() : $() : R(e) ? Q() : f.tokenize && e === 47 ? Je() : $()); - } - function Pe() { - var e, t, u; - return A(), e = { - start: { - line: g, - column: r - b - } - }, t = Ie(), e.end = { - line: g, - column: r - b - }, t.type !== y.EOF && (u = s.slice(t.start, t.end), f.tokens.push({ - type: D[t.type], - value: u, - range: [t.start, t.end], - loc: e - })), t; - } - function N() { - var e; - return e = i, r = e.end, g = e.lineNumber, b = e.lineStart, i = typeof f.tokens < "u" ? Pe() : Ie(), r = e.end, g = e.lineNumber, b = e.lineStart, e; - } - function we() { - var e, t, u; - e = r, t = g, u = b, i = typeof f.tokens < "u" ? Pe() : Ie(), r = e, g = t, b = u; - } - function Le(e, t) { - this.line = e, this.column = t; - } - function Qe(e, t, u, l) { - this.start = new Le(e, t), this.end = new Le(u, l); - } - m = { - name: "SyntaxTree", - processComment: function(e) { - var t, u; - if (!(e.type === E.Program && e.body.length > 0)) { - for (f.trailingComments.length > 0 ? f.trailingComments[0].range[0] >= e.range[1] ? (u = f.trailingComments, f.trailingComments = []) : f.trailingComments.length = 0 : f.bottomRightStack.length > 0 && f.bottomRightStack[f.bottomRightStack.length - 1].trailingComments && f.bottomRightStack[f.bottomRightStack.length - 1].trailingComments[0].range[0] >= e.range[1] && (u = f.bottomRightStack[f.bottomRightStack.length - 1].trailingComments, delete f.bottomRightStack[f.bottomRightStack.length - 1].trailingComments); f.bottomRightStack.length > 0 && f.bottomRightStack[f.bottomRightStack.length - 1].range[0] >= e.range[0]; ) - t = f.bottomRightStack.pop(); - t ? t.leadingComments && t.leadingComments[t.leadingComments.length - 1].range[1] <= e.range[0] && (e.leadingComments = t.leadingComments, delete t.leadingComments) : f.leadingComments.length > 0 && f.leadingComments[f.leadingComments.length - 1].range[1] <= e.range[0] && (e.leadingComments = f.leadingComments, f.leadingComments = []), u && (e.trailingComments = u), f.bottomRightStack.push(e); - } - }, - markEnd: function(e, t) { - return f.range && (e.range = [t.start, r]), f.loc && (e.loc = new Qe( - t.startLineNumber === void 0 ? t.lineNumber : t.startLineNumber, - t.start - (t.startLineStart === void 0 ? t.lineStart : t.startLineStart), - g, - r - b - ), this.postProcess(e)), f.attachComment && this.processComment(e), e; - }, - postProcess: function(e) { - return f.source && (e.loc.source = f.source), e; - }, - createArrayExpression: function(e) { - return { - type: E.ArrayExpression, - elements: e - }; - }, - createAssignmentExpression: function(e, t, u) { - return { - type: E.AssignmentExpression, - operator: e, - left: t, - right: u - }; - }, - createBinaryExpression: function(e, t, u) { - var l = e === "||" || e === "&&" ? E.LogicalExpression : E.BinaryExpression; - return { - type: l, - operator: e, - left: t, - right: u - }; - }, - createBlockStatement: function(e) { - return { - type: E.BlockStatement, - body: e - }; - }, - createBreakStatement: function(e) { - return { - type: E.BreakStatement, - label: e - }; - }, - createCallExpression: function(e, t) { - return { - type: E.CallExpression, - callee: e, - arguments: t - }; - }, - createCatchClause: function(e, t) { - return { - type: E.CatchClause, - param: e, - body: t - }; - }, - createConditionalExpression: function(e, t, u) { - return { - type: E.ConditionalExpression, - test: e, - consequent: t, - alternate: u - }; - }, - createContinueStatement: function(e) { - return { - type: E.ContinueStatement, - label: e - }; - }, - createDebuggerStatement: function() { - return { - type: E.DebuggerStatement - }; - }, - createDoWhileStatement: function(e, t) { - return { - type: E.DoWhileStatement, - body: e, - test: t - }; - }, - createEmptyStatement: function() { - return { - type: E.EmptyStatement - }; - }, - createExpressionStatement: function(e) { - return { - type: E.ExpressionStatement, - expression: e - }; - }, - createForStatement: function(e, t, u, l) { - return { - type: E.ForStatement, - init: e, - test: t, - update: u, - body: l - }; - }, - createForInStatement: function(e, t, u) { - return { - type: E.ForInStatement, - left: e, - right: t, - body: u, - each: !1 - }; - }, - createFunctionDeclaration: function(e, t, u, l) { - return { - type: E.FunctionDeclaration, - id: e, - params: t, - defaults: u, - body: l, - rest: null, - generator: !1, - expression: !1 - }; - }, - createFunctionExpression: function(e, t, u, l) { - return { - type: E.FunctionExpression, - id: e, - params: t, - defaults: u, - body: l, - rest: null, - generator: !1, - expression: !1 - }; - }, - createIdentifier: function(e) { - return { - type: E.Identifier, - name: e - }; - }, - createIfStatement: function(e, t, u) { - return { - type: E.IfStatement, - test: e, - consequent: t, - alternate: u - }; - }, - createLabeledStatement: function(e, t) { - return { - type: E.LabeledStatement, - label: e, - body: t - }; - }, - createLiteral: function(e) { - return { - type: E.Literal, - value: e.value, - raw: s.slice(e.start, e.end) - }; - }, - createMemberExpression: function(e, t, u) { - return { - type: E.MemberExpression, - computed: e === "[", - object: t, - property: u - }; - }, - createNewExpression: function(e, t) { - return { - type: E.NewExpression, - callee: e, - arguments: t - }; - }, - createObjectExpression: function(e) { - return { - type: E.ObjectExpression, - properties: e - }; - }, - createPostfixExpression: function(e, t) { - return { - type: E.UpdateExpression, - operator: e, - argument: t, - prefix: !1 - }; - }, - createProgram: function(e) { - return { - type: E.Program, - body: e - }; - }, - createProperty: function(e, t, u) { - return { - type: E.Property, - key: t, - value: u, - kind: e - }; - }, - createReturnStatement: function(e) { - return { - type: E.ReturnStatement, - argument: e - }; - }, - createSequenceExpression: function(e) { - return { - type: E.SequenceExpression, - expressions: e - }; - }, - createSwitchCase: function(e, t) { - return { - type: E.SwitchCase, - test: e, - consequent: t - }; - }, - createSwitchStatement: function(e, t) { - return { - type: E.SwitchStatement, - discriminant: e, - cases: t - }; - }, - createThisExpression: function() { - return { - type: E.ThisExpression - }; - }, - createThrowStatement: function(e) { - return { - type: E.ThrowStatement, - argument: e - }; - }, - createTryStatement: function(e, t, u, l) { - return { - type: E.TryStatement, - block: e, - guardedHandlers: t, - handlers: u, - finalizer: l - }; - }, - createUnaryExpression: function(e, t) { - return e === "++" || e === "--" ? { - type: E.UpdateExpression, - operator: e, - argument: t, - prefix: !0 - } : { - type: E.UnaryExpression, - operator: e, - argument: t, - prefix: !0 - }; - }, - createVariableDeclaration: function(e, t) { - return { - type: E.VariableDeclaration, - declarations: e, - kind: t - }; - }, - createVariableDeclarator: function(e, t) { - return { - type: E.VariableDeclarator, - id: e, - init: t - }; - }, - createWhileStatement: function(e, t) { - return { - type: E.WhileStatement, - test: e, - body: t - }; - }, - createWithStatement: function(e, t) { - return { - type: E.WithStatement, - object: e, - body: t - }; - } - }; - function Ce() { - var e, t, u, l; - return e = r, t = g, u = b, A(), l = g !== t, r = e, g = t, b = u, l; - } - function P(e, t) { - var u, l = Array.prototype.slice.call(arguments, 2), C = t.replace( - /%(\d)/g, - function(x, j) { - return I(j < l.length, "Message reference must be in range"), l[j]; - } - ); - throw typeof e.lineNumber == "number" ? (u = new Error("Line " + e.lineNumber + ": " + C), u.index = e.start, u.lineNumber = e.lineNumber, u.column = e.start - b + 1) : (u = new Error("Line " + g + ": " + C), u.index = r, u.lineNumber = g, u.column = r - b + 1), u.description = C, u; - } - function G() { - try { - P.apply(null, arguments); - } catch (e) { - if (f.errors) - f.errors.push(e); - else - throw e; - } - } - function pe(e) { - if (e.type === y.EOF && P(e, a.UnexpectedEOS), e.type === y.NumericLiteral && P(e, a.UnexpectedNumber), e.type === y.StringLiteral && P(e, a.UnexpectedString), e.type === y.Identifier && P(e, a.UnexpectedIdentifier), e.type === y.Keyword) { - if (ae(e.value)) - P(e, a.UnexpectedReserved); - else if (c && Y(e.value)) { - G(e, a.StrictReservedWord); - return; - } - P(e, a.UnexpectedToken, e.value); - } - P(e, a.UnexpectedToken, e.value); - } - function O(e) { - var t = N(); - (t.type !== y.Punctuator || t.value !== e) && pe(t); - } - function Z(e) { - var t = N(); - (t.type !== y.Keyword || t.value !== e) && pe(t); - } - function _(e) { - return i.type === y.Punctuator && i.value === e; - } - function ne(e) { - return i.type === y.Keyword && i.value === e; - } - function Ye() { - var e; - return i.type !== y.Punctuator ? !1 : (e = i.value, e === "=" || e === "*=" || e === "/=" || e === "%=" || e === "+=" || e === "-=" || e === "<<=" || e === ">>=" || e === ">>>=" || e === "&=" || e === "^=" || e === "|="); - } - function he() { - var e; - if (s.charCodeAt(r) === 59 || _(";")) { - N(); - return; - } - e = g, A(), g === e && i.type !== y.EOF && !_("}") && pe(i); - } - function be(e) { - return e.type === E.Identifier || e.type === E.MemberExpression; - } - function Ze() { - var e = [], t; - for (t = i, O("["); !_("]"); ) - _(",") ? (N(), e.push(null)) : (e.push(le()), _("]") || O(",")); - return N(), n.markEnd(n.createArrayExpression(e), t); - } - function _e(e, t) { - var u, l, C; - return u = c, C = i, l = Oe(), t && c && J(e[0].name) && G(t, a.StrictParamName), c = u, n.markEnd(n.createFunctionExpression(null, e, [], l), C); - } - function De() { - var e, t; - return t = i, e = N(), e.type === y.StringLiteral || e.type === y.NumericLiteral ? (c && e.octal && G(e, a.StrictOctalLiteral), n.markEnd(n.createLiteral(e), t)) : n.markEnd(n.createIdentifier(e.value), t); - } - function et() { - var e, t, u, l, C, x; - if (e = i, x = i, e.type === y.Identifier) - return u = De(), e.value === "get" && !_(":") ? (t = De(), O("("), O(")"), l = _e([]), n.markEnd(n.createProperty("get", t, l), x)) : e.value === "set" && !_(":") ? (t = De(), O("("), e = i, e.type !== y.Identifier ? (O(")"), G(e, a.UnexpectedToken, e.value), l = _e([])) : (C = [ye()], O(")"), l = _e(C, e)), n.markEnd(n.createProperty("set", t, l), x)) : (O(":"), l = le(), n.markEnd(n.createProperty("init", u, l), x)); - if (e.type === y.EOF || e.type === y.Punctuator) - pe(e); - else - return t = De(), O(":"), l = le(), n.markEnd(n.createProperty("init", t, l), x); - } - function tt() { - var e = [], t, u, l, C, x = {}, j = String, W; - for (W = i, O("{"); !_("}"); ) - t = et(), t.key.type === E.Identifier ? u = t.key.name : u = j(t.key.value), C = t.kind === "init" ? d.Data : t.kind === "get" ? d.Get : d.Set, l = "$" + u, Object.prototype.hasOwnProperty.call(x, l) ? (x[l] === d.Data ? c && C === d.Data ? G({}, a.StrictDuplicateProperty) : C !== d.Data && G({}, a.AccessorDataProperty) : C === d.Data ? G({}, a.AccessorDataProperty) : x[l] & C && G({}, a.AccessorGetSet), x[l] |= C) : x[l] = C, e.push(t), _("}") || O(","); - return O("}"), n.markEnd(n.createObjectExpression(e), W); - } - function rt() { - var e; - return O("("), e = te(), O(")"), e; - } - function Re() { - var e, t, u, l; - if (_("(")) - return rt(); - if (_("[")) - return Ze(); - if (_("{")) - return tt(); - if (e = i.type, l = i, e === y.Identifier) - u = n.createIdentifier(N().value); - else if (e === y.StringLiteral || e === y.NumericLiteral) - c && i.octal && G(i, a.StrictOctalLiteral), u = n.createLiteral(N()); - else if (e === y.Keyword) { - if (ne("function")) - return It(); - ne("this") ? (N(), u = n.createThisExpression()) : pe(N()); - } else - e === y.BooleanLiteral ? (t = N(), t.value = t.value === "true", u = n.createLiteral(t)) : e === y.NullLiteral ? (t = N(), t.value = null, u = n.createLiteral(t)) : _("/") || _("/=") ? (typeof f.tokens < "u" ? u = n.createLiteral(de()) : u = n.createLiteral(Fe()), we()) : pe(N()); - return n.markEnd(u, l); - } - function je() { - var e = []; - if (O("("), !_(")")) - for (; r < h && (e.push(le()), !_(")")); ) - O(","); - return O(")"), e; - } - function nt() { - var e, t; - return t = i, e = N(), Ke(e) || pe(e), n.markEnd(n.createIdentifier(e.value), t); - } - function Me() { - return O("."), nt(); - } - function Ue() { - var e; - return O("["), e = te(), O("]"), e; - } - function $e() { - var e, t, u; - return u = i, Z("new"), e = it(), t = _("(") ? je() : [], n.markEnd(n.createNewExpression(e, t), u); - } - function ut() { - var e, t, u, l, C; - for (C = i, e = p.allowIn, p.allowIn = !0, t = ne("new") ? $e() : Re(), p.allowIn = e; ; ) { - if (_(".")) - l = Me(), t = n.createMemberExpression(".", t, l); - else if (_("(")) - u = je(), t = n.createCallExpression(t, u); - else if (_("[")) - l = Ue(), t = n.createMemberExpression("[", t, l); - else - break; - n.markEnd(t, C); - } - return t; - } - function it() { - var e, t, u, l; - for (l = i, e = p.allowIn, t = ne("new") ? $e() : Re(), p.allowIn = e; _(".") || _("["); ) - _("[") ? (u = Ue(), t = n.createMemberExpression("[", t, u)) : (u = Me(), t = n.createMemberExpression(".", t, u)), n.markEnd(t, l); - return t; - } - function ze() { - var e, t, u = i; - return e = ut(), i.type === y.Punctuator && (_("++") || _("--")) && !Ce() && (c && e.type === E.Identifier && J(e.name) && G({}, a.StrictLHSPostfix), be(e) || G({}, a.InvalidLHSInAssignment), t = N(), e = n.markEnd(n.createPostfixExpression(t.value, e), u)), e; - } - function Ae() { - var e, t, u; - return i.type !== y.Punctuator && i.type !== y.Keyword ? t = ze() : _("++") || _("--") ? (u = i, e = N(), t = Ae(), c && t.type === E.Identifier && J(t.name) && G({}, a.StrictLHSPrefix), be(t) || G({}, a.InvalidLHSInAssignment), t = n.createUnaryExpression(e.value, t), t = n.markEnd(t, u)) : _("+") || _("-") || _("~") || _("!") ? (u = i, e = N(), t = Ae(), t = n.createUnaryExpression(e.value, t), t = n.markEnd(t, u)) : ne("delete") || ne("void") || ne("typeof") ? (u = i, e = N(), t = Ae(), t = n.createUnaryExpression(e.value, t), t = n.markEnd(t, u), c && t.operator === "delete" && t.argument.type === E.Identifier && G({}, a.StrictDelete)) : t = ze(), t; - } - function He(e, t) { - var u = 0; - if (e.type !== y.Punctuator && e.type !== y.Keyword) - return 0; - switch (e.value) { - case "||": - u = 1; - break; - case "&&": - u = 2; - break; - case "|": - u = 3; - break; - case "^": - u = 4; - break; - case "&": - u = 5; - break; - case "==": - case "!=": - case "===": - case "!==": - u = 6; - break; - case "<": - case ">": - case "<=": - case ">=": - case "instanceof": - u = 7; - break; - case "in": - u = t ? 7 : 0; - break; - case "<<": - case ">>": - case ">>>": - u = 8; - break; - case "+": - case "-": - u = 9; - break; - case "*": - case "/": - case "%": - u = 11; - break; - } - return u; - } - function at() { - var e, t, u, l, C, x, j, W, ue, re; - if (e = i, ue = Ae(), l = i, C = He(l, p.allowIn), C === 0) - return ue; - for (l.prec = C, N(), t = [e, i], j = Ae(), x = [ue, l, j]; (C = He(i, p.allowIn)) > 0; ) { - for (; x.length > 2 && C <= x[x.length - 2].prec; ) - j = x.pop(), W = x.pop().value, ue = x.pop(), u = n.createBinaryExpression(W, ue, j), t.pop(), e = t[t.length - 1], n.markEnd(u, e), x.push(u); - l = N(), l.prec = C, x.push(l), t.push(i), u = Ae(), x.push(u); - } - for (re = x.length - 1, u = x[re], t.pop(); re > 1; ) - u = n.createBinaryExpression(x[re - 1].value, x[re - 2], u), re -= 2, e = t.pop(), n.markEnd(u, e); - return u; - } - function st() { - var e, t, u, l, C; - return C = i, e = at(), _("?") && (N(), t = p.allowIn, p.allowIn = !0, u = le(), p.allowIn = t, O(":"), l = le(), e = n.createConditionalExpression(e, u, l), n.markEnd(e, C)), e; - } - function le() { - var e, t, u, l, C; - return e = i, C = i, l = t = st(), Ye() && (be(t) || G({}, a.InvalidLHSInAssignment), c && t.type === E.Identifier && J(t.name) && G(e, a.StrictLHSAssignment), e = N(), u = le(), l = n.markEnd(n.createAssignmentExpression(e.value, t, u), C)), l; - } - function te() { - var e, t = i; - if (e = le(), _(",")) { - for (e = n.createSequenceExpression([e]); r < h && _(","); ) - N(), e.expressions.push(le()); - n.markEnd(e, t); - } - return e; - } - function ot() { - for (var e = [], t; r < h && !(_("}") || (t = Se(), typeof t > "u")); ) - e.push(t); - return e; - } - function xe() { - var e, t; - return t = i, O("{"), e = ot(), O("}"), n.markEnd(n.createBlockStatement(e), t); - } - function ye() { - var e, t; - return t = i, e = N(), e.type !== y.Identifier && pe(e), n.markEnd(n.createIdentifier(e.value), t); - } - function lt(e) { - var t = null, u, l; - return l = i, u = ye(), c && J(u.name) && G({}, a.StrictVarName), e === "const" ? (O("="), t = le()) : _("=") && (N(), t = le()), n.markEnd(n.createVariableDeclarator(u, t), l); - } - function Te(e) { - var t = []; - do { - if (t.push(lt(e)), !_(",")) - break; - N(); - } while (r < h); - return t; - } - function ct() { - var e; - return Z("var"), e = Te(), he(), n.createVariableDeclaration(e, "var"); - } - function ft(e) { - var t, u; - return u = i, Z(e), t = Te(e), he(), n.markEnd(n.createVariableDeclaration(t, e), u); - } - function pt() { - return O(";"), n.createEmptyStatement(); - } - function ht() { - var e = te(); - return he(), n.createExpressionStatement(e); - } - function mt() { - var e, t, u; - return Z("if"), O("("), e = te(), O(")"), t = me(), ne("else") ? (N(), u = me()) : u = null, n.createIfStatement(e, t, u); - } - function yt() { - var e, t, u; - return Z("do"), u = p.inIteration, p.inIteration = !0, e = me(), p.inIteration = u, Z("while"), O("("), t = te(), O(")"), _(";") && N(), n.createDoWhileStatement(e, t); - } - function dt() { - var e, t, u; - return Z("while"), O("("), e = te(), O(")"), u = p.inIteration, p.inIteration = !0, t = me(), p.inIteration = u, n.createWhileStatement(e, t); - } - function Et() { - var e, t, u; - return u = i, e = N(), t = Te(), n.markEnd(n.createVariableDeclaration(t, e.value), u); - } - function At() { - var e, t, u, l, C, x, j; - return e = t = u = null, Z("for"), O("("), _(";") ? N() : (ne("var") || ne("let") ? (p.allowIn = !1, e = Et(), p.allowIn = !0, e.declarations.length === 1 && ne("in") && (N(), l = e, C = te(), e = null)) : (p.allowIn = !1, e = te(), p.allowIn = !0, ne("in") && (be(e) || G({}, a.InvalidLHSInForIn), N(), l = e, C = te(), e = null)), typeof l > "u" && O(";")), typeof l > "u" && (_(";") || (t = te()), O(";"), _(")") || (u = te())), O(")"), j = p.inIteration, p.inIteration = !0, x = me(), p.inIteration = j, typeof l > "u" ? n.createForStatement(e, t, u, x) : n.createForInStatement(l, C, x); - } - function gt() { - var e = null, t; - return Z("continue"), s.charCodeAt(r) === 59 ? (N(), p.inIteration || P({}, a.IllegalContinue), n.createContinueStatement(null)) : Ce() ? (p.inIteration || P({}, a.IllegalContinue), n.createContinueStatement(null)) : (i.type === y.Identifier && (e = ye(), t = "$" + e.name, Object.prototype.hasOwnProperty.call(p.labelSet, t) || P({}, a.UnknownLabel, e.name)), he(), e === null && !p.inIteration && P({}, a.IllegalContinue), n.createContinueStatement(e)); - } - function Ct() { - var e = null, t; - return Z("break"), s.charCodeAt(r) === 59 ? (N(), p.inIteration || p.inSwitch || P({}, a.IllegalBreak), n.createBreakStatement(null)) : Ce() ? (p.inIteration || p.inSwitch || P({}, a.IllegalBreak), n.createBreakStatement(null)) : (i.type === y.Identifier && (e = ye(), t = "$" + e.name, Object.prototype.hasOwnProperty.call(p.labelSet, t) || P({}, a.UnknownLabel, e.name)), he(), e === null && !(p.inIteration || p.inSwitch) && P({}, a.IllegalBreak), n.createBreakStatement(e)); - } - function St() { - var e = null; - return Z("return"), p.inFunctionBody || G({}, a.IllegalReturn), s.charCodeAt(r) === 32 && z(s.charCodeAt(r + 1)) ? (e = te(), he(), n.createReturnStatement(e)) : Ce() ? n.createReturnStatement(null) : (_(";") || !_("}") && i.type !== y.EOF && (e = te()), he(), n.createReturnStatement(e)); - } - function vt() { - var e, t; - return c && (A(), G({}, a.StrictModeWith)), Z("with"), O("("), e = te(), O(")"), t = me(), n.createWithStatement(e, t); - } - function Ft() { - var e, t = [], u, l; - for (l = i, ne("default") ? (N(), e = null) : (Z("case"), e = te()), O(":"); r < h && !(_("}") || ne("default") || ne("case")); ) - u = me(), t.push(u); - return n.markEnd(n.createSwitchCase(e, t), l); - } - function bt() { - var e, t, u, l, C; - if (Z("switch"), O("("), e = te(), O(")"), O("{"), t = [], _("}")) - return N(), n.createSwitchStatement(e, t); - for (l = p.inSwitch, p.inSwitch = !0, C = !1; r < h && !_("}"); ) - u = Ft(), u.test === null && (C && P({}, a.MultipleDefaultsInSwitch), C = !0), t.push(u); - return p.inSwitch = l, O("}"), n.createSwitchStatement(e, t); - } - function Dt() { - var e; - return Z("throw"), Ce() && P({}, a.NewlineAfterThrow), e = te(), he(), n.createThrowStatement(e); - } - function xt() { - var e, t, u; - return u = i, Z("catch"), O("("), _(")") && pe(i), e = ye(), c && J(e.name) && G({}, a.StrictCatchVariable), O(")"), t = xe(), n.markEnd(n.createCatchClause(e, t), u); - } - function Bt() { - var e, t = [], u = null; - return Z("try"), e = xe(), ne("catch") && t.push(xt()), ne("finally") && (N(), u = xe()), t.length === 0 && !u && P({}, a.NoCatchOrFinally), n.createTryStatement(e, [], t, u); - } - function kt() { - return Z("debugger"), he(), n.createDebuggerStatement(); - } - function me() { - var e = i.type, t, u, l, C; - if (e === y.EOF && pe(i), e === y.Punctuator && i.value === "{") - return xe(); - if (C = i, e === y.Punctuator) - switch (i.value) { - case ";": - return n.markEnd(pt(), C); - case "(": - return n.markEnd(ht(), C); - } - if (e === y.Keyword) - switch (i.value) { - case "break": - return n.markEnd(Ct(), C); - case "continue": - return n.markEnd(gt(), C); - case "debugger": - return n.markEnd(kt(), C); - case "do": - return n.markEnd(yt(), C); - case "for": - return n.markEnd(At(), C); - case "function": - return n.markEnd(Ge(), C); - case "if": - return n.markEnd(mt(), C); - case "return": - return n.markEnd(St(), C); - case "switch": - return n.markEnd(bt(), C); - case "throw": - return n.markEnd(Dt(), C); - case "try": - return n.markEnd(Bt(), C); - case "var": - return n.markEnd(ct(), C); - case "while": - return n.markEnd(dt(), C); - case "with": - return n.markEnd(vt(), C); - } - return t = te(), t.type === E.Identifier && _(":") ? (N(), l = "$" + t.name, Object.prototype.hasOwnProperty.call(p.labelSet, l) && P({}, a.Redeclaration, "Label", t.name), p.labelSet[l] = !0, u = me(), delete p.labelSet[l], n.markEnd(n.createLabeledStatement(t, u), C)) : (he(), n.markEnd(n.createExpressionStatement(t), C)); - } - function Oe() { - var e, t = [], u, l, C, x, j, W, ue, re; - for (re = i, O("{"); r < h && !(i.type !== y.StringLiteral || (u = i, e = Se(), t.push(e), e.expression.type !== E.Literal)); ) - l = s.slice(u.start + 1, u.end - 1), l === "use strict" ? (c = !0, C && G(C, a.StrictOctalLiteral)) : !C && u.octal && (C = u); - for (x = p.labelSet, j = p.inIteration, W = p.inSwitch, ue = p.inFunctionBody, p.labelSet = {}, p.inIteration = !1, p.inSwitch = !1, p.inFunctionBody = !0; r < h && !(_("}") || (e = Se(), typeof e > "u")); ) - t.push(e); - return O("}"), p.labelSet = x, p.inIteration = j, p.inSwitch = W, p.inFunctionBody = ue, n.markEnd(n.createBlockStatement(t), re); - } - function qe(e) { - var t, u = [], l, C, x, j, W; - if (O("("), !_(")")) - for (x = {}; r < h && (l = i, t = ye(), j = "$" + l.value, c ? (J(l.value) && (C = l, W = a.StrictParamName), Object.prototype.hasOwnProperty.call(x, j) && (C = l, W = a.StrictParamDupe)) : e || (J(l.value) ? (e = l, W = a.StrictParamName) : Y(l.value) ? (e = l, W = a.StrictReservedWord) : Object.prototype.hasOwnProperty.call(x, j) && (e = l, W = a.StrictParamDupe)), u.push(t), x[j] = !0, !_(")")); ) - O(","); - return O(")"), { - params: u, - stricted: C, - firstRestricted: e, - message: W - }; - } - function Ge() { - var e, t = [], u, l, C, x, j, W, ue, re; - return re = i, Z("function"), l = i, e = ye(), c ? J(l.value) && G(l, a.StrictFunctionName) : J(l.value) ? (j = l, W = a.StrictFunctionName) : Y(l.value) && (j = l, W = a.StrictReservedWord), x = qe(j), t = x.params, C = x.stricted, j = x.firstRestricted, x.message && (W = x.message), ue = c, u = Oe(), c && j && P(j, W), c && C && G(C, W), c = ue, n.markEnd(n.createFunctionDeclaration(e, t, [], u), re); - } - function It() { - var e, t = null, u, l, C, x, j = [], W, ue, re; - return re = i, Z("function"), _("(") || (e = i, t = ye(), c ? J(e.value) && G(e, a.StrictFunctionName) : J(e.value) ? (l = e, C = a.StrictFunctionName) : Y(e.value) && (l = e, C = a.StrictReservedWord)), x = qe(l), j = x.params, u = x.stricted, l = x.firstRestricted, x.message && (C = x.message), ue = c, W = Oe(), c && l && P(l, C), c && u && G(u, C), c = ue, n.markEnd(n.createFunctionExpression(t, j, [], W), re); - } - function Se() { - if (i.type === y.Keyword) - switch (i.value) { - case "const": - case "let": - return ft(i.value); - case "function": - return Ge(); - default: - return me(); - } - if (i.type !== y.EOF) - return me(); - } - function wt() { - for (var e, t = [], u, l, C; r < h && (u = i, !(u.type !== y.StringLiteral || (e = Se(), t.push(e), e.expression.type !== E.Literal))); ) - l = s.slice(u.start + 1, u.end - 1), l === "use strict" ? (c = !0, C && G(C, a.StrictOctalLiteral)) : !C && u.octal && (C = u); - for (; r < h && (e = Se(), !(typeof e > "u")); ) - t.push(e); - return t; - } - function _t() { - var e, t; - return A(), we(), t = i, c = !1, e = wt(), n.markEnd(n.createProgram(e), t); - } - function We() { - var e, t, u, l = []; - for (e = 0; e < f.tokens.length; ++e) - t = f.tokens[e], u = { - type: t.type, - value: t.value - }, f.range && (u.range = t.range), f.loc && (u.loc = t.loc), l.push(u); - f.tokens = l; - } - function Tt(e, t) { - var u, l, C; - u = String, typeof e != "string" && !(e instanceof String) && (e = u(e)), n = m, s = e, r = 0, g = s.length > 0 ? 1 : 0, b = 0, h = s.length, i = null, p = { - allowIn: !0, - labelSet: {}, - inFunctionBody: !1, - inIteration: !1, - inSwitch: !1, - lastCommentStart: -1 - }, f = {}, t = t || {}, t.tokens = !0, f.tokens = [], f.tokenize = !0, f.openParenToken = -1, f.openCurlyToken = -1, f.range = typeof t.range == "boolean" && t.range, f.loc = typeof t.loc == "boolean" && t.loc, typeof t.comment == "boolean" && t.comment && (f.comments = []), typeof t.tolerant == "boolean" && t.tolerant && (f.errors = []); - try { - if (we(), i.type === y.EOF) - return f.tokens; - for (l = N(); i.type !== y.EOF; ) - try { - l = N(); - } catch (x) { - if (l = i, f.errors) { - f.errors.push(x); - break; - } else - throw x; - } - We(), C = f.tokens, typeof f.comments < "u" && (C.comments = f.comments), typeof f.errors < "u" && (C.errors = f.errors); - } catch (x) { - throw x; - } finally { - f = {}; - } - return C; - } - function Ot(e, t) { - var u, l; - l = String, typeof e != "string" && !(e instanceof String) && (e = l(e)), n = m, s = e, r = 0, g = s.length > 0 ? 1 : 0, b = 0, h = s.length, i = null, p = { - allowIn: !0, - labelSet: {}, - inFunctionBody: !1, - inIteration: !1, - inSwitch: !1, - lastCommentStart: -1 - }, f = {}, typeof t < "u" && (f.range = typeof t.range == "boolean" && t.range, f.loc = typeof t.loc == "boolean" && t.loc, f.attachComment = typeof t.attachComment == "boolean" && t.attachComment, f.loc && t.source !== null && t.source !== void 0 && (f.source = l(t.source)), typeof t.tokens == "boolean" && t.tokens && (f.tokens = []), typeof t.comment == "boolean" && t.comment && (f.comments = []), typeof t.tolerant == "boolean" && t.tolerant && (f.errors = []), f.attachComment && (f.range = !0, f.comments = [], f.bottomRightStack = [], f.trailingComments = [], f.leadingComments = [])); - try { - u = _t(), typeof f.comments < "u" && (u.comments = f.comments), typeof f.tokens < "u" && (We(), u.tokens = f.tokens), typeof f.errors < "u" && (u.errors = f.errors); - } catch (C) { - throw C; - } finally { - f = {}; - } - return u; - } - v.version = "1.2.2", v.tokenize = Tt, v.parse = Ot, v.Syntax = function() { - var e, t = {}; - typeof Object.create == "function" && (t = /* @__PURE__ */ Object.create(null)); - for (e in E) - E.hasOwnProperty(e) && (t[e] = E[e]); - return typeof Object.freeze == "function" && Object.freeze(t), t; - }(); - }); - }, {}], 1: [function(T, L, B) { - (function(v) { - var y = function() { - var D = { - trace: function() { - }, - yy: {}, - symbols_: { error: 2, JSON_PATH: 3, DOLLAR: 4, PATH_COMPONENTS: 5, LEADING_CHILD_MEMBER_EXPRESSION: 6, PATH_COMPONENT: 7, MEMBER_COMPONENT: 8, SUBSCRIPT_COMPONENT: 9, CHILD_MEMBER_COMPONENT: 10, DESCENDANT_MEMBER_COMPONENT: 11, DOT: 12, MEMBER_EXPRESSION: 13, DOT_DOT: 14, STAR: 15, IDENTIFIER: 16, SCRIPT_EXPRESSION: 17, INTEGER: 18, END: 19, CHILD_SUBSCRIPT_COMPONENT: 20, DESCENDANT_SUBSCRIPT_COMPONENT: 21, "[": 22, SUBSCRIPT: 23, "]": 24, SUBSCRIPT_EXPRESSION: 25, SUBSCRIPT_EXPRESSION_LIST: 26, SUBSCRIPT_EXPRESSION_LISTABLE: 27, ",": 28, STRING_LITERAL: 29, ARRAY_SLICE: 30, FILTER_EXPRESSION: 31, QQ_STRING: 32, Q_STRING: 33, $accept: 0, $end: 1 }, - terminals_: { 2: "error", 4: "DOLLAR", 12: "DOT", 14: "DOT_DOT", 15: "STAR", 16: "IDENTIFIER", 17: "SCRIPT_EXPRESSION", 18: "INTEGER", 19: "END", 22: "[", 24: "]", 28: ",", 30: "ARRAY_SLICE", 31: "FILTER_EXPRESSION", 32: "QQ_STRING", 33: "Q_STRING" }, - productions_: [0, [3, 1], [3, 2], [3, 1], [3, 2], [5, 1], [5, 2], [7, 1], [7, 1], [8, 1], [8, 1], [10, 2], [6, 1], [11, 2], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [9, 1], [9, 1], [20, 3], [21, 4], [23, 1], [23, 1], [26, 1], [26, 3], [27, 1], [27, 1], [27, 1], [25, 1], [25, 1], [25, 1], [29, 1], [29, 1]], - performAction: function(o, m, s, c, r, g, b) { - c.ast || (c.ast = S, S.initialize()); - var h = g.length - 1; - switch (r) { - case 1: - return c.ast.set({ expression: { type: "root", value: g[h] } }), c.ast.unshift(), c.ast.yield(); - case 2: - return c.ast.set({ expression: { type: "root", value: g[h - 1] } }), c.ast.unshift(), c.ast.yield(); - case 3: - return c.ast.unshift(), c.ast.yield(); - case 4: - return c.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: g[h - 1] } }), c.ast.unshift(), c.ast.yield(); - case 5: - break; - case 6: - break; - case 7: - c.ast.set({ operation: "member" }), c.ast.push(); - break; - case 8: - c.ast.set({ operation: "subscript" }), c.ast.push(); - break; - case 9: - c.ast.set({ scope: "child" }); - break; - case 10: - c.ast.set({ scope: "descendant" }); - break; - case 11: - break; - case 12: - c.ast.set({ scope: "child", operation: "member" }); - break; - case 13: - break; - case 14: - c.ast.set({ expression: { type: "wildcard", value: g[h] } }); - break; - case 15: - c.ast.set({ expression: { type: "identifier", value: g[h] } }); - break; - case 16: - c.ast.set({ expression: { type: "script_expression", value: g[h] } }); - break; - case 17: - c.ast.set({ expression: { type: "numeric_literal", value: parseInt(g[h]) } }); - break; - case 18: - break; - case 19: - c.ast.set({ scope: "child" }); - break; - case 20: - c.ast.set({ scope: "descendant" }); - break; - case 21: - break; - case 22: - break; - case 23: - break; - case 24: - g[h].length > 1 ? c.ast.set({ expression: { type: "union", value: g[h] } }) : this.$ = g[h]; - break; - case 25: - this.$ = [g[h]]; - break; - case 26: - this.$ = g[h - 2].concat(g[h]); - break; - case 27: - this.$ = { expression: { type: "numeric_literal", value: parseInt(g[h]) } }, c.ast.set(this.$); - break; - case 28: - this.$ = { expression: { type: "string_literal", value: g[h] } }, c.ast.set(this.$); - break; - case 29: - this.$ = { expression: { type: "slice", value: g[h] } }, c.ast.set(this.$); - break; - case 30: - this.$ = { expression: { type: "wildcard", value: g[h] } }, c.ast.set(this.$); - break; - case 31: - this.$ = { expression: { type: "script_expression", value: g[h] } }, c.ast.set(this.$); - break; - case 32: - this.$ = { expression: { type: "filter_expression", value: g[h] } }, c.ast.set(this.$); - break; - case 33: - this.$ = g[h]; - break; - case 34: - this.$ = g[h]; - break; - } - }, - table: [{ 3: 1, 4: [1, 2], 6: 3, 13: 4, 15: [1, 5], 16: [1, 6], 17: [1, 7], 18: [1, 8], 19: [1, 9] }, { 1: [3] }, { 1: [2, 1], 5: 10, 7: 11, 8: 12, 9: 13, 10: 14, 11: 15, 12: [1, 18], 14: [1, 19], 20: 16, 21: 17, 22: [1, 20] }, { 1: [2, 3], 5: 21, 7: 11, 8: 12, 9: 13, 10: 14, 11: 15, 12: [1, 18], 14: [1, 19], 20: 16, 21: 17, 22: [1, 20] }, { 1: [2, 12], 12: [2, 12], 14: [2, 12], 22: [2, 12] }, { 1: [2, 14], 12: [2, 14], 14: [2, 14], 22: [2, 14] }, { 1: [2, 15], 12: [2, 15], 14: [2, 15], 22: [2, 15] }, { 1: [2, 16], 12: [2, 16], 14: [2, 16], 22: [2, 16] }, { 1: [2, 17], 12: [2, 17], 14: [2, 17], 22: [2, 17] }, { 1: [2, 18], 12: [2, 18], 14: [2, 18], 22: [2, 18] }, { 1: [2, 2], 7: 22, 8: 12, 9: 13, 10: 14, 11: 15, 12: [1, 18], 14: [1, 19], 20: 16, 21: 17, 22: [1, 20] }, { 1: [2, 5], 12: [2, 5], 14: [2, 5], 22: [2, 5] }, { 1: [2, 7], 12: [2, 7], 14: [2, 7], 22: [2, 7] }, { 1: [2, 8], 12: [2, 8], 14: [2, 8], 22: [2, 8] }, { 1: [2, 9], 12: [2, 9], 14: [2, 9], 22: [2, 9] }, { 1: [2, 10], 12: [2, 10], 14: [2, 10], 22: [2, 10] }, { 1: [2, 19], 12: [2, 19], 14: [2, 19], 22: [2, 19] }, { 1: [2, 20], 12: [2, 20], 14: [2, 20], 22: [2, 20] }, { 13: 23, 15: [1, 5], 16: [1, 6], 17: [1, 7], 18: [1, 8], 19: [1, 9] }, { 13: 24, 15: [1, 5], 16: [1, 6], 17: [1, 7], 18: [1, 8], 19: [1, 9], 22: [1, 25] }, { 15: [1, 29], 17: [1, 30], 18: [1, 33], 23: 26, 25: 27, 26: 28, 27: 32, 29: 34, 30: [1, 35], 31: [1, 31], 32: [1, 36], 33: [1, 37] }, { 1: [2, 4], 7: 22, 8: 12, 9: 13, 10: 14, 11: 15, 12: [1, 18], 14: [1, 19], 20: 16, 21: 17, 22: [1, 20] }, { 1: [2, 6], 12: [2, 6], 14: [2, 6], 22: [2, 6] }, { 1: [2, 11], 12: [2, 11], 14: [2, 11], 22: [2, 11] }, { 1: [2, 13], 12: [2, 13], 14: [2, 13], 22: [2, 13] }, { 15: [1, 29], 17: [1, 30], 18: [1, 33], 23: 38, 25: 27, 26: 28, 27: 32, 29: 34, 30: [1, 35], 31: [1, 31], 32: [1, 36], 33: [1, 37] }, { 24: [1, 39] }, { 24: [2, 23] }, { 24: [2, 24], 28: [1, 40] }, { 24: [2, 30] }, { 24: [2, 31] }, { 24: [2, 32] }, { 24: [2, 25], 28: [2, 25] }, { 24: [2, 27], 28: [2, 27] }, { 24: [2, 28], 28: [2, 28] }, { 24: [2, 29], 28: [2, 29] }, { 24: [2, 33], 28: [2, 33] }, { 24: [2, 34], 28: [2, 34] }, { 24: [1, 41] }, { 1: [2, 21], 12: [2, 21], 14: [2, 21], 22: [2, 21] }, { 18: [1, 33], 27: 42, 29: 34, 30: [1, 35], 32: [1, 36], 33: [1, 37] }, { 1: [2, 22], 12: [2, 22], 14: [2, 22], 22: [2, 22] }, { 24: [2, 26], 28: [2, 26] }], - defaultActions: { 27: [2, 23], 29: [2, 30], 30: [2, 31], 31: [2, 32] }, - parseError: function(o, m) { - if (m.recoverable) - this.trace(o); - else - throw new Error(o); - }, - parse: function(o) { - var m = this, s = [0], c = [null], r = [], g = this.table, b = "", h = 0, n = 0, i = 2, p = 1, f = r.slice.call(arguments, 1); - this.lexer.setInput(o), this.lexer.yy = this.yy, this.yy.lexer = this.lexer, this.yy.parser = this, typeof this.lexer.yylloc > "u" && (this.lexer.yylloc = {}); - var I = this.lexer.yylloc; - r.push(I); - var R = this.lexer.options && this.lexer.options.ranges; - typeof this.yy.parseError == "function" ? this.parseError = this.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; - function U() { - var oe; - return oe = m.lexer.lex() || p, typeof oe != "number" && (oe = m.symbols_[oe] || oe), oe; - } - for (var w, H, M, z, V = {}, ae, Y, J, se; ; ) { - if (H = s[s.length - 1], this.defaultActions[H] ? M = this.defaultActions[H] : ((w === null || typeof w > "u") && (w = U()), M = g[H] && g[H][w]), typeof M > "u" || !M.length || !M[0]) { - var ie = ""; - se = []; - for (ae in g[H]) - this.terminals_[ae] && ae > i && se.push("'" + this.terminals_[ae] + "'"); - this.lexer.showPosition ? ie = "Parse error on line " + (h + 1) + `: -` + this.lexer.showPosition() + ` -Expecting ` + se.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : ie = "Parse error on line " + (h + 1) + ": Unexpected " + (w == p ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(ie, { - text: this.lexer.match, - token: this.terminals_[w] || w, - line: this.lexer.yylineno, - loc: I, - expected: se - }); - } - if (M[0] instanceof Array && M.length > 1) - throw new Error("Parse Error: multiple actions possible at state: " + H + ", token: " + w); - switch (M[0]) { - case 1: - s.push(w), c.push(this.lexer.yytext), r.push(this.lexer.yylloc), s.push(M[1]), w = null, n = this.lexer.yyleng, b = this.lexer.yytext, h = this.lexer.yylineno, I = this.lexer.yylloc; - break; - case 2: - if (Y = this.productions_[M[1]][1], V.$ = c[c.length - Y], V._$ = { - first_line: r[r.length - (Y || 1)].first_line, - last_line: r[r.length - 1].last_line, - first_column: r[r.length - (Y || 1)].first_column, - last_column: r[r.length - 1].last_column - }, R && (V._$.range = [ - r[r.length - (Y || 1)].range[0], - r[r.length - 1].range[1] - ]), z = this.performAction.apply(V, [ - b, - n, - h, - this.yy, - M[1], - c, - r - ].concat(f)), typeof z < "u") - return z; - Y && (s = s.slice(0, -1 * Y * 2), c = c.slice(0, -1 * Y), r = r.slice(0, -1 * Y)), s.push(this.productions_[M[1]][0]), c.push(V.$), r.push(V._$), J = g[s[s.length - 2]][s[s.length - 1]], s.push(J); - break; - case 3: - return !0; - } - } - return !0; - } - }, S = { - initialize: function() { - this._nodes = [], this._node = {}, this._stash = []; - }, - set: function(a) { - for (var o in a) - this._node[o] = a[o]; - return this._node; - }, - node: function(a) { - return arguments.length && (this._node = a), this._node; - }, - push: function() { - this._nodes.push(this._node), this._node = {}; - }, - unshift: function() { - this._nodes.unshift(this._node), this._node = {}; - }, - yield: function() { - var a = this._nodes; - return this.initialize(), a; - } - }, E = /* @__PURE__ */ function() { - var a = { - EOF: 1, - parseError: function(m, s) { - if (this.yy.parser) - this.yy.parser.parseError(m, s); - else - throw new Error(m); - }, - // resets the lexer, sets new input - setInput: function(o) { - return this._input = o, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; - }, - // consumes and returns one char from the input - input: function() { - var o = this._input[0]; - this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o; - var m = o.match(/(?:\r\n?|\n).*/g); - return m ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), o; - }, - // unshifts one char (or a string) into the input - unput: function(o) { - var m = o.length, s = o.split(/(?:\r\n?|\n)/g); - this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - m - 1), this.offset -= m; - var c = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), s.length - 1 && (this.yylineno -= s.length - 1); - var r = this.yylloc.range; - return this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: s ? (s.length === c.length ? this.yylloc.first_column : 0) + c[c.length - s.length].length - s[0].length : this.yylloc.first_column - m - }, this.options.ranges && (this.yylloc.range = [r[0], r[0] + this.yyleng - m]), this.yyleng = this.yytext.length, this; - }, - // When called from action, caches matched text and appends it on next action - more: function() { - return this._more = !0, this; - }, - // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. - reject: function() { - if (this.options.backtrack_lexer) - this._backtrack = !0; - else - return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). -` + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - return this; - }, - // retain first n characters of the match - less: function(o) { - this.unput(this.match.slice(o)); - }, - // displays already matched input, i.e. for error messages - pastInput: function() { - var o = this.matched.substr(0, this.matched.length - this.match.length); - return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, ""); - }, - // displays upcoming input, i.e. for error messages - upcomingInput: function() { - var o = this.match; - return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, ""); - }, - // displays the character position where the lexing error occurred, i.e. for error messages - showPosition: function() { - var o = this.pastInput(), m = new Array(o.length + 1).join("-"); - return o + this.upcomingInput() + ` -` + m + "^"; - }, - // test the lexed token: return FALSE when not a match, otherwise return token - test_match: function(o, m) { - var s, c, r; - if (this.options.backtrack_lexer && (r = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }, this.options.ranges && (r.yylloc.range = this.yylloc.range.slice(0))), c = o[0].match(/(?:\r\n?|\n).*/g), c && (this.yylineno += c.length), this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: c ? c[c.length - 1].length - c[c.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + o[0].length - }, this.yytext += o[0], this.match += o[0], this.matches = o, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(o[0].length), this.matched += o[0], s = this.performAction.call(this, this.yy, this, m, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), s) - return s; - if (this._backtrack) { - for (var g in r) - this[g] = r[g]; - return !1; - } - return !1; - }, - // return next match in input - next: function() { - if (this.done) - return this.EOF; - this._input || (this.done = !0); - var o, m, s, c; - this._more || (this.yytext = "", this.match = ""); - for (var r = this._currentRules(), g = 0; g < r.length; g++) - if (s = this._input.match(this.rules[r[g]]), s && (!m || s[0].length > m[0].length)) { - if (m = s, c = g, this.options.backtrack_lexer) { - if (o = this.test_match(s, r[g]), o !== !1) - return o; - if (this._backtrack) { - m = !1; - continue; - } else - return !1; - } else if (!this.options.flex) - break; - } - return m ? (o = this.test_match(m, r[c]), o !== !1 ? o : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text. -` + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - }, - // return next match that has a token - lex: function() { - var m = this.next(); - return m || this.lex(); - }, - // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) - begin: function(m) { - this.conditionStack.push(m); - }, - // pop the previously active lexer condition state off the condition stack - popState: function() { - var m = this.conditionStack.length - 1; - return m > 0 ? this.conditionStack.pop() : this.conditionStack[0]; - }, - // produce the lexer rule set which is active for the currently active lexer condition state - _currentRules: function() { - return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; - }, - // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available - topState: function(m) { - return m = this.conditionStack.length - 1 - Math.abs(m || 0), m >= 0 ? this.conditionStack[m] : "INITIAL"; - }, - // alias for begin(condition) - pushState: function(m) { - this.begin(m); - }, - // return the number of states currently on the stack - stateStackSize: function() { - return this.conditionStack.length; - }, - options: {}, - performAction: function(m, s, c, r) { - switch (c) { - case 0: - return 4; - case 1: - return 14; - case 2: - return 12; - case 3: - return 15; - case 4: - return 16; - case 5: - return 22; - case 6: - return 24; - case 7: - return 28; - case 8: - return 30; - case 9: - return 18; - case 10: - return s.yytext = s.yytext.substr(1, s.yyleng - 2), 32; - case 11: - return s.yytext = s.yytext.substr(1, s.yyleng - 2), 33; - case 12: - return 17; - case 13: - return 31; - } - }, - rules: [/^(?:\$)/, /^(?:\.\.)/, /^(?:\.)/, /^(?:\*)/, /^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/, /^(?:\[)/, /^(?:\])/, /^(?:,)/, /^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/, /^(?:(-?(?:0|[1-9][0-9]*)))/, /^(?:"(?:\\["bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/, /^(?:'(?:\\['bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/, /^(?:\(.+?\)(?=\]))/, /^(?:\?\(.+?\)(?=\]))/], - conditions: { INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], inclusive: !0 } } - }; - return a; - }(); - D.lexer = E; - function d() { - this.yy = {}; - } - return d.prototype = D, D.Parser = d, new d(); - }(); - typeof T < "u" && typeof B < "u" && (B.parser = y, B.Parser = y.Parser, B.parse = function() { - return y.parse.apply(y, arguments); - }, B.main = function(S) { - S[1] || (console.log("Usage: " + S[0] + " FILE"), v.exit(1)); - var E = T("fs").readFileSync(T("path").normalize(S[1]), "utf8"); - return B.parser.parse(E); - }, typeof L < "u" && T.main === L && B.main(v.argv.slice(1))); - }).call(this, T("_process")); - }, { _process: 14, fs: 12, path: 13 }], 2: [function(T, L, B) { - L.exports = { - identifier: "[a-zA-Z_]+[a-zA-Z0-9_]*", - integer: "-?(?:0|[1-9][0-9]*)", - qq_string: '"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*"', - q_string: "'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*'" - }; - }, {}], 3: [function(T, L, B) { - var v = T("./dict"), y = T("fs"), D = { - lex: { - macros: { - esc: "\\\\", - int: v.integer - }, - rules: [ - ["\\$", "return 'DOLLAR'"], - ["\\.\\.", "return 'DOT_DOT'"], - ["\\.", "return 'DOT'"], - ["\\*", "return 'STAR'"], - [v.identifier, "return 'IDENTIFIER'"], - ["\\[", "return '['"], - ["\\]", "return ']'"], - [",", "return ','"], - ["({int})?\\:({int})?(\\:({int})?)?", "return 'ARRAY_SLICE'"], - ["{int}", "return 'INTEGER'"], - [v.qq_string, "yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"], - [v.q_string, "yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"], - ["\\(.+?\\)(?=\\])", "return 'SCRIPT_EXPRESSION'"], - ["\\?\\(.+?\\)(?=\\])", "return 'FILTER_EXPRESSION'"] - ] - }, - start: "JSON_PATH", - bnf: { - JSON_PATH: [ - ["DOLLAR", 'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'], - ["DOLLAR PATH_COMPONENTS", 'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'], - ["LEADING_CHILD_MEMBER_EXPRESSION", "yy.ast.unshift(); return yy.ast.yield()"], - ["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS", 'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()'] - ], - PATH_COMPONENTS: [ - ["PATH_COMPONENT", ""], - ["PATH_COMPONENTS PATH_COMPONENT", ""] - ], - PATH_COMPONENT: [ - ["MEMBER_COMPONENT", 'yy.ast.set({ operation: "member" }); yy.ast.push()'], - ["SUBSCRIPT_COMPONENT", 'yy.ast.set({ operation: "subscript" }); yy.ast.push() '] - ], - MEMBER_COMPONENT: [ - ["CHILD_MEMBER_COMPONENT", 'yy.ast.set({ scope: "child" })'], - ["DESCENDANT_MEMBER_COMPONENT", 'yy.ast.set({ scope: "descendant" })'] - ], - CHILD_MEMBER_COMPONENT: [ - ["DOT MEMBER_EXPRESSION", ""] - ], - LEADING_CHILD_MEMBER_EXPRESSION: [ - ["MEMBER_EXPRESSION", 'yy.ast.set({ scope: "child", operation: "member" })'] - ], - DESCENDANT_MEMBER_COMPONENT: [ - ["DOT_DOT MEMBER_EXPRESSION", ""] - ], - MEMBER_EXPRESSION: [ - ["STAR", 'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'], - ["IDENTIFIER", 'yy.ast.set({ expression: { type: "identifier", value: $1 } })'], - ["SCRIPT_EXPRESSION", 'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'], - ["INTEGER", 'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'], - ["END", ""] - ], - SUBSCRIPT_COMPONENT: [ - ["CHILD_SUBSCRIPT_COMPONENT", 'yy.ast.set({ scope: "child" })'], - ["DESCENDANT_SUBSCRIPT_COMPONENT", 'yy.ast.set({ scope: "descendant" })'] - ], - CHILD_SUBSCRIPT_COMPONENT: [ - ["[ SUBSCRIPT ]", ""] - ], - DESCENDANT_SUBSCRIPT_COMPONENT: [ - ["DOT_DOT [ SUBSCRIPT ]", ""] - ], - SUBSCRIPT: [ - ["SUBSCRIPT_EXPRESSION", ""], - ["SUBSCRIPT_EXPRESSION_LIST", '$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1'] - ], - SUBSCRIPT_EXPRESSION_LIST: [ - ["SUBSCRIPT_EXPRESSION_LISTABLE", "$$ = [$1]"], - ["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE", "$$ = $1.concat($3)"] - ], - SUBSCRIPT_EXPRESSION_LISTABLE: [ - ["INTEGER", '$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'], - ["STRING_LITERAL", '$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'], - ["ARRAY_SLICE", '$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)'] - ], - SUBSCRIPT_EXPRESSION: [ - ["STAR", '$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'], - ["SCRIPT_EXPRESSION", '$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'], - ["FILTER_EXPRESSION", '$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)'] - ], - STRING_LITERAL: [ - ["QQ_STRING", "$$ = $1"], - ["Q_STRING", "$$ = $1"] - ] - } - }; - y.readFileSync && (D.moduleInclude = y.readFileSync(T.resolve("../include/module.js")), D.actionInclude = y.readFileSync(T.resolve("../include/action.js"))), L.exports = D; - }, { "./dict": 2, fs: 12 }], 4: [function(T, L, B) { - var v = T("./aesprim"), y = T("./slice"), D = T("static-eval"), S = T("underscore").uniq, E = function() { - return this.initialize.apply(this, arguments); - }; - E.prototype.initialize = function() { - this.traverse = m(!0), this.descend = m(); - }, E.prototype.keys = Object.keys, E.prototype.resolve = function(h) { - var n = [h.operation, h.scope, h.expression.type].join("-"), i = this._fns[n]; - if (!i) - throw new Error("couldn't resolve key: " + n); - return i.bind(this); - }, E.prototype.register = function(h, n) { - if (!n instanceof Function) - throw new Error("handler must be a function"); - this._fns[h] = n; - }, E.prototype._fns = { - "member-child-identifier": function(h, n) { - var i = h.expression.value, p = n.value; - if (p instanceof Object && i in p) - return [{ value: p[i], path: n.path.concat(i) }]; - }, - "member-descendant-identifier": c(function(h, n, i) { - return h == i; - }), - "subscript-child-numeric_literal": s(function(h, n, i) { - return h === i; - }), - "member-child-numeric_literal": s(function(h, n, i) { - return String(h) === String(i); - }), - "subscript-descendant-numeric_literal": c(function(h, n, i) { - return h === i; - }), - "member-child-wildcard": s(function() { - return !0; - }), - "member-descendant-wildcard": c(function() { - return !0; - }), - "subscript-descendant-wildcard": c(function() { - return !0; - }), - "subscript-child-wildcard": s(function() { - return !0; - }), - "subscript-child-slice": function(h, n) { - if (a(n.value)) { - var i = h.expression.value.split(":").map(b), p = n.value.map(function(f, I) { - return { value: f, path: n.path.concat(I) }; - }); - return y.apply(null, [p].concat(i)); - } - }, - "subscript-child-union": function(h, n) { - var i = []; - return h.expression.value.forEach(function(p) { - var f = { operation: "subscript", scope: "child", expression: p.expression }, I = this.resolve(f), R = I(f, n); - R && (i = i.concat(R)); - }, this), g(i); - }, - "subscript-descendant-union": function(h, n, i) { - var p = T(".."), f = this, I = [], R = p.nodes(n, "$..*").slice(1); - return R.forEach(function(U) { - I.length >= i || h.expression.value.forEach(function(w) { - var H = { operation: "subscript", scope: "child", expression: w.expression }, M = f.resolve(H), z = M(H, U); - I = I.concat(z); - }); - }), g(I); - }, - "subscript-child-filter_expression": function(h, n, i) { - var p = h.expression.value.slice(2, -1), f = v.parse(p).body[0].expression, I = function(R, U) { - return r(f, { "@": U }); - }; - return this.descend(n, null, I, i); - }, - "subscript-descendant-filter_expression": function(h, n, i) { - var p = h.expression.value.slice(2, -1), f = v.parse(p).body[0].expression, I = function(R, U) { - return r(f, { "@": U }); - }; - return this.traverse(n, null, I, i); - }, - "subscript-child-script_expression": function(h, n) { - var i = h.expression.value.slice(1, -1); - return d(n, i, "$[{{value}}]"); - }, - "member-child-script_expression": function(h, n) { - var i = h.expression.value.slice(1, -1); - return d(n, i, "$.{{value}}"); - }, - "member-descendant-script_expression": function(h, n) { - var i = h.expression.value.slice(1, -1); - return d(n, i, "$..value"); - } - }, E.prototype._fns["subscript-child-string_literal"] = E.prototype._fns["member-child-identifier"], E.prototype._fns["member-descendant-numeric_literal"] = E.prototype._fns["subscript-descendant-string_literal"] = E.prototype._fns["member-descendant-identifier"]; - function d(h, n, i) { - var p = T("./index"), f = v.parse(n).body[0].expression, I = r(f, { "@": h.value }), R = i.replace(/\{\{\s*value\s*\}\}/g, I), U = p.nodes(h.value, R); - return U.forEach(function(w) { - w.path = h.path.concat(w.path.slice(1)); - }), U; - } - function a(h) { - return Array.isArray(h); - } - function o(h) { - return h && !(h instanceof Array) && h instanceof Object; - } - function m(h) { - return function(n, i, p, f) { - var I = n.value, R = n.path, U = [], w = (function(H, M) { - a(H) ? (H.forEach(function(z, V) { - U.length >= f || p(V, z, i) && U.push({ path: M.concat(V), value: z }); - }), H.forEach(function(z, V) { - U.length >= f || h && w(z, M.concat(V)); - })) : o(H) && (this.keys(H).forEach(function(z) { - U.length >= f || p(z, H[z], i) && U.push({ path: M.concat(z), value: H[z] }); - }), this.keys(H).forEach(function(z) { - U.length >= f || h && w(H[z], M.concat(z)); - })); - }).bind(this); - return w(I, R), U; - }; - } - function s(h) { - return function(n, i, p) { - return this.descend(i, n.expression.value, h, p); - }; - } - function c(h) { - return function(n, i, p) { - return this.traverse(i, n.expression.value, h, p); - }; - } - function r() { - try { - return D.apply(this, arguments); - } catch { - } - } - function g(h) { - return h = h.filter(function(n) { - return n; - }), S( - h, - function(n) { - return n.path.map(function(i) { - return String(i).replace("-", "--"); - }).join("-"); - } - ); - } - function b(h) { - var n = String(h); - return n.match(/^-?[0-9]+$/) ? parseInt(n) : null; - } - L.exports = E; - }, { "..": "jsonpath", "./aesprim": "./aesprim", "./index": 5, "./slice": 7, "static-eval": 15, underscore: 12 }], 5: [function(T, L, B) { - var v = T("assert"), y = T("./dict"), D = T("./parser"), S = T("./handlers"), E = function() { - this.initialize.apply(this, arguments); - }; - E.prototype.initialize = function() { - this.parser = new D(), this.handlers = new S(); - }, E.prototype.parse = function(o) { - return v.ok(d(o), "we need a path"), this.parser.parse(o); - }, E.prototype.parent = function(o, m) { - v.ok(o instanceof Object, "obj needs to be an object"), v.ok(m, "we need a path"); - var s = this.nodes(o, m)[0]; - return s.path.pop(), this.value(o, s.path); - }, E.prototype.apply = function(o, m, s) { - v.ok(o instanceof Object, "obj needs to be an object"), v.ok(m, "we need a path"), v.equal(typeof s, "function", "fn needs to be function"); - var c = this.nodes(o, m).sort(function(r, g) { - return g.path.length - r.path.length; - }); - return c.forEach(function(r) { - var g = r.path.pop(), b = this.value(o, this.stringify(r.path)), h = r.value = s.call(o, b[g]); - b[g] = h; - }, this), c; - }, E.prototype.value = function(o, m, s) { - if (v.ok(o instanceof Object, "obj needs to be an object"), v.ok(m, "we need a path"), arguments.length >= 3) { - var c = this.nodes(o, m).shift(); - if (!c) - return this._vivify(o, m, s); - var r = c.path.slice(-1).shift(), g = this.parent(o, this.stringify(c.path)); - g[r] = s; - } - return this.query(o, this.stringify(m), 1).shift(); - }, E.prototype._vivify = function(o, m, s) { - var c = this; - v.ok(o instanceof Object, "obj needs to be an object"), v.ok(m, "we need a path"); - var r = this.parser.parse(m).map(function(b) { - return b.expression.value; - }), g = function(b, h) { - var n = b.pop(), i = c.value(o, b); - i || (g(b.concat(), typeof n == "string" ? {} : []), i = c.value(o, b)), i[n] = h; - }; - return g(r, s), this.query(o, m)[0]; - }, E.prototype.query = function(o, m, s) { - v.ok(o instanceof Object, "obj needs to be an object"), v.ok(d(m), "we need a path"); - var c = this.nodes(o, m, s).map(function(r) { - return r.value; - }); - return c; - }, E.prototype.paths = function(o, m, s) { - v.ok(o instanceof Object, "obj needs to be an object"), v.ok(m, "we need a path"); - var c = this.nodes(o, m, s).map(function(r) { - return r.path; - }); - return c; - }, E.prototype.nodes = function(o, m, s) { - if (v.ok(o instanceof Object, "obj needs to be an object"), v.ok(m, "we need a path"), s === 0) - return []; - var c = this.parser.parse(m), r = this.handlers, g = [{ path: ["$"], value: o }], b = []; - return c.length && c[0].expression.type == "root" && c.shift(), c.length ? (c.forEach(function(h, n) { - if (!(b.length >= s)) { - var i = r.resolve(h), p = []; - g.forEach(function(f) { - if (!(b.length >= s)) { - var I = i(h, f, s); - n == c.length - 1 ? b = b.concat(I || []) : p = p.concat(I || []); - } - }), g = p; - } - }), s ? b.slice(0, s) : b) : g; - }, E.prototype.stringify = function(o) { - v.ok(o, "we need a path"); - var m = "$", s = { - "descendant-member": "..{{value}}", - "child-member": ".{{value}}", - "descendant-subscript": "..[{{value}}]", - "child-subscript": "[{{value}}]" - }; - return o = this._normalize(o), o.forEach(function(c) { - if (c.expression.type != "root") { - var r = [c.scope, c.operation].join("-"), g = s[r], b; - if (c.expression.type == "string_literal" ? b = JSON.stringify(c.expression.value) : b = c.expression.value, !g) - throw new Error("couldn't find template " + r); - m += g.replace(/{{value}}/, b); - } - }), m; - }, E.prototype._normalize = function(o) { - if (v.ok(o, "we need a path"), typeof o == "string") - return this.parser.parse(o); - if (Array.isArray(o) && typeof o[0] == "string") { - var m = [{ expression: { type: "root", value: "$" } }]; - return o.forEach(function(s, c) { - if (!(s == "$" && c === 0)) - if (typeof s == "string" && s.match("^" + y.identifier + "$")) - m.push({ - operation: "member", - scope: "child", - expression: { value: s, type: "identifier" } - }); - else { - var r = typeof s == "number" ? "numeric_literal" : "string_literal"; - m.push({ - operation: "subscript", - scope: "child", - expression: { value: s, type: r } - }); - } - }), m; - } else if (Array.isArray(o) && typeof o[0] == "object") - return o; - throw new Error("couldn't understand path " + o); - }; - function d(o) { - return Object.prototype.toString.call(o) == "[object String]"; - } - E.Handlers = S, E.Parser = D; - var a = new E(); - a.JSONPath = E, L.exports = a; - }, { "./dict": 2, "./handlers": 4, "./parser": 6, assert: 8 }], 6: [function(T, L, B) { - var v = T("./grammar"), y = T("../generated/parser"), D = function() { - var S = new y.Parser(), E = S.parseError; - return S.yy.parseError = function() { - S.yy.ast && S.yy.ast.initialize(), E.apply(S, arguments); - }, S; - }; - D.grammar = v, L.exports = D; - }, { "../generated/parser": 1, "./grammar": 3 }], 7: [function(T, L, B) { - L.exports = function(y, D, S, E) { - if (typeof D == "string") - throw new Error("start cannot be a string"); - if (typeof S == "string") - throw new Error("end cannot be a string"); - if (typeof E == "string") - throw new Error("step cannot be a string"); - var d = y.length; - if (E === 0) - throw new Error("step cannot be zero"); - if (E = E ? v(E) : 1, D = D < 0 ? d + D : D, S = S < 0 ? d + S : S, D = v(D === 0 ? 0 : D || (E > 0 ? 0 : d - 1)), S = v(S === 0 ? 0 : S || (E > 0 ? d : -1)), D = E > 0 ? Math.max(0, D) : Math.min(d, D), S = E > 0 ? Math.min(S, d) : Math.max(-1, S), E > 0 && S <= D) - return []; - if (E < 0 && D <= S) - return []; - for (var a = [], o = D; o != S && !(E < 0 && o <= S || E > 0 && o >= S); o += E) - a.push(y[o]); - return a; - }; - function v(y) { - return String(y).match(/^[0-9]+$/) ? parseInt(y) : Number.isFinite(y) ? parseInt(y, 10) : 0; - } - }, {}], 8: [function(T, L, B) { - var v = T("util/"), y = Array.prototype.slice, D = Object.prototype.hasOwnProperty, S = L.exports = m; - S.AssertionError = function(i) { - this.name = "AssertionError", this.actual = i.actual, this.expected = i.expected, this.operator = i.operator, i.message ? (this.message = i.message, this.generatedMessage = !1) : (this.message = a(this), this.generatedMessage = !0); - var p = i.stackStartFunction || o; - if (Error.captureStackTrace) - Error.captureStackTrace(this, p); - else { - var f = new Error(); - if (f.stack) { - var I = f.stack, R = p.name, U = I.indexOf(` -` + R); - if (U >= 0) { - var w = I.indexOf(` -`, U + 1); - I = I.substring(w + 1); - } - this.stack = I; - } - } - }, v.inherits(S.AssertionError, Error); - function E(n, i) { - return v.isUndefined(i) ? "" + i : v.isNumber(i) && !isFinite(i) || v.isFunction(i) || v.isRegExp(i) ? i.toString() : i; - } - function d(n, i) { - return v.isString(n) ? n.length < i ? n : n.slice(0, i) : n; - } - function a(n) { - return d(JSON.stringify(n.actual, E), 128) + " " + n.operator + " " + d(JSON.stringify(n.expected, E), 128); - } - function o(n, i, p, f, I) { - throw new S.AssertionError({ - message: p, - actual: n, - expected: i, - operator: f, - stackStartFunction: I - }); - } - S.fail = o; - function m(n, i) { - n || o(n, !0, i, "==", S.ok); - } - S.ok = m, S.equal = function(i, p, f) { - i != p && o(i, p, f, "==", S.equal); - }, S.notEqual = function(i, p, f) { - i == p && o(i, p, f, "!=", S.notEqual); - }, S.deepEqual = function(i, p, f) { - s(i, p) || o(i, p, f, "deepEqual", S.deepEqual); - }; - function s(n, i) { - if (n === i) - return !0; - if (v.isBuffer(n) && v.isBuffer(i)) { - if (n.length != i.length) - return !1; - for (var p = 0; p < n.length; p++) - if (n[p] !== i[p]) - return !1; - return !0; - } else - return v.isDate(n) && v.isDate(i) ? n.getTime() === i.getTime() : v.isRegExp(n) && v.isRegExp(i) ? n.source === i.source && n.global === i.global && n.multiline === i.multiline && n.lastIndex === i.lastIndex && n.ignoreCase === i.ignoreCase : !v.isObject(n) && !v.isObject(i) ? n == i : r(n, i); - } - function c(n) { - return Object.prototype.toString.call(n) == "[object Arguments]"; - } - function r(n, i) { - if (v.isNullOrUndefined(n) || v.isNullOrUndefined(i) || n.prototype !== i.prototype) - return !1; - if (v.isPrimitive(n) || v.isPrimitive(i)) - return n === i; - var p = c(n), f = c(i); - if (p && !f || !p && f) - return !1; - if (p) - return n = y.call(n), i = y.call(i), s(n, i); - var I = h(n), R = h(i), U, w; - if (I.length != R.length) - return !1; - for (I.sort(), R.sort(), w = I.length - 1; w >= 0; w--) - if (I[w] != R[w]) - return !1; - for (w = I.length - 1; w >= 0; w--) - if (U = I[w], !s(n[U], i[U])) - return !1; - return !0; - } - S.notDeepEqual = function(i, p, f) { - s(i, p) && o(i, p, f, "notDeepEqual", S.notDeepEqual); - }, S.strictEqual = function(i, p, f) { - i !== p && o(i, p, f, "===", S.strictEqual); - }, S.notStrictEqual = function(i, p, f) { - i === p && o(i, p, f, "!==", S.notStrictEqual); - }; - function g(n, i) { - return !n || !i ? !1 : Object.prototype.toString.call(i) == "[object RegExp]" ? i.test(n) : n instanceof i ? !0 : i.call({}, n) === !0; - } - function b(n, i, p, f) { - var I; - v.isString(p) && (f = p, p = null); - try { - i(); - } catch (R) { - I = R; - } - if (f = (p && p.name ? " (" + p.name + ")." : ".") + (f ? " " + f : "."), n && !I && o(I, p, "Missing expected exception" + f), !n && g(I, p) && o(I, p, "Got unwanted exception" + f), n && I && p && !g(I, p) || !n && I) - throw I; - } - S.throws = function(n, i, p) { - b.apply(this, [!0].concat(y.call(arguments))); - }, S.doesNotThrow = function(n, i) { - b.apply(this, [!1].concat(y.call(arguments))); - }, S.ifError = function(n) { - if (n) - throw n; - }; - var h = Object.keys || function(n) { - var i = []; - for (var p in n) - D.call(n, p) && i.push(p); - return i; - }; - }, { "util/": 11 }], 9: [function(T, L, B) { - typeof Object.create == "function" ? L.exports = function(y, D) { - y.super_ = D, y.prototype = Object.create(D.prototype, { - constructor: { - value: y, - enumerable: !1, - writable: !0, - configurable: !0 - } - }); - } : L.exports = function(y, D) { - y.super_ = D; - var S = function() { - }; - S.prototype = D.prototype, y.prototype = new S(), y.prototype.constructor = y; - }; - }, {}], 10: [function(T, L, B) { - L.exports = function(y) { - return y && typeof y == "object" && typeof y.copy == "function" && typeof y.fill == "function" && typeof y.readUInt8 == "function"; - }; - }, {}], 11: [function(T, L, B) { - (function(v, y) { - var D = /%[sdj%]/g; - B.format = function(A) { - if (!R(A)) { - for (var F = [], k = 0; k < arguments.length; k++) - F.push(d(arguments[k])); - return F.join(" "); - } - for (var k = 1, X = arguments, ee = X.length, $ = String(A).replace(D, function(K) { - if (K === "%%") - return "%"; - if (k >= ee) - return K; - switch (K) { - case "%s": - return String(X[k++]); - case "%d": - return Number(X[k++]); - case "%j": - try { - return JSON.stringify(X[k++]); - } catch { - return "[Circular]"; - } - default: - return K; - } - }), q = X[k]; k < ee; q = X[++k]) - p(q) || !M(q) ? $ += " " + q : $ += " " + d(q); - return $; - }, B.deprecate = function(A, F) { - if (w(y.process)) - return function() { - return B.deprecate(A, F).apply(this, arguments); - }; - if (v.noDeprecation === !0) - return A; - var k = !1; - function X() { - if (!k) { - if (v.throwDeprecation) - throw new Error(F); - v.traceDeprecation ? console.trace(F) : console.error(F), k = !0; - } - return A.apply(this, arguments); - } - return X; - }; - var S = {}, E; - B.debuglog = function(A) { - if (w(E) && (E = v.env.NODE_DEBUG || ""), A = A.toUpperCase(), !S[A]) - if (new RegExp("\\b" + A + "\\b", "i").test(E)) { - var F = v.pid; - S[A] = function() { - var k = B.format.apply(B, arguments); - console.error("%s %d: %s", A, F, k); - }; - } else - S[A] = function() { - }; - return S[A]; - }; - function d(A, F) { - var k = { - seen: [], - stylize: o - }; - return arguments.length >= 3 && (k.depth = arguments[2]), arguments.length >= 4 && (k.colors = arguments[3]), i(F) ? k.showHidden = F : F && B._extend(k, F), w(k.showHidden) && (k.showHidden = !1), w(k.depth) && (k.depth = 2), w(k.colors) && (k.colors = !1), w(k.customInspect) && (k.customInspect = !0), k.colors && (k.stylize = a), s(k, A, k.depth); - } - B.inspect = d, d.colors = { - bold: [1, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - white: [37, 39], - grey: [90, 39], - black: [30, 39], - blue: [34, 39], - cyan: [36, 39], - green: [32, 39], - magenta: [35, 39], - red: [31, 39], - yellow: [33, 39] - }, d.styles = { - special: "cyan", - number: "yellow", - boolean: "yellow", - undefined: "grey", - null: "bold", - string: "green", - date: "magenta", - // "name": intentionally not styling - regexp: "red" - }; - function a(A, F) { - var k = d.styles[F]; - return k ? "\x1B[" + d.colors[k][0] + "m" + A + "\x1B[" + d.colors[k][1] + "m" : A; - } - function o(A, F) { - return A; - } - function m(A) { - var F = {}; - return A.forEach(function(k, X) { - F[k] = !0; - }), F; - } - function s(A, F, k) { - if (A.customInspect && F && ae(F.inspect) && // Filter out the util module, it's inspect function is special - F.inspect !== B.inspect && // Also filter out any prototype objects using the circular check. - !(F.constructor && F.constructor.prototype === F)) { - var X = F.inspect(k, A); - return R(X) || (X = s(A, X, k)), X; - } - var ee = c(A, F); - if (ee) - return ee; - var $ = Object.keys(F), q = m($); - if (A.showHidden && ($ = Object.getOwnPropertyNames(F)), V(F) && ($.indexOf("message") >= 0 || $.indexOf("description") >= 0)) - return r(F); - if ($.length === 0) { - if (ae(F)) { - var K = F.name ? ": " + F.name : ""; - return A.stylize("[Function" + K + "]", "special"); - } - if (H(F)) - return A.stylize(RegExp.prototype.toString.call(F), "regexp"); - if (z(F)) - return A.stylize(Date.prototype.toString.call(F), "date"); - if (V(F)) - return r(F); - } - var Q = "", fe = !1, Ee = ["{", "}"]; - if (n(F) && (fe = !0, Ee = ["[", "]"]), ae(F)) { - var ke = F.name ? ": " + F.name : ""; - Q = " [Function" + ke + "]"; - } - if (H(F) && (Q = " " + RegExp.prototype.toString.call(F)), z(F) && (Q = " " + Date.prototype.toUTCString.call(F)), V(F) && (Q = " " + r(F)), $.length === 0 && (!fe || F.length == 0)) - return Ee[0] + Q + Ee[1]; - if (k < 0) - return H(F) ? A.stylize(RegExp.prototype.toString.call(F), "regexp") : A.stylize("[Object]", "special"); - A.seen.push(F); - var ge; - return fe ? ge = g(A, F, k, q, $) : ge = $.map(function(Fe) { - return b(A, F, k, q, Fe, fe); - }), A.seen.pop(), h(ge, Q, Ee); - } - function c(A, F) { - if (w(F)) - return A.stylize("undefined", "undefined"); - if (R(F)) { - var k = "'" + JSON.stringify(F).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; - return A.stylize(k, "string"); - } - if (I(F)) - return A.stylize("" + F, "number"); - if (i(F)) - return A.stylize("" + F, "boolean"); - if (p(F)) - return A.stylize("null", "null"); - } - function r(A) { - return "[" + Error.prototype.toString.call(A) + "]"; - } - function g(A, F, k, X, ee) { - for (var $ = [], q = 0, K = F.length; q < K; ++q) - ve(F, String(q)) ? $.push(b( - A, - F, - k, - X, - String(q), - !0 - )) : $.push(""); - return ee.forEach(function(Q) { - Q.match(/^\d+$/) || $.push(b( - A, - F, - k, - X, - Q, - !0 - )); - }), $; - } - function b(A, F, k, X, ee, $) { - var q, K, Q; - if (Q = Object.getOwnPropertyDescriptor(F, ee) || { value: F[ee] }, Q.get ? Q.set ? K = A.stylize("[Getter/Setter]", "special") : K = A.stylize("[Getter]", "special") : Q.set && (K = A.stylize("[Setter]", "special")), ve(X, ee) || (q = "[" + ee + "]"), K || (A.seen.indexOf(Q.value) < 0 ? (p(k) ? K = s(A, Q.value, null) : K = s(A, Q.value, k - 1), K.indexOf(` -`) > -1 && ($ ? K = K.split(` -`).map(function(fe) { - return " " + fe; - }).join(` -`).substr(2) : K = ` -` + K.split(` -`).map(function(fe) { - return " " + fe; - }).join(` -`))) : K = A.stylize("[Circular]", "special")), w(q)) { - if ($ && ee.match(/^\d+$/)) - return K; - q = JSON.stringify("" + ee), q.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (q = q.substr(1, q.length - 2), q = A.stylize(q, "name")) : (q = q.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), q = A.stylize(q, "string")); - } - return q + ": " + K; - } - function h(A, F, k) { - var X = A.reduce(function(ee, $) { - return $.indexOf(` -`) >= 0, ee + $.replace(/\u001b\[\d\d?m/g, "").length + 1; - }, 0); - return X > 60 ? k[0] + (F === "" ? "" : F + ` - `) + " " + A.join(`, - `) + " " + k[1] : k[0] + F + " " + A.join(", ") + " " + k[1]; - } - function n(A) { - return Array.isArray(A); - } - B.isArray = n; - function i(A) { - return typeof A == "boolean"; - } - B.isBoolean = i; - function p(A) { - return A === null; - } - B.isNull = p; - function f(A) { - return A == null; - } - B.isNullOrUndefined = f; - function I(A) { - return typeof A == "number"; - } - B.isNumber = I; - function R(A) { - return typeof A == "string"; - } - B.isString = R; - function U(A) { - return typeof A == "symbol"; - } - B.isSymbol = U; - function w(A) { - return A === void 0; - } - B.isUndefined = w; - function H(A) { - return M(A) && J(A) === "[object RegExp]"; - } - B.isRegExp = H; - function M(A) { - return typeof A == "object" && A !== null; - } - B.isObject = M; - function z(A) { - return M(A) && J(A) === "[object Date]"; - } - B.isDate = z; - function V(A) { - return M(A) && (J(A) === "[object Error]" || A instanceof Error); - } - B.isError = V; - function ae(A) { - return typeof A == "function"; - } - B.isFunction = ae; - function Y(A) { - return A === null || typeof A == "boolean" || typeof A == "number" || typeof A == "string" || typeof A == "symbol" || // ES6 symbol - typeof A > "u"; - } - B.isPrimitive = Y, B.isBuffer = T("./support/isBuffer"); - function J(A) { - return Object.prototype.toString.call(A); - } - function se(A) { - return A < 10 ? "0" + A.toString(10) : A.toString(10); - } - var ie = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" - ]; - function oe() { - var A = /* @__PURE__ */ new Date(), F = [ - se(A.getHours()), - se(A.getMinutes()), - se(A.getSeconds()) - ].join(":"); - return [A.getDate(), ie[A.getMonth()], F].join(" "); - } - B.log = function() { - console.log("%s - %s", oe(), B.format.apply(B, arguments)); - }, B.inherits = T("inherits"), B._extend = function(A, F) { - if (!F || !M(F)) - return A; - for (var k = Object.keys(F), X = k.length; X--; ) - A[k[X]] = F[k[X]]; - return A; - }; - function ve(A, F) { - return Object.prototype.hasOwnProperty.call(A, F); - } - }).call(this, T("_process"), typeof Xe < "u" ? Xe : typeof self < "u" ? self : typeof window < "u" ? window : {}); - }, { "./support/isBuffer": 10, _process: 14, inherits: 9 }], 12: [function(T, L, B) { - }, {}], 13: [function(T, L, B) { - (function(v) { - function y(d, a) { - for (var o = 0, m = d.length - 1; m >= 0; m--) { - var s = d[m]; - s === "." ? d.splice(m, 1) : s === ".." ? (d.splice(m, 1), o++) : o && (d.splice(m, 1), o--); - } - if (a) - for (; o--; o) - d.unshift(".."); - return d; - } - B.resolve = function() { - for (var d = "", a = !1, o = arguments.length - 1; o >= -1 && !a; o--) { - var m = o >= 0 ? arguments[o] : v.cwd(); - if (typeof m != "string") - throw new TypeError("Arguments to path.resolve must be strings"); - if (!m) - continue; - d = m + "/" + d, a = m.charAt(0) === "/"; - } - return d = y(S(d.split("/"), function(s) { - return !!s; - }), !a).join("/"), (a ? "/" : "") + d || "."; - }, B.normalize = function(d) { - var a = B.isAbsolute(d), o = E(d, -1) === "/"; - return d = y(S(d.split("/"), function(m) { - return !!m; - }), !a).join("/"), !d && !a && (d = "."), d && o && (d += "/"), (a ? "/" : "") + d; - }, B.isAbsolute = function(d) { - return d.charAt(0) === "/"; - }, B.join = function() { - var d = Array.prototype.slice.call(arguments, 0); - return B.normalize(S(d, function(a, o) { - if (typeof a != "string") - throw new TypeError("Arguments to path.join must be strings"); - return a; - }).join("/")); - }, B.relative = function(d, a) { - d = B.resolve(d).substr(1), a = B.resolve(a).substr(1); - function o(h) { - for (var n = 0; n < h.length && h[n] === ""; n++) - ; - for (var i = h.length - 1; i >= 0 && h[i] === ""; i--) - ; - return n > i ? [] : h.slice(n, i - n + 1); - } - for (var m = o(d.split("/")), s = o(a.split("/")), c = Math.min(m.length, s.length), r = c, g = 0; g < c; g++) - if (m[g] !== s[g]) { - r = g; - break; - } - for (var b = [], g = r; g < m.length; g++) - b.push(".."); - return b = b.concat(s.slice(r)), b.join("/"); - }, B.sep = "/", B.delimiter = ":", B.dirname = function(d) { - if (typeof d != "string" && (d = d + ""), d.length === 0) - return "."; - for (var a = d.charCodeAt(0), o = a === 47, m = -1, s = !0, c = d.length - 1; c >= 1; --c) - if (a = d.charCodeAt(c), a === 47) { - if (!s) { - m = c; - break; - } - } else - s = !1; - return m === -1 ? o ? "/" : "." : o && m === 1 ? "/" : d.slice(0, m); - }; - function D(d) { - typeof d != "string" && (d = d + ""); - var a = 0, o = -1, m = !0, s; - for (s = d.length - 1; s >= 0; --s) - if (d.charCodeAt(s) === 47) { - if (!m) { - a = s + 1; - break; - } - } else - o === -1 && (m = !1, o = s + 1); - return o === -1 ? "" : d.slice(a, o); - } - B.basename = function(d, a) { - var o = D(d); - return a && o.substr(-1 * a.length) === a && (o = o.substr(0, o.length - a.length)), o; - }, B.extname = function(d) { - typeof d != "string" && (d = d + ""); - for (var a = -1, o = 0, m = -1, s = !0, c = 0, r = d.length - 1; r >= 0; --r) { - var g = d.charCodeAt(r); - if (g === 47) { - if (!s) { - o = r + 1; - break; - } - continue; - } - m === -1 && (s = !1, m = r + 1), g === 46 ? a === -1 ? a = r : c !== 1 && (c = 1) : a !== -1 && (c = -1); - } - return a === -1 || m === -1 || // We saw a non-dot character immediately before the dot - c === 0 || // The (right-most) trimmed path component is exactly '..' - c === 1 && a === m - 1 && a === o + 1 ? "" : d.slice(a, m); - }; - function S(d, a) { - if (d.filter) - return d.filter(a); - for (var o = [], m = 0; m < d.length; m++) - a(d[m], m, d) && o.push(d[m]); - return o; - } - var E = "ab".substr(-1) === "b" ? function(d, a, o) { - return d.substr(a, o); - } : function(d, a, o) { - return a < 0 && (a = d.length + a), d.substr(a, o); - }; - }).call(this, T("_process")); - }, { _process: 14 }], 14: [function(T, L, B) { - var v = L.exports = {}, y, D; - function S() { - throw new Error("setTimeout has not been defined"); - } - function E() { - throw new Error("clearTimeout has not been defined"); - } - (function() { - try { - typeof setTimeout == "function" ? y = setTimeout : y = S; - } catch { - y = S; - } - try { - typeof clearTimeout == "function" ? D = clearTimeout : D = E; - } catch { - D = E; - } - })(); - function d(n) { - if (y === setTimeout) - return setTimeout(n, 0); - if ((y === S || !y) && setTimeout) - return y = setTimeout, setTimeout(n, 0); - try { - return y(n, 0); - } catch { - try { - return y.call(null, n, 0); - } catch { - return y.call(this, n, 0); - } - } - } - function a(n) { - if (D === clearTimeout) - return clearTimeout(n); - if ((D === E || !D) && clearTimeout) - return D = clearTimeout, clearTimeout(n); - try { - return D(n); - } catch { - try { - return D.call(null, n); - } catch { - return D.call(this, n); - } - } - } - var o = [], m = !1, s, c = -1; - function r() { - !m || !s || (m = !1, s.length ? o = s.concat(o) : c = -1, o.length && g()); - } - function g() { - if (!m) { - var n = d(r); - m = !0; - for (var i = o.length; i; ) { - for (s = o, o = []; ++c < i; ) - s && s[c].run(); - c = -1, i = o.length; - } - s = null, m = !1, a(n); - } - } - v.nextTick = function(n) { - var i = new Array(arguments.length - 1); - if (arguments.length > 1) - for (var p = 1; p < arguments.length; p++) - i[p - 1] = arguments[p]; - o.push(new b(n, i)), o.length === 1 && !m && d(g); - }; - function b(n, i) { - this.fun = n, this.array = i; - } - b.prototype.run = function() { - this.fun.apply(null, this.array); - }, v.title = "browser", v.browser = !0, v.env = {}, v.argv = [], v.version = "", v.versions = {}; - function h() { - } - v.on = h, v.addListener = h, v.once = h, v.off = h, v.removeListener = h, v.removeAllListeners = h, v.emit = h, v.prependListener = h, v.prependOnceListener = h, v.listeners = function(n) { - return []; - }, v.binding = function(n) { - throw new Error("process.binding is not supported"); - }, v.cwd = function() { - return "/"; - }, v.chdir = function(n) { - throw new Error("process.chdir is not supported"); - }, v.umask = function() { - return 0; - }; - }, {}], 15: [function(T, L, B) { - var v = T("escodegen").generate; - L.exports = function(y, D) { - D || (D = {}); - var S = {}, E = function d(a, o) { - if (a.type === "Literal") - return a.value; - if (a.type === "UnaryExpression") { - var m = d(a.argument); - return a.operator === "+" ? +m : a.operator === "-" ? -m : a.operator === "~" ? ~m : a.operator === "!" ? !m : S; - } else if (a.type === "ArrayExpression") { - for (var s = [], c = 0, r = a.elements.length; c < r; c++) { - var g = d(a.elements[c]); - if (g === S) - return S; - s.push(g); - } - return s; - } else if (a.type === "ObjectExpression") { - for (var b = {}, c = 0; c < a.properties.length; c++) { - var h = a.properties[c], n = h.value === null ? h.value : d(h.value); - if (n === S) - return S; - b[h.key.value || h.key.name] = n; - } - return b; - } else if (a.type === "BinaryExpression" || a.type === "LogicalExpression") { - var r = d(a.left); - if (r === S) - return S; - var i = d(a.right); - if (i === S) - return S; - var p = a.operator; - return p === "==" ? r == i : p === "===" ? r === i : p === "!=" ? r != i : p === "!==" ? r !== i : p === "+" ? r + i : p === "-" ? r - i : p === "*" ? r * i : p === "/" ? r / i : p === "%" ? r % i : p === "<" ? r < i : p === "<=" ? r <= i : p === ">" ? r > i : p === ">=" ? r >= i : p === "|" ? r | i : p === "&" ? r & i : p === "^" ? r ^ i : p === "&&" ? r && i : p === "||" ? r || i : S; - } else { - if (a.type === "Identifier") - return {}.hasOwnProperty.call(D, a.name) ? D[a.name] : S; - if (a.type === "ThisExpression") - return {}.hasOwnProperty.call(D, "this") ? D.this : S; - if (a.type === "CallExpression") { - var f = d(a.callee); - if (f === S || typeof f != "function") - return S; - var I = a.callee.object ? d(a.callee.object) : S; - I === S && (I = null); - for (var R = [], c = 0, r = a.arguments.length; c < r; c++) { - var g = d(a.arguments[c]); - if (g === S) - return S; - R.push(g); - } - return f.apply(I, R); - } else if (a.type === "MemberExpression") { - var b = d(a.object); - if (b === S || typeof b == "function") - return S; - if (a.property.type === "Identifier") - return b[a.property.name]; - var h = d(a.property); - return h === S ? S : b[h]; - } else if (a.type === "ConditionalExpression") { - var m = d(a.test); - return m === S ? S : d(m ? a.consequent : a.alternate); - } else if (a.type === "ExpressionStatement") { - var m = d(a.expression); - return m === S ? S : m; - } else { - if (a.type === "ReturnStatement") - return d(a.argument); - if (a.type === "FunctionExpression") { - var U = a.body.body, w = {}; - Object.keys(D).forEach(function(ie) { - w[ie] = D[ie]; - }); - for (var c = 0; c < a.params.length; c++) { - var H = a.params[c]; - if (H.type == "Identifier") - D[H.name] = null; - else - return S; - } - for (var c in U) - if (d(U[c]) === S) - return S; - D = w; - var M = Object.keys(D), z = M.map(function(ie) { - return D[ie]; - }); - return Function(M.join(", "), "return " + v(a)).apply(null, z); - } else if (a.type === "TemplateLiteral") { - for (var V = "", c = 0; c < a.expressions.length; c++) - V += d(a.quasis[c]), V += d(a.expressions[c]); - return V += d(a.quasis[c]), V; - } else if (a.type === "TaggedTemplateExpression") { - var ae = d(a.tag), Y = a.quasi, J = Y.quasis.map(d), se = Y.expressions.map(d); - return ae.apply(null, [J].concat(se)); - } else - return a.type === "TemplateElement" ? a.value.cooked : S; - } - } - }(y); - return E === S ? void 0 : E; - }; - }, { escodegen: 12 }], jsonpath: [function(T, L, B) { - L.exports = T("./lib/index"); - }, { "./lib/index": 5 }] }, {}, ["jsonpath"])("jsonpath"); - }); -})(Ve); -var Pt = Ve.exports; -const Lt = /* @__PURE__ */ Nt(Pt); -function Rt(ce, Ne, T) { - let L; - try { - L = JSON.parse(T); - } catch { - return; - } - const B = Lt.query(L, Ne); - return { filtered: JSON.stringify(B, null, 2) }; -} -export { - Rt as pluginHookResponseFilter -}; -//# sourceMappingURL=index.mjs.map diff --git a/src-tauri/plugins/filter-jsonpath/index.mjs.map b/src-tauri/plugins/filter-jsonpath/index.mjs.map deleted file mode 100644 index 57ed164e..00000000 --- a/src-tauri/plugins/filter-jsonpath/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../plugins/filter-jsonpath/node_modules/jsonpath/jsonpath.js","../../../plugins/filter-jsonpath/src/index.js"],"sourcesContent":["/*! jsonpath 1.1.1 */\n\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.jsonpath = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o\n Copyright (C) 2013 Thaddee Tyl \n Copyright (C) 2013 Mathias Bynens \n Copyright (C) 2012 Ariya Hidayat \n Copyright (C) 2012 Mathias Bynens \n Copyright (C) 2012 Joost-Wim Boekesteijn \n Copyright (C) 2012 Kris Kowal \n Copyright (C) 2012 Yusuke Suzuki \n Copyright (C) 2012 Arpad Borsos \n Copyright (C) 2011 Ariya Hidayat \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*jslint bitwise:true plusplus:true */\n/*global esprima:true, define:true, exports:true, window: true,\nthrowErrorTolerant: true,\nthrowError: true, generateStatement: true, peek: true,\nparseAssignmentExpression: true, parseBlock: true, parseExpression: true,\nparseFunctionDeclaration: true, parseFunctionExpression: true,\nparseFunctionSourceElements: true, parseVariableIdentifier: true,\nparseLeftHandSideExpression: true,\nparseUnaryExpression: true,\nparseStatement: true, parseSourceElement: true */\n\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n // Rhino, and plain browser loading.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== 'undefined') {\n factory(exports);\n } else {\n factory((root.esprima = {}));\n }\n}(this, function (exports) {\n 'use strict';\n\n var Token,\n TokenName,\n FnExprTokens,\n Syntax,\n PropertyKind,\n Messages,\n Regex,\n SyntaxTreeDelegate,\n source,\n strict,\n index,\n lineNumber,\n lineStart,\n length,\n delegate,\n lookahead,\n state,\n extra;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8,\n RegularExpression: 9\n };\n\n TokenName = {};\n TokenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '';\n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.NumericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n TokenName[Token.RegularExpression] = 'RegularExpression';\n\n // A function following one of those tokens is an expression.\n FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',\n 'return', 'case', 'delete', 'throw', 'void',\n // assignment operators\n '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',\n '&=', '|=', '^=', ',',\n // binary/unary operators\n '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',\n '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',\n '<=', '<', '>', '!=', '!=='];\n\n Syntax = {\n AssignmentExpression: 'AssignmentExpression',\n ArrayExpression: 'ArrayExpression',\n BlockStatement: 'BlockStatement',\n BinaryExpression: 'BinaryExpression',\n BreakStatement: 'BreakStatement',\n CallExpression: 'CallExpression',\n CatchClause: 'CatchClause',\n ConditionalExpression: 'ConditionalExpression',\n ContinueStatement: 'ContinueStatement',\n DoWhileStatement: 'DoWhileStatement',\n DebuggerStatement: 'DebuggerStatement',\n EmptyStatement: 'EmptyStatement',\n ExpressionStatement: 'ExpressionStatement',\n ForStatement: 'ForStatement',\n ForInStatement: 'ForInStatement',\n FunctionDeclaration: 'FunctionDeclaration',\n FunctionExpression: 'FunctionExpression',\n Identifier: 'Identifier',\n IfStatement: 'IfStatement',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n NewExpression: 'NewExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ReturnStatement: 'ReturnStatement',\n SequenceExpression: 'SequenceExpression',\n SwitchStatement: 'SwitchStatement',\n SwitchCase: 'SwitchCase',\n ThisExpression: 'ThisExpression',\n ThrowStatement: 'ThrowStatement',\n TryStatement: 'TryStatement',\n UnaryExpression: 'UnaryExpression',\n UpdateExpression: 'UpdateExpression',\n VariableDeclaration: 'VariableDeclaration',\n VariableDeclarator: 'VariableDeclarator',\n WhileStatement: 'WhileStatement',\n WithStatement: 'WithStatement'\n };\n\n PropertyKind = {\n Data: 1,\n Get: 2,\n Set: 4\n };\n\n // Error messages should be identical to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnexpectedNumber: 'Unexpected number',\n UnexpectedString: 'Unexpected string',\n UnexpectedIdentifier: 'Unexpected identifier',\n UnexpectedReserved: 'Unexpected reserved word',\n UnexpectedEOS: 'Unexpected end of input',\n NewlineAfterThrow: 'Illegal newline after throw',\n InvalidRegExp: 'Invalid regular expression',\n UnterminatedRegExp: 'Invalid regular expression: missing /',\n InvalidLHSInAssignment: 'Invalid left-hand side in assignment',\n InvalidLHSInForIn: 'Invalid left-hand side in for-in',\n MultipleDefaultsInSwitch: 'More than one default clause in switch statement',\n NoCatchOrFinally: 'Missing catch or finally after try',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\'%1\\' has already been declared',\n IllegalContinue: 'Illegal continue statement',\n IllegalBreak: 'Illegal break statement',\n IllegalReturn: 'Illegal return statement',\n StrictModeWith: 'Strict mode code may not include a with statement',\n StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',\n StrictVarName: 'Variable name may not be eval or arguments in strict mode',\n StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',\n StrictParamDupe: 'Strict mode function may not have duplicate parameter names',\n StrictFunctionName: 'Function name may not be eval or arguments in strict mode',\n StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',\n StrictDelete: 'Delete of an unqualified identifier in strict mode.',\n StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',\n AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',\n AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',\n StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',\n StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',\n StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',\n StrictReservedWord: 'Use of future reserved word in strict mode'\n };\n\n // See also tools/generate-unicode-regex.py.\n Regex = {\n NonAsciiIdentifierStart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),\n NonAsciiIdentifierPart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0\\u08A2-\\u08AC\\u08E4-\\u08FE\\u0900-\\u0963\\u0966-\\u096F\\u0971-\\u0977\\u0979-\\u097F\\u0981-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C01-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C82\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D02\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1D00-\\u1DE6\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA697\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A\\uAA7B\\uAA80-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]')\n };\n\n // Ensure the condition is true, otherwise throw an error.\n // This is only to have a better contract semantic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condition on any user input.\n\n function assert(condition, message) {\n /* istanbul ignore if */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57); // 0..9\n }\n\n function isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n }\n\n function isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names and Identifiers\n\n function isIdentifierStart(ch) {\n return (ch == 0x40) || (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }\n\n function isIdentifierPart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch >= 0x30 && ch <= 0x39) || // 0..9\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n }\n\n // 7.6.1.2 Future Reserved Words\n\n function isFutureReservedWord(id) {\n switch (id) {\n case 'class':\n case 'enum':\n case 'export':\n case 'extends':\n case 'import':\n case 'super':\n return true;\n default:\n return false;\n }\n }\n\n function isStrictModeReservedWord(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'yield':\n case 'let':\n return true;\n default:\n return false;\n }\n }\n\n function isRestrictedWord(id) {\n return id === 'eval' || id === 'arguments';\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n if (strict && isStrictModeReservedWord(id)) {\n return true;\n }\n\n // 'const' is specialized as Keyword in V8.\n // 'yield' and 'let' are for compatiblity with SpiderMonkey and ES.next.\n // Some others are from future reserved words.\n\n switch (id.length) {\n case 2:\n return (id === 'if') || (id === 'in') || (id === 'do');\n case 3:\n return (id === 'var') || (id === 'for') || (id === 'new') ||\n (id === 'try') || (id === 'let');\n case 4:\n return (id === 'this') || (id === 'else') || (id === 'case') ||\n (id === 'void') || (id === 'with') || (id === 'enum');\n case 5:\n return (id === 'while') || (id === 'break') || (id === 'catch') ||\n (id === 'throw') || (id === 'const') || (id === 'yield') ||\n (id === 'class') || (id === 'super');\n case 6:\n return (id === 'return') || (id === 'typeof') || (id === 'delete') ||\n (id === 'switch') || (id === 'export') || (id === 'import');\n case 7:\n return (id === 'default') || (id === 'finally') || (id === 'extends');\n case 8:\n return (id === 'function') || (id === 'continue') || (id === 'debugger');\n case 10:\n return (id === 'instanceof');\n default:\n return false;\n }\n }\n\n // 7.4 Comments\n\n function addComment(type, value, start, end, loc) {\n var comment, attacher;\n\n assert(typeof start === 'number', 'Comment must have valid position');\n\n // Because the way the actual token is scanned, often the comments\n // (if any) are skipped twice during the lexical analysis.\n // Thus, we need to skip adding a comment if the comment array already\n // handled it.\n if (state.lastCommentStart >= start) {\n return;\n }\n state.lastCommentStart = start;\n\n comment = {\n type: type,\n value: value\n };\n if (extra.range) {\n comment.range = [start, end];\n }\n if (extra.loc) {\n comment.loc = loc;\n }\n extra.comments.push(comment);\n if (extra.attachComment) {\n extra.leadingComments.push(comment);\n extra.trailingComments.push(comment);\n }\n }\n\n function skipSingleLineComment(offset) {\n var start, loc, ch, comment;\n\n start = index - offset;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - offset\n }\n };\n\n while (index < length) {\n ch = source.charCodeAt(index);\n ++index;\n if (isLineTerminator(ch)) {\n if (extra.comments) {\n comment = source.slice(start + offset, index - 1);\n loc.end = {\n line: lineNumber,\n column: index - lineStart - 1\n };\n addComment('Line', comment, start, index - 1, loc);\n }\n if (ch === 13 && source.charCodeAt(index) === 10) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n return;\n }\n }\n\n if (extra.comments) {\n comment = source.slice(start + offset, index);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Line', comment, start, index, loc);\n }\n }\n\n function skipMultiLineComment() {\n var start, loc, ch, comment;\n\n if (extra.comments) {\n start = index - 2;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - 2\n }\n };\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (isLineTerminator(ch)) {\n if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n ++index;\n lineStart = index;\n if (index >= length) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else if (ch === 0x2A) {\n // Block comment ends with '*/'.\n if (source.charCodeAt(index + 1) === 0x2F) {\n ++index;\n ++index;\n if (extra.comments) {\n comment = source.slice(start + 2, index - 2);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Block', comment, start, index, loc);\n }\n return;\n }\n ++index;\n } else {\n ++index;\n }\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n function skipComment() {\n var ch, start;\n\n start = (index === 0);\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch)) {\n ++index;\n } else if (isLineTerminator(ch)) {\n ++index;\n if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n start = true;\n } else if (ch === 0x2F) { // U+002F is '/'\n ch = source.charCodeAt(index + 1);\n if (ch === 0x2F) {\n ++index;\n ++index;\n skipSingleLineComment(2);\n start = true;\n } else if (ch === 0x2A) { // U+002A is '*'\n ++index;\n ++index;\n skipMultiLineComment();\n } else {\n break;\n }\n } else if (start && ch === 0x2D) { // U+002D is '-'\n // U+003E is '>'\n if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {\n // '-->' is a single-line comment\n index += 3;\n skipSingleLineComment(3);\n } else {\n break;\n }\n } else if (ch === 0x3C) { // U+003C is '<'\n if (source.slice(index + 1, index + 4) === '!--') {\n ++index; // `<`\n ++index; // `!`\n ++index; // `-`\n ++index; // `-`\n skipSingleLineComment(4);\n } else {\n break;\n }\n } else {\n break;\n }\n }\n }\n\n function scanHexEscape(prefix) {\n var i, len, ch, code = 0;\n\n len = (prefix === 'u') ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n return '';\n }\n }\n return String.fromCharCode(code);\n }\n\n function getEscapedIdentifier() {\n var ch, id;\n\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id += ch;\n }\n }\n\n return id;\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier() {\n var start, id, type;\n\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E: // ~\n ++index;\n if (extra.tokenize) {\n if (code === 0x28) {\n extra.openParenToken = extra.tokens.length;\n } else if (code === 0x7B) {\n extra.openCurlyToken = extra.tokens.length;\n }\n }\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A: // *\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n case 0x21: // !\n case 0x3D: // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: Token.Punctuator,\n value: ch4,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: Token.Punctuator,\n value: ch3,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n\n if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch2,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: Token.Punctuator,\n value: ch1,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n\n function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanOctalLiteral(start) {\n var number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a decimal digit or a decimal point');\n\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n }\n\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseFloat(number),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 7.8.4 String Literals\n\n function scanStringLiteral() {\n var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart;\n startLineNumber = lineNumber;\n startLineStart = lineStart;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"'),\n 'String literal must starts with a quote');\n\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n str += unescaped;\n } else {\n index = restore;\n str += ch;\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.indexOf(ch) >= 0 &&\n index < length &&\n isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLiteral,\n value: str,\n octal: octal,\n startLineNumber: startLineNumber,\n startLineStart: startLineStart,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function testRegExp(pattern, flags) {\n var value;\n try {\n value = new RegExp(pattern, flags);\n } catch (e) {\n throwError({}, Messages.InvalidRegExp);\n }\n return value;\n }\n\n function scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n }\n\n function scanRegExpFlags() {\n var ch, str, flags, restore;\n\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n if (ch === '\\\\' && index < length) {\n ch = source[index];\n if (ch === 'u') {\n ++index;\n restore = index;\n ch = scanHexEscape('u');\n if (ch) {\n flags += ch;\n for (str += '\\\\u'; restore < index; ++restore) {\n str += source[restore];\n }\n } else {\n index = restore;\n flags += 'u';\n str += '\\\\u';\n }\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n } else {\n str += '\\\\';\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n return {\n value: flags,\n literal: str\n };\n }\n\n function scanRegExp() {\n var start, body, flags, pattern, value;\n\n lookahead = null;\n skipComment();\n start = index;\n\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n\n if (extra.tokenize) {\n return {\n type: Token.RegularExpression,\n value: value,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n return {\n literal: body.literal + flags.literal,\n value: value,\n start: start,\n end: index\n };\n }\n\n function collectRegex() {\n var pos, loc, regex, token;\n\n skipComment();\n\n pos = index;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n regex = scanRegExp();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n /* istanbul ignore next */\n if (!extra.tokenize) {\n // Pop the previous token, which is likely '/' or '/='\n if (extra.tokens.length > 0) {\n token = extra.tokens[extra.tokens.length - 1];\n if (token.range[0] === pos && token.type === 'Punctuator') {\n if (token.value === '/' || token.value === '/=') {\n extra.tokens.pop();\n }\n }\n }\n\n extra.tokens.push({\n type: 'RegularExpression',\n value: regex.literal,\n range: [pos, index],\n loc: loc\n });\n }\n\n return regex;\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyword ||\n token.type === Token.BooleanLiteral ||\n token.type === Token.NullLiteral;\n }\n\n function advanceSlash() {\n var prevToken,\n checkToken;\n // Using the following algorithm:\n // https://github.com/mozilla/sweet.js/wiki/design\n prevToken = extra.tokens[extra.tokens.length - 1];\n if (!prevToken) {\n // Nothing before that: it cannot be a division.\n return collectRegex();\n }\n if (prevToken.type === 'Punctuator') {\n if (prevToken.value === ']') {\n return scanPunctuator();\n }\n if (prevToken.value === ')') {\n checkToken = extra.tokens[extra.openParenToken - 1];\n if (checkToken &&\n checkToken.type === 'Keyword' &&\n (checkToken.value === 'if' ||\n checkToken.value === 'while' ||\n checkToken.value === 'for' ||\n checkToken.value === 'with')) {\n return collectRegex();\n }\n return scanPunctuator();\n }\n if (prevToken.value === '}') {\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n if (extra.tokens[extra.openCurlyToken - 3] &&\n extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {\n // Anonymous function.\n checkToken = extra.tokens[extra.openCurlyToken - 4];\n if (!checkToken) {\n return scanPunctuator();\n }\n } else if (extra.tokens[extra.openCurlyToken - 4] &&\n extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {\n // Named function.\n checkToken = extra.tokens[extra.openCurlyToken - 5];\n if (!checkToken) {\n return collectRegex();\n }\n } else {\n return scanPunctuator();\n }\n // checkToken determines whether the function is\n // a declaration or an expression.\n if (FnExprTokens.indexOf(checkToken.value) >= 0) {\n // It is an expression.\n return scanPunctuator();\n }\n // It is a declaration.\n return collectRegex();\n }\n return collectRegex();\n }\n if (prevToken.type === 'Keyword') {\n return collectRegex();\n }\n return scanPunctuator();\n }\n\n function advance() {\n var ch;\n\n skipComment();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: index,\n end: index\n };\n }\n\n ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n // Slash (/) U+002F can also start a regex.\n if (extra.tokenize && ch === 0x2F) {\n return advanceSlash();\n }\n\n return scanPunctuator();\n }\n\n function collectToken() {\n var loc, token, range, value;\n\n skipComment();\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n token = advance();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n if (token.type !== Token.EOF) {\n value = source.slice(token.start, token.end);\n extra.tokens.push({\n type: TokenName[token.type],\n value: value,\n range: [token.start, token.end],\n loc: loc\n });\n }\n\n return token;\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n return token;\n }\n\n function peek() {\n var pos, line, start;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n index = pos;\n lineNumber = line;\n lineStart = start;\n }\n\n function Position(line, column) {\n this.line = line;\n this.column = column;\n }\n\n function SourceLocation(startLine, startColumn, line, column) {\n this.start = new Position(startLine, startColumn);\n this.end = new Position(line, column);\n }\n\n SyntaxTreeDelegate = {\n\n name: 'SyntaxTree',\n\n processComment: function (node) {\n var lastChild, trailingComments;\n\n if (node.type === Syntax.Program) {\n if (node.body.length > 0) {\n return;\n }\n }\n\n if (extra.trailingComments.length > 0) {\n if (extra.trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.trailingComments;\n extra.trailingComments = [];\n } else {\n extra.trailingComments.length = 0;\n }\n } else {\n if (extra.bottomRightStack.length > 0 &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n delete extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n }\n }\n\n // Eating the stack.\n while (extra.bottomRightStack.length > 0 && extra.bottomRightStack[extra.bottomRightStack.length - 1].range[0] >= node.range[0]) {\n lastChild = extra.bottomRightStack.pop();\n }\n\n if (lastChild) {\n if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n }\n } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = extra.leadingComments;\n extra.leadingComments = [];\n }\n\n\n if (trailingComments) {\n node.trailingComments = trailingComments;\n }\n\n extra.bottomRightStack.push(node);\n },\n\n markEnd: function (node, startToken) {\n if (extra.range) {\n node.range = [startToken.start, index];\n }\n if (extra.loc) {\n node.loc = new SourceLocation(\n startToken.startLineNumber === undefined ? startToken.lineNumber : startToken.startLineNumber,\n startToken.start - (startToken.startLineStart === undefined ? startToken.lineStart : startToken.startLineStart),\n lineNumber,\n index - lineStart\n );\n this.postProcess(node);\n }\n\n if (extra.attachComment) {\n this.processComment(node);\n }\n return node;\n },\n\n postProcess: function (node) {\n if (extra.source) {\n node.loc.source = extra.source;\n }\n return node;\n },\n\n createArrayExpression: function (elements) {\n return {\n type: Syntax.ArrayExpression,\n elements: elements\n };\n },\n\n createAssignmentExpression: function (operator, left, right) {\n return {\n type: Syntax.AssignmentExpression,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBinaryExpression: function (operator, left, right) {\n var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression :\n Syntax.BinaryExpression;\n return {\n type: type,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBlockStatement: function (body) {\n return {\n type: Syntax.BlockStatement,\n body: body\n };\n },\n\n createBreakStatement: function (label) {\n return {\n type: Syntax.BreakStatement,\n label: label\n };\n },\n\n createCallExpression: function (callee, args) {\n return {\n type: Syntax.CallExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createCatchClause: function (param, body) {\n return {\n type: Syntax.CatchClause,\n param: param,\n body: body\n };\n },\n\n createConditionalExpression: function (test, consequent, alternate) {\n return {\n type: Syntax.ConditionalExpression,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createContinueStatement: function (label) {\n return {\n type: Syntax.ContinueStatement,\n label: label\n };\n },\n\n createDebuggerStatement: function () {\n return {\n type: Syntax.DebuggerStatement\n };\n },\n\n createDoWhileStatement: function (body, test) {\n return {\n type: Syntax.DoWhileStatement,\n body: body,\n test: test\n };\n },\n\n createEmptyStatement: function () {\n return {\n type: Syntax.EmptyStatement\n };\n },\n\n createExpressionStatement: function (expression) {\n return {\n type: Syntax.ExpressionStatement,\n expression: expression\n };\n },\n\n createForStatement: function (init, test, update, body) {\n return {\n type: Syntax.ForStatement,\n init: init,\n test: test,\n update: update,\n body: body\n };\n },\n\n createForInStatement: function (left, right, body) {\n return {\n type: Syntax.ForInStatement,\n left: left,\n right: right,\n body: body,\n each: false\n };\n },\n\n createFunctionDeclaration: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionDeclaration,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createFunctionExpression: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionExpression,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createIdentifier: function (name) {\n return {\n type: Syntax.Identifier,\n name: name\n };\n },\n\n createIfStatement: function (test, consequent, alternate) {\n return {\n type: Syntax.IfStatement,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createLabeledStatement: function (label, body) {\n return {\n type: Syntax.LabeledStatement,\n label: label,\n body: body\n };\n },\n\n createLiteral: function (token) {\n return {\n type: Syntax.Literal,\n value: token.value,\n raw: source.slice(token.start, token.end)\n };\n },\n\n createMemberExpression: function (accessor, object, property) {\n return {\n type: Syntax.MemberExpression,\n computed: accessor === '[',\n object: object,\n property: property\n };\n },\n\n createNewExpression: function (callee, args) {\n return {\n type: Syntax.NewExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createObjectExpression: function (properties) {\n return {\n type: Syntax.ObjectExpression,\n properties: properties\n };\n },\n\n createPostfixExpression: function (operator, argument) {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: false\n };\n },\n\n createProgram: function (body) {\n return {\n type: Syntax.Program,\n body: body\n };\n },\n\n createProperty: function (kind, key, value) {\n return {\n type: Syntax.Property,\n key: key,\n value: value,\n kind: kind\n };\n },\n\n createReturnStatement: function (argument) {\n return {\n type: Syntax.ReturnStatement,\n argument: argument\n };\n },\n\n createSequenceExpression: function (expressions) {\n return {\n type: Syntax.SequenceExpression,\n expressions: expressions\n };\n },\n\n createSwitchCase: function (test, consequent) {\n return {\n type: Syntax.SwitchCase,\n test: test,\n consequent: consequent\n };\n },\n\n createSwitchStatement: function (discriminant, cases) {\n return {\n type: Syntax.SwitchStatement,\n discriminant: discriminant,\n cases: cases\n };\n },\n\n createThisExpression: function () {\n return {\n type: Syntax.ThisExpression\n };\n },\n\n createThrowStatement: function (argument) {\n return {\n type: Syntax.ThrowStatement,\n argument: argument\n };\n },\n\n createTryStatement: function (block, guardedHandlers, handlers, finalizer) {\n return {\n type: Syntax.TryStatement,\n block: block,\n guardedHandlers: guardedHandlers,\n handlers: handlers,\n finalizer: finalizer\n };\n },\n\n createUnaryExpression: function (operator, argument) {\n if (operator === '++' || operator === '--') {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n }\n return {\n type: Syntax.UnaryExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n },\n\n createVariableDeclaration: function (declarations, kind) {\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n },\n\n createVariableDeclarator: function (id, init) {\n return {\n type: Syntax.VariableDeclarator,\n id: id,\n init: init\n };\n },\n\n createWhileStatement: function (test, body) {\n return {\n type: Syntax.WhileStatement,\n test: test,\n body: body\n };\n },\n\n createWithStatement: function (object, body) {\n return {\n type: Syntax.WithStatement,\n object: object,\n body: body\n };\n }\n };\n\n // Return true if there is a line terminator before the next token.\n\n function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }\n\n // Throw an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n function (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n if (typeof token.lineNumber === 'number') {\n error = new Error('Line ' + token.lineNumber + ': ' + msg);\n error.index = token.start;\n error.lineNumber = token.lineNumber;\n error.column = token.start - lineStart + 1;\n } else {\n error = new Error('Line ' + lineNumber + ': ' + msg);\n error.index = index;\n error.lineNumber = lineNumber;\n error.column = index - lineStart + 1;\n }\n\n error.description = msg;\n throw error;\n }\n\n function throwErrorTolerant() {\n try {\n throwError.apply(null, arguments);\n } catch (e) {\n if (extra.errors) {\n extra.errors.push(e);\n } else {\n throw e;\n }\n }\n }\n\n\n // Throw an exception because of the token.\n\n function throwUnexpected(token) {\n if (token.type === Token.EOF) {\n throwError(token, Messages.UnexpectedEOS);\n }\n\n if (token.type === Token.NumericLiteral) {\n throwError(token, Messages.UnexpectedNumber);\n }\n\n if (token.type === Token.StringLiteral) {\n throwError(token, Messages.UnexpectedString);\n }\n\n if (token.type === Token.Identifier) {\n throwError(token, Messages.UnexpectedIdentifier);\n }\n\n if (token.type === Token.Keyword) {\n if (isFutureReservedWord(token.value)) {\n throwError(token, Messages.UnexpectedReserved);\n } else if (strict && isStrictModeReservedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictReservedWord);\n return;\n }\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // Expect the next token to match the specified punctuator.\n // If not, an exception will be thrown.\n\n function expect(value) {\n var token = lex();\n if (token.type !== Token.Punctuator || token.value !== value) {\n throwUnexpected(token);\n }\n }\n\n // Expect the next token to match the specified keyword.\n // If not, an exception will be thrown.\n\n function expectKeyword(keyword) {\n var token = lex();\n if (token.type !== Token.Keyword || token.value !== keyword) {\n throwUnexpected(token);\n }\n }\n\n // Return true if the next token matches the specified punctuator.\n\n function match(value) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyword\n\n function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }\n\n // Return true if the next token is an assignment operator\n\n function matchAssign() {\n var op;\n\n if (lookahead.type !== Token.Punctuator) {\n return false;\n }\n op = lookahead.value;\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }\n\n function consumeSemicolon() {\n var line;\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B || match(';')) {\n lex();\n return;\n }\n\n line = lineNumber;\n skipComment();\n if (lineNumber !== line) {\n return;\n }\n\n if (lookahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahead);\n }\n }\n\n // Return true if provided expression is LeftHandSideExpression\n\n function isLeftHandSide(expr) {\n return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;\n }\n\n // 11.1.4 Array Initialiser\n\n function parseArrayInitialiser() {\n var elements = [], startToken;\n\n startToken = lookahead;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseAssignmentExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n\n return delegate.markEnd(delegate.createArrayExpression(elements), startToken);\n }\n\n // 11.1.5 Object Initialiser\n\n function parsePropertyFunction(param, first) {\n var previousStrict, body, startToken;\n\n previousStrict = strict;\n startToken = lookahead;\n body = parseFunctionSourceElements();\n if (first && strict && isRestrictedWord(param[0].name)) {\n throwErrorTolerant(first, Messages.StrictParamName);\n }\n strict = previousStrict;\n return delegate.markEnd(delegate.createFunctionExpression(null, param, [], body), startToken);\n }\n\n function parseObjectPropertyKey() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n if (strict && token.octal) {\n throwErrorTolerant(token, Messages.StrictOctalLiteral);\n }\n return delegate.markEnd(delegate.createLiteral(token), startToken);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseObjectProperty() {\n var token, key, id, value, param, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n if (token.type === Token.Identifier) {\n\n id = parseObjectPropertyKey();\n\n // Property Assignment: Getter and Setter.\n\n if (token.value === 'get' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n expect(')');\n value = parsePropertyFunction([]);\n return delegate.markEnd(delegate.createProperty('get', key, value), startToken);\n }\n if (token.value === 'set' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n token = lookahead;\n if (token.type !== Token.Identifier) {\n expect(')');\n throwErrorTolerant(token, Messages.UnexpectedToken, token.value);\n value = parsePropertyFunction([]);\n } else {\n param = [ parseVariableIdentifier() ];\n expect(')');\n value = parsePropertyFunction(param, token);\n }\n return delegate.markEnd(delegate.createProperty('set', key, value), startToken);\n }\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', id, value), startToken);\n }\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', key, value), startToken);\n }\n }\n\n function parseObjectInitialiser() {\n var properties = [], property, name, key, kind, map = {}, toString = String, startToken;\n\n startToken = lookahead;\n\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === Syntax.Identifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;\n\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n if (map[key] === PropertyKind.Data) {\n if (strict && kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.StrictDuplicateProperty);\n } else if (kind !== PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n }\n } else {\n if (kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n } else if (map[key] & kind) {\n throwErrorTolerant({}, Messages.AccessorGetSet);\n }\n }\n map[key] |= kind;\n } else {\n map[key] = kind;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n\n return delegate.markEnd(delegate.createObjectExpression(properties), startToken);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expressions\n\n function parsePrimaryExpression() {\n var type, token, expr, startToken;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n startToken = lookahead;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n if (strict && lookahead.octal) {\n throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);\n }\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keyword) {\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n } else {\n throwUnexpected(lex());\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n token.value = (token.value === 'true');\n expr = delegate.createLiteral(token);\n } else if (type === Token.NullLiteral) {\n token = lex();\n token.value = null;\n expr = delegate.createLiteral(token);\n } else if (match('/') || match('/=')) {\n if (typeof extra.tokens !== 'undefined') {\n expr = delegate.createLiteral(collectRegex());\n } else {\n expr = delegate.createLiteral(scanRegExp());\n }\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return delegate.markEnd(expr, startToken);\n }\n\n // 11.2 Left-Hand-Side Expressions\n\n function parseArguments() {\n var args = [];\n\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseAssignmentExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseNonComputedMember() {\n expect('.');\n\n return parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n\n expect(']');\n\n return expr;\n }\n\n function parseNewExpression() {\n var callee, args, startToken;\n\n startToken = lookahead;\n expectKeyword('new');\n callee = parseLeftHandSideExpression();\n args = match('(') ? parseArguments() : [];\n\n return delegate.markEnd(delegate.createNewExpression(callee, args), startToken);\n }\n\n function parseLeftHandSideExpressionAllowCall() {\n var previousAllowIn, expr, args, property, startToken;\n\n startToken = lookahead;\n\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n state.allowIn = previousAllowIn;\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = delegate.createCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n break;\n }\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n function parseLeftHandSideExpression() {\n var previousAllowIn, expr, property, startToken;\n\n startToken = lookahead;\n\n previousAllowIn = state.allowIn;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n state.allowIn = previousAllowIn;\n\n while (match('.') || match('[')) {\n if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n }\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n function parsePostfixExpression() {\n var expr, token, startToken = lookahead;\n\n expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === Token.Punctuator) {\n if ((match('++') || match('--')) && !peekLineTerminator()) {\n // 11.3.1, 11.3.2\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPostfix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n token = lex();\n expr = delegate.markEnd(delegate.createPostfixExpression(token.value, expr), startToken);\n }\n }\n\n return expr;\n }\n\n // 11.4 Unary Operators\n\n function parseUnaryExpression() {\n var token, expr, startToken;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n // 11.4.4, 11.4.5\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPrefix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {\n throwErrorTolerant({}, Messages.StrictDelete);\n }\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token, allowIn) {\n var prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = allowIn ? 7 : 0;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Additive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Operators\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }\n\n\n // 11.12 Conditional Operator\n\n function parseConditionalExpression() {\n var expr, previousAllowIn, consequent, alternate, startToken;\n\n startToken = lookahead;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n consequent = parseAssignmentExpression();\n state.allowIn = previousAllowIn;\n expect(':');\n alternate = parseAssignmentExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.13 Assignment Operators\n\n function parseAssignmentExpression() {\n var token, left, right, node, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n node = left = parseConditionalExpression();\n\n if (matchAssign()) {\n // LeftHandSideExpression\n if (!isLeftHandSide(left)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n // 11.13.1\n if (strict && left.type === Syntax.Identifier && isRestrictedWord(left.name)) {\n throwErrorTolerant(token, Messages.StrictLHSAssignment);\n }\n\n token = lex();\n right = parseAssignmentExpression();\n node = delegate.markEnd(delegate.createAssignmentExpression(token.value, left, right), startToken);\n }\n\n return node;\n }\n\n // 11.14 Comma Operator\n\n function parseExpression() {\n var expr, startToken = lookahead;\n\n expr = parseAssignmentExpression();\n\n if (match(',')) {\n expr = delegate.createSequenceExpression([ expr ]);\n\n while (index < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expr.expressions.push(parseAssignmentExpression());\n }\n\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 12.1 Block\n\n function parseStatementList() {\n var list = [],\n statement;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n statement = parseSourceElement();\n if (typeof statement === 'undefined') {\n break;\n }\n list.push(statement);\n }\n\n return list;\n }\n\n function parseBlock() {\n var block, startToken;\n\n startToken = lookahead;\n expect('{');\n\n block = parseStatementList();\n\n expect('}');\n\n return delegate.markEnd(delegate.createBlockStatement(block), startToken);\n }\n\n // 12.2 Variable Statement\n\n function parseVariableIdentifier() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (token.type !== Token.Identifier) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseVariableDeclaration(kind) {\n var init = null, id, startToken;\n\n startToken = lookahead;\n id = parseVariableIdentifier();\n\n // 12.2.1\n if (strict && isRestrictedWord(id.name)) {\n throwErrorTolerant({}, Messages.StrictVarName);\n }\n\n if (kind === 'const') {\n expect('=');\n init = parseAssignmentExpression();\n } else if (match('=')) {\n lex();\n init = parseAssignmentExpression();\n }\n\n return delegate.markEnd(delegate.createVariableDeclarator(id, init), startToken);\n }\n\n function parseVariableDeclarationList(kind) {\n var list = [];\n\n do {\n list.push(parseVariableDeclaration(kind));\n if (!match(',')) {\n break;\n }\n lex();\n } while (index < length);\n\n return list;\n }\n\n function parseVariableStatement() {\n var declarations;\n\n expectKeyword('var');\n\n declarations = parseVariableDeclarationList();\n\n consumeSemicolon();\n\n return delegate.createVariableDeclaration(declarations, 'var');\n }\n\n // kind may be `const` or `let`\n // Both are experimental and not in the specification yet.\n // see http://wiki.ecmascript.org/doku.php?id=harmony:const\n // and http://wiki.ecmascript.org/doku.php?id=harmony:let\n function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }\n\n // 12.3 Empty Statement\n\n function parseEmptyStatement() {\n expect(';');\n return delegate.createEmptyStatement();\n }\n\n // 12.4 Expression Statement\n\n function parseExpressionStatement() {\n var expr = parseExpression();\n consumeSemicolon();\n return delegate.createExpressionStatement(expr);\n }\n\n // 12.5 If statement\n\n function parseIfStatement() {\n var test, consequent, alternate;\n\n expectKeyword('if');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n consequent = parseStatement();\n\n if (matchKeyword('else')) {\n lex();\n alternate = parseStatement();\n } else {\n alternate = null;\n }\n\n return delegate.createIfStatement(test, consequent, alternate);\n }\n\n // 12.6 Iteration Statements\n\n function parseDoWhileStatement() {\n var body, test, oldInIteration;\n\n expectKeyword('do');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n if (match(';')) {\n lex();\n }\n\n return delegate.createDoWhileStatement(body, test);\n }\n\n function parseWhileStatement() {\n var test, body, oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return delegate.createWhileStatement(test, body);\n }\n\n function parseForVariableDeclaration() {\n var token, declarations, startToken;\n\n startToken = lookahead;\n token = lex();\n declarations = parseVariableDeclarationList();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, token.value), startToken);\n }\n\n function parseForStatement() {\n var init, test, update, left, right, body, oldInIteration;\n\n init = test = update = null;\n\n expectKeyword('for');\n\n expect('(');\n\n if (match(';')) {\n lex();\n } else {\n if (matchKeyword('var') || matchKeyword('let')) {\n state.allowIn = false;\n init = parseForVariableDeclaration();\n state.allowIn = true;\n\n if (init.declarations.length === 1 && matchKeyword('in')) {\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n } else {\n state.allowIn = false;\n init = parseExpression();\n state.allowIn = true;\n\n if (matchKeyword('in')) {\n // LeftHandSideExpression\n if (!isLeftHandSide(init)) {\n throwErrorTolerant({}, Messages.InvalidLHSInForIn);\n }\n\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n }\n\n if (typeof left === 'undefined') {\n expect(';');\n }\n }\n\n if (typeof left === 'undefined') {\n\n if (!match(';')) {\n test = parseExpression();\n }\n expect(';');\n\n if (!match(')')) {\n update = parseExpression();\n }\n }\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return (typeof left === 'undefined') ?\n delegate.createForStatement(init, test, update, body) :\n delegate.createForInStatement(left, right, body);\n }\n\n // 12.7 The continue statement\n\n function parseContinueStatement() {\n var label = null, key;\n\n expectKeyword('continue');\n\n // Optimize the most common form: 'continue;'.\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(label);\n }\n\n // 12.8 The break statement\n\n function parseBreakStatement() {\n var label = null, key;\n\n expectKeyword('break');\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(label);\n }\n\n // 12.9 The return statement\n\n function parseReturnStatement() {\n var argument = null;\n\n expectKeyword('return');\n\n if (!state.inFunctionBody) {\n throwErrorTolerant({}, Messages.IllegalReturn);\n }\n\n // 'return' followed by a space and an identifier is very common.\n if (source.charCodeAt(index) === 0x20) {\n if (isIdentifierStart(source.charCodeAt(index + 1))) {\n argument = parseExpression();\n consumeSemicolon();\n return delegate.createReturnStatement(argument);\n }\n }\n\n if (peekLineTerminator()) {\n return delegate.createReturnStatement(null);\n }\n\n if (!match(';')) {\n if (!match('}') && lookahead.type !== Token.EOF) {\n argument = parseExpression();\n }\n }\n\n consumeSemicolon();\n\n return delegate.createReturnStatement(argument);\n }\n\n // 12.10 The with statement\n\n function parseWithStatement() {\n var object, body;\n\n if (strict) {\n // TODO(ikarienator): Should we update the test cases instead?\n skipComment();\n throwErrorTolerant({}, Messages.StrictModeWith);\n }\n\n expectKeyword('with');\n\n expect('(');\n\n object = parseExpression();\n\n expect(')');\n\n body = parseStatement();\n\n return delegate.createWithStatement(object, body);\n }\n\n // 12.10 The swith statement\n\n function parseSwitchCase() {\n var test, consequent = [], statement, startToken;\n\n startToken = lookahead;\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n statement = parseStatement();\n consequent.push(statement);\n }\n\n return delegate.markEnd(delegate.createSwitchCase(test, consequent), startToken);\n }\n\n function parseSwitchStatement() {\n var discriminant, cases, clause, oldInSwitch, defaultFound;\n\n expectKeyword('switch');\n\n expect('(');\n\n discriminant = parseExpression();\n\n expect(')');\n\n expect('{');\n\n cases = [];\n\n if (match('}')) {\n lex();\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n oldInSwitch = state.inSwitch;\n state.inSwitch = true;\n defaultFound = false;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n clause = parseSwitchCase();\n if (clause.test === null) {\n if (defaultFound) {\n throwError({}, Messages.MultipleDefaultsInSwitch);\n }\n defaultFound = true;\n }\n cases.push(clause);\n }\n\n state.inSwitch = oldInSwitch;\n\n expect('}');\n\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n // 12.13 The throw statement\n\n function parseThrowStatement() {\n var argument;\n\n expectKeyword('throw');\n\n if (peekLineTerminator()) {\n throwError({}, Messages.NewlineAfterThrow);\n }\n\n argument = parseExpression();\n\n consumeSemicolon();\n\n return delegate.createThrowStatement(argument);\n }\n\n // 12.14 The try statement\n\n function parseCatchClause() {\n var param, body, startToken;\n\n startToken = lookahead;\n expectKeyword('catch');\n\n expect('(');\n if (match(')')) {\n throwUnexpected(lookahead);\n }\n\n param = parseVariableIdentifier();\n // 12.14.1\n if (strict && isRestrictedWord(param.name)) {\n throwErrorTolerant({}, Messages.StrictCatchVariable);\n }\n\n expect(')');\n body = parseBlock();\n return delegate.markEnd(delegate.createCatchClause(param, body), startToken);\n }\n\n function parseTryStatement() {\n var block, handlers = [], finalizer = null;\n\n expectKeyword('try');\n\n block = parseBlock();\n\n if (matchKeyword('catch')) {\n handlers.push(parseCatchClause());\n }\n\n if (matchKeyword('finally')) {\n lex();\n finalizer = parseBlock();\n }\n\n if (handlers.length === 0 && !finalizer) {\n throwError({}, Messages.NoCatchOrFinally);\n }\n\n return delegate.createTryStatement(block, [], handlers, finalizer);\n }\n\n // 12.15 The debugger statement\n\n function parseDebuggerStatement() {\n expectKeyword('debugger');\n\n consumeSemicolon();\n\n return delegate.createDebuggerStatement();\n }\n\n // 12 Statements\n\n function parseStatement() {\n var type = lookahead.type,\n expr,\n labeledBody,\n key,\n startToken;\n\n if (type === Token.EOF) {\n throwUnexpected(lookahead);\n }\n\n if (type === Token.Punctuator && lookahead.value === '{') {\n return parseBlock();\n }\n\n startToken = lookahead;\n\n if (type === Token.Punctuator) {\n switch (lookahead.value) {\n case ';':\n return delegate.markEnd(parseEmptyStatement(), startToken);\n case '(':\n return delegate.markEnd(parseExpressionStatement(), startToken);\n default:\n break;\n }\n }\n\n if (type === Token.Keyword) {\n switch (lookahead.value) {\n case 'break':\n return delegate.markEnd(parseBreakStatement(), startToken);\n case 'continue':\n return delegate.markEnd(parseContinueStatement(), startToken);\n case 'debugger':\n return delegate.markEnd(parseDebuggerStatement(), startToken);\n case 'do':\n return delegate.markEnd(parseDoWhileStatement(), startToken);\n case 'for':\n return delegate.markEnd(parseForStatement(), startToken);\n case 'function':\n return delegate.markEnd(parseFunctionDeclaration(), startToken);\n case 'if':\n return delegate.markEnd(parseIfStatement(), startToken);\n case 'return':\n return delegate.markEnd(parseReturnStatement(), startToken);\n case 'switch':\n return delegate.markEnd(parseSwitchStatement(), startToken);\n case 'throw':\n return delegate.markEnd(parseThrowStatement(), startToken);\n case 'try':\n return delegate.markEnd(parseTryStatement(), startToken);\n case 'var':\n return delegate.markEnd(parseVariableStatement(), startToken);\n case 'while':\n return delegate.markEnd(parseWhileStatement(), startToken);\n case 'with':\n return delegate.markEnd(parseWithStatement(), startToken);\n default:\n break;\n }\n }\n\n expr = parseExpression();\n\n // 12.12 Labelled Statements\n if ((expr.type === Syntax.Identifier) && match(':')) {\n lex();\n\n key = '$' + expr.name;\n if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.Redeclaration, 'Label', expr.name);\n }\n\n state.labelSet[key] = true;\n labeledBody = parseStatement();\n delete state.labelSet[key];\n return delegate.markEnd(delegate.createLabeledStatement(expr, labeledBody), startToken);\n }\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createExpressionStatement(expr), startToken);\n }\n\n // 13 Function Definition\n\n function parseFunctionSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted,\n oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, startToken;\n\n startToken = lookahead;\n expect('{');\n\n while (index < length) {\n if (lookahead.type !== Token.StringLiteral) {\n break;\n }\n token = lookahead;\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n oldLabelSet = state.labelSet;\n oldInIteration = state.inIteration;\n oldInSwitch = state.inSwitch;\n oldInFunctionBody = state.inFunctionBody;\n\n state.labelSet = {};\n state.inIteration = false;\n state.inSwitch = false;\n state.inFunctionBody = true;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n\n expect('}');\n\n state.labelSet = oldLabelSet;\n state.inIteration = oldInIteration;\n state.inSwitch = oldInSwitch;\n state.inFunctionBody = oldInFunctionBody;\n\n return delegate.markEnd(delegate.createBlockStatement(sourceElements), startToken);\n }\n\n function parseParams(firstRestricted) {\n var param, params = [], token, stricted, paramSet, key, message;\n expect('(');\n\n if (!match(')')) {\n paramSet = {};\n while (index < length) {\n token = lookahead;\n param = parseVariableIdentifier();\n key = '$' + token.value;\n if (strict) {\n if (isRestrictedWord(token.value)) {\n stricted = token;\n message = Messages.StrictParamName;\n }\n if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n stricted = token;\n message = Messages.StrictParamDupe;\n }\n } else if (!firstRestricted) {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictParamName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n } else if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n firstRestricted = token;\n message = Messages.StrictParamDupe;\n }\n }\n params.push(param);\n paramSet[key] = true;\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return {\n params: params,\n stricted: stricted,\n firstRestricted: firstRestricted,\n message: message\n };\n }\n\n function parseFunctionDeclaration() {\n var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, startToken;\n\n startToken = lookahead;\n\n expectKeyword('function');\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionDeclaration(id, params, [], body), startToken);\n }\n\n function parseFunctionExpression() {\n var token, id = null, stricted, firstRestricted, message, tmp, params = [], body, previousStrict, startToken;\n\n startToken = lookahead;\n expectKeyword('function');\n\n if (!match('(')) {\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionExpression(id, params, [], body), startToken);\n }\n\n // 14 Program\n\n function parseSourceElement() {\n if (lookahead.type === Token.Keyword) {\n switch (lookahead.value) {\n case 'const':\n case 'let':\n return parseConstLetDeclaration(lookahead.value);\n case 'function':\n return parseFunctionDeclaration();\n default:\n return parseStatement();\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n return parseStatement();\n }\n }\n\n function parseSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted;\n\n while (index < length) {\n token = lookahead;\n if (token.type !== Token.StringLiteral) {\n break;\n }\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n while (index < length) {\n sourceElement = parseSourceElement();\n /* istanbul ignore if */\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n return sourceElements;\n }\n\n function parseProgram() {\n var body, startToken;\n\n skipComment();\n peek();\n startToken = lookahead;\n strict = false;\n\n body = parseSourceElements();\n return delegate.markEnd(delegate.createProgram(body), startToken);\n }\n\n function filterTokenLocation() {\n var i, entry, token, tokens = [];\n\n for (i = 0; i < extra.tokens.length; ++i) {\n entry = extra.tokens[i];\n token = {\n type: entry.type,\n value: entry.value\n };\n if (extra.range) {\n token.range = entry.range;\n }\n if (extra.loc) {\n token.loc = entry.loc;\n }\n tokens.push(token);\n }\n\n extra.tokens = tokens;\n }\n\n function tokenize(code, options) {\n var toString,\n token,\n tokens;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n\n // Options matching.\n options = options || {};\n\n // Of course we collect tokens here.\n options.tokens = true;\n extra.tokens = [];\n extra.tokenize = true;\n // The following two fields are necessary to compute the Regex tokens.\n extra.openParenToken = -1;\n extra.openCurlyToken = -1;\n\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n\n try {\n peek();\n if (lookahead.type === Token.EOF) {\n return extra.tokens;\n }\n\n token = lex();\n while (lookahead.type !== Token.EOF) {\n try {\n token = lex();\n } catch (lexError) {\n token = lookahead;\n if (extra.errors) {\n extra.errors.push(lexError);\n // We have to break on the first error\n // to avoid infinite loops.\n break;\n } else {\n throw lexError;\n }\n }\n }\n\n filterTokenLocation();\n tokens = extra.tokens;\n if (typeof extra.comments !== 'undefined') {\n tokens.comments = extra.comments;\n }\n if (typeof extra.errors !== 'undefined') {\n tokens.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n return tokens;\n }\n\n function parse(code, options) {\n var program, toString;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n if (typeof options !== 'undefined') {\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;\n\n if (extra.loc && options.source !== null && options.source !== undefined) {\n extra.source = toString(options.source);\n }\n\n if (typeof options.tokens === 'boolean' && options.tokens) {\n extra.tokens = [];\n }\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n if (extra.attachComment) {\n extra.range = true;\n extra.comments = [];\n extra.bottomRightStack = [];\n extra.trailingComments = [];\n extra.leadingComments = [];\n }\n }\n\n try {\n program = parseProgram();\n if (typeof extra.comments !== 'undefined') {\n program.comments = extra.comments;\n }\n if (typeof extra.tokens !== 'undefined') {\n filterTokenLocation();\n program.tokens = extra.tokens;\n }\n if (typeof extra.errors !== 'undefined') {\n program.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n\n return program;\n }\n\n // Sync with *.json manifests.\n exports.version = '1.2.2';\n\n exports.tokenize = tokenize;\n\n exports.parse = parse;\n\n // Deep copy.\n /* istanbul ignore next */\n exports.Syntax = (function () {\n var name, types = {};\n\n if (typeof Object.create === 'function') {\n types = Object.create(null);\n }\n\n for (name in Syntax) {\n if (Syntax.hasOwnProperty(name)) {\n types[name] = Syntax[name];\n }\n }\n\n if (typeof Object.freeze === 'function') {\n Object.freeze(types);\n }\n\n return types;\n }());\n\n}));\n/* vim: set sw=4 ts=4 et tw=80 : */\n\n},{}],1:[function(require,module,exports){\n(function (process){\n/* parser generated by jison 0.4.13 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar parser = {trace: function trace() { },\nyy: {},\nsymbols_: {\"error\":2,\"JSON_PATH\":3,\"DOLLAR\":4,\"PATH_COMPONENTS\":5,\"LEADING_CHILD_MEMBER_EXPRESSION\":6,\"PATH_COMPONENT\":7,\"MEMBER_COMPONENT\":8,\"SUBSCRIPT_COMPONENT\":9,\"CHILD_MEMBER_COMPONENT\":10,\"DESCENDANT_MEMBER_COMPONENT\":11,\"DOT\":12,\"MEMBER_EXPRESSION\":13,\"DOT_DOT\":14,\"STAR\":15,\"IDENTIFIER\":16,\"SCRIPT_EXPRESSION\":17,\"INTEGER\":18,\"END\":19,\"CHILD_SUBSCRIPT_COMPONENT\":20,\"DESCENDANT_SUBSCRIPT_COMPONENT\":21,\"[\":22,\"SUBSCRIPT\":23,\"]\":24,\"SUBSCRIPT_EXPRESSION\":25,\"SUBSCRIPT_EXPRESSION_LIST\":26,\"SUBSCRIPT_EXPRESSION_LISTABLE\":27,\",\":28,\"STRING_LITERAL\":29,\"ARRAY_SLICE\":30,\"FILTER_EXPRESSION\":31,\"QQ_STRING\":32,\"Q_STRING\":33,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"DOLLAR\",12:\"DOT\",14:\"DOT_DOT\",15:\"STAR\",16:\"IDENTIFIER\",17:\"SCRIPT_EXPRESSION\",18:\"INTEGER\",19:\"END\",22:\"[\",24:\"]\",28:\",\",30:\"ARRAY_SLICE\",31:\"FILTER_EXPRESSION\",32:\"QQ_STRING\",33:\"Q_STRING\"},\nproductions_: [0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */\n/**/) {\n/* this == yyval */\nif (!yy.ast) {\n yy.ast = _ast;\n _ast.initialize();\n}\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:yy.ast.set({ expression: { type: \"root\", value: $$[$0] } }); yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 2:yy.ast.set({ expression: { type: \"root\", value: $$[$0-1] } }); yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 3:yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 4:yy.ast.set({ operation: \"member\", scope: \"child\", expression: { type: \"identifier\", value: $$[$0-1] }}); yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 5:\nbreak;\ncase 6:\nbreak;\ncase 7:yy.ast.set({ operation: \"member\" }); yy.ast.push()\nbreak;\ncase 8:yy.ast.set({ operation: \"subscript\" }); yy.ast.push() \nbreak;\ncase 9:yy.ast.set({ scope: \"child\" })\nbreak;\ncase 10:yy.ast.set({ scope: \"descendant\" })\nbreak;\ncase 11:\nbreak;\ncase 12:yy.ast.set({ scope: \"child\", operation: \"member\" })\nbreak;\ncase 13:\nbreak;\ncase 14:yy.ast.set({ expression: { type: \"wildcard\", value: $$[$0] } })\nbreak;\ncase 15:yy.ast.set({ expression: { type: \"identifier\", value: $$[$0] } })\nbreak;\ncase 16:yy.ast.set({ expression: { type: \"script_expression\", value: $$[$0] } })\nbreak;\ncase 17:yy.ast.set({ expression: { type: \"numeric_literal\", value: parseInt($$[$0]) } })\nbreak;\ncase 18:\nbreak;\ncase 19:yy.ast.set({ scope: \"child\" })\nbreak;\ncase 20:yy.ast.set({ scope: \"descendant\" })\nbreak;\ncase 21:\nbreak;\ncase 22:\nbreak;\ncase 23:\nbreak;\ncase 24:$$[$0].length > 1? yy.ast.set({ expression: { type: \"union\", value: $$[$0] } }) : this.$ = $$[$0]\nbreak;\ncase 25:this.$ = [$$[$0]]\nbreak;\ncase 26:this.$ = $$[$0-2].concat($$[$0])\nbreak;\ncase 27:this.$ = { expression: { type: \"numeric_literal\", value: parseInt($$[$0]) } }; yy.ast.set(this.$)\nbreak;\ncase 28:this.$ = { expression: { type: \"string_literal\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 29:this.$ = { expression: { type: \"slice\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 30:this.$ = { expression: { type: \"wildcard\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 31:this.$ = { expression: { type: \"script_expression\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 32:this.$ = { expression: { type: \"filter_expression\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 33:this.$ = $$[$0]\nbreak;\ncase 34:this.$ = $$[$0]\nbreak;\n}\n},\ntable: [{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],\ndefaultActions: {27:[2,23],29:[2,30],30:[2,31],31:[2,32]},\nparseError: function parseError(str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n throw new Error(str);\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n this.lexer.setInput(input);\n this.lexer.yy = this.yy;\n this.yy.lexer = this.lexer;\n this.yy.parser = this;\n if (typeof this.lexer.yylloc == 'undefined') {\n this.lexer.yylloc = {};\n }\n var yyloc = this.lexer.yylloc;\n lstack.push(yyloc);\n var ranges = this.lexer.options && this.lexer.options.ranges;\n if (typeof this.yy.parseError === 'function') {\n this.parseError = this.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = self.lexer.lex() || EOF;\n if (typeof token !== 'number') {\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (this.lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + this.lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: this.lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: this.lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(this.lexer.yytext);\n lstack.push(this.lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = this.lexer.yyleng;\n yytext = this.lexer.yytext;\n yylineno = this.lexer.yylineno;\n yyloc = this.lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n this.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\nvar _ast = {\n\n initialize: function() {\n this._nodes = [];\n this._node = {};\n this._stash = [];\n },\n\n set: function(props) {\n for (var k in props) this._node[k] = props[k];\n return this._node;\n },\n\n node: function(obj) {\n if (arguments.length) this._node = obj;\n return this._node;\n },\n\n push: function() {\n this._nodes.push(this._node);\n this._node = {};\n },\n\n unshift: function() {\n this._nodes.unshift(this._node);\n this._node = {};\n },\n\n yield: function() {\n var _nodes = this._nodes;\n this.initialize();\n return _nodes;\n }\n};\n/* generated by jison-lex 0.2.1 */\nvar lexer = (function(){\nvar lexer = {\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input) {\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function (match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex() {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin(condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState() {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules() {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState(n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState(condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START\n/**/) {\n\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:return 4\nbreak;\ncase 1:return 14\nbreak;\ncase 2:return 12\nbreak;\ncase 3:return 15\nbreak;\ncase 4:return 16\nbreak;\ncase 5:return 22\nbreak;\ncase 6:return 24\nbreak;\ncase 7:return 28\nbreak;\ncase 8:return 30\nbreak;\ncase 9:return 18\nbreak;\ncase 10:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 32;\nbreak;\ncase 11:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 33;\nbreak;\ncase 12:return 17\nbreak;\ncase 13:return 31\nbreak;\n}\n},\nrules: [/^(?:\\$)/,/^(?:\\.\\.)/,/^(?:\\.)/,/^(?:\\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\\[)/,/^(?:\\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\\:((-?(?:0|[1-9][0-9]*)))?(\\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:\"(?:\\\\[\"bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^\"\\\\])*\")/,/^(?:'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*')/,/^(?:\\(.+?\\)(?=\\]))/,/^(?:\\?\\(.+?\\)(?=\\]))/],\nconditions: {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],\"inclusive\":true}}\n};\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain(args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}\n\n}).call(this,require('_process'))\n},{\"_process\":14,\"fs\":12,\"path\":13}],2:[function(require,module,exports){\nmodule.exports = {\n identifier: \"[a-zA-Z_]+[a-zA-Z0-9_]*\",\n integer: \"-?(?:0|[1-9][0-9]*)\",\n qq_string: \"\\\"(?:\\\\\\\\[\\\"bfnrt/\\\\\\\\]|\\\\\\\\u[a-fA-F0-9]{4}|[^\\\"\\\\\\\\])*\\\"\",\n q_string: \"'(?:\\\\\\\\[\\'bfnrt/\\\\\\\\]|\\\\\\\\u[a-fA-F0-9]{4}|[^\\'\\\\\\\\])*'\"\n};\n\n},{}],3:[function(require,module,exports){\nvar dict = require('./dict');\nvar fs = require('fs');\nvar grammar = {\n\n lex: {\n\n macros: {\n esc: \"\\\\\\\\\",\n int: dict.integer\n },\n\n rules: [\n [\"\\\\$\", \"return 'DOLLAR'\"],\n [\"\\\\.\\\\.\", \"return 'DOT_DOT'\"],\n [\"\\\\.\", \"return 'DOT'\"],\n [\"\\\\*\", \"return 'STAR'\"],\n [dict.identifier, \"return 'IDENTIFIER'\"],\n [\"\\\\[\", \"return '['\"],\n [\"\\\\]\", \"return ']'\"],\n [\",\", \"return ','\"],\n [\"({int})?\\\\:({int})?(\\\\:({int})?)?\", \"return 'ARRAY_SLICE'\"],\n [\"{int}\", \"return 'INTEGER'\"],\n [dict.qq_string, \"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';\"],\n [dict.q_string, \"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';\"],\n [\"\\\\(.+?\\\\)(?=\\\\])\", \"return 'SCRIPT_EXPRESSION'\"],\n [\"\\\\?\\\\(.+?\\\\)(?=\\\\])\", \"return 'FILTER_EXPRESSION'\"]\n ]\n },\n\n start: \"JSON_PATH\",\n\n bnf: {\n\n JSON_PATH: [\n [ 'DOLLAR', 'yy.ast.set({ expression: { type: \"root\", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()' ],\n [ 'DOLLAR PATH_COMPONENTS', 'yy.ast.set({ expression: { type: \"root\", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()' ],\n [ 'LEADING_CHILD_MEMBER_EXPRESSION', 'yy.ast.unshift(); return yy.ast.yield()' ],\n [ 'LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS', 'yy.ast.set({ operation: \"member\", scope: \"child\", expression: { type: \"identifier\", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()' ] ],\n\n PATH_COMPONENTS: [\n [ 'PATH_COMPONENT', '' ],\n [ 'PATH_COMPONENTS PATH_COMPONENT', '' ] ],\n\n PATH_COMPONENT: [\n [ 'MEMBER_COMPONENT', 'yy.ast.set({ operation: \"member\" }); yy.ast.push()' ],\n [ 'SUBSCRIPT_COMPONENT', 'yy.ast.set({ operation: \"subscript\" }); yy.ast.push() ' ] ],\n\n MEMBER_COMPONENT: [\n [ 'CHILD_MEMBER_COMPONENT', 'yy.ast.set({ scope: \"child\" })' ],\n [ 'DESCENDANT_MEMBER_COMPONENT', 'yy.ast.set({ scope: \"descendant\" })' ] ],\n\n CHILD_MEMBER_COMPONENT: [\n [ 'DOT MEMBER_EXPRESSION', '' ] ],\n\n LEADING_CHILD_MEMBER_EXPRESSION: [\n [ 'MEMBER_EXPRESSION', 'yy.ast.set({ scope: \"child\", operation: \"member\" })' ] ],\n\n DESCENDANT_MEMBER_COMPONENT: [\n [ 'DOT_DOT MEMBER_EXPRESSION', '' ] ],\n\n MEMBER_EXPRESSION: [\n [ 'STAR', 'yy.ast.set({ expression: { type: \"wildcard\", value: $1 } })' ],\n [ 'IDENTIFIER', 'yy.ast.set({ expression: { type: \"identifier\", value: $1 } })' ],\n [ 'SCRIPT_EXPRESSION', 'yy.ast.set({ expression: { type: \"script_expression\", value: $1 } })' ],\n [ 'INTEGER', 'yy.ast.set({ expression: { type: \"numeric_literal\", value: parseInt($1) } })' ],\n [ 'END', '' ] ],\n\n SUBSCRIPT_COMPONENT: [\n [ 'CHILD_SUBSCRIPT_COMPONENT', 'yy.ast.set({ scope: \"child\" })' ],\n [ 'DESCENDANT_SUBSCRIPT_COMPONENT', 'yy.ast.set({ scope: \"descendant\" })' ] ],\n\n CHILD_SUBSCRIPT_COMPONENT: [\n [ '[ SUBSCRIPT ]', '' ] ],\n\n DESCENDANT_SUBSCRIPT_COMPONENT: [\n [ 'DOT_DOT [ SUBSCRIPT ]', '' ] ],\n\n SUBSCRIPT: [\n [ 'SUBSCRIPT_EXPRESSION', '' ],\n [ 'SUBSCRIPT_EXPRESSION_LIST', '$1.length > 1? yy.ast.set({ expression: { type: \"union\", value: $1 } }) : $$ = $1' ] ],\n\n SUBSCRIPT_EXPRESSION_LIST: [\n [ 'SUBSCRIPT_EXPRESSION_LISTABLE', '$$ = [$1]'],\n [ 'SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE', '$$ = $1.concat($3)' ] ],\n\n SUBSCRIPT_EXPRESSION_LISTABLE: [\n [ 'INTEGER', '$$ = { expression: { type: \"numeric_literal\", value: parseInt($1) } }; yy.ast.set($$)' ],\n [ 'STRING_LITERAL', '$$ = { expression: { type: \"string_literal\", value: $1 } }; yy.ast.set($$)' ],\n [ 'ARRAY_SLICE', '$$ = { expression: { type: \"slice\", value: $1 } }; yy.ast.set($$)' ] ],\n\n SUBSCRIPT_EXPRESSION: [\n [ 'STAR', '$$ = { expression: { type: \"wildcard\", value: $1 } }; yy.ast.set($$)' ],\n [ 'SCRIPT_EXPRESSION', '$$ = { expression: { type: \"script_expression\", value: $1 } }; yy.ast.set($$)' ],\n [ 'FILTER_EXPRESSION', '$$ = { expression: { type: \"filter_expression\", value: $1 } }; yy.ast.set($$)' ] ],\n\n STRING_LITERAL: [\n [ 'QQ_STRING', \"$$ = $1\" ],\n [ 'Q_STRING', \"$$ = $1\" ] ]\n }\n};\nif (fs.readFileSync) {\n grammar.moduleInclude = fs.readFileSync(require.resolve(\"../include/module.js\"));\n grammar.actionInclude = fs.readFileSync(require.resolve(\"../include/action.js\"));\n}\n\nmodule.exports = grammar;\n\n},{\"./dict\":2,\"fs\":12}],4:[function(require,module,exports){\nvar aesprim = require('./aesprim');\nvar slice = require('./slice');\nvar _evaluate = require('static-eval');\nvar _uniq = require('underscore').uniq;\n\nvar Handlers = function() {\n return this.initialize.apply(this, arguments);\n}\n\nHandlers.prototype.initialize = function() {\n this.traverse = traverser(true);\n this.descend = traverser();\n}\n\nHandlers.prototype.keys = Object.keys;\n\nHandlers.prototype.resolve = function(component) {\n\n var key = [ component.operation, component.scope, component.expression.type ].join('-');\n var method = this._fns[key];\n\n if (!method) throw new Error(\"couldn't resolve key: \" + key);\n return method.bind(this);\n};\n\nHandlers.prototype.register = function(key, handler) {\n\n if (!handler instanceof Function) {\n throw new Error(\"handler must be a function\");\n }\n\n this._fns[key] = handler;\n};\n\nHandlers.prototype._fns = {\n\n 'member-child-identifier': function(component, partial) {\n var key = component.expression.value;\n var value = partial.value;\n if (value instanceof Object && key in value) {\n return [ { value: value[key], path: partial.path.concat(key) } ]\n }\n },\n\n 'member-descendant-identifier':\n _traverse(function(key, value, ref) { return key == ref }),\n\n 'subscript-child-numeric_literal':\n _descend(function(key, value, ref) { return key === ref }),\n\n 'member-child-numeric_literal':\n _descend(function(key, value, ref) { return String(key) === String(ref) }),\n\n 'subscript-descendant-numeric_literal':\n _traverse(function(key, value, ref) { return key === ref }),\n\n 'member-child-wildcard':\n _descend(function() { return true }),\n\n 'member-descendant-wildcard':\n _traverse(function() { return true }),\n\n 'subscript-descendant-wildcard':\n _traverse(function() { return true }),\n\n 'subscript-child-wildcard':\n _descend(function() { return true }),\n\n 'subscript-child-slice': function(component, partial) {\n if (is_array(partial.value)) {\n var args = component.expression.value.split(':').map(_parse_nullable_int);\n var values = partial.value.map(function(v, i) { return { value: v, path: partial.path.concat(i) } });\n return slice.apply(null, [values].concat(args));\n }\n },\n\n 'subscript-child-union': function(component, partial) {\n var results = [];\n component.expression.value.forEach(function(component) {\n var _component = { operation: 'subscript', scope: 'child', expression: component.expression };\n var handler = this.resolve(_component);\n var _results = handler(_component, partial);\n if (_results) {\n results = results.concat(_results);\n }\n }, this);\n\n return unique(results);\n },\n\n 'subscript-descendant-union': function(component, partial, count) {\n\n var jp = require('..');\n var self = this;\n\n var results = [];\n var nodes = jp.nodes(partial, '$..*').slice(1);\n\n nodes.forEach(function(node) {\n if (results.length >= count) return;\n component.expression.value.forEach(function(component) {\n var _component = { operation: 'subscript', scope: 'child', expression: component.expression };\n var handler = self.resolve(_component);\n var _results = handler(_component, node);\n results = results.concat(_results);\n });\n });\n\n return unique(results);\n },\n\n 'subscript-child-filter_expression': function(component, partial, count) {\n\n // slice out the expression from ?(expression)\n var src = component.expression.value.slice(2, -1);\n var ast = aesprim.parse(src).body[0].expression;\n\n var passable = function(key, value) {\n return evaluate(ast, { '@': value });\n }\n\n return this.descend(partial, null, passable, count);\n\n },\n\n 'subscript-descendant-filter_expression': function(component, partial, count) {\n\n // slice out the expression from ?(expression)\n var src = component.expression.value.slice(2, -1);\n var ast = aesprim.parse(src).body[0].expression;\n\n var passable = function(key, value) {\n return evaluate(ast, { '@': value });\n }\n\n return this.traverse(partial, null, passable, count);\n },\n\n 'subscript-child-script_expression': function(component, partial) {\n var exp = component.expression.value.slice(1, -1);\n return eval_recurse(partial, exp, '$[{{value}}]');\n },\n\n 'member-child-script_expression': function(component, partial) {\n var exp = component.expression.value.slice(1, -1);\n return eval_recurse(partial, exp, '$.{{value}}');\n },\n\n 'member-descendant-script_expression': function(component, partial) {\n var exp = component.expression.value.slice(1, -1);\n return eval_recurse(partial, exp, '$..value');\n }\n};\n\nHandlers.prototype._fns['subscript-child-string_literal'] =\n\tHandlers.prototype._fns['member-child-identifier'];\n\nHandlers.prototype._fns['member-descendant-numeric_literal'] =\n Handlers.prototype._fns['subscript-descendant-string_literal'] =\n Handlers.prototype._fns['member-descendant-identifier'];\n\nfunction eval_recurse(partial, src, template) {\n\n var jp = require('./index');\n var ast = aesprim.parse(src).body[0].expression;\n var value = evaluate(ast, { '@': partial.value });\n var path = template.replace(/\\{\\{\\s*value\\s*\\}\\}/g, value);\n\n var results = jp.nodes(partial.value, path);\n results.forEach(function(r) {\n r.path = partial.path.concat(r.path.slice(1));\n });\n\n return results;\n}\n\nfunction is_array(val) {\n return Array.isArray(val);\n}\n\nfunction is_object(val) {\n // is this a non-array, non-null object?\n return val && !(val instanceof Array) && val instanceof Object;\n}\n\nfunction traverser(recurse) {\n\n return function(partial, ref, passable, count) {\n\n var value = partial.value;\n var path = partial.path;\n\n var results = [];\n\n var descend = function(value, path) {\n\n if (is_array(value)) {\n value.forEach(function(element, index) {\n if (results.length >= count) { return }\n if (passable(index, element, ref)) {\n results.push({ path: path.concat(index), value: element });\n }\n });\n value.forEach(function(element, index) {\n if (results.length >= count) { return }\n if (recurse) {\n descend(element, path.concat(index));\n }\n });\n } else if (is_object(value)) {\n this.keys(value).forEach(function(k) {\n if (results.length >= count) { return }\n if (passable(k, value[k], ref)) {\n results.push({ path: path.concat(k), value: value[k] });\n }\n })\n this.keys(value).forEach(function(k) {\n if (results.length >= count) { return }\n if (recurse) {\n descend(value[k], path.concat(k));\n }\n });\n }\n }.bind(this);\n descend(value, path);\n return results;\n }\n}\n\nfunction _descend(passable) {\n return function(component, partial, count) {\n return this.descend(partial, component.expression.value, passable, count);\n }\n}\n\nfunction _traverse(passable) {\n return function(component, partial, count) {\n return this.traverse(partial, component.expression.value, passable, count);\n }\n}\n\nfunction evaluate() {\n try { return _evaluate.apply(this, arguments) }\n catch (e) { }\n}\n\nfunction unique(results) {\n results = results.filter(function(d) { return d })\n return _uniq(\n results,\n function(r) { return r.path.map(function(c) { return String(c).replace('-', '--') }).join('-') }\n );\n}\n\nfunction _parse_nullable_int(val) {\n var sval = String(val);\n return sval.match(/^-?[0-9]+$/) ? parseInt(sval) : null;\n}\n\nmodule.exports = Handlers;\n\n},{\"..\":\"jsonpath\",\"./aesprim\":\"./aesprim\",\"./index\":5,\"./slice\":7,\"static-eval\":15,\"underscore\":12}],5:[function(require,module,exports){\nvar assert = require('assert');\nvar dict = require('./dict');\nvar Parser = require('./parser');\nvar Handlers = require('./handlers');\n\nvar JSONPath = function() {\n this.initialize.apply(this, arguments);\n};\n\nJSONPath.prototype.initialize = function() {\n this.parser = new Parser();\n this.handlers = new Handlers();\n};\n\nJSONPath.prototype.parse = function(string) {\n assert.ok(_is_string(string), \"we need a path\");\n return this.parser.parse(string);\n};\n\nJSONPath.prototype.parent = function(obj, string) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n var node = this.nodes(obj, string)[0];\n var key = node.path.pop(); /* jshint unused:false */\n return this.value(obj, node.path);\n}\n\nJSONPath.prototype.apply = function(obj, string, fn) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n assert.equal(typeof fn, \"function\", \"fn needs to be function\")\n\n var nodes = this.nodes(obj, string).sort(function(a, b) {\n // sort nodes so we apply from the bottom up\n return b.path.length - a.path.length;\n });\n\n nodes.forEach(function(node) {\n var key = node.path.pop();\n var parent = this.value(obj, this.stringify(node.path));\n var val = node.value = fn.call(obj, parent[key]);\n parent[key] = val;\n }, this);\n\n return nodes;\n}\n\nJSONPath.prototype.value = function(obj, path, value) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(path, \"we need a path\");\n\n if (arguments.length >= 3) {\n var node = this.nodes(obj, path).shift();\n if (!node) return this._vivify(obj, path, value);\n var key = node.path.slice(-1).shift();\n var parent = this.parent(obj, this.stringify(node.path));\n parent[key] = value;\n }\n return this.query(obj, this.stringify(path), 1).shift();\n}\n\nJSONPath.prototype._vivify = function(obj, string, value) {\n\n var self = this;\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n var path = this.parser.parse(string)\n .map(function(component) { return component.expression.value });\n\n var setValue = function(path, value) {\n var key = path.pop();\n var node = self.value(obj, path);\n if (!node) {\n setValue(path.concat(), typeof key === 'string' ? {} : []);\n node = self.value(obj, path);\n }\n node[key] = value;\n }\n setValue(path, value);\n return this.query(obj, string)[0];\n}\n\nJSONPath.prototype.query = function(obj, string, count) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(_is_string(string), \"we need a path\");\n\n var results = this.nodes(obj, string, count)\n .map(function(r) { return r.value });\n\n return results;\n};\n\nJSONPath.prototype.paths = function(obj, string, count) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n var results = this.nodes(obj, string, count)\n .map(function(r) { return r.path });\n\n return results;\n};\n\nJSONPath.prototype.nodes = function(obj, string, count) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n if (count === 0) return [];\n\n var path = this.parser.parse(string);\n var handlers = this.handlers;\n\n var partials = [ { path: ['$'], value: obj } ];\n var matches = [];\n\n if (path.length && path[0].expression.type == 'root') path.shift();\n\n if (!path.length) return partials;\n\n path.forEach(function(component, index) {\n\n if (matches.length >= count) return;\n var handler = handlers.resolve(component);\n var _partials = [];\n\n partials.forEach(function(p) {\n\n if (matches.length >= count) return;\n var results = handler(component, p, count);\n\n if (index == path.length - 1) {\n // if we're through the components we're done\n matches = matches.concat(results || []);\n } else {\n // otherwise accumulate and carry on through\n _partials = _partials.concat(results || []);\n }\n });\n\n partials = _partials;\n\n });\n\n return count ? matches.slice(0, count) : matches;\n};\n\nJSONPath.prototype.stringify = function(path) {\n\n assert.ok(path, \"we need a path\");\n\n var string = '$';\n\n var templates = {\n 'descendant-member': '..{{value}}',\n 'child-member': '.{{value}}',\n 'descendant-subscript': '..[{{value}}]',\n 'child-subscript': '[{{value}}]'\n };\n\n path = this._normalize(path);\n\n path.forEach(function(component) {\n\n if (component.expression.type == 'root') return;\n\n var key = [component.scope, component.operation].join('-');\n var template = templates[key];\n var value;\n\n if (component.expression.type == 'string_literal') {\n value = JSON.stringify(component.expression.value)\n } else {\n value = component.expression.value;\n }\n\n if (!template) throw new Error(\"couldn't find template \" + key);\n\n string += template.replace(/{{value}}/, value);\n });\n\n return string;\n}\n\nJSONPath.prototype._normalize = function(path) {\n\n assert.ok(path, \"we need a path\");\n\n if (typeof path == \"string\") {\n\n return this.parser.parse(path);\n\n } else if (Array.isArray(path) && typeof path[0] == \"string\") {\n\n var _path = [ { expression: { type: \"root\", value: \"$\" } } ];\n\n path.forEach(function(component, index) {\n\n if (component == '$' && index === 0) return;\n\n if (typeof component == \"string\" && component.match(\"^\" + dict.identifier + \"$\")) {\n\n _path.push({\n operation: 'member',\n scope: 'child',\n expression: { value: component, type: 'identifier' }\n });\n\n } else {\n\n var type = typeof component == \"number\" ?\n 'numeric_literal' : 'string_literal';\n\n _path.push({\n operation: 'subscript',\n scope: 'child',\n expression: { value: component, type: type }\n });\n }\n });\n\n return _path;\n\n } else if (Array.isArray(path) && typeof path[0] == \"object\") {\n\n return path\n }\n\n throw new Error(\"couldn't understand path \" + path);\n}\n\nfunction _is_string(obj) {\n return Object.prototype.toString.call(obj) == '[object String]';\n}\n\nJSONPath.Handlers = Handlers;\nJSONPath.Parser = Parser;\n\nvar instance = new JSONPath;\ninstance.JSONPath = JSONPath;\n\nmodule.exports = instance;\n\n},{\"./dict\":2,\"./handlers\":4,\"./parser\":6,\"assert\":8}],6:[function(require,module,exports){\nvar grammar = require('./grammar');\nvar gparser = require('../generated/parser');\n\nvar Parser = function() {\n\n var parser = new gparser.Parser();\n\n var _parseError = parser.parseError;\n parser.yy.parseError = function() {\n if (parser.yy.ast) {\n parser.yy.ast.initialize();\n }\n _parseError.apply(parser, arguments);\n }\n\n return parser;\n\n};\n\nParser.grammar = grammar;\nmodule.exports = Parser;\n\n},{\"../generated/parser\":1,\"./grammar\":3}],7:[function(require,module,exports){\nmodule.exports = function(arr, start, end, step) {\n\n if (typeof start == 'string') throw new Error(\"start cannot be a string\");\n if (typeof end == 'string') throw new Error(\"end cannot be a string\");\n if (typeof step == 'string') throw new Error(\"step cannot be a string\");\n\n var len = arr.length;\n\n if (step === 0) throw new Error(\"step cannot be zero\");\n step = step ? integer(step) : 1;\n\n // normalize negative values\n start = start < 0 ? len + start : start;\n end = end < 0 ? len + end : end;\n\n // default extents to extents\n start = integer(start === 0 ? 0 : !start ? (step > 0 ? 0 : len - 1) : start);\n end = integer(end === 0 ? 0 : !end ? (step > 0 ? len : -1) : end);\n\n // clamp extents\n start = step > 0 ? Math.max(0, start) : Math.min(len, start);\n end = step > 0 ? Math.min(end, len) : Math.max(-1, end);\n\n // return empty if extents are backwards\n if (step > 0 && end <= start) return [];\n if (step < 0 && start <= end) return [];\n\n var result = [];\n\n for (var i = start; i != end; i += step) {\n if ((step < 0 && i <= end) || (step > 0 && i >= end)) break;\n result.push(arr[i]);\n }\n\n return result;\n}\n\nfunction integer(val) {\n return String(val).match(/^[0-9]+$/) ? parseInt(val) :\n Number.isFinite(val) ? parseInt(val, 10) : 0;\n}\n\n},{}],8:[function(require,module,exports){\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// when used in node, this will actually load the util module we depend on\n// versus loading the builtin util module as happens otherwise\n// this is a bug in node module loading as far as I am concerned\nvar util = require('util/');\n\nvar pSlice = Array.prototype.slice;\nvar hasOwn = Object.prototype.hasOwnProperty;\n\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nassert.AssertionError = function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n }\n else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = stackStartFunction.name;\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n};\n\n// assert.AssertionError instanceof Error\nutil.inherits(assert.AssertionError, Error);\n\nfunction replacer(key, value) {\n if (util.isUndefined(value)) {\n return '' + value;\n }\n if (util.isNumber(value) && !isFinite(value)) {\n return value.toString();\n }\n if (util.isFunction(value) || util.isRegExp(value)) {\n return value.toString();\n }\n return value;\n}\n\nfunction truncate(s, n) {\n if (util.isString(s)) {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\n\nfunction getMessage(self) {\n return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +\n self.operator + ' ' +\n truncate(JSON.stringify(self.expected, replacer), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction fail(actual, expected, message, operator, stackStartFunction) {\n throw new assert.AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nfunction ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n}\nassert.ok = ok;\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\n\nassert.equal = function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', assert.equal);\n};\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\n\nassert.notEqual = function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', assert.notEqual);\n }\n};\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected)) {\n fail(actual, expected, message, 'deepEqual', assert.deepEqual);\n }\n};\n\nfunction _deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (util.isBuffer(actual) && util.isBuffer(expected)) {\n if (actual.length != expected.length) return false;\n\n for (var i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) return false;\n }\n\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (util.isDate(actual) && util.isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (util.isRegExp(actual) && util.isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!util.isObject(actual) && !util.isObject(expected)) {\n return actual == expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b) {\n if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n // if one is a primitive, the other must be same\n if (util.isPrimitive(a) || util.isPrimitive(b)) {\n return a === b;\n }\n var aIsArgs = isArguments(a),\n bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b);\n }\n var ka = objectKeys(a),\n kb = objectKeys(b),\n key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key])) return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected)) {\n fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);\n }\n};\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', assert.strictEqual);\n }\n};\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', assert.notStrictEqual);\n }\n};\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n } else if (actual instanceof expected) {\n return true;\n } else if (expected.call({}, actual) === true) {\n return true;\n }\n\n return false;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (util.isString(expected)) {\n message = expected;\n expected = null;\n }\n\n try {\n block();\n } catch (e) {\n actual = e;\n }\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n if (!shouldThrow && expectedException(actual, expected)) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\n\nassert.throws = function(block, /*optional*/error, /*optional*/message) {\n _throws.apply(this, [true].concat(pSlice.call(arguments)));\n};\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = function(block, /*optional*/message) {\n _throws.apply(this, [false].concat(pSlice.call(arguments)));\n};\n\nassert.ifError = function(err) { if (err) {throw err;}};\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n\n},{\"util/\":11}],9:[function(require,module,exports){\nif (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n},{}],10:[function(require,module,exports){\nmodule.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n},{}],11:[function(require,module,exports){\n(function (process,global){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n}).call(this,require('_process'),typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"./support/isBuffer\":10,\"_process\":14,\"inherits\":9}],12:[function(require,module,exports){\n\n},{}],13:[function(require,module,exports){\n(function (process){\n// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n if (typeof path !== 'string') path = path + '';\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) {\n // return '//';\n // Backwards-compat fix:\n return '/';\n }\n return path.slice(0, end);\n};\n\nfunction basename(path) {\n if (typeof path !== 'string') path = path + '';\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n var f = basename(path);\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\nexports.extname = function (path) {\n if (typeof path !== 'string') path = path + '';\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n\n}).call(this,require('_process'))\n},{\"_process\":14}],14:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],15:[function(require,module,exports){\nvar unparse = require('escodegen').generate;\n\nmodule.exports = function (ast, vars) {\n if (!vars) vars = {};\n var FAIL = {};\n \n var result = (function walk (node, scopeVars) {\n if (node.type === 'Literal') {\n return node.value;\n }\n else if (node.type === 'UnaryExpression'){\n var val = walk(node.argument)\n if (node.operator === '+') return +val\n if (node.operator === '-') return -val\n if (node.operator === '~') return ~val\n if (node.operator === '!') return !val\n return FAIL\n }\n else if (node.type === 'ArrayExpression') {\n var xs = [];\n for (var i = 0, l = node.elements.length; i < l; i++) {\n var x = walk(node.elements[i]);\n if (x === FAIL) return FAIL;\n xs.push(x);\n }\n return xs;\n }\n else if (node.type === 'ObjectExpression') {\n var obj = {};\n for (var i = 0; i < node.properties.length; i++) {\n var prop = node.properties[i];\n var value = prop.value === null\n ? prop.value\n : walk(prop.value)\n ;\n if (value === FAIL) return FAIL;\n obj[prop.key.value || prop.key.name] = value;\n }\n return obj;\n }\n else if (node.type === 'BinaryExpression' ||\n node.type === 'LogicalExpression') {\n var l = walk(node.left);\n if (l === FAIL) return FAIL;\n var r = walk(node.right);\n if (r === FAIL) return FAIL;\n \n var op = node.operator;\n if (op === '==') return l == r;\n if (op === '===') return l === r;\n if (op === '!=') return l != r;\n if (op === '!==') return l !== r;\n if (op === '+') return l + r;\n if (op === '-') return l - r;\n if (op === '*') return l * r;\n if (op === '/') return l / r;\n if (op === '%') return l % r;\n if (op === '<') return l < r;\n if (op === '<=') return l <= r;\n if (op === '>') return l > r;\n if (op === '>=') return l >= r;\n if (op === '|') return l | r;\n if (op === '&') return l & r;\n if (op === '^') return l ^ r;\n if (op === '&&') return l && r;\n if (op === '||') return l || r;\n \n return FAIL;\n }\n else if (node.type === 'Identifier') {\n if ({}.hasOwnProperty.call(vars, node.name)) {\n return vars[node.name];\n }\n else return FAIL;\n }\n else if (node.type === 'ThisExpression') {\n if ({}.hasOwnProperty.call(vars, 'this')) {\n return vars['this'];\n }\n else return FAIL;\n }\n else if (node.type === 'CallExpression') {\n var callee = walk(node.callee);\n if (callee === FAIL) return FAIL;\n if (typeof callee !== 'function') return FAIL;\n \n var ctx = node.callee.object ? walk(node.callee.object) : FAIL;\n if (ctx === FAIL) ctx = null;\n\n var args = [];\n for (var i = 0, l = node.arguments.length; i < l; i++) {\n var x = walk(node.arguments[i]);\n if (x === FAIL) return FAIL;\n args.push(x);\n }\n return callee.apply(ctx, args);\n }\n else if (node.type === 'MemberExpression') {\n var obj = walk(node.object);\n // do not allow access to methods on Function \n if((obj === FAIL) || (typeof obj == 'function')){\n return FAIL;\n }\n if (node.property.type === 'Identifier') {\n return obj[node.property.name];\n }\n var prop = walk(node.property);\n if (prop === FAIL) return FAIL;\n return obj[prop];\n }\n else if (node.type === 'ConditionalExpression') {\n var val = walk(node.test)\n if (val === FAIL) return FAIL;\n return val ? walk(node.consequent) : walk(node.alternate)\n }\n else if (node.type === 'ExpressionStatement') {\n var val = walk(node.expression)\n if (val === FAIL) return FAIL;\n return val;\n }\n else if (node.type === 'ReturnStatement') {\n return walk(node.argument)\n }\n else if (node.type === 'FunctionExpression') {\n \n var bodies = node.body.body;\n \n // Create a \"scope\" for our arguments\n var oldVars = {};\n Object.keys(vars).forEach(function(element){\n oldVars[element] = vars[element];\n })\n\n for(var i=0; i= 1 && e <= 11; - }, A = function(e) { - return e && f(e.nodeType) && typeof e.nodeName == "string"; - }; - function y(e) { - var r = Array.prototype.slice, o = e.length, a = function(l, g) { - return function() { - return g.apply(this, l.concat(r.call(arguments))); - }; - }, i = function() { - var l = r.call(arguments); - return l.length < o ? a(l, i) : e.apply(this, r.apply(arguments, [0, o])); - }; - return i; - } - var N = function(e, r) { - for (var o = 0; o < r.length; o += 1) - e(r[o], o, r); - }, w = function(e, r, o) { - var a = r; - return N(function(i, l) { - a = e(a, i, l); - }, o), a; - }, S = function(e, r) { - var o = new Array(r.length); - return N(function(a, i) { - o[i] = e(a); - }, r), o; - }, k = function(e, r) { - var o = []; - return N(function(a, i) { - e(a, i) && o.push(a); - }, r), o; - }, q = function(e, r) { - for (var o = 0; o < e.length; o += 1) - if (e[o] === r) - return !0; - return !1; - }; - function $(e) { - return function() { - return e; - }; - } - function J(e) { - return e.toString(); - } - var H = function(e, r) { - return r.join(e); - }, G = function(e, r, o) { - return e + o + r; - }, Q = Array.prototype.concat, He = function(e, r) { - var o = new m(); - o.addArray(e); - var a = o.toArray(); - return r ? a.reverse() : a; - }, Y = 32767; - function te(e) { - for (var r = [], o = 0; o < e.length; o += Y) { - var a = e.slice(o, o + Y); - r = Q.apply(r, a); - } - return r; - } - function Se(e, r) { - for (var o = Object(e), a = 1; a < arguments.length; a++) { - var i = arguments[a]; - if (i != null) - for (var l in i) - Object.prototype.hasOwnProperty.call(i, l) && (o[l] = i[l]); - } - return o; - } - var x = { - ELEMENT_NODE: 1, - ATTRIBUTE_NODE: 2, - TEXT_NODE: 3, - CDATA_SECTION_NODE: 4, - PROCESSING_INSTRUCTION_NODE: 7, - COMMENT_NODE: 8, - DOCUMENT_NODE: 9, - DOCUMENT_TYPE_NODE: 10, - DOCUMENT_FRAGMENT_NODE: 11, - NAMESPACE_NODE: s - }; - p.prototype = new Object(), p.prototype.constructor = p, p.superclass = Object.prototype; - function p() { - this.init(); - } - p.prototype.init = function() { - this.reduceActions = [], this.reduceActions[3] = function(e) { - return new ue(e[0], e[2]); - }, this.reduceActions[5] = function(e) { - return new pe(e[0], e[2]); - }, this.reduceActions[7] = function(e) { - return new M(e[0], e[2]); - }, this.reduceActions[8] = function(e) { - return new j(e[0], e[2]); - }, this.reduceActions[10] = function(e) { - return new ce(e[0], e[2]); - }, this.reduceActions[11] = function(e) { - return new Ae(e[0], e[2]); - }, this.reduceActions[12] = function(e) { - return new De(e[0], e[2]); - }, this.reduceActions[13] = function(e) { - return new ge(e[0], e[2]); - }, this.reduceActions[15] = function(e) { - return new de(e[0], e[2]); - }, this.reduceActions[16] = function(e) { - return new me(e[0], e[2]); - }, this.reduceActions[18] = function(e) { - return new Ne(e[0], e[2]); - }, this.reduceActions[19] = function(e) { - return new ve(e[0], e[2]); - }, this.reduceActions[20] = function(e) { - return new xe(e[0], e[2]); - }, this.reduceActions[22] = function(e) { - return new le(e[1]); - }, this.reduceActions[24] = function(e) { - return new Ce(e[0], e[2]); - }, this.reduceActions[25] = function(e) { - return new _(void 0, void 0, e[0]); - }, this.reduceActions[27] = function(e) { - return e[0].locationPath = e[2], e[0]; - }, this.reduceActions[28] = function(e) { - return e[0].locationPath = e[2], e[0].locationPath.steps.unshift(new E(E.DESCENDANTORSELF, d.nodeTest, [])), e[0]; - }, this.reduceActions[29] = function(e) { - return new _(e[0], [], void 0); - }, this.reduceActions[30] = function(e) { - return v.instance_of(e[0], _) ? (e[0].filterPredicates == null && (e[0].filterPredicates = []), e[0].filterPredicates.push(e[1]), e[0]) : new _(e[0], [e[1]], void 0); - }, this.reduceActions[32] = function(e) { - return e[1]; - }, this.reduceActions[33] = function(e) { - return new T(e[0]); - }, this.reduceActions[34] = function(e) { - return new b(e[0]); - }, this.reduceActions[36] = function(e) { - return new ye(e[0], []); - }, this.reduceActions[37] = function(e) { - return new ye(e[0], e[2]); - }, this.reduceActions[38] = function(e) { - return [e[0]]; - }, this.reduceActions[39] = function(e) { - return e[2].unshift(e[0]), e[2]; - }, this.reduceActions[43] = function(e) { - return new Oe(!0, []); - }, this.reduceActions[44] = function(e) { - return e[1].absolute = !0, e[1]; - }, this.reduceActions[46] = function(e) { - return new Oe(!1, [e[0]]); - }, this.reduceActions[47] = function(e) { - return e[0].steps.push(e[2]), e[0]; - }, this.reduceActions[49] = function(e) { - return new E(e[0], e[1], []); - }, this.reduceActions[50] = function(e) { - return new E(E.CHILD, e[0], []); - }, this.reduceActions[51] = function(e) { - return new E(e[0], e[1], e[2]); - }, this.reduceActions[52] = function(e) { - return new E(E.CHILD, e[0], e[1]); - }, this.reduceActions[54] = function(e) { - return [e[0]]; - }, this.reduceActions[55] = function(e) { - return e[1].unshift(e[0]), e[1]; - }, this.reduceActions[56] = function(e) { - return e[0] == "ancestor" ? E.ANCESTOR : e[0] == "ancestor-or-self" ? E.ANCESTORORSELF : e[0] == "attribute" ? E.ATTRIBUTE : e[0] == "child" ? E.CHILD : e[0] == "descendant" ? E.DESCENDANT : e[0] == "descendant-or-self" ? E.DESCENDANTORSELF : e[0] == "following" ? E.FOLLOWING : e[0] == "following-sibling" ? E.FOLLOWINGSIBLING : e[0] == "namespace" ? E.NAMESPACE : e[0] == "parent" ? E.PARENT : e[0] == "preceding" ? E.PRECEDING : e[0] == "preceding-sibling" ? E.PRECEDINGSIBLING : e[0] == "self" ? E.SELF : -1; - }, this.reduceActions[57] = function(e) { - return E.ATTRIBUTE; - }, this.reduceActions[59] = function(e) { - return e[0] == "comment" ? d.commentTest : e[0] == "text" ? d.textTest : e[0] == "processing-instruction" ? d.anyPiTest : e[0] == "node" ? d.nodeTest : new d(-1, void 0); - }, this.reduceActions[60] = function(e) { - return new d.PITest(e[2]); - }, this.reduceActions[61] = function(e) { - return e[1]; - }, this.reduceActions[63] = function(e) { - return e[1].absolute = !0, e[1].steps.unshift(new E(E.DESCENDANTORSELF, d.nodeTest, [])), e[1]; - }, this.reduceActions[64] = function(e) { - return e[0].steps.push(new E(E.DESCENDANTORSELF, d.nodeTest, [])), e[0].steps.push(e[2]), e[0]; - }, this.reduceActions[65] = function(e) { - return new E(E.SELF, d.nodeTest, []); - }, this.reduceActions[66] = function(e) { - return new E(E.PARENT, d.nodeTest, []); - }, this.reduceActions[67] = function(e) { - return new Fe(e[1]); - }, this.reduceActions[68] = function(e) { - return d.nameTestAny; - }, this.reduceActions[69] = function(e) { - return new d.NameTestPrefixAny(e[0].split(":")[0]); - }, this.reduceActions[70] = function(e) { - return new d.NameTestQName(e[0]); - }; - }, p.actionTable = [ - " s s sssssssss s ss s ss", - " s ", - "r rrrrrrrrr rrrrrrr rr r ", - " rrrrr ", - " s s sssssssss s ss s ss", - "rs rrrrrrrr s sssssrrrrrr rrs rs ", - " s s sssssssss s ss s ss", - " s ", - " s ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - " s ", - " s ", - " s s sssss s s ", - "r rrrrrrrrr rrrrrrr rr r ", - "a ", - "r s rr r ", - "r sr rr r ", - "r s rr s rr r ", - "r rssrr rss rr r ", - "r rrrrr rrrss rr r ", - "r rrrrrsss rrrrr rr r ", - "r rrrrrrrr rrrrr rr r ", - "r rrrrrrrr rrrrrs rr r ", - "r rrrrrrrr rrrrrr rr r ", - "r rrrrrrrr rrrrrr rr r ", - "r srrrrrrrr rrrrrrs rr sr ", - "r srrrrrrrr rrrrrrs rr r ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrr rrrrrr rr r ", - "r rrrrrrrr rrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - " sssss ", - "r rrrrrrrrr rrrrrrr rr sr ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - " s ", - "r srrrrrrrr rrrrrrs rr r ", - "r rrrrrrrr rrrrr rr r ", - " s ", - " s ", - " rrrrr ", - " s s sssssssss s sss s ss", - "r srrrrrrrr rrrrrrs rr r ", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss s ss s ss", - " s s sssssssss ss s ss", - " s s sssssssss s ss s ss", - " s s sssss s s ", - " s s sssss s s ", - "r rrrrrrrrr rrrrrrr rr rr ", - " s s sssss s s ", - " s s sssss s s ", - "r rrrrrrrrr rrrrrrr rr sr ", - "r rrrrrrrrr rrrrrrr rr sr ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr rr ", - " s ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - " rr ", - " s ", - " rs ", - "r sr rr r ", - "r s rr s rr r ", - "r rssrr rss rr r ", - "r rssrr rss rr r ", - "r rrrrr rrrss rr r ", - "r rrrrr rrrss rr r ", - "r rrrrr rrrss rr r ", - "r rrrrr rrrss rr r ", - "r rrrrrsss rrrrr rr r ", - "r rrrrrsss rrrrr rr r ", - "r rrrrrrrr rrrrr rr r ", - "r rrrrrrrr rrrrr rr r ", - "r rrrrrrrr rrrrr rr r ", - "r rrrrrrrr rrrrrr rr r ", - " r ", - " s ", - "r srrrrrrrr rrrrrrs rr r ", - "r srrrrrrrr rrrrrrs rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr r ", - "r rrrrrrrrr rrrrrrr rr rr ", - "r rrrrrrrrr rrrrrrr rr rr ", - " s s sssssssss s ss s ss", - "r rrrrrrrrr rrrrrrr rr rr ", - " r " - ], p.actionTableNumber = [ - ` 1 0 /.-,+*)(' & %$ # "!`, - " J ", - "a aaaaaaaaa aaaaaaa aa a ", - " YYYYY ", - ` 1 0 /.-,+*)(' & %$ # "!`, - `K1 KKKKKKKK . +*)('KKKKKK KK# K" `, - ` 1 0 /.-,+*)(' & %$ # "!`, - " N ", - " O ", - "e eeeeeeeee eeeeeee ee ee ", - "f fffffffff fffffff ff ff ", - "d ddddddddd ddddddd dd dd ", - "B BBBBBBBBB BBBBBBB BB BB ", - "A AAAAAAAAA AAAAAAA AA AA ", - " P ", - " Q ", - ` 1 . +*)(' # " `, - "b bbbbbbbbb bbbbbbb bb b ", - " ", - "! S !! ! ", - '" T" "" " ', - "$ V $$ U $$ $ ", - "& &ZY&& &XW && & ", - ") ))))) )))\\[ )) ) ", - ". ....._^] ..... .. . ", - "1 11111111 11111 11 1 ", - "5 55555555 55555` 55 5 ", - "7 77777777 777777 77 7 ", - "9 99999999 999999 99 9 ", - ": c:::::::: ::::::b :: a: ", - "I fIIIIIIII IIIIIIe II I ", - "= ========= ======= == == ", - "? ????????? ??????? ?? ?? ", - "C CCCCCCCCC CCCCCCC CC CC ", - "J JJJJJJJJ JJJJJJ JJ J ", - "M MMMMMMMM MMMMMM MM M ", - "N NNNNNNNNN NNNNNNN NN N ", - "P PPPPPPPPP PPPPPPP PP P ", - " +*)(' ", - "R RRRRRRRRR RRRRRRR RR aR ", - "U UUUUUUUUU UUUUUUU UU U ", - "Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ", - "c ccccccccc ccccccc cc cc ", - " j ", - "L fLLLLLLLL LLLLLLe LL L ", - "6 66666666 66666 66 6 ", - " k ", - " l ", - " XXXXX ", - ` 1 0 /.-,+*)(' & %$m # "!`, - "_ f________ ______e __ _ ", - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 0 /.-,+*)(' %$ # "!`, - ` 1 0 /.-,+*)(' & %$ # "!`, - ` 1 . +*)(' # " `, - ` 1 . +*)(' # " `, - "> >>>>>>>>> >>>>>>> >> >> ", - ` 1 . +*)(' # " `, - ` 1 . +*)(' # " `, - "Q QQQQQQQQQ QQQQQQQ QQ aQ ", - "V VVVVVVVVV VVVVVVV VV aV ", - "T TTTTTTTTT TTTTTTT TT T ", - "@ @@@@@@@@@ @@@@@@@ @@ @@ ", - " ‡ ", - "[ [[[[[[[[[ [[[[[[[ [[ [[ ", - "D DDDDDDDDD DDDDDDD DD DD ", - " HH ", - " ˆ ", - " F‰ ", - "# T# ## # ", - "% V %% U %% % ", - "' 'ZY'' 'XW '' ' ", - "( (ZY(( (XW (( ( ", - "+ +++++ +++\\[ ++ + ", - "* ***** ***\\[ ** * ", - "- ----- ---\\[ -- - ", - ", ,,,,, ,,,\\[ ,, , ", - "0 00000_^] 00000 00 0 ", - "/ /////_^] ///// // / ", - "2 22222222 22222 22 2 ", - "3 33333333 33333 33 3 ", - "4 44444444 44444 44 4 ", - "8 88888888 888888 88 8 ", - " ^ ", - " Š ", - "; f;;;;;;;; ;;;;;;e ;; ; ", - "< f<<<<<<<< <<<<<?@ AB CDEFGH IJ ", - " ", - " ", - " ", - "L456789:;<=>?@ AB CDEFGH IJ ", - " M EFGH IJ ", - " N;<=>?@ AB CDEFGH IJ ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " S EFGH IJ ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " e ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " h J ", - " i j ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "o456789:;<=>?@ ABpqCDEFGH IJ ", - " ", - " r6789:;<=>?@ AB CDEFGH IJ ", - " s789:;<=>?@ AB CDEFGH IJ ", - " t89:;<=>?@ AB CDEFGH IJ ", - " u89:;<=>?@ AB CDEFGH IJ ", - " v9:;<=>?@ AB CDEFGH IJ ", - " w9:;<=>?@ AB CDEFGH IJ ", - " x9:;<=>?@ AB CDEFGH IJ ", - " y9:;<=>?@ AB CDEFGH IJ ", - " z:;<=>?@ AB CDEFGH IJ ", - " {:;<=>?@ AB CDEFGH IJ ", - " |;<=>?@ AB CDEFGH IJ ", - " };<=>?@ AB CDEFGH IJ ", - " ~;<=>?@ AB CDEFGH IJ ", - " =>?@ AB CDEFGH IJ ", - "€456789:;<=>?@ AB CDEFGH IJ", - " ‚ EFGH IJ ", - " ƒ EFGH IJ ", - " ", - " „ GH IJ ", - " … GH IJ ", - " i † ", - " i ‡ ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "o456789:;<=>?@ ABŒqCDEFGH IJ ", - " ", - " " - ], p.productions = [ - [1, 1, 2], - [2, 1, 3], - [3, 1, 4], - [3, 3, 3, -9, 4], - [4, 1, 5], - [4, 3, 4, -8, 5], - [5, 1, 6], - [5, 3, 5, -22, 6], - [5, 3, 5, -5, 6], - [6, 1, 7], - [6, 3, 6, -23, 7], - [6, 3, 6, -24, 7], - [6, 3, 6, -6, 7], - [6, 3, 6, -7, 7], - [7, 1, 8], - [7, 3, 7, -25, 8], - [7, 3, 7, -26, 8], - [8, 1, 9], - [8, 3, 8, -12, 9], - [8, 3, 8, -11, 9], - [8, 3, 8, -10, 9], - [9, 1, 10], - [9, 2, -26, 9], - [10, 1, 11], - [10, 3, 10, -27, 11], - [11, 1, 12], - [11, 1, 13], - [11, 3, 13, -28, 14], - [11, 3, 13, -4, 14], - [13, 1, 15], - [13, 2, 13, 16], - [15, 1, 17], - [15, 3, -29, 2, -30], - [15, 1, -15], - [15, 1, -16], - [15, 1, 18], - [18, 3, -13, -29, -30], - [18, 4, -13, -29, 19, -30], - [19, 1, 20], - [19, 3, 20, -31, 19], - [20, 1, 2], - [12, 1, 14], - [12, 1, 21], - [21, 1, -28], - [21, 2, -28, 14], - [21, 1, 22], - [14, 1, 23], - [14, 3, 14, -28, 23], - [14, 1, 24], - [23, 2, 25, 26], - [23, 1, 26], - [23, 3, 25, 26, 27], - [23, 2, 26, 27], - [23, 1, 28], - [27, 1, 16], - [27, 2, 16, 27], - [25, 2, -14, -3], - [25, 1, -32], - [26, 1, 29], - [26, 3, -20, -29, -30], - [26, 4, -21, -29, -15, -30], - [16, 3, -33, 30, -34], - [30, 1, 2], - [22, 2, -4, 14], - [24, 3, 14, -4, 23], - [28, 1, -35], - [28, 1, -2], - [17, 2, -36, -18], - [29, 1, -17], - [29, 1, -19], - [29, 1, -18] - ], p.DOUBLEDOT = 2, p.DOUBLECOLON = 3, p.DOUBLESLASH = 4, p.NOTEQUAL = 5, p.LESSTHANOREQUAL = 6, p.GREATERTHANOREQUAL = 7, p.AND = 8, p.OR = 9, p.MOD = 10, p.DIV = 11, p.MULTIPLYOPERATOR = 12, p.FUNCTIONNAME = 13, p.AXISNAME = 14, p.LITERAL = 15, p.NUMBER = 16, p.ASTERISKNAMETEST = 17, p.QNAME = 18, p.NCNAMECOLONASTERISK = 19, p.NODETYPE = 20, p.PROCESSINGINSTRUCTIONWITHLITERAL = 21, p.EQUALS = 22, p.LESSTHAN = 23, p.GREATERTHAN = 24, p.PLUS = 25, p.MINUS = 26, p.BAR = 27, p.SLASH = 28, p.LEFTPARENTHESIS = 29, p.RIGHTPARENTHESIS = 30, p.COMMA = 31, p.AT = 32, p.LEFTBRACKET = 33, p.RIGHTBRACKET = 34, p.DOT = 35, p.DOLLAR = 36, p.prototype.tokenize = function(e) { - for (var r = [], o = [], a = e + "\0", i = 0, l = a.charAt(i++); ; ) { - for (; l == " " || l == " " || l == "\r" || l == ` -`; ) - l = a.charAt(i++); - if (l == "\0" || i >= a.length) - break; - if (l == "(") { - r.push(p.LEFTPARENTHESIS), o.push(l), l = a.charAt(i++); - continue; - } - if (l == ")") { - r.push(p.RIGHTPARENTHESIS), o.push(l), l = a.charAt(i++); - continue; - } - if (l == "[") { - r.push(p.LEFTBRACKET), o.push(l), l = a.charAt(i++); - continue; - } - if (l == "]") { - r.push(p.RIGHTBRACKET), o.push(l), l = a.charAt(i++); - continue; - } - if (l == "@") { - r.push(p.AT), o.push(l), l = a.charAt(i++); - continue; - } - if (l == ",") { - r.push(p.COMMA), o.push(l), l = a.charAt(i++); - continue; - } - if (l == "|") { - r.push(p.BAR), o.push(l), l = a.charAt(i++); - continue; - } - if (l == "+") { - r.push(p.PLUS), o.push(l), l = a.charAt(i++); - continue; - } - if (l == "-") { - r.push(p.MINUS), o.push(l), l = a.charAt(i++); - continue; - } - if (l == "=") { - r.push(p.EQUALS), o.push(l), l = a.charAt(i++); - continue; - } - if (l == "$") { - r.push(p.DOLLAR), o.push(l), l = a.charAt(i++); - continue; - } - if (l == ".") { - if (l = a.charAt(i++), l == ".") { - r.push(p.DOUBLEDOT), o.push(".."), l = a.charAt(i++); - continue; - } - if (l >= "0" && l <= "9") { - var g = "." + l; - for (l = a.charAt(i++); l >= "0" && l <= "9"; ) - g += l, l = a.charAt(i++); - r.push(p.NUMBER), o.push(g); - continue; - } - r.push(p.DOT), o.push("."); - continue; - } - if (l == "'" || l == '"') { - for (var I = l, L = ""; i < a.length && (l = a.charAt(i)) !== I; ) - L += l, i += 1; - if (l !== I) - throw be.fromMessage("Unterminated string literal: " + I + L); - i += 1, r.push(p.LITERAL), o.push(L), l = a.charAt(i++); - continue; - } - if (l >= "0" && l <= "9") { - var g = l; - for (l = a.charAt(i++); l >= "0" && l <= "9"; ) - g += l, l = a.charAt(i++); - if (l == "." && a.charAt(i) >= "0" && a.charAt(i) <= "9") - for (g += l, g += a.charAt(i++), l = a.charAt(i++); l >= "0" && l <= "9"; ) - g += l, l = a.charAt(i++); - r.push(p.NUMBER), o.push(g); - continue; - } - if (l == "*") { - if (r.length > 0) { - var D = r[r.length - 1]; - if (D != p.AT && D != p.DOUBLECOLON && D != p.LEFTPARENTHESIS && D != p.LEFTBRACKET && D != p.AND && D != p.OR && D != p.MOD && D != p.DIV && D != p.MULTIPLYOPERATOR && D != p.SLASH && D != p.DOUBLESLASH && D != p.BAR && D != p.PLUS && D != p.MINUS && D != p.EQUALS && D != p.NOTEQUAL && D != p.LESSTHAN && D != p.LESSTHANOREQUAL && D != p.GREATERTHAN && D != p.GREATERTHANOREQUAL) { - r.push(p.MULTIPLYOPERATOR), o.push(l), l = a.charAt(i++); - continue; - } - } - r.push(p.ASTERISKNAMETEST), o.push(l), l = a.charAt(i++); - continue; - } - if (l == ":" && a.charAt(i) == ":") { - r.push(p.DOUBLECOLON), o.push("::"), i++, l = a.charAt(i++); - continue; - } - if (l == "/") { - if (l = a.charAt(i++), l == "/") { - r.push(p.DOUBLESLASH), o.push("//"), l = a.charAt(i++); - continue; - } - r.push(p.SLASH), o.push("/"); - continue; - } - if (l == "!" && a.charAt(i) == "=") { - r.push(p.NOTEQUAL), o.push("!="), i++, l = a.charAt(i++); - continue; - } - if (l == "<") { - if (a.charAt(i) == "=") { - r.push(p.LESSTHANOREQUAL), o.push("<="), i++, l = a.charAt(i++); - continue; - } - r.push(p.LESSTHAN), o.push("<"), l = a.charAt(i++); - continue; - } - if (l == ">") { - if (a.charAt(i) == "=") { - r.push(p.GREATERTHANOREQUAL), o.push(">="), i++, l = a.charAt(i++); - continue; - } - r.push(p.GREATERTHAN), o.push(">"), l = a.charAt(i++); - continue; - } - if (l == "_" || v.isLetter(l.charCodeAt(0))) { - var B = l; - for (l = a.charAt(i++); v.isNCNameChar(l.charCodeAt(0)); ) - B += l, l = a.charAt(i++); - if (r.length > 0) { - var D = r[r.length - 1]; - if (D != p.AT && D != p.DOUBLECOLON && D != p.LEFTPARENTHESIS && D != p.LEFTBRACKET && D != p.AND && D != p.OR && D != p.MOD && D != p.DIV && D != p.MULTIPLYOPERATOR && D != p.SLASH && D != p.DOUBLESLASH && D != p.BAR && D != p.PLUS && D != p.MINUS && D != p.EQUALS && D != p.NOTEQUAL && D != p.LESSTHAN && D != p.LESSTHANOREQUAL && D != p.GREATERTHAN && D != p.GREATERTHANOREQUAL) { - if (B == "and") { - r.push(p.AND), o.push(B); - continue; - } - if (B == "or") { - r.push(p.OR), o.push(B); - continue; - } - if (B == "mod") { - r.push(p.MOD), o.push(B); - continue; - } - if (B == "div") { - r.push(p.DIV), o.push(B); - continue; - } - } - } - if (l == ":") { - if (a.charAt(i) == "*") { - r.push(p.NCNAMECOLONASTERISK), o.push(B + ":*"), i++, l = a.charAt(i++); - continue; - } - if (a.charAt(i) == "_" || v.isLetter(a.charCodeAt(i))) { - for (B += ":", l = a.charAt(i++); v.isNCNameChar(l.charCodeAt(0)); ) - B += l, l = a.charAt(i++); - if (l == "(") { - r.push(p.FUNCTIONNAME), o.push(B); - continue; - } - r.push(p.QNAME), o.push(B); - continue; - } - if (a.charAt(i) == ":") { - r.push(p.AXISNAME), o.push(B); - continue; - } - } - if (l == "(") { - if (B == "comment" || B == "text" || B == "node") { - r.push(p.NODETYPE), o.push(B); - continue; - } - if (B == "processing-instruction") { - a.charAt(i) == ")" ? r.push(p.NODETYPE) : r.push(p.PROCESSINGINSTRUCTIONWITHLITERAL), o.push(B); - continue; - } - r.push(p.FUNCTIONNAME), o.push(B); - continue; - } - r.push(p.QNAME), o.push(B); - continue; - } - throw new Error("Unexpected character " + l); - } - return r.push(1), o.push("[EOF]"), [r, o]; - }, p.SHIFT = "s", p.REDUCE = "r", p.ACCEPT = "a", p.prototype.parse = function(L) { - if (!L) - throw new Error("XPath expression unspecified."); - if (typeof L != "string") - throw new Error("XPath expression must be a string."); - var r, o, a = this.tokenize(L); - if (a != null) { - r = a[0], o = a[1]; - var i = 0, l = [], g = [], I = [], L, D, B; - for (l.push(0), g.push(1), I.push("_S"), D = r[i], B = o[i++]; ; ) - switch (L = l[l.length - 1], p.actionTable[L].charAt(D - 1)) { - case p.SHIFT: - g.push(-D), I.push(B), l.push(p.actionTableNumber[L].charCodeAt(D - 1) - 32), D = r[i], B = o[i++]; - break; - case p.REDUCE: - for (var Ie = p.productions[p.actionTableNumber[L].charCodeAt(D - 1) - 32][1], je = [], ze = 0; ze < Ie; ze++) - g.pop(), je.unshift(I.pop()), l.pop(); - var Ye = l[l.length - 1]; - g.push(p.productions[p.actionTableNumber[L].charCodeAt(D - 1) - 32][0]), this.reduceActions[p.actionTableNumber[L].charCodeAt(D - 1) - 32] == null ? I.push(je[0]) : I.push(this.reduceActions[p.actionTableNumber[L].charCodeAt(D - 1) - 32](je)), l.push(p.gotoTable[Ye].charCodeAt(p.productions[p.actionTableNumber[L].charCodeAt(D - 1) - 32][0] - 2) - 33); - break; - case p.ACCEPT: - return new Z(I.pop()); - default: - throw new Error("XPath parse error"); - } - } - }, Z.prototype = new Object(), Z.prototype.constructor = Z, Z.superclass = Object.prototype; - function Z(e) { - this.expression = e; - } - Z.prototype.toString = function() { - return this.expression.toString(); - }; - function ee(e, r, o) { - r in e || (e[r] = o); - } - Z.prototype.evaluate = function(e) { - var r = e.expressionContextNode; - if (!(c(r) || A(r))) - throw new Error("Context node does not appear to be a valid DOM node."); - return e.contextNode = e.expressionContextNode, e.contextSize = 1, e.contextPosition = 1, e.isHtml && (ee(e, "caseInsensitive", !0), ee(e, "allowAnyNamespaceForNoPrefix", !0)), ee(e, "caseInsensitive", !1), this.expression.evaluate(e); - }, Z.XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace", Z.XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/", U.prototype = new Object(), U.prototype.constructor = U, U.superclass = Object.prototype; - function U() { - } - U.prototype.init = function() { - }, U.prototype.toString = function() { - return ""; - }, U.prototype.evaluate = function(e) { - throw new Error("Could not evaluate expression."); - }, X.prototype = new U(), X.prototype.constructor = X, X.superclass = U.prototype; - function X(e) { - arguments.length > 0 && this.init(e); - } - X.prototype.init = function(e) { - this.rhs = e; - }, le.prototype = new X(), le.prototype.constructor = le, le.superclass = X.prototype; - function le(e) { - arguments.length > 0 && this.init(e); - } - le.prototype.init = function(e) { - le.superclass.init.call(this, e); - }, le.prototype.evaluate = function(e) { - return this.rhs.evaluate(e).number().negate(); - }, le.prototype.toString = function() { - return "-" + this.rhs.toString(); - }, R.prototype = new U(), R.prototype.constructor = R, R.superclass = U.prototype; - function R(e, r) { - arguments.length > 0 && this.init(e, r); - } - R.prototype.init = function(e, r) { - this.lhs = e, this.rhs = r; - }, ue.prototype = new R(), ue.prototype.constructor = ue, ue.superclass = R.prototype; - function ue(e, r) { - arguments.length > 0 && this.init(e, r); - } - ue.prototype.init = function(e, r) { - ue.superclass.init.call(this, e, r); - }, ue.prototype.toString = function() { - return "(" + this.lhs.toString() + " or " + this.rhs.toString() + ")"; - }, ue.prototype.evaluate = function(e) { - var r = this.lhs.evaluate(e).bool(); - return r.booleanValue() ? r : this.rhs.evaluate(e).bool(); - }, pe.prototype = new R(), pe.prototype.constructor = pe, pe.superclass = R.prototype; - function pe(e, r) { - arguments.length > 0 && this.init(e, r); - } - pe.prototype.init = function(e, r) { - pe.superclass.init.call(this, e, r); - }, pe.prototype.toString = function() { - return "(" + this.lhs.toString() + " and " + this.rhs.toString() + ")"; - }, pe.prototype.evaluate = function(e) { - var r = this.lhs.evaluate(e).bool(); - return r.booleanValue() ? this.rhs.evaluate(e).bool() : r; - }, M.prototype = new R(), M.prototype.constructor = M, M.superclass = R.prototype; - function M(e, r) { - arguments.length > 0 && this.init(e, r); - } - M.prototype.init = function(e, r) { - M.superclass.init.call(this, e, r); - }, M.prototype.toString = function() { - return "(" + this.lhs.toString() + " = " + this.rhs.toString() + ")"; - }, M.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).equals(this.rhs.evaluate(e)); - }, j.prototype = new R(), j.prototype.constructor = j, j.superclass = R.prototype; - function j(e, r) { - arguments.length > 0 && this.init(e, r); - } - j.prototype.init = function(e, r) { - j.superclass.init.call(this, e, r); - }, j.prototype.toString = function() { - return "(" + this.lhs.toString() + " != " + this.rhs.toString() + ")"; - }, j.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).notequal(this.rhs.evaluate(e)); - }, ce.prototype = new R(), ce.prototype.constructor = ce, ce.superclass = R.prototype; - function ce(e, r) { - arguments.length > 0 && this.init(e, r); - } - ce.prototype.init = function(e, r) { - ce.superclass.init.call(this, e, r); - }, ce.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).lessthan(this.rhs.evaluate(e)); - }, ce.prototype.toString = function() { - return "(" + this.lhs.toString() + " < " + this.rhs.toString() + ")"; - }, Ae.prototype = new R(), Ae.prototype.constructor = Ae, Ae.superclass = R.prototype; - function Ae(e, r) { - arguments.length > 0 && this.init(e, r); - } - Ae.prototype.init = function(e, r) { - Ae.superclass.init.call(this, e, r); - }, Ae.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).greaterthan(this.rhs.evaluate(e)); - }, Ae.prototype.toString = function() { - return "(" + this.lhs.toString() + " > " + this.rhs.toString() + ")"; - }, De.prototype = new R(), De.prototype.constructor = De, De.superclass = R.prototype; - function De(e, r) { - arguments.length > 0 && this.init(e, r); - } - De.prototype.init = function(e, r) { - De.superclass.init.call(this, e, r); - }, De.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).lessthanorequal(this.rhs.evaluate(e)); - }, De.prototype.toString = function() { - return "(" + this.lhs.toString() + " <= " + this.rhs.toString() + ")"; - }, ge.prototype = new R(), ge.prototype.constructor = ge, ge.superclass = R.prototype; - function ge(e, r) { - arguments.length > 0 && this.init(e, r); - } - ge.prototype.init = function(e, r) { - ge.superclass.init.call(this, e, r); - }, ge.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).greaterthanorequal(this.rhs.evaluate(e)); - }, ge.prototype.toString = function() { - return "(" + this.lhs.toString() + " >= " + this.rhs.toString() + ")"; - }, de.prototype = new R(), de.prototype.constructor = de, de.superclass = R.prototype; - function de(e, r) { - arguments.length > 0 && this.init(e, r); - } - de.prototype.init = function(e, r) { - de.superclass.init.call(this, e, r); - }, de.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).number().plus(this.rhs.evaluate(e).number()); - }, de.prototype.toString = function() { - return "(" + this.lhs.toString() + " + " + this.rhs.toString() + ")"; - }, me.prototype = new R(), me.prototype.constructor = me, me.superclass = R.prototype; - function me(e, r) { - arguments.length > 0 && this.init(e, r); - } - me.prototype.init = function(e, r) { - me.superclass.init.call(this, e, r); - }, me.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).number().minus(this.rhs.evaluate(e).number()); - }, me.prototype.toString = function() { - return "(" + this.lhs.toString() + " - " + this.rhs.toString() + ")"; - }, Ne.prototype = new R(), Ne.prototype.constructor = Ne, Ne.superclass = R.prototype; - function Ne(e, r) { - arguments.length > 0 && this.init(e, r); - } - Ne.prototype.init = function(e, r) { - Ne.superclass.init.call(this, e, r); - }, Ne.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).number().multiply(this.rhs.evaluate(e).number()); - }, Ne.prototype.toString = function() { - return "(" + this.lhs.toString() + " * " + this.rhs.toString() + ")"; - }, ve.prototype = new R(), ve.prototype.constructor = ve, ve.superclass = R.prototype; - function ve(e, r) { - arguments.length > 0 && this.init(e, r); - } - ve.prototype.init = function(e, r) { - ve.superclass.init.call(this, e, r); - }, ve.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).number().div(this.rhs.evaluate(e).number()); - }, ve.prototype.toString = function() { - return "(" + this.lhs.toString() + " div " + this.rhs.toString() + ")"; - }, xe.prototype = new R(), xe.prototype.constructor = xe, xe.superclass = R.prototype; - function xe(e, r) { - arguments.length > 0 && this.init(e, r); - } - xe.prototype.init = function(e, r) { - xe.superclass.init.call(this, e, r); - }, xe.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).number().mod(this.rhs.evaluate(e).number()); - }, xe.prototype.toString = function() { - return "(" + this.lhs.toString() + " mod " + this.rhs.toString() + ")"; - }, Ce.prototype = new R(), Ce.prototype.constructor = Ce, Ce.superclass = R.prototype; - function Ce(e, r) { - arguments.length > 0 && this.init(e, r); - } - Ce.prototype.init = function(e, r) { - Ce.superclass.init.call(this, e, r); - }, Ce.prototype.evaluate = function(e) { - return this.lhs.evaluate(e).nodeset().union(this.rhs.evaluate(e).nodeset()); - }, Ce.prototype.toString = function() { - return S(J, [this.lhs, this.rhs]).join(" | "); - }, _.prototype = new U(), _.prototype.constructor = _, _.superclass = U.prototype; - function _(e, r, o) { - arguments.length > 0 && this.init(e, r, o); - } - _.prototype.init = function(e, r, o) { - _.superclass.init.call(this), this.filter = e, this.filterPredicates = r, this.locationPath = o; - }; - function It(e) { - for (; e && e.parentNode; ) - e = e.parentNode; - return e; - } - var Vr = function(e, r, o, a) { - if (e.length === 0) - return o; - var i = r.extend({}); - return w( - function(l, g) { - return i.contextSize = l.length, k( - function(I, L) { - return i.contextNode = I, i.contextPosition = L + 1, _.predicateMatches(g, i); - }, - l - ); - }, - He(o, a), - e - ); - }; - _.getRoot = function(e, r) { - var o = r[0]; - if (o && o.nodeType === x.DOCUMENT_NODE) - return o; - if (e.virtualRoot) - return e.virtualRoot; - if (!o) - throw new Error("Context node not found when determining document root."); - var a = o.ownerDocument; - if (a) - return a; - for (var i = o; i.parentNode != null; ) - i = i.parentNode; - return i; - }; - var Lt = function(e) { - var r = String(e.name); - return r === "xmlns" ? "" : r.substring(0, 6) === "xmlns:" ? r.substring(6, r.length) : null; - }; - _.applyStep = function(e, r, o) { - if (!o) - throw new Error("Context node not found when evaluating XPath step: " + e); - var a = []; - switch (r.contextNode = o, e.axis) { - case E.ANCESTOR: - if (r.contextNode === r.virtualRoot) - break; - var i; - for (r.contextNode.nodeType == x.ATTRIBUTE_NODE ? i = _.getOwnerElement(r.contextNode) : i = r.contextNode.parentNode; i != null && (e.nodeTest.matches(i, r) && a.push(i), i !== r.virtualRoot); ) - i = i.parentNode; - break; - case E.ANCESTORORSELF: - for (var i = r.contextNode; i != null && (e.nodeTest.matches(i, r) && a.push(i), i !== r.virtualRoot); i = i.nodeType == x.ATTRIBUTE_NODE ? _.getOwnerElement(i) : i.parentNode) - ; - break; - case E.ATTRIBUTE: - var l = r.contextNode.attributes; - if (l != null) - for (var g = 0; g < l.length; g++) { - var i = l.item(g); - e.nodeTest.matches(i, r) && a.push(i); - } - break; - case E.CHILD: - for (var i = r.contextNode.firstChild; i != null; i = i.nextSibling) - e.nodeTest.matches(i, r) && a.push(i); - break; - case E.DESCENDANT: - for (var B = [r.contextNode.firstChild]; B.length > 0; ) - for (var i = B.pop(); i != null; ) - e.nodeTest.matches(i, r) && a.push(i), i.firstChild != null ? (B.push(i.nextSibling), i = i.firstChild) : i = i.nextSibling; - break; - case E.DESCENDANTORSELF: - e.nodeTest.matches(r.contextNode, r) && a.push(r.contextNode); - for (var B = [r.contextNode.firstChild]; B.length > 0; ) - for (var i = B.pop(); i != null; ) - e.nodeTest.matches(i, r) && a.push(i), i.firstChild != null ? (B.push(i.nextSibling), i = i.firstChild) : i = i.nextSibling; - break; - case E.FOLLOWING: - if (r.contextNode === r.virtualRoot) - break; - var B = []; - r.contextNode.firstChild != null ? B.unshift(r.contextNode.firstChild) : B.unshift(r.contextNode.nextSibling); - for (var i = r.contextNode.parentNode; i != null && i.nodeType != x.DOCUMENT_NODE && i !== r.virtualRoot; i = i.parentNode) - B.unshift(i.nextSibling); - do - for (var i = B.pop(); i != null; ) - e.nodeTest.matches(i, r) && a.push(i), i.firstChild != null ? (B.push(i.nextSibling), i = i.firstChild) : i = i.nextSibling; - while (B.length > 0); - break; - case E.FOLLOWINGSIBLING: - if (r.contextNode === r.virtualRoot) - break; - for (var i = r.contextNode.nextSibling; i != null; i = i.nextSibling) - e.nodeTest.matches(i, r) && a.push(i); - break; - case E.NAMESPACE: - var I = {}; - if (r.contextNode.nodeType == x.ELEMENT_NODE) { - I.xml = new Xe("xml", null, Z.XML_NAMESPACE_URI, r.contextNode); - for (var i = r.contextNode; i != null && i.nodeType == x.ELEMENT_NODE; i = i.parentNode) - for (var g = 0; g < i.attributes.length; g++) { - var L = i.attributes.item(g), D = Lt(L); - D != null && I[D] == null && (I[D] = new Xe(D, L, L.value, r.contextNode)); - } - for (var D in I) { - var o = I[D]; - e.nodeTest.matches(o, r) && a.push(o); - } - } - break; - case E.PARENT: - i = null, r.contextNode !== r.virtualRoot && (r.contextNode.nodeType == x.ATTRIBUTE_NODE ? i = _.getOwnerElement(r.contextNode) : i = r.contextNode.parentNode), i != null && e.nodeTest.matches(i, r) && a.push(i); - break; - case E.PRECEDING: - var B; - r.virtualRoot != null ? B = [r.virtualRoot] : B = [It(r.contextNode)]; - e: - for (; B.length > 0; ) - for (var i = B.pop(); i != null; ) { - if (i == r.contextNode) - break e; - e.nodeTest.matches(i, r) && a.unshift(i), i.firstChild != null ? (B.push(i.nextSibling), i = i.firstChild) : i = i.nextSibling; - } - break; - case E.PRECEDINGSIBLING: - if (r.contextNode === r.virtualRoot) - break; - for (var i = r.contextNode.previousSibling; i != null; i = i.previousSibling) - e.nodeTest.matches(i, r) && a.push(i); - break; - case E.SELF: - e.nodeTest.matches(r.contextNode, r) && a.push(r.contextNode); - break; - } - return a; - }; - function Pt(e, r, o) { - return Vr( - e.predicates, - r, - _.applyStep(e, r, o), - q(Mt, e.axis) - ); - } - function qt(e, r, o) { - return te( - S( - Pt.bind(null, o, e), - r - ) - ); - } - _.applySteps = function(e, r, o) { - return w( - qt.bind(null, r), - o, - e - ); - }, _.prototype.applyFilter = function(e, r) { - if (!this.filter) - return { nodes: [e.contextNode] }; - var o = this.filter.evaluate(e); - if (!v.instance_of(o, m)) { - if (this.filterPredicates != null && this.filterPredicates.length > 0 || this.locationPath != null) - throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used"); - return { nonNodes: o }; - } - return { - nodes: Vr( - this.filterPredicates || [], - r, - o.toUnsortedArray(), - !1 - // reverse - ) - }; - }, _.applyLocationPath = function(e, r, o) { - if (!e) - return o; - var a = e.absolute ? [_.getRoot(r, o)] : o; - return _.applySteps(e.steps, r, a); - }, _.prototype.evaluate = function(e) { - var r = Se(new Te(), e), o = this.applyFilter(e, r); - if ("nonNodes" in o) - return o.nonNodes; - var a = new m(); - return a.addArray(_.applyLocationPath(this.locationPath, r, o.nodes)), a; - }, _.predicateMatches = function(e, r) { - var o = e.evaluate(r); - return v.instance_of(o, b) ? r.contextPosition === o.numberValue() : o.booleanValue(); - }, _.predicateString = function(e) { - return G("[", "]", e.toString()); - }, _.predicatesString = function(e) { - return H( - "", - S(_.predicateString, e) - ); - }, _.prototype.toString = function() { - if (this.filter != null) { - var e = J(this.filter); - return v.instance_of(this.filter, T) ? G("'", "'", e) : this.filterPredicates != null && this.filterPredicates.length ? G("(", ")", e) + _.predicatesString(this.filterPredicates) : this.locationPath != null ? e + (this.locationPath.absolute ? "" : "/") + J(this.locationPath) : e; - } - return J(this.locationPath); - }, _.getOwnerElement = function(e) { - if (e.ownerElement) - return e.ownerElement; - try { - if (e.selectSingleNode) - return e.selectSingleNode(".."); - } catch { - } - for (var r = e.nodeType == x.DOCUMENT_NODE ? e : e.ownerDocument, o = r.getElementsByTagName("*"), a = 0; a < o.length; a++) - for (var i = o.item(a), l = i.attributes, g = 0; g < l.length; g++) { - var I = l.item(g); - if (I === e) - return i; - } - return null; - }, Oe.prototype = new Object(), Oe.prototype.constructor = Oe, Oe.superclass = Object.prototype; - function Oe(e, r) { - arguments.length > 0 && this.init(e, r); - } - Oe.prototype.init = function(e, r) { - this.absolute = e, this.steps = r; - }, Oe.prototype.toString = function() { - return (this.absolute ? "/" : "") + S(J, this.steps).join("/"); - }, E.prototype = new Object(), E.prototype.constructor = E, E.superclass = Object.prototype; - function E(e, r, o) { - arguments.length > 0 && this.init(e, r, o); - } - E.prototype.init = function(e, r, o) { - this.axis = e, this.nodeTest = r, this.predicates = o; - }, E.prototype.toString = function() { - return E.STEPNAMES[this.axis] + "::" + this.nodeTest.toString() + _.predicatesString(this.predicates); - }, E.ANCESTOR = 0, E.ANCESTORORSELF = 1, E.ATTRIBUTE = 2, E.CHILD = 3, E.DESCENDANT = 4, E.DESCENDANTORSELF = 5, E.FOLLOWING = 6, E.FOLLOWINGSIBLING = 7, E.NAMESPACE = 8, E.PARENT = 9, E.PRECEDING = 10, E.PRECEDINGSIBLING = 11, E.SELF = 12, E.STEPNAMES = w(function(e, r) { - return e[r[0]] = r[1], e; - }, {}, [ - [E.ANCESTOR, "ancestor"], - [E.ANCESTORORSELF, "ancestor-or-self"], - [E.ATTRIBUTE, "attribute"], - [E.CHILD, "child"], - [E.DESCENDANT, "descendant"], - [E.DESCENDANTORSELF, "descendant-or-self"], - [E.FOLLOWING, "following"], - [E.FOLLOWINGSIBLING, "following-sibling"], - [E.NAMESPACE, "namespace"], - [E.PARENT, "parent"], - [E.PRECEDING, "preceding"], - [E.PRECEDINGSIBLING, "preceding-sibling"], - [E.SELF, "self"] - ]); - var Mt = [ - E.ANCESTOR, - E.ANCESTORORSELF, - E.PARENT, - E.PRECEDING, - E.PRECEDINGSIBLING - ]; - d.prototype = new Object(), d.prototype.constructor = d, d.superclass = Object.prototype; - function d(e, r) { - arguments.length > 0 && this.init(e, r); - } - d.prototype.init = function(e, r) { - this.type = e, this.value = r; - }, d.prototype.toString = function() { - return ""; - }, d.prototype.matches = function(e, r) { - console.warn("unknown node test type"); - }, d.NAMETESTANY = 0, d.NAMETESTPREFIXANY = 1, d.NAMETESTQNAME = 2, d.COMMENT = 3, d.TEXT = 4, d.PI = 5, d.NODE = 6, d.isNodeType = function(e) { - return function(r) { - return q(e, r.nodeType); - }; - }, d.makeNodeTestType = function(e, r, o) { - var a = o || function() { - }; - return a.prototype = new d(e), a.prototype.constructor = a, Se(a.prototype, r), a; - }, d.makeNodeTypeTest = function(e, r, o) { - return new (d.makeNodeTestType(e, { - matches: d.isNodeType(r), - toString: $(o) - }))(); - }, d.hasPrefix = function(e) { - return e.prefix || (e.nodeName || e.tagName).indexOf(":") !== -1; - }, d.isElementOrAttribute = d.isNodeType([1, 2]), d.nameSpaceMatches = function(e, r, o) { - var a = o.namespaceURI || ""; - if (!e) - return !a || r.allowAnyNamespaceForNoPrefix && !d.hasPrefix(o); - var i = r.namespaceResolver.getNamespace(e, r.expressionContextNode); - if (i == null) - throw new Error("Cannot resolve QName " + e); - return i === a; - }, d.localNameMatches = function(e, r, o) { - var a = o.localName || o.nodeName; - return r.caseInsensitive ? e.toLowerCase() === a.toLowerCase() : e === a; - }, d.NameTestPrefixAny = d.makeNodeTestType( - d.NAMETESTPREFIXANY, - { - matches: function(e, r) { - return d.isElementOrAttribute(e) && d.nameSpaceMatches(this.prefix, r, e); - }, - toString: function() { - return this.prefix + ":*"; - } - }, - function(r) { - this.prefix = r; - } - ), d.NameTestQName = d.makeNodeTestType( - d.NAMETESTQNAME, - { - matches: function(e, r) { - return d.isNodeType( - [ - x.ELEMENT_NODE, - x.ATTRIBUTE_NODE, - x.NAMESPACE_NODE - ] - )(e) && d.nameSpaceMatches(this.prefix, r, e) && d.localNameMatches(this.localName, r, e); - }, - toString: function() { - return this.name; - } - }, - function(r) { - var o = r.split(":"); - this.name = r, this.prefix = o.length > 1 ? o[0] : null, this.localName = o[o.length > 1 ? 1 : 0]; - } - ), d.PITest = d.makeNodeTestType(d.PI, { - matches: function(e, r) { - return d.isNodeType( - [x.PROCESSING_INSTRUCTION_NODE] - )(e) && (e.target || e.nodeName) === this.name; - }, - toString: function() { - return G('processing-instruction("', '")', this.name); - } - }, function(e) { - this.name = e; - }), d.nameTestAny = d.makeNodeTypeTest( - d.NAMETESTANY, - [ - x.ELEMENT_NODE, - x.ATTRIBUTE_NODE, - x.NAMESPACE_NODE - ], - "*" - ), d.textTest = d.makeNodeTypeTest( - d.TEXT, - [ - x.TEXT_NODE, - x.CDATA_SECTION_NODE - ], - "text()" - ), d.commentTest = d.makeNodeTypeTest( - d.COMMENT, - [x.COMMENT_NODE], - "comment()" - ), d.nodeTest = d.makeNodeTypeTest( - d.NODE, - [ - x.ELEMENT_NODE, - x.ATTRIBUTE_NODE, - x.TEXT_NODE, - x.CDATA_SECTION_NODE, - x.PROCESSING_INSTRUCTION_NODE, - x.COMMENT_NODE, - x.DOCUMENT_NODE - ], - "node()" - ), d.anyPiTest = d.makeNodeTypeTest( - d.PI, - [x.PROCESSING_INSTRUCTION_NODE], - "processing-instruction()" - ), Fe.prototype = new U(), Fe.prototype.constructor = Fe, Fe.superclass = U.prototype; - function Fe(e) { - arguments.length > 0 && this.init(e); - } - Fe.prototype.init = function(e) { - this.variable = e; - }, Fe.prototype.toString = function() { - return "$" + this.variable; - }, Fe.prototype.evaluate = function(e) { - var r = v.resolveQName(this.variable, e.namespaceResolver, e.contextNode, !1); - if (r[0] == null) - throw new Error("Cannot resolve QName " + fn); - var o = e.variableResolver.getVariable(r[1], r[0]); - if (!o) - throw be.fromMessage("Undeclared variable: " + this.toString()); - return o; - }, ye.prototype = new U(), ye.prototype.constructor = ye, ye.superclass = U.prototype; - function ye(e, r) { - arguments.length > 0 && this.init(e, r); - } - ye.prototype.init = function(e, r) { - this.functionName = e, this.arguments = r; - }, ye.prototype.toString = function() { - for (var e = this.functionName + "(", r = 0; r < this.arguments.length; r++) - r > 0 && (e += ", "), e += this.arguments[r].toString(); - return e + ")"; - }, ye.prototype.evaluate = function(e) { - var r = fe.getFunctionFromContext(this.functionName, e); - if (!r) - throw new Error("Unknown function " + this.functionName); - var o = [e].concat(this.arguments); - return r.apply(e.functionResolver.thisArg, o); - }; - var W = new Object(); - W.equals = function(e, r) { - return e.equals(r); - }, W.notequal = function(e, r) { - return e.notequal(r); - }, W.lessthan = function(e, r) { - return e.lessthan(r); - }, W.greaterthan = function(e, r) { - return e.greaterthan(r); - }, W.lessthanorequal = function(e, r) { - return e.lessthanorequal(r); - }, W.greaterthanorequal = function(e, r) { - return e.greaterthanorequal(r); - }, T.prototype = new U(), T.prototype.constructor = T, T.superclass = U.prototype; - function T(e) { - arguments.length > 0 && this.init(e); - } - T.prototype.init = function(e) { - this.str = String(e); - }, T.prototype.toString = function() { - return this.str; - }, T.prototype.evaluate = function(e) { - return this; - }, T.prototype.string = function() { - return this; - }, T.prototype.number = function() { - return new b(this.str); - }, T.prototype.bool = function() { - return new C(this.str); - }, T.prototype.nodeset = function() { - throw new Error("Cannot convert string to nodeset"); - }, T.prototype.stringValue = function() { - return this.str; - }, T.prototype.numberValue = function() { - return this.number().numberValue(); - }, T.prototype.booleanValue = function() { - return this.bool().booleanValue(); - }, T.prototype.equals = function(e) { - return v.instance_of(e, C) ? this.bool().equals(e) : v.instance_of(e, b) ? this.number().equals(e) : v.instance_of(e, m) ? e.compareWithString(this, W.equals) : new C(this.str == e.str); - }, T.prototype.notequal = function(e) { - return v.instance_of(e, C) ? this.bool().notequal(e) : v.instance_of(e, b) ? this.number().notequal(e) : v.instance_of(e, m) ? e.compareWithString(this, W.notequal) : new C(this.str != e.str); - }, T.prototype.lessthan = function(e) { - return this.number().lessthan(e); - }, T.prototype.greaterthan = function(e) { - return this.number().greaterthan(e); - }, T.prototype.lessthanorequal = function(e) { - return this.number().lessthanorequal(e); - }, T.prototype.greaterthanorequal = function(e) { - return this.number().greaterthanorequal(e); - }, b.prototype = new U(), b.prototype.constructor = b, b.superclass = U.prototype; - function b(e) { - arguments.length > 0 && this.init(e); - } - b.prototype.init = function(e) { - this.num = typeof e == "string" ? this.parse(e) : Number(e); - }, b.prototype.numberFormat = /^\s*-?[0-9]*\.?[0-9]+\s*$/, b.prototype.parse = function(e) { - return this.numberFormat.test(e) ? parseFloat(e) : Number.NaN; - }; - function Ut(e) { - for (var r = e.split("e-"), o = r[0].replace(".", ""), a = Number(r[1]), i = 0; i < a - 1; i += 1) - o = "0" + o; - return "0." + o; - } - function Vt(e) { - for (var r = e.split("e"), o = r[0].replace(".", ""), a = Number(r[1]), i = a + 1 - o.length, l = 0; l < i; l += 1) - o += "0"; - return o; - } - b.prototype.toString = function() { - var e = this.num.toString(); - return e.indexOf("e-") !== -1 ? Ut(e) : e.indexOf("e") !== -1 ? Vt(e) : e; - }, b.prototype.evaluate = function(e) { - return this; - }, b.prototype.string = function() { - return new T(this.toString()); - }, b.prototype.number = function() { - return this; - }, b.prototype.bool = function() { - return new C(this.num); - }, b.prototype.nodeset = function() { - throw new Error("Cannot convert number to nodeset"); - }, b.prototype.stringValue = function() { - return this.string().stringValue(); - }, b.prototype.numberValue = function() { - return this.num; - }, b.prototype.booleanValue = function() { - return this.bool().booleanValue(); - }, b.prototype.negate = function() { - return new b(-this.num); - }, b.prototype.equals = function(e) { - return v.instance_of(e, C) ? this.bool().equals(e) : v.instance_of(e, T) ? this.equals(e.number()) : v.instance_of(e, m) ? e.compareWithNumber(this, W.equals) : new C(this.num == e.num); - }, b.prototype.notequal = function(e) { - return v.instance_of(e, C) ? this.bool().notequal(e) : v.instance_of(e, T) ? this.notequal(e.number()) : v.instance_of(e, m) ? e.compareWithNumber(this, W.notequal) : new C(this.num != e.num); - }, b.prototype.lessthan = function(e) { - return v.instance_of(e, m) ? e.compareWithNumber(this, W.greaterthan) : v.instance_of(e, C) || v.instance_of(e, T) ? this.lessthan(e.number()) : new C(this.num < e.num); - }, b.prototype.greaterthan = function(e) { - return v.instance_of(e, m) ? e.compareWithNumber(this, W.lessthan) : v.instance_of(e, C) || v.instance_of(e, T) ? this.greaterthan(e.number()) : new C(this.num > e.num); - }, b.prototype.lessthanorequal = function(e) { - return v.instance_of(e, m) ? e.compareWithNumber(this, W.greaterthanorequal) : v.instance_of(e, C) || v.instance_of(e, T) ? this.lessthanorequal(e.number()) : new C(this.num <= e.num); - }, b.prototype.greaterthanorequal = function(e) { - return v.instance_of(e, m) ? e.compareWithNumber(this, W.lessthanorequal) : v.instance_of(e, C) || v.instance_of(e, T) ? this.greaterthanorequal(e.number()) : new C(this.num >= e.num); - }, b.prototype.plus = function(e) { - return new b(this.num + e.num); - }, b.prototype.minus = function(e) { - return new b(this.num - e.num); - }, b.prototype.multiply = function(e) { - return new b(this.num * e.num); - }, b.prototype.div = function(e) { - return new b(this.num / e.num); - }, b.prototype.mod = function(e) { - return new b(this.num % e.num); - }, C.prototype = new U(), C.prototype.constructor = C, C.superclass = U.prototype; - function C(e) { - arguments.length > 0 && this.init(e); - } - C.prototype.init = function(e) { - this.b = !!e; - }, C.prototype.toString = function() { - return this.b.toString(); - }, C.prototype.evaluate = function(e) { - return this; - }, C.prototype.string = function() { - return new T(this.b); - }, C.prototype.number = function() { - return new b(this.b); - }, C.prototype.bool = function() { - return this; - }, C.prototype.nodeset = function() { - throw new Error("Cannot convert boolean to nodeset"); - }, C.prototype.stringValue = function() { - return this.string().stringValue(); - }, C.prototype.numberValue = function() { - return this.number().numberValue(); - }, C.prototype.booleanValue = function() { - return this.b; - }, C.prototype.not = function() { - return new C(!this.b); - }, C.prototype.equals = function(e) { - return v.instance_of(e, T) || v.instance_of(e, b) ? this.equals(e.bool()) : v.instance_of(e, m) ? e.compareWithBoolean(this, W.equals) : new C(this.b == e.b); - }, C.prototype.notequal = function(e) { - return v.instance_of(e, T) || v.instance_of(e, b) ? this.notequal(e.bool()) : v.instance_of(e, m) ? e.compareWithBoolean(this, W.notequal) : new C(this.b != e.b); - }, C.prototype.lessthan = function(e) { - return this.number().lessthan(e); - }, C.prototype.greaterthan = function(e) { - return this.number().greaterthan(e); - }, C.prototype.lessthanorequal = function(e) { - return this.number().lessthanorequal(e); - }, C.prototype.greaterthanorequal = function(e) { - return this.number().greaterthanorequal(e); - }, C.true_ = new C(!0), C.false_ = new C(!1), ne.prototype = new Object(), ne.prototype.constructor = ne, ne.superclass = Object.prototype; - function ne(e) { - this.init(e); - } - ne.prototype.init = function(e) { - this.left = null, this.right = null, this.node = e, this.depth = 1; - }, ne.prototype.balance = function() { - var e = this.left == null ? 0 : this.left.depth, r = this.right == null ? 0 : this.right.depth; - if (e > r + 1) { - var o = this.left.left == null ? 0 : this.left.left.depth, a = this.left.right == null ? 0 : this.left.right.depth; - o < a && this.left.rotateRR(), this.rotateLL(); - } else if (e + 1 < r) { - var i = this.right.right == null ? 0 : this.right.right.depth, l = this.right.left == null ? 0 : this.right.left.depth; - l > i && this.right.rotateLL(), this.rotateRR(); - } - }, ne.prototype.rotateLL = function() { - var e = this.node, r = this.right; - this.node = this.left.node, this.right = this.left, this.left = this.left.left, this.right.left = this.right.right, this.right.right = r, this.right.node = e, this.right.updateInNewLocation(), this.updateInNewLocation(); - }, ne.prototype.rotateRR = function() { - var e = this.node, r = this.left; - this.node = this.right.node, this.left = this.right, this.right = this.right.right, this.left.right = this.left.left, this.left.left = r, this.left.node = e, this.left.updateInNewLocation(), this.updateInNewLocation(); - }, ne.prototype.updateInNewLocation = function() { - this.getDepthFromChildren(); - }, ne.prototype.getDepthFromChildren = function() { - this.depth = this.node == null ? 0 : 1, this.left != null && (this.depth = this.left.depth + 1), this.right != null && this.depth <= this.right.depth && (this.depth = this.right.depth + 1); - }; - function kt(e, r) { - if (e === r) - return 0; - if (e.compareDocumentPosition) { - var o = e.compareDocumentPosition(r); - return o & 1 || o & 10 ? 1 : o & 20 ? -1 : 0; - } - for (var a = 0, i = 0, l = e; l != null; l = l.parentNode || l.ownerElement) - a++; - for (var g = r; g != null; g = g.parentNode || g.ownerElement) - i++; - if (a > i) { - for (; a > i; ) - e = e.parentNode || e.ownerElement, a--; - if (e === r) - return 1; - } else if (i > a) { - for (; i > a; ) - r = r.parentNode || r.ownerElement, i--; - if (e === r) - return -1; - } - for (var I = e.parentNode || e.ownerElement, L = r.parentNode || r.ownerElement; I !== L; ) - e = I, r = L, I = e.parentNode || e.ownerElement, L = r.parentNode || r.ownerElement; - var D = kr(e), B = kr(r); - if (D && !B) - return -1; - if (!D && B) - return 1; - if (e.isXPathNamespace) { - if (e.nodeValue === Z.XML_NAMESPACE_URI || !r.isXPathNamespace) - return -1; - if (r.nodeValue === Z.XML_NAMESPACE_URI) - return 1; - } else if (r.isXPathNamespace) - return 1; - if (I) - for (var Ie = D ? I.attributes : I.childNodes, je = Ie.length, ze = e.baseNode || e, Ye = r.baseNode || r, or = 0; or < je; or += 1) { - var ir = Ie[or]; - if (ir === ze) - return -1; - if (ir === Ye) - return 1; - } - throw new Error("Unexpected: could not determine node order"); - } - ne.prototype.add = function(e) { - if (e === this.node) - return !1; - var r = kt(e, this.node), o = !1; - return r == -1 ? this.left == null ? (this.left = new ne(e), o = !0) : (o = this.left.add(e), o && this.balance()) : r == 1 && (this.right == null ? (this.right = new ne(e), o = !0) : (o = this.right.add(e), o && this.balance())), o && this.getDepthFromChildren(), o; - }, m.prototype = new U(), m.prototype.constructor = m, m.superclass = U.prototype; - function m() { - this.init(); - } - m.prototype.init = function() { - this.tree = null, this.nodes = [], this.size = 0; - }, m.prototype.toString = function() { - var e = this.first(); - return e == null ? "" : this.stringForNode(e); - }, m.prototype.evaluate = function(e) { - return this; - }, m.prototype.string = function() { - return new T(this.toString()); - }, m.prototype.stringValue = function() { - return this.toString(); - }, m.prototype.number = function() { - return new b(this.string()); - }, m.prototype.numberValue = function() { - return Number(this.string()); - }, m.prototype.bool = function() { - return new C(this.booleanValue()); - }, m.prototype.booleanValue = function() { - return !!this.size; - }, m.prototype.nodeset = function() { - return this; - }, m.prototype.stringForNode = function(e) { - return e.nodeType == x.DOCUMENT_NODE || e.nodeType == x.ELEMENT_NODE || e.nodeType === x.DOCUMENT_FRAGMENT_NODE ? this.stringForContainerNode(e) : e.nodeType === x.ATTRIBUTE_NODE ? e.value || e.nodeValue : e.isNamespaceNode ? e.namespace : e.nodeValue; - }, m.prototype.stringForContainerNode = function(e) { - for (var r = "", o = e.firstChild; o != null; o = o.nextSibling) { - var a = o.nodeType; - (a === 1 || a === 3 || a === 4 || a === 9 || a === 11) && (r += this.stringForNode(o)); - } - return r; - }, m.prototype.buildTree = function() { - if (!this.tree && this.nodes.length) { - this.tree = new ne(this.nodes[0]); - for (var e = 1; e < this.nodes.length; e += 1) - this.tree.add(this.nodes[e]); - } - return this.tree; - }, m.prototype.first = function() { - var e = this.buildTree(); - if (e == null) - return null; - for (; e.left != null; ) - e = e.left; - return e.node; - }, m.prototype.add = function(e) { - for (var r = 0; r < this.nodes.length; r += 1) - if (e === this.nodes[r]) - return; - this.tree = null, this.nodes.push(e), this.size += 1; - }, m.prototype.addArray = function(e) { - var r = this; - N(function(o) { - r.add(o); - }, e); - }, m.prototype.toArray = function() { - var e = []; - return this.toArrayRec(this.buildTree(), e), e; - }, m.prototype.toArrayRec = function(e, r) { - e != null && (this.toArrayRec(e.left, r), r.push(e.node), this.toArrayRec(e.right, r)); - }, m.prototype.toUnsortedArray = function() { - return this.nodes.slice(); - }, m.prototype.compareWithString = function(e, r) { - for (var o = this.toUnsortedArray(), a = 0; a < o.length; a++) { - var i = o[a], l = new T(this.stringForNode(i)), g = r(l, e); - if (g.booleanValue()) - return g; - } - return new C(!1); - }, m.prototype.compareWithNumber = function(e, r) { - for (var o = this.toUnsortedArray(), a = 0; a < o.length; a++) { - var i = o[a], l = new b(this.stringForNode(i)), g = r(l, e); - if (g.booleanValue()) - return g; - } - return new C(!1); - }, m.prototype.compareWithBoolean = function(e, r) { - return r(this.bool(), e); - }, m.prototype.compareWithNodeSet = function(e, r) { - for (var o = this.toUnsortedArray(), a = function(I, L) { - return r(L, I); - }, i = 0; i < o.length; i++) { - var l = new T(this.stringForNode(o[i])), g = e.compareWithString(l, a); - if (g.booleanValue()) - return g; - } - return new C(!1); - }, m.compareWith = y(function(e, r) { - return v.instance_of(r, T) ? this.compareWithString(r, e) : v.instance_of(r, b) ? this.compareWithNumber(r, e) : v.instance_of(r, C) ? this.compareWithBoolean(r, e) : this.compareWithNodeSet(r, e); - }), m.prototype.equals = m.compareWith(W.equals), m.prototype.notequal = m.compareWith(W.notequal), m.prototype.lessthan = m.compareWith(W.lessthan), m.prototype.greaterthan = m.compareWith(W.greaterthan), m.prototype.lessthanorequal = m.compareWith(W.lessthanorequal), m.prototype.greaterthanorequal = m.compareWith(W.greaterthanorequal), m.prototype.union = function(e) { - var r = new m(); - return r.addArray(this.toUnsortedArray()), r.addArray(e.toUnsortedArray()), r; - }, Xe.prototype = new Object(), Xe.prototype.constructor = Xe, Xe.superclass = Object.prototype; - function Xe(e, r, o, a) { - this.isXPathNamespace = !0, this.baseNode = r, this.ownerDocument = a.ownerDocument, this.nodeName = e, this.prefix = e, this.localName = e, this.namespaceURI = null, this.nodeValue = o, this.ownerElement = a, this.nodeType = x.NAMESPACE_NODE; - } - Xe.prototype.toString = function() { - return '{ "' + this.prefix + '", "' + this.namespaceURI + '" }'; - }, Te.prototype = new Object(), Te.prototype.constructor = Te, Te.superclass = Object.prototype; - function Te(e, r, o) { - this.variableResolver = e ?? new Ue(), this.namespaceResolver = r ?? new Re(), this.functionResolver = o ?? new fe(); - } - Te.prototype.extend = function(e) { - return Se(new Te(), this, e); - }, Ue.prototype = new Object(), Ue.prototype.constructor = Ue, Ue.superclass = Object.prototype; - function Ue() { - } - Ue.prototype.getVariable = function(e, r) { - return null; - }, fe.prototype = new Object(), fe.prototype.constructor = fe, fe.superclass = Object.prototype; - function fe(e) { - this.thisArg = e ?? O, this.functions = new Object(), this.addStandardFunctions(); - } - fe.prototype.addStandardFunctions = function() { - this.functions["{}last"] = O.last, this.functions["{}position"] = O.position, this.functions["{}count"] = O.count, this.functions["{}id"] = O.id, this.functions["{}local-name"] = O.localName, this.functions["{}namespace-uri"] = O.namespaceURI, this.functions["{}name"] = O.name, this.functions["{}string"] = O.string, this.functions["{}concat"] = O.concat, this.functions["{}starts-with"] = O.startsWith, this.functions["{}contains"] = O.contains, this.functions["{}substring-before"] = O.substringBefore, this.functions["{}substring-after"] = O.substringAfter, this.functions["{}substring"] = O.substring, this.functions["{}string-length"] = O.stringLength, this.functions["{}normalize-space"] = O.normalizeSpace, this.functions["{}translate"] = O.translate, this.functions["{}boolean"] = O.boolean_, this.functions["{}not"] = O.not, this.functions["{}true"] = O.true_, this.functions["{}false"] = O.false_, this.functions["{}lang"] = O.lang, this.functions["{}number"] = O.number, this.functions["{}sum"] = O.sum, this.functions["{}floor"] = O.floor, this.functions["{}ceiling"] = O.ceiling, this.functions["{}round"] = O.round; - }, fe.prototype.addFunction = function(e, r, o) { - this.functions["{" + e + "}" + r] = o; - }, fe.getFunctionFromContext = function(e, r) { - var o = v.resolveQName(e, r.namespaceResolver, r.contextNode, !1); - if (o[0] === null) - throw new Error("Cannot resolve QName " + name); - return r.functionResolver.getFunction(o[1], o[0]); - }, fe.prototype.getFunction = function(e, r) { - return this.functions["{" + r + "}" + e]; - }, Re.prototype = new Object(), Re.prototype.constructor = Re, Re.superclass = Object.prototype; - function Re() { - } - Re.prototype.getNamespace = function(e, r) { - if (e == "xml") - return Z.XML_NAMESPACE_URI; - if (e == "xmlns") - return Z.XMLNS_NAMESPACE_URI; - for (r.nodeType == x.DOCUMENT_NODE ? r = r.documentElement : r.nodeType == x.ATTRIBUTE_NODE ? r = _.getOwnerElement(r) : r.nodeType != x.ELEMENT_NODE && (r = r.parentNode); r != null && r.nodeType == x.ELEMENT_NODE; ) { - for (var o = r.attributes, a = 0; a < o.length; a++) { - var i = o.item(a), l = i.name || i.nodeName; - if (l === "xmlns" && e === "" || l === "xmlns:" + e) - return String(i.value || i.nodeValue); - } - r = r.parentNode; - } - return null; - }; - var O = new Object(); - O.last = function(e) { - if (arguments.length != 1) - throw new Error("Function last expects ()"); - return new b(e.contextSize); - }, O.position = function(e) { - if (arguments.length != 1) - throw new Error("Function position expects ()"); - return new b(e.contextPosition); - }, O.count = function() { - var e = arguments[0], r; - if (arguments.length != 2 || !v.instance_of(r = arguments[1].evaluate(e), m)) - throw new Error("Function count expects (node-set)"); - return new b(r.size); - }, O.id = function() { - var e = arguments[0], r; - if (arguments.length != 2) - throw new Error("Function id expects (object)"); - r = arguments[1].evaluate(e), v.instance_of(r, m) ? r = r.toArray().join(" ") : r = r.stringValue(); - for (var o = r.split(/[\x0d\x0a\x09\x20]+/), a = new m(), i = e.contextNode.nodeType == x.DOCUMENT_NODE ? e.contextNode : e.contextNode.ownerDocument, l = 0; l < o.length; l++) { - var g; - i.getElementById ? g = i.getElementById(o[l]) : g = v.getElementById(i, o[l]), g != null && a.add(g); - } - return a; - }, O.localName = function(e, r) { - var o; - if (arguments.length == 1) - o = e.contextNode; - else if (arguments.length == 2) - o = r.evaluate(e).first(); - else - throw new Error("Function local-name expects (node-set?)"); - return o == null ? new T("") : new T( - o.localName || // standard elements and attributes - o.baseName || // IE - o.target || // processing instructions - o.nodeName || // DOM1 elements - "" - // fallback - ); - }, O.namespaceURI = function() { - var e = arguments[0], r; - if (arguments.length == 1) - r = e.contextNode; - else if (arguments.length == 2) - r = arguments[1].evaluate(e).first(); - else - throw new Error("Function namespace-uri expects (node-set?)"); - return r == null ? new T("") : new T(r.namespaceURI || ""); - }, O.name = function() { - var e = arguments[0], r; - if (arguments.length == 1) - r = e.contextNode; - else if (arguments.length == 2) - r = arguments[1].evaluate(e).first(); - else - throw new Error("Function name expects (node-set?)"); - return r == null ? new T("") : r.nodeType == x.ELEMENT_NODE ? new T(r.nodeName) : r.nodeType == x.ATTRIBUTE_NODE ? new T(r.name || r.nodeName) : r.nodeType === x.PROCESSING_INSTRUCTION_NODE ? new T(r.target || r.nodeName) : r.localName == null ? new T("") : new T(r.localName); - }, O.string = function() { - var e = arguments[0]; - if (arguments.length == 1) - return new T(m.prototype.stringForNode(e.contextNode)); - if (arguments.length == 2) - return arguments[1].evaluate(e).string(); - throw new Error("Function string expects (object?)"); - }, O.concat = function(e) { - if (arguments.length < 3) - throw new Error("Function concat expects (string, string[, string]*)"); - for (var r = "", o = 1; o < arguments.length; o++) - r += arguments[o].evaluate(e).stringValue(); - return new T(r); - }, O.startsWith = function() { - var e = arguments[0]; - if (arguments.length != 3) - throw new Error("Function startsWith expects (string, string)"); - var r = arguments[1].evaluate(e).stringValue(), o = arguments[2].evaluate(e).stringValue(); - return new C(r.substring(0, o.length) == o); - }, O.contains = function() { - var e = arguments[0]; - if (arguments.length != 3) - throw new Error("Function contains expects (string, string)"); - var r = arguments[1].evaluate(e).stringValue(), o = arguments[2].evaluate(e).stringValue(); - return new C(r.indexOf(o) !== -1); - }, O.substringBefore = function() { - var e = arguments[0]; - if (arguments.length != 3) - throw new Error("Function substring-before expects (string, string)"); - var r = arguments[1].evaluate(e).stringValue(), o = arguments[2].evaluate(e).stringValue(); - return new T(r.substring(0, r.indexOf(o))); - }, O.substringAfter = function() { - var e = arguments[0]; - if (arguments.length != 3) - throw new Error("Function substring-after expects (string, string)"); - var r = arguments[1].evaluate(e).stringValue(), o = arguments[2].evaluate(e).stringValue(); - if (o.length == 0) - return new T(r); - var a = r.indexOf(o); - return a == -1 ? new T("") : new T(r.substring(a + o.length)); - }, O.substring = function() { - var e = arguments[0]; - if (!(arguments.length == 3 || arguments.length == 4)) - throw new Error("Function substring expects (string, number, number?)"); - var r = arguments[1].evaluate(e).stringValue(), o = Math.round(arguments[2].evaluate(e).numberValue()) - 1, a = arguments.length == 4 ? o + Math.round(arguments[3].evaluate(e).numberValue()) : void 0; - return new T(r.substring(o, a)); - }, O.stringLength = function() { - var e = arguments[0], r; - if (arguments.length == 1) - r = m.prototype.stringForNode(e.contextNode); - else if (arguments.length == 2) - r = arguments[1].evaluate(e).stringValue(); - else - throw new Error("Function string-length expects (string?)"); - return new b(r.length); - }, O.normalizeSpace = function() { - var e = arguments[0], r; - if (arguments.length == 1) - r = m.prototype.stringForNode(e.contextNode); - else if (arguments.length == 2) - r = arguments[1].evaluate(e).stringValue(); - else - throw new Error("Function normalize-space expects (string?)"); - for (var o = 0, a = r.length - 1; v.isSpace(r.charCodeAt(a)); ) - a--; - for (var i = ""; o <= a && v.isSpace(r.charCodeAt(o)); ) - o++; - for (; o <= a; ) - if (v.isSpace(r.charCodeAt(o))) - for (i += " "; o <= a && v.isSpace(r.charCodeAt(o)); ) - o++; - else - i += r.charAt(o), o++; - return new T(i); - }, O.translate = function(e, r, o, a) { - if (arguments.length != 4) - throw new Error("Function translate expects (string, string, string)"); - var i = r.evaluate(e).stringValue(), l = o.evaluate(e).stringValue(), g = a.evaluate(e).stringValue(), I = w(function(D, B, Ie) { - return B in D || (D[B] = Ie > g.length ? "" : g[Ie]), D; - }, {}, l), L = H( - "", - S(function(D) { - return D in I ? I[D] : D; - }, i) - ); - return new T(L); - }, O.boolean_ = function() { - var e = arguments[0]; - if (arguments.length != 2) - throw new Error("Function boolean expects (object)"); - return arguments[1].evaluate(e).bool(); - }, O.not = function(e, r) { - if (arguments.length != 2) - throw new Error("Function not expects (object)"); - return r.evaluate(e).bool().not(); - }, O.true_ = function() { - if (arguments.length != 1) - throw new Error("Function true expects ()"); - return C.true_; - }, O.false_ = function() { - if (arguments.length != 1) - throw new Error("Function false expects ()"); - return C.false_; - }, O.lang = function() { - var e = arguments[0]; - if (arguments.length != 2) - throw new Error("Function lang expects (string)"); - for (var r, o = e.contextNode; o != null && o.nodeType != x.DOCUMENT_NODE; o = o.parentNode) { - var a = o.getAttributeNS(Z.XML_NAMESPACE_URI, "lang"); - if (a != null) { - r = String(a); - break; - } - } - if (r == null) - return C.false_; - var i = arguments[1].evaluate(e).stringValue(); - return new C(r.substring(0, i.length) == i && (r.length == i.length || r.charAt(i.length) == "-")); - }, O.number = function() { - var e = arguments[0]; - if (!(arguments.length == 1 || arguments.length == 2)) - throw new Error("Function number expects (object?)"); - return arguments.length == 1 ? new b(m.prototype.stringForNode(e.contextNode)) : arguments[1].evaluate(e).number(); - }, O.sum = function() { - var e = arguments[0], r; - if (arguments.length != 2 || !v.instance_of(r = arguments[1].evaluate(e), m)) - throw new Error("Function sum expects (node-set)"); - r = r.toUnsortedArray(); - for (var o = 0, a = 0; a < r.length; a++) - o += new b(m.prototype.stringForNode(r[a])).numberValue(); - return new b(o); - }, O.floor = function() { - var e = arguments[0]; - if (arguments.length != 2) - throw new Error("Function floor expects (number)"); - return new b(Math.floor(arguments[1].evaluate(e).numberValue())); - }, O.ceiling = function() { - var e = arguments[0]; - if (arguments.length != 2) - throw new Error("Function ceiling expects (number)"); - return new b(Math.ceil(arguments[1].evaluate(e).numberValue())); - }, O.round = function() { - var e = arguments[0]; - if (arguments.length != 2) - throw new Error("Function round expects (number)"); - return new b(Math.round(arguments[1].evaluate(e).numberValue())); - }; - var v = new Object(), kr = function(e) { - return e && (e.nodeType === x.ATTRIBUTE_NODE || e.ownerElement || e.isXPathNamespace); - }; - v.splitQName = function(e) { - var r = e.indexOf(":"); - return r == -1 ? [null, e] : [e.substring(0, r), e.substring(r + 1)]; - }, v.resolveQName = function(e, r, o, a) { - var i = v.splitQName(e); - return i[0] != null ? i[0] = r.getNamespace(i[0], o) : a ? (i[0] = r.getNamespace("", o), i[0] == null && (i[0] = "")) : i[0] = "", i; - }, v.isSpace = function(e) { - return e == 9 || e == 13 || e == 10 || e == 32; - }, v.isLetter = function(e) { - return e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 255 || e >= 256 && e <= 305 || e >= 308 && e <= 318 || e >= 321 && e <= 328 || e >= 330 && e <= 382 || e >= 384 && e <= 451 || e >= 461 && e <= 496 || e >= 500 && e <= 501 || e >= 506 && e <= 535 || e >= 592 && e <= 680 || e >= 699 && e <= 705 || e == 902 || e >= 904 && e <= 906 || e == 908 || e >= 910 && e <= 929 || e >= 931 && e <= 974 || e >= 976 && e <= 982 || e == 986 || e == 988 || e == 990 || e == 992 || e >= 994 && e <= 1011 || e >= 1025 && e <= 1036 || e >= 1038 && e <= 1103 || e >= 1105 && e <= 1116 || e >= 1118 && e <= 1153 || e >= 1168 && e <= 1220 || e >= 1223 && e <= 1224 || e >= 1227 && e <= 1228 || e >= 1232 && e <= 1259 || e >= 1262 && e <= 1269 || e >= 1272 && e <= 1273 || e >= 1329 && e <= 1366 || e == 1369 || e >= 1377 && e <= 1414 || e >= 1488 && e <= 1514 || e >= 1520 && e <= 1522 || e >= 1569 && e <= 1594 || e >= 1601 && e <= 1610 || e >= 1649 && e <= 1719 || e >= 1722 && e <= 1726 || e >= 1728 && e <= 1742 || e >= 1744 && e <= 1747 || e == 1749 || e >= 1765 && e <= 1766 || e >= 2309 && e <= 2361 || e == 2365 || e >= 2392 && e <= 2401 || e >= 2437 && e <= 2444 || e >= 2447 && e <= 2448 || e >= 2451 && e <= 2472 || e >= 2474 && e <= 2480 || e == 2482 || e >= 2486 && e <= 2489 || e >= 2524 && e <= 2525 || e >= 2527 && e <= 2529 || e >= 2544 && e <= 2545 || e >= 2565 && e <= 2570 || e >= 2575 && e <= 2576 || e >= 2579 && e <= 2600 || e >= 2602 && e <= 2608 || e >= 2610 && e <= 2611 || e >= 2613 && e <= 2614 || e >= 2616 && e <= 2617 || e >= 2649 && e <= 2652 || e == 2654 || e >= 2674 && e <= 2676 || e >= 2693 && e <= 2699 || e == 2701 || e >= 2703 && e <= 2705 || e >= 2707 && e <= 2728 || e >= 2730 && e <= 2736 || e >= 2738 && e <= 2739 || e >= 2741 && e <= 2745 || e == 2749 || e == 2784 || e >= 2821 && e <= 2828 || e >= 2831 && e <= 2832 || e >= 2835 && e <= 2856 || e >= 2858 && e <= 2864 || e >= 2866 && e <= 2867 || e >= 2870 && e <= 2873 || e == 2877 || e >= 2908 && e <= 2909 || e >= 2911 && e <= 2913 || e >= 2949 && e <= 2954 || e >= 2958 && e <= 2960 || e >= 2962 && e <= 2965 || e >= 2969 && e <= 2970 || e == 2972 || e >= 2974 && e <= 2975 || e >= 2979 && e <= 2980 || e >= 2984 && e <= 2986 || e >= 2990 && e <= 2997 || e >= 2999 && e <= 3001 || e >= 3077 && e <= 3084 || e >= 3086 && e <= 3088 || e >= 3090 && e <= 3112 || e >= 3114 && e <= 3123 || e >= 3125 && e <= 3129 || e >= 3168 && e <= 3169 || e >= 3205 && e <= 3212 || e >= 3214 && e <= 3216 || e >= 3218 && e <= 3240 || e >= 3242 && e <= 3251 || e >= 3253 && e <= 3257 || e == 3294 || e >= 3296 && e <= 3297 || e >= 3333 && e <= 3340 || e >= 3342 && e <= 3344 || e >= 3346 && e <= 3368 || e >= 3370 && e <= 3385 || e >= 3424 && e <= 3425 || e >= 3585 && e <= 3630 || e == 3632 || e >= 3634 && e <= 3635 || e >= 3648 && e <= 3653 || e >= 3713 && e <= 3714 || e == 3716 || e >= 3719 && e <= 3720 || e == 3722 || e == 3725 || e >= 3732 && e <= 3735 || e >= 3737 && e <= 3743 || e >= 3745 && e <= 3747 || e == 3749 || e == 3751 || e >= 3754 && e <= 3755 || e >= 3757 && e <= 3758 || e == 3760 || e >= 3762 && e <= 3763 || e == 3773 || e >= 3776 && e <= 3780 || e >= 3904 && e <= 3911 || e >= 3913 && e <= 3945 || e >= 4256 && e <= 4293 || e >= 4304 && e <= 4342 || e == 4352 || e >= 4354 && e <= 4355 || e >= 4357 && e <= 4359 || e == 4361 || e >= 4363 && e <= 4364 || e >= 4366 && e <= 4370 || e == 4412 || e == 4414 || e == 4416 || e == 4428 || e == 4430 || e == 4432 || e >= 4436 && e <= 4437 || e == 4441 || e >= 4447 && e <= 4449 || e == 4451 || e == 4453 || e == 4455 || e == 4457 || e >= 4461 && e <= 4462 || e >= 4466 && e <= 4467 || e == 4469 || e == 4510 || e == 4520 || e == 4523 || e >= 4526 && e <= 4527 || e >= 4535 && e <= 4536 || e == 4538 || e >= 4540 && e <= 4546 || e == 4587 || e == 4592 || e == 4601 || e >= 7680 && e <= 7835 || e >= 7840 && e <= 7929 || e >= 7936 && e <= 7957 || e >= 7960 && e <= 7965 || e >= 7968 && e <= 8005 || e >= 8008 && e <= 8013 || e >= 8016 && e <= 8023 || e == 8025 || e == 8027 || e == 8029 || e >= 8031 && e <= 8061 || e >= 8064 && e <= 8116 || e >= 8118 && e <= 8124 || e == 8126 || e >= 8130 && e <= 8132 || e >= 8134 && e <= 8140 || e >= 8144 && e <= 8147 || e >= 8150 && e <= 8155 || e >= 8160 && e <= 8172 || e >= 8178 && e <= 8180 || e >= 8182 && e <= 8188 || e == 8486 || e >= 8490 && e <= 8491 || e == 8494 || e >= 8576 && e <= 8578 || e >= 12353 && e <= 12436 || e >= 12449 && e <= 12538 || e >= 12549 && e <= 12588 || e >= 44032 && e <= 55203 || e >= 19968 && e <= 40869 || e == 12295 || e >= 12321 && e <= 12329; - }, v.isNCNameChar = function(e) { - return e >= 48 && e <= 57 || e >= 1632 && e <= 1641 || e >= 1776 && e <= 1785 || e >= 2406 && e <= 2415 || e >= 2534 && e <= 2543 || e >= 2662 && e <= 2671 || e >= 2790 && e <= 2799 || e >= 2918 && e <= 2927 || e >= 3047 && e <= 3055 || e >= 3174 && e <= 3183 || e >= 3302 && e <= 3311 || e >= 3430 && e <= 3439 || e >= 3664 && e <= 3673 || e >= 3792 && e <= 3801 || e >= 3872 && e <= 3881 || e == 46 || e == 45 || e == 95 || v.isLetter(e) || e >= 768 && e <= 837 || e >= 864 && e <= 865 || e >= 1155 && e <= 1158 || e >= 1425 && e <= 1441 || e >= 1443 && e <= 1465 || e >= 1467 && e <= 1469 || e == 1471 || e >= 1473 && e <= 1474 || e == 1476 || e >= 1611 && e <= 1618 || e == 1648 || e >= 1750 && e <= 1756 || e >= 1757 && e <= 1759 || e >= 1760 && e <= 1764 || e >= 1767 && e <= 1768 || e >= 1770 && e <= 1773 || e >= 2305 && e <= 2307 || e == 2364 || e >= 2366 && e <= 2380 || e == 2381 || e >= 2385 && e <= 2388 || e >= 2402 && e <= 2403 || e >= 2433 && e <= 2435 || e == 2492 || e == 2494 || e == 2495 || e >= 2496 && e <= 2500 || e >= 2503 && e <= 2504 || e >= 2507 && e <= 2509 || e == 2519 || e >= 2530 && e <= 2531 || e == 2562 || e == 2620 || e == 2622 || e == 2623 || e >= 2624 && e <= 2626 || e >= 2631 && e <= 2632 || e >= 2635 && e <= 2637 || e >= 2672 && e <= 2673 || e >= 2689 && e <= 2691 || e == 2748 || e >= 2750 && e <= 2757 || e >= 2759 && e <= 2761 || e >= 2763 && e <= 2765 || e >= 2817 && e <= 2819 || e == 2876 || e >= 2878 && e <= 2883 || e >= 2887 && e <= 2888 || e >= 2891 && e <= 2893 || e >= 2902 && e <= 2903 || e >= 2946 && e <= 2947 || e >= 3006 && e <= 3010 || e >= 3014 && e <= 3016 || e >= 3018 && e <= 3021 || e == 3031 || e >= 3073 && e <= 3075 || e >= 3134 && e <= 3140 || e >= 3142 && e <= 3144 || e >= 3146 && e <= 3149 || e >= 3157 && e <= 3158 || e >= 3202 && e <= 3203 || e >= 3262 && e <= 3268 || e >= 3270 && e <= 3272 || e >= 3274 && e <= 3277 || e >= 3285 && e <= 3286 || e >= 3330 && e <= 3331 || e >= 3390 && e <= 3395 || e >= 3398 && e <= 3400 || e >= 3402 && e <= 3405 || e == 3415 || e == 3633 || e >= 3636 && e <= 3642 || e >= 3655 && e <= 3662 || e == 3761 || e >= 3764 && e <= 3769 || e >= 3771 && e <= 3772 || e >= 3784 && e <= 3789 || e >= 3864 && e <= 3865 || e == 3893 || e == 3895 || e == 3897 || e == 3902 || e == 3903 || e >= 3953 && e <= 3972 || e >= 3974 && e <= 3979 || e >= 3984 && e <= 3989 || e == 3991 || e >= 3993 && e <= 4013 || e >= 4017 && e <= 4023 || e == 4025 || e >= 8400 && e <= 8412 || e == 8417 || e >= 12330 && e <= 12335 || e == 12441 || e == 12442 || e == 183 || e == 720 || e == 721 || e == 903 || e == 1600 || e == 3654 || e == 3782 || e == 12293 || e >= 12337 && e <= 12341 || e >= 12445 && e <= 12446 || e >= 12540 && e <= 12542; - }, v.coalesceText = function(e) { - for (var r = e.firstChild; r != null; r = r.nextSibling) - if (r.nodeType == x.TEXT_NODE || r.nodeType == x.CDATA_SECTION_NODE) { - var o = r.nodeValue, a = r; - for (r = r.nextSibling; r != null && (r.nodeType == x.TEXT_NODE || r.nodeType == x.CDATA_SECTION_NODE); ) { - o += r.nodeValue; - var i = r; - r = r.nextSibling, i.parentNode.removeChild(i); - } - if (a.nodeType == x.CDATA_SECTION_NODE) { - var l = a.parentNode; - if (a.nextSibling == null) - l.removeChild(a), l.appendChild(l.ownerDocument.createTextNode(o)); - else { - var g = a.nextSibling; - l.removeChild(a), l.insertBefore(l.ownerDocument.createTextNode(o), g); - } - } else - a.nodeValue = o; - if (r == null) - break; - } else - r.nodeType == x.ELEMENT_NODE && v.coalesceText(r); - }, v.instance_of = function(e, r) { - for (; e != null; ) { - if (e.constructor === r) - return !0; - if (e === Object) - return !1; - e = e.constructor.superclass; - } - return !1; - }, v.getElementById = function(e, r) { - if (e.nodeType == x.ELEMENT_NODE && (e.getAttribute("id") == r || e.getAttributeNS(null, "id") == r)) - return e; - for (var o = e.firstChild; o != null; o = o.nextSibling) { - var a = v.getElementById(o, r); - if (a != null) - return a; - } - return null; - }; - var be = function() { - function e(o, a) { - var i = a ? ": " + a.toString() : ""; - switch (o) { - case r.INVALID_EXPRESSION_ERR: - return "Invalid expression" + i; - case r.TYPE_ERR: - return "Type error" + i; - } - return null; - } - function r(o, a, i) { - var l = Error.call(this, e(o, a) || i); - return l.code = o, l.exception = a, l; - } - return r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, r.superclass = Error, r.prototype.toString = function() { - return this.message; - }, r.fromMessage = function(o, a) { - return new r(null, a, o); - }, r.INVALID_EXPRESSION_ERR = 51, r.TYPE_ERR = 52, r; - }(); - he.prototype = {}, he.prototype.constructor = he, he.superclass = Object.prototype; - function he(e, r, o) { - this.xpath = o.parse(e), this.context = new Te(), this.context.namespaceResolver = new $e(r); - } - he.getOwnerDocument = function(e) { - return e.nodeType === x.DOCUMENT_NODE ? e : e.ownerDocument; - }, he.detectHtmlDom = function(e) { - if (!e) - return !1; - var r = he.getOwnerDocument(e); - try { - return r.implementation.hasFeature("HTML", "2.0"); - } catch { - return !0; - } - }, he.prototype.evaluate = function(e, r, o) { - this.context.expressionContextNode = e, this.context.caseInsensitive = he.detectHtmlDom(e); - var a = this.xpath.evaluate(this.context); - return new F(a, r); - }, $e.prototype = {}, $e.prototype.constructor = $e, $e.superclass = Object.prototype; - function $e(e) { - this.xpathNSResolver = e; - } - $e.prototype.getNamespace = function(e, r) { - return this.xpathNSResolver == null ? null : this.xpathNSResolver.lookupNamespaceURI(e); - }, Qe.prototype = {}, Qe.prototype.constructor = Qe, Qe.superclass = Object.prototype; - function Qe(e) { - this.node = e, this.namespaceResolver = new Re(); - } - Qe.prototype.lookupNamespaceURI = function(e) { - return this.namespaceResolver.getNamespace(e, this.node); - }, F.prototype = {}, F.prototype.constructor = F, F.superclass = Object.prototype; - function F(e, r) { - switch (r == F.ANY_TYPE && (e.constructor === T ? r = F.STRING_TYPE : e.constructor === b ? r = F.NUMBER_TYPE : e.constructor === C ? r = F.BOOLEAN_TYPE : e.constructor === m && (r = F.UNORDERED_NODE_ITERATOR_TYPE)), this.resultType = r, r) { - case F.NUMBER_TYPE: - this.numberValue = e.numberValue(); - return; - case F.STRING_TYPE: - this.stringValue = e.stringValue(); - return; - case F.BOOLEAN_TYPE: - this.booleanValue = e.booleanValue(); - return; - case F.ANY_UNORDERED_NODE_TYPE: - case F.FIRST_ORDERED_NODE_TYPE: - if (e.constructor === m) { - this.singleNodeValue = e.first(); - return; - } - break; - case F.UNORDERED_NODE_ITERATOR_TYPE: - case F.ORDERED_NODE_ITERATOR_TYPE: - if (e.constructor === m) { - this.invalidIteratorState = !1, this.nodes = e.toArray(), this.iteratorIndex = 0; - return; - } - break; - case F.UNORDERED_NODE_SNAPSHOT_TYPE: - case F.ORDERED_NODE_SNAPSHOT_TYPE: - if (e.constructor === m) { - this.nodes = e.toArray(), this.snapshotLength = this.nodes.length; - return; - } - break; - } - throw new be(be.TYPE_ERR); - } - F.prototype.iterateNext = function() { - if (this.resultType != F.UNORDERED_NODE_ITERATOR_TYPE && this.resultType != F.ORDERED_NODE_ITERATOR_TYPE) - throw new be(be.TYPE_ERR); - return this.nodes[this.iteratorIndex++]; - }, F.prototype.snapshotItem = function(e) { - if (this.resultType != F.UNORDERED_NODE_SNAPSHOT_TYPE && this.resultType != F.ORDERED_NODE_SNAPSHOT_TYPE) - throw new be(be.TYPE_ERR); - return this.nodes[e]; - }, F.ANY_TYPE = 0, F.NUMBER_TYPE = 1, F.STRING_TYPE = 2, F.BOOLEAN_TYPE = 3, F.UNORDERED_NODE_ITERATOR_TYPE = 4, F.ORDERED_NODE_ITERATOR_TYPE = 5, F.UNORDERED_NODE_SNAPSHOT_TYPE = 6, F.ORDERED_NODE_SNAPSHOT_TYPE = 7, F.ANY_UNORDERED_NODE_TYPE = 8, F.FIRST_ORDERED_NODE_TYPE = 9; - function Gr(e, r) { - e.createExpression = function(o, a) { - try { - return new he(o, a, r); - } catch (i) { - throw new be(be.INVALID_EXPRESSION_ERR, i); - } - }, e.createNSResolver = function(o) { - return new Qe(o); - }, e.evaluate = function(o, a, i, l, g) { - if (l < 0 || l > 9) - throw { code: 0, toString: function() { - return "Request type not supported"; - } }; - return e.createExpression(o, i, r).evaluate(a, l, g); - }; - } - try { - var Hr = !0; - try { - document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("XPath", null) && (Hr = !1); - } catch { - } - Hr && Gr(document, new p()); - } catch { - } - Gr(n, new p()), function() { - var e = new p(), r = new Re(), o = new fe(), a = new Ue(); - function i(h) { - return { - getNamespace: function(P, oe) { - var Ve = h(P, oe); - return Ve || r.getNamespace(P, oe); - } - }; - } - function l(h) { - return i(h.getNamespace.bind(h)); - } - function g(h) { - return i(function(P) { - return h[P]; - }); - } - function I(h) { - return h && typeof h.getNamespace == "function" ? l(h) : typeof h == "function" ? i(h) : typeof h == "object" ? g(h) : r; - } - function L(h) { - if (h === null || typeof h > "u" || h instanceof T || h instanceof C || h instanceof b || h instanceof m) - return h; - switch (typeof h) { - case "string": - return new T(h); - case "boolean": - return new C(h); - case "number": - return new b(h); - } - var P = new m(); - return P.addArray([].concat(h)), P; - } - function D(h) { - return function(P) { - var oe = Array.prototype.slice.call(arguments, 1).map(function(Wt) { - return Wt.evaluate(P); - }), Ve = h.apply(this, [].concat(P, oe)); - return L(Ve); - }; - } - function B(h) { - return { - getFunction: function(P, oe) { - var Ve = h(P, oe); - return Ve ? D(Ve) : o.getFunction(P, oe); - } - }; - } - function Ie(h) { - return B(h.getFunction.bind(h)); - } - function je(h) { - return B(function(P) { - return h[P]; - }); - } - function ze(h) { - return h && typeof h.getFunction == "function" ? Ie(h) : typeof h == "function" ? B(h) : typeof h == "object" ? je(h) : o; - } - function Ye(h) { - return { - getVariable: function(P, oe) { - var Ve = h(P, oe); - return L(Ve); - } - }; - } - function or(h) { - if (h) { - if (typeof h.getVariable == "function") - return Ye(h.getVariable.bind(h)); - if (typeof h == "function") - return Ye(h); - if (typeof h == "object") - return Ye(function(P) { - return h[P]; - }); - } - return a; - } - function ir(h, P, oe) { - h in oe && (P[h] = oe[h]); - } - function Ht(h) { - var P = new Te(); - return h ? (P.namespaceResolver = I(h.namespaces), P.functionResolver = ze(h.functions), P.variableResolver = or(h.variables), P.expressionContextNode = h.node, ir("allowAnyNamespaceForNoPrefix", P, h), ir("isHtml", P, h)) : P.namespaceResolver = r, P; - } - function Xt(h, P) { - var oe = Ht(P); - return h.evaluate(oe); - } - var jt = { - evaluate: function(h) { - return Xt(this.expression, h); - }, - evaluateNumber: function(h) { - return this.evaluate(h).numberValue(); - }, - evaluateString: function(h) { - return this.evaluate(h).stringValue(); - }, - evaluateBoolean: function(h) { - return this.evaluate(h).booleanValue(); - }, - evaluateNodeSet: function(h) { - return this.evaluate(h).nodeset(); - }, - select: function(h) { - return this.evaluateNodeSet(h).toArray(); - }, - select1: function(h) { - return this.select(h)[0]; - } - }; - function Yt(h) { - var P = e.parse(h); - return Object.create(jt, { - expression: { - value: P - } - }); - } - n.parse = Yt; - }(), Se( - n, - { - XPath: Z, - XPathParser: p, - XPathResult: F, - Step: E, - PathExpr: _, - NodeTest: d, - LocationPath: Oe, - OrOperation: ue, - AndOperation: pe, - BarOperation: Ce, - EqualsOperation: M, - NotEqualOperation: j, - LessThanOperation: ce, - GreaterThanOperation: Ae, - LessThanOrEqualOperation: De, - GreaterThanOrEqualOperation: ge, - PlusOperation: de, - MinusOperation: me, - MultiplyOperation: Ne, - DivOperation: ve, - ModOperation: xe, - UnaryMinusOperation: le, - FunctionCall: ye, - VariableReference: Fe, - XPathContext: Te, - XNodeSet: m, - XBoolean: C, - XString: T, - XNumber: b, - NamespaceResolver: Re, - FunctionResolver: fe, - VariableResolver: Ue, - Utilities: v - } - ), n.select = function(e, r, o) { - return n.selectWithResolver(e, r, null, o); - }, n.useNamespaces = function(e) { - var r = { - mappings: e || {}, - lookupNamespaceURI: function(o) { - return this.mappings[o]; - } - }; - return function(o, a, i) { - return n.selectWithResolver(o, a, r, i); - }; - }, n.selectWithResolver = function(e, r, o, a) { - var i = new he(e, o, new p()), l = F.ANY_TYPE, g = i.evaluate(r, l, null); - return g.resultType == F.STRING_TYPE ? g = g.stringValue : g.resultType == F.NUMBER_TYPE ? g = g.numberValue : g.resultType == F.BOOLEAN_TYPE ? g = g.booleanValue : (g = g.nodes, a && (g = g[0])), g; - }, n.select1 = function(e, r) { - return n.select(e, r, !0); - }; - var Gt = function(e) { - return Array.isArray(e) && e.every(A); - }, _e = function(e) { - return function(r) { - return A(r) && r.nodeType === e; - }; - }; - Se( - n, - { - isNodeLike: A, - isArrayOfNodes: Gt, - isElement: _e(x.ELEMENT_NODE), - isAttribute: _e(x.ATTRIBUTE_NODE), - isTextNode: _e(x.TEXT_NODE), - isCDATASection: _e(x.CDATA_SECTION_NODE), - isProcessingInstruction: _e(x.PROCESSING_INSTRUCTION_NODE), - isComment: _e(x.COMMENT_NODE), - isDocumentNode: _e(x.DOCUMENT_NODE), - isDocumentTypeNode: _e(x.DOCUMENT_TYPE_NODE), - isDocumentFragment: _e(x.DOCUMENT_FRAGMENT_NODE) - } - ); - })(u); -})(nt); -const Qt = /* @__PURE__ */ $t(nt); -var Ge = {}, Me = {}; -function zt(t, u, n) { - if (n === void 0 && (n = Array.prototype), t && typeof n.find == "function") - return n.find.call(t, u); - for (var s = 0; s < t.length; s++) - if (Object.prototype.hasOwnProperty.call(t, s)) { - var c = t[s]; - if (u.call(void 0, c, s, t)) - return c; - } -} -function Or(t, u) { - return u === void 0 && (u = Object), u && typeof u.freeze == "function" ? u.freeze(t) : t; -} -function Jt(t, u) { - if (t === null || typeof t != "object") - throw new TypeError("target is not an object"); - for (var n in u) - Object.prototype.hasOwnProperty.call(u, n) && (t[n] = u[n]); - return t; -} -var ot = Or({ - /** - * `text/html`, the only mime type that triggers treating an XML document as HTML. - * - * @see DOMParser.SupportedType.isHTML - * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration - * @see https://en.wikipedia.org/wiki/HTML Wikipedia - * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN - * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec - */ - HTML: "text/html", - /** - * Helper method to check a mime type if it indicates an HTML document - * - * @param {string} [value] - * @returns {boolean} - * - * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration - * @see https://en.wikipedia.org/wiki/HTML Wikipedia - * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN - * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring */ - isHTML: function(t) { - return t === ot.HTML; - }, - /** - * `application/xml`, the standard mime type for XML documents. - * - * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration - * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303 - * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia - */ - XML_APPLICATION: "application/xml", - /** - * `text/html`, an alias for `application/xml`. - * - * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303 - * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration - * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia - */ - XML_TEXT: "text/xml", - /** - * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace, - * but is parsed as an XML document. - * - * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration - * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec - * @see https://en.wikipedia.org/wiki/XHTML Wikipedia - */ - XML_XHTML_APPLICATION: "application/xhtml+xml", - /** - * `image/svg+xml`, - * - * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration - * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1 - * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia - */ - XML_SVG_IMAGE: "image/svg+xml" -}), it = Or({ - /** - * The XHTML namespace. - * - * @see http://www.w3.org/1999/xhtml - */ - HTML: "http://www.w3.org/1999/xhtml", - /** - * Checks if `uri` equals `NAMESPACE.HTML`. - * - * @param {string} [uri] - * - * @see NAMESPACE.HTML - */ - isHTML: function(t) { - return t === it.HTML; - }, - /** - * The SVG namespace. - * - * @see http://www.w3.org/2000/svg - */ - SVG: "http://www.w3.org/2000/svg", - /** - * The `xml:` namespace. - * - * @see http://www.w3.org/XML/1998/namespace - */ - XML: "http://www.w3.org/XML/1998/namespace", - /** - * The `xmlns:` namespace - * - * @see https://www.w3.org/2000/xmlns/ - */ - XMLNS: "http://www.w3.org/2000/xmlns/" -}); -Me.assign = Jt; -Me.find = zt; -Me.freeze = Or; -Me.MIME_TYPE = ot; -Me.NAMESPACE = it; -var st = Me, we = st.find, pr = st.NAMESPACE; -function Zt(t) { - return t !== ""; -} -function Kt(t) { - return t ? t.split(/[\t\n\f\r ]+/).filter(Zt) : []; -} -function eu(t, u) { - return t.hasOwnProperty(u) || (t[u] = !0), t; -} -function Xr(t) { - if (!t) - return []; - var u = Kt(t); - return Object.keys(u.reduce(eu, {})); -} -function ru(t) { - return function(u) { - return t && t.indexOf(u) !== -1; - }; -} -function hr(t, u) { - for (var n in t) - Object.prototype.hasOwnProperty.call(t, n) && (u[n] = t[n]); -} -function se(t, u) { - var n = t.prototype; - if (!(n instanceof u)) { - let s = function() { - }; - s.prototype = u.prototype, s = new s(), hr(n, s), t.prototype = n = s; - } - n.constructor != t && (typeof t != "function" && console.error("unknown Class:" + t), n.constructor = t); -} -var ae = {}, Ee = ae.ELEMENT_NODE = 1, tr = ae.ATTRIBUTE_NODE = 2, mr = ae.TEXT_NODE = 3, at = ae.CDATA_SECTION_NODE = 4, lt = ae.ENTITY_REFERENCE_NODE = 5, tu = ae.ENTITY_NODE = 6, pt = ae.PROCESSING_INSTRUCTION_NODE = 7, ct = ae.COMMENT_NODE = 8, ft = ae.DOCUMENT_NODE = 9, ht = ae.DOCUMENT_TYPE_NODE = 10, Pe = ae.DOCUMENT_FRAGMENT_NODE = 11, uu = ae.NOTATION_NODE = 12, re = {}, K = {}; -re.INDEX_SIZE_ERR = (K[1] = "Index size error", 1); -re.DOMSTRING_SIZE_ERR = (K[2] = "DOMString size error", 2); -var ie = re.HIERARCHY_REQUEST_ERR = (K[3] = "Hierarchy request error", 3); -re.WRONG_DOCUMENT_ERR = (K[4] = "Wrong document", 4); -re.INVALID_CHARACTER_ERR = (K[5] = "Invalid character", 5); -re.NO_DATA_ALLOWED_ERR = (K[6] = "No data allowed", 6); -re.NO_MODIFICATION_ALLOWED_ERR = (K[7] = "No modification allowed", 7); -var Et = re.NOT_FOUND_ERR = (K[8] = "Not found", 8); -re.NOT_SUPPORTED_ERR = (K[9] = "Not supported", 9); -var jr = re.INUSE_ATTRIBUTE_ERR = (K[10] = "Attribute in use", 10); -re.INVALID_STATE_ERR = (K[11] = "Invalid state", 11); -re.SYNTAX_ERR = (K[12] = "Syntax error", 12); -re.INVALID_MODIFICATION_ERR = (K[13] = "Invalid modification", 13); -re.NAMESPACE_ERR = (K[14] = "Invalid namespace", 14); -re.INVALID_ACCESS_ERR = (K[15] = "Invalid access", 15); -function z(t, u) { - if (u instanceof Error) - var n = u; - else - n = this, Error.call(this, K[t]), this.message = K[t], Error.captureStackTrace && Error.captureStackTrace(this, z); - return n.code = t, u && (this.message = this.message + ": " + u), n; -} -z.prototype = Error.prototype; -hr(re, z); -function Le() { -} -Le.prototype = { - /** - * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive. - * @standard level1 - */ - length: 0, - /** - * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null. - * @standard level1 - * @param index unsigned long - * Index into the collection. - * @return Node - * The node at the indexth position in the NodeList, or null if that is not a valid index. - */ - item: function(t) { - return t >= 0 && t < this.length ? this[t] : null; - }, - toString: function(t, u) { - for (var n = [], s = 0; s < this.length; s++) - rr(this[s], n, t, u); - return n.join(""); - }, - /** - * @private - * @param {function (Node):boolean} predicate - * @returns {Node[]} - */ - filter: function(t) { - return Array.prototype.filter.call(this, t); - }, - /** - * @private - * @param {Node} item - * @returns {number} - */ - indexOf: function(t) { - return Array.prototype.indexOf.call(this, t); - } -}; -function ur(t, u) { - this._node = t, this._refresh = u, Fr(this); -} -function Fr(t) { - var u = t._node._inc || t._node.ownerDocument._inc; - if (t._inc !== u) { - var n = t._refresh(t._node); - if (bt(t, "length", n.length), !t.$$length || n.length < t.$$length) - for (var s = n.length; s in t; s++) - Object.prototype.hasOwnProperty.call(t, s) && delete t[s]; - hr(n, t), t._inc = u; - } -} -ur.prototype.item = function(t) { - return Fr(this), this[t] || null; -}; -se(ur, Le); -function Nr() { -} -function At(t, u) { - for (var n = t.length; n--; ) - if (t[n] === u) - return n; -} -function Yr(t, u, n, s) { - if (s ? u[At(u, s)] = n : u[u.length++] = n, t) { - n.ownerElement = t; - var c = t.ownerDocument; - c && (s && dt(c, t, s), nu(c, t, n)); - } -} -function Wr(t, u, n) { - var s = At(u, n); - if (s >= 0) { - for (var c = u.length - 1; s < c; ) - u[s] = u[++s]; - if (u.length = c, t) { - var f = t.ownerDocument; - f && (dt(f, t, n), n.ownerElement = null); - } - } else - throw new z(Et, new Error(t.tagName + "@" + n)); -} -Nr.prototype = { - length: 0, - item: Le.prototype.item, - getNamedItem: function(t) { - for (var u = this.length; u--; ) { - var n = this[u]; - if (n.nodeName == t) - return n; - } - }, - setNamedItem: function(t) { - var u = t.ownerElement; - if (u && u != this._ownerElement) - throw new z(jr); - var n = this.getNamedItem(t.nodeName); - return Yr(this._ownerElement, this, t, n), n; - }, - /* returns Node */ - setNamedItemNS: function(t) { - var u = t.ownerElement, n; - if (u && u != this._ownerElement) - throw new z(jr); - return n = this.getNamedItemNS(t.namespaceURI, t.localName), Yr(this._ownerElement, this, t, n), n; - }, - /* returns Node */ - removeNamedItem: function(t) { - var u = this.getNamedItem(t); - return Wr(this._ownerElement, this, u), u; - }, - // raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR - //for level2 - removeNamedItemNS: function(t, u) { - var n = this.getNamedItemNS(t, u); - return Wr(this._ownerElement, this, n), n; - }, - getNamedItemNS: function(t, u) { - for (var n = this.length; n--; ) { - var s = this[n]; - if (s.localName == u && s.namespaceURI == t) - return s; - } - return null; - } -}; -function Dt() { -} -Dt.prototype = { - /** - * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported. - * The different implementations fairly diverged in what kind of features were reported. - * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use. - * - * @deprecated It is deprecated and modern browsers return true in all cases. - * - * @param {string} feature - * @param {string} [version] - * @returns {boolean} always true - * - * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN - * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core - * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard - */ - hasFeature: function(t, u) { - return !0; - }, - /** - * Creates an XML Document object of the specified type with its document element. - * - * __It behaves slightly different from the description in the living standard__: - * - There is no interface/class `XMLDocument`, it returns a `Document` instance. - * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared. - * - this implementation is not validating names or qualified names - * (when parsing XML strings, the SAX parser takes care of that) - * - * @param {string|null} namespaceURI - * @param {string} qualifiedName - * @param {DocumentType=null} doctype - * @returns {Document} - * - * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN - * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial) - * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core - * - * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract - * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names - * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names - */ - createDocument: function(t, u, n) { - var s = new Er(); - if (s.implementation = this, s.childNodes = new Le(), s.doctype = n || null, n && s.appendChild(n), u) { - var c = s.createElementNS(t, u); - s.appendChild(c); - } - return s; - }, - /** - * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`. - * - * __This behavior is slightly different from the in the specs__: - * - this implementation is not validating names or qualified names - * (when parsing XML strings, the SAX parser takes care of that) - * - * @param {string} qualifiedName - * @param {string} [publicId] - * @param {string} [systemId] - * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation - * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()` - * - * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN - * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core - * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard - * - * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract - * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names - * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names - */ - createDocumentType: function(t, u, n) { - var s = new Cr(); - return s.name = t, s.nodeName = t, s.publicId = u || "", s.systemId = n || "", s; - } -}; -function V() { -} -V.prototype = { - firstChild: null, - lastChild: null, - previousSibling: null, - nextSibling: null, - attributes: null, - parentNode: null, - childNodes: null, - ownerDocument: null, - nodeValue: null, - namespaceURI: null, - prefix: null, - localName: null, - // Modified in DOM Level 2: - insertBefore: function(t, u) { - return vr(this, t, u); - }, - replaceChild: function(t, u) { - vr(this, t, u, Nt), u && this.removeChild(u); - }, - removeChild: function(t) { - return mt(this, t); - }, - appendChild: function(t) { - return this.insertBefore(t, null); - }, - hasChildNodes: function() { - return this.firstChild != null; - }, - cloneNode: function(t) { - return wr(this.ownerDocument || this, this, t); - }, - // Modified in DOM Level 2: - normalize: function() { - for (var t = this.firstChild; t; ) { - var u = t.nextSibling; - u && u.nodeType == mr && t.nodeType == mr ? (this.removeChild(u), t.appendData(u.data)) : (t.normalize(), t = u); - } - }, - // Introduced in DOM Level 2: - isSupported: function(t, u) { - return this.ownerDocument.implementation.hasFeature(t, u); - }, - // Introduced in DOM Level 2: - hasAttributes: function() { - return this.attributes.length > 0; - }, - /** - * Look up the prefix associated to the given namespace URI, starting from this node. - * **The default namespace declarations are ignored by this method.** - * See Namespace Prefix Lookup for details on the algorithm used by this method. - * - * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._ - * - * @param {string | null} namespaceURI - * @returns {string | null} - * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix - * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo - * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix - * @see https://github.com/xmldom/xmldom/issues/322 - */ - lookupPrefix: function(t) { - for (var u = this; u; ) { - var n = u._nsMap; - if (n) { - for (var s in n) - if (Object.prototype.hasOwnProperty.call(n, s) && n[s] === t) - return s; - } - u = u.nodeType == tr ? u.ownerDocument : u.parentNode; - } - return null; - }, - // Introduced in DOM Level 3: - lookupNamespaceURI: function(t) { - for (var u = this; u; ) { - var n = u._nsMap; - if (n && Object.prototype.hasOwnProperty.call(n, t)) - return n[t]; - u = u.nodeType == tr ? u.ownerDocument : u.parentNode; - } - return null; - }, - // Introduced in DOM Level 3: - isDefaultNamespace: function(t) { - var u = this.lookupPrefix(t); - return u == null; - } -}; -function gt(t) { - return t == "<" && "<" || t == ">" && ">" || t == "&" && "&" || t == '"' && """ || "&#" + t.charCodeAt() + ";"; -} -hr(ae, V); -hr(ae, V.prototype); -function cr(t, u) { - if (u(t)) - return !0; - if (t = t.firstChild) - do - if (cr(t, u)) - return !0; - while (t = t.nextSibling); -} -function Er() { - this.ownerDocument = this; -} -function nu(t, u, n) { - t && t._inc++; - var s = n.namespaceURI; - s === pr.XMLNS && (u._nsMap[n.prefix ? n.localName : ""] = n.value); -} -function dt(t, u, n, s) { - t && t._inc++; - var c = n.namespaceURI; - c === pr.XMLNS && delete u._nsMap[n.prefix ? n.localName : ""]; -} -function Rr(t, u, n) { - if (t && t._inc) { - t._inc++; - var s = u.childNodes; - if (n) - s[s.length++] = n; - else { - for (var c = u.firstChild, f = 0; c; ) - s[f++] = c, c = c.nextSibling; - s.length = f, delete s[s.length]; - } - } -} -function mt(t, u) { - var n = u.previousSibling, s = u.nextSibling; - return n ? n.nextSibling = s : t.firstChild = s, s ? s.previousSibling = n : t.lastChild = n, u.parentNode = null, u.previousSibling = null, u.nextSibling = null, Rr(t.ownerDocument, t), u; -} -function ou(t) { - return t && (t.nodeType === V.DOCUMENT_NODE || t.nodeType === V.DOCUMENT_FRAGMENT_NODE || t.nodeType === V.ELEMENT_NODE); -} -function iu(t) { - return t && (Be(t) || _r(t) || qe(t) || t.nodeType === V.DOCUMENT_FRAGMENT_NODE || t.nodeType === V.COMMENT_NODE || t.nodeType === V.PROCESSING_INSTRUCTION_NODE); -} -function qe(t) { - return t && t.nodeType === V.DOCUMENT_TYPE_NODE; -} -function Be(t) { - return t && t.nodeType === V.ELEMENT_NODE; -} -function _r(t) { - return t && t.nodeType === V.TEXT_NODE; -} -function $r(t, u) { - var n = t.childNodes || []; - if (we(n, Be) || qe(u)) - return !1; - var s = we(n, qe); - return !(u && s && n.indexOf(s) > n.indexOf(u)); -} -function Qr(t, u) { - var n = t.childNodes || []; - function s(f) { - return Be(f) && f !== u; - } - if (we(n, s)) - return !1; - var c = we(n, qe); - return !(u && c && n.indexOf(c) > n.indexOf(u)); -} -function su(t, u, n) { - if (!ou(t)) - throw new z(ie, "Unexpected parent node type " + t.nodeType); - if (n && n.parentNode !== t) - throw new z(Et, "child not in parent"); - if ( - // 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a "HierarchyRequestError" DOMException. - !iu(u) || // 5. If either `node` is a Text node and `parent` is a document, - // the sax parser currently adds top level text nodes, this will be fixed in 0.9.0 - // || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE) - // or `node` is a doctype and `parent` is not a document, then throw a "HierarchyRequestError" DOMException. - qe(u) && t.nodeType !== V.DOCUMENT_NODE - ) - throw new z( - ie, - "Unexpected node type " + u.nodeType + " for parent node type " + t.nodeType - ); -} -function au(t, u, n) { - var s = t.childNodes || [], c = u.childNodes || []; - if (u.nodeType === V.DOCUMENT_FRAGMENT_NODE) { - var f = c.filter(Be); - if (f.length > 1 || we(c, _r)) - throw new z(ie, "More than one element or text in fragment"); - if (f.length === 1 && !$r(t, n)) - throw new z(ie, "Element in fragment can not be inserted before doctype"); - } - if (Be(u) && !$r(t, n)) - throw new z(ie, "Only one element can be added and only after doctype"); - if (qe(u)) { - if (we(s, qe)) - throw new z(ie, "Only one doctype is allowed"); - var A = we(s, Be); - if (n && s.indexOf(A) < s.indexOf(n)) - throw new z(ie, "Doctype can only be inserted before an element"); - if (!n && A) - throw new z(ie, "Doctype can not be appended since element is present"); - } -} -function Nt(t, u, n) { - var s = t.childNodes || [], c = u.childNodes || []; - if (u.nodeType === V.DOCUMENT_FRAGMENT_NODE) { - var f = c.filter(Be); - if (f.length > 1 || we(c, _r)) - throw new z(ie, "More than one element or text in fragment"); - if (f.length === 1 && !Qr(t, n)) - throw new z(ie, "Element in fragment can not be inserted before doctype"); - } - if (Be(u) && !Qr(t, n)) - throw new z(ie, "Only one element can be added and only after doctype"); - if (qe(u)) { - if (we(s, function(N) { - return qe(N) && N !== n; - })) - throw new z(ie, "Only one doctype is allowed"); - var A = we(s, Be); - if (n && s.indexOf(A) < s.indexOf(n)) - throw new z(ie, "Doctype can only be inserted before an element"); - } -} -function vr(t, u, n, s) { - su(t, u, n), t.nodeType === V.DOCUMENT_NODE && (s || au)(t, u, n); - var c = u.parentNode; - if (c && c.removeChild(u), u.nodeType === Pe) { - var f = u.firstChild; - if (f == null) - return u; - var A = u.lastChild; - } else - f = A = u; - var y = n ? n.previousSibling : t.lastChild; - f.previousSibling = y, A.nextSibling = n, y ? y.nextSibling = f : t.firstChild = f, n == null ? t.lastChild = A : n.previousSibling = A; - do - f.parentNode = t; - while (f !== A && (f = f.nextSibling)); - return Rr(t.ownerDocument || t, t), u.nodeType == Pe && (u.firstChild = u.lastChild = null), u; -} -function lu(t, u) { - return u.parentNode && u.parentNode.removeChild(u), u.parentNode = t, u.previousSibling = t.lastChild, u.nextSibling = null, u.previousSibling ? u.previousSibling.nextSibling = u : t.firstChild = u, t.lastChild = u, Rr(t.ownerDocument, t, u), u; -} -Er.prototype = { - //implementation : null, - nodeName: "#document", - nodeType: ft, - /** - * The DocumentType node of the document. - * - * @readonly - * @type DocumentType - */ - doctype: null, - documentElement: null, - _inc: 1, - insertBefore: function(t, u) { - if (t.nodeType == Pe) { - for (var n = t.firstChild; n; ) { - var s = n.nextSibling; - this.insertBefore(n, u), n = s; - } - return t; - } - return vr(this, t, u), t.ownerDocument = this, this.documentElement === null && t.nodeType === Ee && (this.documentElement = t), t; - }, - removeChild: function(t) { - return this.documentElement == t && (this.documentElement = null), mt(this, t); - }, - replaceChild: function(t, u) { - vr(this, t, u, Nt), t.ownerDocument = this, u && this.removeChild(u), Be(t) && (this.documentElement = t); - }, - // Introduced in DOM Level 2: - importNode: function(t, u) { - return Tt(this, t, u); - }, - // Introduced in DOM Level 2: - getElementById: function(t) { - var u = null; - return cr(this.documentElement, function(n) { - if (n.nodeType == Ee && n.getAttribute("id") == t) - return u = n, !0; - }), u; - }, - /** - * The `getElementsByClassName` method of `Document` interface returns an array-like object - * of all child elements which have **all** of the given class name(s). - * - * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters. - * - * - * Warning: This is a live LiveNodeList. - * Changes in the DOM will reflect in the array as the changes occur. - * If an element selected by this array no longer qualifies for the selector, - * it will automatically be removed. Be aware of this for iteration purposes. - * - * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace - * - * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName - * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname - */ - getElementsByClassName: function(t) { - var u = Xr(t); - return new ur(this, function(n) { - var s = []; - return u.length > 0 && cr(n.documentElement, function(c) { - if (c !== n && c.nodeType === Ee) { - var f = c.getAttribute("class"); - if (f) { - var A = t === f; - if (!A) { - var y = Xr(f); - A = u.every(ru(y)); - } - A && s.push(c); - } - } - }), s; - }); - }, - //document factory method: - createElement: function(t) { - var u = new We(); - u.ownerDocument = this, u.nodeName = t, u.tagName = t, u.localName = t, u.childNodes = new Le(); - var n = u.attributes = new Nr(); - return n._ownerElement = u, u; - }, - createDocumentFragment: function() { - var t = new yr(); - return t.ownerDocument = this, t.childNodes = new Le(), t; - }, - createTextNode: function(t) { - var u = new Ir(); - return u.ownerDocument = this, u.appendData(t), u; - }, - createComment: function(t) { - var u = new Lr(); - return u.ownerDocument = this, u.appendData(t), u; - }, - createCDATASection: function(t) { - var u = new Pr(); - return u.ownerDocument = this, u.appendData(t), u; - }, - createProcessingInstruction: function(t, u) { - var n = new Mr(); - return n.ownerDocument = this, n.tagName = n.nodeName = n.target = t, n.nodeValue = n.data = u, n; - }, - createAttribute: function(t) { - var u = new xr(); - return u.ownerDocument = this, u.name = t, u.nodeName = t, u.localName = t, u.specified = !0, u; - }, - createEntityReference: function(t) { - var u = new qr(); - return u.ownerDocument = this, u.nodeName = t, u; - }, - // Introduced in DOM Level 2: - createElementNS: function(t, u) { - var n = new We(), s = u.split(":"), c = n.attributes = new Nr(); - return n.childNodes = new Le(), n.ownerDocument = this, n.nodeName = u, n.tagName = u, n.namespaceURI = t, s.length == 2 ? (n.prefix = s[0], n.localName = s[1]) : n.localName = u, c._ownerElement = n, n; - }, - // Introduced in DOM Level 2: - createAttributeNS: function(t, u) { - var n = new xr(), s = u.split(":"); - return n.ownerDocument = this, n.nodeName = u, n.name = u, n.namespaceURI = t, n.specified = !0, s.length == 2 ? (n.prefix = s[0], n.localName = s[1]) : n.localName = u, n; - } -}; -se(Er, V); -function We() { - this._nsMap = {}; -} -We.prototype = { - nodeType: Ee, - hasAttribute: function(t) { - return this.getAttributeNode(t) != null; - }, - getAttribute: function(t) { - var u = this.getAttributeNode(t); - return u && u.value || ""; - }, - getAttributeNode: function(t) { - return this.attributes.getNamedItem(t); - }, - setAttribute: function(t, u) { - var n = this.ownerDocument.createAttribute(t); - n.value = n.nodeValue = "" + u, this.setAttributeNode(n); - }, - removeAttribute: function(t) { - var u = this.getAttributeNode(t); - u && this.removeAttributeNode(u); - }, - //four real opeartion method - appendChild: function(t) { - return t.nodeType === Pe ? this.insertBefore(t, null) : lu(this, t); - }, - setAttributeNode: function(t) { - return this.attributes.setNamedItem(t); - }, - setAttributeNodeNS: function(t) { - return this.attributes.setNamedItemNS(t); - }, - removeAttributeNode: function(t) { - return this.attributes.removeNamedItem(t.nodeName); - }, - //get real attribute name,and remove it by removeAttributeNode - removeAttributeNS: function(t, u) { - var n = this.getAttributeNodeNS(t, u); - n && this.removeAttributeNode(n); - }, - hasAttributeNS: function(t, u) { - return this.getAttributeNodeNS(t, u) != null; - }, - getAttributeNS: function(t, u) { - var n = this.getAttributeNodeNS(t, u); - return n && n.value || ""; - }, - setAttributeNS: function(t, u, n) { - var s = this.ownerDocument.createAttributeNS(t, u); - s.value = s.nodeValue = "" + n, this.setAttributeNode(s); - }, - getAttributeNodeNS: function(t, u) { - return this.attributes.getNamedItemNS(t, u); - }, - getElementsByTagName: function(t) { - return new ur(this, function(u) { - var n = []; - return cr(u, function(s) { - s !== u && s.nodeType == Ee && (t === "*" || s.tagName == t) && n.push(s); - }), n; - }); - }, - getElementsByTagNameNS: function(t, u) { - return new ur(this, function(n) { - var s = []; - return cr(n, function(c) { - c !== n && c.nodeType === Ee && (t === "*" || c.namespaceURI === t) && (u === "*" || c.localName == u) && s.push(c); - }), s; - }); - } -}; -Er.prototype.getElementsByTagName = We.prototype.getElementsByTagName; -Er.prototype.getElementsByTagNameNS = We.prototype.getElementsByTagNameNS; -se(We, V); -function xr() { -} -xr.prototype.nodeType = tr; -se(xr, V); -function Ar() { -} -Ar.prototype = { - data: "", - substringData: function(t, u) { - return this.data.substring(t, t + u); - }, - appendData: function(t) { - t = this.data + t, this.nodeValue = this.data = t, this.length = t.length; - }, - insertData: function(t, u) { - this.replaceData(t, 0, u); - }, - appendChild: function(t) { - throw new Error(K[ie]); - }, - deleteData: function(t, u) { - this.replaceData(t, u, ""); - }, - replaceData: function(t, u, n) { - var s = this.data.substring(0, t), c = this.data.substring(t + u); - n = s + n + c, this.nodeValue = this.data = n, this.length = n.length; - } -}; -se(Ar, V); -function Ir() { -} -Ir.prototype = { - nodeName: "#text", - nodeType: mr, - splitText: function(t) { - var u = this.data, n = u.substring(t); - u = u.substring(0, t), this.data = this.nodeValue = u, this.length = u.length; - var s = this.ownerDocument.createTextNode(n); - return this.parentNode && this.parentNode.insertBefore(s, this.nextSibling), s; - } -}; -se(Ir, Ar); -function Lr() { -} -Lr.prototype = { - nodeName: "#comment", - nodeType: ct -}; -se(Lr, Ar); -function Pr() { -} -Pr.prototype = { - nodeName: "#cdata-section", - nodeType: at -}; -se(Pr, Ar); -function Cr() { -} -Cr.prototype.nodeType = ht; -se(Cr, V); -function vt() { -} -vt.prototype.nodeType = uu; -se(vt, V); -function xt() { -} -xt.prototype.nodeType = tu; -se(xt, V); -function qr() { -} -qr.prototype.nodeType = lt; -se(qr, V); -function yr() { -} -yr.prototype.nodeName = "#document-fragment"; -yr.prototype.nodeType = Pe; -se(yr, V); -function Mr() { -} -Mr.prototype.nodeType = pt; -se(Mr, V); -function Ct() { -} -Ct.prototype.serializeToString = function(t, u, n) { - return yt.call(t, u, n); -}; -V.prototype.toString = yt; -function yt(t, u) { - var n = [], s = this.nodeType == 9 && this.documentElement || this, c = s.prefix, f = s.namespaceURI; - if (f && c == null) { - var c = s.lookupPrefix(f); - if (c == null) - var A = [ - { namespace: f, prefix: null } - //{namespace:uri,prefix:''} - ]; - } - return rr(this, n, t, u, A), n.join(""); -} -function zr(t, u, n) { - var s = t.prefix || "", c = t.namespaceURI; - if (!c || s === "xml" && c === pr.XML || c === pr.XMLNS) - return !1; - for (var f = n.length; f--; ) { - var A = n[f]; - if (A.prefix === s) - return A.namespace !== c; - } - return !0; -} -function br(t, u, n) { - t.push(" ", u, '="', n.replace(/[<>&"\t\n\r]/g, gt), '"'); -} -function rr(t, u, n, s, c) { - if (c || (c = []), s) - if (t = s(t), t) { - if (typeof t == "string") { - u.push(t); - return; - } - } else - return; - switch (t.nodeType) { - case Ee: - var f = t.attributes, A = f.length, Q = t.firstChild, y = t.tagName; - n = pr.isHTML(t.namespaceURI) || n; - var N = y; - if (!n && !t.prefix && t.namespaceURI) { - for (var w, S = 0; S < f.length; S++) - if (f.item(S).name === "xmlns") { - w = f.item(S).value; - break; - } - if (!w) - for (var k = c.length - 1; k >= 0; k--) { - var q = c[k]; - if (q.prefix === "" && q.namespace === t.namespaceURI) { - w = q.namespace; - break; - } - } - if (w !== t.namespaceURI) - for (var k = c.length - 1; k >= 0; k--) { - var q = c[k]; - if (q.namespace === t.namespaceURI) { - q.prefix && (N = q.prefix + ":" + y); - break; - } - } - } - u.push("<", N); - for (var $ = 0; $ < A; $++) { - var J = f.item($); - J.prefix == "xmlns" ? c.push({ prefix: J.localName, namespace: J.value }) : J.nodeName == "xmlns" && c.push({ prefix: "", namespace: J.value }); - } - for (var $ = 0; $ < A; $++) { - var J = f.item($); - if (zr(J, n, c)) { - var H = J.prefix || "", G = J.namespaceURI; - br(u, H ? "xmlns:" + H : "xmlns", G), c.push({ prefix: H, namespace: G }); - } - rr(J, u, n, s, c); - } - if (y === N && zr(t, n, c)) { - var H = t.prefix || "", G = t.namespaceURI; - br(u, H ? "xmlns:" + H : "xmlns", G), c.push({ prefix: H, namespace: G }); - } - if (Q || n && !/^(?:meta|link|img|br|hr|input)$/i.test(y)) { - if (u.push(">"), n && /^script$/i.test(y)) - for (; Q; ) - Q.data ? u.push(Q.data) : rr(Q, u, n, s, c.slice()), Q = Q.nextSibling; - else - for (; Q; ) - rr(Q, u, n, s, c.slice()), Q = Q.nextSibling; - u.push(""); - } else - u.push("/>"); - return; - case ft: - case Pe: - for (var Q = t.firstChild; Q; ) - rr(Q, u, n, s, c.slice()), Q = Q.nextSibling; - return; - case tr: - return br(u, t.name, t.value); - case mr: - return u.push( - t.data.replace(/[<&>]/g, gt) - ); - case at: - return u.push(""); - case ct: - return u.push(""); - case ht: - var He = t.publicId, Y = t.systemId; - if (u.push(""); - else if (Y && Y != ".") - u.push(" SYSTEM ", Y, ">"); - else { - var te = t.internalSubset; - te && u.push(" [", te, "]"), u.push(">"); - } - return; - case pt: - return u.push(""); - case lt: - return u.push("&", t.nodeName, ";"); - default: - u.push("??", t.nodeName); - } -} -function Tt(t, u, n) { - var s; - switch (u.nodeType) { - case Ee: - s = u.cloneNode(!1), s.ownerDocument = t; - case Pe: - break; - case tr: - n = !0; - break; - } - if (s || (s = u.cloneNode(!1)), s.ownerDocument = t, s.parentNode = null, n) - for (var c = u.firstChild; c; ) - s.appendChild(Tt(t, c, n)), c = c.nextSibling; - return s; -} -function wr(t, u, n) { - var s = new u.constructor(); - for (var c in u) - if (Object.prototype.hasOwnProperty.call(u, c)) { - var f = u[c]; - typeof f != "object" && f != s[c] && (s[c] = f); - } - switch (u.childNodes && (s.childNodes = new Le()), s.ownerDocument = t, s.nodeType) { - case Ee: - var A = u.attributes, y = s.attributes = new Nr(), N = A.length; - y._ownerElement = s; - for (var w = 0; w < N; w++) - s.setAttributeNode(wr(t, A.item(w), !0)); - break; - case tr: - n = !0; - } - if (n) - for (var S = u.firstChild; S; ) - s.appendChild(wr(t, S, n)), S = S.nextSibling; - return s; -} -function bt(t, u, n) { - t[u] = n; -} -try { - if (Object.defineProperty) { - let t = function(u) { - switch (u.nodeType) { - case Ee: - case Pe: - var n = []; - for (u = u.firstChild; u; ) - u.nodeType !== 7 && u.nodeType !== 8 && n.push(t(u)), u = u.nextSibling; - return n.join(""); - default: - return u.nodeValue; - } - }; - Object.defineProperty(ur.prototype, "length", { - get: function() { - return Fr(this), this.$$length; - } - }), Object.defineProperty(V.prototype, "textContent", { - get: function() { - return t(this); - }, - set: function(u) { - switch (this.nodeType) { - case Ee: - case Pe: - for (; this.firstChild; ) - this.removeChild(this.firstChild); - (u || String(u)) && this.appendChild(this.ownerDocument.createTextNode(u)); - break; - default: - this.data = u, this.value = u, this.nodeValue = u; - } - } - }), bt = function(u, n, s) { - u["$$" + n] = s; - }; - } -} catch { -} -Ge.DocumentType = Cr; -Ge.DOMException = z; -Ge.DOMImplementation = Dt; -Ge.Element = We; -Ge.Node = V; -Ge.NodeList = Le; -Ge.XMLSerializer = Ct; -var Tr = {}, wt = {}; -(function(t) { - var u = Me.freeze; - t.XML_ENTITIES = u({ - amp: "&", - apos: "'", - gt: ">", - lt: "<", - quot: '"' - }), t.HTML_ENTITIES = u({ - Aacute: "Á", - aacute: "á", - Abreve: "Ă", - abreve: "ă", - ac: "∾", - acd: "∿", - acE: "∾̳", - Acirc: "Â", - acirc: "â", - acute: "´", - Acy: "А", - acy: "а", - AElig: "Æ", - aelig: "æ", - af: "⁡", - Afr: "𝔄", - afr: "𝔞", - Agrave: "À", - agrave: "à", - alefsym: "ℵ", - aleph: "ℵ", - Alpha: "Α", - alpha: "α", - Amacr: "Ā", - amacr: "ā", - amalg: "⨿", - AMP: "&", - amp: "&", - And: "⩓", - and: "∧", - andand: "⩕", - andd: "⩜", - andslope: "⩘", - andv: "⩚", - ang: "∠", - ange: "⦤", - angle: "∠", - angmsd: "∡", - angmsdaa: "⦨", - angmsdab: "⦩", - angmsdac: "⦪", - angmsdad: "⦫", - angmsdae: "⦬", - angmsdaf: "⦭", - angmsdag: "⦮", - angmsdah: "⦯", - angrt: "∟", - angrtvb: "⊾", - angrtvbd: "⦝", - angsph: "∢", - angst: "Å", - angzarr: "⍼", - Aogon: "Ą", - aogon: "ą", - Aopf: "𝔸", - aopf: "𝕒", - ap: "≈", - apacir: "⩯", - apE: "⩰", - ape: "≊", - apid: "≋", - apos: "'", - ApplyFunction: "⁡", - approx: "≈", - approxeq: "≊", - Aring: "Å", - aring: "å", - Ascr: "𝒜", - ascr: "𝒶", - Assign: "≔", - ast: "*", - asymp: "≈", - asympeq: "≍", - Atilde: "Ã", - atilde: "ã", - Auml: "Ä", - auml: "ä", - awconint: "∳", - awint: "⨑", - backcong: "≌", - backepsilon: "϶", - backprime: "‵", - backsim: "∽", - backsimeq: "⋍", - Backslash: "∖", - Barv: "⫧", - barvee: "⊽", - Barwed: "⌆", - barwed: "⌅", - barwedge: "⌅", - bbrk: "⎵", - bbrktbrk: "⎶", - bcong: "≌", - Bcy: "Б", - bcy: "б", - bdquo: "„", - becaus: "∵", - Because: "∵", - because: "∵", - bemptyv: "⦰", - bepsi: "϶", - bernou: "ℬ", - Bernoullis: "ℬ", - Beta: "Β", - beta: "β", - beth: "ℶ", - between: "≬", - Bfr: "𝔅", - bfr: "𝔟", - bigcap: "⋂", - bigcirc: "◯", - bigcup: "⋃", - bigodot: "⨀", - bigoplus: "⨁", - bigotimes: "⨂", - bigsqcup: "⨆", - bigstar: "★", - bigtriangledown: "▽", - bigtriangleup: "△", - biguplus: "⨄", - bigvee: "⋁", - bigwedge: "⋀", - bkarow: "⤍", - blacklozenge: "⧫", - blacksquare: "▪", - blacktriangle: "▴", - blacktriangledown: "▾", - blacktriangleleft: "◂", - blacktriangleright: "▸", - blank: "␣", - blk12: "▒", - blk14: "░", - blk34: "▓", - block: "█", - bne: "=⃥", - bnequiv: "≡⃥", - bNot: "⫭", - bnot: "⌐", - Bopf: "𝔹", - bopf: "𝕓", - bot: "⊥", - bottom: "⊥", - bowtie: "⋈", - boxbox: "⧉", - boxDL: "╗", - boxDl: "╖", - boxdL: "╕", - boxdl: "┐", - boxDR: "╔", - boxDr: "╓", - boxdR: "╒", - boxdr: "┌", - boxH: "═", - boxh: "─", - boxHD: "╦", - boxHd: "╤", - boxhD: "╥", - boxhd: "┬", - boxHU: "╩", - boxHu: "╧", - boxhU: "╨", - boxhu: "┴", - boxminus: "⊟", - boxplus: "⊞", - boxtimes: "⊠", - boxUL: "╝", - boxUl: "╜", - boxuL: "╛", - boxul: "┘", - boxUR: "╚", - boxUr: "╙", - boxuR: "╘", - boxur: "└", - boxV: "║", - boxv: "│", - boxVH: "╬", - boxVh: "╫", - boxvH: "╪", - boxvh: "┼", - boxVL: "╣", - boxVl: "╢", - boxvL: "╡", - boxvl: "┤", - boxVR: "╠", - boxVr: "╟", - boxvR: "╞", - boxvr: "├", - bprime: "‵", - Breve: "˘", - breve: "˘", - brvbar: "¦", - Bscr: "ℬ", - bscr: "𝒷", - bsemi: "⁏", - bsim: "∽", - bsime: "⋍", - bsol: "\\", - bsolb: "⧅", - bsolhsub: "⟈", - bull: "•", - bullet: "•", - bump: "≎", - bumpE: "⪮", - bumpe: "≏", - Bumpeq: "≎", - bumpeq: "≏", - Cacute: "Ć", - cacute: "ć", - Cap: "⋒", - cap: "∩", - capand: "⩄", - capbrcup: "⩉", - capcap: "⩋", - capcup: "⩇", - capdot: "⩀", - CapitalDifferentialD: "ⅅ", - caps: "∩︀", - caret: "⁁", - caron: "ˇ", - Cayleys: "ℭ", - ccaps: "⩍", - Ccaron: "Č", - ccaron: "č", - Ccedil: "Ç", - ccedil: "ç", - Ccirc: "Ĉ", - ccirc: "ĉ", - Cconint: "∰", - ccups: "⩌", - ccupssm: "⩐", - Cdot: "Ċ", - cdot: "ċ", - cedil: "¸", - Cedilla: "¸", - cemptyv: "⦲", - cent: "¢", - CenterDot: "·", - centerdot: "·", - Cfr: "ℭ", - cfr: "𝔠", - CHcy: "Ч", - chcy: "ч", - check: "✓", - checkmark: "✓", - Chi: "Χ", - chi: "χ", - cir: "○", - circ: "ˆ", - circeq: "≗", - circlearrowleft: "↺", - circlearrowright: "↻", - circledast: "⊛", - circledcirc: "⊚", - circleddash: "⊝", - CircleDot: "⊙", - circledR: "®", - circledS: "Ⓢ", - CircleMinus: "⊖", - CirclePlus: "⊕", - CircleTimes: "⊗", - cirE: "⧃", - cire: "≗", - cirfnint: "⨐", - cirmid: "⫯", - cirscir: "⧂", - ClockwiseContourIntegral: "∲", - CloseCurlyDoubleQuote: "”", - CloseCurlyQuote: "’", - clubs: "♣", - clubsuit: "♣", - Colon: "∷", - colon: ":", - Colone: "⩴", - colone: "≔", - coloneq: "≔", - comma: ",", - commat: "@", - comp: "∁", - compfn: "∘", - complement: "∁", - complexes: "ℂ", - cong: "≅", - congdot: "⩭", - Congruent: "≡", - Conint: "∯", - conint: "∮", - ContourIntegral: "∮", - Copf: "ℂ", - copf: "𝕔", - coprod: "∐", - Coproduct: "∐", - COPY: "©", - copy: "©", - copysr: "℗", - CounterClockwiseContourIntegral: "∳", - crarr: "↵", - Cross: "⨯", - cross: "✗", - Cscr: "𝒞", - cscr: "𝒸", - csub: "⫏", - csube: "⫑", - csup: "⫐", - csupe: "⫒", - ctdot: "⋯", - cudarrl: "⤸", - cudarrr: "⤵", - cuepr: "⋞", - cuesc: "⋟", - cularr: "↶", - cularrp: "⤽", - Cup: "⋓", - cup: "∪", - cupbrcap: "⩈", - CupCap: "≍", - cupcap: "⩆", - cupcup: "⩊", - cupdot: "⊍", - cupor: "⩅", - cups: "∪︀", - curarr: "↷", - curarrm: "⤼", - curlyeqprec: "⋞", - curlyeqsucc: "⋟", - curlyvee: "⋎", - curlywedge: "⋏", - curren: "¤", - curvearrowleft: "↶", - curvearrowright: "↷", - cuvee: "⋎", - cuwed: "⋏", - cwconint: "∲", - cwint: "∱", - cylcty: "⌭", - Dagger: "‡", - dagger: "†", - daleth: "ℸ", - Darr: "↡", - dArr: "⇓", - darr: "↓", - dash: "‐", - Dashv: "⫤", - dashv: "⊣", - dbkarow: "⤏", - dblac: "˝", - Dcaron: "Ď", - dcaron: "ď", - Dcy: "Д", - dcy: "д", - DD: "ⅅ", - dd: "ⅆ", - ddagger: "‡", - ddarr: "⇊", - DDotrahd: "⤑", - ddotseq: "⩷", - deg: "°", - Del: "∇", - Delta: "Δ", - delta: "δ", - demptyv: "⦱", - dfisht: "⥿", - Dfr: "𝔇", - dfr: "𝔡", - dHar: "⥥", - dharl: "⇃", - dharr: "⇂", - DiacriticalAcute: "´", - DiacriticalDot: "˙", - DiacriticalDoubleAcute: "˝", - DiacriticalGrave: "`", - DiacriticalTilde: "˜", - diam: "⋄", - Diamond: "⋄", - diamond: "⋄", - diamondsuit: "♦", - diams: "♦", - die: "¨", - DifferentialD: "ⅆ", - digamma: "ϝ", - disin: "⋲", - div: "÷", - divide: "÷", - divideontimes: "⋇", - divonx: "⋇", - DJcy: "Ђ", - djcy: "ђ", - dlcorn: "⌞", - dlcrop: "⌍", - dollar: "$", - Dopf: "𝔻", - dopf: "𝕕", - Dot: "¨", - dot: "˙", - DotDot: "⃜", - doteq: "≐", - doteqdot: "≑", - DotEqual: "≐", - dotminus: "∸", - dotplus: "∔", - dotsquare: "⊡", - doublebarwedge: "⌆", - DoubleContourIntegral: "∯", - DoubleDot: "¨", - DoubleDownArrow: "⇓", - DoubleLeftArrow: "⇐", - DoubleLeftRightArrow: "⇔", - DoubleLeftTee: "⫤", - DoubleLongLeftArrow: "⟸", - DoubleLongLeftRightArrow: "⟺", - DoubleLongRightArrow: "⟹", - DoubleRightArrow: "⇒", - DoubleRightTee: "⊨", - DoubleUpArrow: "⇑", - DoubleUpDownArrow: "⇕", - DoubleVerticalBar: "∥", - DownArrow: "↓", - Downarrow: "⇓", - downarrow: "↓", - DownArrowBar: "⤓", - DownArrowUpArrow: "⇵", - DownBreve: "̑", - downdownarrows: "⇊", - downharpoonleft: "⇃", - downharpoonright: "⇂", - DownLeftRightVector: "⥐", - DownLeftTeeVector: "⥞", - DownLeftVector: "↽", - DownLeftVectorBar: "⥖", - DownRightTeeVector: "⥟", - DownRightVector: "⇁", - DownRightVectorBar: "⥗", - DownTee: "⊤", - DownTeeArrow: "↧", - drbkarow: "⤐", - drcorn: "⌟", - drcrop: "⌌", - Dscr: "𝒟", - dscr: "𝒹", - DScy: "Ѕ", - dscy: "ѕ", - dsol: "⧶", - Dstrok: "Đ", - dstrok: "đ", - dtdot: "⋱", - dtri: "▿", - dtrif: "▾", - duarr: "⇵", - duhar: "⥯", - dwangle: "⦦", - DZcy: "Џ", - dzcy: "џ", - dzigrarr: "⟿", - Eacute: "É", - eacute: "é", - easter: "⩮", - Ecaron: "Ě", - ecaron: "ě", - ecir: "≖", - Ecirc: "Ê", - ecirc: "ê", - ecolon: "≕", - Ecy: "Э", - ecy: "э", - eDDot: "⩷", - Edot: "Ė", - eDot: "≑", - edot: "ė", - ee: "ⅇ", - efDot: "≒", - Efr: "𝔈", - efr: "𝔢", - eg: "⪚", - Egrave: "È", - egrave: "è", - egs: "⪖", - egsdot: "⪘", - el: "⪙", - Element: "∈", - elinters: "⏧", - ell: "ℓ", - els: "⪕", - elsdot: "⪗", - Emacr: "Ē", - emacr: "ē", - empty: "∅", - emptyset: "∅", - EmptySmallSquare: "◻", - emptyv: "∅", - EmptyVerySmallSquare: "▫", - emsp: " ", - emsp13: " ", - emsp14: " ", - ENG: "Ŋ", - eng: "ŋ", - ensp: " ", - Eogon: "Ę", - eogon: "ę", - Eopf: "𝔼", - eopf: "𝕖", - epar: "⋕", - eparsl: "⧣", - eplus: "⩱", - epsi: "ε", - Epsilon: "Ε", - epsilon: "ε", - epsiv: "ϵ", - eqcirc: "≖", - eqcolon: "≕", - eqsim: "≂", - eqslantgtr: "⪖", - eqslantless: "⪕", - Equal: "⩵", - equals: "=", - EqualTilde: "≂", - equest: "≟", - Equilibrium: "⇌", - equiv: "≡", - equivDD: "⩸", - eqvparsl: "⧥", - erarr: "⥱", - erDot: "≓", - Escr: "ℰ", - escr: "ℯ", - esdot: "≐", - Esim: "⩳", - esim: "≂", - Eta: "Η", - eta: "η", - ETH: "Ð", - eth: "ð", - Euml: "Ë", - euml: "ë", - euro: "€", - excl: "!", - exist: "∃", - Exists: "∃", - expectation: "ℰ", - ExponentialE: "ⅇ", - exponentiale: "ⅇ", - fallingdotseq: "≒", - Fcy: "Ф", - fcy: "ф", - female: "♀", - ffilig: "ffi", - fflig: "ff", - ffllig: "ffl", - Ffr: "𝔉", - ffr: "𝔣", - filig: "fi", - FilledSmallSquare: "◼", - FilledVerySmallSquare: "▪", - fjlig: "fj", - flat: "♭", - fllig: "fl", - fltns: "▱", - fnof: "ƒ", - Fopf: "𝔽", - fopf: "𝕗", - ForAll: "∀", - forall: "∀", - fork: "⋔", - forkv: "⫙", - Fouriertrf: "ℱ", - fpartint: "⨍", - frac12: "½", - frac13: "⅓", - frac14: "¼", - frac15: "⅕", - frac16: "⅙", - frac18: "⅛", - frac23: "⅔", - frac25: "⅖", - frac34: "¾", - frac35: "⅗", - frac38: "⅜", - frac45: "⅘", - frac56: "⅚", - frac58: "⅝", - frac78: "⅞", - frasl: "⁄", - frown: "⌢", - Fscr: "ℱ", - fscr: "𝒻", - gacute: "ǵ", - Gamma: "Γ", - gamma: "γ", - Gammad: "Ϝ", - gammad: "ϝ", - gap: "⪆", - Gbreve: "Ğ", - gbreve: "ğ", - Gcedil: "Ģ", - Gcirc: "Ĝ", - gcirc: "ĝ", - Gcy: "Г", - gcy: "г", - Gdot: "Ġ", - gdot: "ġ", - gE: "≧", - ge: "≥", - gEl: "⪌", - gel: "⋛", - geq: "≥", - geqq: "≧", - geqslant: "⩾", - ges: "⩾", - gescc: "⪩", - gesdot: "⪀", - gesdoto: "⪂", - gesdotol: "⪄", - gesl: "⋛︀", - gesles: "⪔", - Gfr: "𝔊", - gfr: "𝔤", - Gg: "⋙", - gg: "≫", - ggg: "⋙", - gimel: "ℷ", - GJcy: "Ѓ", - gjcy: "ѓ", - gl: "≷", - gla: "⪥", - glE: "⪒", - glj: "⪤", - gnap: "⪊", - gnapprox: "⪊", - gnE: "≩", - gne: "⪈", - gneq: "⪈", - gneqq: "≩", - gnsim: "⋧", - Gopf: "𝔾", - gopf: "𝕘", - grave: "`", - GreaterEqual: "≥", - GreaterEqualLess: "⋛", - GreaterFullEqual: "≧", - GreaterGreater: "⪢", - GreaterLess: "≷", - GreaterSlantEqual: "⩾", - GreaterTilde: "≳", - Gscr: "𝒢", - gscr: "ℊ", - gsim: "≳", - gsime: "⪎", - gsiml: "⪐", - Gt: "≫", - GT: ">", - gt: ">", - gtcc: "⪧", - gtcir: "⩺", - gtdot: "⋗", - gtlPar: "⦕", - gtquest: "⩼", - gtrapprox: "⪆", - gtrarr: "⥸", - gtrdot: "⋗", - gtreqless: "⋛", - gtreqqless: "⪌", - gtrless: "≷", - gtrsim: "≳", - gvertneqq: "≩︀", - gvnE: "≩︀", - Hacek: "ˇ", - hairsp: " ", - half: "½", - hamilt: "ℋ", - HARDcy: "Ъ", - hardcy: "ъ", - hArr: "⇔", - harr: "↔", - harrcir: "⥈", - harrw: "↭", - Hat: "^", - hbar: "ℏ", - Hcirc: "Ĥ", - hcirc: "ĥ", - hearts: "♥", - heartsuit: "♥", - hellip: "…", - hercon: "⊹", - Hfr: "ℌ", - hfr: "𝔥", - HilbertSpace: "ℋ", - hksearow: "⤥", - hkswarow: "⤦", - hoarr: "⇿", - homtht: "∻", - hookleftarrow: "↩", - hookrightarrow: "↪", - Hopf: "ℍ", - hopf: "𝕙", - horbar: "―", - HorizontalLine: "─", - Hscr: "ℋ", - hscr: "𝒽", - hslash: "ℏ", - Hstrok: "Ħ", - hstrok: "ħ", - HumpDownHump: "≎", - HumpEqual: "≏", - hybull: "⁃", - hyphen: "‐", - Iacute: "Í", - iacute: "í", - ic: "⁣", - Icirc: "Î", - icirc: "î", - Icy: "И", - icy: "и", - Idot: "İ", - IEcy: "Е", - iecy: "е", - iexcl: "¡", - iff: "⇔", - Ifr: "ℑ", - ifr: "𝔦", - Igrave: "Ì", - igrave: "ì", - ii: "ⅈ", - iiiint: "⨌", - iiint: "∭", - iinfin: "⧜", - iiota: "℩", - IJlig: "IJ", - ijlig: "ij", - Im: "ℑ", - Imacr: "Ī", - imacr: "ī", - image: "ℑ", - ImaginaryI: "ⅈ", - imagline: "ℐ", - imagpart: "ℑ", - imath: "ı", - imof: "⊷", - imped: "Ƶ", - Implies: "⇒", - in: "∈", - incare: "℅", - infin: "∞", - infintie: "⧝", - inodot: "ı", - Int: "∬", - int: "∫", - intcal: "⊺", - integers: "ℤ", - Integral: "∫", - intercal: "⊺", - Intersection: "⋂", - intlarhk: "⨗", - intprod: "⨼", - InvisibleComma: "⁣", - InvisibleTimes: "⁢", - IOcy: "Ё", - iocy: "ё", - Iogon: "Į", - iogon: "į", - Iopf: "𝕀", - iopf: "𝕚", - Iota: "Ι", - iota: "ι", - iprod: "⨼", - iquest: "¿", - Iscr: "ℐ", - iscr: "𝒾", - isin: "∈", - isindot: "⋵", - isinE: "⋹", - isins: "⋴", - isinsv: "⋳", - isinv: "∈", - it: "⁢", - Itilde: "Ĩ", - itilde: "ĩ", - Iukcy: "І", - iukcy: "і", - Iuml: "Ï", - iuml: "ï", - Jcirc: "Ĵ", - jcirc: "ĵ", - Jcy: "Й", - jcy: "й", - Jfr: "𝔍", - jfr: "𝔧", - jmath: "ȷ", - Jopf: "𝕁", - jopf: "𝕛", - Jscr: "𝒥", - jscr: "𝒿", - Jsercy: "Ј", - jsercy: "ј", - Jukcy: "Є", - jukcy: "є", - Kappa: "Κ", - kappa: "κ", - kappav: "ϰ", - Kcedil: "Ķ", - kcedil: "ķ", - Kcy: "К", - kcy: "к", - Kfr: "𝔎", - kfr: "𝔨", - kgreen: "ĸ", - KHcy: "Х", - khcy: "х", - KJcy: "Ќ", - kjcy: "ќ", - Kopf: "𝕂", - kopf: "𝕜", - Kscr: "𝒦", - kscr: "𝓀", - lAarr: "⇚", - Lacute: "Ĺ", - lacute: "ĺ", - laemptyv: "⦴", - lagran: "ℒ", - Lambda: "Λ", - lambda: "λ", - Lang: "⟪", - lang: "⟨", - langd: "⦑", - langle: "⟨", - lap: "⪅", - Laplacetrf: "ℒ", - laquo: "«", - Larr: "↞", - lArr: "⇐", - larr: "←", - larrb: "⇤", - larrbfs: "⤟", - larrfs: "⤝", - larrhk: "↩", - larrlp: "↫", - larrpl: "⤹", - larrsim: "⥳", - larrtl: "↢", - lat: "⪫", - lAtail: "⤛", - latail: "⤙", - late: "⪭", - lates: "⪭︀", - lBarr: "⤎", - lbarr: "⤌", - lbbrk: "❲", - lbrace: "{", - lbrack: "[", - lbrke: "⦋", - lbrksld: "⦏", - lbrkslu: "⦍", - Lcaron: "Ľ", - lcaron: "ľ", - Lcedil: "Ļ", - lcedil: "ļ", - lceil: "⌈", - lcub: "{", - Lcy: "Л", - lcy: "л", - ldca: "⤶", - ldquo: "“", - ldquor: "„", - ldrdhar: "⥧", - ldrushar: "⥋", - ldsh: "↲", - lE: "≦", - le: "≤", - LeftAngleBracket: "⟨", - LeftArrow: "←", - Leftarrow: "⇐", - leftarrow: "←", - LeftArrowBar: "⇤", - LeftArrowRightArrow: "⇆", - leftarrowtail: "↢", - LeftCeiling: "⌈", - LeftDoubleBracket: "⟦", - LeftDownTeeVector: "⥡", - LeftDownVector: "⇃", - LeftDownVectorBar: "⥙", - LeftFloor: "⌊", - leftharpoondown: "↽", - leftharpoonup: "↼", - leftleftarrows: "⇇", - LeftRightArrow: "↔", - Leftrightarrow: "⇔", - leftrightarrow: "↔", - leftrightarrows: "⇆", - leftrightharpoons: "⇋", - leftrightsquigarrow: "↭", - LeftRightVector: "⥎", - LeftTee: "⊣", - LeftTeeArrow: "↤", - LeftTeeVector: "⥚", - leftthreetimes: "⋋", - LeftTriangle: "⊲", - LeftTriangleBar: "⧏", - LeftTriangleEqual: "⊴", - LeftUpDownVector: "⥑", - LeftUpTeeVector: "⥠", - LeftUpVector: "↿", - LeftUpVectorBar: "⥘", - LeftVector: "↼", - LeftVectorBar: "⥒", - lEg: "⪋", - leg: "⋚", - leq: "≤", - leqq: "≦", - leqslant: "⩽", - les: "⩽", - lescc: "⪨", - lesdot: "⩿", - lesdoto: "⪁", - lesdotor: "⪃", - lesg: "⋚︀", - lesges: "⪓", - lessapprox: "⪅", - lessdot: "⋖", - lesseqgtr: "⋚", - lesseqqgtr: "⪋", - LessEqualGreater: "⋚", - LessFullEqual: "≦", - LessGreater: "≶", - lessgtr: "≶", - LessLess: "⪡", - lesssim: "≲", - LessSlantEqual: "⩽", - LessTilde: "≲", - lfisht: "⥼", - lfloor: "⌊", - Lfr: "𝔏", - lfr: "𝔩", - lg: "≶", - lgE: "⪑", - lHar: "⥢", - lhard: "↽", - lharu: "↼", - lharul: "⥪", - lhblk: "▄", - LJcy: "Љ", - ljcy: "љ", - Ll: "⋘", - ll: "≪", - llarr: "⇇", - llcorner: "⌞", - Lleftarrow: "⇚", - llhard: "⥫", - lltri: "◺", - Lmidot: "Ŀ", - lmidot: "ŀ", - lmoust: "⎰", - lmoustache: "⎰", - lnap: "⪉", - lnapprox: "⪉", - lnE: "≨", - lne: "⪇", - lneq: "⪇", - lneqq: "≨", - lnsim: "⋦", - loang: "⟬", - loarr: "⇽", - lobrk: "⟦", - LongLeftArrow: "⟵", - Longleftarrow: "⟸", - longleftarrow: "⟵", - LongLeftRightArrow: "⟷", - Longleftrightarrow: "⟺", - longleftrightarrow: "⟷", - longmapsto: "⟼", - LongRightArrow: "⟶", - Longrightarrow: "⟹", - longrightarrow: "⟶", - looparrowleft: "↫", - looparrowright: "↬", - lopar: "⦅", - Lopf: "𝕃", - lopf: "𝕝", - loplus: "⨭", - lotimes: "⨴", - lowast: "∗", - lowbar: "_", - LowerLeftArrow: "↙", - LowerRightArrow: "↘", - loz: "◊", - lozenge: "◊", - lozf: "⧫", - lpar: "(", - lparlt: "⦓", - lrarr: "⇆", - lrcorner: "⌟", - lrhar: "⇋", - lrhard: "⥭", - lrm: "‎", - lrtri: "⊿", - lsaquo: "‹", - Lscr: "ℒ", - lscr: "𝓁", - Lsh: "↰", - lsh: "↰", - lsim: "≲", - lsime: "⪍", - lsimg: "⪏", - lsqb: "[", - lsquo: "‘", - lsquor: "‚", - Lstrok: "Ł", - lstrok: "ł", - Lt: "≪", - LT: "<", - lt: "<", - ltcc: "⪦", - ltcir: "⩹", - ltdot: "⋖", - lthree: "⋋", - ltimes: "⋉", - ltlarr: "⥶", - ltquest: "⩻", - ltri: "◃", - ltrie: "⊴", - ltrif: "◂", - ltrPar: "⦖", - lurdshar: "⥊", - luruhar: "⥦", - lvertneqq: "≨︀", - lvnE: "≨︀", - macr: "¯", - male: "♂", - malt: "✠", - maltese: "✠", - Map: "⤅", - map: "↦", - mapsto: "↦", - mapstodown: "↧", - mapstoleft: "↤", - mapstoup: "↥", - marker: "▮", - mcomma: "⨩", - Mcy: "М", - mcy: "м", - mdash: "—", - mDDot: "∺", - measuredangle: "∡", - MediumSpace: " ", - Mellintrf: "ℳ", - Mfr: "𝔐", - mfr: "𝔪", - mho: "℧", - micro: "µ", - mid: "∣", - midast: "*", - midcir: "⫰", - middot: "·", - minus: "−", - minusb: "⊟", - minusd: "∸", - minusdu: "⨪", - MinusPlus: "∓", - mlcp: "⫛", - mldr: "…", - mnplus: "∓", - models: "⊧", - Mopf: "𝕄", - mopf: "𝕞", - mp: "∓", - Mscr: "ℳ", - mscr: "𝓂", - mstpos: "∾", - Mu: "Μ", - mu: "μ", - multimap: "⊸", - mumap: "⊸", - nabla: "∇", - Nacute: "Ń", - nacute: "ń", - nang: "∠⃒", - nap: "≉", - napE: "⩰̸", - napid: "≋̸", - napos: "ʼn", - napprox: "≉", - natur: "♮", - natural: "♮", - naturals: "ℕ", - nbsp: " ", - nbump: "≎̸", - nbumpe: "≏̸", - ncap: "⩃", - Ncaron: "Ň", - ncaron: "ň", - Ncedil: "Ņ", - ncedil: "ņ", - ncong: "≇", - ncongdot: "⩭̸", - ncup: "⩂", - Ncy: "Н", - ncy: "н", - ndash: "–", - ne: "≠", - nearhk: "⤤", - neArr: "⇗", - nearr: "↗", - nearrow: "↗", - nedot: "≐̸", - NegativeMediumSpace: "​", - NegativeThickSpace: "​", - NegativeThinSpace: "​", - NegativeVeryThinSpace: "​", - nequiv: "≢", - nesear: "⤨", - nesim: "≂̸", - NestedGreaterGreater: "≫", - NestedLessLess: "≪", - NewLine: ` -`, - nexist: "∄", - nexists: "∄", - Nfr: "𝔑", - nfr: "𝔫", - ngE: "≧̸", - nge: "≱", - ngeq: "≱", - ngeqq: "≧̸", - ngeqslant: "⩾̸", - nges: "⩾̸", - nGg: "⋙̸", - ngsim: "≵", - nGt: "≫⃒", - ngt: "≯", - ngtr: "≯", - nGtv: "≫̸", - nhArr: "⇎", - nharr: "↮", - nhpar: "⫲", - ni: "∋", - nis: "⋼", - nisd: "⋺", - niv: "∋", - NJcy: "Њ", - njcy: "њ", - nlArr: "⇍", - nlarr: "↚", - nldr: "‥", - nlE: "≦̸", - nle: "≰", - nLeftarrow: "⇍", - nleftarrow: "↚", - nLeftrightarrow: "⇎", - nleftrightarrow: "↮", - nleq: "≰", - nleqq: "≦̸", - nleqslant: "⩽̸", - nles: "⩽̸", - nless: "≮", - nLl: "⋘̸", - nlsim: "≴", - nLt: "≪⃒", - nlt: "≮", - nltri: "⋪", - nltrie: "⋬", - nLtv: "≪̸", - nmid: "∤", - NoBreak: "⁠", - NonBreakingSpace: " ", - Nopf: "ℕ", - nopf: "𝕟", - Not: "⫬", - not: "¬", - NotCongruent: "≢", - NotCupCap: "≭", - NotDoubleVerticalBar: "∦", - NotElement: "∉", - NotEqual: "≠", - NotEqualTilde: "≂̸", - NotExists: "∄", - NotGreater: "≯", - NotGreaterEqual: "≱", - NotGreaterFullEqual: "≧̸", - NotGreaterGreater: "≫̸", - NotGreaterLess: "≹", - NotGreaterSlantEqual: "⩾̸", - NotGreaterTilde: "≵", - NotHumpDownHump: "≎̸", - NotHumpEqual: "≏̸", - notin: "∉", - notindot: "⋵̸", - notinE: "⋹̸", - notinva: "∉", - notinvb: "⋷", - notinvc: "⋶", - NotLeftTriangle: "⋪", - NotLeftTriangleBar: "⧏̸", - NotLeftTriangleEqual: "⋬", - NotLess: "≮", - NotLessEqual: "≰", - NotLessGreater: "≸", - NotLessLess: "≪̸", - NotLessSlantEqual: "⩽̸", - NotLessTilde: "≴", - NotNestedGreaterGreater: "⪢̸", - NotNestedLessLess: "⪡̸", - notni: "∌", - notniva: "∌", - notnivb: "⋾", - notnivc: "⋽", - NotPrecedes: "⊀", - NotPrecedesEqual: "⪯̸", - NotPrecedesSlantEqual: "⋠", - NotReverseElement: "∌", - NotRightTriangle: "⋫", - NotRightTriangleBar: "⧐̸", - NotRightTriangleEqual: "⋭", - NotSquareSubset: "⊏̸", - NotSquareSubsetEqual: "⋢", - NotSquareSuperset: "⊐̸", - NotSquareSupersetEqual: "⋣", - NotSubset: "⊂⃒", - NotSubsetEqual: "⊈", - NotSucceeds: "⊁", - NotSucceedsEqual: "⪰̸", - NotSucceedsSlantEqual: "⋡", - NotSucceedsTilde: "≿̸", - NotSuperset: "⊃⃒", - NotSupersetEqual: "⊉", - NotTilde: "≁", - NotTildeEqual: "≄", - NotTildeFullEqual: "≇", - NotTildeTilde: "≉", - NotVerticalBar: "∤", - npar: "∦", - nparallel: "∦", - nparsl: "⫽⃥", - npart: "∂̸", - npolint: "⨔", - npr: "⊀", - nprcue: "⋠", - npre: "⪯̸", - nprec: "⊀", - npreceq: "⪯̸", - nrArr: "⇏", - nrarr: "↛", - nrarrc: "⤳̸", - nrarrw: "↝̸", - nRightarrow: "⇏", - nrightarrow: "↛", - nrtri: "⋫", - nrtrie: "⋭", - nsc: "⊁", - nsccue: "⋡", - nsce: "⪰̸", - Nscr: "𝒩", - nscr: "𝓃", - nshortmid: "∤", - nshortparallel: "∦", - nsim: "≁", - nsime: "≄", - nsimeq: "≄", - nsmid: "∤", - nspar: "∦", - nsqsube: "⋢", - nsqsupe: "⋣", - nsub: "⊄", - nsubE: "⫅̸", - nsube: "⊈", - nsubset: "⊂⃒", - nsubseteq: "⊈", - nsubseteqq: "⫅̸", - nsucc: "⊁", - nsucceq: "⪰̸", - nsup: "⊅", - nsupE: "⫆̸", - nsupe: "⊉", - nsupset: "⊃⃒", - nsupseteq: "⊉", - nsupseteqq: "⫆̸", - ntgl: "≹", - Ntilde: "Ñ", - ntilde: "ñ", - ntlg: "≸", - ntriangleleft: "⋪", - ntrianglelefteq: "⋬", - ntriangleright: "⋫", - ntrianglerighteq: "⋭", - Nu: "Ν", - nu: "ν", - num: "#", - numero: "№", - numsp: " ", - nvap: "≍⃒", - nVDash: "⊯", - nVdash: "⊮", - nvDash: "⊭", - nvdash: "⊬", - nvge: "≥⃒", - nvgt: ">⃒", - nvHarr: "⤄", - nvinfin: "⧞", - nvlArr: "⤂", - nvle: "≤⃒", - nvlt: "<⃒", - nvltrie: "⊴⃒", - nvrArr: "⤃", - nvrtrie: "⊵⃒", - nvsim: "∼⃒", - nwarhk: "⤣", - nwArr: "⇖", - nwarr: "↖", - nwarrow: "↖", - nwnear: "⤧", - Oacute: "Ó", - oacute: "ó", - oast: "⊛", - ocir: "⊚", - Ocirc: "Ô", - ocirc: "ô", - Ocy: "О", - ocy: "о", - odash: "⊝", - Odblac: "Ő", - odblac: "ő", - odiv: "⨸", - odot: "⊙", - odsold: "⦼", - OElig: "Œ", - oelig: "œ", - ofcir: "⦿", - Ofr: "𝔒", - ofr: "𝔬", - ogon: "˛", - Ograve: "Ò", - ograve: "ò", - ogt: "⧁", - ohbar: "⦵", - ohm: "Ω", - oint: "∮", - olarr: "↺", - olcir: "⦾", - olcross: "⦻", - oline: "‾", - olt: "⧀", - Omacr: "Ō", - omacr: "ō", - Omega: "Ω", - omega: "ω", - Omicron: "Ο", - omicron: "ο", - omid: "⦶", - ominus: "⊖", - Oopf: "𝕆", - oopf: "𝕠", - opar: "⦷", - OpenCurlyDoubleQuote: "“", - OpenCurlyQuote: "‘", - operp: "⦹", - oplus: "⊕", - Or: "⩔", - or: "∨", - orarr: "↻", - ord: "⩝", - order: "ℴ", - orderof: "ℴ", - ordf: "ª", - ordm: "º", - origof: "⊶", - oror: "⩖", - orslope: "⩗", - orv: "⩛", - oS: "Ⓢ", - Oscr: "𝒪", - oscr: "ℴ", - Oslash: "Ø", - oslash: "ø", - osol: "⊘", - Otilde: "Õ", - otilde: "õ", - Otimes: "⨷", - otimes: "⊗", - otimesas: "⨶", - Ouml: "Ö", - ouml: "ö", - ovbar: "⌽", - OverBar: "‾", - OverBrace: "⏞", - OverBracket: "⎴", - OverParenthesis: "⏜", - par: "∥", - para: "¶", - parallel: "∥", - parsim: "⫳", - parsl: "⫽", - part: "∂", - PartialD: "∂", - Pcy: "П", - pcy: "п", - percnt: "%", - period: ".", - permil: "‰", - perp: "⊥", - pertenk: "‱", - Pfr: "𝔓", - pfr: "𝔭", - Phi: "Φ", - phi: "φ", - phiv: "ϕ", - phmmat: "ℳ", - phone: "☎", - Pi: "Π", - pi: "π", - pitchfork: "⋔", - piv: "ϖ", - planck: "ℏ", - planckh: "ℎ", - plankv: "ℏ", - plus: "+", - plusacir: "⨣", - plusb: "⊞", - pluscir: "⨢", - plusdo: "∔", - plusdu: "⨥", - pluse: "⩲", - PlusMinus: "±", - plusmn: "±", - plussim: "⨦", - plustwo: "⨧", - pm: "±", - Poincareplane: "ℌ", - pointint: "⨕", - Popf: "ℙ", - popf: "𝕡", - pound: "£", - Pr: "⪻", - pr: "≺", - prap: "⪷", - prcue: "≼", - prE: "⪳", - pre: "⪯", - prec: "≺", - precapprox: "⪷", - preccurlyeq: "≼", - Precedes: "≺", - PrecedesEqual: "⪯", - PrecedesSlantEqual: "≼", - PrecedesTilde: "≾", - preceq: "⪯", - precnapprox: "⪹", - precneqq: "⪵", - precnsim: "⋨", - precsim: "≾", - Prime: "″", - prime: "′", - primes: "ℙ", - prnap: "⪹", - prnE: "⪵", - prnsim: "⋨", - prod: "∏", - Product: "∏", - profalar: "⌮", - profline: "⌒", - profsurf: "⌓", - prop: "∝", - Proportion: "∷", - Proportional: "∝", - propto: "∝", - prsim: "≾", - prurel: "⊰", - Pscr: "𝒫", - pscr: "𝓅", - Psi: "Ψ", - psi: "ψ", - puncsp: " ", - Qfr: "𝔔", - qfr: "𝔮", - qint: "⨌", - Qopf: "ℚ", - qopf: "𝕢", - qprime: "⁗", - Qscr: "𝒬", - qscr: "𝓆", - quaternions: "ℍ", - quatint: "⨖", - quest: "?", - questeq: "≟", - QUOT: '"', - quot: '"', - rAarr: "⇛", - race: "∽̱", - Racute: "Ŕ", - racute: "ŕ", - radic: "√", - raemptyv: "⦳", - Rang: "⟫", - rang: "⟩", - rangd: "⦒", - range: "⦥", - rangle: "⟩", - raquo: "»", - Rarr: "↠", - rArr: "⇒", - rarr: "→", - rarrap: "⥵", - rarrb: "⇥", - rarrbfs: "⤠", - rarrc: "⤳", - rarrfs: "⤞", - rarrhk: "↪", - rarrlp: "↬", - rarrpl: "⥅", - rarrsim: "⥴", - Rarrtl: "⤖", - rarrtl: "↣", - rarrw: "↝", - rAtail: "⤜", - ratail: "⤚", - ratio: "∶", - rationals: "ℚ", - RBarr: "⤐", - rBarr: "⤏", - rbarr: "⤍", - rbbrk: "❳", - rbrace: "}", - rbrack: "]", - rbrke: "⦌", - rbrksld: "⦎", - rbrkslu: "⦐", - Rcaron: "Ř", - rcaron: "ř", - Rcedil: "Ŗ", - rcedil: "ŗ", - rceil: "⌉", - rcub: "}", - Rcy: "Р", - rcy: "р", - rdca: "⤷", - rdldhar: "⥩", - rdquo: "”", - rdquor: "”", - rdsh: "↳", - Re: "ℜ", - real: "ℜ", - realine: "ℛ", - realpart: "ℜ", - reals: "ℝ", - rect: "▭", - REG: "®", - reg: "®", - ReverseElement: "∋", - ReverseEquilibrium: "⇋", - ReverseUpEquilibrium: "⥯", - rfisht: "⥽", - rfloor: "⌋", - Rfr: "ℜ", - rfr: "𝔯", - rHar: "⥤", - rhard: "⇁", - rharu: "⇀", - rharul: "⥬", - Rho: "Ρ", - rho: "ρ", - rhov: "ϱ", - RightAngleBracket: "⟩", - RightArrow: "→", - Rightarrow: "⇒", - rightarrow: "→", - RightArrowBar: "⇥", - RightArrowLeftArrow: "⇄", - rightarrowtail: "↣", - RightCeiling: "⌉", - RightDoubleBracket: "⟧", - RightDownTeeVector: "⥝", - RightDownVector: "⇂", - RightDownVectorBar: "⥕", - RightFloor: "⌋", - rightharpoondown: "⇁", - rightharpoonup: "⇀", - rightleftarrows: "⇄", - rightleftharpoons: "⇌", - rightrightarrows: "⇉", - rightsquigarrow: "↝", - RightTee: "⊢", - RightTeeArrow: "↦", - RightTeeVector: "⥛", - rightthreetimes: "⋌", - RightTriangle: "⊳", - RightTriangleBar: "⧐", - RightTriangleEqual: "⊵", - RightUpDownVector: "⥏", - RightUpTeeVector: "⥜", - RightUpVector: "↾", - RightUpVectorBar: "⥔", - RightVector: "⇀", - RightVectorBar: "⥓", - ring: "˚", - risingdotseq: "≓", - rlarr: "⇄", - rlhar: "⇌", - rlm: "‏", - rmoust: "⎱", - rmoustache: "⎱", - rnmid: "⫮", - roang: "⟭", - roarr: "⇾", - robrk: "⟧", - ropar: "⦆", - Ropf: "ℝ", - ropf: "𝕣", - roplus: "⨮", - rotimes: "⨵", - RoundImplies: "⥰", - rpar: ")", - rpargt: "⦔", - rppolint: "⨒", - rrarr: "⇉", - Rrightarrow: "⇛", - rsaquo: "›", - Rscr: "ℛ", - rscr: "𝓇", - Rsh: "↱", - rsh: "↱", - rsqb: "]", - rsquo: "’", - rsquor: "’", - rthree: "⋌", - rtimes: "⋊", - rtri: "▹", - rtrie: "⊵", - rtrif: "▸", - rtriltri: "⧎", - RuleDelayed: "⧴", - ruluhar: "⥨", - rx: "℞", - Sacute: "Ś", - sacute: "ś", - sbquo: "‚", - Sc: "⪼", - sc: "≻", - scap: "⪸", - Scaron: "Š", - scaron: "š", - sccue: "≽", - scE: "⪴", - sce: "⪰", - Scedil: "Ş", - scedil: "ş", - Scirc: "Ŝ", - scirc: "ŝ", - scnap: "⪺", - scnE: "⪶", - scnsim: "⋩", - scpolint: "⨓", - scsim: "≿", - Scy: "С", - scy: "с", - sdot: "⋅", - sdotb: "⊡", - sdote: "⩦", - searhk: "⤥", - seArr: "⇘", - searr: "↘", - searrow: "↘", - sect: "§", - semi: ";", - seswar: "⤩", - setminus: "∖", - setmn: "∖", - sext: "✶", - Sfr: "𝔖", - sfr: "𝔰", - sfrown: "⌢", - sharp: "♯", - SHCHcy: "Щ", - shchcy: "щ", - SHcy: "Ш", - shcy: "ш", - ShortDownArrow: "↓", - ShortLeftArrow: "←", - shortmid: "∣", - shortparallel: "∥", - ShortRightArrow: "→", - ShortUpArrow: "↑", - shy: "­", - Sigma: "Σ", - sigma: "σ", - sigmaf: "ς", - sigmav: "ς", - sim: "∼", - simdot: "⩪", - sime: "≃", - simeq: "≃", - simg: "⪞", - simgE: "⪠", - siml: "⪝", - simlE: "⪟", - simne: "≆", - simplus: "⨤", - simrarr: "⥲", - slarr: "←", - SmallCircle: "∘", - smallsetminus: "∖", - smashp: "⨳", - smeparsl: "⧤", - smid: "∣", - smile: "⌣", - smt: "⪪", - smte: "⪬", - smtes: "⪬︀", - SOFTcy: "Ь", - softcy: "ь", - sol: "/", - solb: "⧄", - solbar: "⌿", - Sopf: "𝕊", - sopf: "𝕤", - spades: "♠", - spadesuit: "♠", - spar: "∥", - sqcap: "⊓", - sqcaps: "⊓︀", - sqcup: "⊔", - sqcups: "⊔︀", - Sqrt: "√", - sqsub: "⊏", - sqsube: "⊑", - sqsubset: "⊏", - sqsubseteq: "⊑", - sqsup: "⊐", - sqsupe: "⊒", - sqsupset: "⊐", - sqsupseteq: "⊒", - squ: "□", - Square: "□", - square: "□", - SquareIntersection: "⊓", - SquareSubset: "⊏", - SquareSubsetEqual: "⊑", - SquareSuperset: "⊐", - SquareSupersetEqual: "⊒", - SquareUnion: "⊔", - squarf: "▪", - squf: "▪", - srarr: "→", - Sscr: "𝒮", - sscr: "𝓈", - ssetmn: "∖", - ssmile: "⌣", - sstarf: "⋆", - Star: "⋆", - star: "☆", - starf: "★", - straightepsilon: "ϵ", - straightphi: "ϕ", - strns: "¯", - Sub: "⋐", - sub: "⊂", - subdot: "⪽", - subE: "⫅", - sube: "⊆", - subedot: "⫃", - submult: "⫁", - subnE: "⫋", - subne: "⊊", - subplus: "⪿", - subrarr: "⥹", - Subset: "⋐", - subset: "⊂", - subseteq: "⊆", - subseteqq: "⫅", - SubsetEqual: "⊆", - subsetneq: "⊊", - subsetneqq: "⫋", - subsim: "⫇", - subsub: "⫕", - subsup: "⫓", - succ: "≻", - succapprox: "⪸", - succcurlyeq: "≽", - Succeeds: "≻", - SucceedsEqual: "⪰", - SucceedsSlantEqual: "≽", - SucceedsTilde: "≿", - succeq: "⪰", - succnapprox: "⪺", - succneqq: "⪶", - succnsim: "⋩", - succsim: "≿", - SuchThat: "∋", - Sum: "∑", - sum: "∑", - sung: "♪", - Sup: "⋑", - sup: "⊃", - sup1: "¹", - sup2: "²", - sup3: "³", - supdot: "⪾", - supdsub: "⫘", - supE: "⫆", - supe: "⊇", - supedot: "⫄", - Superset: "⊃", - SupersetEqual: "⊇", - suphsol: "⟉", - suphsub: "⫗", - suplarr: "⥻", - supmult: "⫂", - supnE: "⫌", - supne: "⊋", - supplus: "⫀", - Supset: "⋑", - supset: "⊃", - supseteq: "⊇", - supseteqq: "⫆", - supsetneq: "⊋", - supsetneqq: "⫌", - supsim: "⫈", - supsub: "⫔", - supsup: "⫖", - swarhk: "⤦", - swArr: "⇙", - swarr: "↙", - swarrow: "↙", - swnwar: "⤪", - szlig: "ß", - Tab: " ", - target: "⌖", - Tau: "Τ", - tau: "τ", - tbrk: "⎴", - Tcaron: "Ť", - tcaron: "ť", - Tcedil: "Ţ", - tcedil: "ţ", - Tcy: "Т", - tcy: "т", - tdot: "⃛", - telrec: "⌕", - Tfr: "𝔗", - tfr: "𝔱", - there4: "∴", - Therefore: "∴", - therefore: "∴", - Theta: "Θ", - theta: "θ", - thetasym: "ϑ", - thetav: "ϑ", - thickapprox: "≈", - thicksim: "∼", - ThickSpace: "  ", - thinsp: " ", - ThinSpace: " ", - thkap: "≈", - thksim: "∼", - THORN: "Þ", - thorn: "þ", - Tilde: "∼", - tilde: "˜", - TildeEqual: "≃", - TildeFullEqual: "≅", - TildeTilde: "≈", - times: "×", - timesb: "⊠", - timesbar: "⨱", - timesd: "⨰", - tint: "∭", - toea: "⤨", - top: "⊤", - topbot: "⌶", - topcir: "⫱", - Topf: "𝕋", - topf: "𝕥", - topfork: "⫚", - tosa: "⤩", - tprime: "‴", - TRADE: "™", - trade: "™", - triangle: "▵", - triangledown: "▿", - triangleleft: "◃", - trianglelefteq: "⊴", - triangleq: "≜", - triangleright: "▹", - trianglerighteq: "⊵", - tridot: "◬", - trie: "≜", - triminus: "⨺", - TripleDot: "⃛", - triplus: "⨹", - trisb: "⧍", - tritime: "⨻", - trpezium: "⏢", - Tscr: "𝒯", - tscr: "𝓉", - TScy: "Ц", - tscy: "ц", - TSHcy: "Ћ", - tshcy: "ћ", - Tstrok: "Ŧ", - tstrok: "ŧ", - twixt: "≬", - twoheadleftarrow: "↞", - twoheadrightarrow: "↠", - Uacute: "Ú", - uacute: "ú", - Uarr: "↟", - uArr: "⇑", - uarr: "↑", - Uarrocir: "⥉", - Ubrcy: "Ў", - ubrcy: "ў", - Ubreve: "Ŭ", - ubreve: "ŭ", - Ucirc: "Û", - ucirc: "û", - Ucy: "У", - ucy: "у", - udarr: "⇅", - Udblac: "Ű", - udblac: "ű", - udhar: "⥮", - ufisht: "⥾", - Ufr: "𝔘", - ufr: "𝔲", - Ugrave: "Ù", - ugrave: "ù", - uHar: "⥣", - uharl: "↿", - uharr: "↾", - uhblk: "▀", - ulcorn: "⌜", - ulcorner: "⌜", - ulcrop: "⌏", - ultri: "◸", - Umacr: "Ū", - umacr: "ū", - uml: "¨", - UnderBar: "_", - UnderBrace: "⏟", - UnderBracket: "⎵", - UnderParenthesis: "⏝", - Union: "⋃", - UnionPlus: "⊎", - Uogon: "Ų", - uogon: "ų", - Uopf: "𝕌", - uopf: "𝕦", - UpArrow: "↑", - Uparrow: "⇑", - uparrow: "↑", - UpArrowBar: "⤒", - UpArrowDownArrow: "⇅", - UpDownArrow: "↕", - Updownarrow: "⇕", - updownarrow: "↕", - UpEquilibrium: "⥮", - upharpoonleft: "↿", - upharpoonright: "↾", - uplus: "⊎", - UpperLeftArrow: "↖", - UpperRightArrow: "↗", - Upsi: "ϒ", - upsi: "υ", - upsih: "ϒ", - Upsilon: "Υ", - upsilon: "υ", - UpTee: "⊥", - UpTeeArrow: "↥", - upuparrows: "⇈", - urcorn: "⌝", - urcorner: "⌝", - urcrop: "⌎", - Uring: "Ů", - uring: "ů", - urtri: "◹", - Uscr: "𝒰", - uscr: "𝓊", - utdot: "⋰", - Utilde: "Ũ", - utilde: "ũ", - utri: "▵", - utrif: "▴", - uuarr: "⇈", - Uuml: "Ü", - uuml: "ü", - uwangle: "⦧", - vangrt: "⦜", - varepsilon: "ϵ", - varkappa: "ϰ", - varnothing: "∅", - varphi: "ϕ", - varpi: "ϖ", - varpropto: "∝", - vArr: "⇕", - varr: "↕", - varrho: "ϱ", - varsigma: "ς", - varsubsetneq: "⊊︀", - varsubsetneqq: "⫋︀", - varsupsetneq: "⊋︀", - varsupsetneqq: "⫌︀", - vartheta: "ϑ", - vartriangleleft: "⊲", - vartriangleright: "⊳", - Vbar: "⫫", - vBar: "⫨", - vBarv: "⫩", - Vcy: "В", - vcy: "в", - VDash: "⊫", - Vdash: "⊩", - vDash: "⊨", - vdash: "⊢", - Vdashl: "⫦", - Vee: "⋁", - vee: "∨", - veebar: "⊻", - veeeq: "≚", - vellip: "⋮", - Verbar: "‖", - verbar: "|", - Vert: "‖", - vert: "|", - VerticalBar: "∣", - VerticalLine: "|", - VerticalSeparator: "❘", - VerticalTilde: "≀", - VeryThinSpace: " ", - Vfr: "𝔙", - vfr: "𝔳", - vltri: "⊲", - vnsub: "⊂⃒", - vnsup: "⊃⃒", - Vopf: "𝕍", - vopf: "𝕧", - vprop: "∝", - vrtri: "⊳", - Vscr: "𝒱", - vscr: "𝓋", - vsubnE: "⫋︀", - vsubne: "⊊︀", - vsupnE: "⫌︀", - vsupne: "⊋︀", - Vvdash: "⊪", - vzigzag: "⦚", - Wcirc: "Ŵ", - wcirc: "ŵ", - wedbar: "⩟", - Wedge: "⋀", - wedge: "∧", - wedgeq: "≙", - weierp: "℘", - Wfr: "𝔚", - wfr: "𝔴", - Wopf: "𝕎", - wopf: "𝕨", - wp: "℘", - wr: "≀", - wreath: "≀", - Wscr: "𝒲", - wscr: "𝓌", - xcap: "⋂", - xcirc: "◯", - xcup: "⋃", - xdtri: "▽", - Xfr: "𝔛", - xfr: "𝔵", - xhArr: "⟺", - xharr: "⟷", - Xi: "Ξ", - xi: "ξ", - xlArr: "⟸", - xlarr: "⟵", - xmap: "⟼", - xnis: "⋻", - xodot: "⨀", - Xopf: "𝕏", - xopf: "𝕩", - xoplus: "⨁", - xotime: "⨂", - xrArr: "⟹", - xrarr: "⟶", - Xscr: "𝒳", - xscr: "𝓍", - xsqcup: "⨆", - xuplus: "⨄", - xutri: "△", - xvee: "⋁", - xwedge: "⋀", - Yacute: "Ý", - yacute: "ý", - YAcy: "Я", - yacy: "я", - Ycirc: "Ŷ", - ycirc: "ŷ", - Ycy: "Ы", - ycy: "ы", - yen: "¥", - Yfr: "𝔜", - yfr: "𝔶", - YIcy: "Ї", - yicy: "ї", - Yopf: "𝕐", - yopf: "𝕪", - Yscr: "𝒴", - yscr: "𝓎", - YUcy: "Ю", - yucy: "ю", - Yuml: "Ÿ", - yuml: "ÿ", - Zacute: "Ź", - zacute: "ź", - Zcaron: "Ž", - zcaron: "ž", - Zcy: "З", - zcy: "з", - Zdot: "Ż", - zdot: "ż", - zeetrf: "ℨ", - ZeroWidthSpace: "​", - Zeta: "Ζ", - zeta: "ζ", - Zfr: "ℨ", - zfr: "𝔷", - ZHcy: "Ж", - zhcy: "ж", - zigrarr: "⇝", - Zopf: "ℤ", - zopf: "𝕫", - Zscr: "𝒵", - zscr: "𝓏", - zwj: "‍", - zwnj: "‌" - }), t.entityMap = t.HTML_ENTITIES; -})(wt); -var Ur = {}, fr = Me.NAMESPACE, Br = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, Jr = new RegExp("[\\-\\.0-9" + Br.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"), Zr = new RegExp("^" + Br.source + Jr.source + "*(?::" + Br.source + Jr.source + "*)?$"), sr = 0, ke = 1, Je = 2, ar = 3, Ze = 4, Ke = 5, lr = 6, gr = 7; -function nr(t, u) { - this.message = t, this.locator = u, Error.captureStackTrace && Error.captureStackTrace(this, nr); -} -nr.prototype = new Error(); -nr.prototype.name = nr.name; -function Bt() { -} -Bt.prototype = { - parse: function(t, u, n) { - var s = this.domBuilder; - s.startDocument(), St(u, u = {}), pu( - t, - u, - n, - s, - this.errorHandler - ), s.endDocument(); - } -}; -function pu(t, u, n, s, c) { - function f(M) { - if (M > 65535) { - M -= 65536; - var j = 55296 + (M >> 10), ce = 56320 + (M & 1023); - return String.fromCharCode(j, ce); - } else - return String.fromCharCode(M); - } - function A(M) { - var j = M.slice(1, -1); - return Object.hasOwnProperty.call(n, j) ? n[j] : j.charAt(0) === "#" ? f(parseInt(j.substr(1).replace("x", "0x"))) : (c.error("entity not found:" + M), M); - } - function y(M) { - if (M > H) { - var j = t.substring(H, M).replace(/&#?\w+;/g, A); - q && N(H), s.characters(j, 0, M - H), H = M; - } - } - function N(M, j) { - for (; M >= S && (j = k.exec(t)); ) - w = j.index, S = w + j[0].length, q.lineNumber++; - q.columnNumber = M - w + 1; - } - for (var w = 0, S = 0, k = /.*(?:\r\n?|\n)|.*$/g, q = s.locator, $ = [{ currentNSMap: u }], J = {}, H = 0; ; ) { - try { - var G = t.indexOf("<", H); - if (G < 0) { - if (!t.substr(H).match(/^\s*$/)) { - var Q = s.doc, He = Q.createTextNode(t.substr(H)); - Q.appendChild(He), s.currentElement = He; - } - return; - } - switch (G > H && y(G), t.charAt(G + 1)) { - case "/": - var X = t.indexOf(">", G + 3), Y = t.substring(G + 2, X).replace(/[ \t\n\r]+$/g, ""), te = $.pop(); - X < 0 ? (Y = t.substring(G + 2).replace(/[\s<].*/, ""), c.error("end tag name: " + Y + " is not complete:" + te.tagName), X = G + 1 + Y.length) : Y.match(/\s H ? H = X : y(Math.max(G, H) + 1); - } -} -function Kr(t, u) { - return u.lineNumber = t.lineNumber, u.columnNumber = t.columnNumber, u; -} -function cu(t, u, n, s, c, f) { - function A(q, $, J) { - n.attributeNames.hasOwnProperty(q) && f.fatalError("Attribute " + q + " redefined"), n.addValue( - q, - // @see https://www.w3.org/TR/xml/#AVNormalize - // since the xmldom sax parser does not "interpret" DTD the following is not implemented: - // - recursive replacement of (DTD) entity references - // - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA - $.replace(/[\t\n\r]/g, " ").replace(/&#?\w+;/g, c), - J - ); - } - for (var y, N, w = ++u, S = sr; ; ) { - var k = t.charAt(w); - switch (k) { - case "=": - if (S === ke) - y = t.slice(u, w), S = ar; - else if (S === Je) - S = ar; - else - throw new Error("attribute equal must after attrName"); - break; - case "'": - case '"': - if (S === ar || S === ke) - if (S === ke && (f.warning('attribute value must after "="'), y = t.slice(u, w)), u = w + 1, w = t.indexOf(k, u), w > 0) - N = t.slice(u, w), A(y, N, u - 1), S = Ke; - else - throw new Error("attribute value no end '" + k + "' match"); - else if (S == Ze) - N = t.slice(u, w), A(y, N, u), f.warning('attribute "' + y + '" missed start quot(' + k + ")!!"), u = w + 1, S = Ke; - else - throw new Error('attribute value must after "="'); - break; - case "/": - switch (S) { - case sr: - n.setTagName(t.slice(u, w)); - case Ke: - case lr: - case gr: - S = gr, n.closed = !0; - case Ze: - case ke: - break; - case Je: - n.closed = !0; - break; - default: - throw new Error("attribute invalid close char('/')"); - } - break; - case "": - return f.error("unexpected end of input"), S == sr && n.setTagName(t.slice(u, w)), w; - case ">": - switch (S) { - case sr: - n.setTagName(t.slice(u, w)); - case Ke: - case lr: - case gr: - break; - case Ze: - case ke: - N = t.slice(u, w), N.slice(-1) === "/" && (n.closed = !0, N = N.slice(0, -1)); - case Je: - S === Je && (N = y), S == Ze ? (f.warning('attribute "' + N + '" missed quot(")!'), A(y, N, u)) : ((!fr.isHTML(s[""]) || !N.match(/^(?:disabled|checked|selected)$/i)) && f.warning('attribute "' + N + '" missed value!! "' + N + '" instead!!'), A(N, N, u)); - break; - case ar: - throw new Error("attribute value missed!!"); - } - return w; - case "€": - k = " "; - default: - if (k <= " ") - switch (S) { - case sr: - n.setTagName(t.slice(u, w)), S = lr; - break; - case ke: - y = t.slice(u, w), S = Je; - break; - case Ze: - var N = t.slice(u, w); - f.warning('attribute "' + N + '" missed quot(")!!'), A(y, N, u); - case Ke: - S = lr; - break; - } - else - switch (S) { - case Je: - n.tagName, (!fr.isHTML(s[""]) || !y.match(/^(?:disabled|checked|selected)$/i)) && f.warning('attribute "' + y + '" missed value!! "' + y + '" instead2!!'), A(y, y, u), u = w, S = ke; - break; - case Ke: - f.warning('attribute space is required"' + y + '"!!'); - case lr: - S = ke, u = w; - break; - case ar: - S = Ze, u = w; - break; - case gr: - throw new Error("elements closed character '/' and '>' must be connected to"); - } - } - w++; - } -} -function et(t, u, n) { - for (var s = t.tagName, c = null, k = t.length; k--; ) { - var f = t[k], A = f.qName, y = f.value, q = A.indexOf(":"); - if (q > 0) - var N = f.prefix = A.slice(0, q), w = A.slice(q + 1), S = N === "xmlns" && w; - else - w = A, N = null, S = A === "xmlns" && ""; - f.localName = w, S !== !1 && (c == null && (c = {}, St(n, n = {})), n[S] = c[S] = y, f.uri = fr.XMLNS, u.startPrefixMapping(S, y)); - } - for (var k = t.length; k--; ) { - f = t[k]; - var N = f.prefix; - N && (N === "xml" && (f.uri = fr.XML), N !== "xmlns" && (f.uri = n[N || ""])); - } - var q = s.indexOf(":"); - q > 0 ? (N = t.prefix = s.slice(0, q), w = t.localName = s.slice(q + 1)) : (N = null, w = t.localName = s); - var $ = t.uri = n[N || ""]; - if (u.startElement($, w, s, t), t.closed) { - if (u.endElement($, w, s), c) - for (N in c) - Object.prototype.hasOwnProperty.call(c, N) && u.endPrefixMapping(N); - } else - return t.currentNSMap = n, t.localNSMap = c, !0; -} -function fu(t, u, n, s, c) { - if (/^(?:script|textarea)$/i.test(n)) { - var f = t.indexOf("", u), A = t.substring(u + 1, f); - if (/[&<]/.test(A)) - return /^script$/i.test(n) ? (c.characters(A, 0, A.length), f) : (A = A.replace(/&#?\w+;/g, s), c.characters(A, 0, A.length), f); - } - return u + 1; -} -function hu(t, u, n, s) { - var c = s[n]; - return c == null && (c = t.lastIndexOf(""), c < u && (c = t.lastIndexOf("", u + 4); - return f > u ? (n.comment(t, u + 4, f - u - 4), f + 3) : (s.error("Unclosed comment"), -1); - } else - return -1; - default: - if (t.substr(u + 3, 6) == "CDATA[") { - var f = t.indexOf("]]>", u + 9); - return n.startCDATA(), n.characters(t, u + 9, f - u - 9), n.endCDATA(), f + 3; - } - var A = Du(t, u), y = A.length; - if (y > 1 && /!doctype/i.test(A[0][0])) { - var N = A[1][0], w = !1, S = !1; - y > 3 && (/^public$/i.test(A[2][0]) ? (w = A[3][0], S = y > 4 && A[4][0]) : /^system$/i.test(A[2][0]) && (S = A[3][0])); - var k = A[y - 1]; - return n.startDTD(N, w, S), n.endDTD(), k.index + k[0].length; - } - } - return -1; -} -function Au(t, u, n) { - var s = t.indexOf("?>", u); - if (s) { - var c = t.substring(u, s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/); - return c ? (c[0].length, n.processingInstruction(c[1], c[2]), s + 2) : -1; - } - return -1; -} -function Ot() { - this.attributeNames = {}; -} -Ot.prototype = { - setTagName: function(t) { - if (!Zr.test(t)) - throw new Error("invalid tagName:" + t); - this.tagName = t; - }, - addValue: function(t, u, n) { - if (!Zr.test(t)) - throw new Error("invalid attribute:" + t); - this.attributeNames[t] = this.length, this[this.length++] = { qName: t, value: u, offset: n }; - }, - length: 0, - getLocalName: function(t) { - return this[t].localName; - }, - getLocator: function(t) { - return this[t].locator; - }, - getQName: function(t) { - return this[t].qName; - }, - getURI: function(t) { - return this[t].uri; - }, - getValue: function(t) { - return this[t].value; - } - // ,getIndex:function(uri, localName)){ - // if(localName){ - // - // }else{ - // var qName = uri - // } - // }, - // getValue:function(){return this.getValue(this.getIndex.apply(this,arguments))}, - // getType:function(uri,localName){} - // getType:function(i){}, -}; -function Du(t, u) { - var n, s = [], c = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g; - for (c.lastIndex = u, c.exec(t); n = c.exec(t); ) - if (s.push(n), n[1]) - return s; -} -Ur.XMLReader = Bt; -Ur.ParseError = nr; -var gu = Me, du = Ge, rt = wt, Ft = Ur, mu = du.DOMImplementation, tt = gu.NAMESPACE, Nu = Ft.ParseError, vu = Ft.XMLReader; -function Rt(t) { - return t.replace(/\r[\n\u0085]/g, ` -`).replace(/[\r\u0085\u2028]/g, ` -`); -} -function _t(t) { - this.options = t || { locator: {} }; -} -_t.prototype.parseFromString = function(t, u) { - var n = this.options, s = new vu(), c = n.domBuilder || new Dr(), f = n.errorHandler, A = n.locator, y = n.xmlns || {}, N = /\/x?html?$/.test(u), w = N ? rt.HTML_ENTITIES : rt.XML_ENTITIES; - A && c.setDocumentLocator(A), s.errorHandler = xu(f, c, A), s.domBuilder = n.domBuilder || c, N && (y[""] = tt.HTML), y.xml = y.xml || tt.XML; - var S = n.normalizeLineEndings || Rt; - return t && typeof t == "string" ? s.parse( - S(t), - y, - w - ) : s.errorHandler.error("invalid doc source"), c.doc; -}; -function xu(t, u, n) { - if (!t) { - if (u instanceof Dr) - return u; - t = u; - } - var s = {}, c = t instanceof Function; - n = n || {}; - function f(A) { - var y = t[A]; - !y && c && (y = t.length == 2 ? function(N) { - t(A, N); - } : t), s[A] = y && function(N) { - y("[xmldom " + A + "] " + N + Sr(n)); - } || function() { - }; - } - return f("warning"), f("error"), f("fatalError"), s; -} -function Dr() { - this.cdata = !1; -} -function er(t, u) { - u.lineNumber = t.lineNumber, u.columnNumber = t.columnNumber; -} -Dr.prototype = { - startDocument: function() { - this.doc = new mu().createDocument(null, null, null), this.locator && (this.doc.documentURI = this.locator.systemId); - }, - startElement: function(t, u, n, s) { - var c = this.doc, f = c.createElementNS(t, n || u), A = s.length; - dr(this, f), this.currentElement = f, this.locator && er(this.locator, f); - for (var y = 0; y < A; y++) { - var t = s.getURI(y), N = s.getValue(y), n = s.getQName(y), w = c.createAttributeNS(t, n); - this.locator && er(s.getLocator(y), w), w.value = w.nodeValue = N, f.setAttributeNode(w); - } - }, - endElement: function(t, u, n) { - var s = this.currentElement; - s.tagName, this.currentElement = s.parentNode; - }, - startPrefixMapping: function(t, u) { - }, - endPrefixMapping: function(t) { - }, - processingInstruction: function(t, u) { - var n = this.doc.createProcessingInstruction(t, u); - this.locator && er(this.locator, n), dr(this, n); - }, - ignorableWhitespace: function(t, u, n) { - }, - characters: function(t, u, n) { - if (t = ut.apply(this, arguments), t) { - if (this.cdata) - var s = this.doc.createCDATASection(t); - else - var s = this.doc.createTextNode(t); - this.currentElement ? this.currentElement.appendChild(s) : /^\s*$/.test(t) && this.doc.appendChild(s), this.locator && er(this.locator, s); - } - }, - skippedEntity: function(t) { - }, - endDocument: function() { - this.doc.normalize(); - }, - setDocumentLocator: function(t) { - (this.locator = t) && (t.lineNumber = 0); - }, - //LexicalHandler - comment: function(t, u, n) { - t = ut.apply(this, arguments); - var s = this.doc.createComment(t); - this.locator && er(this.locator, s), dr(this, s); - }, - startCDATA: function() { - this.cdata = !0; - }, - endCDATA: function() { - this.cdata = !1; - }, - startDTD: function(t, u, n) { - var s = this.doc.implementation; - if (s && s.createDocumentType) { - var c = s.createDocumentType(t, u, n); - this.locator && er(this.locator, c), dr(this, c), this.doc.doctype = c; - } - }, - /** - * @see org.xml.sax.ErrorHandler - * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html - */ - warning: function(t) { - console.warn("[xmldom warning] " + t, Sr(this.locator)); - }, - error: function(t) { - console.error("[xmldom error] " + t, Sr(this.locator)); - }, - fatalError: function(t) { - throw new Nu(t, this.locator); - } -}; -function Sr(t) { - if (t) - return ` -@` + (t.systemId || "") + "#[line:" + t.lineNumber + ",col:" + t.columnNumber + "]"; -} -function ut(t, u, n) { - return typeof t == "string" ? t.substr(u, n) : t.length >= u + n || u ? new java.lang.String(t, u, n) + "" : t; -} -"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function(t) { - Dr.prototype[t] = function() { - return null; - }; -}); -function dr(t, u) { - t.currentElement ? t.currentElement.appendChild(u) : t.doc.appendChild(u); -} -Tr.__DOMHandler = Dr; -Tr.normalizeLineEndings = Rt; -Tr.DOMParser = _t; -var Cu = Tr.DOMParser; -function yu(t, u, n) { - const s = new Cu().parseFromString(n, "text/xml"); - return { filtered: `${Qt.select(u, s)}` }; -} -export { - yu as pluginHookResponseFilter -}; -//# sourceMappingURL=index.mjs.map diff --git a/src-tauri/plugins/filter-xpath/index.mjs.map b/src-tauri/plugins/filter-xpath/index.mjs.map deleted file mode 100644 index a11ac669..00000000 --- a/src-tauri/plugins/filter-xpath/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../../../plugins/filter-xpath/node_modules/xpath/xpath.js","../../../plugins/filter-xpath/node_modules/@xmldom/xmldom/lib/conventions.js","../../../plugins/filter-xpath/node_modules/@xmldom/xmldom/lib/dom.js","../../../plugins/filter-xpath/node_modules/@xmldom/xmldom/lib/entities.js","../../../plugins/filter-xpath/node_modules/@xmldom/xmldom/lib/sax.js","../../../plugins/filter-xpath/node_modules/@xmldom/xmldom/lib/dom-parser.js","../../../plugins/filter-xpath/node_modules/@xmldom/xmldom/lib/index.js","../../../plugins/filter-xpath/src/index.js"],"sourcesContent":["/*\r\n * xpath.js\r\n *\r\n * An XPath 1.0 library for JavaScript.\r\n *\r\n * Cameron McCormack \r\n *\r\n * This work is licensed under the MIT License.\r\n *\r\n * Revision 20: April 26, 2011\r\n * Fixed a typo resulting in FIRST_ORDERED_NODE_TYPE results being wrong,\r\n * thanks to .\r\n *\r\n * Revision 19: November 29, 2005\r\n * Nodesets now store their nodes in a height balanced tree, increasing\r\n * performance for the common case of selecting nodes in document order,\r\n * thanks to Sébastien Cramatte .\r\n * AVL tree code adapted from Raimund Neumann .\r\n *\r\n * Revision 18: October 27, 2005\r\n * DOM 3 XPath support. Caveats:\r\n * - namespace prefixes aren't resolved in XPathEvaluator.createExpression,\r\n * but in XPathExpression.evaluate.\r\n * - XPathResult.invalidIteratorState is not implemented.\r\n *\r\n * Revision 17: October 25, 2005\r\n * Some core XPath function fixes and a patch to avoid crashing certain\r\n * versions of MSXML in PathExpr.prototype.getOwnerElement, thanks to\r\n * Sébastien Cramatte .\r\n *\r\n * Revision 16: September 22, 2005\r\n * Workarounds for some IE 5.5 deficiencies.\r\n * Fixed problem with prefix node tests on attribute nodes.\r\n *\r\n * Revision 15: May 21, 2005\r\n * Fixed problem with QName node tests on elements with an xmlns=\"...\".\r\n *\r\n * Revision 14: May 19, 2005\r\n * Fixed QName node tests on attribute node regression.\r\n *\r\n * Revision 13: May 3, 2005\r\n * Node tests are case insensitive now if working in an HTML DOM.\r\n *\r\n * Revision 12: April 26, 2005\r\n * Updated licence. Slight code changes to enable use of Dean\r\n * Edwards' script compression, http://dean.edwards.name/packer/ .\r\n *\r\n * Revision 11: April 23, 2005\r\n * Fixed bug with 'and' and 'or' operators, fix thanks to\r\n * Sandy McArthur .\r\n *\r\n * Revision 10: April 15, 2005\r\n * Added support for a virtual root node, supposedly helpful for\r\n * implementing XForms. Fixed problem with QName node tests and\r\n * the parent axis.\r\n *\r\n * Revision 9: March 17, 2005\r\n * Namespace resolver tweaked so using the document node as the context\r\n * for namespace lookups is equivalent to using the document element.\r\n *\r\n * Revision 8: February 13, 2005\r\n * Handle implicit declaration of 'xmlns' namespace prefix.\r\n * Fixed bug when comparing nodesets.\r\n * Instance data can now be associated with a FunctionResolver, and\r\n * workaround for MSXML not supporting 'localName' and 'getElementById',\r\n * thanks to Grant Gongaware.\r\n * Fix a few problems when the context node is the root node.\r\n *\r\n * Revision 7: February 11, 2005\r\n * Default namespace resolver fix from Grant Gongaware\r\n * .\r\n *\r\n * Revision 6: February 10, 2005\r\n * Fixed bug in 'number' function.\r\n *\r\n * Revision 5: February 9, 2005\r\n * Fixed bug where text nodes not getting converted to string values.\r\n *\r\n * Revision 4: January 21, 2005\r\n * Bug in 'name' function, fix thanks to Bill Edney.\r\n * Fixed incorrect processing of namespace nodes.\r\n * Fixed NamespaceResolver to resolve 'xml' namespace.\r\n * Implemented union '|' operator.\r\n *\r\n * Revision 3: January 14, 2005\r\n * Fixed bug with nodeset comparisons, bug lexing < and >.\r\n *\r\n * Revision 2: October 26, 2004\r\n * QName node test namespace handling fixed. Few other bug fixes.\r\n *\r\n * Revision 1: August 13, 2004\r\n * Bug fixes from William J. Edney .\r\n * Added minimal licence.\r\n *\r\n * Initial version: June 14, 2004\r\n */\r\n\r\n// non-node wrapper\r\nvar xpath = (typeof exports === 'undefined') ? {} : exports;\r\n\r\n(function (exports) {\r\n \"use strict\";\r\n\r\n // namespace nodes are not part of the DOM spec, so we use a custom nodetype for them.\r\n // should NOT be used externally\r\n var NAMESPACE_NODE_NODETYPE = '__namespace';\r\n\r\n var isNil = function (x) {\r\n return x === null || x === undefined;\r\n };\r\n\r\n var isValidNodeType = function (nodeType) {\r\n return nodeType === NAMESPACE_NODE_NODETYPE ||\r\n (Number.isInteger(nodeType)\r\n && nodeType >= 1\r\n && nodeType <= 11\r\n );\r\n };\r\n\r\n var isNodeLike = function (value) {\r\n return value\r\n && isValidNodeType(value.nodeType)\r\n && typeof value.nodeName === \"string\";\r\n };\r\n\r\n // functional helpers\r\n function curry(func) {\r\n var slice = Array.prototype.slice,\r\n totalargs = func.length,\r\n partial = function (args, fn) {\r\n return function () {\r\n return fn.apply(this, args.concat(slice.call(arguments)));\r\n }\r\n },\r\n fn = function () {\r\n var args = slice.call(arguments);\r\n return (args.length < totalargs) ?\r\n partial(args, fn) :\r\n func.apply(this, slice.apply(arguments, [0, totalargs]));\r\n };\r\n return fn;\r\n }\r\n\r\n var forEach = function (f, xs) {\r\n for (var i = 0; i < xs.length; i += 1) {\r\n f(xs[i], i, xs);\r\n }\r\n };\r\n\r\n var reduce = function (f, seed, xs) {\r\n var acc = seed;\r\n\r\n forEach(function (x, i) { acc = f(acc, x, i); }, xs);\r\n\r\n return acc;\r\n };\r\n\r\n var map = function (f, xs) {\r\n var mapped = new Array(xs.length);\r\n\r\n forEach(function (x, i) { mapped[i] = f(x); }, xs);\r\n\r\n return mapped;\r\n };\r\n\r\n var filter = function (f, xs) {\r\n var filtered = [];\r\n\r\n forEach(function (x, i) { if (f(x, i)) { filtered.push(x); } }, xs);\r\n\r\n return filtered;\r\n };\r\n\r\n var includes = function (values, value) {\r\n for (var i = 0; i < values.length; i += 1) {\r\n if (values[i] === value) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n };\r\n\r\n function always(value) { return function () { return value; } }\r\n\r\n function toString(x) { return x.toString(); }\r\n var join = function (s, xs) { return xs.join(s); };\r\n var wrap = function (pref, suf, str) { return pref + str + suf; };\r\n\r\n var prototypeConcat = Array.prototype.concat;\r\n\r\n var sortNodes = function (nodes, reverse) {\r\n var ns = new XNodeSet();\r\n\r\n ns.addArray(nodes);\r\n\r\n var sorted = ns.toArray();\r\n\r\n return reverse ? sorted.reverse() : sorted;\r\n }\r\n\r\n // .apply() fails above a certain number of arguments - https://github.com/goto100/xpath/pull/98\r\n var MAX_ARGUMENT_LENGTH = 32767;\r\n\r\n function flatten(arr) {\r\n var result = [];\r\n\r\n for (var start = 0; start < arr.length; start += MAX_ARGUMENT_LENGTH) {\r\n var chunk = arr.slice(start, start + MAX_ARGUMENT_LENGTH);\r\n\r\n result = prototypeConcat.apply(result, chunk);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function assign(target, varArgs) { // .length of function is 2\r\n var to = Object(target);\r\n\r\n for (var index = 1; index < arguments.length; index++) {\r\n var nextSource = arguments[index];\r\n\r\n if (nextSource != null) { // Skip over if undefined or null\r\n for (var nextKey in nextSource) {\r\n // Avoid bugs when hasOwnProperty is shadowed\r\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\r\n to[nextKey] = nextSource[nextKey];\r\n }\r\n }\r\n }\r\n }\r\n\r\n return to;\r\n }\r\n\r\n var NodeTypes = {\r\n ELEMENT_NODE: 1,\r\n ATTRIBUTE_NODE: 2,\r\n TEXT_NODE: 3,\r\n CDATA_SECTION_NODE: 4,\r\n PROCESSING_INSTRUCTION_NODE: 7,\r\n COMMENT_NODE: 8,\r\n DOCUMENT_NODE: 9,\r\n DOCUMENT_TYPE_NODE: 10,\r\n DOCUMENT_FRAGMENT_NODE: 11,\r\n NAMESPACE_NODE: NAMESPACE_NODE_NODETYPE,\r\n };\r\n\r\n // XPathParser ///////////////////////////////////////////////////////////////\r\n\r\n XPathParser.prototype = new Object();\r\n XPathParser.prototype.constructor = XPathParser;\r\n XPathParser.superclass = Object.prototype;\r\n\r\n function XPathParser() {\r\n this.init();\r\n }\r\n\r\n XPathParser.prototype.init = function () {\r\n this.reduceActions = [];\r\n\r\n this.reduceActions[3] = function (rhs) {\r\n return new OrOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[5] = function (rhs) {\r\n return new AndOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[7] = function (rhs) {\r\n return new EqualsOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[8] = function (rhs) {\r\n return new NotEqualOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[10] = function (rhs) {\r\n return new LessThanOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[11] = function (rhs) {\r\n return new GreaterThanOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[12] = function (rhs) {\r\n return new LessThanOrEqualOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[13] = function (rhs) {\r\n return new GreaterThanOrEqualOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[15] = function (rhs) {\r\n return new PlusOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[16] = function (rhs) {\r\n return new MinusOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[18] = function (rhs) {\r\n return new MultiplyOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[19] = function (rhs) {\r\n return new DivOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[20] = function (rhs) {\r\n return new ModOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[22] = function (rhs) {\r\n return new UnaryMinusOperation(rhs[1]);\r\n };\r\n this.reduceActions[24] = function (rhs) {\r\n return new BarOperation(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[25] = function (rhs) {\r\n return new PathExpr(undefined, undefined, rhs[0]);\r\n };\r\n this.reduceActions[27] = function (rhs) {\r\n rhs[0].locationPath = rhs[2];\r\n return rhs[0];\r\n };\r\n this.reduceActions[28] = function (rhs) {\r\n rhs[0].locationPath = rhs[2];\r\n rhs[0].locationPath.steps.unshift(new Step(Step.DESCENDANTORSELF, NodeTest.nodeTest, []));\r\n return rhs[0];\r\n };\r\n this.reduceActions[29] = function (rhs) {\r\n return new PathExpr(rhs[0], [], undefined);\r\n };\r\n this.reduceActions[30] = function (rhs) {\r\n if (Utilities.instance_of(rhs[0], PathExpr)) {\r\n if (rhs[0].filterPredicates == undefined) {\r\n rhs[0].filterPredicates = [];\r\n }\r\n rhs[0].filterPredicates.push(rhs[1]);\r\n return rhs[0];\r\n } else {\r\n return new PathExpr(rhs[0], [rhs[1]], undefined);\r\n }\r\n };\r\n this.reduceActions[32] = function (rhs) {\r\n return rhs[1];\r\n };\r\n this.reduceActions[33] = function (rhs) {\r\n return new XString(rhs[0]);\r\n };\r\n this.reduceActions[34] = function (rhs) {\r\n return new XNumber(rhs[0]);\r\n };\r\n this.reduceActions[36] = function (rhs) {\r\n return new FunctionCall(rhs[0], []);\r\n };\r\n this.reduceActions[37] = function (rhs) {\r\n return new FunctionCall(rhs[0], rhs[2]);\r\n };\r\n this.reduceActions[38] = function (rhs) {\r\n return [rhs[0]];\r\n };\r\n this.reduceActions[39] = function (rhs) {\r\n rhs[2].unshift(rhs[0]);\r\n return rhs[2];\r\n };\r\n this.reduceActions[43] = function (rhs) {\r\n return new LocationPath(true, []);\r\n };\r\n this.reduceActions[44] = function (rhs) {\r\n rhs[1].absolute = true;\r\n return rhs[1];\r\n };\r\n this.reduceActions[46] = function (rhs) {\r\n return new LocationPath(false, [rhs[0]]);\r\n };\r\n this.reduceActions[47] = function (rhs) {\r\n rhs[0].steps.push(rhs[2]);\r\n return rhs[0];\r\n };\r\n this.reduceActions[49] = function (rhs) {\r\n return new Step(rhs[0], rhs[1], []);\r\n };\r\n this.reduceActions[50] = function (rhs) {\r\n return new Step(Step.CHILD, rhs[0], []);\r\n };\r\n this.reduceActions[51] = function (rhs) {\r\n return new Step(rhs[0], rhs[1], rhs[2]);\r\n };\r\n this.reduceActions[52] = function (rhs) {\r\n return new Step(Step.CHILD, rhs[0], rhs[1]);\r\n };\r\n this.reduceActions[54] = function (rhs) {\r\n return [rhs[0]];\r\n };\r\n this.reduceActions[55] = function (rhs) {\r\n rhs[1].unshift(rhs[0]);\r\n return rhs[1];\r\n };\r\n this.reduceActions[56] = function (rhs) {\r\n if (rhs[0] == \"ancestor\") {\r\n return Step.ANCESTOR;\r\n } else if (rhs[0] == \"ancestor-or-self\") {\r\n return Step.ANCESTORORSELF;\r\n } else if (rhs[0] == \"attribute\") {\r\n return Step.ATTRIBUTE;\r\n } else if (rhs[0] == \"child\") {\r\n return Step.CHILD;\r\n } else if (rhs[0] == \"descendant\") {\r\n return Step.DESCENDANT;\r\n } else if (rhs[0] == \"descendant-or-self\") {\r\n return Step.DESCENDANTORSELF;\r\n } else if (rhs[0] == \"following\") {\r\n return Step.FOLLOWING;\r\n } else if (rhs[0] == \"following-sibling\") {\r\n return Step.FOLLOWINGSIBLING;\r\n } else if (rhs[0] == \"namespace\") {\r\n return Step.NAMESPACE;\r\n } else if (rhs[0] == \"parent\") {\r\n return Step.PARENT;\r\n } else if (rhs[0] == \"preceding\") {\r\n return Step.PRECEDING;\r\n } else if (rhs[0] == \"preceding-sibling\") {\r\n return Step.PRECEDINGSIBLING;\r\n } else if (rhs[0] == \"self\") {\r\n return Step.SELF;\r\n }\r\n return -1;\r\n };\r\n this.reduceActions[57] = function (rhs) {\r\n return Step.ATTRIBUTE;\r\n };\r\n this.reduceActions[59] = function (rhs) {\r\n if (rhs[0] == \"comment\") {\r\n return NodeTest.commentTest;\r\n } else if (rhs[0] == \"text\") {\r\n return NodeTest.textTest;\r\n } else if (rhs[0] == \"processing-instruction\") {\r\n return NodeTest.anyPiTest;\r\n } else if (rhs[0] == \"node\") {\r\n return NodeTest.nodeTest;\r\n }\r\n return new NodeTest(-1, undefined);\r\n };\r\n this.reduceActions[60] = function (rhs) {\r\n return new NodeTest.PITest(rhs[2]);\r\n };\r\n this.reduceActions[61] = function (rhs) {\r\n return rhs[1];\r\n };\r\n this.reduceActions[63] = function (rhs) {\r\n rhs[1].absolute = true;\r\n rhs[1].steps.unshift(new Step(Step.DESCENDANTORSELF, NodeTest.nodeTest, []));\r\n return rhs[1];\r\n };\r\n this.reduceActions[64] = function (rhs) {\r\n rhs[0].steps.push(new Step(Step.DESCENDANTORSELF, NodeTest.nodeTest, []));\r\n rhs[0].steps.push(rhs[2]);\r\n return rhs[0];\r\n };\r\n this.reduceActions[65] = function (rhs) {\r\n return new Step(Step.SELF, NodeTest.nodeTest, []);\r\n };\r\n this.reduceActions[66] = function (rhs) {\r\n return new Step(Step.PARENT, NodeTest.nodeTest, []);\r\n };\r\n this.reduceActions[67] = function (rhs) {\r\n return new VariableReference(rhs[1]);\r\n };\r\n this.reduceActions[68] = function (rhs) {\r\n return NodeTest.nameTestAny;\r\n };\r\n this.reduceActions[69] = function (rhs) {\r\n return new NodeTest.NameTestPrefixAny(rhs[0].split(':')[0]);\r\n };\r\n this.reduceActions[70] = function (rhs) {\r\n return new NodeTest.NameTestQName(rhs[0]);\r\n };\r\n };\r\n\r\n XPathParser.actionTable = [\r\n \" s s sssssssss s ss s ss\",\r\n \" s \",\r\n \"r rrrrrrrrr rrrrrrr rr r \",\r\n \" rrrrr \",\r\n \" s s sssssssss s ss s ss\",\r\n \"rs rrrrrrrr s sssssrrrrrr rrs rs \",\r\n \" s s sssssssss s ss s ss\",\r\n \" s \",\r\n \" s \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \" s \",\r\n \" s \",\r\n \" s s sssss s s \",\r\n \"r rrrrrrrrr rrrrrrr rr r \",\r\n \"a \",\r\n \"r s rr r \",\r\n \"r sr rr r \",\r\n \"r s rr s rr r \",\r\n \"r rssrr rss rr r \",\r\n \"r rrrrr rrrss rr r \",\r\n \"r rrrrrsss rrrrr rr r \",\r\n \"r rrrrrrrr rrrrr rr r \",\r\n \"r rrrrrrrr rrrrrs rr r \",\r\n \"r rrrrrrrr rrrrrr rr r \",\r\n \"r rrrrrrrr rrrrrr rr r \",\r\n \"r srrrrrrrr rrrrrrs rr sr \",\r\n \"r srrrrrrrr rrrrrrs rr r \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \"r rrrrrrrr rrrrrr rr r \",\r\n \"r rrrrrrrr rrrrrr rr r \",\r\n \"r rrrrrrrrr rrrrrrr rr r \",\r\n \"r rrrrrrrrr rrrrrrr rr r \",\r\n \" sssss \",\r\n \"r rrrrrrrrr rrrrrrr rr sr \",\r\n \"r rrrrrrrrr rrrrrrr rr r \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \" s \",\r\n \"r srrrrrrrr rrrrrrs rr r \",\r\n \"r rrrrrrrr rrrrr rr r \",\r\n \" s \",\r\n \" s \",\r\n \" rrrrr \",\r\n \" s s sssssssss s sss s ss\",\r\n \"r srrrrrrrr rrrrrrs rr r \",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssssssss ss s ss\",\r\n \" s s sssssssss s ss s ss\",\r\n \" s s sssss s s \",\r\n \" s s sssss s s \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \" s s sssss s s \",\r\n \" s s sssss s s \",\r\n \"r rrrrrrrrr rrrrrrr rr sr \",\r\n \"r rrrrrrrrr rrrrrrr rr sr \",\r\n \"r rrrrrrrrr rrrrrrr rr r \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \" s \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \" rr \",\r\n \" s \",\r\n \" rs \",\r\n \"r sr rr r \",\r\n \"r s rr s rr r \",\r\n \"r rssrr rss rr r \",\r\n \"r rssrr rss rr r \",\r\n \"r rrrrr rrrss rr r \",\r\n \"r rrrrr rrrss rr r \",\r\n \"r rrrrr rrrss rr r \",\r\n \"r rrrrr rrrss rr r \",\r\n \"r rrrrrsss rrrrr rr r \",\r\n \"r rrrrrsss rrrrr rr r \",\r\n \"r rrrrrrrr rrrrr rr r \",\r\n \"r rrrrrrrr rrrrr rr r \",\r\n \"r rrrrrrrr rrrrr rr r \",\r\n \"r rrrrrrrr rrrrrr rr r \",\r\n \" r \",\r\n \" s \",\r\n \"r srrrrrrrr rrrrrrs rr r \",\r\n \"r srrrrrrrr rrrrrrs rr r \",\r\n \"r rrrrrrrrr rrrrrrr rr r \",\r\n \"r rrrrrrrrr rrrrrrr rr r \",\r\n \"r rrrrrrrrr rrrrrrr rr r \",\r\n \"r rrrrrrrrr rrrrrrr rr r \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \" s s sssssssss s ss s ss\",\r\n \"r rrrrrrrrr rrrrrrr rr rr \",\r\n \" r \"\r\n ];\r\n\r\n XPathParser.actionTableNumber = [\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" J \",\r\n \"a aaaaaaaaa aaaaaaa aa a \",\r\n \" YYYYY \",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \"K1 KKKKKKKK . +*)('KKKKKK KK# K\\\" \",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" N \",\r\n \" O \",\r\n \"e eeeeeeeee eeeeeee ee ee \",\r\n \"f fffffffff fffffff ff ff \",\r\n \"d ddddddddd ddddddd dd dd \",\r\n \"B BBBBBBBBB BBBBBBB BB BB \",\r\n \"A AAAAAAAAA AAAAAAA AA AA \",\r\n \" P \",\r\n \" Q \",\r\n \" 1 . +*)(' # \\\" \",\r\n \"b bbbbbbbbb bbbbbbb bb b \",\r\n \" \",\r\n \"! S !! ! \",\r\n \"\\\" T\\\" \\\"\\\" \\\" \",\r\n \"$ V $$ U $$ $ \",\r\n \"& &ZY&& &XW && & \",\r\n \") ))))) )))\\\\[ )) ) \",\r\n \". ....._^] ..... .. . \",\r\n \"1 11111111 11111 11 1 \",\r\n \"5 55555555 55555` 55 5 \",\r\n \"7 77777777 777777 77 7 \",\r\n \"9 99999999 999999 99 9 \",\r\n \": c:::::::: ::::::b :: a: \",\r\n \"I fIIIIIIII IIIIIIe II I \",\r\n \"= ========= ======= == == \",\r\n \"? ????????? ??????? ?? ?? \",\r\n \"C CCCCCCCCC CCCCCCC CC CC \",\r\n \"J JJJJJJJJ JJJJJJ JJ J \",\r\n \"M MMMMMMMM MMMMMM MM M \",\r\n \"N NNNNNNNNN NNNNNNN NN N \",\r\n \"P PPPPPPPPP PPPPPPP PP P \",\r\n \" +*)(' \",\r\n \"R RRRRRRRRR RRRRRRR RR aR \",\r\n \"U UUUUUUUUU UUUUUUU UU U \",\r\n \"Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ \",\r\n \"c ccccccccc ccccccc cc cc \",\r\n \" j \",\r\n \"L fLLLLLLLL LLLLLLe LL L \",\r\n \"6 66666666 66666 66 6 \",\r\n \" k \",\r\n \" l \",\r\n \" XXXXX \",\r\n \" 1 0 /.-,+*)(' & %$m # \\\"!\",\r\n \"_ f________ ______e __ _ \",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' %$ # \\\"!\",\r\n \" 1 0 /.-,+*)(' & %$ # \\\"!\",\r\n \" 1 . +*)(' # \\\" \",\r\n \" 1 . +*)(' # \\\" \",\r\n \"> >>>>>>>>> >>>>>>> >> >> \",\r\n \" 1 . +*)(' # \\\" \",\r\n \" 1 . +*)(' # \\\" \",\r\n \"Q QQQQQQQQQ QQQQQQQ QQ aQ \",\r\n \"V VVVVVVVVV VVVVVVV VV aV \",\r\n \"T TTTTTTTTT TTTTTTT TT T \",\r\n \"@ @@@@@@@@@ @@@@@@@ @@ @@ \",\r\n \" \\x87 \",\r\n \"[ [[[[[[[[[ [[[[[[[ [[ [[ \",\r\n \"D DDDDDDDDD DDDDDDD DD DD \",\r\n \" HH \",\r\n \" \\x88 \",\r\n \" F\\x89 \",\r\n \"# T# ## # \",\r\n \"% V %% U %% % \",\r\n \"' 'ZY'' 'XW '' ' \",\r\n \"( (ZY(( (XW (( ( \",\r\n \"+ +++++ +++\\\\[ ++ + \",\r\n \"* ***** ***\\\\[ ** * \",\r\n \"- ----- ---\\\\[ -- - \",\r\n \", ,,,,, ,,,\\\\[ ,, , \",\r\n \"0 00000_^] 00000 00 0 \",\r\n \"/ /////_^] ///// // / \",\r\n \"2 22222222 22222 22 2 \",\r\n \"3 33333333 33333 33 3 \",\r\n \"4 44444444 44444 44 4 \",\r\n \"8 88888888 888888 88 8 \",\r\n \" ^ \",\r\n \" \\x8a \",\r\n \"; f;;;;;;;; ;;;;;;e ;; ; \",\r\n \"< f<<<<<<<< <<<<<?@ AB CDEFGH IJ \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \"L456789:;<=>?@ AB CDEFGH IJ \",\r\n \" M EFGH IJ \",\r\n \" N;<=>?@ AB CDEFGH IJ \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" S EFGH IJ \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" e \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" h J \",\r\n \" i j \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \"o456789:;<=>?@ ABpqCDEFGH IJ \",\r\n \" \",\r\n \" r6789:;<=>?@ AB CDEFGH IJ \",\r\n \" s789:;<=>?@ AB CDEFGH IJ \",\r\n \" t89:;<=>?@ AB CDEFGH IJ \",\r\n \" u89:;<=>?@ AB CDEFGH IJ \",\r\n \" v9:;<=>?@ AB CDEFGH IJ \",\r\n \" w9:;<=>?@ AB CDEFGH IJ \",\r\n \" x9:;<=>?@ AB CDEFGH IJ \",\r\n \" y9:;<=>?@ AB CDEFGH IJ \",\r\n \" z:;<=>?@ AB CDEFGH IJ \",\r\n \" {:;<=>?@ AB CDEFGH IJ \",\r\n \" |;<=>?@ AB CDEFGH IJ \",\r\n \" };<=>?@ AB CDEFGH IJ \",\r\n \" ~;<=>?@ AB CDEFGH IJ \",\r\n \" \\x7f=>?@ AB CDEFGH IJ \",\r\n \"\\x80456789:;<=>?@ AB CDEFGH IJ\\x81\",\r\n \" \\x82 EFGH IJ \",\r\n \" \\x83 EFGH IJ \",\r\n \" \",\r\n \" \\x84 GH IJ \",\r\n \" \\x85 GH IJ \",\r\n \" i \\x86 \",\r\n \" i \\x87 \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \" \",\r\n \"o456789:;<=>?@ AB\\x8cqCDEFGH IJ \",\r\n \" \",\r\n \" \"\r\n ];\r\n\r\n XPathParser.productions = [\r\n [1, 1, 2],\r\n [2, 1, 3],\r\n [3, 1, 4],\r\n [3, 3, 3, -9, 4],\r\n [4, 1, 5],\r\n [4, 3, 4, -8, 5],\r\n [5, 1, 6],\r\n [5, 3, 5, -22, 6],\r\n [5, 3, 5, -5, 6],\r\n [6, 1, 7],\r\n [6, 3, 6, -23, 7],\r\n [6, 3, 6, -24, 7],\r\n [6, 3, 6, -6, 7],\r\n [6, 3, 6, -7, 7],\r\n [7, 1, 8],\r\n [7, 3, 7, -25, 8],\r\n [7, 3, 7, -26, 8],\r\n [8, 1, 9],\r\n [8, 3, 8, -12, 9],\r\n [8, 3, 8, -11, 9],\r\n [8, 3, 8, -10, 9],\r\n [9, 1, 10],\r\n [9, 2, -26, 9],\r\n [10, 1, 11],\r\n [10, 3, 10, -27, 11],\r\n [11, 1, 12],\r\n [11, 1, 13],\r\n [11, 3, 13, -28, 14],\r\n [11, 3, 13, -4, 14],\r\n [13, 1, 15],\r\n [13, 2, 13, 16],\r\n [15, 1, 17],\r\n [15, 3, -29, 2, -30],\r\n [15, 1, -15],\r\n [15, 1, -16],\r\n [15, 1, 18],\r\n [18, 3, -13, -29, -30],\r\n [18, 4, -13, -29, 19, -30],\r\n [19, 1, 20],\r\n [19, 3, 20, -31, 19],\r\n [20, 1, 2],\r\n [12, 1, 14],\r\n [12, 1, 21],\r\n [21, 1, -28],\r\n [21, 2, -28, 14],\r\n [21, 1, 22],\r\n [14, 1, 23],\r\n [14, 3, 14, -28, 23],\r\n [14, 1, 24],\r\n [23, 2, 25, 26],\r\n [23, 1, 26],\r\n [23, 3, 25, 26, 27],\r\n [23, 2, 26, 27],\r\n [23, 1, 28],\r\n [27, 1, 16],\r\n [27, 2, 16, 27],\r\n [25, 2, -14, -3],\r\n [25, 1, -32],\r\n [26, 1, 29],\r\n [26, 3, -20, -29, -30],\r\n [26, 4, -21, -29, -15, -30],\r\n [16, 3, -33, 30, -34],\r\n [30, 1, 2],\r\n [22, 2, -4, 14],\r\n [24, 3, 14, -4, 23],\r\n [28, 1, -35],\r\n [28, 1, -2],\r\n [17, 2, -36, -18],\r\n [29, 1, -17],\r\n [29, 1, -19],\r\n [29, 1, -18]\r\n ];\r\n\r\n XPathParser.DOUBLEDOT = 2;\r\n XPathParser.DOUBLECOLON = 3;\r\n XPathParser.DOUBLESLASH = 4;\r\n XPathParser.NOTEQUAL = 5;\r\n XPathParser.LESSTHANOREQUAL = 6;\r\n XPathParser.GREATERTHANOREQUAL = 7;\r\n XPathParser.AND = 8;\r\n XPathParser.OR = 9;\r\n XPathParser.MOD = 10;\r\n XPathParser.DIV = 11;\r\n XPathParser.MULTIPLYOPERATOR = 12;\r\n XPathParser.FUNCTIONNAME = 13;\r\n XPathParser.AXISNAME = 14;\r\n XPathParser.LITERAL = 15;\r\n XPathParser.NUMBER = 16;\r\n XPathParser.ASTERISKNAMETEST = 17;\r\n XPathParser.QNAME = 18;\r\n XPathParser.NCNAMECOLONASTERISK = 19;\r\n XPathParser.NODETYPE = 20;\r\n XPathParser.PROCESSINGINSTRUCTIONWITHLITERAL = 21;\r\n XPathParser.EQUALS = 22;\r\n XPathParser.LESSTHAN = 23;\r\n XPathParser.GREATERTHAN = 24;\r\n XPathParser.PLUS = 25;\r\n XPathParser.MINUS = 26;\r\n XPathParser.BAR = 27;\r\n XPathParser.SLASH = 28;\r\n XPathParser.LEFTPARENTHESIS = 29;\r\n XPathParser.RIGHTPARENTHESIS = 30;\r\n XPathParser.COMMA = 31;\r\n XPathParser.AT = 32;\r\n XPathParser.LEFTBRACKET = 33;\r\n XPathParser.RIGHTBRACKET = 34;\r\n XPathParser.DOT = 35;\r\n XPathParser.DOLLAR = 36;\r\n\r\n XPathParser.prototype.tokenize = function (s1) {\r\n var types = [];\r\n var values = [];\r\n var s = s1 + '\\0';\r\n\r\n var pos = 0;\r\n var c = s.charAt(pos++);\r\n while (1) {\r\n while (c == ' ' || c == '\\t' || c == '\\r' || c == '\\n') {\r\n c = s.charAt(pos++);\r\n }\r\n if (c == '\\0' || pos >= s.length) {\r\n break;\r\n }\r\n\r\n if (c == '(') {\r\n types.push(XPathParser.LEFTPARENTHESIS);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c == ')') {\r\n types.push(XPathParser.RIGHTPARENTHESIS);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c == '[') {\r\n types.push(XPathParser.LEFTBRACKET);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c == ']') {\r\n types.push(XPathParser.RIGHTBRACKET);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c == '@') {\r\n types.push(XPathParser.AT);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c == ',') {\r\n types.push(XPathParser.COMMA);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c == '|') {\r\n types.push(XPathParser.BAR);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c == '+') {\r\n types.push(XPathParser.PLUS);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c == '-') {\r\n types.push(XPathParser.MINUS);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c == '=') {\r\n types.push(XPathParser.EQUALS);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c == '$') {\r\n types.push(XPathParser.DOLLAR);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n\r\n if (c == '.') {\r\n c = s.charAt(pos++);\r\n if (c == '.') {\r\n types.push(XPathParser.DOUBLEDOT);\r\n values.push(\"..\");\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (c >= '0' && c <= '9') {\r\n var number = \".\" + c;\r\n c = s.charAt(pos++);\r\n while (c >= '0' && c <= '9') {\r\n number += c;\r\n c = s.charAt(pos++);\r\n }\r\n types.push(XPathParser.NUMBER);\r\n values.push(number);\r\n continue;\r\n }\r\n types.push(XPathParser.DOT);\r\n values.push('.');\r\n continue;\r\n }\r\n\r\n if (c == '\\'' || c == '\"') {\r\n var delimiter = c;\r\n var literal = \"\";\r\n while (pos < s.length && (c = s.charAt(pos)) !== delimiter) {\r\n literal += c;\r\n pos += 1;\r\n }\r\n if (c !== delimiter) {\r\n throw XPathException.fromMessage(\"Unterminated string literal: \" + delimiter + literal);\r\n }\r\n pos += 1;\r\n types.push(XPathParser.LITERAL);\r\n values.push(literal);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n\r\n if (c >= '0' && c <= '9') {\r\n var number = c;\r\n c = s.charAt(pos++);\r\n while (c >= '0' && c <= '9') {\r\n number += c;\r\n c = s.charAt(pos++);\r\n }\r\n if (c == '.') {\r\n if (s.charAt(pos) >= '0' && s.charAt(pos) <= '9') {\r\n number += c;\r\n number += s.charAt(pos++);\r\n c = s.charAt(pos++);\r\n while (c >= '0' && c <= '9') {\r\n number += c;\r\n c = s.charAt(pos++);\r\n }\r\n }\r\n }\r\n types.push(XPathParser.NUMBER);\r\n values.push(number);\r\n continue;\r\n }\r\n\r\n if (c == '*') {\r\n if (types.length > 0) {\r\n var last = types[types.length - 1];\r\n if (last != XPathParser.AT\r\n && last != XPathParser.DOUBLECOLON\r\n && last != XPathParser.LEFTPARENTHESIS\r\n && last != XPathParser.LEFTBRACKET\r\n && last != XPathParser.AND\r\n && last != XPathParser.OR\r\n && last != XPathParser.MOD\r\n && last != XPathParser.DIV\r\n && last != XPathParser.MULTIPLYOPERATOR\r\n && last != XPathParser.SLASH\r\n && last != XPathParser.DOUBLESLASH\r\n && last != XPathParser.BAR\r\n && last != XPathParser.PLUS\r\n && last != XPathParser.MINUS\r\n && last != XPathParser.EQUALS\r\n && last != XPathParser.NOTEQUAL\r\n && last != XPathParser.LESSTHAN\r\n && last != XPathParser.LESSTHANOREQUAL\r\n && last != XPathParser.GREATERTHAN\r\n && last != XPathParser.GREATERTHANOREQUAL) {\r\n types.push(XPathParser.MULTIPLYOPERATOR);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n }\r\n types.push(XPathParser.ASTERISKNAMETEST);\r\n values.push(c);\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n\r\n if (c == ':') {\r\n if (s.charAt(pos) == ':') {\r\n types.push(XPathParser.DOUBLECOLON);\r\n values.push(\"::\");\r\n pos++;\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n }\r\n\r\n if (c == '/') {\r\n c = s.charAt(pos++);\r\n if (c == '/') {\r\n types.push(XPathParser.DOUBLESLASH);\r\n values.push(\"//\");\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n types.push(XPathParser.SLASH);\r\n values.push('/');\r\n continue;\r\n }\r\n\r\n if (c == '!') {\r\n if (s.charAt(pos) == '=') {\r\n types.push(XPathParser.NOTEQUAL);\r\n values.push(\"!=\");\r\n pos++;\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n }\r\n\r\n if (c == '<') {\r\n if (s.charAt(pos) == '=') {\r\n types.push(XPathParser.LESSTHANOREQUAL);\r\n values.push(\"<=\");\r\n pos++;\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n types.push(XPathParser.LESSTHAN);\r\n values.push('<');\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n\r\n if (c == '>') {\r\n if (s.charAt(pos) == '=') {\r\n types.push(XPathParser.GREATERTHANOREQUAL);\r\n values.push(\">=\");\r\n pos++;\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n types.push(XPathParser.GREATERTHAN);\r\n values.push('>');\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n\r\n if (c == '_' || Utilities.isLetter(c.charCodeAt(0))) {\r\n var name = c;\r\n c = s.charAt(pos++);\r\n while (Utilities.isNCNameChar(c.charCodeAt(0))) {\r\n name += c;\r\n c = s.charAt(pos++);\r\n }\r\n if (types.length > 0) {\r\n var last = types[types.length - 1];\r\n if (last != XPathParser.AT\r\n && last != XPathParser.DOUBLECOLON\r\n && last != XPathParser.LEFTPARENTHESIS\r\n && last != XPathParser.LEFTBRACKET\r\n && last != XPathParser.AND\r\n && last != XPathParser.OR\r\n && last != XPathParser.MOD\r\n && last != XPathParser.DIV\r\n && last != XPathParser.MULTIPLYOPERATOR\r\n && last != XPathParser.SLASH\r\n && last != XPathParser.DOUBLESLASH\r\n && last != XPathParser.BAR\r\n && last != XPathParser.PLUS\r\n && last != XPathParser.MINUS\r\n && last != XPathParser.EQUALS\r\n && last != XPathParser.NOTEQUAL\r\n && last != XPathParser.LESSTHAN\r\n && last != XPathParser.LESSTHANOREQUAL\r\n && last != XPathParser.GREATERTHAN\r\n && last != XPathParser.GREATERTHANOREQUAL) {\r\n if (name == \"and\") {\r\n types.push(XPathParser.AND);\r\n values.push(name);\r\n continue;\r\n }\r\n if (name == \"or\") {\r\n types.push(XPathParser.OR);\r\n values.push(name);\r\n continue;\r\n }\r\n if (name == \"mod\") {\r\n types.push(XPathParser.MOD);\r\n values.push(name);\r\n continue;\r\n }\r\n if (name == \"div\") {\r\n types.push(XPathParser.DIV);\r\n values.push(name);\r\n continue;\r\n }\r\n }\r\n }\r\n if (c == ':') {\r\n if (s.charAt(pos) == '*') {\r\n types.push(XPathParser.NCNAMECOLONASTERISK);\r\n values.push(name + \":*\");\r\n pos++;\r\n c = s.charAt(pos++);\r\n continue;\r\n }\r\n if (s.charAt(pos) == '_' || Utilities.isLetter(s.charCodeAt(pos))) {\r\n name += ':';\r\n c = s.charAt(pos++);\r\n while (Utilities.isNCNameChar(c.charCodeAt(0))) {\r\n name += c;\r\n c = s.charAt(pos++);\r\n }\r\n if (c == '(') {\r\n types.push(XPathParser.FUNCTIONNAME);\r\n values.push(name);\r\n continue;\r\n }\r\n types.push(XPathParser.QNAME);\r\n values.push(name);\r\n continue;\r\n }\r\n if (s.charAt(pos) == ':') {\r\n types.push(XPathParser.AXISNAME);\r\n values.push(name);\r\n continue;\r\n }\r\n }\r\n if (c == '(') {\r\n if (name == \"comment\" || name == \"text\" || name == \"node\") {\r\n types.push(XPathParser.NODETYPE);\r\n values.push(name);\r\n continue;\r\n }\r\n if (name == \"processing-instruction\") {\r\n if (s.charAt(pos) == ')') {\r\n types.push(XPathParser.NODETYPE);\r\n } else {\r\n types.push(XPathParser.PROCESSINGINSTRUCTIONWITHLITERAL);\r\n }\r\n values.push(name);\r\n continue;\r\n }\r\n types.push(XPathParser.FUNCTIONNAME);\r\n values.push(name);\r\n continue;\r\n }\r\n types.push(XPathParser.QNAME);\r\n values.push(name);\r\n continue;\r\n }\r\n\r\n throw new Error(\"Unexpected character \" + c);\r\n }\r\n types.push(1);\r\n values.push(\"[EOF]\");\r\n return [types, values];\r\n };\r\n\r\n XPathParser.SHIFT = 's';\r\n XPathParser.REDUCE = 'r';\r\n XPathParser.ACCEPT = 'a';\r\n\r\n XPathParser.prototype.parse = function (s) {\r\n if (!s) {\r\n throw new Error('XPath expression unspecified.');\r\n }\r\n if (typeof s !== 'string'){\r\n throw new Error('XPath expression must be a string.');\r\n }\r\n\r\n var types;\r\n var values;\r\n var res = this.tokenize(s);\r\n if (res == undefined) {\r\n return undefined;\r\n }\r\n types = res[0];\r\n values = res[1];\r\n var tokenPos = 0;\r\n var state = [];\r\n var tokenType = [];\r\n var tokenValue = [];\r\n var s;\r\n var a;\r\n var t;\r\n\r\n state.push(0);\r\n tokenType.push(1);\r\n tokenValue.push(\"_S\");\r\n\r\n a = types[tokenPos];\r\n t = values[tokenPos++];\r\n while (1) {\r\n s = state[state.length - 1];\r\n switch (XPathParser.actionTable[s].charAt(a - 1)) {\r\n case XPathParser.SHIFT:\r\n tokenType.push(-a);\r\n tokenValue.push(t);\r\n state.push(XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32);\r\n a = types[tokenPos];\r\n t = values[tokenPos++];\r\n break;\r\n case XPathParser.REDUCE:\r\n var num = XPathParser.productions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32][1];\r\n var rhs = [];\r\n for (var i = 0; i < num; i++) {\r\n tokenType.pop();\r\n rhs.unshift(tokenValue.pop());\r\n state.pop();\r\n }\r\n var s_ = state[state.length - 1];\r\n tokenType.push(XPathParser.productions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32][0]);\r\n if (this.reduceActions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32] == undefined) {\r\n tokenValue.push(rhs[0]);\r\n } else {\r\n tokenValue.push(this.reduceActions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32](rhs));\r\n }\r\n state.push(XPathParser.gotoTable[s_].charCodeAt(XPathParser.productions[XPathParser.actionTableNumber[s].charCodeAt(a - 1) - 32][0] - 2) - 33);\r\n break;\r\n case XPathParser.ACCEPT:\r\n return new XPath(tokenValue.pop());\r\n default:\r\n throw new Error(\"XPath parse error\");\r\n }\r\n }\r\n };\r\n\r\n // XPath /////////////////////////////////////////////////////////////////////\r\n\r\n XPath.prototype = new Object();\r\n XPath.prototype.constructor = XPath;\r\n XPath.superclass = Object.prototype;\r\n\r\n function XPath(e) {\r\n this.expression = e;\r\n }\r\n\r\n XPath.prototype.toString = function () {\r\n return this.expression.toString();\r\n };\r\n\r\n function setIfUnset(obj, prop, value) {\r\n if (!(prop in obj)) {\r\n obj[prop] = value;\r\n }\r\n }\r\n\r\n XPath.prototype.evaluate = function (c) {\r\n var node = c.expressionContextNode;\r\n\r\n if (!(isNil(node) || isNodeLike(node))) {\r\n throw new Error(\"Context node does not appear to be a valid DOM node.\");\r\n }\r\n\r\n c.contextNode = c.expressionContextNode;\r\n c.contextSize = 1;\r\n c.contextPosition = 1;\r\n\r\n // [2017-11-25] Removed usage of .implementation.hasFeature() since it does\r\n // not reliably detect HTML DOMs (always returns false in xmldom and true in browsers)\r\n if (c.isHtml) {\r\n setIfUnset(c, 'caseInsensitive', true);\r\n setIfUnset(c, 'allowAnyNamespaceForNoPrefix', true);\r\n }\r\n\r\n setIfUnset(c, 'caseInsensitive', false);\r\n\r\n return this.expression.evaluate(c);\r\n };\r\n\r\n XPath.XML_NAMESPACE_URI = \"http://www.w3.org/XML/1998/namespace\";\r\n XPath.XMLNS_NAMESPACE_URI = \"http://www.w3.org/2000/xmlns/\";\r\n\r\n // Expression ////////////////////////////////////////////////////////////////\r\n\r\n Expression.prototype = new Object();\r\n Expression.prototype.constructor = Expression;\r\n Expression.superclass = Object.prototype;\r\n\r\n function Expression() {\r\n }\r\n\r\n Expression.prototype.init = function () {\r\n };\r\n\r\n Expression.prototype.toString = function () {\r\n return \"\";\r\n };\r\n\r\n Expression.prototype.evaluate = function (c) {\r\n throw new Error(\"Could not evaluate expression.\");\r\n };\r\n\r\n // UnaryOperation ////////////////////////////////////////////////////////////\r\n\r\n UnaryOperation.prototype = new Expression();\r\n UnaryOperation.prototype.constructor = UnaryOperation;\r\n UnaryOperation.superclass = Expression.prototype;\r\n\r\n function UnaryOperation(rhs) {\r\n if (arguments.length > 0) {\r\n this.init(rhs);\r\n }\r\n }\r\n\r\n UnaryOperation.prototype.init = function (rhs) {\r\n this.rhs = rhs;\r\n };\r\n\r\n // UnaryMinusOperation ///////////////////////////////////////////////////////\r\n\r\n UnaryMinusOperation.prototype = new UnaryOperation();\r\n UnaryMinusOperation.prototype.constructor = UnaryMinusOperation;\r\n UnaryMinusOperation.superclass = UnaryOperation.prototype;\r\n\r\n function UnaryMinusOperation(rhs) {\r\n if (arguments.length > 0) {\r\n this.init(rhs);\r\n }\r\n }\r\n\r\n UnaryMinusOperation.prototype.init = function (rhs) {\r\n UnaryMinusOperation.superclass.init.call(this, rhs);\r\n };\r\n\r\n UnaryMinusOperation.prototype.evaluate = function (c) {\r\n return this.rhs.evaluate(c).number().negate();\r\n };\r\n\r\n UnaryMinusOperation.prototype.toString = function () {\r\n return \"-\" + this.rhs.toString();\r\n };\r\n\r\n // BinaryOperation ///////////////////////////////////////////////////////////\r\n\r\n BinaryOperation.prototype = new Expression();\r\n BinaryOperation.prototype.constructor = BinaryOperation;\r\n BinaryOperation.superclass = Expression.prototype;\r\n\r\n function BinaryOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n BinaryOperation.prototype.init = function (lhs, rhs) {\r\n this.lhs = lhs;\r\n this.rhs = rhs;\r\n };\r\n\r\n // OrOperation ///////////////////////////////////////////////////////////////\r\n\r\n OrOperation.prototype = new BinaryOperation();\r\n OrOperation.prototype.constructor = OrOperation;\r\n OrOperation.superclass = BinaryOperation.prototype;\r\n\r\n function OrOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n OrOperation.prototype.init = function (lhs, rhs) {\r\n OrOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n OrOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" or \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n OrOperation.prototype.evaluate = function (c) {\r\n var b = this.lhs.evaluate(c).bool();\r\n if (b.booleanValue()) {\r\n return b;\r\n }\r\n return this.rhs.evaluate(c).bool();\r\n };\r\n\r\n // AndOperation //////////////////////////////////////////////////////////////\r\n\r\n AndOperation.prototype = new BinaryOperation();\r\n AndOperation.prototype.constructor = AndOperation;\r\n AndOperation.superclass = BinaryOperation.prototype;\r\n\r\n function AndOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n AndOperation.prototype.init = function (lhs, rhs) {\r\n AndOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n AndOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" and \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n AndOperation.prototype.evaluate = function (c) {\r\n var b = this.lhs.evaluate(c).bool();\r\n if (!b.booleanValue()) {\r\n return b;\r\n }\r\n return this.rhs.evaluate(c).bool();\r\n };\r\n\r\n // EqualsOperation ///////////////////////////////////////////////////////////\r\n\r\n EqualsOperation.prototype = new BinaryOperation();\r\n EqualsOperation.prototype.constructor = EqualsOperation;\r\n EqualsOperation.superclass = BinaryOperation.prototype;\r\n\r\n function EqualsOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n EqualsOperation.prototype.init = function (lhs, rhs) {\r\n EqualsOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n EqualsOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" = \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n EqualsOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).equals(this.rhs.evaluate(c));\r\n };\r\n\r\n // NotEqualOperation /////////////////////////////////////////////////////////\r\n\r\n NotEqualOperation.prototype = new BinaryOperation();\r\n NotEqualOperation.prototype.constructor = NotEqualOperation;\r\n NotEqualOperation.superclass = BinaryOperation.prototype;\r\n\r\n function NotEqualOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n NotEqualOperation.prototype.init = function (lhs, rhs) {\r\n NotEqualOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n NotEqualOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" != \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n NotEqualOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).notequal(this.rhs.evaluate(c));\r\n };\r\n\r\n // LessThanOperation /////////////////////////////////////////////////////////\r\n\r\n LessThanOperation.prototype = new BinaryOperation();\r\n LessThanOperation.prototype.constructor = LessThanOperation;\r\n LessThanOperation.superclass = BinaryOperation.prototype;\r\n\r\n function LessThanOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n LessThanOperation.prototype.init = function (lhs, rhs) {\r\n LessThanOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n LessThanOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).lessthan(this.rhs.evaluate(c));\r\n };\r\n\r\n LessThanOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" < \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n // GreaterThanOperation //////////////////////////////////////////////////////\r\n\r\n GreaterThanOperation.prototype = new BinaryOperation();\r\n GreaterThanOperation.prototype.constructor = GreaterThanOperation;\r\n GreaterThanOperation.superclass = BinaryOperation.prototype;\r\n\r\n function GreaterThanOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n GreaterThanOperation.prototype.init = function (lhs, rhs) {\r\n GreaterThanOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n GreaterThanOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).greaterthan(this.rhs.evaluate(c));\r\n };\r\n\r\n GreaterThanOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" > \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n // LessThanOrEqualOperation //////////////////////////////////////////////////\r\n\r\n LessThanOrEqualOperation.prototype = new BinaryOperation();\r\n LessThanOrEqualOperation.prototype.constructor = LessThanOrEqualOperation;\r\n LessThanOrEqualOperation.superclass = BinaryOperation.prototype;\r\n\r\n function LessThanOrEqualOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n LessThanOrEqualOperation.prototype.init = function (lhs, rhs) {\r\n LessThanOrEqualOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n LessThanOrEqualOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).lessthanorequal(this.rhs.evaluate(c));\r\n };\r\n\r\n LessThanOrEqualOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" <= \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n // GreaterThanOrEqualOperation ///////////////////////////////////////////////\r\n\r\n GreaterThanOrEqualOperation.prototype = new BinaryOperation();\r\n GreaterThanOrEqualOperation.prototype.constructor = GreaterThanOrEqualOperation;\r\n GreaterThanOrEqualOperation.superclass = BinaryOperation.prototype;\r\n\r\n function GreaterThanOrEqualOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n GreaterThanOrEqualOperation.prototype.init = function (lhs, rhs) {\r\n GreaterThanOrEqualOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n GreaterThanOrEqualOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).greaterthanorequal(this.rhs.evaluate(c));\r\n };\r\n\r\n GreaterThanOrEqualOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" >= \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n // PlusOperation /////////////////////////////////////////////////////////////\r\n\r\n PlusOperation.prototype = new BinaryOperation();\r\n PlusOperation.prototype.constructor = PlusOperation;\r\n PlusOperation.superclass = BinaryOperation.prototype;\r\n\r\n function PlusOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n PlusOperation.prototype.init = function (lhs, rhs) {\r\n PlusOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n PlusOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).number().plus(this.rhs.evaluate(c).number());\r\n };\r\n\r\n PlusOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" + \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n // MinusOperation ////////////////////////////////////////////////////////////\r\n\r\n MinusOperation.prototype = new BinaryOperation();\r\n MinusOperation.prototype.constructor = MinusOperation;\r\n MinusOperation.superclass = BinaryOperation.prototype;\r\n\r\n function MinusOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n MinusOperation.prototype.init = function (lhs, rhs) {\r\n MinusOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n MinusOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).number().minus(this.rhs.evaluate(c).number());\r\n };\r\n\r\n MinusOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" - \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n // MultiplyOperation /////////////////////////////////////////////////////////\r\n\r\n MultiplyOperation.prototype = new BinaryOperation();\r\n MultiplyOperation.prototype.constructor = MultiplyOperation;\r\n MultiplyOperation.superclass = BinaryOperation.prototype;\r\n\r\n function MultiplyOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n MultiplyOperation.prototype.init = function (lhs, rhs) {\r\n MultiplyOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n MultiplyOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).number().multiply(this.rhs.evaluate(c).number());\r\n };\r\n\r\n MultiplyOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" * \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n // DivOperation //////////////////////////////////////////////////////////////\r\n\r\n DivOperation.prototype = new BinaryOperation();\r\n DivOperation.prototype.constructor = DivOperation;\r\n DivOperation.superclass = BinaryOperation.prototype;\r\n\r\n function DivOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n DivOperation.prototype.init = function (lhs, rhs) {\r\n DivOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n DivOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).number().div(this.rhs.evaluate(c).number());\r\n };\r\n\r\n DivOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" div \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n // ModOperation //////////////////////////////////////////////////////////////\r\n\r\n ModOperation.prototype = new BinaryOperation();\r\n ModOperation.prototype.constructor = ModOperation;\r\n ModOperation.superclass = BinaryOperation.prototype;\r\n\r\n function ModOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n ModOperation.prototype.init = function (lhs, rhs) {\r\n ModOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n ModOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).number().mod(this.rhs.evaluate(c).number());\r\n };\r\n\r\n ModOperation.prototype.toString = function () {\r\n return \"(\" + this.lhs.toString() + \" mod \" + this.rhs.toString() + \")\";\r\n };\r\n\r\n // BarOperation //////////////////////////////////////////////////////////////\r\n\r\n BarOperation.prototype = new BinaryOperation();\r\n BarOperation.prototype.constructor = BarOperation;\r\n BarOperation.superclass = BinaryOperation.prototype;\r\n\r\n function BarOperation(lhs, rhs) {\r\n if (arguments.length > 0) {\r\n this.init(lhs, rhs);\r\n }\r\n }\r\n\r\n BarOperation.prototype.init = function (lhs, rhs) {\r\n BarOperation.superclass.init.call(this, lhs, rhs);\r\n };\r\n\r\n BarOperation.prototype.evaluate = function (c) {\r\n return this.lhs.evaluate(c).nodeset().union(this.rhs.evaluate(c).nodeset());\r\n };\r\n\r\n BarOperation.prototype.toString = function () {\r\n return map(toString, [this.lhs, this.rhs]).join(' | ');\r\n };\r\n\r\n // PathExpr //////////////////////////////////////////////////////////////////\r\n\r\n PathExpr.prototype = new Expression();\r\n PathExpr.prototype.constructor = PathExpr;\r\n PathExpr.superclass = Expression.prototype;\r\n\r\n function PathExpr(filter, filterPreds, locpath) {\r\n if (arguments.length > 0) {\r\n this.init(filter, filterPreds, locpath);\r\n }\r\n }\r\n\r\n PathExpr.prototype.init = function (filter, filterPreds, locpath) {\r\n PathExpr.superclass.init.call(this);\r\n this.filter = filter;\r\n this.filterPredicates = filterPreds;\r\n this.locationPath = locpath;\r\n };\r\n\r\n /**\r\n * Returns the topmost node of the tree containing node\r\n */\r\n function findRoot(node) {\r\n while (node && node.parentNode) {\r\n node = node.parentNode;\r\n }\r\n\r\n return node;\r\n }\r\n\r\n var applyPredicates = function (predicates, c, nodes, reverse) {\r\n if (predicates.length === 0) {\r\n return nodes;\r\n }\r\n\r\n var ctx = c.extend({});\r\n\r\n return reduce(\r\n function (inNodes, pred) {\r\n ctx.contextSize = inNodes.length;\r\n\r\n return filter(\r\n function (node, i) {\r\n ctx.contextNode = node;\r\n ctx.contextPosition = i + 1;\r\n\r\n return PathExpr.predicateMatches(pred, ctx);\r\n },\r\n inNodes\r\n );\r\n },\r\n sortNodes(nodes, reverse),\r\n predicates\r\n );\r\n };\r\n\r\n PathExpr.getRoot = function (xpc, nodes) {\r\n var firstNode = nodes[0];\r\n\r\n // xpc.virtualRoot could possibly provide a root even if firstNode is null,\r\n // so using a guard here instead of throwing.\r\n if (firstNode && firstNode.nodeType === NodeTypes.DOCUMENT_NODE) {\r\n return firstNode;\r\n }\r\n\r\n if (xpc.virtualRoot) {\r\n return xpc.virtualRoot;\r\n }\r\n\r\n if (!firstNode) {\r\n throw new Error('Context node not found when determining document root.');\r\n }\r\n\r\n var ownerDoc = firstNode.ownerDocument;\r\n\r\n if (ownerDoc) {\r\n return ownerDoc;\r\n }\r\n\r\n // IE 5.5 doesn't have ownerDocument?\r\n var n = firstNode;\r\n while (n.parentNode != null) {\r\n n = n.parentNode;\r\n }\r\n return n;\r\n }\r\n\r\n var getPrefixForNamespaceNode = function (attrNode) {\r\n var nm = String(attrNode.name);\r\n\r\n if (nm === \"xmlns\") {\r\n return \"\";\r\n }\r\n\r\n if (nm.substring(0, 6) === \"xmlns:\") {\r\n return nm.substring(6, nm.length);\r\n }\r\n\r\n return null;\r\n };\r\n\r\n PathExpr.applyStep = function (step, xpc, node) {\r\n if (!node) {\r\n throw new Error('Context node not found when evaluating XPath step: ' + step);\r\n }\r\n\r\n var newNodes = [];\r\n xpc.contextNode = node;\r\n\r\n switch (step.axis) {\r\n case Step.ANCESTOR:\r\n // look at all the ancestor nodes\r\n if (xpc.contextNode === xpc.virtualRoot) {\r\n break;\r\n }\r\n var m;\r\n if (xpc.contextNode.nodeType == NodeTypes.ATTRIBUTE_NODE) {\r\n m = PathExpr.getOwnerElement(xpc.contextNode);\r\n } else {\r\n m = xpc.contextNode.parentNode;\r\n }\r\n while (m != null) {\r\n if (step.nodeTest.matches(m, xpc)) {\r\n newNodes.push(m);\r\n }\r\n if (m === xpc.virtualRoot) {\r\n break;\r\n }\r\n m = m.parentNode;\r\n }\r\n break;\r\n\r\n case Step.ANCESTORORSELF:\r\n // look at all the ancestor nodes and the current node\r\n for (var m = xpc.contextNode; m != null; m = m.nodeType == NodeTypes.ATTRIBUTE_NODE ? PathExpr.getOwnerElement(m) : m.parentNode) {\r\n if (step.nodeTest.matches(m, xpc)) {\r\n newNodes.push(m);\r\n }\r\n if (m === xpc.virtualRoot) {\r\n break;\r\n }\r\n }\r\n break;\r\n\r\n case Step.ATTRIBUTE:\r\n // look at the attributes\r\n var nnm = xpc.contextNode.attributes;\r\n if (nnm != null) {\r\n for (var k = 0; k < nnm.length; k++) {\r\n var m = nnm.item(k);\r\n if (step.nodeTest.matches(m, xpc)) {\r\n newNodes.push(m);\r\n }\r\n }\r\n }\r\n break;\r\n\r\n case Step.CHILD:\r\n // look at all child elements\r\n for (var m = xpc.contextNode.firstChild; m != null; m = m.nextSibling) {\r\n if (step.nodeTest.matches(m, xpc)) {\r\n newNodes.push(m);\r\n }\r\n }\r\n break;\r\n\r\n case Step.DESCENDANT:\r\n // look at all descendant nodes\r\n var st = [xpc.contextNode.firstChild];\r\n while (st.length > 0) {\r\n for (var m = st.pop(); m != null;) {\r\n if (step.nodeTest.matches(m, xpc)) {\r\n newNodes.push(m);\r\n }\r\n if (m.firstChild != null) {\r\n st.push(m.nextSibling);\r\n m = m.firstChild;\r\n } else {\r\n m = m.nextSibling;\r\n }\r\n }\r\n }\r\n break;\r\n\r\n case Step.DESCENDANTORSELF:\r\n // look at self\r\n if (step.nodeTest.matches(xpc.contextNode, xpc)) {\r\n newNodes.push(xpc.contextNode);\r\n }\r\n // look at all descendant nodes\r\n var st = [xpc.contextNode.firstChild];\r\n while (st.length > 0) {\r\n for (var m = st.pop(); m != null;) {\r\n if (step.nodeTest.matches(m, xpc)) {\r\n newNodes.push(m);\r\n }\r\n if (m.firstChild != null) {\r\n st.push(m.nextSibling);\r\n m = m.firstChild;\r\n } else {\r\n m = m.nextSibling;\r\n }\r\n }\r\n }\r\n break;\r\n\r\n case Step.FOLLOWING:\r\n if (xpc.contextNode === xpc.virtualRoot) {\r\n break;\r\n }\r\n var st = [];\r\n if (xpc.contextNode.firstChild != null) {\r\n st.unshift(xpc.contextNode.firstChild);\r\n } else {\r\n st.unshift(xpc.contextNode.nextSibling);\r\n }\r\n for (var m = xpc.contextNode.parentNode; m != null && m.nodeType != NodeTypes.DOCUMENT_NODE && m !== xpc.virtualRoot; m = m.parentNode) {\r\n st.unshift(m.nextSibling);\r\n }\r\n do {\r\n for (var m = st.pop(); m != null;) {\r\n if (step.nodeTest.matches(m, xpc)) {\r\n newNodes.push(m);\r\n }\r\n if (m.firstChild != null) {\r\n st.push(m.nextSibling);\r\n m = m.firstChild;\r\n } else {\r\n m = m.nextSibling;\r\n }\r\n }\r\n } while (st.length > 0);\r\n break;\r\n\r\n case Step.FOLLOWINGSIBLING:\r\n if (xpc.contextNode === xpc.virtualRoot) {\r\n break;\r\n }\r\n for (var m = xpc.contextNode.nextSibling; m != null; m = m.nextSibling) {\r\n if (step.nodeTest.matches(m, xpc)) {\r\n newNodes.push(m);\r\n }\r\n }\r\n break;\r\n\r\n case Step.NAMESPACE:\r\n var nodes = {};\r\n\r\n if (xpc.contextNode.nodeType == NodeTypes.ELEMENT_NODE) {\r\n // BUG: This only collects the namespaces on the current node, but seemingly\r\n // it should collect all those in scope\r\n nodes[\"xml\"] = new XPathNamespace(\"xml\", null, XPath.XML_NAMESPACE_URI, xpc.contextNode);\r\n\r\n for (var m = xpc.contextNode; m != null && m.nodeType == NodeTypes.ELEMENT_NODE; m = m.parentNode) {\r\n for (var k = 0; k < m.attributes.length; k++) {\r\n var attr = m.attributes.item(k);\r\n\r\n var pre = getPrefixForNamespaceNode(attr);\r\n\r\n if (pre != null && nodes[pre] == undefined) {\r\n nodes[pre] = new XPathNamespace(pre, attr, attr.value, xpc.contextNode);\r\n }\r\n }\r\n }\r\n\r\n for (var pre in nodes) {\r\n var node = nodes[pre];\r\n\r\n if (step.nodeTest.matches(node, xpc)) {\r\n newNodes.push(node);\r\n }\r\n }\r\n }\r\n break;\r\n\r\n case Step.PARENT:\r\n m = null;\r\n if (xpc.contextNode !== xpc.virtualRoot) {\r\n if (xpc.contextNode.nodeType == NodeTypes.ATTRIBUTE_NODE) {\r\n m = PathExpr.getOwnerElement(xpc.contextNode);\r\n } else {\r\n m = xpc.contextNode.parentNode;\r\n }\r\n }\r\n if (m != null && step.nodeTest.matches(m, xpc)) {\r\n newNodes.push(m);\r\n }\r\n break;\r\n\r\n case Step.PRECEDING:\r\n var st;\r\n if (xpc.virtualRoot != null) {\r\n st = [xpc.virtualRoot];\r\n } else {\r\n // cannot rely on .ownerDocument because the node may be in a document fragment\r\n st = [findRoot(xpc.contextNode)];\r\n }\r\n outer: while (st.length > 0) {\r\n for (var m = st.pop(); m != null;) {\r\n if (m == xpc.contextNode) {\r\n break outer;\r\n }\r\n if (step.nodeTest.matches(m, xpc)) {\r\n newNodes.unshift(m);\r\n }\r\n if (m.firstChild != null) {\r\n st.push(m.nextSibling);\r\n m = m.firstChild;\r\n } else {\r\n m = m.nextSibling;\r\n }\r\n }\r\n }\r\n break;\r\n\r\n case Step.PRECEDINGSIBLING:\r\n if (xpc.contextNode === xpc.virtualRoot) {\r\n break;\r\n }\r\n for (var m = xpc.contextNode.previousSibling; m != null; m = m.previousSibling) {\r\n if (step.nodeTest.matches(m, xpc)) {\r\n newNodes.push(m);\r\n }\r\n }\r\n break;\r\n\r\n case Step.SELF:\r\n if (step.nodeTest.matches(xpc.contextNode, xpc)) {\r\n newNodes.push(xpc.contextNode);\r\n }\r\n break;\r\n\r\n default:\r\n }\r\n\r\n return newNodes;\r\n };\r\n\r\n function applyStepWithPredicates(step, xpc, node) {\r\n return applyPredicates(\r\n step.predicates,\r\n xpc,\r\n PathExpr.applyStep(step, xpc, node),\r\n includes(REVERSE_AXES, step.axis)\r\n );\r\n }\r\n\r\n function applyStepToNodes(context, nodes, step) {\r\n return flatten(\r\n map(\r\n applyStepWithPredicates.bind(null, step, context),\r\n nodes\r\n )\r\n );\r\n }\r\n\r\n PathExpr.applySteps = function (steps, xpc, nodes) {\r\n return reduce(\r\n applyStepToNodes.bind(null, xpc),\r\n nodes,\r\n steps\r\n );\r\n }\r\n\r\n PathExpr.prototype.applyFilter = function (c, xpc) {\r\n if (!this.filter) {\r\n return { nodes: [c.contextNode] };\r\n }\r\n\r\n var ns = this.filter.evaluate(c);\r\n\r\n if (!Utilities.instance_of(ns, XNodeSet)) {\r\n if (this.filterPredicates != null && this.filterPredicates.length > 0 || this.locationPath != null) {\r\n throw new Error(\"Path expression filter must evaluate to a nodeset if predicates or location path are used\");\r\n }\r\n\r\n return { nonNodes: ns };\r\n }\r\n\r\n return {\r\n nodes: applyPredicates(\r\n this.filterPredicates || [],\r\n xpc,\r\n ns.toUnsortedArray(),\r\n false // reverse\r\n )\r\n };\r\n };\r\n\r\n PathExpr.applyLocationPath = function (locationPath, xpc, nodes) {\r\n if (!locationPath) {\r\n return nodes;\r\n }\r\n\r\n var startNodes = locationPath.absolute ? [PathExpr.getRoot(xpc, nodes)] : nodes;\r\n\r\n return PathExpr.applySteps(locationPath.steps, xpc, startNodes);\r\n };\r\n\r\n PathExpr.prototype.evaluate = function (c) {\r\n var xpc = assign(new XPathContext(), c);\r\n\r\n var filterResult = this.applyFilter(c, xpc);\r\n\r\n if ('nonNodes' in filterResult) {\r\n return filterResult.nonNodes;\r\n }\r\n\r\n var ns = new XNodeSet();\r\n ns.addArray(PathExpr.applyLocationPath(this.locationPath, xpc, filterResult.nodes));\r\n return ns;\r\n };\r\n\r\n PathExpr.predicateMatches = function (pred, c) {\r\n var res = pred.evaluate(c);\r\n\r\n return Utilities.instance_of(res, XNumber)\r\n ? c.contextPosition === res.numberValue()\r\n : res.booleanValue();\r\n };\r\n\r\n PathExpr.predicateString = function (predicate) {\r\n return wrap('[', ']', predicate.toString());\r\n }\r\n\r\n PathExpr.predicatesString = function (predicates) {\r\n return join(\r\n '',\r\n map(PathExpr.predicateString, predicates)\r\n );\r\n }\r\n\r\n PathExpr.prototype.toString = function () {\r\n if (this.filter != undefined) {\r\n var filterStr = toString(this.filter);\r\n\r\n if (Utilities.instance_of(this.filter, XString)) {\r\n return wrap(\"'\", \"'\", filterStr);\r\n }\r\n if (this.filterPredicates != undefined && this.filterPredicates.length) {\r\n return wrap('(', ')', filterStr) +\r\n PathExpr.predicatesString(this.filterPredicates);\r\n }\r\n if (this.locationPath != undefined) {\r\n return filterStr +\r\n (this.locationPath.absolute ? '' : '/') +\r\n toString(this.locationPath);\r\n }\r\n\r\n return filterStr;\r\n }\r\n\r\n return toString(this.locationPath);\r\n };\r\n\r\n PathExpr.getOwnerElement = function (n) {\r\n // DOM 2 has ownerElement\r\n if (n.ownerElement) {\r\n return n.ownerElement;\r\n }\r\n // DOM 1 Internet Explorer can use selectSingleNode (ironically)\r\n try {\r\n if (n.selectSingleNode) {\r\n return n.selectSingleNode(\"..\");\r\n }\r\n } catch (e) {\r\n }\r\n // Other DOM 1 implementations must use this egregious search\r\n var doc = n.nodeType == NodeTypes.DOCUMENT_NODE\r\n ? n\r\n : n.ownerDocument;\r\n var elts = doc.getElementsByTagName(\"*\");\r\n for (var i = 0; i < elts.length; i++) {\r\n var elt = elts.item(i);\r\n var nnm = elt.attributes;\r\n for (var j = 0; j < nnm.length; j++) {\r\n var an = nnm.item(j);\r\n if (an === n) {\r\n return elt;\r\n }\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n // LocationPath //////////////////////////////////////////////////////////////\r\n\r\n LocationPath.prototype = new Object();\r\n LocationPath.prototype.constructor = LocationPath;\r\n LocationPath.superclass = Object.prototype;\r\n\r\n function LocationPath(abs, steps) {\r\n if (arguments.length > 0) {\r\n this.init(abs, steps);\r\n }\r\n }\r\n\r\n LocationPath.prototype.init = function (abs, steps) {\r\n this.absolute = abs;\r\n this.steps = steps;\r\n };\r\n\r\n LocationPath.prototype.toString = function () {\r\n return (\r\n (this.absolute ? '/' : '') +\r\n map(toString, this.steps).join('/')\r\n );\r\n };\r\n\r\n // Step //////////////////////////////////////////////////////////////////////\r\n\r\n Step.prototype = new Object();\r\n Step.prototype.constructor = Step;\r\n Step.superclass = Object.prototype;\r\n\r\n function Step(axis, nodetest, preds) {\r\n if (arguments.length > 0) {\r\n this.init(axis, nodetest, preds);\r\n }\r\n }\r\n\r\n Step.prototype.init = function (axis, nodetest, preds) {\r\n this.axis = axis;\r\n this.nodeTest = nodetest;\r\n this.predicates = preds;\r\n };\r\n\r\n Step.prototype.toString = function () {\r\n return Step.STEPNAMES[this.axis] +\r\n \"::\" +\r\n this.nodeTest.toString() +\r\n PathExpr.predicatesString(this.predicates);\r\n };\r\n\r\n\r\n Step.ANCESTOR = 0;\r\n Step.ANCESTORORSELF = 1;\r\n Step.ATTRIBUTE = 2;\r\n Step.CHILD = 3;\r\n Step.DESCENDANT = 4;\r\n Step.DESCENDANTORSELF = 5;\r\n Step.FOLLOWING = 6;\r\n Step.FOLLOWINGSIBLING = 7;\r\n Step.NAMESPACE = 8;\r\n Step.PARENT = 9;\r\n Step.PRECEDING = 10;\r\n Step.PRECEDINGSIBLING = 11;\r\n Step.SELF = 12;\r\n\r\n Step.STEPNAMES = reduce(function (acc, x) { return acc[x[0]] = x[1], acc; }, {}, [\r\n [Step.ANCESTOR, 'ancestor'],\r\n [Step.ANCESTORORSELF, 'ancestor-or-self'],\r\n [Step.ATTRIBUTE, 'attribute'],\r\n [Step.CHILD, 'child'],\r\n [Step.DESCENDANT, 'descendant'],\r\n [Step.DESCENDANTORSELF, 'descendant-or-self'],\r\n [Step.FOLLOWING, 'following'],\r\n [Step.FOLLOWINGSIBLING, 'following-sibling'],\r\n [Step.NAMESPACE, 'namespace'],\r\n [Step.PARENT, 'parent'],\r\n [Step.PRECEDING, 'preceding'],\r\n [Step.PRECEDINGSIBLING, 'preceding-sibling'],\r\n [Step.SELF, 'self']\r\n ]);\r\n\r\n var REVERSE_AXES = [\r\n Step.ANCESTOR,\r\n Step.ANCESTORORSELF,\r\n Step.PARENT,\r\n Step.PRECEDING,\r\n Step.PRECEDINGSIBLING\r\n ];\r\n\r\n // NodeTest //////////////////////////////////////////////////////////////////\r\n\r\n NodeTest.prototype = new Object();\r\n NodeTest.prototype.constructor = NodeTest;\r\n NodeTest.superclass = Object.prototype;\r\n\r\n function NodeTest(type, value) {\r\n if (arguments.length > 0) {\r\n this.init(type, value);\r\n }\r\n }\r\n\r\n NodeTest.prototype.init = function (type, value) {\r\n this.type = type;\r\n this.value = value;\r\n };\r\n\r\n NodeTest.prototype.toString = function () {\r\n return \"\";\r\n };\r\n\r\n NodeTest.prototype.matches = function (n, xpc) {\r\n console.warn('unknown node test type');\r\n };\r\n\r\n NodeTest.NAMETESTANY = 0;\r\n NodeTest.NAMETESTPREFIXANY = 1;\r\n NodeTest.NAMETESTQNAME = 2;\r\n NodeTest.COMMENT = 3;\r\n NodeTest.TEXT = 4;\r\n NodeTest.PI = 5;\r\n NodeTest.NODE = 6;\r\n\r\n NodeTest.isNodeType = function (types) {\r\n return function (node) {\r\n return includes(types, node.nodeType);\r\n };\r\n };\r\n\r\n NodeTest.makeNodeTestType = function (type, members, ctor) {\r\n var newType = ctor || function () { };\r\n\r\n newType.prototype = new NodeTest(type);\r\n newType.prototype.constructor = newType;\r\n\r\n assign(newType.prototype, members);\r\n\r\n return newType;\r\n };\r\n // create invariant node test for certain node types\r\n NodeTest.makeNodeTypeTest = function (type, nodeTypes, stringVal) {\r\n return new (NodeTest.makeNodeTestType(type, {\r\n matches: NodeTest.isNodeType(nodeTypes),\r\n toString: always(stringVal)\r\n }))();\r\n };\r\n\r\n NodeTest.hasPrefix = function (node) {\r\n return node.prefix || (node.nodeName || node.tagName).indexOf(':') !== -1;\r\n };\r\n\r\n NodeTest.isElementOrAttribute = NodeTest.isNodeType([1, 2]);\r\n NodeTest.nameSpaceMatches = function (prefix, xpc, n) {\r\n var nNamespace = (n.namespaceURI || '');\r\n\r\n if (!prefix) {\r\n return !nNamespace || (xpc.allowAnyNamespaceForNoPrefix && !NodeTest.hasPrefix(n));\r\n }\r\n\r\n var ns = xpc.namespaceResolver.getNamespace(prefix, xpc.expressionContextNode);\r\n\r\n if (ns == null) {\r\n throw new Error(\"Cannot resolve QName \" + prefix);\r\n }\r\n\r\n return ns === nNamespace;\r\n };\r\n NodeTest.localNameMatches = function (localName, xpc, n) {\r\n var nLocalName = (n.localName || n.nodeName);\r\n\r\n return xpc.caseInsensitive\r\n ? localName.toLowerCase() === nLocalName.toLowerCase()\r\n : localName === nLocalName;\r\n };\r\n\r\n NodeTest.NameTestPrefixAny = NodeTest.makeNodeTestType(\r\n NodeTest.NAMETESTPREFIXANY,\r\n {\r\n matches: function (n, xpc) {\r\n return NodeTest.isElementOrAttribute(n) &&\r\n NodeTest.nameSpaceMatches(this.prefix, xpc, n);\r\n },\r\n toString: function () {\r\n return this.prefix + \":*\";\r\n }\r\n },\r\n function NameTestPrefixAny(prefix) { this.prefix = prefix; }\r\n );\r\n\r\n NodeTest.NameTestQName = NodeTest.makeNodeTestType(\r\n NodeTest.NAMETESTQNAME,\r\n {\r\n matches: function (n, xpc) {\r\n return NodeTest.isNodeType(\r\n [\r\n NodeTypes.ELEMENT_NODE,\r\n NodeTypes.ATTRIBUTE_NODE,\r\n NodeTypes.NAMESPACE_NODE,\r\n ]\r\n )(n) &&\r\n NodeTest.nameSpaceMatches(this.prefix, xpc, n) &&\r\n NodeTest.localNameMatches(this.localName, xpc, n);\r\n },\r\n toString: function () {\r\n return this.name;\r\n }\r\n },\r\n function NameTestQName(name) {\r\n var nameParts = name.split(':');\r\n\r\n this.name = name;\r\n this.prefix = nameParts.length > 1 ? nameParts[0] : null;\r\n this.localName = nameParts[nameParts.length > 1 ? 1 : 0];\r\n }\r\n );\r\n\r\n NodeTest.PITest = NodeTest.makeNodeTestType(NodeTest.PI, {\r\n matches: function (n, xpc) {\r\n return NodeTest.isNodeType(\r\n [NodeTypes.PROCESSING_INSTRUCTION_NODE]\r\n )(n) &&\r\n (n.target || n.nodeName) === this.name;\r\n },\r\n toString: function () {\r\n return wrap('processing-instruction(\"', '\")', this.name);\r\n }\r\n }, function (name) { this.name = name; })\r\n\r\n // singletons\r\n\r\n // elements, attributes, namespaces\r\n NodeTest.nameTestAny = NodeTest.makeNodeTypeTest(\r\n NodeTest.NAMETESTANY,\r\n [\r\n NodeTypes.ELEMENT_NODE,\r\n NodeTypes.ATTRIBUTE_NODE,\r\n NodeTypes.NAMESPACE_NODE,\r\n ],\r\n '*'\r\n );\r\n // text, cdata\r\n NodeTest.textTest = NodeTest.makeNodeTypeTest(\r\n NodeTest.TEXT,\r\n [\r\n NodeTypes.TEXT_NODE,\r\n NodeTypes.CDATA_SECTION_NODE,\r\n ],\r\n 'text()'\r\n );\r\n NodeTest.commentTest = NodeTest.makeNodeTypeTest(\r\n NodeTest.COMMENT,\r\n [NodeTypes.COMMENT_NODE],\r\n 'comment()'\r\n );\r\n // elements, attributes, text, cdata, PIs, comments, document nodes\r\n NodeTest.nodeTest = NodeTest.makeNodeTypeTest(\r\n NodeTest.NODE,\r\n [\r\n NodeTypes.ELEMENT_NODE,\r\n NodeTypes.ATTRIBUTE_NODE,\r\n NodeTypes.TEXT_NODE,\r\n NodeTypes.CDATA_SECTION_NODE,\r\n NodeTypes.PROCESSING_INSTRUCTION_NODE,\r\n NodeTypes.COMMENT_NODE,\r\n NodeTypes.DOCUMENT_NODE,\r\n ],\r\n 'node()'\r\n );\r\n NodeTest.anyPiTest = NodeTest.makeNodeTypeTest(\r\n NodeTest.PI,\r\n [NodeTypes.PROCESSING_INSTRUCTION_NODE],\r\n 'processing-instruction()'\r\n );\r\n\r\n // VariableReference /////////////////////////////////////////////////////////\r\n\r\n VariableReference.prototype = new Expression();\r\n VariableReference.prototype.constructor = VariableReference;\r\n VariableReference.superclass = Expression.prototype;\r\n\r\n function VariableReference(v) {\r\n if (arguments.length > 0) {\r\n this.init(v);\r\n }\r\n }\r\n\r\n VariableReference.prototype.init = function (v) {\r\n this.variable = v;\r\n };\r\n\r\n VariableReference.prototype.toString = function () {\r\n return \"$\" + this.variable;\r\n };\r\n\r\n VariableReference.prototype.evaluate = function (c) {\r\n var parts = Utilities.resolveQName(this.variable, c.namespaceResolver, c.contextNode, false);\r\n\r\n if (parts[0] == null) {\r\n throw new Error(\"Cannot resolve QName \" + fn);\r\n }\r\n var result = c.variableResolver.getVariable(parts[1], parts[0]);\r\n if (!result) {\r\n throw XPathException.fromMessage(\"Undeclared variable: \" + this.toString());\r\n }\r\n return result;\r\n };\r\n\r\n // FunctionCall //////////////////////////////////////////////////////////////\r\n\r\n FunctionCall.prototype = new Expression();\r\n FunctionCall.prototype.constructor = FunctionCall;\r\n FunctionCall.superclass = Expression.prototype;\r\n\r\n function FunctionCall(fn, args) {\r\n if (arguments.length > 0) {\r\n this.init(fn, args);\r\n }\r\n }\r\n\r\n FunctionCall.prototype.init = function (fn, args) {\r\n this.functionName = fn;\r\n this.arguments = args;\r\n };\r\n\r\n FunctionCall.prototype.toString = function () {\r\n var s = this.functionName + \"(\";\r\n for (var i = 0; i < this.arguments.length; i++) {\r\n if (i > 0) {\r\n s += \", \";\r\n }\r\n s += this.arguments[i].toString();\r\n }\r\n return s + \")\";\r\n };\r\n\r\n FunctionCall.prototype.evaluate = function (c) {\r\n var f = FunctionResolver.getFunctionFromContext(this.functionName, c);\r\n\r\n if (!f) {\r\n throw new Error(\"Unknown function \" + this.functionName);\r\n }\r\n\r\n var a = [c].concat(this.arguments);\r\n return f.apply(c.functionResolver.thisArg, a);\r\n };\r\n\r\n // Operators /////////////////////////////////////////////////////////////////\r\n\r\n var Operators = new Object();\r\n\r\n Operators.equals = function (l, r) {\r\n return l.equals(r);\r\n };\r\n\r\n Operators.notequal = function (l, r) {\r\n return l.notequal(r);\r\n };\r\n\r\n Operators.lessthan = function (l, r) {\r\n return l.lessthan(r);\r\n };\r\n\r\n Operators.greaterthan = function (l, r) {\r\n return l.greaterthan(r);\r\n };\r\n\r\n Operators.lessthanorequal = function (l, r) {\r\n return l.lessthanorequal(r);\r\n };\r\n\r\n Operators.greaterthanorequal = function (l, r) {\r\n return l.greaterthanorequal(r);\r\n };\r\n\r\n // XString ///////////////////////////////////////////////////////////////////\r\n\r\n XString.prototype = new Expression();\r\n XString.prototype.constructor = XString;\r\n XString.superclass = Expression.prototype;\r\n\r\n function XString(s) {\r\n if (arguments.length > 0) {\r\n this.init(s);\r\n }\r\n }\r\n\r\n XString.prototype.init = function (s) {\r\n this.str = String(s);\r\n };\r\n\r\n XString.prototype.toString = function () {\r\n return this.str;\r\n };\r\n\r\n XString.prototype.evaluate = function (c) {\r\n return this;\r\n };\r\n\r\n XString.prototype.string = function () {\r\n return this;\r\n };\r\n\r\n XString.prototype.number = function () {\r\n return new XNumber(this.str);\r\n };\r\n\r\n XString.prototype.bool = function () {\r\n return new XBoolean(this.str);\r\n };\r\n\r\n XString.prototype.nodeset = function () {\r\n throw new Error(\"Cannot convert string to nodeset\");\r\n };\r\n\r\n XString.prototype.stringValue = function () {\r\n return this.str;\r\n };\r\n\r\n XString.prototype.numberValue = function () {\r\n return this.number().numberValue();\r\n };\r\n\r\n XString.prototype.booleanValue = function () {\r\n return this.bool().booleanValue();\r\n };\r\n\r\n XString.prototype.equals = function (r) {\r\n if (Utilities.instance_of(r, XBoolean)) {\r\n return this.bool().equals(r);\r\n }\r\n if (Utilities.instance_of(r, XNumber)) {\r\n return this.number().equals(r);\r\n }\r\n if (Utilities.instance_of(r, XNodeSet)) {\r\n return r.compareWithString(this, Operators.equals);\r\n }\r\n return new XBoolean(this.str == r.str);\r\n };\r\n\r\n XString.prototype.notequal = function (r) {\r\n if (Utilities.instance_of(r, XBoolean)) {\r\n return this.bool().notequal(r);\r\n }\r\n if (Utilities.instance_of(r, XNumber)) {\r\n return this.number().notequal(r);\r\n }\r\n if (Utilities.instance_of(r, XNodeSet)) {\r\n return r.compareWithString(this, Operators.notequal);\r\n }\r\n return new XBoolean(this.str != r.str);\r\n };\r\n\r\n XString.prototype.lessthan = function (r) {\r\n return this.number().lessthan(r);\r\n };\r\n\r\n XString.prototype.greaterthan = function (r) {\r\n return this.number().greaterthan(r);\r\n };\r\n\r\n XString.prototype.lessthanorequal = function (r) {\r\n return this.number().lessthanorequal(r);\r\n };\r\n\r\n XString.prototype.greaterthanorequal = function (r) {\r\n return this.number().greaterthanorequal(r);\r\n };\r\n\r\n // XNumber ///////////////////////////////////////////////////////////////////\r\n\r\n XNumber.prototype = new Expression();\r\n XNumber.prototype.constructor = XNumber;\r\n XNumber.superclass = Expression.prototype;\r\n\r\n function XNumber(n) {\r\n if (arguments.length > 0) {\r\n this.init(n);\r\n }\r\n }\r\n\r\n XNumber.prototype.init = function (n) {\r\n this.num = typeof n === \"string\" ? this.parse(n) : Number(n);\r\n };\r\n\r\n XNumber.prototype.numberFormat = /^\\s*-?[0-9]*\\.?[0-9]+\\s*$/;\r\n\r\n XNumber.prototype.parse = function (s) {\r\n // XPath representation of numbers is more restrictive than what Number() or parseFloat() allow\r\n return this.numberFormat.test(s) ? parseFloat(s) : Number.NaN;\r\n };\r\n\r\n function padSmallNumber(numberStr) {\r\n var parts = numberStr.split('e-');\r\n var base = parts[0].replace('.', '');\r\n var exponent = Number(parts[1]);\r\n\r\n for (var i = 0; i < exponent - 1; i += 1) {\r\n base = '0' + base;\r\n }\r\n\r\n return '0.' + base;\r\n }\r\n\r\n function padLargeNumber(numberStr) {\r\n var parts = numberStr.split('e');\r\n var base = parts[0].replace('.', '');\r\n var exponent = Number(parts[1]);\r\n var zerosToAppend = exponent + 1 - base.length;\r\n\r\n for (var i = 0; i < zerosToAppend; i += 1) {\r\n base += '0';\r\n }\r\n\r\n return base;\r\n }\r\n\r\n XNumber.prototype.toString = function () {\r\n var strValue = this.num.toString();\r\n\r\n if (strValue.indexOf('e-') !== -1) {\r\n return padSmallNumber(strValue);\r\n }\r\n\r\n if (strValue.indexOf('e') !== -1) {\r\n return padLargeNumber(strValue);\r\n }\r\n\r\n return strValue;\r\n };\r\n\r\n XNumber.prototype.evaluate = function (c) {\r\n return this;\r\n };\r\n\r\n XNumber.prototype.string = function () {\r\n\r\n\r\n return new XString(this.toString());\r\n };\r\n\r\n XNumber.prototype.number = function () {\r\n return this;\r\n };\r\n\r\n XNumber.prototype.bool = function () {\r\n return new XBoolean(this.num);\r\n };\r\n\r\n XNumber.prototype.nodeset = function () {\r\n throw new Error(\"Cannot convert number to nodeset\");\r\n };\r\n\r\n XNumber.prototype.stringValue = function () {\r\n return this.string().stringValue();\r\n };\r\n\r\n XNumber.prototype.numberValue = function () {\r\n return this.num;\r\n };\r\n\r\n XNumber.prototype.booleanValue = function () {\r\n return this.bool().booleanValue();\r\n };\r\n\r\n XNumber.prototype.negate = function () {\r\n return new XNumber(-this.num);\r\n };\r\n\r\n XNumber.prototype.equals = function (r) {\r\n if (Utilities.instance_of(r, XBoolean)) {\r\n return this.bool().equals(r);\r\n }\r\n if (Utilities.instance_of(r, XString)) {\r\n return this.equals(r.number());\r\n }\r\n if (Utilities.instance_of(r, XNodeSet)) {\r\n return r.compareWithNumber(this, Operators.equals);\r\n }\r\n return new XBoolean(this.num == r.num);\r\n };\r\n\r\n XNumber.prototype.notequal = function (r) {\r\n if (Utilities.instance_of(r, XBoolean)) {\r\n return this.bool().notequal(r);\r\n }\r\n if (Utilities.instance_of(r, XString)) {\r\n return this.notequal(r.number());\r\n }\r\n if (Utilities.instance_of(r, XNodeSet)) {\r\n return r.compareWithNumber(this, Operators.notequal);\r\n }\r\n return new XBoolean(this.num != r.num);\r\n };\r\n\r\n XNumber.prototype.lessthan = function (r) {\r\n if (Utilities.instance_of(r, XNodeSet)) {\r\n return r.compareWithNumber(this, Operators.greaterthan);\r\n }\r\n if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) {\r\n return this.lessthan(r.number());\r\n }\r\n return new XBoolean(this.num < r.num);\r\n };\r\n\r\n XNumber.prototype.greaterthan = function (r) {\r\n if (Utilities.instance_of(r, XNodeSet)) {\r\n return r.compareWithNumber(this, Operators.lessthan);\r\n }\r\n if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) {\r\n return this.greaterthan(r.number());\r\n }\r\n return new XBoolean(this.num > r.num);\r\n };\r\n\r\n XNumber.prototype.lessthanorequal = function (r) {\r\n if (Utilities.instance_of(r, XNodeSet)) {\r\n return r.compareWithNumber(this, Operators.greaterthanorequal);\r\n }\r\n if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) {\r\n return this.lessthanorequal(r.number());\r\n }\r\n return new XBoolean(this.num <= r.num);\r\n };\r\n\r\n XNumber.prototype.greaterthanorequal = function (r) {\r\n if (Utilities.instance_of(r, XNodeSet)) {\r\n return r.compareWithNumber(this, Operators.lessthanorequal);\r\n }\r\n if (Utilities.instance_of(r, XBoolean) || Utilities.instance_of(r, XString)) {\r\n return this.greaterthanorequal(r.number());\r\n }\r\n return new XBoolean(this.num >= r.num);\r\n };\r\n\r\n XNumber.prototype.plus = function (r) {\r\n return new XNumber(this.num + r.num);\r\n };\r\n\r\n XNumber.prototype.minus = function (r) {\r\n return new XNumber(this.num - r.num);\r\n };\r\n\r\n XNumber.prototype.multiply = function (r) {\r\n return new XNumber(this.num * r.num);\r\n };\r\n\r\n XNumber.prototype.div = function (r) {\r\n return new XNumber(this.num / r.num);\r\n };\r\n\r\n XNumber.prototype.mod = function (r) {\r\n return new XNumber(this.num % r.num);\r\n };\r\n\r\n // XBoolean //////////////////////////////////////////////////////////////////\r\n\r\n XBoolean.prototype = new Expression();\r\n XBoolean.prototype.constructor = XBoolean;\r\n XBoolean.superclass = Expression.prototype;\r\n\r\n function XBoolean(b) {\r\n if (arguments.length > 0) {\r\n this.init(b);\r\n }\r\n }\r\n\r\n XBoolean.prototype.init = function (b) {\r\n this.b = Boolean(b);\r\n };\r\n\r\n XBoolean.prototype.toString = function () {\r\n return this.b.toString();\r\n };\r\n\r\n XBoolean.prototype.evaluate = function (c) {\r\n return this;\r\n };\r\n\r\n XBoolean.prototype.string = function () {\r\n return new XString(this.b);\r\n };\r\n\r\n XBoolean.prototype.number = function () {\r\n return new XNumber(this.b);\r\n };\r\n\r\n XBoolean.prototype.bool = function () {\r\n return this;\r\n };\r\n\r\n XBoolean.prototype.nodeset = function () {\r\n throw new Error(\"Cannot convert boolean to nodeset\");\r\n };\r\n\r\n XBoolean.prototype.stringValue = function () {\r\n return this.string().stringValue();\r\n };\r\n\r\n XBoolean.prototype.numberValue = function () {\r\n return this.number().numberValue();\r\n };\r\n\r\n XBoolean.prototype.booleanValue = function () {\r\n return this.b;\r\n };\r\n\r\n XBoolean.prototype.not = function () {\r\n return new XBoolean(!this.b);\r\n };\r\n\r\n XBoolean.prototype.equals = function (r) {\r\n if (Utilities.instance_of(r, XString) || Utilities.instance_of(r, XNumber)) {\r\n return this.equals(r.bool());\r\n }\r\n if (Utilities.instance_of(r, XNodeSet)) {\r\n return r.compareWithBoolean(this, Operators.equals);\r\n }\r\n return new XBoolean(this.b == r.b);\r\n };\r\n\r\n XBoolean.prototype.notequal = function (r) {\r\n if (Utilities.instance_of(r, XString) || Utilities.instance_of(r, XNumber)) {\r\n return this.notequal(r.bool());\r\n }\r\n if (Utilities.instance_of(r, XNodeSet)) {\r\n return r.compareWithBoolean(this, Operators.notequal);\r\n }\r\n return new XBoolean(this.b != r.b);\r\n };\r\n\r\n XBoolean.prototype.lessthan = function (r) {\r\n return this.number().lessthan(r);\r\n };\r\n\r\n XBoolean.prototype.greaterthan = function (r) {\r\n return this.number().greaterthan(r);\r\n };\r\n\r\n XBoolean.prototype.lessthanorequal = function (r) {\r\n return this.number().lessthanorequal(r);\r\n };\r\n\r\n XBoolean.prototype.greaterthanorequal = function (r) {\r\n return this.number().greaterthanorequal(r);\r\n };\r\n\r\n XBoolean.true_ = new XBoolean(true);\r\n XBoolean.false_ = new XBoolean(false);\r\n\r\n // AVLTree ///////////////////////////////////////////////////////////////////\r\n\r\n AVLTree.prototype = new Object();\r\n AVLTree.prototype.constructor = AVLTree;\r\n AVLTree.superclass = Object.prototype;\r\n\r\n function AVLTree(n) {\r\n this.init(n);\r\n }\r\n\r\n AVLTree.prototype.init = function (n) {\r\n this.left = null;\r\n this.right = null;\r\n this.node = n;\r\n this.depth = 1;\r\n };\r\n\r\n AVLTree.prototype.balance = function () {\r\n var ldepth = this.left == null ? 0 : this.left.depth;\r\n var rdepth = this.right == null ? 0 : this.right.depth;\r\n\r\n if (ldepth > rdepth + 1) {\r\n // LR or LL rotation\r\n var lldepth = this.left.left == null ? 0 : this.left.left.depth;\r\n var lrdepth = this.left.right == null ? 0 : this.left.right.depth;\r\n\r\n if (lldepth < lrdepth) {\r\n // LR rotation consists of a RR rotation of the left child\r\n this.left.rotateRR();\r\n // plus a LL rotation of this node, which happens anyway\r\n }\r\n this.rotateLL();\r\n } else if (ldepth + 1 < rdepth) {\r\n // RR or RL rorarion\r\n var rrdepth = this.right.right == null ? 0 : this.right.right.depth;\r\n var rldepth = this.right.left == null ? 0 : this.right.left.depth;\r\n\r\n if (rldepth > rrdepth) {\r\n // RR rotation consists of a LL rotation of the right child\r\n this.right.rotateLL();\r\n // plus a RR rotation of this node, which happens anyway\r\n }\r\n this.rotateRR();\r\n }\r\n };\r\n\r\n AVLTree.prototype.rotateLL = function () {\r\n // the left side is too long => rotate from the left (_not_ leftwards)\r\n var nodeBefore = this.node;\r\n var rightBefore = this.right;\r\n this.node = this.left.node;\r\n this.right = this.left;\r\n this.left = this.left.left;\r\n this.right.left = this.right.right;\r\n this.right.right = rightBefore;\r\n this.right.node = nodeBefore;\r\n this.right.updateInNewLocation();\r\n this.updateInNewLocation();\r\n };\r\n\r\n AVLTree.prototype.rotateRR = function () {\r\n // the right side is too long => rotate from the right (_not_ rightwards)\r\n var nodeBefore = this.node;\r\n var leftBefore = this.left;\r\n this.node = this.right.node;\r\n this.left = this.right;\r\n this.right = this.right.right;\r\n this.left.right = this.left.left;\r\n this.left.left = leftBefore;\r\n this.left.node = nodeBefore;\r\n this.left.updateInNewLocation();\r\n this.updateInNewLocation();\r\n };\r\n\r\n AVLTree.prototype.updateInNewLocation = function () {\r\n this.getDepthFromChildren();\r\n };\r\n\r\n AVLTree.prototype.getDepthFromChildren = function () {\r\n this.depth = this.node == null ? 0 : 1;\r\n if (this.left != null) {\r\n this.depth = this.left.depth + 1;\r\n }\r\n if (this.right != null && this.depth <= this.right.depth) {\r\n this.depth = this.right.depth + 1;\r\n }\r\n };\r\n\r\n function nodeOrder(n1, n2) {\r\n if (n1 === n2) {\r\n return 0;\r\n }\r\n\r\n if (n1.compareDocumentPosition) {\r\n var cpos = n1.compareDocumentPosition(n2);\r\n\r\n if (cpos & 0x01) {\r\n // not in the same document; return an arbitrary result (is there a better way to do this)\r\n return 1;\r\n }\r\n if (cpos & 0x0A) {\r\n // n2 precedes or contains n1\r\n return 1;\r\n }\r\n if (cpos & 0x14) {\r\n // n2 follows or is contained by n1\r\n return -1;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n var d1 = 0,\r\n d2 = 0;\r\n for (var m1 = n1; m1 != null; m1 = m1.parentNode || m1.ownerElement) {\r\n d1++;\r\n }\r\n for (var m2 = n2; m2 != null; m2 = m2.parentNode || m2.ownerElement) {\r\n d2++;\r\n }\r\n\r\n // step up to same depth\r\n if (d1 > d2) {\r\n while (d1 > d2) {\r\n n1 = n1.parentNode || n1.ownerElement;\r\n d1--;\r\n }\r\n if (n1 === n2) {\r\n return 1;\r\n }\r\n } else if (d2 > d1) {\r\n while (d2 > d1) {\r\n n2 = n2.parentNode || n2.ownerElement;\r\n d2--;\r\n }\r\n if (n1 === n2) {\r\n return -1;\r\n }\r\n }\r\n\r\n var n1Par = n1.parentNode || n1.ownerElement,\r\n n2Par = n2.parentNode || n2.ownerElement;\r\n\r\n // find common parent\r\n while (n1Par !== n2Par) {\r\n n1 = n1Par;\r\n n2 = n2Par;\r\n n1Par = n1.parentNode || n1.ownerElement;\r\n n2Par = n2.parentNode || n2.ownerElement;\r\n }\r\n\r\n var n1isAttr = isAttributeLike(n1);\r\n var n2isAttr = isAttributeLike(n2);\r\n\r\n if (n1isAttr && !n2isAttr) {\r\n return -1;\r\n }\r\n if (!n1isAttr && n2isAttr) {\r\n return 1;\r\n }\r\n\r\n // xml namespace node comes before others. namespace nodes before non-namespace nodes\r\n if (n1.isXPathNamespace) {\r\n if (n1.nodeValue === XPath.XML_NAMESPACE_URI) {\r\n return -1;\r\n }\r\n\r\n if (!n2.isXPathNamespace) {\r\n return -1;\r\n }\r\n\r\n if (n2.nodeValue === XPath.XML_NAMESPACE_URI) {\r\n return 1;\r\n }\r\n } else if (n2.isXPathNamespace) {\r\n return 1;\r\n }\r\n\r\n if (n1Par) {\r\n var cn = n1isAttr ? n1Par.attributes : n1Par.childNodes;\r\n var len = cn.length;\r\n var n1Compare = n1.baseNode || n1;\r\n var n2Compare = n2.baseNode || n2;\r\n\r\n for (var i = 0; i < len; i += 1) {\r\n var n = cn[i];\r\n if (n === n1Compare) {\r\n return -1;\r\n }\r\n if (n === n2Compare) {\r\n return 1;\r\n }\r\n }\r\n }\r\n\r\n throw new Error('Unexpected: could not determine node order');\r\n }\r\n\r\n AVLTree.prototype.add = function (n) {\r\n if (n === this.node) {\r\n return false;\r\n }\r\n\r\n var o = nodeOrder(n, this.node);\r\n\r\n var ret = false;\r\n if (o == -1) {\r\n if (this.left == null) {\r\n this.left = new AVLTree(n);\r\n ret = true;\r\n } else {\r\n ret = this.left.add(n);\r\n if (ret) {\r\n this.balance();\r\n }\r\n }\r\n } else if (o == 1) {\r\n if (this.right == null) {\r\n this.right = new AVLTree(n);\r\n ret = true;\r\n } else {\r\n ret = this.right.add(n);\r\n if (ret) {\r\n this.balance();\r\n }\r\n }\r\n }\r\n\r\n if (ret) {\r\n this.getDepthFromChildren();\r\n }\r\n return ret;\r\n };\r\n\r\n // XNodeSet //////////////////////////////////////////////////////////////////\r\n\r\n XNodeSet.prototype = new Expression();\r\n XNodeSet.prototype.constructor = XNodeSet;\r\n XNodeSet.superclass = Expression.prototype;\r\n\r\n function XNodeSet() {\r\n this.init();\r\n }\r\n\r\n XNodeSet.prototype.init = function () {\r\n this.tree = null;\r\n this.nodes = [];\r\n this.size = 0;\r\n };\r\n\r\n XNodeSet.prototype.toString = function () {\r\n var p = this.first();\r\n if (p == null) {\r\n return \"\";\r\n }\r\n return this.stringForNode(p);\r\n };\r\n\r\n XNodeSet.prototype.evaluate = function (c) {\r\n return this;\r\n };\r\n\r\n XNodeSet.prototype.string = function () {\r\n return new XString(this.toString());\r\n };\r\n\r\n XNodeSet.prototype.stringValue = function () {\r\n return this.toString();\r\n };\r\n\r\n XNodeSet.prototype.number = function () {\r\n return new XNumber(this.string());\r\n };\r\n\r\n XNodeSet.prototype.numberValue = function () {\r\n return Number(this.string());\r\n };\r\n\r\n XNodeSet.prototype.bool = function () {\r\n return new XBoolean(this.booleanValue());\r\n };\r\n\r\n XNodeSet.prototype.booleanValue = function () {\r\n return !!this.size;\r\n };\r\n\r\n XNodeSet.prototype.nodeset = function () {\r\n return this;\r\n };\r\n\r\n XNodeSet.prototype.stringForNode = function (n) {\r\n if (n.nodeType == NodeTypes.DOCUMENT_NODE ||\r\n n.nodeType == NodeTypes.ELEMENT_NODE ||\r\n n.nodeType === NodeTypes.DOCUMENT_FRAGMENT_NODE) {\r\n return this.stringForContainerNode(n);\r\n }\r\n if (n.nodeType === NodeTypes.ATTRIBUTE_NODE) {\r\n return n.value || n.nodeValue;\r\n }\r\n if (n.isNamespaceNode) {\r\n return n.namespace;\r\n }\r\n return n.nodeValue;\r\n };\r\n\r\n XNodeSet.prototype.stringForContainerNode = function (n) {\r\n var s = \"\";\r\n for (var n2 = n.firstChild; n2 != null; n2 = n2.nextSibling) {\r\n var nt = n2.nodeType;\r\n // Element, Text, CDATA, Document, Document Fragment\r\n if (nt === 1 || nt === 3 || nt === 4 || nt === 9 || nt === 11) {\r\n s += this.stringForNode(n2);\r\n }\r\n }\r\n return s;\r\n };\r\n\r\n XNodeSet.prototype.buildTree = function () {\r\n if (!this.tree && this.nodes.length) {\r\n this.tree = new AVLTree(this.nodes[0]);\r\n for (var i = 1; i < this.nodes.length; i += 1) {\r\n this.tree.add(this.nodes[i]);\r\n }\r\n }\r\n\r\n return this.tree;\r\n };\r\n\r\n XNodeSet.prototype.first = function () {\r\n var p = this.buildTree();\r\n if (p == null) {\r\n return null;\r\n }\r\n while (p.left != null) {\r\n p = p.left;\r\n }\r\n return p.node;\r\n };\r\n\r\n XNodeSet.prototype.add = function (n) {\r\n for (var i = 0; i < this.nodes.length; i += 1) {\r\n if (n === this.nodes[i]) {\r\n return;\r\n }\r\n }\r\n\r\n this.tree = null;\r\n this.nodes.push(n);\r\n this.size += 1;\r\n };\r\n\r\n XNodeSet.prototype.addArray = function (ns) {\r\n var self = this;\r\n\r\n forEach(function (x) { self.add(x); }, ns);\r\n };\r\n\r\n /**\r\n * Returns an array of the node set's contents in document order\r\n */\r\n XNodeSet.prototype.toArray = function () {\r\n var a = [];\r\n this.toArrayRec(this.buildTree(), a);\r\n return a;\r\n };\r\n\r\n XNodeSet.prototype.toArrayRec = function (t, a) {\r\n if (t != null) {\r\n this.toArrayRec(t.left, a);\r\n a.push(t.node);\r\n this.toArrayRec(t.right, a);\r\n }\r\n };\r\n\r\n /**\r\n * Returns an array of the node set's contents in arbitrary order\r\n */\r\n XNodeSet.prototype.toUnsortedArray = function () {\r\n return this.nodes.slice();\r\n };\r\n\r\n XNodeSet.prototype.compareWithString = function (r, o) {\r\n var a = this.toUnsortedArray();\r\n for (var i = 0; i < a.length; i++) {\r\n var n = a[i];\r\n var l = new XString(this.stringForNode(n));\r\n var res = o(l, r);\r\n if (res.booleanValue()) {\r\n return res;\r\n }\r\n }\r\n return new XBoolean(false);\r\n };\r\n\r\n XNodeSet.prototype.compareWithNumber = function (r, o) {\r\n var a = this.toUnsortedArray();\r\n for (var i = 0; i < a.length; i++) {\r\n var n = a[i];\r\n var l = new XNumber(this.stringForNode(n));\r\n var res = o(l, r);\r\n if (res.booleanValue()) {\r\n return res;\r\n }\r\n }\r\n return new XBoolean(false);\r\n };\r\n\r\n XNodeSet.prototype.compareWithBoolean = function (r, o) {\r\n return o(this.bool(), r);\r\n };\r\n\r\n XNodeSet.prototype.compareWithNodeSet = function (r, o) {\r\n var arr = this.toUnsortedArray();\r\n var oInvert = function (lop, rop) { return o(rop, lop); };\r\n\r\n for (var i = 0; i < arr.length; i++) {\r\n var l = new XString(this.stringForNode(arr[i]));\r\n\r\n var res = r.compareWithString(l, oInvert);\r\n if (res.booleanValue()) {\r\n return res;\r\n }\r\n }\r\n\r\n return new XBoolean(false);\r\n };\r\n\r\n XNodeSet.compareWith = curry(function (o, r) {\r\n if (Utilities.instance_of(r, XString)) {\r\n return this.compareWithString(r, o);\r\n }\r\n if (Utilities.instance_of(r, XNumber)) {\r\n return this.compareWithNumber(r, o);\r\n }\r\n if (Utilities.instance_of(r, XBoolean)) {\r\n return this.compareWithBoolean(r, o);\r\n }\r\n return this.compareWithNodeSet(r, o);\r\n });\r\n\r\n XNodeSet.prototype.equals = XNodeSet.compareWith(Operators.equals);\r\n XNodeSet.prototype.notequal = XNodeSet.compareWith(Operators.notequal);\r\n XNodeSet.prototype.lessthan = XNodeSet.compareWith(Operators.lessthan);\r\n XNodeSet.prototype.greaterthan = XNodeSet.compareWith(Operators.greaterthan);\r\n XNodeSet.prototype.lessthanorequal = XNodeSet.compareWith(Operators.lessthanorequal);\r\n XNodeSet.prototype.greaterthanorequal = XNodeSet.compareWith(Operators.greaterthanorequal);\r\n\r\n XNodeSet.prototype.union = function (r) {\r\n var ns = new XNodeSet();\r\n ns.addArray(this.toUnsortedArray());\r\n ns.addArray(r.toUnsortedArray());\r\n return ns;\r\n };\r\n\r\n // XPathNamespace ////////////////////////////////////////////////////////////\r\n\r\n XPathNamespace.prototype = new Object();\r\n XPathNamespace.prototype.constructor = XPathNamespace;\r\n XPathNamespace.superclass = Object.prototype;\r\n\r\n function XPathNamespace(pre, node, uri, p) {\r\n this.isXPathNamespace = true;\r\n this.baseNode = node;\r\n this.ownerDocument = p.ownerDocument;\r\n this.nodeName = pre;\r\n this.prefix = pre;\r\n this.localName = pre;\r\n this.namespaceURI = null;\r\n this.nodeValue = uri;\r\n this.ownerElement = p;\r\n this.nodeType = NodeTypes.NAMESPACE_NODE;\r\n }\r\n\r\n XPathNamespace.prototype.toString = function () {\r\n return \"{ \\\"\" + this.prefix + \"\\\", \\\"\" + this.namespaceURI + \"\\\" }\";\r\n };\r\n\r\n // XPathContext //////////////////////////////////////////////////////////////\r\n\r\n XPathContext.prototype = new Object();\r\n XPathContext.prototype.constructor = XPathContext;\r\n XPathContext.superclass = Object.prototype;\r\n\r\n function XPathContext(vr, nr, fr) {\r\n this.variableResolver = vr != null ? vr : new VariableResolver();\r\n this.namespaceResolver = nr != null ? nr : new NamespaceResolver();\r\n this.functionResolver = fr != null ? fr : new FunctionResolver();\r\n }\r\n\r\n XPathContext.prototype.extend = function (newProps) {\r\n return assign(new XPathContext(), this, newProps);\r\n };\r\n\r\n // VariableResolver //////////////////////////////////////////////////////////\r\n\r\n VariableResolver.prototype = new Object();\r\n VariableResolver.prototype.constructor = VariableResolver;\r\n VariableResolver.superclass = Object.prototype;\r\n\r\n function VariableResolver() {\r\n }\r\n\r\n VariableResolver.prototype.getVariable = function (ln, ns) {\r\n return null;\r\n };\r\n\r\n // FunctionResolver //////////////////////////////////////////////////////////\r\n\r\n FunctionResolver.prototype = new Object();\r\n FunctionResolver.prototype.constructor = FunctionResolver;\r\n FunctionResolver.superclass = Object.prototype;\r\n\r\n function FunctionResolver(thisArg) {\r\n this.thisArg = thisArg != null ? thisArg : Functions;\r\n this.functions = new Object();\r\n this.addStandardFunctions();\r\n }\r\n\r\n FunctionResolver.prototype.addStandardFunctions = function () {\r\n this.functions[\"{}last\"] = Functions.last;\r\n this.functions[\"{}position\"] = Functions.position;\r\n this.functions[\"{}count\"] = Functions.count;\r\n this.functions[\"{}id\"] = Functions.id;\r\n this.functions[\"{}local-name\"] = Functions.localName;\r\n this.functions[\"{}namespace-uri\"] = Functions.namespaceURI;\r\n this.functions[\"{}name\"] = Functions.name;\r\n this.functions[\"{}string\"] = Functions.string;\r\n this.functions[\"{}concat\"] = Functions.concat;\r\n this.functions[\"{}starts-with\"] = Functions.startsWith;\r\n this.functions[\"{}contains\"] = Functions.contains;\r\n this.functions[\"{}substring-before\"] = Functions.substringBefore;\r\n this.functions[\"{}substring-after\"] = Functions.substringAfter;\r\n this.functions[\"{}substring\"] = Functions.substring;\r\n this.functions[\"{}string-length\"] = Functions.stringLength;\r\n this.functions[\"{}normalize-space\"] = Functions.normalizeSpace;\r\n this.functions[\"{}translate\"] = Functions.translate;\r\n this.functions[\"{}boolean\"] = Functions.boolean_;\r\n this.functions[\"{}not\"] = Functions.not;\r\n this.functions[\"{}true\"] = Functions.true_;\r\n this.functions[\"{}false\"] = Functions.false_;\r\n this.functions[\"{}lang\"] = Functions.lang;\r\n this.functions[\"{}number\"] = Functions.number;\r\n this.functions[\"{}sum\"] = Functions.sum;\r\n this.functions[\"{}floor\"] = Functions.floor;\r\n this.functions[\"{}ceiling\"] = Functions.ceiling;\r\n this.functions[\"{}round\"] = Functions.round;\r\n };\r\n\r\n FunctionResolver.prototype.addFunction = function (ns, ln, f) {\r\n this.functions[\"{\" + ns + \"}\" + ln] = f;\r\n };\r\n\r\n FunctionResolver.getFunctionFromContext = function (qName, context) {\r\n var parts = Utilities.resolveQName(qName, context.namespaceResolver, context.contextNode, false);\r\n\r\n if (parts[0] === null) {\r\n throw new Error(\"Cannot resolve QName \" + name);\r\n }\r\n\r\n return context.functionResolver.getFunction(parts[1], parts[0]);\r\n };\r\n\r\n FunctionResolver.prototype.getFunction = function (localName, namespace) {\r\n return this.functions[\"{\" + namespace + \"}\" + localName];\r\n };\r\n\r\n // NamespaceResolver /////////////////////////////////////////////////////////\r\n\r\n NamespaceResolver.prototype = new Object();\r\n NamespaceResolver.prototype.constructor = NamespaceResolver;\r\n NamespaceResolver.superclass = Object.prototype;\r\n\r\n function NamespaceResolver() {\r\n }\r\n\r\n NamespaceResolver.prototype.getNamespace = function (prefix, n) {\r\n if (prefix == \"xml\") {\r\n return XPath.XML_NAMESPACE_URI;\r\n } else if (prefix == \"xmlns\") {\r\n return XPath.XMLNS_NAMESPACE_URI;\r\n }\r\n if (n.nodeType == NodeTypes.DOCUMENT_NODE) {\r\n n = n.documentElement;\r\n } else if (n.nodeType == NodeTypes.ATTRIBUTE_NODE) {\r\n n = PathExpr.getOwnerElement(n);\r\n } else if (n.nodeType != NodeTypes.ELEMENT_NODE) {\r\n n = n.parentNode;\r\n }\r\n while (n != null && n.nodeType == NodeTypes.ELEMENT_NODE) {\r\n var nnm = n.attributes;\r\n for (var i = 0; i < nnm.length; i++) {\r\n var a = nnm.item(i);\r\n var aname = a.name || a.nodeName;\r\n if ((aname === \"xmlns\" && prefix === \"\")\r\n || aname === \"xmlns:\" + prefix) {\r\n return String(a.value || a.nodeValue);\r\n }\r\n }\r\n n = n.parentNode;\r\n }\r\n return null;\r\n };\r\n\r\n // Functions /////////////////////////////////////////////////////////////////\r\n\r\n var Functions = new Object();\r\n\r\n Functions.last = function (c) {\r\n if (arguments.length != 1) {\r\n throw new Error(\"Function last expects ()\");\r\n }\r\n\r\n return new XNumber(c.contextSize);\r\n };\r\n\r\n Functions.position = function (c) {\r\n if (arguments.length != 1) {\r\n throw new Error(\"Function position expects ()\");\r\n }\r\n\r\n return new XNumber(c.contextPosition);\r\n };\r\n\r\n Functions.count = function () {\r\n var c = arguments[0];\r\n var ns;\r\n if (arguments.length != 2 || !Utilities.instance_of(ns = arguments[1].evaluate(c), XNodeSet)) {\r\n throw new Error(\"Function count expects (node-set)\");\r\n }\r\n return new XNumber(ns.size);\r\n };\r\n\r\n Functions.id = function () {\r\n var c = arguments[0];\r\n var id;\r\n if (arguments.length != 2) {\r\n throw new Error(\"Function id expects (object)\");\r\n }\r\n id = arguments[1].evaluate(c);\r\n if (Utilities.instance_of(id, XNodeSet)) {\r\n id = id.toArray().join(\" \");\r\n } else {\r\n id = id.stringValue();\r\n }\r\n var ids = id.split(/[\\x0d\\x0a\\x09\\x20]+/);\r\n var count = 0;\r\n var ns = new XNodeSet();\r\n var doc = c.contextNode.nodeType == NodeTypes.DOCUMENT_NODE\r\n ? c.contextNode\r\n : c.contextNode.ownerDocument;\r\n for (var i = 0; i < ids.length; i++) {\r\n var n;\r\n if (doc.getElementById) {\r\n n = doc.getElementById(ids[i]);\r\n } else {\r\n n = Utilities.getElementById(doc, ids[i]);\r\n }\r\n if (n != null) {\r\n ns.add(n);\r\n count++;\r\n }\r\n }\r\n return ns;\r\n };\r\n\r\n Functions.localName = function (c, eNode) {\r\n var n;\r\n\r\n if (arguments.length == 1) {\r\n n = c.contextNode;\r\n } else if (arguments.length == 2) {\r\n n = eNode.evaluate(c).first();\r\n } else {\r\n throw new Error(\"Function local-name expects (node-set?)\");\r\n }\r\n\r\n if (n == null) {\r\n return new XString(\"\");\r\n }\r\n\r\n return new XString(\r\n n.localName || // standard elements and attributes\r\n n.baseName || // IE\r\n n.target || // processing instructions\r\n n.nodeName || // DOM1 elements\r\n \"\" // fallback\r\n );\r\n };\r\n\r\n Functions.namespaceURI = function () {\r\n var c = arguments[0];\r\n var n;\r\n\r\n if (arguments.length == 1) {\r\n n = c.contextNode;\r\n } else if (arguments.length == 2) {\r\n n = arguments[1].evaluate(c).first();\r\n } else {\r\n throw new Error(\"Function namespace-uri expects (node-set?)\");\r\n }\r\n\r\n if (n == null) {\r\n return new XString(\"\");\r\n }\r\n return new XString(n.namespaceURI || '');\r\n };\r\n\r\n Functions.name = function () {\r\n var c = arguments[0];\r\n var n;\r\n if (arguments.length == 1) {\r\n n = c.contextNode;\r\n } else if (arguments.length == 2) {\r\n n = arguments[1].evaluate(c).first();\r\n } else {\r\n throw new Error(\"Function name expects (node-set?)\");\r\n }\r\n if (n == null) {\r\n return new XString(\"\");\r\n }\r\n if (n.nodeType == NodeTypes.ELEMENT_NODE) {\r\n return new XString(n.nodeName);\r\n } else if (n.nodeType == NodeTypes.ATTRIBUTE_NODE) {\r\n return new XString(n.name || n.nodeName);\r\n } else if (n.nodeType === NodeTypes.PROCESSING_INSTRUCTION_NODE) {\r\n return new XString(n.target || n.nodeName);\r\n } else if (n.localName == null) {\r\n return new XString(\"\");\r\n } else {\r\n return new XString(n.localName);\r\n }\r\n };\r\n\r\n Functions.string = function () {\r\n var c = arguments[0];\r\n if (arguments.length == 1) {\r\n return new XString(XNodeSet.prototype.stringForNode(c.contextNode));\r\n } else if (arguments.length == 2) {\r\n return arguments[1].evaluate(c).string();\r\n }\r\n throw new Error(\"Function string expects (object?)\");\r\n };\r\n\r\n Functions.concat = function (c) {\r\n if (arguments.length < 3) {\r\n throw new Error(\"Function concat expects (string, string[, string]*)\");\r\n }\r\n var s = \"\";\r\n for (var i = 1; i < arguments.length; i++) {\r\n s += arguments[i].evaluate(c).stringValue();\r\n }\r\n return new XString(s);\r\n };\r\n\r\n Functions.startsWith = function () {\r\n var c = arguments[0];\r\n if (arguments.length != 3) {\r\n throw new Error(\"Function startsWith expects (string, string)\");\r\n }\r\n var s1 = arguments[1].evaluate(c).stringValue();\r\n var s2 = arguments[2].evaluate(c).stringValue();\r\n return new XBoolean(s1.substring(0, s2.length) == s2);\r\n };\r\n\r\n Functions.contains = function () {\r\n var c = arguments[0];\r\n if (arguments.length != 3) {\r\n throw new Error(\"Function contains expects (string, string)\");\r\n }\r\n var s1 = arguments[1].evaluate(c).stringValue();\r\n var s2 = arguments[2].evaluate(c).stringValue();\r\n return new XBoolean(s1.indexOf(s2) !== -1);\r\n };\r\n\r\n Functions.substringBefore = function () {\r\n var c = arguments[0];\r\n if (arguments.length != 3) {\r\n throw new Error(\"Function substring-before expects (string, string)\");\r\n }\r\n var s1 = arguments[1].evaluate(c).stringValue();\r\n var s2 = arguments[2].evaluate(c).stringValue();\r\n return new XString(s1.substring(0, s1.indexOf(s2)));\r\n };\r\n\r\n Functions.substringAfter = function () {\r\n var c = arguments[0];\r\n if (arguments.length != 3) {\r\n throw new Error(\"Function substring-after expects (string, string)\");\r\n }\r\n var s1 = arguments[1].evaluate(c).stringValue();\r\n var s2 = arguments[2].evaluate(c).stringValue();\r\n if (s2.length == 0) {\r\n return new XString(s1);\r\n }\r\n var i = s1.indexOf(s2);\r\n if (i == -1) {\r\n return new XString(\"\");\r\n }\r\n return new XString(s1.substring(i + s2.length));\r\n };\r\n\r\n Functions.substring = function () {\r\n var c = arguments[0];\r\n if (!(arguments.length == 3 || arguments.length == 4)) {\r\n throw new Error(\"Function substring expects (string, number, number?)\");\r\n }\r\n var s = arguments[1].evaluate(c).stringValue();\r\n var n1 = Math.round(arguments[2].evaluate(c).numberValue()) - 1;\r\n var n2 = arguments.length == 4 ? n1 + Math.round(arguments[3].evaluate(c).numberValue()) : undefined;\r\n return new XString(s.substring(n1, n2));\r\n };\r\n\r\n Functions.stringLength = function () {\r\n var c = arguments[0];\r\n var s;\r\n if (arguments.length == 1) {\r\n s = XNodeSet.prototype.stringForNode(c.contextNode);\r\n } else if (arguments.length == 2) {\r\n s = arguments[1].evaluate(c).stringValue();\r\n } else {\r\n throw new Error(\"Function string-length expects (string?)\");\r\n }\r\n return new XNumber(s.length);\r\n };\r\n\r\n Functions.normalizeSpace = function () {\r\n var c = arguments[0];\r\n var s;\r\n if (arguments.length == 1) {\r\n s = XNodeSet.prototype.stringForNode(c.contextNode);\r\n } else if (arguments.length == 2) {\r\n s = arguments[1].evaluate(c).stringValue();\r\n } else {\r\n throw new Error(\"Function normalize-space expects (string?)\");\r\n }\r\n var i = 0;\r\n var j = s.length - 1;\r\n while (Utilities.isSpace(s.charCodeAt(j))) {\r\n j--;\r\n }\r\n var t = \"\";\r\n while (i <= j && Utilities.isSpace(s.charCodeAt(i))) {\r\n i++;\r\n }\r\n while (i <= j) {\r\n if (Utilities.isSpace(s.charCodeAt(i))) {\r\n t += \" \";\r\n while (i <= j && Utilities.isSpace(s.charCodeAt(i))) {\r\n i++;\r\n }\r\n } else {\r\n t += s.charAt(i);\r\n i++;\r\n }\r\n }\r\n return new XString(t);\r\n };\r\n\r\n Functions.translate = function (c, eValue, eFrom, eTo) {\r\n if (arguments.length != 4) {\r\n throw new Error(\"Function translate expects (string, string, string)\");\r\n }\r\n\r\n var value = eValue.evaluate(c).stringValue();\r\n var from = eFrom.evaluate(c).stringValue();\r\n var to = eTo.evaluate(c).stringValue();\r\n\r\n var cMap = reduce(function (acc, ch, i) {\r\n if (!(ch in acc)) {\r\n acc[ch] = i > to.length ? '' : to[i];\r\n }\r\n return acc;\r\n }, {}, from);\r\n\r\n var t = join(\r\n '',\r\n map(function (ch) {\r\n return ch in cMap ? cMap[ch] : ch;\r\n }, value)\r\n );\r\n\r\n return new XString(t);\r\n };\r\n\r\n Functions.boolean_ = function () {\r\n var c = arguments[0];\r\n if (arguments.length != 2) {\r\n throw new Error(\"Function boolean expects (object)\");\r\n }\r\n return arguments[1].evaluate(c).bool();\r\n };\r\n\r\n Functions.not = function (c, eValue) {\r\n if (arguments.length != 2) {\r\n throw new Error(\"Function not expects (object)\");\r\n }\r\n return eValue.evaluate(c).bool().not();\r\n };\r\n\r\n Functions.true_ = function () {\r\n if (arguments.length != 1) {\r\n throw new Error(\"Function true expects ()\");\r\n }\r\n return XBoolean.true_;\r\n };\r\n\r\n Functions.false_ = function () {\r\n if (arguments.length != 1) {\r\n throw new Error(\"Function false expects ()\");\r\n }\r\n return XBoolean.false_;\r\n };\r\n\r\n Functions.lang = function () {\r\n var c = arguments[0];\r\n if (arguments.length != 2) {\r\n throw new Error(\"Function lang expects (string)\");\r\n }\r\n var lang;\r\n for (var n = c.contextNode; n != null && n.nodeType != NodeTypes.DOCUMENT_NODE; n = n.parentNode) {\r\n var a = n.getAttributeNS(XPath.XML_NAMESPACE_URI, \"lang\");\r\n if (a != null) {\r\n lang = String(a);\r\n break;\r\n }\r\n }\r\n if (lang == null) {\r\n return XBoolean.false_;\r\n }\r\n var s = arguments[1].evaluate(c).stringValue();\r\n return new XBoolean(lang.substring(0, s.length) == s\r\n && (lang.length == s.length || lang.charAt(s.length) == '-'));\r\n };\r\n\r\n Functions.number = function () {\r\n var c = arguments[0];\r\n if (!(arguments.length == 1 || arguments.length == 2)) {\r\n throw new Error(\"Function number expects (object?)\");\r\n }\r\n if (arguments.length == 1) {\r\n return new XNumber(XNodeSet.prototype.stringForNode(c.contextNode));\r\n }\r\n return arguments[1].evaluate(c).number();\r\n };\r\n\r\n Functions.sum = function () {\r\n var c = arguments[0];\r\n var ns;\r\n if (arguments.length != 2 || !Utilities.instance_of((ns = arguments[1].evaluate(c)), XNodeSet)) {\r\n throw new Error(\"Function sum expects (node-set)\");\r\n }\r\n ns = ns.toUnsortedArray();\r\n var n = 0;\r\n for (var i = 0; i < ns.length; i++) {\r\n n += new XNumber(XNodeSet.prototype.stringForNode(ns[i])).numberValue();\r\n }\r\n return new XNumber(n);\r\n };\r\n\r\n Functions.floor = function () {\r\n var c = arguments[0];\r\n if (arguments.length != 2) {\r\n throw new Error(\"Function floor expects (number)\");\r\n }\r\n return new XNumber(Math.floor(arguments[1].evaluate(c).numberValue()));\r\n };\r\n\r\n Functions.ceiling = function () {\r\n var c = arguments[0];\r\n if (arguments.length != 2) {\r\n throw new Error(\"Function ceiling expects (number)\");\r\n }\r\n return new XNumber(Math.ceil(arguments[1].evaluate(c).numberValue()));\r\n };\r\n\r\n Functions.round = function () {\r\n var c = arguments[0];\r\n if (arguments.length != 2) {\r\n throw new Error(\"Function round expects (number)\");\r\n }\r\n return new XNumber(Math.round(arguments[1].evaluate(c).numberValue()));\r\n };\r\n\r\n // Utilities /////////////////////////////////////////////////////////////////\r\n\r\n var Utilities = new Object();\r\n\r\n // Returns true if the node is an attribute node or namespace node\r\n var isAttributeLike = function (val) {\r\n return val && (\r\n val.nodeType === NodeTypes.ATTRIBUTE_NODE ||\r\n val.ownerElement ||\r\n val.isXPathNamespace\r\n );\r\n }\r\n\r\n Utilities.splitQName = function (qn) {\r\n var i = qn.indexOf(\":\");\r\n if (i == -1) {\r\n return [null, qn];\r\n }\r\n return [qn.substring(0, i), qn.substring(i + 1)];\r\n };\r\n\r\n Utilities.resolveQName = function (qn, nr, n, useDefault) {\r\n var parts = Utilities.splitQName(qn);\r\n if (parts[0] != null) {\r\n parts[0] = nr.getNamespace(parts[0], n);\r\n } else {\r\n if (useDefault) {\r\n parts[0] = nr.getNamespace(\"\", n);\r\n if (parts[0] == null) {\r\n parts[0] = \"\";\r\n }\r\n } else {\r\n parts[0] = \"\";\r\n }\r\n }\r\n return parts;\r\n };\r\n\r\n Utilities.isSpace = function (c) {\r\n return c == 0x9 || c == 0xd || c == 0xa || c == 0x20;\r\n };\r\n\r\n Utilities.isLetter = function (c) {\r\n return c >= 0x0041 && c <= 0x005A ||\r\n c >= 0x0061 && c <= 0x007A ||\r\n c >= 0x00C0 && c <= 0x00D6 ||\r\n c >= 0x00D8 && c <= 0x00F6 ||\r\n c >= 0x00F8 && c <= 0x00FF ||\r\n c >= 0x0100 && c <= 0x0131 ||\r\n c >= 0x0134 && c <= 0x013E ||\r\n c >= 0x0141 && c <= 0x0148 ||\r\n c >= 0x014A && c <= 0x017E ||\r\n c >= 0x0180 && c <= 0x01C3 ||\r\n c >= 0x01CD && c <= 0x01F0 ||\r\n c >= 0x01F4 && c <= 0x01F5 ||\r\n c >= 0x01FA && c <= 0x0217 ||\r\n c >= 0x0250 && c <= 0x02A8 ||\r\n c >= 0x02BB && c <= 0x02C1 ||\r\n c == 0x0386 ||\r\n c >= 0x0388 && c <= 0x038A ||\r\n c == 0x038C ||\r\n c >= 0x038E && c <= 0x03A1 ||\r\n c >= 0x03A3 && c <= 0x03CE ||\r\n c >= 0x03D0 && c <= 0x03D6 ||\r\n c == 0x03DA ||\r\n c == 0x03DC ||\r\n c == 0x03DE ||\r\n c == 0x03E0 ||\r\n c >= 0x03E2 && c <= 0x03F3 ||\r\n c >= 0x0401 && c <= 0x040C ||\r\n c >= 0x040E && c <= 0x044F ||\r\n c >= 0x0451 && c <= 0x045C ||\r\n c >= 0x045E && c <= 0x0481 ||\r\n c >= 0x0490 && c <= 0x04C4 ||\r\n c >= 0x04C7 && c <= 0x04C8 ||\r\n c >= 0x04CB && c <= 0x04CC ||\r\n c >= 0x04D0 && c <= 0x04EB ||\r\n c >= 0x04EE && c <= 0x04F5 ||\r\n c >= 0x04F8 && c <= 0x04F9 ||\r\n c >= 0x0531 && c <= 0x0556 ||\r\n c == 0x0559 ||\r\n c >= 0x0561 && c <= 0x0586 ||\r\n c >= 0x05D0 && c <= 0x05EA ||\r\n c >= 0x05F0 && c <= 0x05F2 ||\r\n c >= 0x0621 && c <= 0x063A ||\r\n c >= 0x0641 && c <= 0x064A ||\r\n c >= 0x0671 && c <= 0x06B7 ||\r\n c >= 0x06BA && c <= 0x06BE ||\r\n c >= 0x06C0 && c <= 0x06CE ||\r\n c >= 0x06D0 && c <= 0x06D3 ||\r\n c == 0x06D5 ||\r\n c >= 0x06E5 && c <= 0x06E6 ||\r\n c >= 0x0905 && c <= 0x0939 ||\r\n c == 0x093D ||\r\n c >= 0x0958 && c <= 0x0961 ||\r\n c >= 0x0985 && c <= 0x098C ||\r\n c >= 0x098F && c <= 0x0990 ||\r\n c >= 0x0993 && c <= 0x09A8 ||\r\n c >= 0x09AA && c <= 0x09B0 ||\r\n c == 0x09B2 ||\r\n c >= 0x09B6 && c <= 0x09B9 ||\r\n c >= 0x09DC && c <= 0x09DD ||\r\n c >= 0x09DF && c <= 0x09E1 ||\r\n c >= 0x09F0 && c <= 0x09F1 ||\r\n c >= 0x0A05 && c <= 0x0A0A ||\r\n c >= 0x0A0F && c <= 0x0A10 ||\r\n c >= 0x0A13 && c <= 0x0A28 ||\r\n c >= 0x0A2A && c <= 0x0A30 ||\r\n c >= 0x0A32 && c <= 0x0A33 ||\r\n c >= 0x0A35 && c <= 0x0A36 ||\r\n c >= 0x0A38 && c <= 0x0A39 ||\r\n c >= 0x0A59 && c <= 0x0A5C ||\r\n c == 0x0A5E ||\r\n c >= 0x0A72 && c <= 0x0A74 ||\r\n c >= 0x0A85 && c <= 0x0A8B ||\r\n c == 0x0A8D ||\r\n c >= 0x0A8F && c <= 0x0A91 ||\r\n c >= 0x0A93 && c <= 0x0AA8 ||\r\n c >= 0x0AAA && c <= 0x0AB0 ||\r\n c >= 0x0AB2 && c <= 0x0AB3 ||\r\n c >= 0x0AB5 && c <= 0x0AB9 ||\r\n c == 0x0ABD ||\r\n c == 0x0AE0 ||\r\n c >= 0x0B05 && c <= 0x0B0C ||\r\n c >= 0x0B0F && c <= 0x0B10 ||\r\n c >= 0x0B13 && c <= 0x0B28 ||\r\n c >= 0x0B2A && c <= 0x0B30 ||\r\n c >= 0x0B32 && c <= 0x0B33 ||\r\n c >= 0x0B36 && c <= 0x0B39 ||\r\n c == 0x0B3D ||\r\n c >= 0x0B5C && c <= 0x0B5D ||\r\n c >= 0x0B5F && c <= 0x0B61 ||\r\n c >= 0x0B85 && c <= 0x0B8A ||\r\n c >= 0x0B8E && c <= 0x0B90 ||\r\n c >= 0x0B92 && c <= 0x0B95 ||\r\n c >= 0x0B99 && c <= 0x0B9A ||\r\n c == 0x0B9C ||\r\n c >= 0x0B9E && c <= 0x0B9F ||\r\n c >= 0x0BA3 && c <= 0x0BA4 ||\r\n c >= 0x0BA8 && c <= 0x0BAA ||\r\n c >= 0x0BAE && c <= 0x0BB5 ||\r\n c >= 0x0BB7 && c <= 0x0BB9 ||\r\n c >= 0x0C05 && c <= 0x0C0C ||\r\n c >= 0x0C0E && c <= 0x0C10 ||\r\n c >= 0x0C12 && c <= 0x0C28 ||\r\n c >= 0x0C2A && c <= 0x0C33 ||\r\n c >= 0x0C35 && c <= 0x0C39 ||\r\n c >= 0x0C60 && c <= 0x0C61 ||\r\n c >= 0x0C85 && c <= 0x0C8C ||\r\n c >= 0x0C8E && c <= 0x0C90 ||\r\n c >= 0x0C92 && c <= 0x0CA8 ||\r\n c >= 0x0CAA && c <= 0x0CB3 ||\r\n c >= 0x0CB5 && c <= 0x0CB9 ||\r\n c == 0x0CDE ||\r\n c >= 0x0CE0 && c <= 0x0CE1 ||\r\n c >= 0x0D05 && c <= 0x0D0C ||\r\n c >= 0x0D0E && c <= 0x0D10 ||\r\n c >= 0x0D12 && c <= 0x0D28 ||\r\n c >= 0x0D2A && c <= 0x0D39 ||\r\n c >= 0x0D60 && c <= 0x0D61 ||\r\n c >= 0x0E01 && c <= 0x0E2E ||\r\n c == 0x0E30 ||\r\n c >= 0x0E32 && c <= 0x0E33 ||\r\n c >= 0x0E40 && c <= 0x0E45 ||\r\n c >= 0x0E81 && c <= 0x0E82 ||\r\n c == 0x0E84 ||\r\n c >= 0x0E87 && c <= 0x0E88 ||\r\n c == 0x0E8A ||\r\n c == 0x0E8D ||\r\n c >= 0x0E94 && c <= 0x0E97 ||\r\n c >= 0x0E99 && c <= 0x0E9F ||\r\n c >= 0x0EA1 && c <= 0x0EA3 ||\r\n c == 0x0EA5 ||\r\n c == 0x0EA7 ||\r\n c >= 0x0EAA && c <= 0x0EAB ||\r\n c >= 0x0EAD && c <= 0x0EAE ||\r\n c == 0x0EB0 ||\r\n c >= 0x0EB2 && c <= 0x0EB3 ||\r\n c == 0x0EBD ||\r\n c >= 0x0EC0 && c <= 0x0EC4 ||\r\n c >= 0x0F40 && c <= 0x0F47 ||\r\n c >= 0x0F49 && c <= 0x0F69 ||\r\n c >= 0x10A0 && c <= 0x10C5 ||\r\n c >= 0x10D0 && c <= 0x10F6 ||\r\n c == 0x1100 ||\r\n c >= 0x1102 && c <= 0x1103 ||\r\n c >= 0x1105 && c <= 0x1107 ||\r\n c == 0x1109 ||\r\n c >= 0x110B && c <= 0x110C ||\r\n c >= 0x110E && c <= 0x1112 ||\r\n c == 0x113C ||\r\n c == 0x113E ||\r\n c == 0x1140 ||\r\n c == 0x114C ||\r\n c == 0x114E ||\r\n c == 0x1150 ||\r\n c >= 0x1154 && c <= 0x1155 ||\r\n c == 0x1159 ||\r\n c >= 0x115F && c <= 0x1161 ||\r\n c == 0x1163 ||\r\n c == 0x1165 ||\r\n c == 0x1167 ||\r\n c == 0x1169 ||\r\n c >= 0x116D && c <= 0x116E ||\r\n c >= 0x1172 && c <= 0x1173 ||\r\n c == 0x1175 ||\r\n c == 0x119E ||\r\n c == 0x11A8 ||\r\n c == 0x11AB ||\r\n c >= 0x11AE && c <= 0x11AF ||\r\n c >= 0x11B7 && c <= 0x11B8 ||\r\n c == 0x11BA ||\r\n c >= 0x11BC && c <= 0x11C2 ||\r\n c == 0x11EB ||\r\n c == 0x11F0 ||\r\n c == 0x11F9 ||\r\n c >= 0x1E00 && c <= 0x1E9B ||\r\n c >= 0x1EA0 && c <= 0x1EF9 ||\r\n c >= 0x1F00 && c <= 0x1F15 ||\r\n c >= 0x1F18 && c <= 0x1F1D ||\r\n c >= 0x1F20 && c <= 0x1F45 ||\r\n c >= 0x1F48 && c <= 0x1F4D ||\r\n c >= 0x1F50 && c <= 0x1F57 ||\r\n c == 0x1F59 ||\r\n c == 0x1F5B ||\r\n c == 0x1F5D ||\r\n c >= 0x1F5F && c <= 0x1F7D ||\r\n c >= 0x1F80 && c <= 0x1FB4 ||\r\n c >= 0x1FB6 && c <= 0x1FBC ||\r\n c == 0x1FBE ||\r\n c >= 0x1FC2 && c <= 0x1FC4 ||\r\n c >= 0x1FC6 && c <= 0x1FCC ||\r\n c >= 0x1FD0 && c <= 0x1FD3 ||\r\n c >= 0x1FD6 && c <= 0x1FDB ||\r\n c >= 0x1FE0 && c <= 0x1FEC ||\r\n c >= 0x1FF2 && c <= 0x1FF4 ||\r\n c >= 0x1FF6 && c <= 0x1FFC ||\r\n c == 0x2126 ||\r\n c >= 0x212A && c <= 0x212B ||\r\n c == 0x212E ||\r\n c >= 0x2180 && c <= 0x2182 ||\r\n c >= 0x3041 && c <= 0x3094 ||\r\n c >= 0x30A1 && c <= 0x30FA ||\r\n c >= 0x3105 && c <= 0x312C ||\r\n c >= 0xAC00 && c <= 0xD7A3 ||\r\n c >= 0x4E00 && c <= 0x9FA5 ||\r\n c == 0x3007 ||\r\n c >= 0x3021 && c <= 0x3029;\r\n };\r\n\r\n Utilities.isNCNameChar = function (c) {\r\n return c >= 0x0030 && c <= 0x0039\r\n || c >= 0x0660 && c <= 0x0669\r\n || c >= 0x06F0 && c <= 0x06F9\r\n || c >= 0x0966 && c <= 0x096F\r\n || c >= 0x09E6 && c <= 0x09EF\r\n || c >= 0x0A66 && c <= 0x0A6F\r\n || c >= 0x0AE6 && c <= 0x0AEF\r\n || c >= 0x0B66 && c <= 0x0B6F\r\n || c >= 0x0BE7 && c <= 0x0BEF\r\n || c >= 0x0C66 && c <= 0x0C6F\r\n || c >= 0x0CE6 && c <= 0x0CEF\r\n || c >= 0x0D66 && c <= 0x0D6F\r\n || c >= 0x0E50 && c <= 0x0E59\r\n || c >= 0x0ED0 && c <= 0x0ED9\r\n || c >= 0x0F20 && c <= 0x0F29\r\n || c == 0x002E\r\n || c == 0x002D\r\n || c == 0x005F\r\n || Utilities.isLetter(c)\r\n || c >= 0x0300 && c <= 0x0345\r\n || c >= 0x0360 && c <= 0x0361\r\n || c >= 0x0483 && c <= 0x0486\r\n || c >= 0x0591 && c <= 0x05A1\r\n || c >= 0x05A3 && c <= 0x05B9\r\n || c >= 0x05BB && c <= 0x05BD\r\n || c == 0x05BF\r\n || c >= 0x05C1 && c <= 0x05C2\r\n || c == 0x05C4\r\n || c >= 0x064B && c <= 0x0652\r\n || c == 0x0670\r\n || c >= 0x06D6 && c <= 0x06DC\r\n || c >= 0x06DD && c <= 0x06DF\r\n || c >= 0x06E0 && c <= 0x06E4\r\n || c >= 0x06E7 && c <= 0x06E8\r\n || c >= 0x06EA && c <= 0x06ED\r\n || c >= 0x0901 && c <= 0x0903\r\n || c == 0x093C\r\n || c >= 0x093E && c <= 0x094C\r\n || c == 0x094D\r\n || c >= 0x0951 && c <= 0x0954\r\n || c >= 0x0962 && c <= 0x0963\r\n || c >= 0x0981 && c <= 0x0983\r\n || c == 0x09BC\r\n || c == 0x09BE\r\n || c == 0x09BF\r\n || c >= 0x09C0 && c <= 0x09C4\r\n || c >= 0x09C7 && c <= 0x09C8\r\n || c >= 0x09CB && c <= 0x09CD\r\n || c == 0x09D7\r\n || c >= 0x09E2 && c <= 0x09E3\r\n || c == 0x0A02\r\n || c == 0x0A3C\r\n || c == 0x0A3E\r\n || c == 0x0A3F\r\n || c >= 0x0A40 && c <= 0x0A42\r\n || c >= 0x0A47 && c <= 0x0A48\r\n || c >= 0x0A4B && c <= 0x0A4D\r\n || c >= 0x0A70 && c <= 0x0A71\r\n || c >= 0x0A81 && c <= 0x0A83\r\n || c == 0x0ABC\r\n || c >= 0x0ABE && c <= 0x0AC5\r\n || c >= 0x0AC7 && c <= 0x0AC9\r\n || c >= 0x0ACB && c <= 0x0ACD\r\n || c >= 0x0B01 && c <= 0x0B03\r\n || c == 0x0B3C\r\n || c >= 0x0B3E && c <= 0x0B43\r\n || c >= 0x0B47 && c <= 0x0B48\r\n || c >= 0x0B4B && c <= 0x0B4D\r\n || c >= 0x0B56 && c <= 0x0B57\r\n || c >= 0x0B82 && c <= 0x0B83\r\n || c >= 0x0BBE && c <= 0x0BC2\r\n || c >= 0x0BC6 && c <= 0x0BC8\r\n || c >= 0x0BCA && c <= 0x0BCD\r\n || c == 0x0BD7\r\n || c >= 0x0C01 && c <= 0x0C03\r\n || c >= 0x0C3E && c <= 0x0C44\r\n || c >= 0x0C46 && c <= 0x0C48\r\n || c >= 0x0C4A && c <= 0x0C4D\r\n || c >= 0x0C55 && c <= 0x0C56\r\n || c >= 0x0C82 && c <= 0x0C83\r\n || c >= 0x0CBE && c <= 0x0CC4\r\n || c >= 0x0CC6 && c <= 0x0CC8\r\n || c >= 0x0CCA && c <= 0x0CCD\r\n || c >= 0x0CD5 && c <= 0x0CD6\r\n || c >= 0x0D02 && c <= 0x0D03\r\n || c >= 0x0D3E && c <= 0x0D43\r\n || c >= 0x0D46 && c <= 0x0D48\r\n || c >= 0x0D4A && c <= 0x0D4D\r\n || c == 0x0D57\r\n || c == 0x0E31\r\n || c >= 0x0E34 && c <= 0x0E3A\r\n || c >= 0x0E47 && c <= 0x0E4E\r\n || c == 0x0EB1\r\n || c >= 0x0EB4 && c <= 0x0EB9\r\n || c >= 0x0EBB && c <= 0x0EBC\r\n || c >= 0x0EC8 && c <= 0x0ECD\r\n || c >= 0x0F18 && c <= 0x0F19\r\n || c == 0x0F35\r\n || c == 0x0F37\r\n || c == 0x0F39\r\n || c == 0x0F3E\r\n || c == 0x0F3F\r\n || c >= 0x0F71 && c <= 0x0F84\r\n || c >= 0x0F86 && c <= 0x0F8B\r\n || c >= 0x0F90 && c <= 0x0F95\r\n || c == 0x0F97\r\n || c >= 0x0F99 && c <= 0x0FAD\r\n || c >= 0x0FB1 && c <= 0x0FB7\r\n || c == 0x0FB9\r\n || c >= 0x20D0 && c <= 0x20DC\r\n || c == 0x20E1\r\n || c >= 0x302A && c <= 0x302F\r\n || c == 0x3099\r\n || c == 0x309A\r\n || c == 0x00B7\r\n || c == 0x02D0\r\n || c == 0x02D1\r\n || c == 0x0387\r\n || c == 0x0640\r\n || c == 0x0E46\r\n || c == 0x0EC6\r\n || c == 0x3005\r\n || c >= 0x3031 && c <= 0x3035\r\n || c >= 0x309D && c <= 0x309E\r\n || c >= 0x30FC && c <= 0x30FE;\r\n };\r\n\r\n Utilities.coalesceText = function (n) {\r\n for (var m = n.firstChild; m != null; m = m.nextSibling) {\r\n if (m.nodeType == NodeTypes.TEXT_NODE || m.nodeType == NodeTypes.CDATA_SECTION_NODE) {\r\n var s = m.nodeValue;\r\n var first = m;\r\n m = m.nextSibling;\r\n while (m != null && (m.nodeType == NodeTypes.TEXT_NODE || m.nodeType == NodeTypes.CDATA_SECTION_NODE)) {\r\n s += m.nodeValue;\r\n var del = m;\r\n m = m.nextSibling;\r\n del.parentNode.removeChild(del);\r\n }\r\n if (first.nodeType == NodeTypes.CDATA_SECTION_NODE) {\r\n var p = first.parentNode;\r\n if (first.nextSibling == null) {\r\n p.removeChild(first);\r\n p.appendChild(p.ownerDocument.createTextNode(s));\r\n } else {\r\n var next = first.nextSibling;\r\n p.removeChild(first);\r\n p.insertBefore(p.ownerDocument.createTextNode(s), next);\r\n }\r\n } else {\r\n first.nodeValue = s;\r\n }\r\n if (m == null) {\r\n break;\r\n }\r\n } else if (m.nodeType == NodeTypes.ELEMENT_NODE) {\r\n Utilities.coalesceText(m);\r\n }\r\n }\r\n };\r\n\r\n Utilities.instance_of = function (o, c) {\r\n while (o != null) {\r\n if (o.constructor === c) {\r\n return true;\r\n }\r\n if (o === Object) {\r\n return false;\r\n }\r\n o = o.constructor.superclass;\r\n }\r\n return false;\r\n };\r\n\r\n Utilities.getElementById = function (n, id) {\r\n // Note that this does not check the DTD to check for actual\r\n // attributes of type ID, so this may be a bit wrong.\r\n if (n.nodeType == NodeTypes.ELEMENT_NODE) {\r\n if (n.getAttribute(\"id\") == id\r\n || n.getAttributeNS(null, \"id\") == id) {\r\n return n;\r\n }\r\n }\r\n for (var m = n.firstChild; m != null; m = m.nextSibling) {\r\n var res = Utilities.getElementById(m, id);\r\n if (res != null) {\r\n return res;\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n // XPathException ////////////////////////////////////////////////////////////\r\n\r\n var XPathException = (function () {\r\n function getMessage(code, exception) {\r\n var msg = exception ? \": \" + exception.toString() : \"\";\r\n switch (code) {\r\n case XPathException.INVALID_EXPRESSION_ERR:\r\n return \"Invalid expression\" + msg;\r\n case XPathException.TYPE_ERR:\r\n return \"Type error\" + msg;\r\n }\r\n return null;\r\n }\r\n\r\n function XPathException(code, error, message) {\r\n var err = Error.call(this, getMessage(code, error) || message);\r\n\r\n err.code = code;\r\n err.exception = error;\r\n\r\n return err;\r\n }\r\n\r\n XPathException.prototype = Object.create(Error.prototype);\r\n XPathException.prototype.constructor = XPathException;\r\n XPathException.superclass = Error;\r\n\r\n XPathException.prototype.toString = function () {\r\n return this.message;\r\n };\r\n\r\n XPathException.fromMessage = function (message, error) {\r\n return new XPathException(null, error, message);\r\n };\r\n\r\n XPathException.INVALID_EXPRESSION_ERR = 51;\r\n XPathException.TYPE_ERR = 52;\r\n\r\n return XPathException;\r\n })();\r\n\r\n // XPathExpression ///////////////////////////////////////////////////////////\r\n\r\n XPathExpression.prototype = {};\r\n XPathExpression.prototype.constructor = XPathExpression;\r\n XPathExpression.superclass = Object.prototype;\r\n\r\n function XPathExpression(e, r, p) {\r\n this.xpath = p.parse(e);\r\n this.context = new XPathContext();\r\n this.context.namespaceResolver = new XPathNSResolverWrapper(r);\r\n }\r\n\r\n XPathExpression.getOwnerDocument = function (n) {\r\n return n.nodeType === NodeTypes.DOCUMENT_NODE ? n : n.ownerDocument;\r\n }\r\n\r\n XPathExpression.detectHtmlDom = function (n) {\r\n if (!n) { return false; }\r\n\r\n var doc = XPathExpression.getOwnerDocument(n);\r\n\r\n try {\r\n return doc.implementation.hasFeature(\"HTML\", \"2.0\");\r\n } catch (e) {\r\n return true;\r\n }\r\n }\r\n\r\n XPathExpression.prototype.evaluate = function (n, t, res) {\r\n this.context.expressionContextNode = n;\r\n // backward compatibility - no reliable way to detect whether the DOM is HTML, but\r\n // this library has been using this method up until now, so we will continue to use it\r\n // ONLY when using an XPathExpression\r\n this.context.caseInsensitive = XPathExpression.detectHtmlDom(n);\r\n\r\n var result = this.xpath.evaluate(this.context);\r\n\r\n return new XPathResult(result, t);\r\n }\r\n\r\n // XPathNSResolverWrapper ////////////////////////////////////////////////////\r\n\r\n XPathNSResolverWrapper.prototype = {};\r\n XPathNSResolverWrapper.prototype.constructor = XPathNSResolverWrapper;\r\n XPathNSResolverWrapper.superclass = Object.prototype;\r\n\r\n function XPathNSResolverWrapper(r) {\r\n this.xpathNSResolver = r;\r\n }\r\n\r\n XPathNSResolverWrapper.prototype.getNamespace = function (prefix, n) {\r\n if (this.xpathNSResolver == null) {\r\n return null;\r\n }\r\n return this.xpathNSResolver.lookupNamespaceURI(prefix);\r\n };\r\n\r\n // NodeXPathNSResolver ///////////////////////////////////////////////////////\r\n\r\n NodeXPathNSResolver.prototype = {};\r\n NodeXPathNSResolver.prototype.constructor = NodeXPathNSResolver;\r\n NodeXPathNSResolver.superclass = Object.prototype;\r\n\r\n function NodeXPathNSResolver(n) {\r\n this.node = n;\r\n this.namespaceResolver = new NamespaceResolver();\r\n }\r\n\r\n NodeXPathNSResolver.prototype.lookupNamespaceURI = function (prefix) {\r\n return this.namespaceResolver.getNamespace(prefix, this.node);\r\n };\r\n\r\n // XPathResult ///////////////////////////////////////////////////////////////\r\n\r\n XPathResult.prototype = {};\r\n XPathResult.prototype.constructor = XPathResult;\r\n XPathResult.superclass = Object.prototype;\r\n\r\n function XPathResult(v, t) {\r\n if (t == XPathResult.ANY_TYPE) {\r\n if (v.constructor === XString) {\r\n t = XPathResult.STRING_TYPE;\r\n } else if (v.constructor === XNumber) {\r\n t = XPathResult.NUMBER_TYPE;\r\n } else if (v.constructor === XBoolean) {\r\n t = XPathResult.BOOLEAN_TYPE;\r\n } else if (v.constructor === XNodeSet) {\r\n t = XPathResult.UNORDERED_NODE_ITERATOR_TYPE;\r\n }\r\n }\r\n this.resultType = t;\r\n switch (t) {\r\n case XPathResult.NUMBER_TYPE:\r\n this.numberValue = v.numberValue();\r\n return;\r\n case XPathResult.STRING_TYPE:\r\n this.stringValue = v.stringValue();\r\n return;\r\n case XPathResult.BOOLEAN_TYPE:\r\n this.booleanValue = v.booleanValue();\r\n return;\r\n case XPathResult.ANY_UNORDERED_NODE_TYPE:\r\n case XPathResult.FIRST_ORDERED_NODE_TYPE:\r\n if (v.constructor === XNodeSet) {\r\n this.singleNodeValue = v.first();\r\n return;\r\n }\r\n break;\r\n case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:\r\n case XPathResult.ORDERED_NODE_ITERATOR_TYPE:\r\n if (v.constructor === XNodeSet) {\r\n this.invalidIteratorState = false;\r\n this.nodes = v.toArray();\r\n this.iteratorIndex = 0;\r\n return;\r\n }\r\n break;\r\n case XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:\r\n case XPathResult.ORDERED_NODE_SNAPSHOT_TYPE:\r\n if (v.constructor === XNodeSet) {\r\n this.nodes = v.toArray();\r\n this.snapshotLength = this.nodes.length;\r\n return;\r\n }\r\n break;\r\n }\r\n throw new XPathException(XPathException.TYPE_ERR);\r\n };\r\n\r\n XPathResult.prototype.iterateNext = function () {\r\n if (this.resultType != XPathResult.UNORDERED_NODE_ITERATOR_TYPE\r\n && this.resultType != XPathResult.ORDERED_NODE_ITERATOR_TYPE) {\r\n throw new XPathException(XPathException.TYPE_ERR);\r\n }\r\n return this.nodes[this.iteratorIndex++];\r\n };\r\n\r\n XPathResult.prototype.snapshotItem = function (i) {\r\n if (this.resultType != XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE\r\n && this.resultType != XPathResult.ORDERED_NODE_SNAPSHOT_TYPE) {\r\n throw new XPathException(XPathException.TYPE_ERR);\r\n }\r\n return this.nodes[i];\r\n };\r\n\r\n XPathResult.ANY_TYPE = 0;\r\n XPathResult.NUMBER_TYPE = 1;\r\n XPathResult.STRING_TYPE = 2;\r\n XPathResult.BOOLEAN_TYPE = 3;\r\n XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4;\r\n XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5;\r\n XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6;\r\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7;\r\n XPathResult.ANY_UNORDERED_NODE_TYPE = 8;\r\n XPathResult.FIRST_ORDERED_NODE_TYPE = 9;\r\n\r\n // DOM 3 XPath support ///////////////////////////////////////////////////////\r\n\r\n function installDOM3XPathSupport(doc, p) {\r\n doc.createExpression = function (e, r) {\r\n try {\r\n return new XPathExpression(e, r, p);\r\n } catch (e) {\r\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR, e);\r\n }\r\n };\r\n doc.createNSResolver = function (n) {\r\n return new NodeXPathNSResolver(n);\r\n };\r\n doc.evaluate = function (e, cn, r, t, res) {\r\n if (t < 0 || t > 9) {\r\n throw { code: 0, toString: function () { return \"Request type not supported\"; } };\r\n }\r\n return doc.createExpression(e, r, p).evaluate(cn, t, res);\r\n };\r\n };\r\n\r\n // ---------------------------------------------------------------------------\r\n\r\n // Install DOM 3 XPath support for the current document.\r\n try {\r\n var shouldInstall = true;\r\n try {\r\n if (document.implementation\r\n && document.implementation.hasFeature\r\n && document.implementation.hasFeature(\"XPath\", null)) {\r\n shouldInstall = false;\r\n }\r\n } catch (e) {\r\n }\r\n if (shouldInstall) {\r\n installDOM3XPathSupport(document, new XPathParser());\r\n }\r\n } catch (e) {\r\n }\r\n\r\n // ---------------------------------------------------------------------------\r\n // exports for node.js\r\n\r\n installDOM3XPathSupport(exports, new XPathParser());\r\n\r\n (function () {\r\n var parser = new XPathParser();\r\n\r\n var defaultNSResolver = new NamespaceResolver();\r\n var defaultFunctionResolver = new FunctionResolver();\r\n var defaultVariableResolver = new VariableResolver();\r\n\r\n function makeNSResolverFromFunction(func) {\r\n return {\r\n getNamespace: function (prefix, node) {\r\n var ns = func(prefix, node);\r\n\r\n return ns || defaultNSResolver.getNamespace(prefix, node);\r\n }\r\n };\r\n }\r\n\r\n function makeNSResolverFromObject(obj) {\r\n return makeNSResolverFromFunction(obj.getNamespace.bind(obj));\r\n }\r\n\r\n function makeNSResolverFromMap(map) {\r\n return makeNSResolverFromFunction(function (prefix) {\r\n return map[prefix];\r\n });\r\n }\r\n\r\n function makeNSResolver(resolver) {\r\n if (resolver && typeof resolver.getNamespace === \"function\") {\r\n return makeNSResolverFromObject(resolver);\r\n }\r\n\r\n if (typeof resolver === \"function\") {\r\n return makeNSResolverFromFunction(resolver);\r\n }\r\n\r\n // assume prefix -> uri mapping\r\n if (typeof resolver === \"object\") {\r\n return makeNSResolverFromMap(resolver);\r\n }\r\n\r\n return defaultNSResolver;\r\n }\r\n\r\n /** Converts native JavaScript types to their XPath library equivalent */\r\n function convertValue(value) {\r\n if (value === null ||\r\n typeof value === \"undefined\" ||\r\n value instanceof XString ||\r\n value instanceof XBoolean ||\r\n value instanceof XNumber ||\r\n value instanceof XNodeSet) {\r\n return value;\r\n }\r\n\r\n switch (typeof value) {\r\n case \"string\": return new XString(value);\r\n case \"boolean\": return new XBoolean(value);\r\n case \"number\": return new XNumber(value);\r\n }\r\n\r\n // assume node(s)\r\n var ns = new XNodeSet();\r\n ns.addArray([].concat(value));\r\n return ns;\r\n }\r\n\r\n function makeEvaluator(func) {\r\n return function (context) {\r\n var args = Array.prototype.slice.call(arguments, 1).map(function (arg) {\r\n return arg.evaluate(context);\r\n });\r\n var result = func.apply(this, [].concat(context, args));\r\n return convertValue(result);\r\n };\r\n }\r\n\r\n function makeFunctionResolverFromFunction(func) {\r\n return {\r\n getFunction: function (name, namespace) {\r\n var found = func(name, namespace);\r\n if (found) {\r\n return makeEvaluator(found);\r\n }\r\n return defaultFunctionResolver.getFunction(name, namespace);\r\n }\r\n };\r\n }\r\n\r\n function makeFunctionResolverFromObject(obj) {\r\n return makeFunctionResolverFromFunction(obj.getFunction.bind(obj));\r\n }\r\n\r\n function makeFunctionResolverFromMap(map) {\r\n return makeFunctionResolverFromFunction(function (name) {\r\n return map[name];\r\n });\r\n }\r\n\r\n function makeFunctionResolver(resolver) {\r\n if (resolver && typeof resolver.getFunction === \"function\") {\r\n return makeFunctionResolverFromObject(resolver);\r\n }\r\n\r\n if (typeof resolver === \"function\") {\r\n return makeFunctionResolverFromFunction(resolver);\r\n }\r\n\r\n // assume map\r\n if (typeof resolver === \"object\") {\r\n return makeFunctionResolverFromMap(resolver);\r\n }\r\n\r\n return defaultFunctionResolver;\r\n }\r\n\r\n function makeVariableResolverFromFunction(func) {\r\n return {\r\n getVariable: function (name, namespace) {\r\n var value = func(name, namespace);\r\n return convertValue(value);\r\n }\r\n };\r\n }\r\n\r\n function makeVariableResolver(resolver) {\r\n if (resolver) {\r\n if (typeof resolver.getVariable === \"function\") {\r\n return makeVariableResolverFromFunction(resolver.getVariable.bind(resolver));\r\n }\r\n\r\n if (typeof resolver === \"function\") {\r\n return makeVariableResolverFromFunction(resolver);\r\n }\r\n\r\n // assume map\r\n if (typeof resolver === \"object\") {\r\n return makeVariableResolverFromFunction(function (name) {\r\n return resolver[name];\r\n });\r\n }\r\n }\r\n\r\n return defaultVariableResolver;\r\n }\r\n\r\n function copyIfPresent(prop, dest, source) {\r\n if (prop in source) { dest[prop] = source[prop]; }\r\n }\r\n\r\n function makeContext(options) {\r\n var context = new XPathContext();\r\n\r\n if (options) {\r\n context.namespaceResolver = makeNSResolver(options.namespaces);\r\n context.functionResolver = makeFunctionResolver(options.functions);\r\n context.variableResolver = makeVariableResolver(options.variables);\r\n context.expressionContextNode = options.node;\r\n copyIfPresent('allowAnyNamespaceForNoPrefix', context, options);\r\n copyIfPresent('isHtml', context, options);\r\n } else {\r\n context.namespaceResolver = defaultNSResolver;\r\n }\r\n\r\n return context;\r\n }\r\n\r\n function evaluate(parsedExpression, options) {\r\n var context = makeContext(options);\r\n\r\n return parsedExpression.evaluate(context);\r\n }\r\n\r\n var evaluatorPrototype = {\r\n evaluate: function (options) {\r\n return evaluate(this.expression, options);\r\n }\r\n\r\n , evaluateNumber: function (options) {\r\n return this.evaluate(options).numberValue();\r\n }\r\n\r\n , evaluateString: function (options) {\r\n return this.evaluate(options).stringValue();\r\n }\r\n\r\n , evaluateBoolean: function (options) {\r\n return this.evaluate(options).booleanValue();\r\n }\r\n\r\n , evaluateNodeSet: function (options) {\r\n return this.evaluate(options).nodeset();\r\n }\r\n\r\n , select: function (options) {\r\n return this.evaluateNodeSet(options).toArray()\r\n }\r\n\r\n , select1: function (options) {\r\n return this.select(options)[0];\r\n }\r\n };\r\n\r\n function parse(xpath) {\r\n var parsed = parser.parse(xpath);\r\n\r\n return Object.create(evaluatorPrototype, {\r\n expression: {\r\n value: parsed\r\n }\r\n });\r\n }\r\n\r\n exports.parse = parse;\r\n })();\r\n\r\n assign(\r\n exports,\r\n {\r\n XPath: XPath,\r\n XPathParser: XPathParser,\r\n XPathResult: XPathResult,\r\n\r\n Step: Step,\r\n PathExpr: PathExpr,\r\n NodeTest: NodeTest,\r\n LocationPath: LocationPath,\r\n\r\n OrOperation: OrOperation,\r\n AndOperation: AndOperation,\r\n\r\n BarOperation: BarOperation,\r\n\r\n EqualsOperation: EqualsOperation,\r\n NotEqualOperation: NotEqualOperation,\r\n LessThanOperation: LessThanOperation,\r\n GreaterThanOperation: GreaterThanOperation,\r\n LessThanOrEqualOperation: LessThanOrEqualOperation,\r\n GreaterThanOrEqualOperation: GreaterThanOrEqualOperation,\r\n\r\n PlusOperation: PlusOperation,\r\n MinusOperation: MinusOperation,\r\n MultiplyOperation: MultiplyOperation,\r\n DivOperation: DivOperation,\r\n ModOperation: ModOperation,\r\n UnaryMinusOperation: UnaryMinusOperation,\r\n\r\n FunctionCall: FunctionCall,\r\n VariableReference: VariableReference,\r\n\r\n XPathContext: XPathContext,\r\n\r\n XNodeSet: XNodeSet,\r\n XBoolean: XBoolean,\r\n XString: XString,\r\n XNumber: XNumber,\r\n\r\n NamespaceResolver: NamespaceResolver,\r\n FunctionResolver: FunctionResolver,\r\n VariableResolver: VariableResolver,\r\n\r\n Utilities: Utilities,\r\n }\r\n );\r\n\r\n // helper\r\n exports.select = function (e, doc, single) {\r\n return exports.selectWithResolver(e, doc, null, single);\r\n };\r\n\r\n exports.useNamespaces = function (mappings) {\r\n var resolver = {\r\n mappings: mappings || {},\r\n lookupNamespaceURI: function (prefix) {\r\n return this.mappings[prefix];\r\n }\r\n };\r\n\r\n return function (e, doc, single) {\r\n return exports.selectWithResolver(e, doc, resolver, single);\r\n };\r\n };\r\n\r\n exports.selectWithResolver = function (e, doc, resolver, single) {\r\n var expression = new XPathExpression(e, resolver, new XPathParser());\r\n var type = XPathResult.ANY_TYPE;\r\n\r\n var result = expression.evaluate(doc, type, null);\r\n\r\n if (result.resultType == XPathResult.STRING_TYPE) {\r\n result = result.stringValue;\r\n }\r\n else if (result.resultType == XPathResult.NUMBER_TYPE) {\r\n result = result.numberValue;\r\n }\r\n else if (result.resultType == XPathResult.BOOLEAN_TYPE) {\r\n result = result.booleanValue;\r\n }\r\n else {\r\n result = result.nodes;\r\n if (single) {\r\n result = result[0];\r\n }\r\n }\r\n\r\n return result;\r\n };\r\n\r\n exports.select1 = function (e, doc) {\r\n return exports.select(e, doc, true);\r\n };\r\n\r\n var isArrayOfNodes = function (value) {\r\n return Array.isArray(value) && value.every(isNodeLike);\r\n };\r\n\r\n var isNodeOfType = function (type) {\r\n return function (value) {\r\n return isNodeLike(value) && value.nodeType === type;\r\n };\r\n };\r\n\r\n assign(\r\n exports,\r\n {\r\n isNodeLike: isNodeLike,\r\n isArrayOfNodes: isArrayOfNodes,\r\n isElement: isNodeOfType(NodeTypes.ELEMENT_NODE),\r\n isAttribute: isNodeOfType(NodeTypes.ATTRIBUTE_NODE),\r\n isTextNode: isNodeOfType(NodeTypes.TEXT_NODE),\r\n isCDATASection: isNodeOfType(NodeTypes.CDATA_SECTION_NODE),\r\n isProcessingInstruction: isNodeOfType(NodeTypes.PROCESSING_INSTRUCTION_NODE),\r\n isComment: isNodeOfType(NodeTypes.COMMENT_NODE),\r\n isDocumentNode: isNodeOfType(NodeTypes.DOCUMENT_NODE),\r\n isDocumentTypeNode: isNodeOfType(NodeTypes.DOCUMENT_TYPE_NODE),\r\n isDocumentFragment: isNodeOfType(NodeTypes.DOCUMENT_FRAGMENT_NODE),\r\n }\r\n );\r\n // end non-node wrapper\r\n})(xpath);\r\n","'use strict'\n\n/**\n * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes.\n *\n * Works with anything that has a `length` property and index access properties, including NodeList.\n *\n * @template {unknown} T\n * @param {Array | ({length:number, [number]: T})} list\n * @param {function (item: T, index: number, list:Array | ({length:number, [number]: T})):boolean} predicate\n * @param {Partial>?} ac `Array.prototype` by default,\n * \t\t\t\tallows injecting a custom implementation in tests\n * @returns {T | undefined}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find\n */\nfunction find(list, predicate, ac) {\n\tif (ac === undefined) {\n\t\tac = Array.prototype;\n\t}\n\tif (list && typeof ac.find === 'function') {\n\t\treturn ac.find.call(list, predicate);\n\t}\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (Object.prototype.hasOwnProperty.call(list, i)) {\n\t\t\tvar item = list[i];\n\t\t\tif (predicate.call(undefined, item, i, list)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * \"Shallow freezes\" an object to render it immutable.\n * Uses `Object.freeze` if available,\n * otherwise the immutability is only in the type.\n *\n * Is used to create \"enum like\" objects.\n *\n * @template T\n * @param {T} object the object to freeze\n * @param {Pick = Object} oc `Object` by default,\n * \t\t\t\tallows to inject custom object constructor for tests\n * @returns {Readonly}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n */\nfunction freeze(object, oc) {\n\tif (oc === undefined) {\n\t\toc = Object\n\t}\n\treturn oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object\n}\n\n/**\n * Since we can not rely on `Object.assign` we provide a simplified version\n * that is sufficient for our needs.\n *\n * @param {Object} target\n * @param {Object | null | undefined} source\n *\n * @returns {Object} target\n * @throws TypeError if target is not an object\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign\n */\nfunction assign(target, source) {\n\tif (target === null || typeof target !== 'object') {\n\t\tthrow new TypeError('target is not an object')\n\t}\n\tfor (var key in source) {\n\t\tif (Object.prototype.hasOwnProperty.call(source, key)) {\n\t\t\ttarget[key] = source[key]\n\t\t}\n\t}\n\treturn target\n}\n\n/**\n * All mime types that are allowed as input to `DOMParser.parseFromString`\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec\n * @see DOMParser.prototype.parseFromString\n */\nvar MIME_TYPE = freeze({\n\t/**\n\t * `text/html`, the only mime type that triggers treating an XML document as HTML.\n\t *\n\t * @see DOMParser.SupportedType.isHTML\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec\n\t */\n\tHTML: 'text/html',\n\n\t/**\n\t * Helper method to check a mime type if it indicates an HTML document\n\t *\n\t * @param {string} [value]\n\t * @returns {boolean}\n\t *\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring \t */\n\tisHTML: function (value) {\n\t\treturn value === MIME_TYPE.HTML\n\t},\n\n\t/**\n\t * `application/xml`, the standard mime type for XML documents.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_APPLICATION: 'application/xml',\n\n\t/**\n\t * `text/html`, an alias for `application/xml`.\n\t *\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303\n\t * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_TEXT: 'text/xml',\n\n\t/**\n\t * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,\n\t * but is parsed as an XML document.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec\n\t * @see https://en.wikipedia.org/wiki/XHTML Wikipedia\n\t */\n\tXML_XHTML_APPLICATION: 'application/xhtml+xml',\n\n\t/**\n\t * `image/svg+xml`,\n\t *\n\t * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration\n\t * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1\n\t * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia\n\t */\n\tXML_SVG_IMAGE: 'image/svg+xml',\n})\n\n/**\n * Namespaces that are used in this code base.\n *\n * @see http://www.w3.org/TR/REC-xml-names\n */\nvar NAMESPACE = freeze({\n\t/**\n\t * The XHTML namespace.\n\t *\n\t * @see http://www.w3.org/1999/xhtml\n\t */\n\tHTML: 'http://www.w3.org/1999/xhtml',\n\n\t/**\n\t * Checks if `uri` equals `NAMESPACE.HTML`.\n\t *\n\t * @param {string} [uri]\n\t *\n\t * @see NAMESPACE.HTML\n\t */\n\tisHTML: function (uri) {\n\t\treturn uri === NAMESPACE.HTML\n\t},\n\n\t/**\n\t * The SVG namespace.\n\t *\n\t * @see http://www.w3.org/2000/svg\n\t */\n\tSVG: 'http://www.w3.org/2000/svg',\n\n\t/**\n\t * The `xml:` namespace.\n\t *\n\t * @see http://www.w3.org/XML/1998/namespace\n\t */\n\tXML: 'http://www.w3.org/XML/1998/namespace',\n\n\t/**\n\t * The `xmlns:` namespace\n\t *\n\t * @see https://www.w3.org/2000/xmlns/\n\t */\n\tXMLNS: 'http://www.w3.org/2000/xmlns/',\n})\n\nexports.assign = assign;\nexports.find = find;\nexports.freeze = freeze;\nexports.MIME_TYPE = MIME_TYPE;\nexports.NAMESPACE = NAMESPACE;\n","var conventions = require(\"./conventions\");\n\nvar find = conventions.find;\nvar NAMESPACE = conventions.NAMESPACE;\n\n/**\n * A prerequisite for `[].filter`, to drop elements that are empty\n * @param {string} input\n * @returns {boolean}\n */\nfunction notEmptyString (input) {\n\treturn input !== ''\n}\n/**\n * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * @param {string} input\n * @returns {string[]} (can be empty)\n */\nfunction splitOnASCIIWhitespace(input) {\n\t// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE\n\treturn input ? input.split(/[\\t\\n\\f\\r ]+/).filter(notEmptyString) : []\n}\n\n/**\n * Adds element as a key to current if it is not already present.\n *\n * @param {Record} current\n * @param {string} element\n * @returns {Record}\n */\nfunction orderedSetReducer (current, element) {\n\tif (!current.hasOwnProperty(element)) {\n\t\tcurrent[element] = true;\n\t}\n\treturn current;\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ordered-set\n * @param {string} input\n * @returns {string[]}\n */\nfunction toOrderedSet(input) {\n\tif (!input) return [];\n\tvar list = splitOnASCIIWhitespace(input);\n\treturn Object.keys(list.reduce(orderedSetReducer, {}))\n}\n\n/**\n * Uses `list.indexOf` to implement something like `Array.prototype.includes`,\n * which we can not rely on being available.\n *\n * @param {any[]} list\n * @returns {function(any): boolean}\n */\nfunction arrayIncludes (list) {\n\treturn function(element) {\n\t\treturn list && list.indexOf(element) !== -1;\n\t}\n}\n\nfunction copy(src,dest){\n\tfor(var p in src){\n\t\tif (Object.prototype.hasOwnProperty.call(src, p)) {\n\t\t\tdest[p] = src[p];\n\t\t}\n\t}\n}\n\n/**\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*((?:.*\\{\\s*?[\\r\\n][\\s\\S]*?^})|\\S.*?(?=[;\\r\\n]));?\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*(\\S.*?(?=[;\\r\\n]));?\n */\nfunction _extends(Class,Super){\n\tvar pt = Class.prototype;\n\tif(!(pt instanceof Super)){\n\t\tfunction t(){};\n\t\tt.prototype = Super.prototype;\n\t\tt = new t();\n\t\tcopy(pt,t);\n\t\tClass.prototype = pt = t;\n\t}\n\tif(pt.constructor != Class){\n\t\tif(typeof Class != 'function'){\n\t\t\tconsole.error(\"unknown Class:\"+Class)\n\t\t}\n\t\tpt.constructor = Class\n\t}\n}\n\n// Node Types\nvar NodeType = {}\nvar ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;\nvar ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;\nvar TEXT_NODE = NodeType.TEXT_NODE = 3;\nvar CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;\nvar ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;\nvar ENTITY_NODE = NodeType.ENTITY_NODE = 6;\nvar PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;\nvar COMMENT_NODE = NodeType.COMMENT_NODE = 8;\nvar DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;\nvar DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;\nvar DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;\nvar NOTATION_NODE = NodeType.NOTATION_NODE = 12;\n\n// ExceptionCode\nvar ExceptionCode = {}\nvar ExceptionMessage = {};\nvar INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]=\"Index size error\"),1);\nvar DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]=\"DOMString size error\"),2);\nvar HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]=\"Hierarchy request error\"),3);\nvar WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]=\"Wrong document\"),4);\nvar INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]=\"Invalid character\"),5);\nvar NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]=\"No data allowed\"),6);\nvar NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]=\"No modification allowed\"),7);\nvar NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]=\"Not found\"),8);\nvar NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]=\"Not supported\"),9);\nvar INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]=\"Attribute in use\"),10);\n//level2\nvar INVALID_STATE_ERR \t= ExceptionCode.INVALID_STATE_ERR \t= ((ExceptionMessage[11]=\"Invalid state\"),11);\nvar SYNTAX_ERR \t= ExceptionCode.SYNTAX_ERR \t= ((ExceptionMessage[12]=\"Syntax error\"),12);\nvar INVALID_MODIFICATION_ERR \t= ExceptionCode.INVALID_MODIFICATION_ERR \t= ((ExceptionMessage[13]=\"Invalid modification\"),13);\nvar NAMESPACE_ERR \t= ExceptionCode.NAMESPACE_ERR \t= ((ExceptionMessage[14]=\"Invalid namespace\"),14);\nvar INVALID_ACCESS_ERR \t= ExceptionCode.INVALID_ACCESS_ERR \t= ((ExceptionMessage[15]=\"Invalid access\"),15);\n\n/**\n * DOM Level 2\n * Object DOMException\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html\n */\nfunction DOMException(code, message) {\n\tif(message instanceof Error){\n\t\tvar error = message;\n\t}else{\n\t\terror = this;\n\t\tError.call(this, ExceptionMessage[code]);\n\t\tthis.message = ExceptionMessage[code];\n\t\tif(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);\n\t}\n\terror.code = code;\n\tif(message) this.message = this.message + \": \" + message;\n\treturn error;\n};\nDOMException.prototype = Error.prototype;\ncopy(ExceptionCode,DOMException)\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177\n * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.\n * The items in the NodeList are accessible via an integral index, starting from 0.\n */\nfunction NodeList() {\n};\nNodeList.prototype = {\n\t/**\n\t * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.\n\t * @standard level1\n\t */\n\tlength:0,\n\t/**\n\t * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.\n\t * @standard level1\n\t * @param index unsigned long\n\t * Index into the collection.\n\t * @return Node\n\t * \tThe node at the indexth position in the NodeList, or null if that is not a valid index.\n\t */\n\titem: function(index) {\n\t\treturn index >= 0 && index < this.length ? this[index] : null;\n\t},\n\ttoString:function(isHTML,nodeFilter){\n\t\tfor(var buf = [], i = 0;i=0){\n\t\tvar lastIndex = list.length-1\n\t\twhile(i0 || key == 'xmlns'){\n//\t\t\treturn null;\n//\t\t}\n\t\t//console.log()\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar attr = this[i];\n\t\t\t//console.log(attr.nodeName,key)\n\t\t\tif(attr.nodeName == key){\n\t\t\t\treturn attr;\n\t\t\t}\n\t\t}\n\t},\n\tsetNamedItem: function(attr) {\n\t\tvar el = attr.ownerElement;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\tvar oldAttr = this.getNamedItem(attr.nodeName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\t/* returns Node */\n\tsetNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR\n\t\tvar el = attr.ownerElement, oldAttr;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\toldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\n\t/* returns Node */\n\tremoveNamedItem: function(key) {\n\t\tvar attr = this.getNamedItem(key);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\n\n\t},// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR\n\n\t//for level2\n\tremoveNamedItemNS:function(namespaceURI,localName){\n\t\tvar attr = this.getNamedItemNS(namespaceURI,localName);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\t},\n\tgetNamedItemNS: function(namespaceURI, localName) {\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar node = this[i];\n\t\t\tif(node.localName == localName && node.namespaceURI == namespaceURI){\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n};\n\n/**\n * The DOMImplementation interface represents an object providing methods\n * which are not dependent on any particular document.\n * Such an object is returned by the `Document.implementation` property.\n *\n * __The individual methods describe the differences compared to the specs.__\n *\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN\n * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)\n * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core\n * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core\n * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard\n */\nfunction DOMImplementation() {\n}\n\nDOMImplementation.prototype = {\n\t/**\n\t * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.\n\t * The different implementations fairly diverged in what kind of features were reported.\n\t * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.\n\t *\n\t * @deprecated It is deprecated and modern browsers return true in all cases.\n\t *\n\t * @param {string} feature\n\t * @param {string} [version]\n\t * @returns {boolean} always true\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN\n\t * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard\n\t */\n\thasFeature: function(feature, version) {\n\t\t\treturn true;\n\t},\n\t/**\n\t * Creates an XML Document object of the specified type with its document element.\n\t *\n\t * __It behaves slightly different from the description in the living standard__:\n\t * - There is no interface/class `XMLDocument`, it returns a `Document` instance.\n\t * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.\n\t * - this implementation is not validating names or qualified names\n\t * (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string|null} namespaceURI\n\t * @param {string} qualifiedName\n\t * @param {DocumentType=null} doctype\n\t * @returns {Document}\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocument: function(namespaceURI, qualifiedName, doctype){\n\t\tvar doc = new Document();\n\t\tdoc.implementation = this;\n\t\tdoc.childNodes = new NodeList();\n\t\tdoc.doctype = doctype || null;\n\t\tif (doctype){\n\t\t\tdoc.appendChild(doctype);\n\t\t}\n\t\tif (qualifiedName){\n\t\t\tvar root = doc.createElementNS(namespaceURI, qualifiedName);\n\t\t\tdoc.appendChild(root);\n\t\t}\n\t\treturn doc;\n\t},\n\t/**\n\t * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.\n\t *\n\t * __This behavior is slightly different from the in the specs__:\n\t * - this implementation is not validating names or qualified names\n\t * (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string} qualifiedName\n\t * @param {string} [publicId]\n\t * @param {string} [systemId]\n\t * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation\n\t * \t\t\t\t or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocumentType: function(qualifiedName, publicId, systemId){\n\t\tvar node = new DocumentType();\n\t\tnode.name = qualifiedName;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.publicId = publicId || '';\n\t\tnode.systemId = systemId || '';\n\n\t\treturn node;\n\t}\n};\n\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247\n */\n\nfunction Node() {\n};\n\nNode.prototype = {\n\tfirstChild : null,\n\tlastChild : null,\n\tpreviousSibling : null,\n\tnextSibling : null,\n\tattributes : null,\n\tparentNode : null,\n\tchildNodes : null,\n\townerDocument : null,\n\tnodeValue : null,\n\tnamespaceURI : null,\n\tprefix : null,\n\tlocalName : null,\n\t// Modified in DOM Level 2:\n\tinsertBefore:function(newChild, refChild){//raises\n\t\treturn _insertBefore(this,newChild,refChild);\n\t},\n\treplaceChild:function(newChild, oldChild){//raises\n\t\t_insertBefore(this, newChild,oldChild, assertPreReplacementValidityInDocument);\n\t\tif(oldChild){\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t},\n\tremoveChild:function(oldChild){\n\t\treturn _removeChild(this,oldChild);\n\t},\n\tappendChild:function(newChild){\n\t\treturn this.insertBefore(newChild,null);\n\t},\n\thasChildNodes:function(){\n\t\treturn this.firstChild != null;\n\t},\n\tcloneNode:function(deep){\n\t\treturn cloneNode(this.ownerDocument||this,this,deep);\n\t},\n\t// Modified in DOM Level 2:\n\tnormalize:function(){\n\t\tvar child = this.firstChild;\n\t\twhile(child){\n\t\t\tvar next = child.nextSibling;\n\t\t\tif(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){\n\t\t\t\tthis.removeChild(next);\n\t\t\t\tchild.appendData(next.data);\n\t\t\t}else{\n\t\t\t\tchild.normalize();\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t}\n\t},\n \t// Introduced in DOM Level 2:\n\tisSupported:function(feature, version){\n\t\treturn this.ownerDocument.implementation.hasFeature(feature,version);\n\t},\n // Introduced in DOM Level 2:\n hasAttributes:function(){\n \treturn this.attributes.length>0;\n },\n\t/**\n\t * Look up the prefix associated to the given namespace URI, starting from this node.\n\t * **The default namespace declarations are ignored by this method.**\n\t * See Namespace Prefix Lookup for details on the algorithm used by this method.\n\t *\n\t * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._\n\t *\n\t * @param {string | null} namespaceURI\n\t * @returns {string | null}\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo\n\t * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix\n\t * @see https://github.com/xmldom/xmldom/issues/322\n\t */\n lookupPrefix:function(namespaceURI){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tfor(var n in map){\n\t\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {\n\t\t\t\t\t\t\treturn n;\n\t\t\t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n lookupNamespaceURI:function(prefix){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tif(Object.prototype.hasOwnProperty.call(map, prefix)){\n \t\t\t\treturn map[prefix] ;\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n isDefaultNamespace:function(namespaceURI){\n \tvar prefix = this.lookupPrefix(namespaceURI);\n \treturn prefix == null;\n }\n};\n\n\nfunction _xmlEncoder(c){\n\treturn c == '<' && '<' ||\n c == '>' && '>' ||\n c == '&' && '&' ||\n c == '\"' && '"' ||\n '&#'+c.charCodeAt()+';'\n}\n\n\ncopy(NodeType,Node);\ncopy(NodeType,Node.prototype);\n\n/**\n * @param callback return true for continue,false for break\n * @return boolean true: break visit;\n */\nfunction _visitNode(node,callback){\n\tif(callback(node)){\n\t\treturn true;\n\t}\n\tif(node = node.firstChild){\n\t\tdo{\n\t\t\tif(_visitNode(node,callback)){return true}\n }while(node=node.nextSibling)\n }\n}\n\n\n\nfunction Document(){\n\tthis.ownerDocument = this;\n}\n\nfunction _onAddAttribute(doc,el,newAttr){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tel._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value\n\t}\n}\n\nfunction _onRemoveAttribute(doc,el,newAttr,remove){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tdelete el._nsMap[newAttr.prefix?newAttr.localName:'']\n\t}\n}\n\n/**\n * Updates `el.childNodes`, updating the indexed items and it's `length`.\n * Passing `newChild` means it will be appended.\n * Otherwise it's assumed that an item has been removed,\n * and `el.firstNode` and it's `.nextSibling` are used\n * to walk the current list of child nodes.\n *\n * @param {Document} doc\n * @param {Node} el\n * @param {Node} [newChild]\n * @private\n */\nfunction _onUpdateChild (doc, el, newChild) {\n\tif(doc && doc._inc){\n\t\tdoc._inc++;\n\t\t//update childNodes\n\t\tvar cs = el.childNodes;\n\t\tif (newChild) {\n\t\t\tcs[cs.length++] = newChild;\n\t\t} else {\n\t\t\tvar child = el.firstChild;\n\t\t\tvar i = 0;\n\t\t\twhile (child) {\n\t\t\t\tcs[i++] = child;\n\t\t\t\tchild = child.nextSibling;\n\t\t\t}\n\t\t\tcs.length = i;\n\t\t\tdelete cs[cs.length];\n\t\t}\n\t}\n}\n\n/**\n * Removes the connections between `parentNode` and `child`\n * and any existing `child.previousSibling` or `child.nextSibling`.\n *\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n *\n * @param {Node} parentNode\n * @param {Node} child\n * @returns {Node} the child that was removed.\n * @private\n */\nfunction _removeChild (parentNode, child) {\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif (previous) {\n\t\tprevious.nextSibling = next;\n\t} else {\n\t\tparentNode.firstChild = next;\n\t}\n\tif (next) {\n\t\tnext.previousSibling = previous;\n\t} else {\n\t\tparentNode.lastChild = previous;\n\t}\n\tchild.parentNode = null;\n\tchild.previousSibling = null;\n\tchild.nextSibling = null;\n\t_onUpdateChild(parentNode.ownerDocument, parentNode);\n\treturn child;\n}\n\n/**\n * Returns `true` if `node` can be a parent for insertion.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasValidParentNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)\n\t);\n}\n\n/**\n * Returns `true` if `node` can be inserted according to it's `nodeType`.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasInsertableNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(isElementNode(node) ||\n\t\t\tisTextNode(node) ||\n\t\t\tisDocTypeNode(node) ||\n\t\t\tnode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||\n\t\t\tnode.nodeType === Node.COMMENT_NODE ||\n\t\t\tnode.nodeType === Node.PROCESSING_INSTRUCTION_NODE)\n\t);\n}\n\n/**\n * Returns true if `node` is a DOCTYPE node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isDocTypeNode(node) {\n\treturn node && node.nodeType === Node.DOCUMENT_TYPE_NODE;\n}\n\n/**\n * Returns true if the node is an element\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isElementNode(node) {\n\treturn node && node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Returns true if `node` is a text node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isTextNode(node) {\n\treturn node && node.nodeType === Node.TEXT_NODE;\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Document} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementInsertionPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\tif (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Node} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementReplacementPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\n\tfunction hasElementChildThatIsNotChild(node) {\n\t\treturn isElementNode(node) && node !== child;\n\t}\n\n\tif (find(parentChildNodes, hasElementChildThatIsNotChild)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * @private\n * Steps 1-5 of the checks before inserting and before replacing a child are the same.\n *\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidity1to5(parent, node, child) {\n\t// 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a \"HierarchyRequestError\" DOMException.\n\tif (!hasValidParentNodeType(parent)) {\n\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);\n\t}\n\t// 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a \"HierarchyRequestError\" DOMException.\n\t// not implemented!\n\t// 3. If `child` is non-null and its parent is not `parent`, then throw a \"NotFoundError\" DOMException.\n\tif (child && child.parentNode !== parent) {\n\t\tthrow new DOMException(NOT_FOUND_ERR, 'child not in parent');\n\t}\n\tif (\n\t\t// 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a \"HierarchyRequestError\" DOMException.\n\t\t!hasInsertableNodeType(node) ||\n\t\t// 5. If either `node` is a Text node and `parent` is a document,\n\t\t// the sax parser currently adds top level text nodes, this will be fixed in 0.9.0\n\t\t// || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)\n\t\t// or `node` is a doctype and `parent` is not a document, then throw a \"HierarchyRequestError\" DOMException.\n\t\t(isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)\n\t) {\n\t\tthrow new DOMException(\n\t\t\tHIERARCHY_REQUEST_ERR,\n\t\t\t'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType\n\t\t);\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If node has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child,\n\t\t// `child` is a doctype, or `child` is non-null and a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child, `child` is a doctype,\n\t\t// or `child` is non-null and a doctype is following `child`.\n\t\tif (!isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\t// `parent` has a doctype child,\n\t\tif (find(parentChildNodes, isDocTypeNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// `child` is non-null and an element is preceding `child`,\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t\t// or `child` is null and `parent` has an element child.\n\t\tif (!child && parentElementChild) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreReplacementValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If `node` has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (!isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\tfunction hasDoctypeChildThatIsNotChild(node) {\n\t\t\treturn isDocTypeNode(node) && node !== child;\n\t\t}\n\n\t\t// `parent` has a doctype child that is not `child`,\n\t\tif (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// or an element is preceding `child`.\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction _insertBefore(parent, node, child, _inDocumentAssertion) {\n\t// To ensure pre-insertion validity of a node into a parent before a child, run these steps:\n\tassertPreInsertionValidity1to5(parent, node, child);\n\n\t// If parent is a document, and any of the statements below, switched on the interface node implements,\n\t// are true, then throw a \"HierarchyRequestError\" DOMException.\n\tif (parent.nodeType === Node.DOCUMENT_NODE) {\n\t\t(_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);\n\t}\n\n\tvar cp = node.parentNode;\n\tif(cp){\n\t\tcp.removeChild(node);//remove and update\n\t}\n\tif(node.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = node.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn node;\n\t\t}\n\t\tvar newLast = node.lastChild;\n\t}else{\n\t\tnewFirst = newLast = node;\n\t}\n\tvar pre = child ? child.previousSibling : parent.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = child;\n\n\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparent.firstChild = newFirst;\n\t}\n\tif(child == null){\n\t\tparent.lastChild = newLast;\n\t}else{\n\t\tchild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parent;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parent.ownerDocument||parent, parent);\n\t//console.log(parent.lastChild.nextSibling == null)\n\tif (node.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnode.firstChild = node.lastChild = null;\n\t}\n\treturn node;\n}\n\n/**\n * Appends `newChild` to `parentNode`.\n * If `newChild` is already connected to a `parentNode` it is first removed from it.\n *\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n * @param {Node} parentNode\n * @param {Node} newChild\n * @returns {Node}\n * @private\n */\nfunction _appendSingleChild (parentNode, newChild) {\n\tif (newChild.parentNode) {\n\t\tnewChild.parentNode.removeChild(newChild);\n\t}\n\tnewChild.parentNode = parentNode;\n\tnewChild.previousSibling = parentNode.lastChild;\n\tnewChild.nextSibling = null;\n\tif (newChild.previousSibling) {\n\t\tnewChild.previousSibling.nextSibling = newChild;\n\t} else {\n\t\tparentNode.firstChild = newChild;\n\t}\n\tparentNode.lastChild = newChild;\n\t_onUpdateChild(parentNode.ownerDocument, parentNode, newChild);\n\treturn newChild;\n}\n\nDocument.prototype = {\n\t//implementation : null,\n\tnodeName : '#document',\n\tnodeType : DOCUMENT_NODE,\n\t/**\n\t * The DocumentType node of the document.\n\t *\n\t * @readonly\n\t * @type DocumentType\n\t */\n\tdoctype : null,\n\tdocumentElement : null,\n\t_inc : 1,\n\n\tinsertBefore : function(newChild, refChild){//raises\n\t\tif(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){\n\t\t\tvar child = newChild.firstChild;\n\t\t\twhile(child){\n\t\t\t\tvar next = child.nextSibling;\n\t\t\t\tthis.insertBefore(child,refChild);\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t\treturn newChild;\n\t\t}\n\t\t_insertBefore(this, newChild, refChild);\n\t\tnewChild.ownerDocument = this;\n\t\tif (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\n\t\treturn newChild;\n\t},\n\tremoveChild : function(oldChild){\n\t\tif(this.documentElement == oldChild){\n\t\t\tthis.documentElement = null;\n\t\t}\n\t\treturn _removeChild(this,oldChild);\n\t},\n\treplaceChild: function (newChild, oldChild) {\n\t\t//raises\n\t\t_insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);\n\t\tnewChild.ownerDocument = this;\n\t\tif (oldChild) {\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t\tif (isElementNode(newChild)) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\t},\n\t// Introduced in DOM Level 2:\n\timportNode : function(importedNode,deep){\n\t\treturn importNode(this,importedNode,deep);\n\t},\n\t// Introduced in DOM Level 2:\n\tgetElementById :\tfunction(id){\n\t\tvar rtv = null;\n\t\t_visitNode(this.documentElement,function(node){\n\t\t\tif(node.nodeType == ELEMENT_NODE){\n\t\t\t\tif(node.getAttribute('id') == id){\n\t\t\t\t\trtv = node;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\treturn rtv;\n\t},\n\n\t/**\n\t * The `getElementsByClassName` method of `Document` interface returns an array-like object\n\t * of all child elements which have **all** of the given class name(s).\n\t *\n\t * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.\n\t *\n\t *\n\t * Warning: This is a live LiveNodeList.\n\t * Changes in the DOM will reflect in the array as the changes occur.\n\t * If an element selected by this array no longer qualifies for the selector,\n\t * it will automatically be removed. Be aware of this for iteration purposes.\n\t *\n\t * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName\n\t * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname\n\t */\n\tgetElementsByClassName: function(classNames) {\n\t\tvar classNamesSet = toOrderedSet(classNames)\n\t\treturn new LiveNodeList(this, function(base) {\n\t\t\tvar ls = [];\n\t\t\tif (classNamesSet.length > 0) {\n\t\t\t\t_visitNode(base.documentElement, function(node) {\n\t\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE) {\n\t\t\t\t\t\tvar nodeClassNames = node.getAttribute('class')\n\t\t\t\t\t\t// can be null if the attribute does not exist\n\t\t\t\t\t\tif (nodeClassNames) {\n\t\t\t\t\t\t\t// before splitting and iterating just compare them for the most common case\n\t\t\t\t\t\t\tvar matches = classNames === nodeClassNames;\n\t\t\t\t\t\t\tif (!matches) {\n\t\t\t\t\t\t\t\tvar nodeClassNamesSet = toOrderedSet(nodeClassNames)\n\t\t\t\t\t\t\t\tmatches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(matches) {\n\t\t\t\t\t\t\t\tls.push(node);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn ls;\n\t\t});\n\t},\n\n\t//document factory method:\n\tcreateElement :\tfunction(tagName){\n\t\tvar node = new Element();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = tagName;\n\t\tnode.tagName = tagName;\n\t\tnode.localName = tagName;\n\t\tnode.childNodes = new NodeList();\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\tcreateDocumentFragment :\tfunction(){\n\t\tvar node = new DocumentFragment();\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\treturn node;\n\t},\n\tcreateTextNode :\tfunction(data){\n\t\tvar node = new Text();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateComment :\tfunction(data){\n\t\tvar node = new Comment();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateCDATASection :\tfunction(data){\n\t\tvar node = new CDATASection();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateProcessingInstruction :\tfunction(target,data){\n\t\tvar node = new ProcessingInstruction();\n\t\tnode.ownerDocument = this;\n\t\tnode.tagName = node.nodeName = node.target = target;\n\t\tnode.nodeValue = node.data = data;\n\t\treturn node;\n\t},\n\tcreateAttribute :\tfunction(name){\n\t\tvar node = new Attr();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.name = name;\n\t\tnode.nodeName\t= name;\n\t\tnode.localName = name;\n\t\tnode.specified = true;\n\t\treturn node;\n\t},\n\tcreateEntityReference :\tfunction(name){\n\t\tvar node = new EntityReference();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.nodeName\t= name;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateElementNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Element();\n\t\tvar pl = qualifiedName.split(':');\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tnode.childNodes = new NodeList();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.tagName = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateAttributeNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Attr();\n\t\tvar pl = qualifiedName.split(':');\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.name = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tnode.specified = true;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\treturn node;\n\t}\n};\n_extends(Document,Node);\n\n\nfunction Element() {\n\tthis._nsMap = {};\n};\nElement.prototype = {\n\tnodeType : ELEMENT_NODE,\n\thasAttribute : function(name){\n\t\treturn this.getAttributeNode(name)!=null;\n\t},\n\tgetAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name);\n\t\treturn attr && attr.value || '';\n\t},\n\tgetAttributeNode : function(name){\n\t\treturn this.attributes.getNamedItem(name);\n\t},\n\tsetAttribute : function(name, value){\n\t\tvar attr = this.ownerDocument.createAttribute(name);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tremoveAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name)\n\t\tattr && this.removeAttributeNode(attr);\n\t},\n\n\t//four real opeartion method\n\tappendChild:function(newChild){\n\t\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\t\treturn this.insertBefore(newChild,null);\n\t\t}else{\n\t\t\treturn _appendSingleChild(this,newChild);\n\t\t}\n\t},\n\tsetAttributeNode : function(newAttr){\n\t\treturn this.attributes.setNamedItem(newAttr);\n\t},\n\tsetAttributeNodeNS : function(newAttr){\n\t\treturn this.attributes.setNamedItemNS(newAttr);\n\t},\n\tremoveAttributeNode : function(oldAttr){\n\t\t//console.log(this == oldAttr.ownerElement)\n\t\treturn this.attributes.removeNamedItem(oldAttr.nodeName);\n\t},\n\t//get real attribute name,and remove it by removeAttributeNode\n\tremoveAttributeNS : function(namespaceURI, localName){\n\t\tvar old = this.getAttributeNodeNS(namespaceURI, localName);\n\t\told && this.removeAttributeNode(old);\n\t},\n\n\thasAttributeNS : function(namespaceURI, localName){\n\t\treturn this.getAttributeNodeNS(namespaceURI, localName)!=null;\n\t},\n\tgetAttributeNS : function(namespaceURI, localName){\n\t\tvar attr = this.getAttributeNodeNS(namespaceURI, localName);\n\t\treturn attr && attr.value || '';\n\t},\n\tsetAttributeNS : function(namespaceURI, qualifiedName, value){\n\t\tvar attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tgetAttributeNodeNS : function(namespaceURI, localName){\n\t\treturn this.attributes.getNamedItemNS(namespaceURI, localName);\n\t},\n\n\tgetElementsByTagName : function(tagName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t});\n\t},\n\tgetElementsByTagNameNS : function(namespaceURI, localName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\n\t\t});\n\t}\n};\nDocument.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;\nDocument.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;\n\n\n_extends(Element,Node);\nfunction Attr() {\n};\nAttr.prototype.nodeType = ATTRIBUTE_NODE;\n_extends(Attr,Node);\n\n\nfunction CharacterData() {\n};\nCharacterData.prototype = {\n\tdata : '',\n\tsubstringData : function(offset, count) {\n\t\treturn this.data.substring(offset, offset+count);\n\t},\n\tappendData: function(text) {\n\t\ttext = this.data+text;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t},\n\tinsertData: function(offset,text) {\n\t\tthis.replaceData(offset,0,text);\n\n\t},\n\tappendChild:function(newChild){\n\t\tthrow new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])\n\t},\n\tdeleteData: function(offset, count) {\n\t\tthis.replaceData(offset,count,\"\");\n\t},\n\treplaceData: function(offset, count, text) {\n\t\tvar start = this.data.substring(0,offset);\n\t\tvar end = this.data.substring(offset+count);\n\t\ttext = start + text + end;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t}\n}\n_extends(CharacterData,Node);\nfunction Text() {\n};\nText.prototype = {\n\tnodeName : \"#text\",\n\tnodeType : TEXT_NODE,\n\tsplitText : function(offset) {\n\t\tvar text = this.data;\n\t\tvar newText = text.substring(offset);\n\t\ttext = text.substring(0, offset);\n\t\tthis.data = this.nodeValue = text;\n\t\tthis.length = text.length;\n\t\tvar newNode = this.ownerDocument.createTextNode(newText);\n\t\tif(this.parentNode){\n\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);\n\t\t}\n\t\treturn newNode;\n\t}\n}\n_extends(Text,CharacterData);\nfunction Comment() {\n};\nComment.prototype = {\n\tnodeName : \"#comment\",\n\tnodeType : COMMENT_NODE\n}\n_extends(Comment,CharacterData);\n\nfunction CDATASection() {\n};\nCDATASection.prototype = {\n\tnodeName : \"#cdata-section\",\n\tnodeType : CDATA_SECTION_NODE\n}\n_extends(CDATASection,CharacterData);\n\n\nfunction DocumentType() {\n};\nDocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;\n_extends(DocumentType,Node);\n\nfunction Notation() {\n};\nNotation.prototype.nodeType = NOTATION_NODE;\n_extends(Notation,Node);\n\nfunction Entity() {\n};\nEntity.prototype.nodeType = ENTITY_NODE;\n_extends(Entity,Node);\n\nfunction EntityReference() {\n};\nEntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;\n_extends(EntityReference,Node);\n\nfunction DocumentFragment() {\n};\nDocumentFragment.prototype.nodeName =\t\"#document-fragment\";\nDocumentFragment.prototype.nodeType =\tDOCUMENT_FRAGMENT_NODE;\n_extends(DocumentFragment,Node);\n\n\nfunction ProcessingInstruction() {\n}\nProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;\n_extends(ProcessingInstruction,Node);\nfunction XMLSerializer(){}\nXMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){\n\treturn nodeSerializeToString.call(node,isHtml,nodeFilter);\n}\nNode.prototype.toString = nodeSerializeToString;\nfunction nodeSerializeToString(isHtml,nodeFilter){\n\tvar buf = [];\n\tvar refNode = this.nodeType == 9 && this.documentElement || this;\n\tvar prefix = refNode.prefix;\n\tvar uri = refNode.namespaceURI;\n\n\tif(uri && prefix == null){\n\t\t//console.log(prefix)\n\t\tvar prefix = refNode.lookupPrefix(uri);\n\t\tif(prefix == null){\n\t\t\t//isHTML = true;\n\t\t\tvar visibleNamespaces=[\n\t\t\t{namespace:uri,prefix:null}\n\t\t\t//{namespace:uri,prefix:''}\n\t\t\t]\n\t\t}\n\t}\n\tserializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);\n\t//console.log('###',this.nodeType,uri,prefix,buf.join(''))\n\treturn buf.join('');\n}\n\nfunction needNamespaceDefine(node, isHTML, visibleNamespaces) {\n\tvar prefix = node.prefix || '';\n\tvar uri = node.namespaceURI;\n\t// According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,\n\t// and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :\n\t// > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.\n\t// in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)\n\t// and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :\n\t// > [...] Furthermore, the attribute value [...] must not be an empty string.\n\t// so serializing empty namespace value like xmlns:ds=\"\" would produce an invalid XML document.\n\tif (!uri) {\n\t\treturn false;\n\t}\n\tif (prefix === \"xml\" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {\n\t\treturn false;\n\t}\n\n\tvar i = visibleNamespaces.length\n\twhile (i--) {\n\t\tvar ns = visibleNamespaces[i];\n\t\t// get namespace prefix\n\t\tif (ns.prefix === prefix) {\n\t\t\treturn ns.namespace !== uri;\n\t\t}\n\t}\n\treturn true;\n}\n/**\n * Well-formed constraint: No < in Attribute Values\n * > The replacement text of any entity referred to directly or indirectly\n * > in an attribute value must not contain a <.\n * @see https://www.w3.org/TR/xml11/#CleanAttrVals\n * @see https://www.w3.org/TR/xml11/#NT-AttValue\n *\n * Literal whitespace other than space that appear in attribute values\n * are serialized as their entity references, so they will be preserved.\n * (In contrast to whitespace literals in the input which are normalized to spaces)\n * @see https://www.w3.org/TR/xml11/#AVNormalize\n * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes\n */\nfunction addSerializedAttribute(buf, qualifiedName, value) {\n\tbuf.push(' ', qualifiedName, '=\"', value.replace(/[<>&\"\\t\\n\\r]/g, _xmlEncoder), '\"')\n}\n\nfunction serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){\n\tif (!visibleNamespaces) {\n\t\tvisibleNamespaces = [];\n\t}\n\n\tif(nodeFilter){\n\t\tnode = nodeFilter(node);\n\t\tif(node){\n\t\t\tif(typeof node == 'string'){\n\t\t\t\tbuf.push(node);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t//buf.sort.apply(attrs, attributeSorter);\n\t}\n\n\tswitch(node.nodeType){\n\tcase ELEMENT_NODE:\n\t\tvar attrs = node.attributes;\n\t\tvar len = attrs.length;\n\t\tvar child = node.firstChild;\n\t\tvar nodeName = node.tagName;\n\n\t\tisHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML\n\n\t\tvar prefixedNodeName = nodeName\n\t\tif (!isHTML && !node.prefix && node.namespaceURI) {\n\t\t\tvar defaultNS\n\t\t\t// lookup current default ns from `xmlns` attribute\n\t\t\tfor (var ai = 0; ai < attrs.length; ai++) {\n\t\t\t\tif (attrs.item(ai).name === 'xmlns') {\n\t\t\t\t\tdefaultNS = attrs.item(ai).value\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!defaultNS) {\n\t\t\t\t// lookup current default ns in visibleNamespaces\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tdefaultNS = namespace.namespace\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (defaultNS !== node.namespaceURI) {\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tif (namespace.prefix) {\n\t\t\t\t\t\t\tprefixedNodeName = namespace.prefix + ':' + nodeName\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuf.push('<', prefixedNodeName);\n\n\t\tfor(var i=0;i');\n\t\t\t//if is cdata child node\n\t\t\tif(isHTML && /^script$/i.test(nodeName)){\n\t\t\t\twhile(child){\n\t\t\t\t\tif(child.data){\n\t\t\t\t\t\tbuf.push(child.data);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\t}\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\twhile(child){\n\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuf.push('');\n\t\t}else{\n\t\t\tbuf.push('/>');\n\t\t}\n\t\t// remove added visible namespaces\n\t\t//visibleNamespaces.length = startVisibleNamespaces;\n\t\treturn;\n\tcase DOCUMENT_NODE:\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t\treturn;\n\tcase ATTRIBUTE_NODE:\n\t\treturn addSerializedAttribute(buf, node.name, node.value);\n\tcase TEXT_NODE:\n\t\t/**\n\t\t * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,\n\t\t * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.\n\t\t * If they are needed elsewhere, they must be escaped using either numeric character references or the strings\n\t\t * `&` and `<` respectively.\n\t\t * The right angle bracket (>) may be represented using the string \" > \", and must, for compatibility,\n\t\t * be escaped using either `>` or a character reference when it appears in the string `]]>` in content,\n\t\t * when that string is not marking the end of a CDATA section.\n\t\t *\n\t\t * In the content of elements, character data is any string of characters\n\t\t * which does not contain the start-delimiter of any markup\n\t\t * and does not include the CDATA-section-close delimiter, `]]>`.\n\t\t *\n\t\t * @see https://www.w3.org/TR/xml/#NT-CharData\n\t\t * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node\n\t\t */\n\t\treturn buf.push(node.data\n\t\t\t.replace(/[<&>]/g,_xmlEncoder)\n\t\t);\n\tcase CDATA_SECTION_NODE:\n\t\treturn buf.push( '');\n\tcase COMMENT_NODE:\n\t\treturn buf.push( \"\");\n\tcase DOCUMENT_TYPE_NODE:\n\t\tvar pubid = node.publicId;\n\t\tvar sysid = node.systemId;\n\t\tbuf.push('');\n\t\t}else if(sysid && sysid!='.'){\n\t\t\tbuf.push(' SYSTEM ', sysid, '>');\n\t\t}else{\n\t\t\tvar sub = node.internalSubset;\n\t\t\tif(sub){\n\t\t\t\tbuf.push(\" [\",sub,\"]\");\n\t\t\t}\n\t\t\tbuf.push(\">\");\n\t\t}\n\t\treturn;\n\tcase PROCESSING_INSTRUCTION_NODE:\n\t\treturn buf.push( \"\");\n\tcase ENTITY_REFERENCE_NODE:\n\t\treturn buf.push( '&',node.nodeName,';');\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\tdefault:\n\t\tbuf.push('??',node.nodeName);\n\t}\n}\nfunction importNode(doc,node,deep){\n\tvar node2;\n\tswitch (node.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tnode2 = node.cloneNode(false);\n\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i',\n\tlt: '<',\n\tquot: '\"',\n});\n\n/**\n * A map of all entities that are detected in an HTML document.\n * They contain all entries from `XML_ENTITIES`.\n *\n * @see XML_ENTITIES\n * @see DOMParser.parseFromString\n * @see DOMImplementation.prototype.createHTMLDocument\n * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec\n * @see https://html.spec.whatwg.org/entities.json JSON\n * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names\n * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)\n */\nexports.HTML_ENTITIES = freeze({\n\tAacute: '\\u00C1',\n\taacute: '\\u00E1',\n\tAbreve: '\\u0102',\n\tabreve: '\\u0103',\n\tac: '\\u223E',\n\tacd: '\\u223F',\n\tacE: '\\u223E\\u0333',\n\tAcirc: '\\u00C2',\n\tacirc: '\\u00E2',\n\tacute: '\\u00B4',\n\tAcy: '\\u0410',\n\tacy: '\\u0430',\n\tAElig: '\\u00C6',\n\taelig: '\\u00E6',\n\taf: '\\u2061',\n\tAfr: '\\uD835\\uDD04',\n\tafr: '\\uD835\\uDD1E',\n\tAgrave: '\\u00C0',\n\tagrave: '\\u00E0',\n\talefsym: '\\u2135',\n\taleph: '\\u2135',\n\tAlpha: '\\u0391',\n\talpha: '\\u03B1',\n\tAmacr: '\\u0100',\n\tamacr: '\\u0101',\n\tamalg: '\\u2A3F',\n\tAMP: '\\u0026',\n\tamp: '\\u0026',\n\tAnd: '\\u2A53',\n\tand: '\\u2227',\n\tandand: '\\u2A55',\n\tandd: '\\u2A5C',\n\tandslope: '\\u2A58',\n\tandv: '\\u2A5A',\n\tang: '\\u2220',\n\tange: '\\u29A4',\n\tangle: '\\u2220',\n\tangmsd: '\\u2221',\n\tangmsdaa: '\\u29A8',\n\tangmsdab: '\\u29A9',\n\tangmsdac: '\\u29AA',\n\tangmsdad: '\\u29AB',\n\tangmsdae: '\\u29AC',\n\tangmsdaf: '\\u29AD',\n\tangmsdag: '\\u29AE',\n\tangmsdah: '\\u29AF',\n\tangrt: '\\u221F',\n\tangrtvb: '\\u22BE',\n\tangrtvbd: '\\u299D',\n\tangsph: '\\u2222',\n\tangst: '\\u00C5',\n\tangzarr: '\\u237C',\n\tAogon: '\\u0104',\n\taogon: '\\u0105',\n\tAopf: '\\uD835\\uDD38',\n\taopf: '\\uD835\\uDD52',\n\tap: '\\u2248',\n\tapacir: '\\u2A6F',\n\tapE: '\\u2A70',\n\tape: '\\u224A',\n\tapid: '\\u224B',\n\tapos: '\\u0027',\n\tApplyFunction: '\\u2061',\n\tapprox: '\\u2248',\n\tapproxeq: '\\u224A',\n\tAring: '\\u00C5',\n\taring: '\\u00E5',\n\tAscr: '\\uD835\\uDC9C',\n\tascr: '\\uD835\\uDCB6',\n\tAssign: '\\u2254',\n\tast: '\\u002A',\n\tasymp: '\\u2248',\n\tasympeq: '\\u224D',\n\tAtilde: '\\u00C3',\n\tatilde: '\\u00E3',\n\tAuml: '\\u00C4',\n\tauml: '\\u00E4',\n\tawconint: '\\u2233',\n\tawint: '\\u2A11',\n\tbackcong: '\\u224C',\n\tbackepsilon: '\\u03F6',\n\tbackprime: '\\u2035',\n\tbacksim: '\\u223D',\n\tbacksimeq: '\\u22CD',\n\tBackslash: '\\u2216',\n\tBarv: '\\u2AE7',\n\tbarvee: '\\u22BD',\n\tBarwed: '\\u2306',\n\tbarwed: '\\u2305',\n\tbarwedge: '\\u2305',\n\tbbrk: '\\u23B5',\n\tbbrktbrk: '\\u23B6',\n\tbcong: '\\u224C',\n\tBcy: '\\u0411',\n\tbcy: '\\u0431',\n\tbdquo: '\\u201E',\n\tbecaus: '\\u2235',\n\tBecause: '\\u2235',\n\tbecause: '\\u2235',\n\tbemptyv: '\\u29B0',\n\tbepsi: '\\u03F6',\n\tbernou: '\\u212C',\n\tBernoullis: '\\u212C',\n\tBeta: '\\u0392',\n\tbeta: '\\u03B2',\n\tbeth: '\\u2136',\n\tbetween: '\\u226C',\n\tBfr: '\\uD835\\uDD05',\n\tbfr: '\\uD835\\uDD1F',\n\tbigcap: '\\u22C2',\n\tbigcirc: '\\u25EF',\n\tbigcup: '\\u22C3',\n\tbigodot: '\\u2A00',\n\tbigoplus: '\\u2A01',\n\tbigotimes: '\\u2A02',\n\tbigsqcup: '\\u2A06',\n\tbigstar: '\\u2605',\n\tbigtriangledown: '\\u25BD',\n\tbigtriangleup: '\\u25B3',\n\tbiguplus: '\\u2A04',\n\tbigvee: '\\u22C1',\n\tbigwedge: '\\u22C0',\n\tbkarow: '\\u290D',\n\tblacklozenge: '\\u29EB',\n\tblacksquare: '\\u25AA',\n\tblacktriangle: '\\u25B4',\n\tblacktriangledown: '\\u25BE',\n\tblacktriangleleft: '\\u25C2',\n\tblacktriangleright: '\\u25B8',\n\tblank: '\\u2423',\n\tblk12: '\\u2592',\n\tblk14: '\\u2591',\n\tblk34: '\\u2593',\n\tblock: '\\u2588',\n\tbne: '\\u003D\\u20E5',\n\tbnequiv: '\\u2261\\u20E5',\n\tbNot: '\\u2AED',\n\tbnot: '\\u2310',\n\tBopf: '\\uD835\\uDD39',\n\tbopf: '\\uD835\\uDD53',\n\tbot: '\\u22A5',\n\tbottom: '\\u22A5',\n\tbowtie: '\\u22C8',\n\tboxbox: '\\u29C9',\n\tboxDL: '\\u2557',\n\tboxDl: '\\u2556',\n\tboxdL: '\\u2555',\n\tboxdl: '\\u2510',\n\tboxDR: '\\u2554',\n\tboxDr: '\\u2553',\n\tboxdR: '\\u2552',\n\tboxdr: '\\u250C',\n\tboxH: '\\u2550',\n\tboxh: '\\u2500',\n\tboxHD: '\\u2566',\n\tboxHd: '\\u2564',\n\tboxhD: '\\u2565',\n\tboxhd: '\\u252C',\n\tboxHU: '\\u2569',\n\tboxHu: '\\u2567',\n\tboxhU: '\\u2568',\n\tboxhu: '\\u2534',\n\tboxminus: '\\u229F',\n\tboxplus: '\\u229E',\n\tboxtimes: '\\u22A0',\n\tboxUL: '\\u255D',\n\tboxUl: '\\u255C',\n\tboxuL: '\\u255B',\n\tboxul: '\\u2518',\n\tboxUR: '\\u255A',\n\tboxUr: '\\u2559',\n\tboxuR: '\\u2558',\n\tboxur: '\\u2514',\n\tboxV: '\\u2551',\n\tboxv: '\\u2502',\n\tboxVH: '\\u256C',\n\tboxVh: '\\u256B',\n\tboxvH: '\\u256A',\n\tboxvh: '\\u253C',\n\tboxVL: '\\u2563',\n\tboxVl: '\\u2562',\n\tboxvL: '\\u2561',\n\tboxvl: '\\u2524',\n\tboxVR: '\\u2560',\n\tboxVr: '\\u255F',\n\tboxvR: '\\u255E',\n\tboxvr: '\\u251C',\n\tbprime: '\\u2035',\n\tBreve: '\\u02D8',\n\tbreve: '\\u02D8',\n\tbrvbar: '\\u00A6',\n\tBscr: '\\u212C',\n\tbscr: '\\uD835\\uDCB7',\n\tbsemi: '\\u204F',\n\tbsim: '\\u223D',\n\tbsime: '\\u22CD',\n\tbsol: '\\u005C',\n\tbsolb: '\\u29C5',\n\tbsolhsub: '\\u27C8',\n\tbull: '\\u2022',\n\tbullet: '\\u2022',\n\tbump: '\\u224E',\n\tbumpE: '\\u2AAE',\n\tbumpe: '\\u224F',\n\tBumpeq: '\\u224E',\n\tbumpeq: '\\u224F',\n\tCacute: '\\u0106',\n\tcacute: '\\u0107',\n\tCap: '\\u22D2',\n\tcap: '\\u2229',\n\tcapand: '\\u2A44',\n\tcapbrcup: '\\u2A49',\n\tcapcap: '\\u2A4B',\n\tcapcup: '\\u2A47',\n\tcapdot: '\\u2A40',\n\tCapitalDifferentialD: '\\u2145',\n\tcaps: '\\u2229\\uFE00',\n\tcaret: '\\u2041',\n\tcaron: '\\u02C7',\n\tCayleys: '\\u212D',\n\tccaps: '\\u2A4D',\n\tCcaron: '\\u010C',\n\tccaron: '\\u010D',\n\tCcedil: '\\u00C7',\n\tccedil: '\\u00E7',\n\tCcirc: '\\u0108',\n\tccirc: '\\u0109',\n\tCconint: '\\u2230',\n\tccups: '\\u2A4C',\n\tccupssm: '\\u2A50',\n\tCdot: '\\u010A',\n\tcdot: '\\u010B',\n\tcedil: '\\u00B8',\n\tCedilla: '\\u00B8',\n\tcemptyv: '\\u29B2',\n\tcent: '\\u00A2',\n\tCenterDot: '\\u00B7',\n\tcenterdot: '\\u00B7',\n\tCfr: '\\u212D',\n\tcfr: '\\uD835\\uDD20',\n\tCHcy: '\\u0427',\n\tchcy: '\\u0447',\n\tcheck: '\\u2713',\n\tcheckmark: '\\u2713',\n\tChi: '\\u03A7',\n\tchi: '\\u03C7',\n\tcir: '\\u25CB',\n\tcirc: '\\u02C6',\n\tcirceq: '\\u2257',\n\tcirclearrowleft: '\\u21BA',\n\tcirclearrowright: '\\u21BB',\n\tcircledast: '\\u229B',\n\tcircledcirc: '\\u229A',\n\tcircleddash: '\\u229D',\n\tCircleDot: '\\u2299',\n\tcircledR: '\\u00AE',\n\tcircledS: '\\u24C8',\n\tCircleMinus: '\\u2296',\n\tCirclePlus: '\\u2295',\n\tCircleTimes: '\\u2297',\n\tcirE: '\\u29C3',\n\tcire: '\\u2257',\n\tcirfnint: '\\u2A10',\n\tcirmid: '\\u2AEF',\n\tcirscir: '\\u29C2',\n\tClockwiseContourIntegral: '\\u2232',\n\tCloseCurlyDoubleQuote: '\\u201D',\n\tCloseCurlyQuote: '\\u2019',\n\tclubs: '\\u2663',\n\tclubsuit: '\\u2663',\n\tColon: '\\u2237',\n\tcolon: '\\u003A',\n\tColone: '\\u2A74',\n\tcolone: '\\u2254',\n\tcoloneq: '\\u2254',\n\tcomma: '\\u002C',\n\tcommat: '\\u0040',\n\tcomp: '\\u2201',\n\tcompfn: '\\u2218',\n\tcomplement: '\\u2201',\n\tcomplexes: '\\u2102',\n\tcong: '\\u2245',\n\tcongdot: '\\u2A6D',\n\tCongruent: '\\u2261',\n\tConint: '\\u222F',\n\tconint: '\\u222E',\n\tContourIntegral: '\\u222E',\n\tCopf: '\\u2102',\n\tcopf: '\\uD835\\uDD54',\n\tcoprod: '\\u2210',\n\tCoproduct: '\\u2210',\n\tCOPY: '\\u00A9',\n\tcopy: '\\u00A9',\n\tcopysr: '\\u2117',\n\tCounterClockwiseContourIntegral: '\\u2233',\n\tcrarr: '\\u21B5',\n\tCross: '\\u2A2F',\n\tcross: '\\u2717',\n\tCscr: '\\uD835\\uDC9E',\n\tcscr: '\\uD835\\uDCB8',\n\tcsub: '\\u2ACF',\n\tcsube: '\\u2AD1',\n\tcsup: '\\u2AD0',\n\tcsupe: '\\u2AD2',\n\tctdot: '\\u22EF',\n\tcudarrl: '\\u2938',\n\tcudarrr: '\\u2935',\n\tcuepr: '\\u22DE',\n\tcuesc: '\\u22DF',\n\tcularr: '\\u21B6',\n\tcularrp: '\\u293D',\n\tCup: '\\u22D3',\n\tcup: '\\u222A',\n\tcupbrcap: '\\u2A48',\n\tCupCap: '\\u224D',\n\tcupcap: '\\u2A46',\n\tcupcup: '\\u2A4A',\n\tcupdot: '\\u228D',\n\tcupor: '\\u2A45',\n\tcups: '\\u222A\\uFE00',\n\tcurarr: '\\u21B7',\n\tcurarrm: '\\u293C',\n\tcurlyeqprec: '\\u22DE',\n\tcurlyeqsucc: '\\u22DF',\n\tcurlyvee: '\\u22CE',\n\tcurlywedge: '\\u22CF',\n\tcurren: '\\u00A4',\n\tcurvearrowleft: '\\u21B6',\n\tcurvearrowright: '\\u21B7',\n\tcuvee: '\\u22CE',\n\tcuwed: '\\u22CF',\n\tcwconint: '\\u2232',\n\tcwint: '\\u2231',\n\tcylcty: '\\u232D',\n\tDagger: '\\u2021',\n\tdagger: '\\u2020',\n\tdaleth: '\\u2138',\n\tDarr: '\\u21A1',\n\tdArr: '\\u21D3',\n\tdarr: '\\u2193',\n\tdash: '\\u2010',\n\tDashv: '\\u2AE4',\n\tdashv: '\\u22A3',\n\tdbkarow: '\\u290F',\n\tdblac: '\\u02DD',\n\tDcaron: '\\u010E',\n\tdcaron: '\\u010F',\n\tDcy: '\\u0414',\n\tdcy: '\\u0434',\n\tDD: '\\u2145',\n\tdd: '\\u2146',\n\tddagger: '\\u2021',\n\tddarr: '\\u21CA',\n\tDDotrahd: '\\u2911',\n\tddotseq: '\\u2A77',\n\tdeg: '\\u00B0',\n\tDel: '\\u2207',\n\tDelta: '\\u0394',\n\tdelta: '\\u03B4',\n\tdemptyv: '\\u29B1',\n\tdfisht: '\\u297F',\n\tDfr: '\\uD835\\uDD07',\n\tdfr: '\\uD835\\uDD21',\n\tdHar: '\\u2965',\n\tdharl: '\\u21C3',\n\tdharr: '\\u21C2',\n\tDiacriticalAcute: '\\u00B4',\n\tDiacriticalDot: '\\u02D9',\n\tDiacriticalDoubleAcute: '\\u02DD',\n\tDiacriticalGrave: '\\u0060',\n\tDiacriticalTilde: '\\u02DC',\n\tdiam: '\\u22C4',\n\tDiamond: '\\u22C4',\n\tdiamond: '\\u22C4',\n\tdiamondsuit: '\\u2666',\n\tdiams: '\\u2666',\n\tdie: '\\u00A8',\n\tDifferentialD: '\\u2146',\n\tdigamma: '\\u03DD',\n\tdisin: '\\u22F2',\n\tdiv: '\\u00F7',\n\tdivide: '\\u00F7',\n\tdivideontimes: '\\u22C7',\n\tdivonx: '\\u22C7',\n\tDJcy: '\\u0402',\n\tdjcy: '\\u0452',\n\tdlcorn: '\\u231E',\n\tdlcrop: '\\u230D',\n\tdollar: '\\u0024',\n\tDopf: '\\uD835\\uDD3B',\n\tdopf: '\\uD835\\uDD55',\n\tDot: '\\u00A8',\n\tdot: '\\u02D9',\n\tDotDot: '\\u20DC',\n\tdoteq: '\\u2250',\n\tdoteqdot: '\\u2251',\n\tDotEqual: '\\u2250',\n\tdotminus: '\\u2238',\n\tdotplus: '\\u2214',\n\tdotsquare: '\\u22A1',\n\tdoublebarwedge: '\\u2306',\n\tDoubleContourIntegral: '\\u222F',\n\tDoubleDot: '\\u00A8',\n\tDoubleDownArrow: '\\u21D3',\n\tDoubleLeftArrow: '\\u21D0',\n\tDoubleLeftRightArrow: '\\u21D4',\n\tDoubleLeftTee: '\\u2AE4',\n\tDoubleLongLeftArrow: '\\u27F8',\n\tDoubleLongLeftRightArrow: '\\u27FA',\n\tDoubleLongRightArrow: '\\u27F9',\n\tDoubleRightArrow: '\\u21D2',\n\tDoubleRightTee: '\\u22A8',\n\tDoubleUpArrow: '\\u21D1',\n\tDoubleUpDownArrow: '\\u21D5',\n\tDoubleVerticalBar: '\\u2225',\n\tDownArrow: '\\u2193',\n\tDownarrow: '\\u21D3',\n\tdownarrow: '\\u2193',\n\tDownArrowBar: '\\u2913',\n\tDownArrowUpArrow: '\\u21F5',\n\tDownBreve: '\\u0311',\n\tdowndownarrows: '\\u21CA',\n\tdownharpoonleft: '\\u21C3',\n\tdownharpoonright: '\\u21C2',\n\tDownLeftRightVector: '\\u2950',\n\tDownLeftTeeVector: '\\u295E',\n\tDownLeftVector: '\\u21BD',\n\tDownLeftVectorBar: '\\u2956',\n\tDownRightTeeVector: '\\u295F',\n\tDownRightVector: '\\u21C1',\n\tDownRightVectorBar: '\\u2957',\n\tDownTee: '\\u22A4',\n\tDownTeeArrow: '\\u21A7',\n\tdrbkarow: '\\u2910',\n\tdrcorn: '\\u231F',\n\tdrcrop: '\\u230C',\n\tDscr: '\\uD835\\uDC9F',\n\tdscr: '\\uD835\\uDCB9',\n\tDScy: '\\u0405',\n\tdscy: '\\u0455',\n\tdsol: '\\u29F6',\n\tDstrok: '\\u0110',\n\tdstrok: '\\u0111',\n\tdtdot: '\\u22F1',\n\tdtri: '\\u25BF',\n\tdtrif: '\\u25BE',\n\tduarr: '\\u21F5',\n\tduhar: '\\u296F',\n\tdwangle: '\\u29A6',\n\tDZcy: '\\u040F',\n\tdzcy: '\\u045F',\n\tdzigrarr: '\\u27FF',\n\tEacute: '\\u00C9',\n\teacute: '\\u00E9',\n\teaster: '\\u2A6E',\n\tEcaron: '\\u011A',\n\tecaron: '\\u011B',\n\tecir: '\\u2256',\n\tEcirc: '\\u00CA',\n\tecirc: '\\u00EA',\n\tecolon: '\\u2255',\n\tEcy: '\\u042D',\n\tecy: '\\u044D',\n\teDDot: '\\u2A77',\n\tEdot: '\\u0116',\n\teDot: '\\u2251',\n\tedot: '\\u0117',\n\tee: '\\u2147',\n\tefDot: '\\u2252',\n\tEfr: '\\uD835\\uDD08',\n\tefr: '\\uD835\\uDD22',\n\teg: '\\u2A9A',\n\tEgrave: '\\u00C8',\n\tegrave: '\\u00E8',\n\tegs: '\\u2A96',\n\tegsdot: '\\u2A98',\n\tel: '\\u2A99',\n\tElement: '\\u2208',\n\telinters: '\\u23E7',\n\tell: '\\u2113',\n\tels: '\\u2A95',\n\telsdot: '\\u2A97',\n\tEmacr: '\\u0112',\n\temacr: '\\u0113',\n\tempty: '\\u2205',\n\temptyset: '\\u2205',\n\tEmptySmallSquare: '\\u25FB',\n\temptyv: '\\u2205',\n\tEmptyVerySmallSquare: '\\u25AB',\n\temsp: '\\u2003',\n\temsp13: '\\u2004',\n\temsp14: '\\u2005',\n\tENG: '\\u014A',\n\teng: '\\u014B',\n\tensp: '\\u2002',\n\tEogon: '\\u0118',\n\teogon: '\\u0119',\n\tEopf: '\\uD835\\uDD3C',\n\teopf: '\\uD835\\uDD56',\n\tepar: '\\u22D5',\n\teparsl: '\\u29E3',\n\teplus: '\\u2A71',\n\tepsi: '\\u03B5',\n\tEpsilon: '\\u0395',\n\tepsilon: '\\u03B5',\n\tepsiv: '\\u03F5',\n\teqcirc: '\\u2256',\n\teqcolon: '\\u2255',\n\teqsim: '\\u2242',\n\teqslantgtr: '\\u2A96',\n\teqslantless: '\\u2A95',\n\tEqual: '\\u2A75',\n\tequals: '\\u003D',\n\tEqualTilde: '\\u2242',\n\tequest: '\\u225F',\n\tEquilibrium: '\\u21CC',\n\tequiv: '\\u2261',\n\tequivDD: '\\u2A78',\n\teqvparsl: '\\u29E5',\n\terarr: '\\u2971',\n\terDot: '\\u2253',\n\tEscr: '\\u2130',\n\tescr: '\\u212F',\n\tesdot: '\\u2250',\n\tEsim: '\\u2A73',\n\tesim: '\\u2242',\n\tEta: '\\u0397',\n\teta: '\\u03B7',\n\tETH: '\\u00D0',\n\teth: '\\u00F0',\n\tEuml: '\\u00CB',\n\teuml: '\\u00EB',\n\teuro: '\\u20AC',\n\texcl: '\\u0021',\n\texist: '\\u2203',\n\tExists: '\\u2203',\n\texpectation: '\\u2130',\n\tExponentialE: '\\u2147',\n\texponentiale: '\\u2147',\n\tfallingdotseq: '\\u2252',\n\tFcy: '\\u0424',\n\tfcy: '\\u0444',\n\tfemale: '\\u2640',\n\tffilig: '\\uFB03',\n\tfflig: '\\uFB00',\n\tffllig: '\\uFB04',\n\tFfr: '\\uD835\\uDD09',\n\tffr: '\\uD835\\uDD23',\n\tfilig: '\\uFB01',\n\tFilledSmallSquare: '\\u25FC',\n\tFilledVerySmallSquare: '\\u25AA',\n\tfjlig: '\\u0066\\u006A',\n\tflat: '\\u266D',\n\tfllig: '\\uFB02',\n\tfltns: '\\u25B1',\n\tfnof: '\\u0192',\n\tFopf: '\\uD835\\uDD3D',\n\tfopf: '\\uD835\\uDD57',\n\tForAll: '\\u2200',\n\tforall: '\\u2200',\n\tfork: '\\u22D4',\n\tforkv: '\\u2AD9',\n\tFouriertrf: '\\u2131',\n\tfpartint: '\\u2A0D',\n\tfrac12: '\\u00BD',\n\tfrac13: '\\u2153',\n\tfrac14: '\\u00BC',\n\tfrac15: '\\u2155',\n\tfrac16: '\\u2159',\n\tfrac18: '\\u215B',\n\tfrac23: '\\u2154',\n\tfrac25: '\\u2156',\n\tfrac34: '\\u00BE',\n\tfrac35: '\\u2157',\n\tfrac38: '\\u215C',\n\tfrac45: '\\u2158',\n\tfrac56: '\\u215A',\n\tfrac58: '\\u215D',\n\tfrac78: '\\u215E',\n\tfrasl: '\\u2044',\n\tfrown: '\\u2322',\n\tFscr: '\\u2131',\n\tfscr: '\\uD835\\uDCBB',\n\tgacute: '\\u01F5',\n\tGamma: '\\u0393',\n\tgamma: '\\u03B3',\n\tGammad: '\\u03DC',\n\tgammad: '\\u03DD',\n\tgap: '\\u2A86',\n\tGbreve: '\\u011E',\n\tgbreve: '\\u011F',\n\tGcedil: '\\u0122',\n\tGcirc: '\\u011C',\n\tgcirc: '\\u011D',\n\tGcy: '\\u0413',\n\tgcy: '\\u0433',\n\tGdot: '\\u0120',\n\tgdot: '\\u0121',\n\tgE: '\\u2267',\n\tge: '\\u2265',\n\tgEl: '\\u2A8C',\n\tgel: '\\u22DB',\n\tgeq: '\\u2265',\n\tgeqq: '\\u2267',\n\tgeqslant: '\\u2A7E',\n\tges: '\\u2A7E',\n\tgescc: '\\u2AA9',\n\tgesdot: '\\u2A80',\n\tgesdoto: '\\u2A82',\n\tgesdotol: '\\u2A84',\n\tgesl: '\\u22DB\\uFE00',\n\tgesles: '\\u2A94',\n\tGfr: '\\uD835\\uDD0A',\n\tgfr: '\\uD835\\uDD24',\n\tGg: '\\u22D9',\n\tgg: '\\u226B',\n\tggg: '\\u22D9',\n\tgimel: '\\u2137',\n\tGJcy: '\\u0403',\n\tgjcy: '\\u0453',\n\tgl: '\\u2277',\n\tgla: '\\u2AA5',\n\tglE: '\\u2A92',\n\tglj: '\\u2AA4',\n\tgnap: '\\u2A8A',\n\tgnapprox: '\\u2A8A',\n\tgnE: '\\u2269',\n\tgne: '\\u2A88',\n\tgneq: '\\u2A88',\n\tgneqq: '\\u2269',\n\tgnsim: '\\u22E7',\n\tGopf: '\\uD835\\uDD3E',\n\tgopf: '\\uD835\\uDD58',\n\tgrave: '\\u0060',\n\tGreaterEqual: '\\u2265',\n\tGreaterEqualLess: '\\u22DB',\n\tGreaterFullEqual: '\\u2267',\n\tGreaterGreater: '\\u2AA2',\n\tGreaterLess: '\\u2277',\n\tGreaterSlantEqual: '\\u2A7E',\n\tGreaterTilde: '\\u2273',\n\tGscr: '\\uD835\\uDCA2',\n\tgscr: '\\u210A',\n\tgsim: '\\u2273',\n\tgsime: '\\u2A8E',\n\tgsiml: '\\u2A90',\n\tGt: '\\u226B',\n\tGT: '\\u003E',\n\tgt: '\\u003E',\n\tgtcc: '\\u2AA7',\n\tgtcir: '\\u2A7A',\n\tgtdot: '\\u22D7',\n\tgtlPar: '\\u2995',\n\tgtquest: '\\u2A7C',\n\tgtrapprox: '\\u2A86',\n\tgtrarr: '\\u2978',\n\tgtrdot: '\\u22D7',\n\tgtreqless: '\\u22DB',\n\tgtreqqless: '\\u2A8C',\n\tgtrless: '\\u2277',\n\tgtrsim: '\\u2273',\n\tgvertneqq: '\\u2269\\uFE00',\n\tgvnE: '\\u2269\\uFE00',\n\tHacek: '\\u02C7',\n\thairsp: '\\u200A',\n\thalf: '\\u00BD',\n\thamilt: '\\u210B',\n\tHARDcy: '\\u042A',\n\thardcy: '\\u044A',\n\thArr: '\\u21D4',\n\tharr: '\\u2194',\n\tharrcir: '\\u2948',\n\tharrw: '\\u21AD',\n\tHat: '\\u005E',\n\thbar: '\\u210F',\n\tHcirc: '\\u0124',\n\thcirc: '\\u0125',\n\thearts: '\\u2665',\n\theartsuit: '\\u2665',\n\thellip: '\\u2026',\n\thercon: '\\u22B9',\n\tHfr: '\\u210C',\n\thfr: '\\uD835\\uDD25',\n\tHilbertSpace: '\\u210B',\n\thksearow: '\\u2925',\n\thkswarow: '\\u2926',\n\thoarr: '\\u21FF',\n\thomtht: '\\u223B',\n\thookleftarrow: '\\u21A9',\n\thookrightarrow: '\\u21AA',\n\tHopf: '\\u210D',\n\thopf: '\\uD835\\uDD59',\n\thorbar: '\\u2015',\n\tHorizontalLine: '\\u2500',\n\tHscr: '\\u210B',\n\thscr: '\\uD835\\uDCBD',\n\thslash: '\\u210F',\n\tHstrok: '\\u0126',\n\thstrok: '\\u0127',\n\tHumpDownHump: '\\u224E',\n\tHumpEqual: '\\u224F',\n\thybull: '\\u2043',\n\thyphen: '\\u2010',\n\tIacute: '\\u00CD',\n\tiacute: '\\u00ED',\n\tic: '\\u2063',\n\tIcirc: '\\u00CE',\n\ticirc: '\\u00EE',\n\tIcy: '\\u0418',\n\ticy: '\\u0438',\n\tIdot: '\\u0130',\n\tIEcy: '\\u0415',\n\tiecy: '\\u0435',\n\tiexcl: '\\u00A1',\n\tiff: '\\u21D4',\n\tIfr: '\\u2111',\n\tifr: '\\uD835\\uDD26',\n\tIgrave: '\\u00CC',\n\tigrave: '\\u00EC',\n\tii: '\\u2148',\n\tiiiint: '\\u2A0C',\n\tiiint: '\\u222D',\n\tiinfin: '\\u29DC',\n\tiiota: '\\u2129',\n\tIJlig: '\\u0132',\n\tijlig: '\\u0133',\n\tIm: '\\u2111',\n\tImacr: '\\u012A',\n\timacr: '\\u012B',\n\timage: '\\u2111',\n\tImaginaryI: '\\u2148',\n\timagline: '\\u2110',\n\timagpart: '\\u2111',\n\timath: '\\u0131',\n\timof: '\\u22B7',\n\timped: '\\u01B5',\n\tImplies: '\\u21D2',\n\tin: '\\u2208',\n\tincare: '\\u2105',\n\tinfin: '\\u221E',\n\tinfintie: '\\u29DD',\n\tinodot: '\\u0131',\n\tInt: '\\u222C',\n\tint: '\\u222B',\n\tintcal: '\\u22BA',\n\tintegers: '\\u2124',\n\tIntegral: '\\u222B',\n\tintercal: '\\u22BA',\n\tIntersection: '\\u22C2',\n\tintlarhk: '\\u2A17',\n\tintprod: '\\u2A3C',\n\tInvisibleComma: '\\u2063',\n\tInvisibleTimes: '\\u2062',\n\tIOcy: '\\u0401',\n\tiocy: '\\u0451',\n\tIogon: '\\u012E',\n\tiogon: '\\u012F',\n\tIopf: '\\uD835\\uDD40',\n\tiopf: '\\uD835\\uDD5A',\n\tIota: '\\u0399',\n\tiota: '\\u03B9',\n\tiprod: '\\u2A3C',\n\tiquest: '\\u00BF',\n\tIscr: '\\u2110',\n\tiscr: '\\uD835\\uDCBE',\n\tisin: '\\u2208',\n\tisindot: '\\u22F5',\n\tisinE: '\\u22F9',\n\tisins: '\\u22F4',\n\tisinsv: '\\u22F3',\n\tisinv: '\\u2208',\n\tit: '\\u2062',\n\tItilde: '\\u0128',\n\titilde: '\\u0129',\n\tIukcy: '\\u0406',\n\tiukcy: '\\u0456',\n\tIuml: '\\u00CF',\n\tiuml: '\\u00EF',\n\tJcirc: '\\u0134',\n\tjcirc: '\\u0135',\n\tJcy: '\\u0419',\n\tjcy: '\\u0439',\n\tJfr: '\\uD835\\uDD0D',\n\tjfr: '\\uD835\\uDD27',\n\tjmath: '\\u0237',\n\tJopf: '\\uD835\\uDD41',\n\tjopf: '\\uD835\\uDD5B',\n\tJscr: '\\uD835\\uDCA5',\n\tjscr: '\\uD835\\uDCBF',\n\tJsercy: '\\u0408',\n\tjsercy: '\\u0458',\n\tJukcy: '\\u0404',\n\tjukcy: '\\u0454',\n\tKappa: '\\u039A',\n\tkappa: '\\u03BA',\n\tkappav: '\\u03F0',\n\tKcedil: '\\u0136',\n\tkcedil: '\\u0137',\n\tKcy: '\\u041A',\n\tkcy: '\\u043A',\n\tKfr: '\\uD835\\uDD0E',\n\tkfr: '\\uD835\\uDD28',\n\tkgreen: '\\u0138',\n\tKHcy: '\\u0425',\n\tkhcy: '\\u0445',\n\tKJcy: '\\u040C',\n\tkjcy: '\\u045C',\n\tKopf: '\\uD835\\uDD42',\n\tkopf: '\\uD835\\uDD5C',\n\tKscr: '\\uD835\\uDCA6',\n\tkscr: '\\uD835\\uDCC0',\n\tlAarr: '\\u21DA',\n\tLacute: '\\u0139',\n\tlacute: '\\u013A',\n\tlaemptyv: '\\u29B4',\n\tlagran: '\\u2112',\n\tLambda: '\\u039B',\n\tlambda: '\\u03BB',\n\tLang: '\\u27EA',\n\tlang: '\\u27E8',\n\tlangd: '\\u2991',\n\tlangle: '\\u27E8',\n\tlap: '\\u2A85',\n\tLaplacetrf: '\\u2112',\n\tlaquo: '\\u00AB',\n\tLarr: '\\u219E',\n\tlArr: '\\u21D0',\n\tlarr: '\\u2190',\n\tlarrb: '\\u21E4',\n\tlarrbfs: '\\u291F',\n\tlarrfs: '\\u291D',\n\tlarrhk: '\\u21A9',\n\tlarrlp: '\\u21AB',\n\tlarrpl: '\\u2939',\n\tlarrsim: '\\u2973',\n\tlarrtl: '\\u21A2',\n\tlat: '\\u2AAB',\n\tlAtail: '\\u291B',\n\tlatail: '\\u2919',\n\tlate: '\\u2AAD',\n\tlates: '\\u2AAD\\uFE00',\n\tlBarr: '\\u290E',\n\tlbarr: '\\u290C',\n\tlbbrk: '\\u2772',\n\tlbrace: '\\u007B',\n\tlbrack: '\\u005B',\n\tlbrke: '\\u298B',\n\tlbrksld: '\\u298F',\n\tlbrkslu: '\\u298D',\n\tLcaron: '\\u013D',\n\tlcaron: '\\u013E',\n\tLcedil: '\\u013B',\n\tlcedil: '\\u013C',\n\tlceil: '\\u2308',\n\tlcub: '\\u007B',\n\tLcy: '\\u041B',\n\tlcy: '\\u043B',\n\tldca: '\\u2936',\n\tldquo: '\\u201C',\n\tldquor: '\\u201E',\n\tldrdhar: '\\u2967',\n\tldrushar: '\\u294B',\n\tldsh: '\\u21B2',\n\tlE: '\\u2266',\n\tle: '\\u2264',\n\tLeftAngleBracket: '\\u27E8',\n\tLeftArrow: '\\u2190',\n\tLeftarrow: '\\u21D0',\n\tleftarrow: '\\u2190',\n\tLeftArrowBar: '\\u21E4',\n\tLeftArrowRightArrow: '\\u21C6',\n\tleftarrowtail: '\\u21A2',\n\tLeftCeiling: '\\u2308',\n\tLeftDoubleBracket: '\\u27E6',\n\tLeftDownTeeVector: '\\u2961',\n\tLeftDownVector: '\\u21C3',\n\tLeftDownVectorBar: '\\u2959',\n\tLeftFloor: '\\u230A',\n\tleftharpoondown: '\\u21BD',\n\tleftharpoonup: '\\u21BC',\n\tleftleftarrows: '\\u21C7',\n\tLeftRightArrow: '\\u2194',\n\tLeftrightarrow: '\\u21D4',\n\tleftrightarrow: '\\u2194',\n\tleftrightarrows: '\\u21C6',\n\tleftrightharpoons: '\\u21CB',\n\tleftrightsquigarrow: '\\u21AD',\n\tLeftRightVector: '\\u294E',\n\tLeftTee: '\\u22A3',\n\tLeftTeeArrow: '\\u21A4',\n\tLeftTeeVector: '\\u295A',\n\tleftthreetimes: '\\u22CB',\n\tLeftTriangle: '\\u22B2',\n\tLeftTriangleBar: '\\u29CF',\n\tLeftTriangleEqual: '\\u22B4',\n\tLeftUpDownVector: '\\u2951',\n\tLeftUpTeeVector: '\\u2960',\n\tLeftUpVector: '\\u21BF',\n\tLeftUpVectorBar: '\\u2958',\n\tLeftVector: '\\u21BC',\n\tLeftVectorBar: '\\u2952',\n\tlEg: '\\u2A8B',\n\tleg: '\\u22DA',\n\tleq: '\\u2264',\n\tleqq: '\\u2266',\n\tleqslant: '\\u2A7D',\n\tles: '\\u2A7D',\n\tlescc: '\\u2AA8',\n\tlesdot: '\\u2A7F',\n\tlesdoto: '\\u2A81',\n\tlesdotor: '\\u2A83',\n\tlesg: '\\u22DA\\uFE00',\n\tlesges: '\\u2A93',\n\tlessapprox: '\\u2A85',\n\tlessdot: '\\u22D6',\n\tlesseqgtr: '\\u22DA',\n\tlesseqqgtr: '\\u2A8B',\n\tLessEqualGreater: '\\u22DA',\n\tLessFullEqual: '\\u2266',\n\tLessGreater: '\\u2276',\n\tlessgtr: '\\u2276',\n\tLessLess: '\\u2AA1',\n\tlesssim: '\\u2272',\n\tLessSlantEqual: '\\u2A7D',\n\tLessTilde: '\\u2272',\n\tlfisht: '\\u297C',\n\tlfloor: '\\u230A',\n\tLfr: '\\uD835\\uDD0F',\n\tlfr: '\\uD835\\uDD29',\n\tlg: '\\u2276',\n\tlgE: '\\u2A91',\n\tlHar: '\\u2962',\n\tlhard: '\\u21BD',\n\tlharu: '\\u21BC',\n\tlharul: '\\u296A',\n\tlhblk: '\\u2584',\n\tLJcy: '\\u0409',\n\tljcy: '\\u0459',\n\tLl: '\\u22D8',\n\tll: '\\u226A',\n\tllarr: '\\u21C7',\n\tllcorner: '\\u231E',\n\tLleftarrow: '\\u21DA',\n\tllhard: '\\u296B',\n\tlltri: '\\u25FA',\n\tLmidot: '\\u013F',\n\tlmidot: '\\u0140',\n\tlmoust: '\\u23B0',\n\tlmoustache: '\\u23B0',\n\tlnap: '\\u2A89',\n\tlnapprox: '\\u2A89',\n\tlnE: '\\u2268',\n\tlne: '\\u2A87',\n\tlneq: '\\u2A87',\n\tlneqq: '\\u2268',\n\tlnsim: '\\u22E6',\n\tloang: '\\u27EC',\n\tloarr: '\\u21FD',\n\tlobrk: '\\u27E6',\n\tLongLeftArrow: '\\u27F5',\n\tLongleftarrow: '\\u27F8',\n\tlongleftarrow: '\\u27F5',\n\tLongLeftRightArrow: '\\u27F7',\n\tLongleftrightarrow: '\\u27FA',\n\tlongleftrightarrow: '\\u27F7',\n\tlongmapsto: '\\u27FC',\n\tLongRightArrow: '\\u27F6',\n\tLongrightarrow: '\\u27F9',\n\tlongrightarrow: '\\u27F6',\n\tlooparrowleft: '\\u21AB',\n\tlooparrowright: '\\u21AC',\n\tlopar: '\\u2985',\n\tLopf: '\\uD835\\uDD43',\n\tlopf: '\\uD835\\uDD5D',\n\tloplus: '\\u2A2D',\n\tlotimes: '\\u2A34',\n\tlowast: '\\u2217',\n\tlowbar: '\\u005F',\n\tLowerLeftArrow: '\\u2199',\n\tLowerRightArrow: '\\u2198',\n\tloz: '\\u25CA',\n\tlozenge: '\\u25CA',\n\tlozf: '\\u29EB',\n\tlpar: '\\u0028',\n\tlparlt: '\\u2993',\n\tlrarr: '\\u21C6',\n\tlrcorner: '\\u231F',\n\tlrhar: '\\u21CB',\n\tlrhard: '\\u296D',\n\tlrm: '\\u200E',\n\tlrtri: '\\u22BF',\n\tlsaquo: '\\u2039',\n\tLscr: '\\u2112',\n\tlscr: '\\uD835\\uDCC1',\n\tLsh: '\\u21B0',\n\tlsh: '\\u21B0',\n\tlsim: '\\u2272',\n\tlsime: '\\u2A8D',\n\tlsimg: '\\u2A8F',\n\tlsqb: '\\u005B',\n\tlsquo: '\\u2018',\n\tlsquor: '\\u201A',\n\tLstrok: '\\u0141',\n\tlstrok: '\\u0142',\n\tLt: '\\u226A',\n\tLT: '\\u003C',\n\tlt: '\\u003C',\n\tltcc: '\\u2AA6',\n\tltcir: '\\u2A79',\n\tltdot: '\\u22D6',\n\tlthree: '\\u22CB',\n\tltimes: '\\u22C9',\n\tltlarr: '\\u2976',\n\tltquest: '\\u2A7B',\n\tltri: '\\u25C3',\n\tltrie: '\\u22B4',\n\tltrif: '\\u25C2',\n\tltrPar: '\\u2996',\n\tlurdshar: '\\u294A',\n\tluruhar: '\\u2966',\n\tlvertneqq: '\\u2268\\uFE00',\n\tlvnE: '\\u2268\\uFE00',\n\tmacr: '\\u00AF',\n\tmale: '\\u2642',\n\tmalt: '\\u2720',\n\tmaltese: '\\u2720',\n\tMap: '\\u2905',\n\tmap: '\\u21A6',\n\tmapsto: '\\u21A6',\n\tmapstodown: '\\u21A7',\n\tmapstoleft: '\\u21A4',\n\tmapstoup: '\\u21A5',\n\tmarker: '\\u25AE',\n\tmcomma: '\\u2A29',\n\tMcy: '\\u041C',\n\tmcy: '\\u043C',\n\tmdash: '\\u2014',\n\tmDDot: '\\u223A',\n\tmeasuredangle: '\\u2221',\n\tMediumSpace: '\\u205F',\n\tMellintrf: '\\u2133',\n\tMfr: '\\uD835\\uDD10',\n\tmfr: '\\uD835\\uDD2A',\n\tmho: '\\u2127',\n\tmicro: '\\u00B5',\n\tmid: '\\u2223',\n\tmidast: '\\u002A',\n\tmidcir: '\\u2AF0',\n\tmiddot: '\\u00B7',\n\tminus: '\\u2212',\n\tminusb: '\\u229F',\n\tminusd: '\\u2238',\n\tminusdu: '\\u2A2A',\n\tMinusPlus: '\\u2213',\n\tmlcp: '\\u2ADB',\n\tmldr: '\\u2026',\n\tmnplus: '\\u2213',\n\tmodels: '\\u22A7',\n\tMopf: '\\uD835\\uDD44',\n\tmopf: '\\uD835\\uDD5E',\n\tmp: '\\u2213',\n\tMscr: '\\u2133',\n\tmscr: '\\uD835\\uDCC2',\n\tmstpos: '\\u223E',\n\tMu: '\\u039C',\n\tmu: '\\u03BC',\n\tmultimap: '\\u22B8',\n\tmumap: '\\u22B8',\n\tnabla: '\\u2207',\n\tNacute: '\\u0143',\n\tnacute: '\\u0144',\n\tnang: '\\u2220\\u20D2',\n\tnap: '\\u2249',\n\tnapE: '\\u2A70\\u0338',\n\tnapid: '\\u224B\\u0338',\n\tnapos: '\\u0149',\n\tnapprox: '\\u2249',\n\tnatur: '\\u266E',\n\tnatural: '\\u266E',\n\tnaturals: '\\u2115',\n\tnbsp: '\\u00A0',\n\tnbump: '\\u224E\\u0338',\n\tnbumpe: '\\u224F\\u0338',\n\tncap: '\\u2A43',\n\tNcaron: '\\u0147',\n\tncaron: '\\u0148',\n\tNcedil: '\\u0145',\n\tncedil: '\\u0146',\n\tncong: '\\u2247',\n\tncongdot: '\\u2A6D\\u0338',\n\tncup: '\\u2A42',\n\tNcy: '\\u041D',\n\tncy: '\\u043D',\n\tndash: '\\u2013',\n\tne: '\\u2260',\n\tnearhk: '\\u2924',\n\tneArr: '\\u21D7',\n\tnearr: '\\u2197',\n\tnearrow: '\\u2197',\n\tnedot: '\\u2250\\u0338',\n\tNegativeMediumSpace: '\\u200B',\n\tNegativeThickSpace: '\\u200B',\n\tNegativeThinSpace: '\\u200B',\n\tNegativeVeryThinSpace: '\\u200B',\n\tnequiv: '\\u2262',\n\tnesear: '\\u2928',\n\tnesim: '\\u2242\\u0338',\n\tNestedGreaterGreater: '\\u226B',\n\tNestedLessLess: '\\u226A',\n\tNewLine: '\\u000A',\n\tnexist: '\\u2204',\n\tnexists: '\\u2204',\n\tNfr: '\\uD835\\uDD11',\n\tnfr: '\\uD835\\uDD2B',\n\tngE: '\\u2267\\u0338',\n\tnge: '\\u2271',\n\tngeq: '\\u2271',\n\tngeqq: '\\u2267\\u0338',\n\tngeqslant: '\\u2A7E\\u0338',\n\tnges: '\\u2A7E\\u0338',\n\tnGg: '\\u22D9\\u0338',\n\tngsim: '\\u2275',\n\tnGt: '\\u226B\\u20D2',\n\tngt: '\\u226F',\n\tngtr: '\\u226F',\n\tnGtv: '\\u226B\\u0338',\n\tnhArr: '\\u21CE',\n\tnharr: '\\u21AE',\n\tnhpar: '\\u2AF2',\n\tni: '\\u220B',\n\tnis: '\\u22FC',\n\tnisd: '\\u22FA',\n\tniv: '\\u220B',\n\tNJcy: '\\u040A',\n\tnjcy: '\\u045A',\n\tnlArr: '\\u21CD',\n\tnlarr: '\\u219A',\n\tnldr: '\\u2025',\n\tnlE: '\\u2266\\u0338',\n\tnle: '\\u2270',\n\tnLeftarrow: '\\u21CD',\n\tnleftarrow: '\\u219A',\n\tnLeftrightarrow: '\\u21CE',\n\tnleftrightarrow: '\\u21AE',\n\tnleq: '\\u2270',\n\tnleqq: '\\u2266\\u0338',\n\tnleqslant: '\\u2A7D\\u0338',\n\tnles: '\\u2A7D\\u0338',\n\tnless: '\\u226E',\n\tnLl: '\\u22D8\\u0338',\n\tnlsim: '\\u2274',\n\tnLt: '\\u226A\\u20D2',\n\tnlt: '\\u226E',\n\tnltri: '\\u22EA',\n\tnltrie: '\\u22EC',\n\tnLtv: '\\u226A\\u0338',\n\tnmid: '\\u2224',\n\tNoBreak: '\\u2060',\n\tNonBreakingSpace: '\\u00A0',\n\tNopf: '\\u2115',\n\tnopf: '\\uD835\\uDD5F',\n\tNot: '\\u2AEC',\n\tnot: '\\u00AC',\n\tNotCongruent: '\\u2262',\n\tNotCupCap: '\\u226D',\n\tNotDoubleVerticalBar: '\\u2226',\n\tNotElement: '\\u2209',\n\tNotEqual: '\\u2260',\n\tNotEqualTilde: '\\u2242\\u0338',\n\tNotExists: '\\u2204',\n\tNotGreater: '\\u226F',\n\tNotGreaterEqual: '\\u2271',\n\tNotGreaterFullEqual: '\\u2267\\u0338',\n\tNotGreaterGreater: '\\u226B\\u0338',\n\tNotGreaterLess: '\\u2279',\n\tNotGreaterSlantEqual: '\\u2A7E\\u0338',\n\tNotGreaterTilde: '\\u2275',\n\tNotHumpDownHump: '\\u224E\\u0338',\n\tNotHumpEqual: '\\u224F\\u0338',\n\tnotin: '\\u2209',\n\tnotindot: '\\u22F5\\u0338',\n\tnotinE: '\\u22F9\\u0338',\n\tnotinva: '\\u2209',\n\tnotinvb: '\\u22F7',\n\tnotinvc: '\\u22F6',\n\tNotLeftTriangle: '\\u22EA',\n\tNotLeftTriangleBar: '\\u29CF\\u0338',\n\tNotLeftTriangleEqual: '\\u22EC',\n\tNotLess: '\\u226E',\n\tNotLessEqual: '\\u2270',\n\tNotLessGreater: '\\u2278',\n\tNotLessLess: '\\u226A\\u0338',\n\tNotLessSlantEqual: '\\u2A7D\\u0338',\n\tNotLessTilde: '\\u2274',\n\tNotNestedGreaterGreater: '\\u2AA2\\u0338',\n\tNotNestedLessLess: '\\u2AA1\\u0338',\n\tnotni: '\\u220C',\n\tnotniva: '\\u220C',\n\tnotnivb: '\\u22FE',\n\tnotnivc: '\\u22FD',\n\tNotPrecedes: '\\u2280',\n\tNotPrecedesEqual: '\\u2AAF\\u0338',\n\tNotPrecedesSlantEqual: '\\u22E0',\n\tNotReverseElement: '\\u220C',\n\tNotRightTriangle: '\\u22EB',\n\tNotRightTriangleBar: '\\u29D0\\u0338',\n\tNotRightTriangleEqual: '\\u22ED',\n\tNotSquareSubset: '\\u228F\\u0338',\n\tNotSquareSubsetEqual: '\\u22E2',\n\tNotSquareSuperset: '\\u2290\\u0338',\n\tNotSquareSupersetEqual: '\\u22E3',\n\tNotSubset: '\\u2282\\u20D2',\n\tNotSubsetEqual: '\\u2288',\n\tNotSucceeds: '\\u2281',\n\tNotSucceedsEqual: '\\u2AB0\\u0338',\n\tNotSucceedsSlantEqual: '\\u22E1',\n\tNotSucceedsTilde: '\\u227F\\u0338',\n\tNotSuperset: '\\u2283\\u20D2',\n\tNotSupersetEqual: '\\u2289',\n\tNotTilde: '\\u2241',\n\tNotTildeEqual: '\\u2244',\n\tNotTildeFullEqual: '\\u2247',\n\tNotTildeTilde: '\\u2249',\n\tNotVerticalBar: '\\u2224',\n\tnpar: '\\u2226',\n\tnparallel: '\\u2226',\n\tnparsl: '\\u2AFD\\u20E5',\n\tnpart: '\\u2202\\u0338',\n\tnpolint: '\\u2A14',\n\tnpr: '\\u2280',\n\tnprcue: '\\u22E0',\n\tnpre: '\\u2AAF\\u0338',\n\tnprec: '\\u2280',\n\tnpreceq: '\\u2AAF\\u0338',\n\tnrArr: '\\u21CF',\n\tnrarr: '\\u219B',\n\tnrarrc: '\\u2933\\u0338',\n\tnrarrw: '\\u219D\\u0338',\n\tnRightarrow: '\\u21CF',\n\tnrightarrow: '\\u219B',\n\tnrtri: '\\u22EB',\n\tnrtrie: '\\u22ED',\n\tnsc: '\\u2281',\n\tnsccue: '\\u22E1',\n\tnsce: '\\u2AB0\\u0338',\n\tNscr: '\\uD835\\uDCA9',\n\tnscr: '\\uD835\\uDCC3',\n\tnshortmid: '\\u2224',\n\tnshortparallel: '\\u2226',\n\tnsim: '\\u2241',\n\tnsime: '\\u2244',\n\tnsimeq: '\\u2244',\n\tnsmid: '\\u2224',\n\tnspar: '\\u2226',\n\tnsqsube: '\\u22E2',\n\tnsqsupe: '\\u22E3',\n\tnsub: '\\u2284',\n\tnsubE: '\\u2AC5\\u0338',\n\tnsube: '\\u2288',\n\tnsubset: '\\u2282\\u20D2',\n\tnsubseteq: '\\u2288',\n\tnsubseteqq: '\\u2AC5\\u0338',\n\tnsucc: '\\u2281',\n\tnsucceq: '\\u2AB0\\u0338',\n\tnsup: '\\u2285',\n\tnsupE: '\\u2AC6\\u0338',\n\tnsupe: '\\u2289',\n\tnsupset: '\\u2283\\u20D2',\n\tnsupseteq: '\\u2289',\n\tnsupseteqq: '\\u2AC6\\u0338',\n\tntgl: '\\u2279',\n\tNtilde: '\\u00D1',\n\tntilde: '\\u00F1',\n\tntlg: '\\u2278',\n\tntriangleleft: '\\u22EA',\n\tntrianglelefteq: '\\u22EC',\n\tntriangleright: '\\u22EB',\n\tntrianglerighteq: '\\u22ED',\n\tNu: '\\u039D',\n\tnu: '\\u03BD',\n\tnum: '\\u0023',\n\tnumero: '\\u2116',\n\tnumsp: '\\u2007',\n\tnvap: '\\u224D\\u20D2',\n\tnVDash: '\\u22AF',\n\tnVdash: '\\u22AE',\n\tnvDash: '\\u22AD',\n\tnvdash: '\\u22AC',\n\tnvge: '\\u2265\\u20D2',\n\tnvgt: '\\u003E\\u20D2',\n\tnvHarr: '\\u2904',\n\tnvinfin: '\\u29DE',\n\tnvlArr: '\\u2902',\n\tnvle: '\\u2264\\u20D2',\n\tnvlt: '\\u003C\\u20D2',\n\tnvltrie: '\\u22B4\\u20D2',\n\tnvrArr: '\\u2903',\n\tnvrtrie: '\\u22B5\\u20D2',\n\tnvsim: '\\u223C\\u20D2',\n\tnwarhk: '\\u2923',\n\tnwArr: '\\u21D6',\n\tnwarr: '\\u2196',\n\tnwarrow: '\\u2196',\n\tnwnear: '\\u2927',\n\tOacute: '\\u00D3',\n\toacute: '\\u00F3',\n\toast: '\\u229B',\n\tocir: '\\u229A',\n\tOcirc: '\\u00D4',\n\tocirc: '\\u00F4',\n\tOcy: '\\u041E',\n\tocy: '\\u043E',\n\todash: '\\u229D',\n\tOdblac: '\\u0150',\n\todblac: '\\u0151',\n\todiv: '\\u2A38',\n\todot: '\\u2299',\n\todsold: '\\u29BC',\n\tOElig: '\\u0152',\n\toelig: '\\u0153',\n\tofcir: '\\u29BF',\n\tOfr: '\\uD835\\uDD12',\n\tofr: '\\uD835\\uDD2C',\n\togon: '\\u02DB',\n\tOgrave: '\\u00D2',\n\tograve: '\\u00F2',\n\togt: '\\u29C1',\n\tohbar: '\\u29B5',\n\tohm: '\\u03A9',\n\toint: '\\u222E',\n\tolarr: '\\u21BA',\n\tolcir: '\\u29BE',\n\tolcross: '\\u29BB',\n\toline: '\\u203E',\n\tolt: '\\u29C0',\n\tOmacr: '\\u014C',\n\tomacr: '\\u014D',\n\tOmega: '\\u03A9',\n\tomega: '\\u03C9',\n\tOmicron: '\\u039F',\n\tomicron: '\\u03BF',\n\tomid: '\\u29B6',\n\tominus: '\\u2296',\n\tOopf: '\\uD835\\uDD46',\n\toopf: '\\uD835\\uDD60',\n\topar: '\\u29B7',\n\tOpenCurlyDoubleQuote: '\\u201C',\n\tOpenCurlyQuote: '\\u2018',\n\toperp: '\\u29B9',\n\toplus: '\\u2295',\n\tOr: '\\u2A54',\n\tor: '\\u2228',\n\torarr: '\\u21BB',\n\tord: '\\u2A5D',\n\torder: '\\u2134',\n\torderof: '\\u2134',\n\tordf: '\\u00AA',\n\tordm: '\\u00BA',\n\torigof: '\\u22B6',\n\toror: '\\u2A56',\n\torslope: '\\u2A57',\n\torv: '\\u2A5B',\n\toS: '\\u24C8',\n\tOscr: '\\uD835\\uDCAA',\n\toscr: '\\u2134',\n\tOslash: '\\u00D8',\n\toslash: '\\u00F8',\n\tosol: '\\u2298',\n\tOtilde: '\\u00D5',\n\totilde: '\\u00F5',\n\tOtimes: '\\u2A37',\n\totimes: '\\u2297',\n\totimesas: '\\u2A36',\n\tOuml: '\\u00D6',\n\touml: '\\u00F6',\n\tovbar: '\\u233D',\n\tOverBar: '\\u203E',\n\tOverBrace: '\\u23DE',\n\tOverBracket: '\\u23B4',\n\tOverParenthesis: '\\u23DC',\n\tpar: '\\u2225',\n\tpara: '\\u00B6',\n\tparallel: '\\u2225',\n\tparsim: '\\u2AF3',\n\tparsl: '\\u2AFD',\n\tpart: '\\u2202',\n\tPartialD: '\\u2202',\n\tPcy: '\\u041F',\n\tpcy: '\\u043F',\n\tpercnt: '\\u0025',\n\tperiod: '\\u002E',\n\tpermil: '\\u2030',\n\tperp: '\\u22A5',\n\tpertenk: '\\u2031',\n\tPfr: '\\uD835\\uDD13',\n\tpfr: '\\uD835\\uDD2D',\n\tPhi: '\\u03A6',\n\tphi: '\\u03C6',\n\tphiv: '\\u03D5',\n\tphmmat: '\\u2133',\n\tphone: '\\u260E',\n\tPi: '\\u03A0',\n\tpi: '\\u03C0',\n\tpitchfork: '\\u22D4',\n\tpiv: '\\u03D6',\n\tplanck: '\\u210F',\n\tplanckh: '\\u210E',\n\tplankv: '\\u210F',\n\tplus: '\\u002B',\n\tplusacir: '\\u2A23',\n\tplusb: '\\u229E',\n\tpluscir: '\\u2A22',\n\tplusdo: '\\u2214',\n\tplusdu: '\\u2A25',\n\tpluse: '\\u2A72',\n\tPlusMinus: '\\u00B1',\n\tplusmn: '\\u00B1',\n\tplussim: '\\u2A26',\n\tplustwo: '\\u2A27',\n\tpm: '\\u00B1',\n\tPoincareplane: '\\u210C',\n\tpointint: '\\u2A15',\n\tPopf: '\\u2119',\n\tpopf: '\\uD835\\uDD61',\n\tpound: '\\u00A3',\n\tPr: '\\u2ABB',\n\tpr: '\\u227A',\n\tprap: '\\u2AB7',\n\tprcue: '\\u227C',\n\tprE: '\\u2AB3',\n\tpre: '\\u2AAF',\n\tprec: '\\u227A',\n\tprecapprox: '\\u2AB7',\n\tpreccurlyeq: '\\u227C',\n\tPrecedes: '\\u227A',\n\tPrecedesEqual: '\\u2AAF',\n\tPrecedesSlantEqual: '\\u227C',\n\tPrecedesTilde: '\\u227E',\n\tpreceq: '\\u2AAF',\n\tprecnapprox: '\\u2AB9',\n\tprecneqq: '\\u2AB5',\n\tprecnsim: '\\u22E8',\n\tprecsim: '\\u227E',\n\tPrime: '\\u2033',\n\tprime: '\\u2032',\n\tprimes: '\\u2119',\n\tprnap: '\\u2AB9',\n\tprnE: '\\u2AB5',\n\tprnsim: '\\u22E8',\n\tprod: '\\u220F',\n\tProduct: '\\u220F',\n\tprofalar: '\\u232E',\n\tprofline: '\\u2312',\n\tprofsurf: '\\u2313',\n\tprop: '\\u221D',\n\tProportion: '\\u2237',\n\tProportional: '\\u221D',\n\tpropto: '\\u221D',\n\tprsim: '\\u227E',\n\tprurel: '\\u22B0',\n\tPscr: '\\uD835\\uDCAB',\n\tpscr: '\\uD835\\uDCC5',\n\tPsi: '\\u03A8',\n\tpsi: '\\u03C8',\n\tpuncsp: '\\u2008',\n\tQfr: '\\uD835\\uDD14',\n\tqfr: '\\uD835\\uDD2E',\n\tqint: '\\u2A0C',\n\tQopf: '\\u211A',\n\tqopf: '\\uD835\\uDD62',\n\tqprime: '\\u2057',\n\tQscr: '\\uD835\\uDCAC',\n\tqscr: '\\uD835\\uDCC6',\n\tquaternions: '\\u210D',\n\tquatint: '\\u2A16',\n\tquest: '\\u003F',\n\tquesteq: '\\u225F',\n\tQUOT: '\\u0022',\n\tquot: '\\u0022',\n\trAarr: '\\u21DB',\n\trace: '\\u223D\\u0331',\n\tRacute: '\\u0154',\n\tracute: '\\u0155',\n\tradic: '\\u221A',\n\traemptyv: '\\u29B3',\n\tRang: '\\u27EB',\n\trang: '\\u27E9',\n\trangd: '\\u2992',\n\trange: '\\u29A5',\n\trangle: '\\u27E9',\n\traquo: '\\u00BB',\n\tRarr: '\\u21A0',\n\trArr: '\\u21D2',\n\trarr: '\\u2192',\n\trarrap: '\\u2975',\n\trarrb: '\\u21E5',\n\trarrbfs: '\\u2920',\n\trarrc: '\\u2933',\n\trarrfs: '\\u291E',\n\trarrhk: '\\u21AA',\n\trarrlp: '\\u21AC',\n\trarrpl: '\\u2945',\n\trarrsim: '\\u2974',\n\tRarrtl: '\\u2916',\n\trarrtl: '\\u21A3',\n\trarrw: '\\u219D',\n\trAtail: '\\u291C',\n\tratail: '\\u291A',\n\tratio: '\\u2236',\n\trationals: '\\u211A',\n\tRBarr: '\\u2910',\n\trBarr: '\\u290F',\n\trbarr: '\\u290D',\n\trbbrk: '\\u2773',\n\trbrace: '\\u007D',\n\trbrack: '\\u005D',\n\trbrke: '\\u298C',\n\trbrksld: '\\u298E',\n\trbrkslu: '\\u2990',\n\tRcaron: '\\u0158',\n\trcaron: '\\u0159',\n\tRcedil: '\\u0156',\n\trcedil: '\\u0157',\n\trceil: '\\u2309',\n\trcub: '\\u007D',\n\tRcy: '\\u0420',\n\trcy: '\\u0440',\n\trdca: '\\u2937',\n\trdldhar: '\\u2969',\n\trdquo: '\\u201D',\n\trdquor: '\\u201D',\n\trdsh: '\\u21B3',\n\tRe: '\\u211C',\n\treal: '\\u211C',\n\trealine: '\\u211B',\n\trealpart: '\\u211C',\n\treals: '\\u211D',\n\trect: '\\u25AD',\n\tREG: '\\u00AE',\n\treg: '\\u00AE',\n\tReverseElement: '\\u220B',\n\tReverseEquilibrium: '\\u21CB',\n\tReverseUpEquilibrium: '\\u296F',\n\trfisht: '\\u297D',\n\trfloor: '\\u230B',\n\tRfr: '\\u211C',\n\trfr: '\\uD835\\uDD2F',\n\trHar: '\\u2964',\n\trhard: '\\u21C1',\n\trharu: '\\u21C0',\n\trharul: '\\u296C',\n\tRho: '\\u03A1',\n\trho: '\\u03C1',\n\trhov: '\\u03F1',\n\tRightAngleBracket: '\\u27E9',\n\tRightArrow: '\\u2192',\n\tRightarrow: '\\u21D2',\n\trightarrow: '\\u2192',\n\tRightArrowBar: '\\u21E5',\n\tRightArrowLeftArrow: '\\u21C4',\n\trightarrowtail: '\\u21A3',\n\tRightCeiling: '\\u2309',\n\tRightDoubleBracket: '\\u27E7',\n\tRightDownTeeVector: '\\u295D',\n\tRightDownVector: '\\u21C2',\n\tRightDownVectorBar: '\\u2955',\n\tRightFloor: '\\u230B',\n\trightharpoondown: '\\u21C1',\n\trightharpoonup: '\\u21C0',\n\trightleftarrows: '\\u21C4',\n\trightleftharpoons: '\\u21CC',\n\trightrightarrows: '\\u21C9',\n\trightsquigarrow: '\\u219D',\n\tRightTee: '\\u22A2',\n\tRightTeeArrow: '\\u21A6',\n\tRightTeeVector: '\\u295B',\n\trightthreetimes: '\\u22CC',\n\tRightTriangle: '\\u22B3',\n\tRightTriangleBar: '\\u29D0',\n\tRightTriangleEqual: '\\u22B5',\n\tRightUpDownVector: '\\u294F',\n\tRightUpTeeVector: '\\u295C',\n\tRightUpVector: '\\u21BE',\n\tRightUpVectorBar: '\\u2954',\n\tRightVector: '\\u21C0',\n\tRightVectorBar: '\\u2953',\n\tring: '\\u02DA',\n\trisingdotseq: '\\u2253',\n\trlarr: '\\u21C4',\n\trlhar: '\\u21CC',\n\trlm: '\\u200F',\n\trmoust: '\\u23B1',\n\trmoustache: '\\u23B1',\n\trnmid: '\\u2AEE',\n\troang: '\\u27ED',\n\troarr: '\\u21FE',\n\trobrk: '\\u27E7',\n\tropar: '\\u2986',\n\tRopf: '\\u211D',\n\tropf: '\\uD835\\uDD63',\n\troplus: '\\u2A2E',\n\trotimes: '\\u2A35',\n\tRoundImplies: '\\u2970',\n\trpar: '\\u0029',\n\trpargt: '\\u2994',\n\trppolint: '\\u2A12',\n\trrarr: '\\u21C9',\n\tRrightarrow: '\\u21DB',\n\trsaquo: '\\u203A',\n\tRscr: '\\u211B',\n\trscr: '\\uD835\\uDCC7',\n\tRsh: '\\u21B1',\n\trsh: '\\u21B1',\n\trsqb: '\\u005D',\n\trsquo: '\\u2019',\n\trsquor: '\\u2019',\n\trthree: '\\u22CC',\n\trtimes: '\\u22CA',\n\trtri: '\\u25B9',\n\trtrie: '\\u22B5',\n\trtrif: '\\u25B8',\n\trtriltri: '\\u29CE',\n\tRuleDelayed: '\\u29F4',\n\truluhar: '\\u2968',\n\trx: '\\u211E',\n\tSacute: '\\u015A',\n\tsacute: '\\u015B',\n\tsbquo: '\\u201A',\n\tSc: '\\u2ABC',\n\tsc: '\\u227B',\n\tscap: '\\u2AB8',\n\tScaron: '\\u0160',\n\tscaron: '\\u0161',\n\tsccue: '\\u227D',\n\tscE: '\\u2AB4',\n\tsce: '\\u2AB0',\n\tScedil: '\\u015E',\n\tscedil: '\\u015F',\n\tScirc: '\\u015C',\n\tscirc: '\\u015D',\n\tscnap: '\\u2ABA',\n\tscnE: '\\u2AB6',\n\tscnsim: '\\u22E9',\n\tscpolint: '\\u2A13',\n\tscsim: '\\u227F',\n\tScy: '\\u0421',\n\tscy: '\\u0441',\n\tsdot: '\\u22C5',\n\tsdotb: '\\u22A1',\n\tsdote: '\\u2A66',\n\tsearhk: '\\u2925',\n\tseArr: '\\u21D8',\n\tsearr: '\\u2198',\n\tsearrow: '\\u2198',\n\tsect: '\\u00A7',\n\tsemi: '\\u003B',\n\tseswar: '\\u2929',\n\tsetminus: '\\u2216',\n\tsetmn: '\\u2216',\n\tsext: '\\u2736',\n\tSfr: '\\uD835\\uDD16',\n\tsfr: '\\uD835\\uDD30',\n\tsfrown: '\\u2322',\n\tsharp: '\\u266F',\n\tSHCHcy: '\\u0429',\n\tshchcy: '\\u0449',\n\tSHcy: '\\u0428',\n\tshcy: '\\u0448',\n\tShortDownArrow: '\\u2193',\n\tShortLeftArrow: '\\u2190',\n\tshortmid: '\\u2223',\n\tshortparallel: '\\u2225',\n\tShortRightArrow: '\\u2192',\n\tShortUpArrow: '\\u2191',\n\tshy: '\\u00AD',\n\tSigma: '\\u03A3',\n\tsigma: '\\u03C3',\n\tsigmaf: '\\u03C2',\n\tsigmav: '\\u03C2',\n\tsim: '\\u223C',\n\tsimdot: '\\u2A6A',\n\tsime: '\\u2243',\n\tsimeq: '\\u2243',\n\tsimg: '\\u2A9E',\n\tsimgE: '\\u2AA0',\n\tsiml: '\\u2A9D',\n\tsimlE: '\\u2A9F',\n\tsimne: '\\u2246',\n\tsimplus: '\\u2A24',\n\tsimrarr: '\\u2972',\n\tslarr: '\\u2190',\n\tSmallCircle: '\\u2218',\n\tsmallsetminus: '\\u2216',\n\tsmashp: '\\u2A33',\n\tsmeparsl: '\\u29E4',\n\tsmid: '\\u2223',\n\tsmile: '\\u2323',\n\tsmt: '\\u2AAA',\n\tsmte: '\\u2AAC',\n\tsmtes: '\\u2AAC\\uFE00',\n\tSOFTcy: '\\u042C',\n\tsoftcy: '\\u044C',\n\tsol: '\\u002F',\n\tsolb: '\\u29C4',\n\tsolbar: '\\u233F',\n\tSopf: '\\uD835\\uDD4A',\n\tsopf: '\\uD835\\uDD64',\n\tspades: '\\u2660',\n\tspadesuit: '\\u2660',\n\tspar: '\\u2225',\n\tsqcap: '\\u2293',\n\tsqcaps: '\\u2293\\uFE00',\n\tsqcup: '\\u2294',\n\tsqcups: '\\u2294\\uFE00',\n\tSqrt: '\\u221A',\n\tsqsub: '\\u228F',\n\tsqsube: '\\u2291',\n\tsqsubset: '\\u228F',\n\tsqsubseteq: '\\u2291',\n\tsqsup: '\\u2290',\n\tsqsupe: '\\u2292',\n\tsqsupset: '\\u2290',\n\tsqsupseteq: '\\u2292',\n\tsqu: '\\u25A1',\n\tSquare: '\\u25A1',\n\tsquare: '\\u25A1',\n\tSquareIntersection: '\\u2293',\n\tSquareSubset: '\\u228F',\n\tSquareSubsetEqual: '\\u2291',\n\tSquareSuperset: '\\u2290',\n\tSquareSupersetEqual: '\\u2292',\n\tSquareUnion: '\\u2294',\n\tsquarf: '\\u25AA',\n\tsquf: '\\u25AA',\n\tsrarr: '\\u2192',\n\tSscr: '\\uD835\\uDCAE',\n\tsscr: '\\uD835\\uDCC8',\n\tssetmn: '\\u2216',\n\tssmile: '\\u2323',\n\tsstarf: '\\u22C6',\n\tStar: '\\u22C6',\n\tstar: '\\u2606',\n\tstarf: '\\u2605',\n\tstraightepsilon: '\\u03F5',\n\tstraightphi: '\\u03D5',\n\tstrns: '\\u00AF',\n\tSub: '\\u22D0',\n\tsub: '\\u2282',\n\tsubdot: '\\u2ABD',\n\tsubE: '\\u2AC5',\n\tsube: '\\u2286',\n\tsubedot: '\\u2AC3',\n\tsubmult: '\\u2AC1',\n\tsubnE: '\\u2ACB',\n\tsubne: '\\u228A',\n\tsubplus: '\\u2ABF',\n\tsubrarr: '\\u2979',\n\tSubset: '\\u22D0',\n\tsubset: '\\u2282',\n\tsubseteq: '\\u2286',\n\tsubseteqq: '\\u2AC5',\n\tSubsetEqual: '\\u2286',\n\tsubsetneq: '\\u228A',\n\tsubsetneqq: '\\u2ACB',\n\tsubsim: '\\u2AC7',\n\tsubsub: '\\u2AD5',\n\tsubsup: '\\u2AD3',\n\tsucc: '\\u227B',\n\tsuccapprox: '\\u2AB8',\n\tsucccurlyeq: '\\u227D',\n\tSucceeds: '\\u227B',\n\tSucceedsEqual: '\\u2AB0',\n\tSucceedsSlantEqual: '\\u227D',\n\tSucceedsTilde: '\\u227F',\n\tsucceq: '\\u2AB0',\n\tsuccnapprox: '\\u2ABA',\n\tsuccneqq: '\\u2AB6',\n\tsuccnsim: '\\u22E9',\n\tsuccsim: '\\u227F',\n\tSuchThat: '\\u220B',\n\tSum: '\\u2211',\n\tsum: '\\u2211',\n\tsung: '\\u266A',\n\tSup: '\\u22D1',\n\tsup: '\\u2283',\n\tsup1: '\\u00B9',\n\tsup2: '\\u00B2',\n\tsup3: '\\u00B3',\n\tsupdot: '\\u2ABE',\n\tsupdsub: '\\u2AD8',\n\tsupE: '\\u2AC6',\n\tsupe: '\\u2287',\n\tsupedot: '\\u2AC4',\n\tSuperset: '\\u2283',\n\tSupersetEqual: '\\u2287',\n\tsuphsol: '\\u27C9',\n\tsuphsub: '\\u2AD7',\n\tsuplarr: '\\u297B',\n\tsupmult: '\\u2AC2',\n\tsupnE: '\\u2ACC',\n\tsupne: '\\u228B',\n\tsupplus: '\\u2AC0',\n\tSupset: '\\u22D1',\n\tsupset: '\\u2283',\n\tsupseteq: '\\u2287',\n\tsupseteqq: '\\u2AC6',\n\tsupsetneq: '\\u228B',\n\tsupsetneqq: '\\u2ACC',\n\tsupsim: '\\u2AC8',\n\tsupsub: '\\u2AD4',\n\tsupsup: '\\u2AD6',\n\tswarhk: '\\u2926',\n\tswArr: '\\u21D9',\n\tswarr: '\\u2199',\n\tswarrow: '\\u2199',\n\tswnwar: '\\u292A',\n\tszlig: '\\u00DF',\n\tTab: '\\u0009',\n\ttarget: '\\u2316',\n\tTau: '\\u03A4',\n\ttau: '\\u03C4',\n\ttbrk: '\\u23B4',\n\tTcaron: '\\u0164',\n\ttcaron: '\\u0165',\n\tTcedil: '\\u0162',\n\ttcedil: '\\u0163',\n\tTcy: '\\u0422',\n\ttcy: '\\u0442',\n\ttdot: '\\u20DB',\n\ttelrec: '\\u2315',\n\tTfr: '\\uD835\\uDD17',\n\ttfr: '\\uD835\\uDD31',\n\tthere4: '\\u2234',\n\tTherefore: '\\u2234',\n\ttherefore: '\\u2234',\n\tTheta: '\\u0398',\n\ttheta: '\\u03B8',\n\tthetasym: '\\u03D1',\n\tthetav: '\\u03D1',\n\tthickapprox: '\\u2248',\n\tthicksim: '\\u223C',\n\tThickSpace: '\\u205F\\u200A',\n\tthinsp: '\\u2009',\n\tThinSpace: '\\u2009',\n\tthkap: '\\u2248',\n\tthksim: '\\u223C',\n\tTHORN: '\\u00DE',\n\tthorn: '\\u00FE',\n\tTilde: '\\u223C',\n\ttilde: '\\u02DC',\n\tTildeEqual: '\\u2243',\n\tTildeFullEqual: '\\u2245',\n\tTildeTilde: '\\u2248',\n\ttimes: '\\u00D7',\n\ttimesb: '\\u22A0',\n\ttimesbar: '\\u2A31',\n\ttimesd: '\\u2A30',\n\ttint: '\\u222D',\n\ttoea: '\\u2928',\n\ttop: '\\u22A4',\n\ttopbot: '\\u2336',\n\ttopcir: '\\u2AF1',\n\tTopf: '\\uD835\\uDD4B',\n\ttopf: '\\uD835\\uDD65',\n\ttopfork: '\\u2ADA',\n\ttosa: '\\u2929',\n\ttprime: '\\u2034',\n\tTRADE: '\\u2122',\n\ttrade: '\\u2122',\n\ttriangle: '\\u25B5',\n\ttriangledown: '\\u25BF',\n\ttriangleleft: '\\u25C3',\n\ttrianglelefteq: '\\u22B4',\n\ttriangleq: '\\u225C',\n\ttriangleright: '\\u25B9',\n\ttrianglerighteq: '\\u22B5',\n\ttridot: '\\u25EC',\n\ttrie: '\\u225C',\n\ttriminus: '\\u2A3A',\n\tTripleDot: '\\u20DB',\n\ttriplus: '\\u2A39',\n\ttrisb: '\\u29CD',\n\ttritime: '\\u2A3B',\n\ttrpezium: '\\u23E2',\n\tTscr: '\\uD835\\uDCAF',\n\ttscr: '\\uD835\\uDCC9',\n\tTScy: '\\u0426',\n\ttscy: '\\u0446',\n\tTSHcy: '\\u040B',\n\ttshcy: '\\u045B',\n\tTstrok: '\\u0166',\n\ttstrok: '\\u0167',\n\ttwixt: '\\u226C',\n\ttwoheadleftarrow: '\\u219E',\n\ttwoheadrightarrow: '\\u21A0',\n\tUacute: '\\u00DA',\n\tuacute: '\\u00FA',\n\tUarr: '\\u219F',\n\tuArr: '\\u21D1',\n\tuarr: '\\u2191',\n\tUarrocir: '\\u2949',\n\tUbrcy: '\\u040E',\n\tubrcy: '\\u045E',\n\tUbreve: '\\u016C',\n\tubreve: '\\u016D',\n\tUcirc: '\\u00DB',\n\tucirc: '\\u00FB',\n\tUcy: '\\u0423',\n\tucy: '\\u0443',\n\tudarr: '\\u21C5',\n\tUdblac: '\\u0170',\n\tudblac: '\\u0171',\n\tudhar: '\\u296E',\n\tufisht: '\\u297E',\n\tUfr: '\\uD835\\uDD18',\n\tufr: '\\uD835\\uDD32',\n\tUgrave: '\\u00D9',\n\tugrave: '\\u00F9',\n\tuHar: '\\u2963',\n\tuharl: '\\u21BF',\n\tuharr: '\\u21BE',\n\tuhblk: '\\u2580',\n\tulcorn: '\\u231C',\n\tulcorner: '\\u231C',\n\tulcrop: '\\u230F',\n\tultri: '\\u25F8',\n\tUmacr: '\\u016A',\n\tumacr: '\\u016B',\n\tuml: '\\u00A8',\n\tUnderBar: '\\u005F',\n\tUnderBrace: '\\u23DF',\n\tUnderBracket: '\\u23B5',\n\tUnderParenthesis: '\\u23DD',\n\tUnion: '\\u22C3',\n\tUnionPlus: '\\u228E',\n\tUogon: '\\u0172',\n\tuogon: '\\u0173',\n\tUopf: '\\uD835\\uDD4C',\n\tuopf: '\\uD835\\uDD66',\n\tUpArrow: '\\u2191',\n\tUparrow: '\\u21D1',\n\tuparrow: '\\u2191',\n\tUpArrowBar: '\\u2912',\n\tUpArrowDownArrow: '\\u21C5',\n\tUpDownArrow: '\\u2195',\n\tUpdownarrow: '\\u21D5',\n\tupdownarrow: '\\u2195',\n\tUpEquilibrium: '\\u296E',\n\tupharpoonleft: '\\u21BF',\n\tupharpoonright: '\\u21BE',\n\tuplus: '\\u228E',\n\tUpperLeftArrow: '\\u2196',\n\tUpperRightArrow: '\\u2197',\n\tUpsi: '\\u03D2',\n\tupsi: '\\u03C5',\n\tupsih: '\\u03D2',\n\tUpsilon: '\\u03A5',\n\tupsilon: '\\u03C5',\n\tUpTee: '\\u22A5',\n\tUpTeeArrow: '\\u21A5',\n\tupuparrows: '\\u21C8',\n\turcorn: '\\u231D',\n\turcorner: '\\u231D',\n\turcrop: '\\u230E',\n\tUring: '\\u016E',\n\turing: '\\u016F',\n\turtri: '\\u25F9',\n\tUscr: '\\uD835\\uDCB0',\n\tuscr: '\\uD835\\uDCCA',\n\tutdot: '\\u22F0',\n\tUtilde: '\\u0168',\n\tutilde: '\\u0169',\n\tutri: '\\u25B5',\n\tutrif: '\\u25B4',\n\tuuarr: '\\u21C8',\n\tUuml: '\\u00DC',\n\tuuml: '\\u00FC',\n\tuwangle: '\\u29A7',\n\tvangrt: '\\u299C',\n\tvarepsilon: '\\u03F5',\n\tvarkappa: '\\u03F0',\n\tvarnothing: '\\u2205',\n\tvarphi: '\\u03D5',\n\tvarpi: '\\u03D6',\n\tvarpropto: '\\u221D',\n\tvArr: '\\u21D5',\n\tvarr: '\\u2195',\n\tvarrho: '\\u03F1',\n\tvarsigma: '\\u03C2',\n\tvarsubsetneq: '\\u228A\\uFE00',\n\tvarsubsetneqq: '\\u2ACB\\uFE00',\n\tvarsupsetneq: '\\u228B\\uFE00',\n\tvarsupsetneqq: '\\u2ACC\\uFE00',\n\tvartheta: '\\u03D1',\n\tvartriangleleft: '\\u22B2',\n\tvartriangleright: '\\u22B3',\n\tVbar: '\\u2AEB',\n\tvBar: '\\u2AE8',\n\tvBarv: '\\u2AE9',\n\tVcy: '\\u0412',\n\tvcy: '\\u0432',\n\tVDash: '\\u22AB',\n\tVdash: '\\u22A9',\n\tvDash: '\\u22A8',\n\tvdash: '\\u22A2',\n\tVdashl: '\\u2AE6',\n\tVee: '\\u22C1',\n\tvee: '\\u2228',\n\tveebar: '\\u22BB',\n\tveeeq: '\\u225A',\n\tvellip: '\\u22EE',\n\tVerbar: '\\u2016',\n\tverbar: '\\u007C',\n\tVert: '\\u2016',\n\tvert: '\\u007C',\n\tVerticalBar: '\\u2223',\n\tVerticalLine: '\\u007C',\n\tVerticalSeparator: '\\u2758',\n\tVerticalTilde: '\\u2240',\n\tVeryThinSpace: '\\u200A',\n\tVfr: '\\uD835\\uDD19',\n\tvfr: '\\uD835\\uDD33',\n\tvltri: '\\u22B2',\n\tvnsub: '\\u2282\\u20D2',\n\tvnsup: '\\u2283\\u20D2',\n\tVopf: '\\uD835\\uDD4D',\n\tvopf: '\\uD835\\uDD67',\n\tvprop: '\\u221D',\n\tvrtri: '\\u22B3',\n\tVscr: '\\uD835\\uDCB1',\n\tvscr: '\\uD835\\uDCCB',\n\tvsubnE: '\\u2ACB\\uFE00',\n\tvsubne: '\\u228A\\uFE00',\n\tvsupnE: '\\u2ACC\\uFE00',\n\tvsupne: '\\u228B\\uFE00',\n\tVvdash: '\\u22AA',\n\tvzigzag: '\\u299A',\n\tWcirc: '\\u0174',\n\twcirc: '\\u0175',\n\twedbar: '\\u2A5F',\n\tWedge: '\\u22C0',\n\twedge: '\\u2227',\n\twedgeq: '\\u2259',\n\tweierp: '\\u2118',\n\tWfr: '\\uD835\\uDD1A',\n\twfr: '\\uD835\\uDD34',\n\tWopf: '\\uD835\\uDD4E',\n\twopf: '\\uD835\\uDD68',\n\twp: '\\u2118',\n\twr: '\\u2240',\n\twreath: '\\u2240',\n\tWscr: '\\uD835\\uDCB2',\n\twscr: '\\uD835\\uDCCC',\n\txcap: '\\u22C2',\n\txcirc: '\\u25EF',\n\txcup: '\\u22C3',\n\txdtri: '\\u25BD',\n\tXfr: '\\uD835\\uDD1B',\n\txfr: '\\uD835\\uDD35',\n\txhArr: '\\u27FA',\n\txharr: '\\u27F7',\n\tXi: '\\u039E',\n\txi: '\\u03BE',\n\txlArr: '\\u27F8',\n\txlarr: '\\u27F5',\n\txmap: '\\u27FC',\n\txnis: '\\u22FB',\n\txodot: '\\u2A00',\n\tXopf: '\\uD835\\uDD4F',\n\txopf: '\\uD835\\uDD69',\n\txoplus: '\\u2A01',\n\txotime: '\\u2A02',\n\txrArr: '\\u27F9',\n\txrarr: '\\u27F6',\n\tXscr: '\\uD835\\uDCB3',\n\txscr: '\\uD835\\uDCCD',\n\txsqcup: '\\u2A06',\n\txuplus: '\\u2A04',\n\txutri: '\\u25B3',\n\txvee: '\\u22C1',\n\txwedge: '\\u22C0',\n\tYacute: '\\u00DD',\n\tyacute: '\\u00FD',\n\tYAcy: '\\u042F',\n\tyacy: '\\u044F',\n\tYcirc: '\\u0176',\n\tycirc: '\\u0177',\n\tYcy: '\\u042B',\n\tycy: '\\u044B',\n\tyen: '\\u00A5',\n\tYfr: '\\uD835\\uDD1C',\n\tyfr: '\\uD835\\uDD36',\n\tYIcy: '\\u0407',\n\tyicy: '\\u0457',\n\tYopf: '\\uD835\\uDD50',\n\tyopf: '\\uD835\\uDD6A',\n\tYscr: '\\uD835\\uDCB4',\n\tyscr: '\\uD835\\uDCCE',\n\tYUcy: '\\u042E',\n\tyucy: '\\u044E',\n\tYuml: '\\u0178',\n\tyuml: '\\u00FF',\n\tZacute: '\\u0179',\n\tzacute: '\\u017A',\n\tZcaron: '\\u017D',\n\tzcaron: '\\u017E',\n\tZcy: '\\u0417',\n\tzcy: '\\u0437',\n\tZdot: '\\u017B',\n\tzdot: '\\u017C',\n\tzeetrf: '\\u2128',\n\tZeroWidthSpace: '\\u200B',\n\tZeta: '\\u0396',\n\tzeta: '\\u03B6',\n\tZfr: '\\u2128',\n\tzfr: '\\uD835\\uDD37',\n\tZHcy: '\\u0416',\n\tzhcy: '\\u0436',\n\tzigrarr: '\\u21DD',\n\tZopf: '\\u2124',\n\tzopf: '\\uD835\\uDD6B',\n\tZscr: '\\uD835\\uDCB5',\n\tzscr: '\\uD835\\uDCCF',\n\tzwj: '\\u200D',\n\tzwnj: '\\u200C',\n});\n\n/**\n * @deprecated use `HTML_ENTITIES` instead\n * @see HTML_ENTITIES\n */\nexports.entityMap = exports.HTML_ENTITIES;\n","var NAMESPACE = require(\"./conventions\").NAMESPACE;\n\n//[4] \tNameStartChar\t ::= \t\":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n//[4a] \tNameChar\t ::= \tNameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]\n//[5] \tName\t ::= \tNameStartChar (NameChar)*\nvar nameStartChar = /[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]///\\u10000-\\uEFFFF\nvar nameChar = new RegExp(\"[\\\\-\\\\.0-9\"+nameStartChar.source.slice(1,-1)+\"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]\");\nvar tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\\:'+nameStartChar.source+nameChar.source+'*)?$');\n//var tagNamePattern = /^[a-zA-Z_][\\w\\-\\.]*(?:\\:[a-zA-Z_][\\w\\-\\.]*)?$/\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\n\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\nvar S_TAG = 0;//tag name offerring\nvar S_ATTR = 1;//attr name offerring\nvar S_ATTR_SPACE=2;//attr name end and space offer\nvar S_EQ = 3;//=space?\nvar S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)\nvar S_ATTR_END = 5;//attr value end and no space(quot end)\nvar S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)\nvar S_TAG_CLOSE = 7;//closed el\n\n/**\n * Creates an error that will not be caught by XMLReader aka the SAX parser.\n *\n * @param {string} message\n * @param {any?} locator Optional, can provide details about the location in the source\n * @constructor\n */\nfunction ParseError(message, locator) {\n\tthis.message = message\n\tthis.locator = locator\n\tif(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);\n}\nParseError.prototype = new Error();\nParseError.prototype.name = ParseError.name\n\nfunction XMLReader(){\n\n}\n\nXMLReader.prototype = {\n\tparse:function(source,defaultNSMap,entityMap){\n\t\tvar domBuilder = this.domBuilder;\n\t\tdomBuilder.startDocument();\n\t\t_copy(defaultNSMap ,defaultNSMap = {})\n\t\tparse(source,defaultNSMap,entityMap,\n\t\t\t\tdomBuilder,this.errorHandler);\n\t\tdomBuilder.endDocument();\n\t}\n}\nfunction parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){\n\tfunction fixedFromCharCode(code) {\n\t\t// String.prototype.fromCharCode does not supports\n\t\t// > 2 bytes unicode chars directly\n\t\tif (code > 0xffff) {\n\t\t\tcode -= 0x10000;\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10)\n\t\t\t\t, surrogate2 = 0xdc00 + (code & 0x3ff);\n\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\n\t\t} else {\n\t\t\treturn String.fromCharCode(code);\n\t\t}\n\t}\n\tfunction entityReplacer(a){\n\t\tvar k = a.slice(1,-1);\n\t\tif (Object.hasOwnProperty.call(entityMap, k)) {\n\t\t\treturn entityMap[k];\n\t\t}else if(k.charAt(0) === '#'){\n\t\t\treturn fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))\n\t\t}else{\n\t\t\terrorHandler.error('entity not found:'+a);\n\t\t\treturn a;\n\t\t}\n\t}\n\tfunction appendText(end){//has some bugs\n\t\tif(end>start){\n\t\t\tvar xt = source.substring(start,end).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\tlocator&&position(start);\n\t\t\tdomBuilder.characters(xt,0,end-start);\n\t\t\tstart = end\n\t\t}\n\t}\n\tfunction position(p,m){\n\t\twhile(p>=lineEnd && (m = linePattern.exec(source))){\n\t\t\tlineStart = m.index;\n\t\t\tlineEnd = lineStart + m[0].length;\n\t\t\tlocator.lineNumber++;\n\t\t\t//console.log('line++:',locator,startPos,endPos)\n\t\t}\n\t\tlocator.columnNumber = p-lineStart+1;\n\t}\n\tvar lineStart = 0;\n\tvar lineEnd = 0;\n\tvar linePattern = /.*(?:\\r\\n?|\\n)|.*$/g\n\tvar locator = domBuilder.locator;\n\n\tvar parseStack = [{currentNSMap:defaultNSMapCopy}]\n\tvar closeMap = {};\n\tvar start = 0;\n\twhile(true){\n\t\ttry{\n\t\t\tvar tagStart = source.indexOf('<',start);\n\t\t\tif(tagStart<0){\n\t\t\t\tif(!source.substr(start).match(/^\\s*$/)){\n\t\t\t\t\tvar doc = domBuilder.doc;\n\t \t\t\tvar text = doc.createTextNode(source.substr(start));\n\t \t\t\tdoc.appendChild(text);\n\t \t\t\tdomBuilder.currentElement = text;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tagStart>start){\n\t\t\t\tappendText(tagStart);\n\t\t\t}\n\t\t\tswitch(source.charAt(tagStart+1)){\n\t\t\tcase '/':\n\t\t\t\tvar end = source.indexOf('>',tagStart+3);\n\t\t\t\tvar tagName = source.substring(tagStart + 2, end).replace(/[ \\t\\n\\r]+$/g, '');\n\t\t\t\tvar config = parseStack.pop();\n\t\t\t\tif(end<0){\n\n\t \t\ttagName = source.substring(tagStart+2).replace(/[\\s<].*/,'');\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' is not complete:'+config.tagName);\n\t \t\tend = tagStart+1+tagName.length;\n\t \t}else if(tagName.match(/\\s\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseInstruction(source,tagStart,domBuilder);\n\t\t\t\tbreak;\n\t\t\tcase '!':// start){\n\t\t\tstart = end;\n\t\t}else{\n\t\t\t//TODO: 这里有可能sax回退,有位置错误风险\n\t\t\tappendText(Math.max(tagStart,start)+1);\n\t\t}\n\t}\n}\nfunction copyLocator(f,t){\n\tt.lineNumber = f.lineNumber;\n\tt.columnNumber = f.columnNumber;\n\treturn t;\n}\n\n/**\n * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);\n * @return end of the elementStartPart(end of elementEndPart for selfClosed el)\n */\nfunction parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){\n\n\t/**\n\t * @param {string} qname\n\t * @param {string} value\n\t * @param {number} startIndex\n\t */\n\tfunction addAttribute(qname, value, startIndex) {\n\t\tif (el.attributeNames.hasOwnProperty(qname)) {\n\t\t\terrorHandler.fatalError('Attribute ' + qname + ' redefined')\n\t\t}\n\t\tel.addValue(\n\t\t\tqname,\n\t\t\t// @see https://www.w3.org/TR/xml/#AVNormalize\n\t\t\t// since the xmldom sax parser does not \"interpret\" DTD the following is not implemented:\n\t\t\t// - recursive replacement of (DTD) entity references\n\t\t\t// - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA\n\t\t\tvalue.replace(/[\\t\\n\\r]/g, ' ').replace(/&#?\\w+;/g, entityReplacer),\n\t\t\tstartIndex\n\t\t)\n\t}\n\tvar attrName;\n\tvar value;\n\tvar p = ++start;\n\tvar s = S_TAG;//status\n\twhile(true){\n\t\tvar c = source.charAt(p);\n\t\tswitch(c){\n\t\tcase '=':\n\t\t\tif(s === S_ATTR){//attrName\n\t\t\t\tattrName = source.slice(start,p);\n\t\t\t\ts = S_EQ;\n\t\t\t}else if(s === S_ATTR_SPACE){\n\t\t\t\ts = S_EQ;\n\t\t\t}else{\n\t\t\t\t//fatalError: equal must after attrName or space after attrName\n\t\t\t\tthrow new Error('attribute equal must after attrName'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '\\'':\n\t\tcase '\"':\n\t\t\tif(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE\n\t\t\t\t){//equal\n\t\t\t\tif(s === S_ATTR){\n\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"')\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t}\n\t\t\t\tstart = p+1;\n\t\t\t\tp = source.indexOf(c,start)\n\t\t\t\tif(p>0){\n\t\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\t\taddAttribute(attrName, value, start-1);\n\t\t\t\t\ts = S_ATTR_END;\n\t\t\t\t}else{\n\t\t\t\t\t//fatalError: no end quot match\n\t\t\t\t\tthrow new Error('attribute value no end \\''+c+'\\' match');\n\t\t\t\t}\n\t\t\t}else if(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed start quot('+c+')!!');\n\t\t\t\tstart = p+1;\n\t\t\t\ts = S_ATTR_END\n\t\t\t}else{\n\t\t\t\t//fatalError: no equal before\n\t\t\t\tthrow new Error('attribute value must after \"=\"'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\ts =S_TAG_CLOSE;\n\t\t\t\tel.closed = true;\n\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\tcase S_ATTR:\n\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tel.closed = true;\n\t\t\t\tbreak;\n\t\t\t//case S_EQ:\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"attribute invalid close char('/')\") // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ''://end document\n\t\t\terrorHandler.error('unexpected end of input');\n\t\t\tif(s == S_TAG){\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\t}\n\t\t\treturn p;\n\t\tcase '>':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\tbreak;//normal\n\t\t\tcase S_ATTR_NOQUOT_VALUE://Compatible state\n\t\t\tcase S_ATTR:\n\t\t\t\tvalue = source.slice(start,p);\n\t\t\t\tif(value.slice(-1) === '/'){\n\t\t\t\t\tel.closed = true;\n\t\t\t\t\tvalue = value.slice(0,-1)\n\t\t\t\t}\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tif(s === S_ATTR_SPACE){\n\t\t\t\t\tvalue = attrName;\n\t\t\t\t}\n\t\t\t\tif(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\t}else{\n\t\t\t\t\tif(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(value, value, start)\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase S_EQ:\n\t\t\t\tthrow new Error('attribute value missed!!');\n\t\t\t}\n//\t\t\tconsole.log(tagName,tagNamePattern,tagNamePattern.test(tagName))\n\t\t\treturn p;\n\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\n\t\tcase '\\u0080':\n\t\t\tc = ' ';\n\t\tdefault:\n\t\t\tif(c<= ' '){//space\n\t\t\t\tswitch(s){\n\t\t\t\tcase S_TAG:\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR:\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t\ts = S_ATTR_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\t\t\tvar value = source.slice(start, p);\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\t//case S_TAG_SPACE:\n\t\t\t\t//case S_EQ:\n\t\t\t\t//case S_ATTR_SPACE:\n\t\t\t\t//\tvoid();break;\n\t\t\t\t//case S_TAG_CLOSE:\n\t\t\t\t\t//ignore warning\n\t\t\t\t}\n\t\t\t}else{//not space\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\n\t\t\t\tswitch(s){\n\t\t\t\t//case S_TAG:void();break;\n\t\t\t\t//case S_ATTR:void();break;\n\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tvar tagName = el.tagName;\n\t\t\t\t\tif (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed value!! \"'+attrName+'\" instead2!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(attrName, attrName, start);\n\t\t\t\t\tstart = p;\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\terrorHandler.warning('attribute space is required\"'+attrName+'\"!!')\n\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_EQ:\n\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\n\t\t\t\t}\n\t\t\t}\n\t\t}//end outer switch\n\t\t//console.log('p++',p)\n\t\tp++;\n\t}\n}\n/**\n * @return true if has new namespace define\n */\nfunction appendElement(el,domBuilder,currentNSMap){\n\tvar tagName = el.tagName;\n\tvar localNSMap = null;\n\t//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\tvar i = el.length;\n\twhile(i--){\n\t\tvar a = el[i];\n\t\tvar qName = a.qName;\n\t\tvar value = a.value;\n\t\tvar nsp = qName.indexOf(':');\n\t\tif(nsp>0){\n\t\t\tvar prefix = a.prefix = qName.slice(0,nsp);\n\t\t\tvar localName = qName.slice(nsp+1);\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName\n\t\t}else{\n\t\t\tlocalName = qName;\n\t\t\tprefix = null\n\t\t\tnsPrefix = qName === 'xmlns' && ''\n\t\t}\n\t\t//can not set prefix,because prefix !== ''\n\t\ta.localName = localName ;\n\t\t//prefix == null for no ns prefix attribute\n\t\tif(nsPrefix !== false){//hack!!\n\t\t\tif(localNSMap == null){\n\t\t\t\tlocalNSMap = {}\n\t\t\t\t//console.log(currentNSMap,0)\n\t\t\t\t_copy(currentNSMap,currentNSMap={})\n\t\t\t\t//console.log(currentNSMap,1)\n\t\t\t}\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\n\t\t\ta.uri = NAMESPACE.XMLNS\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value)\n\t\t}\n\t}\n\tvar i = el.length;\n\twhile(i--){\n\t\ta = el[i];\n\t\tvar prefix = a.prefix;\n\t\tif(prefix){//no prefix attribute has no namespace\n\t\t\tif(prefix === 'xml'){\n\t\t\t\ta.uri = NAMESPACE.XML;\n\t\t\t}if(prefix !== 'xmlns'){\n\t\t\t\ta.uri = currentNSMap[prefix || '']\n\n\t\t\t\t//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}\n\t\t\t}\n\t\t}\n\t}\n\tvar nsp = tagName.indexOf(':');\n\tif(nsp>0){\n\t\tprefix = el.prefix = tagName.slice(0,nsp);\n\t\tlocalName = el.localName = tagName.slice(nsp+1);\n\t}else{\n\t\tprefix = null;//important!!\n\t\tlocalName = el.localName = tagName;\n\t}\n\t//no prefix element has default namespace\n\tvar ns = el.uri = currentNSMap[prefix || ''];\n\tdomBuilder.startElement(ns,localName,tagName,el);\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\n\t//localNSMap = null\n\tif(el.closed){\n\t\tdomBuilder.endElement(ns,localName,tagName);\n\t\tif(localNSMap){\n\t\t\tfor (prefix in localNSMap) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {\n\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}else{\n\t\tel.currentNSMap = currentNSMap;\n\t\tel.localNSMap = localNSMap;\n\t\t//parseStack.push(el);\n\t\treturn true;\n\t}\n}\nfunction parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){\n\tif(/^(?:script|textarea)$/i.test(tagName)){\n\t\tvar elEndStart = source.indexOf('',elStartEnd);\n\t\tvar text = source.substring(elStartEnd+1,elEndStart);\n\t\tif(/[&<]/.test(text)){\n\t\t\tif(/^script$/i.test(tagName)){\n\t\t\t\t//if(!/\\]\\]>/.test(text)){\n\t\t\t\t\t//lexHandler.startCDATA();\n\t\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\t\t//lexHandler.endCDATA();\n\t\t\t\t\treturn elEndStart;\n\t\t\t\t//}\n\t\t\t}//}else{//text area\n\t\t\t\ttext = text.replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\treturn elEndStart;\n\t\t\t//}\n\n\t\t}\n\t}\n\treturn elStartEnd+1;\n}\nfunction fixSelfClosed(source,elStartEnd,tagName,closeMap){\n\t//if(tagName in closeMap){\n\tvar pos = closeMap[tagName];\n\tif(pos == null){\n\t\t//console.log(tagName)\n\t\tpos = source.lastIndexOf('')\n\t\tif(pos',start+4);\n\t\t\t//append comment source.substring(4,end)//